he wei
2022-06-25 55d7decf3ece27a6c213f1d2a8ae53d176f3b7bd
U 实时页面修改
3个文件已修改
359 ■■■■ 已修改文件
src/components/params/61850/DischargeParams.vue 337 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/params/DischargeDialogContent.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTime.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/params/61850/DischargeParams.vue
@@ -5,7 +5,8 @@
        label-position="top"
        :model="params"
        :rules="rules"
        class="params-dialog">
    class="params-dialog"
  >
        <el-form-item label="电池组名称">
            <el-input v-model="otherParams.groupName" readonly></el-input>
        </el-form-item>
@@ -25,16 +26,21 @@
            <div class="table-row">
                <div class="table-cell pr16">
                    <el-form-item label="电池组号">
                        <el-input v-model="otherParams.GroupIndexInFBSDevice" readonly></el-input>
            <el-input
              v-model="otherParams.GroupIndexInFBSDevice"
              readonly
            ></el-input>
                    </el-form-item>
                </div>
                <div class="table-cell">
                    <el-form-item label="测试类型">
                        <el-select v-model="params.TestCmd" placeholder="请选择">
                            <el-option
                                v-for="item in testType" :key="item.value"
                v-for="item in testType"
                :key="item.value"
                                :label="item.label"
                                :value="item.value"></el-option>
                :value="item.value"
              ></el-option>
                        </el-select>
                    </el-form-item>
                </div>
@@ -59,19 +65,31 @@
                </div>
                <div class="table-cell">
                    <el-form-item label="单体温度上限(10~60℃)" prop="MonomerTmp_High">
                        <el-input v-model="params.MonomerTmp_High" :readonly="readOnly"></el-input>
            <el-input
              v-model="params.MonomerTmp_High"
              :readonly="readOnly"
            ></el-input>
                    </el-form-item>
                </div>
            </div>
            <div class="table-row">
                <div class="table-cell pr16">
                    <el-form-item :label="rangeLabel.GroupVol_Low" prop="GroupVol_Low">
                        <el-input v-model="params.GroupVol_Low" :readonly="readOnly"></el-input>
            <el-input
              v-model="params.GroupVol_Low"
              :readonly="readOnly"
            ></el-input>
                    </el-form-item>
                </div>
                <div class="table-cell">
                    <el-form-item :label="rangeLabel.MonomerVol_Low" prop="MonomerVol_Low">
                        <el-input v-model="params.MonomerVol_Low" :readonly="readOnly"></el-input>
          <el-form-item
            :label="rangeLabel.MonomerVol_Low"
            prop="MonomerVol_Low"
          >
            <el-input
              v-model="params.MonomerVol_Low"
              :readonly="readOnly"
            ></el-input>
                    </el-form-item>
                </div>
            </div>
@@ -90,39 +108,79 @@
        </div>
        <div class="form-footer">
            <!-- <three-btn>清除告警</three-btn> -->
            <three-btn :disabled="!startTestFlag" @click="startTestCheck">启动测试</three-btn>
      <three-btn :disabled="!startTestFlag" @click="monDataShow = true"
        >启动测试</three-btn
      >
            <three-btn @click="getParams(true)">读取</three-btn>
            <three-btn :disabled="!setTestFlag" @click="submitFrom">设定</three-btn>
        </div>
        <el-dialog
            title="人脸校验" width="480px"
      title="人脸校验"
      width="480px"
            :visible.sync="setFaceShow"
            :close-on-click-modal="false" top="0"
      :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="setFaceShow" @checkSuccess="setFaceSuccess"></check-face>
      :modal-append-to-body="false"
      :destroy-on-close="true"
    >
      <check-face
        v-if="setFaceShow"
        @checkSuccess="setFaceSuccess"
      ></check-face>
        </el-dialog>
        <el-dialog
            title="人脸校验" width="480px"
      title="人脸校验"
      width="480px"
            :visible.sync="startFaceShow"
            :close-on-click-modal="false" top="0"
      :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>
      :modal-append-to-body="false"
      :destroy-on-close="true"
    >
      <check-face
        v-if="startFaceShow"
        @checkSuccess="startFaceSuccess"
      ></check-face>
    </el-dialog>
    <el-dialog
      title="单体数据面板"
      width="500px"
      :visible.sync="monDataShow"
      :close-on-click-modal="false"
      top="0"
      :modal="false"
      class="dialog-center"
      :modal-append-to-body="false"
      :destroy-on-close="true"
    >
      <div class="d_contain">
        <el-table :data="monData.datas" height="400">
          <el-table-column
            v-for="(header, key) in monData.headers"
            :key="key"
            :prop="header.prop"
            :label="header.label"
            :width="header.width"
            :min-width="header.minWidth"
            align="center"
          ></el-table-column>
        </el-table>
        <div class="footer">
          <three-btn @click="startTestCheck">确定</three-btn>
        </div>
      </div>
        </el-dialog>
    </el-form>
</template>
<script>
import {
    const_61850,
} from '../../../assets/js/const/index'
import { const_61850 } from "../../../assets/js/const/index";
import {
    testVal
} from '../../../assets/js/tools'
import { testVal } from "../../../assets/js/tools";
import CheckFace from "@/components/checkFace";
import config from "@/assets/js/config";
@@ -133,9 +191,15 @@
        batt: {
            type: Object,
            default() {
                return {}
            }
        }
        return {};
      },
    },
    tdata: {
      type: Array,
      default() {
        return [];
      },
    },
    },
    data() {
        let cmd = const_61850.cmd;
@@ -146,13 +210,22 @@
        // 修改组端下限的取值范围
        rules.GroupVol_Low.min = (batt.MonCount*batt.MonVolStd*0.875).toHold(1);
        rules.GroupVol_Low.max = (batt.MonCount*batt.MonVolStd*1.125).toHold(1);
        rules.GroupVol_Low.msg = "取值范围"+rules.GroupVol_Low.min+"~"+rules.GroupVol_Low.max+"(保留一位小数)";
    rules.GroupVol_Low.msg =
      "取值范围" +
      rules.GroupVol_Low.min +
      "~" +
      rules.GroupVol_Low.max +
      "(保留一位小数)";
        // 修改电池单体下限的取值范围
        rules.MonomerVol_Low.min = (batt.MonVolStd*0.9).toHold(1);
        rules.MonomerVol_Low.max = (batt.MonVolStd*1.2).toHold(1);
        rules.MonomerVol_Low.msg = "取值范围"+rules.MonomerVol_Low.min+"~"+rules.MonomerVol_Low.max+"(保留一位小数)";
    rules.MonomerVol_Low.msg =
      "取值范围" +
      rules.MonomerVol_Low.min +
      "~" +
      rules.MonomerVol_Low.max +
      "(保留一位小数)";
        return {
            setFaceShow: false,
@@ -162,19 +235,45 @@
            startTestFlag: false,       // 启动测试的状态
            setTestFlag: false,         // 设置参数的状态
            readOnly: false,
      monDataShow: false,
      monData: {
        headers: [
          {
            prop: "num1",
            label: "单体编号",
            Width: 80,
          },
          {
            prop: "vol1",
            label: "单体电压",
            width: 120,
          },
          {
            prop: "temp1",
            label: "单体温度",
            width: 120,
          },
          {
            prop: "res1",
            label: "单体内阻",
            width: 120,
          },
        ],
        datas: [],
      },
            ranges: {
                GroupVol_Low: {
                    name: '组端电压下限',
                    unit: 'V',
          name: "组端电压下限",
          unit: "V",
                    min: rules.GroupVol_Low.min,
                    max: rules.GroupVol_Low.max
          max: rules.GroupVol_Low.max,
                },
                MonomerVol_Low: {
                    name: '单体电压下限',
                    unit: 'V',
          name: "单体电压下限",
          unit: "V",
                    min: rules.MonomerVol_Low.min,
                    max: rules.MonomerVol_Low.max
                }
          max: rules.MonomerVol_Low.max,
        },
            },
            params: {
                num: 0,
@@ -191,44 +290,56 @@
                BattGroupNum: 0,  // 电池组编号
            },
            rules: {
                DisCap: [{
        DisCap: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.DisCap)
              testVal(rule, value, callback, rules.DisCap);
                    },
                    trigger: 'change'
                }],
                DisCurr: [{
            trigger: "change",
          },
        ],
        DisCurr: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.DisCurr)
              testVal(rule, value, callback, rules.DisCurr);
                    },
                    trigger: 'change'
                }],
                DisTime: [{
            trigger: "change",
          },
        ],
        DisTime: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.DisTime)
              testVal(rule, value, callback, rules.DisTime);
                    },
                    trigger: 'change'
                }],
                GroupVol_Low: [{
            trigger: "change",
          },
        ],
        GroupVol_Low: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.GroupVol_Low)
              testVal(rule, value, callback, rules.GroupVol_Low);
                    },
                    trigger: 'change'
                }],
                MonomerVol_Low: [{
            trigger: "change",
          },
        ],
        MonomerVol_Low: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.MonomerVol_Low)
              testVal(rule, value, callback, rules.MonomerVol_Low);
                    },
                    trigger: 'change'
                }],
                MonomerTmp_High: [{
            trigger: "change",
          },
        ],
        MonomerTmp_High: [
          {
                    validator(rule, value, callback) {
                        testVal(rule, value, callback, rules.MonomerTmp_High)
              testVal(rule, value, callback, rules.MonomerTmp_High);
                    },
                    trigger: 'change'
                }],
            trigger: "change",
            },
        }
        ],
      },
    };
    },
    watch: {
        params: {
@@ -272,11 +383,13 @@
            this.startTestFlag = false;
            // 查询后台
            this.$apis.dischargeTest.e61850.getParams({
      this.$apis.dischargeTest.e61850
        .getParams({
                num: this.cmd.get,
                dev_id: this.batt.FBSDeviceId,
                BattGroupNum: this.batt.GroupIndexInFBSDevice+1
            }).then(res => {
          BattGroupNum: this.batt.GroupIndexInFBSDevice + 1,
        })
        .then((res) => {
                let rs = JSON.parse(res.data.result);
                if (rs.code == 1) {
                    let fsparam = rs.data[0].fsparam;
@@ -291,7 +404,7 @@
                    // 设置的命令和dev_id
                    this.params.num = this.cmd.set;
                    this.params.dev_id = this.batt.FBSDeviceId;
                    this.$layer.msg('读取成功!');
            this.$layer.msg("读取成功!");
                    // 设置按钮可点击
                    this.setTestFlag = true;
                } else {
@@ -299,11 +412,12 @@
                    this.initParams();
                    // 设置按钮不可点击
                    this.setTestFlag = false;
                    this.$layer.msg('读取失败!');
            this.$layer.msg("读取失败!");
                }
                // 关闭等待框
                this.$layer.close(loading);
            }).catch(error => {
        })
        .catch((error) => {
                console.log(error);
                // 初始化参数
                this.initParams();
@@ -311,7 +425,7 @@
                this.setTestFlag = false;
                // 关闭等待框
                this.$layer.close(loading);
                this.$layer.msg('读取失败,读取请求异常!');
          this.$layer.msg("读取失败,读取请求异常!");
            });
        },
        // 提交表单设置参数
@@ -320,14 +434,17 @@
                // 校验通过
                if (valid) {
                    // 设置参数
                    this.$layer.confirm("确认修改参数", {icon: 3, title: '系统提示'}, (index)=>{
          this.$layer.confirm(
            "确认修改参数",
            { icon: 3, title: "系统提示" },
            (index) => {
                        // 关闭确认框
                        this.$layer.close(index);
                        this.setParamsCheck();
                    });
            }
          );
                } else {
                    this.$layer.msg('存在校验未通过的数据!');
          this.$layer.msg("存在校验未通过的数据!");
                    return false;
                }
            });
@@ -344,31 +461,36 @@
            // 等待框
            let loading = this.$layer.loading(1);
            // 请求后台
            this.$apis.dischargeTest.e61850.setParams(this.params).then(res => {
      this.$apis.dischargeTest.e61850
        .setParams(this.params)
        .then((res) => {
                let rs = JSON.parse(res.data.result);
                if (rs.code == 1) {
                    // 启动按钮可点击
                    this.startTestFlag = true;
                    // 提示信息
                    this.$layer.msg('设置成功');
            this.$layer.msg("设置成功");
                } else {
                    // 启动按钮不可点击
                    this.startTestFlag = false;
                    // 提示信息
                    this.$layer.msg('设置失败!');
            this.$layer.msg("设置失败!");
                }
                // 关闭等待框
                this.$layer.close(loading);
            }).catch(error => {
        })
        .catch((error) => {
                console.log(error);
                // 关闭等待框
                this.$layer.close(loading);
                // 启动按钮不可点击
                this.startTestFlag = false;
                // 提示信息
                this.$layer.msg('设置失败,设置请求异常!');
          this.$layer.msg("设置失败,设置请求异常!");
            });
        },
    // 单体数据
        startTestCheck() {
            if(config.dischargeByFace.value) {
                this.startFaceShow = true;
@@ -378,9 +500,17 @@
        },
        // 确认框
        confirmStartTest() {
            this.$layer.prompt({title: '输入启动口令,并确认', formType: 2, area: ['300px', '180px']}, (pass, index) => {
      this.$layer.prompt(
        {
          title: "输入启动口令,并确认",
          formType: 2,
          area: ["300px", "180px"],
        },
        (pass, index) => {
                // 请求后台校验密码
                this.$apis.login.checkUserPwd(pass).then(res=>{
          this.$apis.login
            .checkUserPwd(pass)
            .then((res) => {
                    let rs = JSON.parse(res.data.result);
                    if(rs.code == 1) {
                        // 关闭弹出框
@@ -391,40 +521,44 @@
                    }else {
                        this.$layer.msg("启动口令错误!");
                    }
                }).catch(error=>{
            })
            .catch((error) => {
                    console.log(error);
                    this.$layer.msg("网络请求异常");
                });
            });
        }
      );
        },
        // 启动
        startTest() {
            // 等待框
            let loading = this.$layer.loading(1);
            // 请求后台
            this.$apis.dischargeTest.e61850.start({
      this.$apis.dischargeTest.e61850
        .start({
                num: this.cmd.start,
                dev_id: this.batt.FBSDeviceId,
                BattGroupNum: this.batt.GroupIndexInFBSDevice+1,
            }).then(res => {
        })
        .then((res) => {
                let rs = JSON.parse(res.data.result);
                if (rs.code == 1) {
                    // 提示信息
                    this.$layer.msg('启动测试成功');
                    this.$emit('close');
            this.$layer.msg("启动测试成功");
            this.$emit("close");
                } else {
                    // 提示信息
                    this.$layer.msg('启动测试失败!');
            this.$layer.msg("启动测试失败!");
                }
                // 关闭等待框
                this.$layer.close(loading);
            }).catch(error => {
        })
        .catch((error) => {
                console.log(error);
                // 关闭等待框
                this.$layer.close(loading);
                // 提示信息
                this.$layer.msg('启动测试失败,启动测试请求异常!');
          this.$layer.msg("启动测试失败,启动测试请求异常!");
            });
        },
        setFaceSuccess() {
@@ -439,33 +573,48 @@
    computed: {
        otherParams() {
            let batt = this.batt;
            let groupInfo = '单体数量:' + this.batt.MonCount + ";电压(V):"
                + this.batt.MonVolStd + ";容量(AH):" + this.batt.MonCapStd;
      let groupInfo =
        "单体数量:" +
        this.batt.MonCount +
        ";电压(V):" +
        this.batt.MonVolStd +
        ";容量(AH):" +
        this.batt.MonCapStd;
            return {
                groupName: batt.StationName + "-" + batt.BattGroupName,
                FBSDeviceId: batt.FBSDeviceId,
                groupInfo: groupInfo,
                GroupIndexInFBSDevice: this.batt.GroupIndexInFBSDevice + 1,
            }
      };
        },
        rangeLabel() {
            let ranges = this.ranges;
            let result = {};
            for(let key in ranges) {
                let item = ranges[key];
                result[key] = item.name+"("+item.min+"~"+item.max+item.unit+")";
        result[key] =
          item.name + "(" + item.min + "~" + item.max + item.unit + ")";
            }
            return result;
        },
    },
    mounted() {
    console.log(this.tdata, 99999999999);
    this.monData.datas = this.tdata;
        // 获取数据
        this.getParams(true);
    },
}
};
</script>
<style scoped>
.d_contain {
  background-color: #ececec;
}
.d_contain .footer {
  text-align: right;
  padding: 8px;
}
.form-footer {
    margin-top: 16px;
    margin-bottom: 16px;
src/components/params/DischargeDialogContent.vue
@@ -3,6 +3,7 @@
    <discharge-params61850
      v-if="reg61850"
      :batt="batt"
      :tdata="tdata"
      @close="close"
    ></discharge-params61850>
    <bts-discharge-params
@@ -41,6 +42,12 @@
        return {};
      },
    },
    tdata: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {};
src/pages/dataTest/realTime.vue
@@ -335,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
@@ -738,6 +738,7 @@
    >
      <discharge-dialog-content
        v-if="dischargeDialog.show"
        :tdata="tdata"
        :batt="batt"
        @close="closeDisChargeDialog"
      >
@@ -1065,10 +1066,11 @@
        this.resize();
      });
    },
    "diagram.type"() {
      let batt = this.batt;
      this.getLastCapacityTest(batt);
    }
    // "diagram.type"(n) {
    //   // console.log(n, '===========测试类型:');
    //   let batt = this.batt;
    //   this.getLastCapacityTest(batt);
    // }
  },
  data() {
    let permits = this.$store.state.user.permits;
@@ -1131,6 +1133,7 @@
      chargeMon: "",
      dischargeMon: "",
      acTabs: "eleLine",
      tdata: [],
      table: {
        headers: [
          {
@@ -1899,6 +1902,7 @@
            //this.inversionInfo()
            this.getLithiumAnalog(), // 锂电池模拟量
            this.inversionData(),
            this.getLastCapacityTest(this.batt),
          ])
          .then(() => {
            this.timer.open();
@@ -2720,6 +2724,7 @@
        // 添加正在测试的单体
        this.chargeMon = chargeMon;
        this.dischargeMon = dischargeMon;
        this.tdata = data;
        
        // 更新表格
        if (this.acTabs == "tblData") {