longyvfengyun
2024-04-11 1c17f0b50ea7d85bcbaaafff74d128b3c556b123
重启设备添加人脸识别
2个文件已修改
98 ■■■■■ 已修改文件
src/assets/js/config.module.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/realTime.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/config.module.js
@@ -8,12 +8,22 @@
  uKey: {
    label: 'uKey',
    des: "用户需要通过插入uKey才可以登录",
    value: false,
    value: true,
  },
  face: {
    label: "人脸识别",
    des: "用户可以直接通过人脸识别登录",
    value: false
    value: true,    // 开启这个同时需要询问运维人员,需要不需要开启动放电和重启的人脸
  },
  dischargeByFace: {
    label: '启动放电添加人脸识别',
    des: '启动充放电测试使用人脸识别',
    value: true
  },
  restartDevByFace: {
    label: '重启设备添加人脸识别',
    des: '开启后重启设备时需要进行人脸识别',
    value: true
  },
  autograph: {
    label: '签名',
@@ -23,12 +33,7 @@
  changeIp: {
    label: '远程修改IP',
    des: '电池信息配置中点击编辑可以远程修改ip',
    value: false,
  },
  dischargeByFace: {
    label: '启动放电添加人脸识别',
    des: '启动充放电测试使用人脸识别',
    value: false
    value: true,
  },
  copyRight: {
    label: '版权声明',
src/views/dataTest/realTime.vue
@@ -1135,6 +1135,22 @@
      :modal-append-to-body="false">
      <regular-test-res-params v-if="regularTestResInfo.visible" :batt="batt" :visible.sync="regularTestResInfo.visible"></regular-test-res-params>
    </el-dialog>
    <!--  重启设备使用人脸识别  -->
    <el-dialog
      title="人脸校验"
      width="480px"
      :visible.sync="restartFaceShow"
      :close-on-click-modal="false"
      top="0"
      :modal="false"
      class="dialog-center"
      :modal-append-to-body="false"
      :destroy-on-close="true">
      <check-face
        v-if="restartFaceShow"
        @checkSuccess="restartFaceSuccess"
      ></check-face>
    </el-dialog>
  </flex-layout>
</template>
@@ -1219,6 +1235,7 @@
import getItemByKey from "@/assets/js/tools/getItemByKey";
import const_9612 from "@/assets/js/const/const_9612";
import RegularTestResParams from "@/views/dataTest/components/RegularTestResParams.vue";
import CheckFace from "@/components/checkFace.vue";
const WSMixin = createWs("RealTime");
@@ -1239,6 +1256,7 @@
  name: "movingRingSysteRrealTime",
  mixins: [WSMixin],
  components: {
    CheckFace,
    RegularTestResParams,
    BattGroupAlarm9612,
    BattGroupAlarm,
@@ -1307,6 +1325,7 @@
    );
    let pageConfig = this.$store.getters["user/realTabsConfig"];
    return {
      restartFaceShow: false,
      regularTestResInfo: {
        visible: false,
      },
@@ -3777,36 +3796,42 @@
      this.dischargeDialog.show = false;
    },
    restartSystem() {
      let self = this;
      let batt = this.batt;
      let resetPwd = "restart123456";
      this.$prompt("请输入重启密码", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        inputType: "password",
      })
        .then(({ value }) => {
      if(sysConfig.restartDevByFace.value) {
        this.restartFaceShow = true;
      }else {
        let resetPwd = "restart123456";
        this.$prompt("请输入重启密码", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          inputType: "password",
        }).then(({ value }) => {
          if (value == resetPwd) {
            let loading = this.$layer.loading();
            restart({
              devId: batt.fbsdeviceId,
              opCmd: 16,
            })
              .then((res) => {
                res = res.data;
                if (res.code && res.data) {
                  this.$alert("发送重启命令成功", "系统提示");
                } else {
                  this.$alert("发送重启命令失败!", "系统提示");
                }
                this.$layer.close(loading);
              })
              .catch((error) => {});
            this.restartSystemReq();
          } else {
            this.$layer.msg("密码不正确");
          }
        })
        .catch(() => {});
        }).catch(() => {});
      }
    },
    restartFaceSuccess() {
      this.restartFaceShow = false;
      this.restartSystemReq();
    },
    restartSystemReq() {
      let loading = this.$layer.loading();
      let batt = this.batt;
      restart({
        devId: batt.fbsdeviceId,
        opCmd: 16,
      }).then((res) => {
        res = res.data;
        if (res.code && res.data) {
          this.$alert("发送重启命令成功", "系统提示");
        } else {
          this.$alert("发送重启命令失败!", "系统提示");
        }
        this.$layer.close(loading);
      }).catch((error) => {});
    },
    getLastCapacityTest(res) {
      if (res) {