ZengTao
2023-09-18 36298f8ee1b0607960dfa33792854320b80850e6
主界面添加操作时必须输入密码
6个文件已修改
122 ■■■■ 已修改文件
CanadaMes-ui/src/api/home.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/home.js
@@ -91,3 +91,12 @@
    })
}
export function SelectPassword() {
    return request({
        url: '/home/SelectPassword',
        method: 'get',
        data :""
    })
}
CanadaMes-ui/src/lang/locales/en-US.json
@@ -274,6 +274,8 @@
  "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
  "prompt":"prompt",
  "Yes":"Yes",
  "No":"No"
  "No":"No",
  "Please enter the password":"Please enter the password",
  "Password error":"Password error"
}
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -278,5 +278,7 @@
  "alarmid": "id",
  "alacontent": "报警内容",
  "time-on": "开始时间",
  "End-Time": "结束时间"
  "End-Time": "结束时间",
  "Please enter the password":"请输入密码",
  "Password error":"密码错误"
}
CanadaMes-ui/src/views/home/index.vue
@@ -177,7 +177,7 @@
    }
}
.el-dialog{
.el-dialog {
    width: 80%;
}
</style>
@@ -265,7 +265,9 @@
                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index + Math.abs(item['cage'] - 5) * 6.8 + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div class="blue gezi" :style="{display:flex,position: absolute,float:left,top: 105 +'px',left: 1050 +'px',height: loadglassheight+'px',width: 5+'px'}"></div>
                <div class="blue gezi"
                    :style="{ display: flex, position: absolute, float: left, top: 105 + 'px', left: 1050 + 'px', height: loadglassheight + 'px', width: 5 + 'px' }">
                </div>
                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
                <div class="blocks-img" :style="{ left: car2 + 'px', top: '175px' }"></div>
                <div class="blocks-img2"></div>
@@ -367,7 +369,7 @@
</template>
<script>
import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist } from "../../api/home";
import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword } from "../../api/home";
import LanguageMixin from '../../lang/LanguageMixin'
@@ -376,6 +378,7 @@
    name: "Home",
    data() {
        return {
            name: 'Confirm',
            mixins: [LanguageMixin],
            dialogFormVisible: false,
            dialogFormVisible1: false,
@@ -411,7 +414,8 @@
            cageinfo: [],
            cage: 0,
            carlist: [],
            loadglassheight:0
            loadglassheight: 0,
            password: 1
        };
    },
    created() {
@@ -457,7 +461,7 @@
                    this.tasklist1 = obj.tasklist1[0];
                    this.tasklist2 = obj.tasklist2[0];
                    this.alarm = obj.alarmmg[0];
                    this.loadglassheight=obj.loadglassheight;
                    this.loadglassheight = obj.loadglassheight;
                    SelectCageInfo(this.cage).then(res => {
                        this.cageinfo = res.data.cageinfo;
                    });
@@ -506,6 +510,9 @@
            Loadcarlist().then(res => {
                this.carlist = res.data.carlist;
                console.log(this.carlist);
            });
            SelectPassword().then(res => {
                this.password = res.data.password;
            });
        },
        //根据格子状态修改颜色
@@ -590,16 +597,22 @@
            this.form1 = {};
        },
        endtask(type, glassid, cell) {
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                inputType: 'password',
                inputPlaceholder: this.$t('Please enter the password'),
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                UpdateTask(type, glassid, cell).then(res => {
                    if (res.data.message3 == 200) {
                        this.$message.success(this.$t('Operation successful'));
                    }
                });
            }).then(({ value }) => {
                if (this.password == value) {
                    UpdateTask(type, glassid, cell).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                    });
                } else {
                    this.$message.success(this.$t('Password error'));//密码错误
                }
            }).catch(() => {
                this.$message({
                    type: 'info',
@@ -616,20 +629,27 @@
            });
        },
        deleteglass(glassid, state) {
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                inputType: 'password',
                inputPlaceholder: this.$t('Please enter the password'),
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                if (state == 1) {
                    DeleteByGlassID(glassid).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                    });
            }).then(({ value }) => {
                if (this.password == value) {
                    if (state == 1) {
                        DeleteByGlassID(glassid).then(res => {
                            if (res.data.message3 == 200) {
                                this.$message.success(this.$t('Operation successful'));
                            }
                        });
                    } else {
                        this.$message.success(this.$t('No delete allowed'));
                    }
                } else {
                    this.$message.success(this.$t('No delete allowed'));
                    this.$message.success(this.$t('Password error'));//密码错误
                }
            }).catch(() => {
                this.$message({
                    type: 'info',
@@ -638,22 +658,28 @@
            });
        },
        outglass(glassid, state) {
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                inputType: 'password',
                inputPlaceholder: this.$t('Please enter the password'),
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                if (state == 1) {
                    OutByGlassID(glassid).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                        else if (res.data.message2 == 300) {
                            this.$message.success(this.$t('There is no such grid'));
                        }
                    });
            }).then(({ value }) => {
                if (this.password == value) {
                    if (state == 1) {
                        OutByGlassID(glassid).then(res => {
                            if (res.data.message3 == 200) {
                                this.$message.success(this.$t('Operation successful'));
                            }
                            else if (res.data.message2 == 300) {
                                this.$message.success(this.$t('There is no such grid'));
                            }
                        });
                    } else {
                        this.$message.success(this.$t('No out allowed'));
                    }
                } else {
                    this.$message.success(this.$t('No out allowed'));
                    this.$message.success(this.$t('Password error'));//密码错误
                }
            }).catch(() => {
                this.$message({
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -151,4 +151,14 @@
        map.put("carlist", carlist);
        return Result.success(map);
    }
    @GetMapping("/SelectPassword")
    public Result SelectPassword() {
        String pwdct = homeMapper.SelectPassword();
        Map<String, Object> map = new HashMap<>();
        map.put("password", pwdct);
        return Result.success(map);
    }
}
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -76,4 +76,7 @@
  @Select("select * from car_position")
  List<CarPosition> Loadcarlist();
  @Select("select dianqimima from user where id=1")
  String SelectPassword();
}