he wei
2022-04-09 5d45ba10563a70124677b36dd1943512d0cb7071
U 新增和编辑电池组时对锂电池包的适配
3个文件已修改
152 ■■■■ 已修改文件
src/components/threeStation/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/components/AddBattGroup.vue 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/components/EditBattGroup.vue 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/threeStation/index.vue
@@ -113,6 +113,8 @@
          width = clientWidth;
          height = clientWidth / ratio;
        }
          // height = clientHeight;
          // width = clientWidth;
        res = {
          width: width + "px",
          height: height + "px",
src/views/dataMager/components/AddBattGroup.vue
@@ -188,8 +188,13 @@
            <el-input v-model="params.battFloatCurrent"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="layout.span" v-if="isLithiumPack">
          <el-form-item label="锂电池包个数" prop="PackCount">
            <el-input v-model="params.packCount"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="layout.span">
          <el-form-item label="单体数量" prop="monCount">
          <el-form-item :label="monCountText" prop="monCount">
            <!--                        <el-select v-model="params.MonCount" placeholder="请选择单体数量">-->
            <!--                            <el-option label="4" value="4"></el-option>-->
            <!--                            <el-option label="24" value="24"></el-option>-->
@@ -473,6 +478,8 @@
  const_battery_type,
} from "@/assets/js/const";
import const_rules from "@/assets/js/const/const_rules";
export default {
  props: {
    batt: {
@@ -484,8 +491,15 @@
  },
  data() {
    let rules = const_battGroup.rules;
    let constRules = const_rules;
    let devTypes = const_devType.batt;
    let batteryTypes = const_battery_type.types;
    const subRules = {
      validator(rule, value, callback) {
        testVal(rule, value, callback, constRules.noSpecialChar);
      },
      trigger: "change",
    };
    return {
      layout: {
        span: 8,
@@ -512,6 +526,7 @@
        floatVolLevel: "53.6", // 浮充电压阀值(V)(自动计算)
        offlineVolLevel: "51.5", // 离线电压阀值(V)(自动计算)
        battFloatCurrent: "5", // 浮充电流阀值(A)
        packCount: 1, // 锂电池包个数
        monCount: 4, // 单体数量
        monCapStd: 150, // 标称容量(AH)
        monVolStd: "2", // 标称单体电压(V)
@@ -555,6 +570,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName2: [
          {
@@ -562,6 +578,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName5: [
          {
@@ -569,6 +586,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName3: [
          {
@@ -576,6 +594,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName4: [
          {
@@ -583,6 +602,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        fbsdeviceName: [
          {
@@ -590,6 +610,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        fbsdeviceIp: [
          {
@@ -624,6 +645,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        tmpId: [
          {
@@ -631,6 +653,7 @@
            message: "请先录入电价分布模板",
            trigger: "change",
          },
          { ...subRules },
        ],
        battGroupNum: [
          {
@@ -638,6 +661,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        floatVolLevel: [
          {
@@ -645,6 +669,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        offlineVolLevel: [
          {
@@ -652,6 +677,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battFloatCurrent: [
          {
@@ -659,6 +685,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monResStd: [
          {
@@ -666,6 +693,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monSerStd: [
          {
@@ -680,6 +708,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        disCurrMax: [
          {
@@ -687,6 +716,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battGroupName: [
          {
@@ -694,6 +724,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monVolStd: [
          {
@@ -701,6 +732,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monCapStd: [
          {
@@ -708,6 +740,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        loadCurr: [
          {
@@ -715,6 +748,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battProducer: [
          {
@@ -722,6 +756,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battModel: [
          {
@@ -729,6 +764,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battProductDate: [
          {
@@ -736,6 +772,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battInUseDate: [
          {
@@ -743,6 +780,15 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        packCount: [
          {
            required: true,
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monCount: [
          {
@@ -750,6 +796,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
      },
      linkage: {
@@ -881,7 +928,7 @@
      // 查询后台
      getExistStations(searchParams).then((res) => {
        res = res.data;
        console.log(res, 'res======99');
        console.log(res, "res======99");
        var data = [];
        if (res.code) {
          data = res.data.map((v) => {
@@ -1206,18 +1253,24 @@
              message: "添加" + batt.stationName + "成功!",
            });
            // 触发事件
            this.$emit("success");
          } else {
            this.$message({
              type: "error",
              message: "添加" + batt.stationName + "失败!",
            });
          }
          this.$emit("success");
          // 关闭加载框
          this.$layer.close(loading);
        })
        .catch((error) => {
          console.log(error);
          this.$message({
            type: "error",
            message: "修改" + batt.stationName + "失败!",
          });
          // 触发事件
          this.$emit("success");
          // 关闭加载框
          this.$layer.close(loading);
        });
@@ -1281,14 +1334,23 @@
  },
  computed: {
    isInversion() {
      let dev_id = this.params.FBSDeviceId;
      let dev_id = this.params.fbsdeviceId;
      return regEquipType(dev_id, "BTS9120");
    },
    isLithium() {
      // 锂电BTS
      let dev_id = this.params.FBSDeviceId;
      let dev_id = this.params.fbsdeviceId;
      return regEquipType(dev_id, ["lithium"]);
    },
    isLithiumPack() {
      // 锂电池包
      let dev_id = this.params.fbsdeviceId;
      return regEquipType(dev_id, ["lithiumPack"]);
    },
    monCountText() {
      let isLithiumPack = this.isLithiumPack;
      return isLithiumPack ? "锂电池包单体个数" : "单体个数";
    },
  },
  mounted() {
    // 设置省市区县的数据
src/views/dataMager/components/EditBattGroup.vue
@@ -177,6 +177,11 @@
            <el-input v-model="params.battFloatCurrent"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="layout.span" v-if="isLithiumPack">
          <el-form-item label="锂电池包个数" prop="packCount">
            <el-input v-model="params.packCount"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="layout.span">
          <el-form-item label="单体数量" prop="monCount">
            <!--                        <el-select v-model="params.monCount" placeholder="请选择单体数量">-->
@@ -417,12 +422,7 @@
</template>
<script>
import {
  testVal,
  extend,
  LinkagePlus,
  regEquipType,
} from "@/assets/js/tools";
import { testVal, extend, LinkagePlus, regEquipType } from "@/assets/js/tools";
import {
  const_province_city_county,
@@ -430,16 +430,10 @@
  const_battery_type,
} from "@/assets/js/const";
import {
  searchProvince,
  searchCity,
  searchCounty,
} from "@/assets/js/api.js";
import { searchProvince, searchCity, searchCounty } from "@/assets/js/api.js";
import {
  searchBattProducer,
  edit
} from '../js/battGroupMager';
import { searchBattProducer, edit } from "../js/battGroupMager";
import const_rules from "@/assets/js/const/const_rules";
export default {
  props: {
@@ -450,7 +444,14 @@
  },
  data() {
    let rules = const_battGroup.rules;
    let constRules = const_rules;
    let batteryTypes = const_battery_type.types;
    const subRules = {
      validator(rule, value, callback) {
        testVal(rule, value, callback, constRules.noSpecialChar);
      },
      trigger: "change",
    };
    return {
      layout: {
        span: 8,
@@ -477,6 +478,7 @@
        floatVolLevel: "53.6", // 浮充电压阀值(V)(自动计算)
        offlineVolLevel: "51.5", // 离线电压阀值(V)(自动计算)
        battFloatCurrent: "5", // 浮充电流阀值(A)
        packCount: 1, // 锂电池包个数
        monCount: 4, // 单体数量
        monCapStd: 150, // 标称容量(AH)
        monVolStd: "4", // 标称单体电压(V)
@@ -519,6 +521,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName2: [
          {
@@ -526,6 +529,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName5: [
          {
@@ -533,6 +537,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName3: [
          {
@@ -540,6 +545,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        stationName4: [
          {
@@ -547,6 +553,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        fbsdeviceId: [
          {
@@ -561,6 +568,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        fbsdeviceIp: [
          {
@@ -570,6 +578,7 @@
            },
            trigger: "change",
          },
          { ...subRules },
        ],
        fbsdeviceipYm: [
          {
@@ -602,6 +611,7 @@
            message: "请先录入电价分布模板",
            trigger: "change",
          },
          { ...subRules },
        ],
        battGroupNum: [
          {
@@ -609,6 +619,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        floatVolLevel: [
          {
@@ -616,6 +627,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        offlineVolLevel: [
          {
@@ -623,6 +635,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battFloatCurrent: [
          {
@@ -630,6 +643,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monResStd: [
          {
@@ -644,6 +658,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monVolLowToAvg: [
          {
@@ -651,6 +666,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        disCurrMax: [
          {
@@ -658,6 +674,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battGroupName: [
          {
@@ -665,6 +682,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monVolStd: [
          {
@@ -672,6 +690,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monCapStd: [
          {
@@ -679,6 +698,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        loadCurr: [
          {
@@ -686,6 +706,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battProducer: [
          {
@@ -700,6 +721,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battProductDate: [
          {
@@ -707,6 +729,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        battInUseDate: [
          {
@@ -714,6 +737,15 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        packCount: [
          {
            required: true,
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
        monCount: [
          {
@@ -721,6 +753,7 @@
            message: "不能为空",
            trigger: "change",
          },
          { ...subRules },
        ],
      },
      linkage: {
@@ -890,6 +923,12 @@
        })
        .catch((error) => {
          console.log(error);
          this.$message({
            type: "error",
            message: "修改" + batt.stationName + "失败!",
          });
          // 触发事件
          this.$emit("success");
          // 关闭加载框
          this.$layer.close(loading);
        });
@@ -1125,6 +1164,15 @@
      let dev_id = this.params.fbsdeviceId;
      return regEquipType(dev_id, ["lithium"]);
    },
    sLithiumPack() {
      // 锂电池包
      let dev_id = this.params.fbsdeviceId;
      return regEquipType(dev_id, ["lithiumPack"]);
    },
    monCountText() {
      let isLithiumPack = this.isLithiumPack;
      return isLithiumPack ? "锂电池包单体个数" : "单体个数";
    },
  },
  mounted() {
    // 设置省市区县的数据