he wei
2024-11-13 0936c4ce40a4307ff965a3469685d49323a9e606
src/views/test/index.vue
@@ -39,10 +39,6 @@
  return currentDev.value.state[0].batteryCount == 1;
});
// 正在测试中 获取测试类型 是充电还是放电
const currentType = computed(() => {
  return currentDev.state?.testType || 1;
});
const resList = computed(() => {
  let _list = list.value[devType.value];
@@ -51,6 +47,19 @@
const currentDev = computed(() => {
  let _list = list.value[devType.value];
  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(() => {
@@ -63,7 +72,7 @@
        ? states[currentDev.value.state[v].workMode] || "--"
        : "--"
    );
    return `组1:${res1}, 组2: ${res2}`;
    return onlyOneGroup.value ? `组1:${res1}` : `组1:${res1}, 组2: ${res2}`;
  }
});
@@ -80,7 +89,7 @@
        ? currentDev.value.state[v].moduleStatus || "--"
        : "--"
    );
    return `组1:${res1}, 组2: ${res2}`;
    return onlyOneGroup.value ? `组1:${res1}` : `组1:${res1}, 组2: ${res2}`;
  }
});
@@ -137,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, "=============");
}
/**
@@ -155,7 +165,7 @@
}
function pauseYtj(type) {
  console.log("currentDev", currentDev, "=============");
  // console.log("currentDev", currentDev, "=============");
  if (!currentDev.value.devId) {
    return false;
  }
@@ -202,7 +212,7 @@
          size="default"
          is-button
        >
          <el-radio-button :value="1">充放电一体机</el-radio-button>
          <el-radio-button :value="1">充放电测试仪</el-radio-button>
          <el-radio-button :value="2">均衡测试仪</el-radio-button>
        </el-radio-group>
      </div>
@@ -276,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
          >
@@ -289,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"
@@ -367,7 +377,7 @@
        <div class="value">{{ currentDev.devModel }}</div>
        <div class="label">设备类型</div>
        <div class="value">
          {{ { 1: "充放电一体机", 2: "均衡测试仪" }[currentDev.devType] }}
          {{ { 1: "充放电测试仪", 2: "均衡测试仪" }[currentDev.devType] }}
        </div>
        <div class="label">设备编号</div>
        <div class="value">{{ currentDev.devIdcode }}</div>
@@ -407,22 +417,20 @@
      width="700px"
      center
    >
      <template v-if="1 == devType">
      <template v-if="testVisible && 1 == devType">
        <param-content
          v-model="testVisible"
          v-if="testVisible"
          :isUpdate="isUpdateParam"
          :testType="currentType"
          :devs="currentDev"
        ></param-content>
      </template>
      <template v-if="2 == devType">
      <template v-if="testVisible && 2 == devType">
        <jh-param-content
          v-model="testVisible"
          v-if="testVisible"
          :isUpdate="isUpdateParam"
          :grpIdx="testGroupIdx"
          :testType="currentType"
          :devs="currentDev"
        ></jh-param-content>
      </template>
@@ -650,10 +658,10 @@
          text-align: center;
          background: #02a7f0;
          &.max {
            background: #d9001b;
            background: #438D29;
          }
          &.min {
            background: #f59a23;
            background: #DBD608;
          }
        }
      }
@@ -687,10 +695,10 @@
          text-align: center;
          background: #02a7f0;
          &.max {
            background: #d9001b;
            background: #438D29;
          }
          &.min {
            background: #f59a23;
            background: #DBD608;
          }
        }
      }
@@ -722,10 +730,10 @@
              padding: 2px 10px;
              border-radius: 6px;
              &.max {
                background: #d9001b;
                background: #438D29;
              }
              &.min {
                background: #f59a23;
                background: #DBD608;
              }
            }
          }