longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
src/pages/dataTest/realTime.vue
@@ -62,9 +62,55 @@
      <!--                    <i class="iconfont el-icon-icon-test" @click="nibian.show=true"></i>-->
      <!--                </el-tooltip>-->
      <!--            </div>-->
      <flex-layout :no-bg="true">
      <flex-layout :no-bg="true" :loading="loading">
        <div class="content-header" slot="header" :model="inputs">
          <div class="table-layout">
        <div class="table-layout" v-if="cdshStatus == 'cdsh'">
            <div class="table-row">
              <div class="table-cell text-right w80">电池状态:</div>
              <div class="table-cell">
                <el-input
                  :value="backInputs.batt_state"
                  size="small"
                  :disabled="true"
                ></el-input>
              </div>
              <div class="table-cell text-right w80">端电压:</div>
              <div class="table-cell">
                <el-input
                  :value="backInputs.group_online_vol"
                  size="small"
                  :disabled="true"
                ></el-input>
              </div>
              <div class="table-cell text-right w80">电池电流:</div>
              <div class="table-cell">
                <el-input
                  :value="backInputs.group_curr"
                  size="small"
                  :disabled="true"
                ></el-input>
              </div>
            </div>
            <div class="table-row">
              <div class="table-cell text-right w80">单体电池数量:</div>
              <div class="table-cell">
                <el-input
                  :value="backInputs.MonCount"
                  size="small"
                  :disabled="true"
                ></el-input>
              </div>
              <div class="table-cell text-right w80">标称单体电压:</div>
              <div class="table-cell">
                <el-input
                  :value="backInputs.MonVolStd"
                  size="small"
                  :disabled="true"
                ></el-input>
              </div>
            </div>
          </div>
          <div class="table-layout" v-else>
            <div class="table-row">
              <div class="table-cell text-right w80">电池状态:</div>
              <div class="table-cell">
@@ -140,6 +186,9 @@
            class="page-content-tools"
            v-if="control.show && isCanTest && isTestDev"
          >
            <button class="hdw-btn transparentBtn" @click="guidesDialog = true" v-if="(acTabs == 'vol'||acTabs == 'res'||acTabs == 'temp'||acTabs == 'conduct'||acTabs == 'leakVol')&&cdshStatus=='cdsh'">
              <span class="light-color">设置参考线</span>
            </button>
            <el-popover placement="bottom" trigger="hover">
              <div class="hdw-menu-list">
                <ul>
@@ -238,7 +287,7 @@
            class="flex-layout noborder"
            @tab-click="tabClick"
          >
            <el-tab-pane key="eleLine" label="电路拓扑图" name="eleLine" v-if="pageConfig.eleLine && !isLd9">
            <el-tab-pane key="eleLine" label="电路拓扑图" name="eleLine" v-if="pageConfig.eleLine">
              <div style="position: absolute;top: 8px; left: 8px">
                <science-box
                  style="position: relative"
@@ -286,7 +335,7 @@
                <science-box
                  style="position: relative; margin-top: 8px"
                  no-header
                  v-show="stateListState && batt.FBSDeviceId"
                  v-show="stateListState && batt.FBSDeviceId && showHistoryStateList.length"
                >
                  <div class="hdw-state-list table-layout">
                    <div
@@ -375,6 +424,9 @@
                :contact-res="diagram.contactRes"
                :drop-vol="diagram.dropVol"
                :dev-type="diagram.devType"
                :charge-mon="chargeMon"
                :discharge-mon="dischargeMon"
                :buscouple-switch="buscoupleSwitch"
              ></circuit-diagram>
            </el-tab-pane>
            <el-tab-pane
@@ -390,6 +442,19 @@
                :show-tools="true"
                @right-click="chartRightCLick"
              ></bar-chart>
            </el-tab-pane>
            <el-tab-pane
              key="lithiumPack"
              label="锂电池信息"
              name="lithiumPack" v-if="isLithiumPack">
              <lithium-pack-tab
                ref="lithiumPack"
                :update="acTabs=='lithiumPack'"
                :change-flag="dataChangeFlag"
                :mon-vols="monVols"
                :mon-temps="monTemps"
                :pack-vols="packVols"
                :pack-currs="packCurrs"></lithium-pack-tab>
            </el-tab-pane>
            <el-tab-pane
              key="res"
@@ -483,7 +548,7 @@
              label="数据表格"
              name="tblData"
              class="el-table-wrapper"
              v-if="pageConfig.tblData"
              v-if="pageConfig.tblData && !isLithiumPack"
            >
              <el-table stripe size="small" :data="table.datas" height="100%" :row-class-name="setTableRowClass">
                <el-table-column
@@ -654,7 +719,7 @@
            <el-tab-pane label="电价统计分析" name="elePrice" v-if="isLithium && pageConfig.elePrice">
              <ele-price-tpl ref="elePriceTpl" :devId="batt.FBSDeviceId" :name="acTabs" :batt="batt"></ele-price-tpl>
            </el-tab-pane>
            <el-tab-pane label="BMS信息" name="bmsInfo" v-if="isLithium" v-show="false">
            <el-tab-pane label="BMS信息" name="bmsInfo" v-if="isLithium || isLithiumPack" v-show="false">
              <bms-info ref="bmsInfo" :batt="batt" :real-update="acTabs=='bmsInfo'"></bms-info>
            </el-tab-pane>
          </el-tabs>
@@ -673,6 +738,7 @@
    >
      <discharge-dialog-content
        v-if="dischargeDialog.show"
        :tdata="tdata"
        :batt="batt"
        @close="closeDisChargeDialog"
      >
@@ -842,6 +908,22 @@
        :batt="batt"
      ></work-plan>
    </el-dialog>
    <!-- 设置参考线 -->
    <el-dialog
      title="设置参考线"
      width="600px"
      :visible.sync="guidesDialog"
      top="0"
      class="dialog-center"
      :modal-append-to-body="false"
    >
        <div class="wx_guides">
          <p>参考线:</p>
          <p><el-input v-model="guidesVal"></el-input></p>
          <el-button type="primary" @click="setGuidesAlert()">设置</el-button>
          <el-button type="info" @click="guidesDialog = false">取消</el-button>
        </div>
    </el-dialog>
    <right-menu
      :visible.sync="rightMenu.show"
      :x="rightMenu.x"
@@ -861,6 +943,20 @@
      </div>
    </right-menu>
    <stop-outline-curing :dev-id="batt.FBSDeviceId" :stop-time="stopTime"></stop-outline-curing>
     <el-dialog
        title="人脸校验"
        width="480px"
        :visible.sync="startFaceShow"
        :close-on-click-modal="false"
        top="0"
        :modal="false"
        class="dialog-center"
        :modal-append-to-body="false"
        :destroy-on-close="true">
        <check-face
           v-if="startFaceShow"
           @checkSuccess="startFaceSuccess"></check-face>
     </el-dialog>
  </flex-layout>
</template>
@@ -895,7 +991,7 @@
  realTimePowerOff,
  realTimeLd9Data,
  realTimeStateList,
  inversionInfo,
  inversionInfo, inversionData,
} from "../../assets/js/realTime";
import {
  getLastCapacityTest
@@ -909,7 +1005,7 @@
  GetMonomerCap,
  GetHourRate,
  isHasPermit,
  getConduct,
  getConduct, getLabelByValue,
} from "../../assets/js/tools";
import { const_61850, const_9100, const_ld_nine } from "../../assets/js/const";
@@ -927,12 +1023,20 @@
import workPlan from "@/pages/dataTest/dialogs/dcdc/workPlan";
import ElePriceTpl from "@/pages/dataTest/components/elePriceTpl";
import BmsInfo from "@/pages/dataTest/components/bmsInfo";
import AutoCheck from "@/pages/dataTest/dialogs/autoCheck";
import const_9120 from "@/assets/js/const/const_9120";
import LithiumPackTab from "@/pages/dataTest/components/lithiumPackTab";
import CheckFace from "@/components/checkFace.vue";
import config from "@/assets/js/config";
/* import moment from "moment"; */
let vol, resChart, temp, conduct, currChart, leakVol, monConnRes;
let tblData = [];
export default {
  components: {
     CheckFace,
    LithiumPackTab,
    AutoCheck,
    stopOutlineCuring,
    BmsInfo,
    ElePriceTpl,
@@ -979,10 +1083,14 @@
        this.resize();
      });
    },
    "diagram.type"() {
      let batt = this.batt;
      this.getLastCapacityTest(batt);
    "$store.user.realTabsConfig"(pageConfig) {
      this.pageConfig = pageConfig;
    }
    // "diagram.type"(n) {
    //   // console.log(n, '===========测试类型:');
    //   let batt = this.batt;
    //   this.getLastCapacityTest(batt);
    // }
  },
  data() {
    let permits = this.$store.state.user.permits;
@@ -992,6 +1100,21 @@
    let lastCapacityTest = const_61850.lastCapacityTest;
    let pageConfig = this.$store.getters["user/realTabsConfig"];
    return {
       startFaceShow: false,
      // 成都石化
      cdshStatus:this.cdshFan(),
      guidesDialog:false,
      guidesVal:"",
      guidesData:{
        monVol:0,
        monTemp:0,
        monRes:0,
        monConduct:0,
        leakVol:0
      },
      //
      loading: false,
      workPlanDialog: false,
      dcdcWorkDialog: false,
      balanceControlDialog: false,
@@ -1024,9 +1147,14 @@
        batt_rest_cap: 0, // 剩余容量
        batt_state: 0 /* 电池状态 */,
        devTemperature: 0, // 环境温度
        devHumidity: 0, // 环境湿度
        devHumidity: 0, // 环境湿度,
        note: -1,   // 实际容量
        list: "",
      },
      chargeMon: "",
      dischargeMon: "",
      acTabs: "eleLine",
      tdata: [],
      table: {
        headers: [
          {
@@ -1121,6 +1249,7 @@
      historyStateList: historyStateList,
      lastCapacityTest: lastCapacityTest,
      timer: new Timeout("realTime"),
      timer2: new Timeout("realTime"),
      diagram: {
        update: true,
        type: -1,
@@ -1479,9 +1608,25 @@
      lithiumParams: {
        analog: lithiumInfo.analog().params,
      },
      // 空开状态 0-断开 1-闭合
      buscoupleSwitch: 0,
      // 数据更新标识
      dataChangeFlag: 0,
      // 单体电压信息
      monVols: [],
      // 单体温度信息
      monTemps: [],
      // 包电压
      packVols:[],
      packCurrs: [],
    };
  },
  methods: {
    // 成都石化判断
    cdshFan:function(){
      return this.$CFG.clientName.name;
    },
    //
    tabClick(tab) {
      this.acTabs = tab.name;
      // 根据tab更新电路图
@@ -1539,6 +1684,8 @@
        this.$refs.elePriceTpl.resize();
      } else if(this.acTabs == "bmsInfo") {
        this.$refs.bmsInfo.resize();
      }else if(this.acTabs == "lithiumPack") {
        this.$refs.lithiumPack.resize();
      }else {
        this.$G.chartManage.resize(this.acTabs);
      }
@@ -1753,16 +1900,30 @@
      }
    },
    startTimer() {
      this.timer.start(() => {
        this.$axios
          .all([
      // 计时器2
      this.timer2.start(()=>{
        this.$axios.all([
            this.realTimeSearch(),
        ]).then(()=>{
          this.dataChangeFlag = Math.random(); // 数据更新
          this.timer2.open();
        }).catch(()=>{
          this.dataChangeFlag = Math.random(); // 数据更新
          this.timer2.open();
        });
      }, 3000);
      // 计时器1
      this.timer.start(() => {
        this.$axios.all([
            this.realTimeGroupss(),
            this.realStateTimeData(),
            this.realTimeStateList(),
            this.loadDevAla(),
            //this.inversionInfo()
            this.getLithiumAnalog(), // 锂电池模拟量
            this.inversionData(),
            this.getLastCapacityTest(this.batt),
          ])
          .then(() => {
            this.timer.open();
@@ -1775,6 +1936,7 @@
    getBattGroupInfo(BattGroupId) {
      this.homeListShow = false;
      this.timer.name = "movingRingSysteRrealTime";
      this.timer2.name = "movingRingSysteRrealTime";
      this.$apis.dataMager.battGroupMager
        .getBattGroupInfo(BattGroupId)
        .then((res) => {
@@ -1801,8 +1963,19 @@
      if (regEquipType(data.FBSDeviceId, ["equip61850"])) {
        this.getLastCapacityTest(data);
      }
      let keyList = ["eleLine", "vol", "res", "temp", "conduct", "monConnRes",
        "curr", "leakVol", "tblData", "dianchigaojing", "niBianInfoTab", "jggdInfoTab", "elePrice", "bmsInfo"];
      for(let i=0; i<keyList.length; i++) {
        let key = keyList[i];
        if(this.pageConfig[key]) {
          this.acTabs = key;
          break;
        }
      }
      this.loading = true;
      this.changeTabsName();
      this.$nextTick(()=>{
        this.changeTabsName();
        // 开启循环请求
        this.startTimer();
      });
@@ -1813,9 +1986,9 @@
     * 根据设备类型修改Tabs选中状态
     */
    changeTabsName() {
      if(this.isLd9) {
        this.acTabs = "vol";
      }
      // if(this.isLd9) {
      //   this.acTabs = "vol";
      // }
      this.$nextTick(()=>{
        this.resize();
@@ -1831,6 +2004,50 @@
        let rs = JSON.parse(res.data.result);
        if (rs.code == 1) {
          let list = rs.data;
        // 初始化查询参考线
        if(this.cdshStatus == "cdsh"){
          this.getGuides(rs);
        }else{
          this.setLin(rs)
        }
          // // 单体电压
          // this.setChartMarkLine(vol, "Voltage", "Batt_Alarm_Type_MonVol", list);
          // // 单体温度
          // this.setChartMarkLine(
          //   temp,
          //   "Temperature",
          //   "Batt_Alarm_Type_MonTmp",
          //   list
          // );
          // // 单体内阻
          // this.setChartMarkLine(
          //   resChart,
          //   "Resistance",
          //   "Batt_Alarm_Type_MonRes",
          //   list
          // );
          // // 单体电导
          // this.setChartMarkLine(
          //   conduct,
          //   "Conductance",
          //   "Batt_Alarm_Type_MonRes",
          //   list
          // );
          // // 漏液电压
          // this.setChartMarkLine(
          //   leakVol,
          //   "leakVol",
          //   "Batt_Alarm_Type_MonLYVol",
          //   list
          // );
        }
      });
    },
    // 设置高低线参考线
    setLin:function(res){
      if (res.code) {
          let list = res.data;
          // 单体电压
          this.setChartMarkLine(vol, "Voltage", "Batt_Alarm_Type_MonVol", list);
          // 单体温度
@@ -1863,7 +2080,6 @@
            list
          );
        }
      });
    },
    setChartMarkLine(chartData, name, alm_name, list) {
      let batt = this.batt;
@@ -1873,42 +2089,152 @@
        if (item.alm_name == alm_name) {
          let high = 0;
          let low = 0;
          let guides = 0;
          switch (name) {
            case "Voltage": // 电压告警
              //单体电压
              let std_mon_vol = batt.MonVolStd;
              high = parseFloat(std_mon_vol * item.alm_high_coe).toHold(3);
              low = parseFloat(std_mon_vol * item.alm_low_coe).toHold(3);
              if(this.cdshStatus == "cdsh"){
                guides = this.guidesData.monVol;
              }
              break;
            case "Temperature":
              //单体温度
              let std_mon_tmp = 25;
              high = parseFloat(std_mon_tmp * item.alm_high_coe).toHold(1);
              low = parseFloat(std_mon_tmp * item.alm_low_coe).toHold(1);
              if(this.cdshStatus == "cdsh"){
                guides = this.guidesData.monTemp;
              }
              break;
            case "Resistance":
              // 单体电阻
              let std_mon_res =
                (1 * (batt.MonVolStd / 2)) / (batt.MonCapStd / 100);
              high = parseFloat(std_mon_res * item.alm_high_coe).toHold(3);
              low = parseFloat(std_mon_res * item.alm_low_coe).toHold(3);
              if(this.cdshStatus == "cdsh"){
                guides = this.guidesData.monRes;
              }
              break;
            case "Conductance":
              // 单体电导
              let std_mon_ser = batt.MonSerStd;
              high = parseFloat(std_mon_ser * item.alm_high_coe).toHold(0);
              low = parseFloat(std_mon_ser * item.alm_low_coe).toHold(0);
              if(this.cdshStatus == "cdsh"){
                guides = this.guidesData.monConduct;
              }
              break;
            case "leakVol":
              // 漏液电压
              high = parseFloat(item.alm_high_coe);
              low = parseFloat(item.alm_low_coe);
              if(this.cdshStatus == "cdsh"){
                guides = this.guidesData.leakVol;
              }
              break;
          }
          // 低告警
          chartData.series[0].markLine.data[0].yAxis = low;
          // 高告警
          chartData.series[0].markLine.data[1].yAxis = high;
          if(this.cdshStatus == "cdsh"){
            //参考线
            chartData.series[0].markLine.data[2].yAxis = guides;
          }
          break;
        }
      }
    },
    // 获取电池组参考线
    getGuides:function(resdata){
      let vm = this;
      let batt = this.batt;
      let obj = {
        battGroupId:batt.BattGroupId
      }
          // debugger
          vm.$axios({
            method: "POST",
              url: "BattGroupGuidesAction!getAll",
              data:'json=' + JSON.stringify(obj)
          }).then((res)=>{
            let rs = JSON.parse(res.data.result);
                if(rs.code == 1){
                  vm.guidesData = rs.data;
                  console.log(vm.guidesData)
                  vm.setLin(resdata)
                }
            console.log(vm.guidesData);
          })
    },
    // 设置参考线弹窗
    setGuidesAlert:function(){
      let vm = this;
      let params = function(){
                      let obj = {};
                      for (const key in vm.guidesData) {
                        // if(key == 'id'){
                        //   if(vm.guidesData[key] != null){
                        //     obj[key] = vm.guidesData[key];
                        //   }
                        // }else{
                          obj[key] = vm.guidesData[key];
                        // }
                      }
                      return obj;
                    }();
          if(!params.battGroupId){
            params.battGroupId = vm.batt.BattGroupId;
          }
          if(vm.guidesVal != ""){
            switch (vm.acTabs) {
              case "vol"://电压
                params.monVol = vm.guidesVal;
                break;
              case "res"://内阻
                params.monRes = vm.guidesVal;
                break;
              case "temp"://温度
                params.monTemp = vm.guidesVal;
                break;
              case "conduct"://电导
                params.monConduct = vm.guidesVal;
                break;
              case "leakVol"://漏液电压
                params.leakVol = vm.guidesVal;
                break;
            }
            // debugger
            vm.$axios({
              method: "POST",
              url: "BattGroupGuidesAction!update",
              data:"json=" + JSON.stringify(params)
            }).then((rs)=>{
              let res = JSON.parse(rs.data.result);
              if(res.code == 1){
                  vm.$message({
                    message: "设置成功!",
                    type: 'success'
                  });
                  vm.guidesVal = "";
                  vm.guidesDialog = false;
                  vm.realTimeAlarmss();
              }else{
                vm.$message.error("设置失败!");
              }
            })
          }else{
            vm.$message({
              message: '请先填写参考线值!',
              type: 'warning'
            });
          }
    },
    /* 实时组端信息 */
    realTimeGroupss() {
@@ -1916,7 +2242,31 @@
      realTimeGroup(batt.BattGroupId).then((res) => {
        let rsa = JSON.parse(res.data.result);
        if (rsa.code == 1) {
          if(!rsa.data[0].stationId) {
            rsa.data[0].stationId=",-1,-1,-1,-1,-1";
          }
          rsa.data[0].note = Number(rsa.data[0].note);
          this.inputs = rsa.data[0];
          if(this.cdshStatus == "cdsh"){
            let data2 = rsa.data2;
             for (const key in data2) {
              this.inputs[key] = data2[key]
            }
            console.log(this.inputs)
          }
          // 多个实际容量
          let list = rsa.data[0].stationId.split(",").filter(item=>{
            return item != "";
          });
          list = list.map(item=>{
            return (Number(item)-Math.abs(rsa.data[0].batt_test_cap)).toHold(1);
          }).join(",");
          // console.log("*******");
          // console.log("标准曲线实际容量:"+rsa.data[0].stationId);
          // console.log("标准曲线剩余容量:"+list);
          // console.log("旧算法剩余容量:"+rsa.data[0].batt_rest_cap);
          // console.log("*******");
          this.inputs.list = list;
        }
      });
    },
@@ -1950,10 +2300,19 @@
                this.diagram.type = 0;
                break;
              case 1:
                this.diagram.type = 1;
                let chargeMon = this.chargeMon;
                let dischargeMon = this.dischargeMon;
                // 存在放电和充电单体
                if(dischargeMon != "" && chargeMon != "") {
                  this.diagram.type = 6;
                }else if(chargeMon != "") {   // 存在充电单体
                  this.diagram.type = 2;
                }else{
                  this.diagram.type = 1;
                }
                break;
              case 2:
                this.diagram.type = 2;
                this.diagram.type = 0;
                break;
              case 3:
                this.diagram.type = 3;
@@ -1993,8 +2352,8 @@
          this.setEquipBase(data);
          // 判断是否超时
          var nowTime = new Date(data.note).getTime(); //当前时间
          var record = new Date(data.record_datetime).getTime();
          let nowTime = new Date(data.note).getTime(); //当前时间
          let record = new Date(data.record_datetime).getTime();
          if (Math.abs(nowTime - record) / 1000 > outTime) {
            this.disconnect();
          } else {
@@ -2005,7 +2364,7 @@
            if (regEquipType(dev_id, "equip61850")) {
              this.setEquip61850(data);
            } else if (
              regEquipType(dev_id, ["BTS", "BTS9110", "BTS9120", "lithium", "LD9"])
              regEquipType(dev_id, ["BTS", "BTS9110", "BTS9120", "lithium", "LD9", "lithiumPack"])
            ) {
              this.setEquipBTS(data);
            } else if (regEquipType(dev_id, ["BTS9605", "BTS9611"])) {
@@ -2364,8 +2723,15 @@
        let diagramType = this.diagram.type;
        let rs = JSON.parse(res.data.result);
        let data = [];
        let chargeMon = "";
        let dischargeMon = "";
        if (rs.code == 1 && diagramType != -1) {
          data = rs.data.map((item) => {
            if(item.monState == 1) {
              dischargeMon += (dischargeMon == ""?"#":',#')+item.mon_num;
            }else if(item.monState == 2) {
              chargeMon += (chargeMon == ""?"#":',#')+item.mon_num;
            }
            return {
              num1: "#" + item.mon_num,
              vol1: item.mon_vol,
@@ -2378,13 +2744,19 @@
              leakVol1: item.mon_LY_vol,
              monConnRes: item.mon_conn_res,
              monCap: item.mon_cap,
              monTestCap: diagramType==1?item.monTestCap:"---",
              monResCap: diagramType==1?item.monRestCap:"---",
              monDisTimeLong: diagramType==1?Math.floor(item.monDisTimeLong/60) + "时" + (item.monDisTimeLong%60) + "分":"---",
              monTestCap: diagramType==1 || diagramType==2 || diagramType==6?item.monTestCap:"---",
              monResCap: diagramType==1 || diagramType==2 || diagramType==6?item.monRestCap:"---",
              monDisTimeLong: diagramType==1 || diagramType==2 || diagramType==6?Math.floor(item.monDisTimeLong/60) + "时" + (item.monDisTimeLong%60) + "分":"---",
              monState: item.monState,
            };
          });
        }
        // 添加正在测试的单体
        this.chargeMon = chargeMon;
        this.dischargeMon = dischargeMon;
        this.tdata = data;
        // 更新表格
        if (this.acTabs == "tblData") {
          this.table.datas = data;
@@ -2400,6 +2772,12 @@
            return ["#" + item.mon_num, value];
          });
        }
        // 设置电压值
        this.monVols = volTempVol.map(item=>{
          return item[1];
        });
        let volBarNum = getBarNum(volTempVol);
        vol.title.text =
          "最大值=" +
@@ -2438,6 +2816,10 @@
            return ["#" + item.mon_num, value];
          });
        }
        this.monTemps = volTempte.map(item=>{
          return item[1];
        });
        let tempBarNum = getBarNum(volTempte);
        temp.title.text =
          "最大值=" +
@@ -2523,6 +2905,12 @@
        monConnRes.series[0].data = monConnResData;
        // 更新电压图表
        this.setChart();
        this.loading = false;
      }).catch(error=>{
        // 更新电压图表
        this.setChart();
        this.loading = false;
        this.loading = false;
      });
    },
    // 向父级发送同步页面的指令
@@ -2579,6 +2967,7 @@
              "BTS9120",
              "BTS9605",
              "lithium",
              "lithiumPack"
            ])
          ) {
            // 停止设备
@@ -2601,6 +2990,7 @@
        .stop({
          num: const_ld_nine.cmd.stop,
          dev_id: this.batt.FBSDeviceId,
          BattGroupNum: this.batt.GroupIndexInFBSDevice+1,
        })
        .then((res) => {
          let rs = JSON.parse(res.data.result);
@@ -2631,6 +3021,7 @@
        .stop({
          num: const_9100.cmd.stop,
          dev_id: this.batt.FBSDeviceId,
          BattGroupNum: this.batt.GroupIndexInFBSDevice+1,
        })
        .then((res) => {
          let rs = JSON.parse(res.data.result);
@@ -2661,6 +3052,7 @@
        .stop({
          num: const_61850.cmd.stop,
          dev_id: this.batt.FBSDeviceId,
          BattGroupNum: this.batt.GroupIndexInFBSDevice+1,
        })
        .then((res) => {
          let rs = JSON.parse(res.data.result);
@@ -2813,21 +3205,26 @@
     */
    getLithiumAnalog() {
      let batt = this.batt;
      let isLithium = regEquipType(batt.FBSDeviceId, ["lithium"]);
      let isLithium = regEquipType(batt.FBSDeviceId, ["lithium", "lithiumPack"]);
      if (isLithium) {
        this.$apis.dcdc
          .getDcDcAnalogParams({
        this.$apis.dcdc.getDcDcAnalogParams({
            devId: batt.FBSDeviceId,
            groupNum: batt.GroupIndexInFBSDevice
          })
          .then((res) => {
            let rs = JSON.parse(res.data.result);
            if (rs.code == 1) {
            if (rs.code == 1 && rs.data.length != 0) {
              // 剩余容量进行累加
              let restCap = 0;
              let packVols = [];
              let packCurrs = [];
              rs.data.map(item=>{
                restCap += item.restCap;
                packVols.push(item.sumVol);
                packCurrs.push(item.current);
              });
              this.packVols = packVols;
              this.packCurrs = packCurrs;
              let data = rs.data[0];
              data.restCap = restCap;
              this.lithiumParams.analog = data;
@@ -3007,6 +3404,20 @@
    closeDisChargeDialog() {
      this.dischargeDialog.show = false;
    },
     startFaceSuccess() {
         this.startFaceShow = false;
        let batt = this.batt;
        let loading = this.$layer.loading();
        this.$apis.outline.restart(batt.FBSDeviceId).then((res) => {
           let rs = JSON.parse(res.data.result);
           if (rs.code == 1) {
              this.$alert("发送重启命令成功", "系统提示");
           } else {
              this.$alert("发送重启命令失败!", "系统提示");
           }
           this.$layer.close(loading);
        }).catch((error) => {});
     },
    restartSystem() {
      let self = this;
      let batt = this.batt;
@@ -3015,27 +3426,17 @@
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        inputType: "password",
      })
        .then(({ value }) => {
      }).then(({ value }) => {
          if (value == resetPwd) {
            let loading = this.$layer.loading();
            this.$apis.outline
              .restart(batt.FBSDeviceId)
              .then((res) => {
                let rs = JSON.parse(res.data.result);
                if (rs.code == 1) {
                  this.$alert("发送重启命令成功", "系统提示");
                } else {
                  this.$alert("发送重启命令失败!", "系统提示");
                }
                this.$layer.close(loading);
              })
              .catch((error) => {});
             if (config.dischargeByFace.value) {
                     this.startFaceShow = true;
             }else {
                this.startFaceSuccess();
             }
          } else {
            this.$layer.msg("密码不正确");
          }
        })
        .catch(() => {});
        }).catch(() => {});
    },
    changeSkin() {
      this.$nextTick(() => {
@@ -3090,7 +3491,31 @@
    },
    stopOutLineCuring() {
      this.stopTime = new Date().getTime();
    }
    },
    inversionData() {
      // 是逆变的设备
      if(regEquipType(this.batt.FBSDeviceId, 'BTS9120')) {
        inversionData(this.batt.FBSDeviceId).then(res=>{
          let rs = JSON.parse(res.data.result);
          let data = {
            commustate: -1,     // 通讯状态
            fanglei_state: -1,  // 防雷状态
            rlayworkmode: -1,   // 空开状态
          };
          if(rs.code == 1) {
            data = rs.data[0];
          }
          if(data.rlayworkmode == 1 || data.rlayworkmode == 3) {
            this.buscoupleSwitch = 0;
          }else {
            this.buscoupleSwitch = 1;
          }
        }).catch(error=>{
          this.buscoupleSwitch = 0;
        });
      }
    },
  },
  computed: {
    battFullName() {
@@ -3109,6 +3534,7 @@
          2: "充电",
          3: "放电",
          4: "均充",
          5: "内阻测试"
        },
        list = {
          batt_state: "未知",
@@ -3120,6 +3546,11 @@
          batt_syrl_cap: "---",
          sysc: "------",
        };
      if(this.cdshStatus == "cdsh"){
        list.MonCount = "0";
        list.MonVolStd = "0V";
      }
      if (this.diagram.type == -1) {
        return list;
      }
@@ -3140,13 +3571,26 @@
      list.batt_test_tlong = formatSeconds(this.inputs.batt_test_tlong);
      list.batt_test_cap = this.inputs.batt_test_cap.toFixed(1) + "AH";
      if (this.inputs.batt_state === 2) {
        list.batt_syrl_cap = "---";
      } else {
      if(this.cdshStatus == "cdsh"){
        list.MonCount = this.inputs.MonCount;
        list.MonVolStd = this.inputs.MonVolStd + "V";
      }
      if (this.inputs.batt_state === 3) {
        // 为0是不更新剩余容量
        if(this.inputs.batt_rest_cap != 0) {
          list.batt_syrl_cap = this.inputs.batt_rest_cap.toFixed(1)
        }
        // 通过标准曲线获取实际容量后计算剩余容量
        // if(this.inputs.note<=0) {
        //   list.batt_syrl_cap = "------";
        //   list.batt_syrl_cap = this.inputs.list+"AH";
        // }else {
        //   //list.batt_syrl_cap = (this.inputs.note-Math.abs(this.inputs.batt_test_cap)).toFixed(1)+"AH";
        //   list.batt_syrl_cap = this.inputs.list+"AH";
        // }
      } else {
        list.batt_syrl_cap = "---";
      }
      if (this.inputs.batt_state === 3) {
        // 为0是不更新续航时长
@@ -3161,7 +3605,7 @@
      }
      // 如果当前为锂电池
      let isLithium = regEquipType(batt.FBSDeviceId, ["lithium"]);
      let isLithium = regEquipType(batt.FBSDeviceId, ["lithium", "lithiumPack"]);
      if (isLithium) {
        list.batt_syrl_cap =
          this.lithiumParams.analog.restCap.toFixed(1) + "AH";
@@ -3193,6 +3637,7 @@
          "BTS9120",
          "BTS9605",
          "lithium",
          "lithiumPack"
        ])
      ) {
        return "BTS设备放电参数设置";
@@ -3203,7 +3648,7 @@
      }
    },
    stateListState() {
      return this.stateListShow && this.showStateList.length;
      return this.stateListShow && this.showStateList.length && !this.isLd9;
    },
    historyStateListState() {
      return this.stateListShow && this.showHistoryStateList.length;
@@ -3239,6 +3684,11 @@
      let batt = this.batt;
      return regEquipType(batt.FBSDeviceId, ["lithium"]);
    },
    isLithiumPack() {
      // 锂电包
      let batt = this.batt;
      return regEquipType(batt.FBSDeviceId, ["lithiumPack"]);
    },
    isLd9() {
      // LD9BTS
      let batt = this.batt;
@@ -3252,25 +3702,52 @@
    tabsConfig() {
      let batt = this.batt;
      let isLithium = regEquipType(batt.FBSDeviceId, ["lithium"]);
      let vol = true;
      let res = !isLithium;
      let temp = true;
      let conduct = !isLithium;
      let curr = !isLithium;
      let leakVol = !isLithium;
      let dianchigaojing = !isLithium;
      let monConnRes = !isLithium;
      return {
        vol: vol,
        res: res,
        temp: temp,
        conduct: conduct,
        curr: curr,
        leakVol: leakVol,
        dianchigaojing: dianchigaojing,
        monConnRes: monConnRes,
      };
      let isLithiumPack = regEquipType(batt.FBSDeviceId, ["lithiumPack"]);
      if(isLithium) {
        return {
          vol: true,
          res: false,
          temp: true,
          conduct: false,
          curr: false,
          leakVol: false,
          dianchigaojing: false,
          monConnRes: false,
        }
      }else if(isLithiumPack) {
        return {
          vol: false,
          res: false,
          temp: false,
          conduct: false,
          curr: false,
          leakVol: false,
          dianchigaojing: false,
          monConnRes: false,
        }
      }else if(!batt.FBSDeviceId) {
        return {
          vol: false,
          res: false,
          temp: false,
          conduct: false,
          curr: false,
          leakVol: false,
          dianchigaojing: false,
          monConnRes: false,
        }
      }else {
        return {
          vol: true,
          res: true,
          temp: true,
          conduct: true,
          curr: true,
          leakVol: true,
          dianchigaojing: true,
          monConnRes: true,
        }
      }
    },
    isTestDev() {
      let batt = this.batt;
@@ -3335,6 +3812,7 @@
  destroyed() {
    window.removeEventListener("resize", this.resize);
    this.timer.stop();
    this.timer2.stop();
  },
};
</script>
@@ -3527,4 +4005,18 @@
  font-size: 14px;
  padding: 0;
}
.wx_guides{
  height: 150px;
  text-align: center;
  background-color: #ffffff;
  padding-top: 15%;
}
.wx_guides p {
  display: inline-block;
  margin-right: 10px;
}
.wx_guides p /deep/.el-input__inner {
  color:#000;
}
</style>