he wei
2024-04-12 d5b9b80a05c4e9111034464ccd1ab7b6e5bde72f
U 添加监控管理模式 手动/自动
2个文件已修改
44 ■■■■ 已修改文件
src/views/powerCabinetControl/components/card-module.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/index.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/components/card-module.vue
@@ -65,6 +65,10 @@
      type: Boolean,
      default: true,
    },
    notice: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    title() {
@@ -79,7 +83,7 @@
        option: { key_r, index, option },
      } = this;
      // 通过index获得它在flag数组中的index
      if (index!=undefined) {
      if (index != undefined) {
        let propIdx = Math.floor(index / 25);
        let prop_key_r = key_r[propIdx];
        let _key_r = datas[prop_key_r];
@@ -155,6 +159,14 @@
          setModeControl(params)
            .then((res) => {
              let { code, data, msg } = res.data;
              if (code && data && this.notice) {
                this.$notify({
                  title: "注意",
                  message:
                    "监控管理模式已被置为'手动'模式, 若需要切换需要手动操作",
                  type: "warning",
                });
              }
              this.$layer.close(loading);
              this.$message(msg);
            })
src/views/powerCabinetControl/index.vue
@@ -259,6 +259,7 @@
              >
                <template v-slot="{ data, index }">
                  <card-module
                    notice
                    :ref="'module_states_' + index"
                    :option="data[index]"
                    :datas="rtData"
@@ -317,10 +318,17 @@
const other_control = [
  {
    label: "系统均浮充状态",
    key_r: 'junFloatStateReal',
    key_w: 'battChrstate',
    flag: 'battChrstateFlag',
    key_r: "junFloatStateReal",
    key_w: "battChrstate",
    flag: "battChrstateFlag",
    option: ["浮充", "均充"],
  },
  {
    label: "监控管理模式",
    key_r: "monitorMode",
    key_w: "monitorMode",
    flag: "monitorModeFlag",
    option: ["自动", "手动"],
  },
  // {
  //   label: "电池组测试",
@@ -680,6 +688,10 @@
          setModeControl(params)
            .then((res) => {
              let { code, data, msg } = res.data;
              if (code && data) {
                // 提示用户需要手动切换状态
                this.showNotice();
              }
              this.$layer.close(loading);
              this.$message(msg);
            })
@@ -689,6 +701,13 @@
            });
        })
        .catch(() => {});
    },
    showNotice() {
      this.$notify({
        title: "注意",
        message: "监控管理模式已被置为'手动'模式, 若需要切换需要手动操作",
        type: 'warning'
      });
    },
    batchModule(state) {
      let title = "是否批量修改模块开关机状态";
@@ -733,7 +752,7 @@
            let propIdx = Math.floor(index / 25);
            let prop_key_w = key_w[propIdx];
            let prop_flag = flag[propIdx];
            params[prop_key_w] = setBitAtPositions(
              0,
              v.indexs.map((vv) => vv % 25),
@@ -749,6 +768,9 @@
          setModeControl(params)
            .then((res) => {
              let { code, data, msg } = res.data;
              if (code && data) {
                this.showNotice();
              }
              this.$layer.close(loading);
              this.$message(msg);
            })