he wei
2025-02-16 dd02fe83152ad999e629de7b4da63e623a05775c
U 6186拓扑图修改
2 文件已重命名
13个文件已修改
3个文件已添加
1 文件已复制
1834 ■■■■ 已修改文件
src/views/dataTest/components/CircuitDiagram.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/eleOperation/js/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/grid/buscouple/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/grid/buscoupleCharge/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/grid/noBuscouple/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/grid/noBuscoupleCharge/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/buscouple/index.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/buscouple/js/diagramStatus.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/buscouple/js/loadCircuitDiagram.js 1092 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/index.vue 185 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/noBuscouple/index.vue 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/noBuscouple/js/diagramStatus.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/load/noBuscouple/js/loadCircuitDiagram.js 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/loadReverse/buscouple/js/diagramStatus.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/loadReverse/noBuscouple/js/diagramStatus.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/normal/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/diagrams/normal9150/js/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/diagram/diagramStates.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/realTime6186.vue 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataTest/components/CircuitDiagram.vue
@@ -7,6 +7,7 @@
    :batt-curr="battCurr"
    :dev-temp="devTemp"
    :type="type"
    :dev-type="devType"
    :load-curr="loadCurr"
    :dis-curr-max="DisCurrMax"
    :update="update"
src/views/dataTest/components/diagrams/eleOperation/js/index.js
@@ -925,7 +925,7 @@
  diagram.text({
    flush: true,
    id: 'sysState',
    text: '系统状态:在线浮充',
    text: '系统状态:直连充电',
    align: 'left',
    fontSize: 16,
    fillStyle: yellow,
src/views/dataTest/components/diagrams/grid/buscouple/js/diagramStates.js
@@ -560,7 +560,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/grid/buscoupleCharge/js/diagramStates.js
@@ -633,7 +633,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/grid/noBuscouple/js/diagramStates.js
@@ -560,7 +560,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/grid/noBuscoupleCharge/js/diagramStates.js
@@ -633,7 +633,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/load/buscouple/index.vue
New file
@@ -0,0 +1,189 @@
<template>
  <div class="diagram-wrapper-hdw">
    <div class="diagram-content">
      <div class="diagram-panel">
        <flex-box no-header size="mini" v-if="false">
          <div class="diagram-panel-list">
            <div class="diagram-panel-item">
              环境温度:0℃
            </div>
            <div class="diagram-panel-item">
              环境湿度:0℃
            </div>
          </div>
        </flex-box>
      </div>
      <div class="diagram-stc" ref="static"></div>
      <div class="diagram-flush" ref="flush"></div>
    </div>
  </div>
</template>
<script>
// 假负载电路图和电流
import loadCircuitDiagram from "./js/loadCircuitDiagram";
import diagramStates from "./js/diagramStatus";
import FlexBox from "@/components/FlexBox";
import const_digit from "@/assets/js/const/const_digit";
const {
  cap: CAP,
  vol: VOL,
  curr: CURR,
  res: RES,
  conduct: CONDUCT,
  temp: TEMP,
  hum: HUM,
} = const_digit;
let diagram;
export default {
  components: {FlexBox},
  props: {
    onlineVol: {
      // 在线电压
      type: [String, Number],
      default: 0,
    },
    groupVol: {
      // 组端电压
      type: [String, Number],
      default: 0,
    },
    battCurr: {
      // 电池电流
      type: [String, Number],
      default: 0,
    },
    devTemp: {
      // 设备温度
      type: [String, Number],
      default: 0,
    },
    type: {
      type: Number,
      default: -1,
    },
    update: {
      type: Boolean,
      default: true,
    },
    loadCurr: {
      type: [String, Number],
      default: "??",
    },
    disCurrMax: {
      type: [String, Number],
      default: "??",
    },
  },
  watch: {
    onlineVol(val) {
      diagram.setOption("onlineVol", "text", val.toHold(VOL) + "V");
    },
    groupVol(val) {
      diagram.setOption("groupVol", "text", val.toHold(VOL) + "V");
    },
    battCurr(val) {
      diagram.setOption("battCurr", "text", val.toHold(CURR) + "A");
    },
    devTemp(val) {
      diagram.setOption("devTemp", "text", "设备温度:" + val.toHold(TEMP) + "℃");
    },
    type(val) {
      this.setDiagramByType();
    },
    update(val) {
      if (val) {
        diagram.start(true);
      } else {
        diagram.stop();
      }
    },
    loadCurr(val) {
      diagram.setOption("loadCurr", "text", "实际负载电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
    disCurrMax(val) {
      diagram.setOption("disCurrMax", "text", "最大核容电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
  },
  methods: {
    init() {
      // 设置在线,组端,电流,和温度
      diagram.setOption("onlineVol", "text", this.onlineVol.toHold(VOL) + "V");
      diagram.setOption("groupVol", "text", this.groupVol.toHold(VOL) + "V");
      diagram.setOption("battCurr", "text", this.battCurr.toHold(CURR) + "A");
      diagram.setOption("devTemp", "text", "设备温度:" + this.devTemp.toHold(TEMP) + "℃");
      diagram.setOption(
        "loadCurr",
        "text",
        "实际负载电流:" + (this.loadCurr == this.loadCurr * 1 ? (this.loadCurr * 1).toHold(CURR) : this.loadCurr) + "A"
      );
      diagram.setOption(
        "disCurrMax",
        "text",
        "最大核容电流:" + (this.disCurrMax == this.disCurrMax * 1 ? (this.disCurrMax * 1).toHold(CURR) : this.disCurrMax) + "A"
      );
      // 设置更新状态
      if (!this.update) {
        diagram.stop();
      }
    },
    setDiagramByType() {
      let type = this.type;
      switch (type) {
        case -1:
          diagramStates(diagram, "break");
          break;
        case 0:
          diagramStates(diagram, "float");
          break;
        case 1:
          diagramStates(diagram, "discharge");
          break;
        case 2:
          diagramStates(diagram, "charge");
          break;
        case 5:
          diagramStates(diagram, "powerCutDischarge");
          break;
        default:
          diagramStates(diagram, "");
          break;
      }
    },
  },
  mounted() {
    diagram = loadCircuitDiagram(this.$refs.static, this.$refs.flush);
    // 初始化数据
    this.init();
    // 设置充放电的类型
    this.setDiagramByType();
  },
  destroyed() {
    // 关闭更新
    diagram.stop();
  },
};
</script>
<style scoped>
.diagram-wrapper-hdw {
  height: 100%;
  padding-left: 220px;
}
.diagram-panel {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 99;
}
.diagram-panel-list {
  padding: 4px 16px;
}
.diagram-panel-item {
  font-size: 14px;
  line-height: 28px;
  color: #FFE329;
}
</style>
src/views/dataTest/components/diagrams/load/buscouple/js/diagramStatus.js
File was renamed from src/views/dataTest/components/diagrams/load/js/diagramStatus.js
@@ -252,7 +252,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/load/buscouple/js/loadCircuitDiagram.js
New file
@@ -0,0 +1,1092 @@
import Diagram from '@/views/dataTest/diagram'
import eleGroupImage from '@/views/dataTest/diagram/images/elegroup.png'
import loaderImage from '@/views/dataTest/diagram/images/load.png'
import screenImage from '@/views/dataTest/diagram/images/screen.png'
import lightSuccessImage from '@/views/dataTest/diagram/images/light-success.png'
import chargeSuccessImage from '@/views/dataTest/diagram/images/charge-success.png'
const textFont = 20;
function loadCircuitDiagram(stc, flush) {
  let diagram = new Diagram();
  diagram.setCanvas(stc, flush);
  // let start = [280, 40]
  let start = [0, 40]
  // 虚线1
  let dashPoints1 = diagram.dashLine({
    strokeStyle: '#50cef5',
    points: [
      start,
      // [950, start[1]],
      [620, start[1]],
    ]
  });
  // 虚线2
  let dashPoints2 = diagram.dashLine({
    strokeStyle: '#50cef5',
    points: [
      dashPoints1[1],
      [dashPoints1[1][0], diagram.height - start[1]],
    ]
  });
  // 虚线3
  let dashPoints3 = diagram.dashLine({
    strokeStyle: '#50cef5',
    points: [
      dashPoints2[1],
      [start[0], dashPoints2[1][1]],
    ]
  });
  // 虚线4
  let dashPoints4 = diagram.dashLine({
    strokeStyle: '#50cef5',
    points: [
      dashPoints3[1],
      start,
    ],
  });
  // 充放电单元配置项
  let options = {
    top: start,
    bottom: dashPoints3[0],
    start: [start[0] + 15, diagram.height / 3]
  };
  // 绘制充放电单元
  let chargeAndDischarge = drawChargeAndDischarge(diagram, options);
  // 绘制蓄电池组单元
  let battGroup = drawBattGroup(diagram, chargeAndDischarge);
  // 绘制负载模块
  let loaderModuleInfo = loaderMoudle(diagram, battGroup);
  // 母联开关
  buscoupleMoudle(diagram, loaderModuleInfo);
  // 设置页面中的文本
  setDiagramTexts(diagram);
  return diagram;
}
// 充放电单元
function drawChargeAndDischarge(diagram, options) {
  let start = options.start;
  // 对角边界
  let top = options.top;
  let bottom = options.bottom;
  // 基础配置
  let springGreen = "#50cef5";
  let red = '#b370fe';
  let lineWidth = 3;
  // 线条1
  let line1 = diagram.line({
    id: 'line1-3',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    hide: true,
    points: [
      start,
      [start[0] + 40, start[1]]
    ]
  });
  // 充放电单元
  let chargeAndDischarge = diagram.chargeAndDischarge({
    hide: true,
    point: line1[1]
  });
  // 放电单元状态
  let dischargeState = diagram.drawImage({
    id: 'dischargeState',
    flush: true,
    hide: true,
    url: lightSuccessImage,
    point: [chargeAndDischarge[0][0] - 50, chargeAndDischarge[0][1] + 50],
    // width: 24,
    // height: 24*469/471
    width: 22,
    height: 46
  });
  // 放电单元文本
  let disCharge_text = diagram.text({
    text: '放电单元',
    baseline: 'middle',
    fontSize: 16,
    hide: true,
    point: [dischargeState.right[0] + 4, dischargeState.right[1]]
  });
  // 充电单元状态
  let chargeState = diagram.drawImage({
    id: 'chargeState',
    flush: true,
    hide: true,
    url: chargeSuccessImage,
    point: [chargeAndDischarge[1][0] - 50, chargeAndDischarge[1][1] + 50],
    width: dischargeState.width,
    height: dischargeState.height
  });
  // 充电单元文本
  let charge_text = diagram.text({
    text: '限流单元',
    baseline: 'middle',
    fontSize: 16,
    hide: true,
    point: [chargeState.right[0] + 4, chargeState.right[1]]
  });
  // 线条2
  let line2 = diagram.line({
    id: 'line1',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      chargeAndDischarge[0],
      [chargeAndDischarge[0][0], top[1] + 30]
    ]
  });
  // 线的高度
  let lineHt = line2[0][1] - line2[1][1];
  // 线条3
  let line3 = diagram.line({
    id: 'line2',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      line2[1],
      [chargeAndDischarge[1][0], line2[1][1]]
    ]
  });
  // 线条4
  let line4 = diagram.line({
    id: 'line3',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      line3[1],
      [chargeAndDischarge[1][0], chargeAndDischarge[1][1]]
    ]
  });
  // 线条5
  let line5 = diagram.line({
    id: 'line4',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      chargeAndDischarge[2],
      [chargeAndDischarge[2][0], chargeAndDischarge[2][1] + lineHt]
    ]
  });
  // 线条6
  let line6 = diagram.line({
    id: 'line5',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      line5[1],
      [chargeAndDischarge[3][0], line5[1][1]]
    ]
  });
  // 线条7
  let line7 = diagram.line({
    id: 'line6',
    strokeStyle: red,
    lineWidth: lineWidth,
    hide: true,
    points: [
      line6[1],
      [chargeAndDischarge[3][0], chargeAndDischarge[3][1]]
    ]
  });
  // 线条8
  let line8 = diagram.line({
    id: 'line7',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line6[0],
      [line6[0][0] + 120, line6[0][1]]
    ]
  });
  // 线条9
  let line9 = diagram.line({
    id: "line1-1",
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    hide: true,
    points: [
      [line8[1][0], bottom[1] - 80],
      [line1[0][0], bottom[1] - 80]
    ]
  });
  // 线条10
  let line10 = diagram.line({
    id: "line1-2",
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    hide: true,
    points: [
      line9[1],
      line1[0]
    ]
  });
  let onOff1 = diagram.onOff({
    id: 'km2',
    point: line8[1],
    direction: 'right',
    state: false,
    flush: true,
  });;
  // 设置km2的文本
  let middle = (onOff1.arc2.bottom[0] - onOff1.arc1.bottom[0]) / 2;
  let onOff1_text1 = diagram.text({
    text: 'k2',
    align: 'center',
    fontSize: 16,
    point: [onOff1.arc1.bottom[0] + middle, onOff1.arc1.bottom[1] + 8]
  });
  let onOff2 = diagram.onOff({
    id: 'km3',
    point: line9[0],
    direction: 'right',
    state: false,
    flush: true
  });
  let onOff2_text1 = diagram.text({
    text: 'k3',
    align: 'center',
    fontSize: 16,
    point: [onOff2.arc1.bottom[0] + middle, onOff2.arc1.bottom[1] + 8]
  });
  // 充电电源模块
  let chargeRect = diagram.drawRect({
    point: [start[0], start[1] - 60],
  });
  // 充电单元状态
  let chargeStateRect = diagram.drawImage({
    id: 'chargeStateRect',
    flush: true,
    url: chargeSuccessImage,
    point: [chargeRect.top[0] - 50, chargeRect.top[1] + 40],
    width: dischargeState.width,
    height: dischargeState.height
  });
  // 充电单元文本
  let chargeRectText = diagram.text({
    text: '限流单元',
    baseline: 'middle',
    fontSize: 16,
    point: [chargeStateRect.right[0] + 4, chargeStateRect.right[1]]
  });
  let line12 = diagram.line({
    id: "line12-1",
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      chargeRect.top,
      [chargeRect.top[0], line3[0][1]]
    ]
  });
  let line13 = diagram.line({
    id: "line13-1",
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      chargeRect.bottom,
      [chargeRect.bottom[0], line6[0][1]]
    ]
  });
  let line15 = diagram.line({
    id: "line15-1",
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line13[1],
      [line6[0][0], line13[1][1]]
    ]
  });
  let line14 = diagram.line({
    id: "line14-1",
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line12[1],
      [line3[1][0], line12[1][1]]
    ]
  });
  // 充电电源模块
  let loaderRect = diagram.drawRect({
    point: [line13[1][0] - 60, line13[1][1] + 40],
  });
  // 充电单元状态
  let loaderStateRect = diagram.drawImage({
    id: 'loaderStateRect',
    flush: true,
    url: lightSuccessImage,
    point: [loaderRect.top[0] - 50, loaderRect.top[1] + 40],
    width: dischargeState.width,
    height: dischargeState.height
  });
  // 充电单元文本
  let loaderRectText = diagram.text({
    text: '假负载模块',
    baseline: 'middle',
    fontSize: 16,
    point: [loaderStateRect.right[0] + 4, loaderStateRect.right[1]]
  });
  let line16 = diagram.line({
    id: "line16-1",
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line13[1],
      loaderRect.top
    ]
  });
  let line17 = diagram.line({
    id: "line17-1",
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      loaderRect.bottom,
      [loaderRect.bottom[0], line9[0][1]]
    ]
  });
  let line18 = diagram.line({
    id: "line18-1",
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      line9[0],
      [loaderRect.bottom[0], line9[0][1]]
    ]
  });
  return {
    top: top,
    bottom: bottom,
    springGreen: springGreen,
    red: red,
    line3: line3,
    onOff1: onOff1,
    onOff2: onOff2,
  }
}
// 蓄电池组单元
function drawBattGroup(diagram, options) {
  let start = options.line3[1];
  // 对角边界
  let top = options.top;
  let bottom = options.bottom;
  // 基础配置
  let springGreen = options.springGreen;
  let red = options.red;
  let lineWidth = 3;
  // BAT1
  let bat1 = diagram.bat({
    strokeStyle: springGreen,
    point: [bottom[0] - 20, start[1]]
  });
  // 线条1
  let line1 = diagram.line({
    id: 'line8',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      start,
      bat1.left,
    ]
  });
  // BAT2
  let bat2 = diagram.bat({
    strokeStyle: springGreen,
    point: [bottom[0] - 20, options.onOff1.arc2.right[1]]
  });
  // 线条2
  let line2 = diagram.line({
    id: 'line9',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      options.onOff1.arc2.right,
      bat2.left,
    ]
  });
  // BAT3
  let bat3 = diagram.bat({
    fillStyle: '#000000',
    strokeStyle: springGreen,
    point: [bottom[0] - 20, options.onOff2.arc2.right[1]]
  });
  // 线条3
  let line3 = diagram.line({
    id: 'line19-1',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      options.onOff2.arc2.right,
      bat3.left,
    ]
  });
  // 线条4
  let line4 = diagram.line({
    id: 'line10',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      bat2.right,
      [bat2.right[0] + 60, bat2.right[1]],
    ]
  });
  // 线条5
  let line5 = diagram.line({
    id: 'line11',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line4[1],
      [line4[1][0], line4[1][1] + 30],
    ]
  });
  // 绘制电池组1
  // let width1 = 70;
  let width1 = 37;
  let height1 = 61;
  let eleGroup1 = diagram.drawImage({
    id: 'eleGroup1',
    point: [line5[1][0] - width1 / 2, line5[1][1]],
    url: eleGroupImage,
    width: width1,
    // height: width1*25/61,
    height: height1,
  });
  // 绘制正极
  diagram.text({
    text: '+',
    point: [eleGroup1.right[0] + 6, eleGroup1.right[1] - 30],
    fontSize: 24,
  });
  // 绘制虚线
  let dashLine1 = diagram.dashLine({
    strokeStyle: springGreen,
    lineWidth: 4,
    points: [
      eleGroup1.bottom,
      [eleGroup1.bottom[0], eleGroup1.bottom[1] + 20]
    ],
  });
  // 电池组2
  let eleGroup2 = diagram.drawImage({
    id: 'eleGroup2',
    point: [dashLine1[1][0] - width1 / 2, dashLine1[1][1]],
    url: eleGroupImage,
    width: eleGroup1.width,
    height: eleGroup1.height,
  });
  // 绘制负极
  diagram.text({
    text: '-',
    point: [eleGroup2.right[0] + 6, eleGroup2.right[1] + 10],
    fontSize: 28,
  });
  // 绘制电池组的文本
  let group_text1 = diagram.text({
    text: '电&池&组',
    point: [eleGroup1.right[0] + 6, eleGroup1.right[1] + 4],
    fontSize: 16,
  });
  // 线条6
  let line6 = diagram.line({
    id: 'line12',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      eleGroup2.bottom,
      [eleGroup2.bottom[0], bat3.right[1]],
    ]
  });
  // 线条7
  let line7 = diagram.line({
    id: 'line20-1',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      bat3.right,
      line6[1],
    ]
  });
  // 线条8
  let left1 = 80;
  let line8 = diagram.line({
    id: 'line13',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      [line2[0][0] + left1, line1[0][1]],
      [line2[0][0] + left1, line1[0][1] + 160],
    ]
  });
  // km1
  let onOff3 = diagram.onOff({
    id: 'km1',
    point: line8[1],
    direction: 'bottom',
    state: false,
    flush: true
  });
  // km1文本
  let onOFF3_text = diagram.text({
    text: 'k1',
    align: 'end',
    fontSize: 16,
    point: [onOff3.arc1.left[0] - 8, onOff3.arc1.left[1] + 10]
  });
  // lin9
  let line9 = diagram.line({
    id: 'line14',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      onOff3.arc2.bottom,
      [onOff3.arc2.bottom[0], line2[0][1]]
    ]
  });
  // line131
  let line131y = line8[0][1] + (line8[1][1] - line8[0][1]) / 2;
  let diodeOffsetX = 100;
  let line131 = diagram.line({
    id: 'line131',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      [line8[0][0], line131y],
      [line8[0][0] + diodeOffsetX, line131y],
    ]
  });
  // line132
  let line132 = diagram.line({
    id: 'line132',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line131[1],
      [line131[1][0], line131[1][1] + 70]
    ]
  });
  // 绘制二极管
  let diode = diagram.diode({
    point: line132[1],
  });
  // line141
  let line141y = line9[0][1] + (line9[1][1] - line9[0][1]) / 2;
  let line141 = diagram.line({
    id: 'line141',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      [line9[0][0], line141y],
      [line9[0][0] + diodeOffsetX, line141y],
    ]
  });
  // line142
  let line142 = diagram.line({
    id: 'line142',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      diode.bottom,
      line141[1]
    ]
  });
  return {
    bat1: bat1,
    line6: line6,
    springGreen: springGreen,
    red: red,
    lineWidth: lineWidth
  };
}
// 负载单元
function loaderMoudle(diagram, options) {
  // 基础配置
  // let right = 80;
  let right = 400;
  let start = options.bat1.right;
  let springGreen = options.springGreen;
  let lineWidth = options.lineWidth;
  let red = options.red;
  let end = options.line6[1];
  let middle = (diagram.width - right - start[0]) / 2;
  // 绘制线1
  let line1 = diagram.line({
    id: 'line15',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      start,
      [start[0] + middle, start[1]]
    ]
  });
  // 绘制线2
  let line2 = diagram.line({
    id: 'line16',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line1[1],
      [diagram.width - right, line1[1][1]]
    ]
  });
  // 负载电流
  diagram.text({
    id: 'loadCurr',
    flush: true,
    fontSize: 16,
    align: 'left',
    point: [line2[0][0] - 10, line2[0][1] - 25],
    text: '实际负载电流:??A',
  });
  // // 核容电流
  // diagram.text({
  //     id: 'disCurrMax',
  //     flush: true,
  //     fontSize: 16,
  //     align: 'left',
  //     point: [line2[0][0]-10, line2[0][1]-25],
  //     text: '最大核容电流:??A',
  // });
  let lineHeight = 220;
  // 绘制线3
  let line3 = diagram.line({
    id: 'line17',
    strokeStyle: red,
    lineWidth: lineWidth + 3,
    points: [
      line2[1],
      [line2[1][0], line2[1][1] + lineHeight],
    ]
  });
  // 绘制负载
  let loaderWidth = 86;
  let loader = diagram.drawImage({
    url: loaderImage,
    point: [line3[1][0] - loaderWidth / 2, line3[1][1] - 3],
    width: loaderWidth,
    height: loaderWidth * 248 / 136
  });
  // 负载文本
  let loader_text1 = diagram.text({
    text: "用&电&负&载",
    fontSize: 16,
    point: [loader.right[0] + 4, loader.right[1] - 30],
  });
  // 绘制线4
  let line4 = diagram.line({
    id: 'line18',
    strokeStyle: springGreen,
    lineWidth: lineWidth + 3,
    points: [
      loader.bottom,
      [loader.bottom[0], end[1]],
    ]
  });
  // 绘制线5
  let line5 = diagram.line({
    id: 'line19',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      line4[1],
      [line1[1][0], line4[1][1]],
    ]
  });
  // 绘制线6
  let line6 = diagram.line({
    id: 'line20',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      line5[1],
      end,
    ]
  });
  // 绘制线7
  let line7 = diagram.line({
    id: 'line21',
    strokeStyle: red,
    lineWidth: lineWidth + 3,
    points: [
      line1[1],
      [line1[1][0], line1[1][1] + lineHeight], ,
    ]
  });
  // 绘制整流器
  let screen = diagram.drawImage({
    url: screenImage,
    point: [line7[1][0] - loaderWidth / 2, line7[1][1] - 3],
    width: loaderWidth,
    height: loaderWidth * 248 / 151
  });
  // 整流器文本
  let screen_text1 = diagram.text({
    text: "整&流&器",
    fontSize: 16,
    point: [screen.right[0] + 4, screen.right[1] - 20],
  });
  // 绘制线8
  let line8 = diagram.line({
    id: 'line22',
    strokeStyle: springGreen,
    lineWidth: lineWidth + 3,
    points: [
      screen.bottom,
      line5[1],
    ]
  });
  return {
    end: line2[1],
    line16: line2[1],
    line19: line5[0],
    line17: line3[1],
    red: red,
    springGreen: springGreen,
    lineWidth: lineWidth,
  }
}
function setDiagramTexts(diagram) {
  // 设备温度
  let line3 = diagram.getOption('line3').points;
  let line13 = diagram.getOption('line13').points;
  let offset1 = (line13[0][0] - line3[0][0]) / 2;
  diagram.text({
    id: 'devTemp',
    flush: true,
    baseline: 'top',
    align: 'center',
    fontSize: textFont,
    point: [line3[0][0] + offset1, line3[0][1] + 16],
    text: '设备温度:0℃'
  });
  // 电流
  // let line15 = diagram.getOption('line15').points;
  // let offset2 = (line15[1][0] - line15[0][0])/2;
  // diagram.text({
  //     id: 'battCurr',
  //     flush: true,
  //     baseline: 'top',
  //     align: 'center',
  //     fontSize: textFont,
  //     point: [line15[0][0]+offset2, line15[0][1]+16],
  //     text: '0.00A'
  // });
  // 在线电压
  let line16 = diagram.getOption('line16').points;
  let offset3 = (line16[1][0] - line16[0][0]) / 2;
  diagram.text({
    id: 'onlineVol',
    flush: true,
    baseline: 'top',
    align: 'center',
    fontSize: textFont,
    point: [line16[0][0] + offset3, line16[0][1] + 32],
    text: '0.00V'
  });
  // 组端电压
  let line11 = diagram.getOption('line11').points;
  diagram.text({
    id: 'groupVol',
    flush: true,
    baseline: 'bottom',
    align: 'left',
    fontSize: textFont,
    point: [line11[1][0] + 8, line11[1][1] - 32],
    text: '0.00V'
  });
  // 电流
  diagram.text({
    id: 'battCurr',
    flush: true,
    baseline: 'bottom',
    align: 'left',
    fontSize: textFont,
    point: [line11[1][0] + 8, line11[1][1] - 4],
    text: '0.00A'
  });
  // 设置电路图类型
  diagram.text({
    id: 'type',
    flush: true,
    fontSize: textFont,
    align: 'center',
    point: [diagram.width / 2, 10],
    text: '设备未连接',
  });
}
function buscoupleMoudle(diagram, options) {
  let start = options.line16;
  let end = options.line19;
  let red = options.red;
  let springGreen = options.springGreen;
  let lineWidth = options.lineWidth;
  let margin = 120;
  let hPoint = options.line17;
  let line1 = diagram.line({
    id: 'bLine1',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      start,
      [start[0] + margin - 40, start[1]]
    ]
  });
  let onOff4 = diagram.onOff({
    id: 'km4',
    point: line1[1],
    direction: 'right',
    state: false,
    flush: true
  });
  let middle = (onOff4.arc2.bottom[0] - onOff4.arc1.bottom[0]) / 2;
  let line2 = diagram.line({
    id: 'bLine2',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      onOff4.arc2.right,
      [onOff4.arc2.right[0] + margin - 70, onOff4.arc2.right[1]]
    ]
  });
  let line3 = diagram.line({
    id: 'bLine3',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line2[1],
      [line2[1][0] + margin + 40, line2[1][1]]
    ]
  });
  let line4 = diagram.line({
    id: 'bLine4',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line3[1],
      [line3[1][0], hPoint[1]],
    ]
  });
  // 绘制负载
  let loaderWidth = 86;
  let loader = diagram.drawImage({
    url: loaderImage,
    point: [line4[1][0] - loaderWidth / 2, line4[1][1] - 3],
    width: loaderWidth,
    height: loaderWidth * 248 / 136
  });
  // 负载文本
  let loader_text1 = diagram.text({
    text: "用&电&负&载",
    fontSize: 16,
    point: [loader.right[0] + 4, loader.right[1] - 30],
  });
  let line5 = diagram.line({
    id: 'bLine5',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      loader.bottom,
      [loader.bottom[0], end[1]],
    ]
  });
  let line6 = diagram.line({
    id: 'bLine6',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      line5[1],
      [line3[0][0], line5[1][1]],
    ]
  });
  let line7 = diagram.line({
    id: 'bLine7',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      line6[1],
      [line2[0][0], line6[1][1]],
    ]
  });
  let line8 = diagram.line({
    id: 'bLine8',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      end,
      [line1[1][0], end[1]]
    ]
  });
  let onOff5 = diagram.onOff({
    id: 'km5',
    point: line8[1],
    direction: 'right',
    state: false,
    flush: true
  });
  let line9 = diagram.dashLine({
    id: 'bLine9',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      [onOff5.arc1.left[0] + middle, onOff5.arc1.left[1]],
      [onOff5.arc1.left[0] + middle, loader.bottom[1] - 30]
    ]
  });
  diagram.text({
    text: '母&联&开&关',
    align: 'center',
    fontSize: 16,
    point: [line9[1][0], line9[1][1] - 82]
  });
  diagram.dashLine({
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      [line9[1][0], line9[1][1] - 90],
      [onOff4.arc1.left[0] + middle, onOff4.arc1.left[1]],
    ]
  });
  let line10 = diagram.line({
    id: 'bLine10',
    strokeStyle: red,
    lineWidth: lineWidth,
    points: [
      line2[1],
      [line2[1][0], line4[1][1]],
    ]
  });
  // 绘制整流器
  let screen = diagram.drawImage({
    url: screenImage,
    point: [line10[1][0] - loaderWidth / 2, line10[1][1] - 3],
    width: loaderWidth,
    height: loaderWidth * 248 / 151
  });
  // 整流器文本
  let screen_text1 = diagram.text({
    text: "整&流&器",
    fontSize: 16,
    point: [screen.right[0] + 4, screen.right[1] - 20],
  });
  let line11 = diagram.line({
    id: 'bLine11',
    strokeStyle: springGreen,
    lineWidth: lineWidth,
    points: [
      screen.bottom,
      line6[1],
    ]
  });
}
export default loadCircuitDiagram;
src/views/dataTest/components/diagrams/load/index.vue
@@ -1,43 +1,31 @@
<template>
  <div class="diagram-content">
    <div class="diagram-panel">
      <flex-box no-header size="mini" v-if="false">
        <div class="diagram-panel-list">
          <div class="diagram-panel-item">
            环境温度:0℃
          </div>
          <div class="diagram-panel-item">
            环境湿度:0℃
          </div>
        </div>
      </flex-box>
    </div>
    <div class="diagram-stc" ref="static"></div>
    <div class="diagram-flush" ref="flush"></div>
  </div>
  <buscouple
    v-if="isHasBuscouple"
    :online-vol="onlineVol"
    :group-vol="groupVol"
    :batt-curr="battCurr"
    :dev-temp="devTemp"
    :type="type"
    :update="update"
    :buscouple-switch="buscoupleSwitch"></buscouple>
  <no-buscouple
    v-else
    :online-vol="onlineVol"
    :group-vol="groupVol"
    :batt-curr="battCurr"
    :dev-temp="devTemp"
    :type="type"
    :update="update"></no-buscouple>
</template>
<script>
// 假负载电路图和电流
import loadCircuitDiagram from "./js/loadCircuitDiagram";
import diagramStates from "./js/diagramStatus";
import FlexBox from "@/components/FlexBox";
import const_digit from "@/assets/js/const/const_digit";
const {
  cap: CAP,
  vol: VOL,
  curr: CURR,
  res: RES,
  conduct: CONDUCT,
  temp: TEMP,
  hum: HUM,
} = const_digit;
let diagram;
import buscouple from "./buscouple";
import noBuscouple from "./noBuscouple";
export default {
  components: {FlexBox},
  components: {
    noBuscouple,
    buscouple
  },
  props: {
    onlineVol: {
      // 在线电压
@@ -67,118 +55,33 @@
      type: Boolean,
      default: true,
    },
    loadCurr: {
      type: [String, Number],
      default: "??",
    /**
     * 0:不带母联(一拖一),限流充电单元充电框图
     * 1:带母联(即1拖2),限流充电单元充电框图
     * 2:不带母联(一拖一),逆变充电框图
     * 3: 带母联(即1拖2),逆变充电框图
     */
    devType: {
      type: Number,
      default: 0,
    },
    disCurrMax: {
      type: [String, Number],
      default: "??",
    buscoupleSwitch: {
      type: Number,
      default: 0,
    },
  },
  watch: {
    onlineVol(val) {
      diagram.setOption("onlineVol", "text", val.toHold(VOL) + "V");
    },
    groupVol(val) {
      diagram.setOption("groupVol", "text", val.toHold(VOL) + "V");
    },
    battCurr(val) {
      diagram.setOption("battCurr", "text", val.toHold(CURR) + "A");
    },
    devTemp(val) {
      diagram.setOption("devTemp", "text", "设备温度:" + val.toHold(TEMP) + "℃");
    },
    type(val) {
      this.setDiagramByType();
    },
    update(val) {
      if (val) {
        diagram.start(true);
      } else {
        diagram.stop();
      }
    },
    loadCurr(val) {
      diagram.setOption("loadCurr", "text", "实际负载电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
    disCurrMax(val) {
      diagram.setOption("disCurrMax", "text", "最大核容电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
  data() {
    return {};
  },
  methods: {
    init() {
      // 设置在线,组端,电流,和温度
      diagram.setOption("onlineVol", "text", this.onlineVol.toHold(VOL) + "V");
      diagram.setOption("groupVol", "text", this.groupVol.toHold(VOL) + "V");
      diagram.setOption("battCurr", "text", this.battCurr.toHold(CURR) + "A");
      diagram.setOption("devTemp", "text", "设备温度:" + this.devTemp.toHold(TEMP) + "℃");
      diagram.setOption(
        "loadCurr",
        "text",
        "实际负载电流:" + (this.loadCurr == this.loadCurr * 1 ? (this.loadCurr * 1).toHold(CURR) : this.loadCurr) + "A"
      );
      diagram.setOption(
        "disCurrMax",
        "text",
        "最大核容电流:" + (this.disCurrMax == this.disCurrMax * 1 ? (this.disCurrMax * 1).toHold(CURR) : this.disCurrMax) + "A"
      );
      // 设置更新状态
      if (!this.update) {
        diagram.stop();
      }
    },
    setDiagramByType() {
      let type = this.type;
      switch (type) {
        case -1:
          diagramStates(diagram, "break");
          break;
        case 0:
          diagramStates(diagram, "float");
          break;
        case 1:
          diagramStates(diagram, "discharge");
          break;
        case 2:
          diagramStates(diagram, "charge");
          break;
        case 5:
          diagramStates(diagram, "powerCutDischarge");
          break;
        default:
          diagramStates(diagram, "");
          break;
      }
    },
  methods: {},
  computed: {
    isHasBuscouple() {
      return this.devType == 1 || this.devType == 3?true:false;
    }
  },
  mounted() {
    diagram = loadCircuitDiagram(this.$refs.static, this.$refs.flush);
    // 初始化数据
    this.init();
    // 设置充放电的类型
    this.setDiagramByType();
  },
  mounted() {},
  destroyed() {
    // 关闭更新
    diagram.stop();
  },
};
</script>
<style scoped>
.diagram-panel {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 99;
}
.diagram-panel-list {
  padding: 4px 16px;
}
.diagram-panel-item {
  font-size: 14px;
  line-height: 28px;
  color: #FFE329;
}
</style>
src/views/dataTest/components/diagrams/load/noBuscouple/index.vue
New file
@@ -0,0 +1,184 @@
<template>
  <div class="diagram-content">
    <div class="diagram-panel">
      <flex-box no-header size="mini" v-if="false">
        <div class="diagram-panel-list">
          <div class="diagram-panel-item">
            环境温度:0℃
          </div>
          <div class="diagram-panel-item">
            环境湿度:0℃
          </div>
        </div>
      </flex-box>
    </div>
    <div class="diagram-stc" ref="static"></div>
    <div class="diagram-flush" ref="flush"></div>
  </div>
</template>
<script>
// 假负载电路图和电流
import loadCircuitDiagram from "./js/loadCircuitDiagram";
import diagramStates from "./js/diagramStatus";
import FlexBox from "@/components/FlexBox";
import const_digit from "@/assets/js/const/const_digit";
const {
  cap: CAP,
  vol: VOL,
  curr: CURR,
  res: RES,
  conduct: CONDUCT,
  temp: TEMP,
  hum: HUM,
} = const_digit;
let diagram;
export default {
  components: {FlexBox},
  props: {
    onlineVol: {
      // 在线电压
      type: [String, Number],
      default: 0,
    },
    groupVol: {
      // 组端电压
      type: [String, Number],
      default: 0,
    },
    battCurr: {
      // 电池电流
      type: [String, Number],
      default: 0,
    },
    devTemp: {
      // 设备温度
      type: [String, Number],
      default: 0,
    },
    type: {
      type: Number,
      default: -1,
    },
    update: {
      type: Boolean,
      default: true,
    },
    loadCurr: {
      type: [String, Number],
      default: "??",
    },
    disCurrMax: {
      type: [String, Number],
      default: "??",
    },
  },
  watch: {
    onlineVol(val) {
      diagram.setOption("onlineVol", "text", val.toHold(VOL) + "V");
    },
    groupVol(val) {
      diagram.setOption("groupVol", "text", val.toHold(VOL) + "V");
    },
    battCurr(val) {
      diagram.setOption("battCurr", "text", val.toHold(CURR) + "A");
    },
    devTemp(val) {
      diagram.setOption("devTemp", "text", "设备温度:" + val.toHold(TEMP) + "℃");
    },
    type(val) {
      this.setDiagramByType();
    },
    update(val) {
      if (val) {
        diagram.start(true);
      } else {
        diagram.stop();
      }
    },
    loadCurr(val) {
      diagram.setOption("loadCurr", "text", "实际负载电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
    disCurrMax(val) {
      diagram.setOption("disCurrMax", "text", "最大核容电流:" + (val == val * 1 ? (val * 1).toHold(CURR) : val) + "A");
    },
  },
  methods: {
    init() {
      // 设置在线,组端,电流,和温度
      diagram.setOption("onlineVol", "text", this.onlineVol.toHold(VOL) + "V");
      diagram.setOption("groupVol", "text", this.groupVol.toHold(VOL) + "V");
      diagram.setOption("battCurr", "text", this.battCurr.toHold(CURR) + "A");
      diagram.setOption("devTemp", "text", "设备温度:" + this.devTemp.toHold(TEMP) + "℃");
      diagram.setOption(
        "loadCurr",
        "text",
        "实际负载电流:" + (this.loadCurr == this.loadCurr * 1 ? (this.loadCurr * 1).toHold(CURR) : this.loadCurr) + "A"
      );
      diagram.setOption(
        "disCurrMax",
        "text",
        "最大核容电流:" + (this.disCurrMax == this.disCurrMax * 1 ? (this.disCurrMax * 1).toHold(CURR) : this.disCurrMax) + "A"
      );
      // 设置更新状态
      if (!this.update) {
        diagram.stop();
      }
    },
    setDiagramByType() {
      let type = this.type;
      switch (type) {
        case -1:
          diagramStates(diagram, "break");
          break;
        case 0:
          diagramStates(diagram, "float");
          break;
        case 1:
          diagramStates(diagram, "discharge");
          break;
        case 2:
          diagramStates(diagram, "charge");
          break;
        case 5:
          diagramStates(diagram, "powerCutDischarge");
          break;
        default:
          diagramStates(diagram, "");
          break;
      }
    },
  },
  mounted() {
    diagram = loadCircuitDiagram(this.$refs.static, this.$refs.flush);
    // 初始化数据
    this.init();
    // 设置充放电的类型
    this.setDiagramByType();
  },
  destroyed() {
    // 关闭更新
    diagram.stop();
  },
};
</script>
<style scoped>
.diagram-panel {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 99;
}
.diagram-panel-list {
  padding: 4px 16px;
}
.diagram-panel-item {
  font-size: 14px;
  line-height: 28px;
  color: #FFE329;
}
</style>
src/views/dataTest/components/diagrams/load/noBuscouple/js/diagramStatus.js
copy from src/views/dataTest/components/diagrams/load/js/diagramStatus.js copy to src/views/dataTest/components/diagrams/load/noBuscouple/js/diagramStatus.js
File was copied from src/views/dataTest/components/diagrams/load/js/diagramStatus.js
@@ -252,7 +252,7 @@
// 浮充状态
function floatCharge(diagram) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 关闭km1
  diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/load/noBuscouple/js/loadCircuitDiagram.js
src/views/dataTest/components/diagrams/loadReverse/buscouple/js/diagramStatus.js
@@ -276,7 +276,7 @@
// 浮充状态
function floatCharge(diagram) {
    // 设置电路图类型
    diagram.setOption('type', 'text', '在线浮充状态');
    diagram.setOption('type', 'text', '直连充电状态');
    // 关闭km1
    diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/loadReverse/noBuscouple/js/diagramStatus.js
@@ -276,7 +276,7 @@
// 浮充状态
function floatCharge(diagram) {
    // 设置电路图类型
    diagram.setOption('type', 'text', '在线浮充状态');
    diagram.setOption('type', 'text', '直连充电状态');
    // 关闭km1
    diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/normal/js/diagramStates.js
@@ -462,7 +462,7 @@
// 浮充状态
function floatCharge(diagram) {
    // 设置电路图类型
    diagram.setOption('type', 'text', '在线浮充状态');
    diagram.setOption('type', 'text', '直连充电状态');
    // 关闭km1
    diagram.setOption('km1', 'state', true);
src/views/dataTest/components/diagrams/normal9150/js/diagramStates.js
@@ -629,7 +629,7 @@
// 浮充状态
function floatCharge(diagram, bypass) {
  // 设置电路图类型
  diagram.setOption('type', 'text', '在线浮充状态');
  diagram.setOption('type', 'text', '直连充电状态');
  // 线条10
  let line10 = diagram.getOption('line10').points;
src/views/dataTest/diagram/diagramStates.js
@@ -424,7 +424,7 @@
// 浮充状态
function floatCharge(diagram) {
    // 设置电路图类型
    diagram.setOption('type', 'text', '在线浮充状态');
    diagram.setOption('type', 'text', '直连充电状态');
    // 关闭km1
    diagram.setOption('km1', 'state', true);
src/views/dataTest/realTime6186.vue
@@ -82,10 +82,10 @@
          <div class="page-content-tools">
            <!-- 按钮组 -->
            <!-- <el-button type="warning" size="mini" v-if="canStopHr" @click="stopTest">停止{{ systemData.workState == 2 ? "核容"
                            : "充电" }}</el-button>
                          <el-button type="primary" size="mini" v-if="canStopRes" @click="stopResTest">停止内阻测试</el-button>
                          <el-button type="primary" size="mini" v-else :disabled="!canTest"
                            @click="confirmStartResTest">启动内阻测试</el-button> -->
                                    : "充电" }}</el-button>
                                  <el-button type="primary" size="mini" v-if="canStopRes" @click="stopResTest">停止内阻测试</el-button>
                                  <el-button type="primary" size="mini" v-else :disabled="!canTest"
                                    @click="confirmStartResTest">启动内阻测试</el-button> -->
  
            <el-popover placement="bottom" trigger="hover">
              <div class="hdw-menu-list">
@@ -138,18 +138,16 @@
                  </div>
                </science-box>
                <science-box style="position: relative; margin-top: 8px" no-header v-show="
                                                  stateListState &&
                                                  batt.fbsdeviceId &&
                                                  showHistoryStateList.length
                                                ">
                                                          batt.fbsdeviceId
                                                        ">
                  <div class="hdw-state-list table-layout">
                    <div v-for="state in showHistoryStateList" :key="state.text" class="table-row" :class="state.type"
                      v-show="!state.notShow">
                      <div class="table-cell text-right">
                        <i v-if="state.icon" class="iconfont" :class="state.icon"></i>{{ state.text }}
                    <div class="table-row">
                      <div class="table-cell text -right">启动失败原因:
                      </div>
                      <div class="table-cell">
                        {{ state.value }}{{ state.unit }}
                    </div>
                    <div class="table-row">
                      <div class="table-cell text-right">
                        {{ controlFailTypeName }}
                      </div>
                    </div>
                  </div>
@@ -159,8 +157,8 @@
                  v-show="stateListState  && batt.fbsdeviceId">
                  <div class="hdw-state-list table-layout">
                    <div v-for="state in lastCapacityTest.filter(
                                                      (item) => item.show
                                                    )" :key="state.text" class="table-row" :class="state.type">
                                                              (item) => item.show
                                                            )" :key="state.text" class="table-row" :class="state.type">
                      <div class="table-cell text-right">
                        <i v-if="state.icon" class="iconfont" :class="state.icon"></i>{{ state.text }}
                      </div>
@@ -185,12 +183,12 @@
            <el-tab-pane key="res" label="内阻" name="res">
              <bar-chart ref="res" id="res" unit="mΩ" :show-tools="true" @right-click="chartRightCLick"></bar-chart>
              <!-- max-color="red"
                                                          min-color="green" -->
                                                                  min-color="green" -->
            </el-tab-pane>
            <el-tab-pane key="temp" label="温度" name="temp">
              <bar-chart ref="temp" id="temp" unit="℃" :show-tools="true" @right-click="chartRightCLick"></bar-chart>
              <!-- max-color="red"
                                                          min-color="green" -->
                                                                  min-color="green" -->
            </el-tab-pane>
            <el-tab-pane key="curr" label="均衡电流" name="curr">
              <bar-chart ref="curr" id="curr" unit="A" :show-tools="true" @right-click="chartRightCLick">
@@ -212,16 +210,9 @@
            </el-tab-pane>
            <el-tab-pane label="资产信息" name="asset">
              <div class="center-box">
                <batt-asset-info
                  :batt="batt"
                  title="当前电池资产信息"
                ></batt-asset-info>
                <batt-asset-info
                  v-for="(item, key) in battRecords.slice(0, 2)"
                  :key="'key' + key"
                  :batt="item"
                  :title="item.recordTime + '-变更记录'"
                ></batt-asset-info>
                <batt-asset-info :batt="batt" title="当前电池资产信息"></batt-asset-info>
                <batt-asset-info v-for="(item, key) in battRecords.slice(0, 2)" :key="'key' + key" :batt="item"
                  :title="item.recordTime + '-变更记录'"></batt-asset-info>
              </div>
            </el-tab-pane>
          </el-tabs>
@@ -231,8 +222,8 @@
    <!-- 放电参数设置 -->
    <el-dialog title="核容参数设置" width="780px" :visible.sync="dischargeDialog.show" :close-on-click-modal="false" top="0"
      class="dialog-center" :modal-append-to-body="false">
      <hr6186-content v-if="dischargeDialog.show" :batt="batt"
        :workStatus="systemData.workState" @close="closeDisChargeDialog">
      <hr6186-content v-if="dischargeDialog.show" :batt="batt" :workStatus="systemData.workState"
        @close="closeDisChargeDialog">
      </hr6186-content>
    </el-dialog>
    <!-- 实时历史数据 -->
@@ -272,9 +263,9 @@
        <three-station :data="station.data"></three-station>
      </div>
      <!-- <div slot="footer">
                                                    v-if="station.data.stationId"
                                                  <el-button @click="station.show = false">关闭</el-button>
                                                </div> -->
                                                            v-if="station.data.stationId"
                                                          <el-button @click="station.show = false">关闭</el-button>
                                                        </div> -->
    </el-dialog>
    <!-- 机房环境图集 -->
    <el-dialog title="机房环境图集" width="auto" :visible.sync="homeImageDialog" :close-on-click-modal="false" top="0"
@@ -335,7 +326,7 @@
    import { formatSeconds, getBarNum, isHasPermit, getDevType } from "@/assets/js/tools";
    import getMarkLineData from "@/components/chart/js/getMarkLineDataPlus";
  import BattAssetInfo from "@/views/dataMager/components/battAssetInfo.vue";
    import BattAssetInfo from "@/views/dataMager/components/battAssetInfo.vue";
    import getTblHeader from "./js/getTblHeader";
    import ThreeStation from "@/components/threeStation";
@@ -422,6 +413,7 @@
                JSON.stringify(const_61850.lastCapacityTest)
            );
            return {
        controlFailTypeName: "",
                alarmParams: {},
                battInf0: {},
                battInf1: {},
@@ -794,10 +786,43 @@
                        vm.inputs = res.data2;
                        this.diagram.devHumidity = res.data2.devHumidity;
                        this.diagram.devTemperature = res.data2.devTemperature;
                        this.controlFailTypeName = res.data2.controlFailTypeName;
                        // 开启模拟数据
                        if (sysConfig.analogData.value) {
                            vm.inputs.recDatetime = new Date().format("yyyy-MM-dd hh:mm:ss");
                        }
                    }
                }
            },
            // 设置stateList的值
            setStateList(name, value, type) {
                let stateList = this.stateList;
                for (let i = 0; i < stateList.length; i++) {
                    let state = stateList[i];
                    if (state.name == name) {
                        state.value = value;
                        state.type = type ? type : "";
                    }
                }
                let historyStateList = this.historyStateList;
                for (let i = 0; i < historyStateList.length; i++) {
                    let state = historyStateList[i];
                    if (state.name == name) {
                        state.value = value;
                        state.type = type ? type : "";
                    }
                }
                for (
                    let i = 0, list = this.lastCapacityTest, j = list.length;
                    i < j;
                    i++
                ) {
                    let state = list[i];
                    if (state.name == name) {
                        state.value = value;
                        state.type = type || "";
                    }
                }
            },
@@ -825,34 +850,34 @@
                            data.testTimelong > 0
                                ? (data.testCap * 3600) / data.testTimelong
                                : data.testCurr;
                        let over_cap = GetMonomerCap(
                            batt.monCapStd,
                            GetHourRate(batt.monCapStd, avg_curr),
                            data.testCap,
                            batNum.max,
                            batNum.min,
                            batt.monVolStd,
                            0
                        );
                        let real_cap = GetMonomerCap(
                            batt.monCapStd,
                            GetHourRate(batt.monCapStd, avg_curr),
                            data.testCap,
                            batNum.max,
                            batNum.min,
                            batt.monVolStd,
                            1
                        );
                        let xuHang = getXuHang(real_cap, batt.loadCurr);
                        this.lastTimeTestInfo.realCap = real_cap.toHold(CAP) + "Ah";
                        this.lastTimeTestInfo.xuHang = xuHang ? sethoubeiTime(xuHang) : "---";
                        // 剩余容量
                        this.setStateList("re_cap", real_cap.toHold(CAP) + "AH");
                        // 续航时长
                        this.setStateList(
                            "endurance_time",
                            xuHang ? sethoubeiTime(xuHang) : "---"
                        );
                        // let over_cap = GetMonomerCap(
                        //     batt.monCapStd,
                        //     GetHourRate(batt.monCapStd, avg_curr),
                        //     data.testCap,
                        //     batNum.max,
                        //     batNum.min,
                        //     batt.monVolStd,
                        //     0
                        // );
                        // let real_cap = GetMonomerCap(
                        //     batt.monCapStd,
                        //     GetHourRate(batt.monCapStd, avg_curr),
                        //     data.testCap,
                        //     batNum.max,
                        //     batNum.min,
                        //     batt.monVolStd,
                        //     1
                        // );
                        // let xuHang = getXuHang(real_cap, batt.loadCurr);
                        // this.lastTimeTestInfo.realCap = real_cap.toHold(CAP) + "Ah";
                        // this.lastTimeTestInfo.xuHang = xuHang ? sethoubeiTime(xuHang) : "---";
                        // // 剩余容量
                        // this.setStateList("re_cap", real_cap.toHold(CAP) + "AH");
                        // // 续航时长
                        // this.setStateList(
                        //     "endurance_time",
                        //     xuHang ? sethoubeiTime(xuHang) : "---"
                        // );
                    }
                }
            },
@@ -893,7 +918,7 @@
                this.batt = data;
                this.diagram.desc = "";
                // this.diagram.devType = getDevType(data.chargeType, data.buscoupleState);
                this.diagram.devType = getDevType(data.chargeType, data.buscoupleState);
                // 查询机房电池组信息(3D用)
                this.getStationBattInfo(data.stationId);
@@ -967,7 +992,7 @@
                }
            },
            setChartMarkLine(chartData, name, almName, list) {
        let batt = this.batt;
                let batt = this.batt;
                // 遍历list
                for (let i = 0; i < list.length; i++) {
                    let item = list[i];
@@ -1090,7 +1115,7 @@
            // 停止内阻测试
            stopRes() {
        let batt = this.batt;
                let batt = this.batt;
                let loading = this.$layer.loading();
                stopRes6184(batt.fbsdeviceId, batt.groupIndexInFBSDevice + 1).then((res) => {
                    let { code, data } = res.data;
@@ -1184,7 +1209,7 @@
                        break;
                }
                // console.log('type?', this.diagram.type, this.diagram.update, '=============');
            },
            // 基础信息
            setEquipBase(data) {
@@ -1410,7 +1435,7 @@
                );
            },
            stop6184Test() {
        let batt = this.batt;
                let batt = this.batt;
                // 开启等待框
                let loading = this.$layer.loading(1);
                // 请求后台