he wei
2024-11-13 0936c4ce40a4307ff965a3469685d49323a9e606
src/views/test/index.vue
@@ -49,6 +49,19 @@
  return _list.filter((v) => v.devId == currentDevId.value)[0] || {};
});
// 是否可以修改均衡仪电池组数
const canChangeBattCount = computed(() => {
  // !currentDev.state[0].isTesting && !currentDev.state[1].isTesting
  if (1 == devType.value || !currentDev.value.state) {
    return false;
  }
  if (onlyOneGroup.value) {
    return !currentDev.value.state[0].isTesting;
  } else {
    return !currentDev.value.state[0].isTesting && !currentDev.value.state[1].isTesting;
  }
});
const testMode = computed(() => {
  if (1 == devType.value) {
    return ["--", "放电测试", "充电测试"][currentDev.value.state?.testType];
@@ -59,7 +72,7 @@
        ? states[currentDev.value.state[v].workMode] || "--"
        : "--"
    );
    return `组1:${res1}, 组2: ${res2}`;
    return onlyOneGroup.value ? `组1:${res1}` : `组1:${res1}, 组2: ${res2}`;
  }
});
@@ -76,7 +89,7 @@
        ? currentDev.value.state[v].moduleStatus || "--"
        : "--"
    );
    return `组1:${res1}, 组2: ${res2}`;
    return onlyOneGroup.value ? `组1:${res1}` : `组1:${res1}, 组2: ${res2}`;
  }
});
@@ -133,12 +146,13 @@
}
function chooseDev(params) {
  // console.log('params', params, '=============');
  currentDevId.value = params.devId;
}
function setBattCount() {
  jhyBattCountVisible.value = true;
  console.log("cur", currentDev, "=============");
  // console.log("cur", currentDev, "=============");
}
/**
@@ -151,7 +165,7 @@
}
function pauseYtj(type) {
  console.log("currentDev", currentDev, "=============");
  // console.log("currentDev", currentDev, "=============");
  if (!currentDev.value.devId) {
    return false;
  }
@@ -272,7 +286,7 @@
            size="small"
            :disabled="!currentDev.devOnline"
            class="btn-start btn-grp1"
            v-if="!currentDev.state[0].isTesting"
            v-if="canChangeBattCount"
            @click="setBattCount"
            >设置组数</el-button
          >
@@ -285,13 +299,13 @@
            >启动组1</el-button
          >
          <template v-else>
            <el-button
            <!-- <el-button
              size="small"
              :disabled="!currentDev.devOnline"
              class="btn-start btn-grp1"
              @click="test(true, 0)"
              >修改组1参数</el-button
            >
            > -->
            <el-button
              size="small"
              :disabled="!currentDev.devOnline"
@@ -644,10 +658,10 @@
          text-align: center;
          background: #02a7f0;
          &.max {
            background: #d9001b;
            background: #438D29;
          }
          &.min {
            background: #f59a23;
            background: #DBD608;
          }
        }
      }
@@ -681,10 +695,10 @@
          text-align: center;
          background: #02a7f0;
          &.max {
            background: #d9001b;
            background: #438D29;
          }
          &.min {
            background: #f59a23;
            background: #DBD608;
          }
        }
      }
@@ -716,10 +730,10 @@
              padding: 2px 10px;
              border-radius: 6px;
              &.max {
                background: #d9001b;
                background: #438D29;
              }
              &.min {
                background: #f59a23;
                background: #DBD608;
              }
            }
          }