he wei
2024-01-10 a35e7553955200c03da6c4baa62fd60c7d0dadc6
U 测控模拟值的初始值问题
3个文件已修改
48 ■■■■■ 已修改文件
src/views/hrControl/components/card.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrControl/components/cardBatt.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/components/card.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrControl/components/card.vue
@@ -15,8 +15,20 @@
      </div>
      <div class="row">
        模拟:
        <el-select class="input" v-if="isSelect" :disabled="setFlag" v-model="num" size="mini">
          <el-option v-for="(item, idx) in selectOptions" :key="'select_' + idx" :label="item.label" :value="idx"> </el-option>
        <el-select
          class="input"
          v-if="isSelect"
          :disabled="setFlag"
          v-model="num"
          size="mini"
        >
          <el-option
            v-for="(item, idx) in selectOptions"
            :key="'select_' + idx"
            :label="item.label"
            :value="idx"
          >
          </el-option>
        </el-select>
        <el-input-number
          v-else
@@ -95,10 +107,10 @@
    },
  },
  watch: {
    datas() {
      // if (this.setFlag) {
      // }
      this.num = this.datas[this.option.key1];
    datas(n, o) {
      if (o.isEmpty && !n.isEmpty) {
        this.num = this.datas[this.option.key1];
      }
    },
    checked(n) {
      this.checked1 = n;
src/views/hrControl/components/cardBatt.vue
@@ -81,12 +81,15 @@
    },
  },
  watch: {
    datas() {
      // if (this.setFlag) {
      // }
      let { datas, option } = this;
      let monData = datas.filter((v) => v.monNum == option.monNum)[0];
      this.num = monData[option.key1];
    datas(n, o) {
      if (!this.updateFlag && n.length) {
        // console.log(o.length, n.length);
        let { datas, option } = this;
        let monData = datas.filter((v) => v.monNum == option.monNum)[0];
        this.num = monData[option.key1];
        // 只更新num 一次
        this.updateFlag = true;
      }
    },
    checked(n) {
      this.checked1 = n;
@@ -97,6 +100,7 @@
      checked1: this.checked,
      // checked: false,
      num: 0,
      updateFlag: false,
    };
  },
  components: {
@@ -138,7 +142,7 @@
            value: flag ? num : undefined,
            st: flag,
            monNum,
            battIndex: 0
            battIndex: 0,
          });
          updateMon(params)
            .then((res) => {
src/views/powerCabinetControl/components/card.vue
@@ -79,9 +79,9 @@
  },
  watch: {
    datas(n, o) {
      // if (this.setFlag) {
      // }
      this.num = this.datas[this.option.key1];
      if (o.isEmpty && !n.isEmpty) {
        this.num = this.datas[this.option.key1];
      }
    },
    checked(n) {
      this.checked1 = n;