Commit 002cf9b26a84b151a6e629667b4049760380468b

Authored by 周铨
1 parent 557626b5

联调接口数据和自适应页面数据

... ... @@ -57,7 +57,7 @@ function initChart(canvas: any, width: any, height: any, data: any, dpr: any) {
57 57 yAxis: {
58 58 x: 'center',
59 59 type: 'value',
60   - name: "单位(kwh)",//name
  60 + name: "单位(kWh)",//name
61 61 splitNumber: 3,
62 62 nameTextStyle: {//y轴名字样式
63 63 color: "#999999",
... ...
1 1 {
2 2 "usingComponents": {
  3 + "van-toast": "@vant/weapp/toast/index",
3 4 "commonTop":"./../../components/commonTop/commonTop",
4 5 "topTabbar":"./../../components/topTabbar/topTabbar",
5 6 "topTitle":"./../../components/topTitle/topTitle",
... ...
1 1 // pages/monitor/monitor.ts
2   -
  2 +import Toast from './../../miniprogram_npm/@vant/weapp/toast/toast';
3 3 import { API_CONST } from "./../../api/smartElectric";
  4 +import { getUnitEvent, getCardEvent } from './../../utils/util'
4 5 import { HTTPService as HTTP } from "./../../services/HTTPService";
5 6 Page({
6 7
... ... @@ -24,20 +25,16 @@ Page({
24 25 type: 2
25 26 },
26 27 {
27   - name: "BMS监视",
  28 + name: "充电桩监视",
28 29 type: 3
29 30 },
30 31 {
31   - name: "充电桩监视",
  32 + name: "光伏监视",
32 33 type: 4
33 34 },
34 35 {
35   - name: "充电桩监视",
  36 + name: "电能表监视",
36 37 type: 5
37   - },
38   - {
39   - name: "充电桩监视",
40   - type: 6
41 38 }
42 39 ],
43 40 deviceDataList: [
... ... @@ -45,54 +42,54 @@ Page({
45 42 type: '光伏',
46 43 imgUrl: "./../../img/device_photovoltaic.png",
47 44 dayNumName: "日发电量",
48   - dayNum: "20.21",
49   - unit: "kwh",
50   - totalNum: "320.00",
  45 + dayNum: "0",
  46 + unit: "kWh",
  47 + totalNum: "0",
51 48 totalNumName: "总发电量"
52 49 },
53 50 {
54 51 type: '储能',
55 52 imgUrl: "./../../img/device_energyStorage.png",
56 53 dayNumName: "日发电量",
57   - dayNum: "20.21",
58   - unit: "kwh",
59   - totalNum: "320.00",
  54 + dayNum: "0",
  55 + unit: "kWh",
  56 + totalNum: "0",
60 57 totalNumName: "放发电量"
61 58 },
62 59 {
63 60 type: '电能表',
64 61 imgUrl: "./../../img/device_electricEnergy.png",
65 62 dayNumName: "总有功功率",
66   - dayNum: "20.21",
67   - unit: "kwh",
68   - totalNum: "320.00",
  63 + dayNum: "0",
  64 + unit: "kWh",
  65 + totalNum: "0",
69 66 totalNumName: "总无功功率"
70 67 },
71 68 {
72 69 type: '充电桩',
73 70 imgUrl: "./../../img/device_chargeStation.png",
74 71 dayNumName: "总有功功率",
75   - dayNum: "20.21",
76   - unit: "kwh",
77   - totalNum: "320.00",
  72 + dayNum: "0",
  73 + unit: "kWh",
  74 + totalNum: "0",
78 75 totalNumName: "总无功功率"
79 76 },
80 77 {
81 78 type: '负载',
82 79 imgUrl: "./../../img/device_load.png",
83 80 dayNumName: "总有功功率",
84   - dayNum: "20.21",
85   - unit: "kwh",
86   - totalNum: "320.00",
  81 + dayNum: "0",
  82 + unit: "kWh",
  83 + totalNum: "0",
87 84 totalNumName: "总无功功率"
88 85 },
89 86 {
90 87 type: '风电',
91 88 imgUrl: "./../../img/device_windPower.png",
92 89 dayNumName: "在线状态",
93   - dayNum: "20.21",
  90 + dayNum: "0",
94 91 unit: "",
95   - totalNum: "320.00",
  92 + totalNum: "0",
96 93 totalNumName: "故障状态"
97 94 },
98 95 ],
... ... @@ -101,7 +98,7 @@ Page({
101 98 type: '光伏',
102 99 oneLabelName: "总有功功率",
103 100 oneLabelNum: "20.21",
104   - unit: "kwh",
  101 + unit: "kWh",
105 102 twoLabelNum: "320.00",
106 103 twoLabelName: "总无功功率",
107 104 threeLabelName: "总直流功率",
... ... @@ -111,7 +108,7 @@ Page({
111 108 type: '风电',
112 109 oneLabelName: "总有功功率",
113 110 oneLabelNum: "20.21",
114   - unit: "kwh",
  111 + unit: "kWh",
115 112 twoLabelNum: "320.00",
116 113 twoLabelName: "总无功功率",
117 114 threeLabelName: "A相电流",
... ... @@ -125,7 +122,7 @@ Page({
125 122 type: '充电桩',
126 123 oneLabelName: "充电桩数量",
127 124 oneLabelNum: "20.21",
128   - unit: "kwh",
  125 + unit: "kWh",
129 126 twoLabelNum: "320.00",
130 127 twoLabelName: "桩额功率",
131 128 threeLabelName: "EMS使用",
... ... @@ -136,7 +133,7 @@ Page({
136 133 type: '电网',
137 134 oneLabelName: "总有功功率",
138 135 oneLabelNum: "20.21",
139   - unit: "kwh",
  136 + unit: "kWh",
140 137 twoLabelNum: "320.00",
141 138 twoLabelName: "总无功功率",
142 139 threeLabelName: "A相电流",
... ... @@ -151,7 +148,7 @@ Page({
151 148 type: '储能',
152 149 oneLabelName: "组端SOC",
153 150 oneLabelNum: "20.21",
154   - unit: "kwh",
  151 + unit: "kWh",
155 152 twoLabelNum: "320.00",
156 153 twoLabelName: "交流功率",
157 154 threeLabelName: "母线电压",
... ... @@ -214,63 +211,7 @@ Page({
214 211
215 212 }
216 213 ],
217   -
218   - dashboardList: [// 仪表盘list数据
219   - {
220   - dataList: [{
221   - value: '100',
222   - name: "总电压",
223   - unit: "V"
224   - }],
225   - numColor: "#46B3FD",
226   - unit: "V"
227   - },
228   - {
229   - dataList: [{
230   - value: '100',
231   - name: "总电流",
232   - unit: "V"
233   - }],
234   - numColor: "#46B3FD",
235   - unit: "V"
236   - },
237   - {
238   - dataList: [{
239   - value: '100',
240   - name: "SOC",
241   - unit: "%"
242   - }],
243   - numColor: "#14C9C9",
244   - unit: "%"
245   - },
246   - {
247   - dataList: [{
248   - value: '100',
249   - name: "SOH",
250   - unit: "%"
251   - }],
252   - numColor: "#14C9C9",
253   - unit: "%"
254   - },
255   - {
256   - dataList: [{
257   - value: '100',
258   - name: "允许充电电流",
259   - unit: "A"
260   - }],
261   - numColor: "#28CD6F",
262   - unit: "A"
263   - },
264   - {
265   - dataList: [{
266   - value: '100',
267   - name: "允许放电电流",
268   - unit: "A"
269   - }],
270   - unit: "A",
271   - numColor: "#28CD6F",
272   - },
273   - ],
  214 + dashboardList: [],// 仪表盘list数据,
274 215 tableList: [
275 216 //表格数据
276 217 {
... ... @@ -374,159 +315,7 @@ Page({
374 315 num: "No.189,Grove St,Lot Angeles"
375 316 },
376 317 ],
377   - allcardList: [
378   - {
379   - type: "最大允许放电功率",
380   - num: "100",
381   - unit: "KW"
382   - },
383   - {
384   - type: "电源电阻R-",
385   - num: "100",
386   - unit: "KQ"
387   - },
388   - {
389   - type: "绝缘电阻R+",
390   - num: "100",
391   - unit: "KQ"
392   - },
393   - {
394   - type: "供电电压",
395   - num: "100",
396   - unit: "V"
397   - },
398   - {
399   - type: "最大允许充电电压",
400   - num: "100",
401   - unit: "V"
402   - },
403   - {
404   - type: "单体最高电压",
405   - num: "100",
406   - unit: "V"
407   - },
408   - {
409   - type: "单体平均压差",
410   - num: "100",
411   - unit: "mV"
412   - },
413   - {
414   - type: "单体压差",
415   - num: "100",
416   - unit: "mV"
417   - },
418   - {
419   - type: "单体最高温度",
420   - num: "100",
421   - unit: "°C"
422   - },
423   - {
424   - type: "单体最低温度",
425   - num: "100",
426   - unit: "°C"
427   - },
428   - {
429   - type: "单体平均温度",
430   - num: "100",
431   - unit: "°C"
432   - },
433   - {
434   - type: "单体温度",
435   - num: "100",
436   - unit: "°C"
437   - },
438   - {
439   - type: "极柱最低温度",
440   - num: "100",
441   - unit: "°C"
442   - },
443   - {
444   - type: "极柱平均温度",
445   - num: "100",
446   - unit: "°C"
447   - },
448   - {
449   - type: "极柱温差",
450   - num: "100",
451   - unit: "°C"
452   - },
453   - {
454   - type: "最高电压序号",
455   - num: "100",
456   - unit: ""
457   - },
458   - {
459   - type: "最低电压序号",
460   - num: "100",
461   - unit: ""
462   - },
463   - {
464   - type: "最高温度序号",
465   - num: "100",
466   - unit: ""
467   - },
468   - {
469   - type: "极柱最高温度序号",
470   - num: "100",
471   - unit: ""
472   - },
473   - {
474   - type: "极柱最低温度序号",
475   - num: "100",
476   - unit: ""
477   - },
478   - {
479   - type: "极柱最高温度模块",
480   - num: "100",
481   - unit: ""
482   - },
483   -
484   - {
485   - type: "极柱最低温度模块",
486   - num: "100",
487   - unit: ""
488   - },
489   - {
490   - type: "最高电压模块",
491   - num: "100",
492   - unit: ""
493   - },
494   - {
495   - type: "最低电压模块",
496   - num: "100",
497   - unit: ""
498   - },
499   - {
500   - type: "最低温度模块",
501   - num: "100",
502   - unit: ""
503   - },
504   - {
505   - type: "单次充电电量",
506   - num: "100",
507   - unit: "kwh"
508   - },
509   - {
510   - type: "单词放电电量",
511   - num: "100",
512   - unit: "kwh"
513   - },
514   - {
515   - type: "当日充电电量",
516   - num: "100",
517   - unit: "kwh"
518   - },
519   - {
520   - type: "当日放电电量",
521   - num: "100",
522   - unit: "kwh"
523   - },
524   - {
525   - type: "总电池结数",
526   - num: "100",
527   - unit: ""
528   - },
529   - ],
  318 + allcardList: [],// 卡片list数据
530 319 myLineObj: {
531 320 dataList: [[18, 36, 65, 30, 78, 40, 33], [12, 50, 51, 35, 70, 30, 20]],
532 321 nameList: ['预算', '实际']
... ... @@ -592,29 +381,134 @@ Page({
592 381 onShareAppMessage() {
593 382 console.log('---------------分享一波')
594 383 },
  384 + // getUnitEvent,
  385 + getTypeVal(e: any) {
  386 + switch (e) {
  387 + case 1: //BMS
  388 + return "BMS"
  389 + break;
  390 + case 2: // PCS
  391 + return "PCS"
  392 + break;
  393 + case 3: //充电桩
  394 + return "CP"
  395 + break;
  396 + case 4: //光伏
  397 + return "CP"
  398 + break;
  399 + case 5: //电能表
  400 + return "EM"
  401 + break;
  402 + default:
  403 + return ""
  404 + break;
  405 + }
  406 + },
595 407 tabsItemChange(e: any) {
596   - console.log(e, '----tab传过来的值', e.detail.type)
597   - console.log(this, '-------------this-----------')
  408 + this.setData({
  409 + dashboardList: [],
  410 + allcardList:[]
  411 + })
  412 + // console.log(e, '----tab传过来的值', e.detail.type)
  413 + // console.log(this, '-------------this-----------')
598 414 const idx = e.detail.type
  415 + const idxToName: string = this.getTypeVal(idx)
  416 + // this.allData
  417 + let dashboardListNew: any = [] // 仪表盘数据
  418 + let allcardListNew: any = [] // 所有卡片数据
  419 + dashboardListNew = getUnitEvent(idx, this.data.allData[idxToName])
  420 + allcardListNew = getCardEvent(idx, this.data.allData[idxToName])
599 421 this.setData({
600   - currentIndex: Number(idx)
  422 + currentIndex: Number(idx),
  423 + dashboardList: dashboardListNew,
  424 + allcardList:allcardListNew
601 425 })
  426 + console.log(dashboardListNew, 'dashboardListdashboardList', this.data.dashboardList)
  427 +
602 428 },
603   - __getOpenQxCustomHczdInde() {
  429 + __getOpenQxCustomHczdInde() {//接口请求
  430 + Toast.loading({
  431 + message: '加载中...',
  432 + forbidClick: true,
  433 + duration: 0, // 持续展示 toast
  434 + });
604 435 HTTP.POST({
605 436 ...API_CONST.home.miniData,
606 437 payload: {
607 438 corpCode: "default"
608 439 }
609 440 }).then((data: any) => {
  441 + Toast.clear()
610 442 console.log(data, '-----------datat')
  443 + let PV = data.data.PV // 光伏
  444 + let BMS = data.data.BMS//储能
  445 + let EM = data.data.EM // 电能表
  446 + const deviceDataList = [
  447 + {
  448 + type: '光伏',
  449 + imgUrl: "./../../img/device_photovoltaic.png",
  450 + dayNumName: "日发电量",
  451 + dayNum: PV.PV23,
  452 + unit: "kWh",
  453 + totalNum: PV.PV28,
  454 + totalNumName: "总发电量"
  455 + },
  456 + {
  457 + type: '储能',
  458 + imgUrl: "./../../img/device_energyStorage.png",
  459 + dayNumName: "日发电量",
  460 + dayNum: BMS.BMS34,
  461 + unit: "kWh",
  462 + totalNum: BMS.BMS35,
  463 + totalNumName: "放发电量"
  464 + },
  465 + {
  466 + type: '电能表',
  467 + imgUrl: "./../../img/device_electricEnergy.png",
  468 + dayNumName: "总有功功率",
  469 + dayNum: EM.EM19,
  470 + unit: "kWh",
  471 + totalNum: "0",
  472 + totalNumName: "总无功功率"
  473 + },
  474 + {
  475 + type: '充电桩',
  476 + imgUrl: "./../../img/device_chargeStation.png",
  477 + dayNumName: "总有功功率",
  478 + dayNum: "0",
  479 + unit: "kWh",
  480 + totalNum: "0",
  481 + totalNumName: "总无功功率"
  482 + },
  483 + {
  484 + type: '负载',
  485 + imgUrl: "./../../img/device_load.png",
  486 + dayNumName: "总有功功率",
  487 + dayNum: "0",
  488 + unit: "kWh",
  489 + totalNum: "0",
  490 + totalNumName: "总无功功率"
  491 + },
  492 + {
  493 + type: '风电',
  494 + imgUrl: "./../../img/device_windPower.png",
  495 + dayNumName: "在线状态",
  496 + dayNum: "0",
  497 + unit: "",
  498 + totalNum: "0",
  499 + totalNumName: "故障状态"
  500 + },
  501 + ]
  502 +
  503 +
  504 +
611 505 this.setData({
612   - allData: data.data
  506 + allData: data.data,
  507 + deviceDataList: deviceDataList,
613 508 })
614 509 const app = getApp();
615   -
616 510 app.globalData.allData = data.data;
617 511
618 512 })
619   - }
  513 + },
620 514 })
\ No newline at end of file
... ...
... ... @@ -13,8 +13,8 @@
13 13 </view>
14 14 <view class="electroc_money_num">
15 15 <text class="electroc_money_text_num">{{allData.allPower
16   - }}</text>
17   - <text class="electroc_money_text_unit">kwh</text>
  16 + ||0}}</text>
  17 + <text class="electroc_money_text_unit">kWh</text>
18 18 </view>
19 19
20 20 </view>
... ... @@ -24,7 +24,7 @@
24 24 </view>
25 25 <view class="electroc_money_num">
26 26 <text class="electroc_money_text_num">{{allData.allAmount
27   - }}</text>
  27 + ||0}}</text>
28 28 <text class="electroc_money_text_unit">万元</text>
29 29 </view>
30 30 </view>
... ... @@ -32,7 +32,7 @@
32 32 </view>
33 33 <view class="deviceStatistics">
34 34 <topTitle topTitleName="设备统计"></topTitle>
35   - <circularDiagram wx:if="{{allData.deviceInfo}}" deviceInfo="{{allData.deviceInfo}}"></circularDiagram>
  35 + <circularDiagram wx:if="{{allData.deviceInfo}}" deviceInfo="{{allData.deviceInfo}}"></circularDiagram>
36 36 <deviceData deviceDataList="{{deviceDataList}}"></deviceData>
37 37 </view>
38 38 <view class="overallOperationStatus">
... ... @@ -76,4 +76,5 @@
76 76
77 77 </view>
78 78 </view>
  79 + <van-toast id="van-toast" />
79 80 </view>
\ No newline at end of file
... ...
... ... @@ -17,3 +17,961 @@ const formatNumber = (n: number) => {
17 17 const s = n.toString()
18 18 return s[1] ? s : '0' + s
19 19 }
  20 +
  21 +//仪表盘数据统一处理
  22 +export const getUnitEvent = (n: number, Obj: any) => {
  23 + let res: any
  24 + if (n === 1) {// BMS
  25 + res = [// 仪表盘list数据
  26 + {
  27 + dataList: [{
  28 + value: Obj.BMS01,
  29 + name: "总电压",
  30 + unit: "V"
  31 + }],
  32 + numColor: "#46B3FD",
  33 + unit: "V"
  34 + },
  35 + {
  36 + dataList: [{
  37 + value: Obj.BMS02,
  38 + name: "总电流",
  39 + unit: "A"
  40 + }],
  41 + numColor: "#46B3FD",
  42 + unit: "A"
  43 + },
  44 + {
  45 + dataList: [{
  46 + value: Obj.BMS03,
  47 + name: "SOC",
  48 + unit: "%"
  49 + }],
  50 + numColor: "#14C9C9",
  51 + unit: "%"
  52 + },
  53 + {
  54 + dataList: [{
  55 + value: Obj.BMS04,
  56 + name: "SOH",
  57 + unit: "%"
  58 + }],
  59 + numColor: "#14C9C9",
  60 + unit: "%"
  61 + },
  62 + {
  63 + dataList: [{
  64 + value: Obj.BMS05,
  65 + name: "允许充电电流",
  66 + unit: "A"
  67 + }],
  68 + numColor: "#28CD6F",
  69 + unit: "A"
  70 + },
  71 + {
  72 + dataList: [{
  73 + value: Obj.BMS06,
  74 + name: "允许放电电流",
  75 + unit: "A"
  76 + }],
  77 + unit: "A",
  78 + numColor: "#28CD6F",
  79 + },
  80 + ]
  81 + } else if (n === 2) {//PCS监控
  82 + res = [// 仪表盘list数据
  83 + {
  84 + dataList: [{
  85 + value: Obj.PCS01,
  86 + name: "额定在线有功容量",
  87 + unit: "kW"
  88 + }],
  89 + numColor: "#46B3FD",
  90 + unit: "kW"
  91 + },
  92 + {
  93 + dataList: [{
  94 + value: Obj.PCS02,
  95 + name: "交流总功率因素",
  96 + unit: "%"
  97 + }],
  98 + numColor: "#46B3FD",
  99 + unit: "%"
  100 + },
  101 + {
  102 + dataList: [{
  103 + value: Obj.PCS03,
  104 + name: "交流有功功率",
  105 + unit: "kW"
  106 + }],
  107 + numColor: "#14C9C9",
  108 + unit: "kW"
  109 + },
  110 + {
  111 + dataList: [{
  112 + value: Obj.PCS04,
  113 + name: "交流A相功率因素",
  114 + unit: "%"
  115 + }],
  116 + numColor: "#14C9C9",
  117 + unit: "%"
  118 + },
  119 + {
  120 + dataList: [{
  121 + value: Obj.PCS05,
  122 + name: "交流B相功率因素",
  123 + unit: "%"
  124 + }],
  125 + numColor: "#28CD6F",
  126 + unit: "%"
  127 + },
  128 + {
  129 + dataList: [{
  130 + value: Obj.PCS06,
  131 + name: "交流C相功率因素",
  132 + unit: "%"
  133 + }],
  134 + unit: "%",
  135 + numColor: "#28CD6F",
  136 + },
  137 + ]
  138 + } else if (n === 3) {//充电桩
  139 + res = [// 仪表盘list数据
  140 + {
  141 + dataList: [{
  142 + value: formatDataEvent(Obj.CP01) ,
  143 + name: "额定功率",
  144 + unit: "kW"
  145 + }],
  146 + numColor: "#46B3FD",
  147 + unit: "kW"
  148 + },
  149 + {
  150 + dataList: [{
  151 + value: formatDataEvent(Obj.CP02),
  152 + name: "当前功率",
  153 + unit: "kW"
  154 + }],
  155 + numColor: "#46B3FD",
  156 + unit: "kW"
  157 + },
  158 + {
  159 + dataList: [{
  160 + value: formatDataEvent(Obj.CP03) ,
  161 + name: "A枪温度",
  162 + unit: "℃"
  163 + }],
  164 + numColor: "#14C9C9",
  165 + unit: "℃"
  166 + },
  167 + {
  168 + dataList: [{
  169 + value: formatDataEvent(Obj.CP04),
  170 + name: "A枪SOC",
  171 + unit: "%"
  172 + }],
  173 + numColor: "#14C9C9",
  174 + unit: "%"
  175 + },
  176 + {
  177 + dataList: [{
  178 + value:formatDataEvent(Obj.CP05),
  179 + name: "B枪SOC",
  180 + unit: "%"
  181 + }],
  182 + numColor: "#28CD6F",
  183 + unit: "%"
  184 + },
  185 + {
  186 + dataList: [{
  187 + value: formatDataEvent(Obj.CP06),
  188 + name: "B枪温度",
  189 + unit: "℃"
  190 + }],
  191 + unit: "℃",
  192 + numColor: "#28CD6F",
  193 + },
  194 + ]
  195 + } else if (n === 4) {//光伏
  196 + res = [// 仪表盘list数据
  197 + {
  198 + dataList: [{
  199 + value: formatDataEvent(Obj.PV26),
  200 + name: "总直接消耗电量",
  201 + unit: "kWh"
  202 + }],
  203 + numColor: "#46B3FD",
  204 + unit: "kWh"
  205 + },
  206 + {
  207 + dataList: [{
  208 + value: formatDataEvent(Obj.PV02),
  209 + name: "总功率因素",
  210 + unit: "kW"
  211 + }],
  212 + numColor: "#46B3FD",
  213 + unit: "kW"
  214 + },
  215 + {
  216 + dataList: [{
  217 + value: formatDataEvent(Obj.PV29),
  218 + name: "母线电压",
  219 + unit: "V"
  220 + }],
  221 + numColor: "#14C9C9",
  222 + unit: "V"
  223 + },
  224 + {
  225 + dataList: [{
  226 + value: formatDataEvent(Obj.PV03),
  227 + name: "逆变器效率",
  228 + unit: "%"
  229 + }],
  230 + numColor: "#14C9C9",
  231 + unit: "%"
  232 + },
  233 +
  234 + {
  235 + dataList: [{
  236 + value: formatDataEvent(Obj.PV22),
  237 + name: "负载功率",
  238 + unit: "%"
  239 + }],
  240 + numColor: "#28CD6F",
  241 + unit: "%"
  242 + },
  243 + {
  244 + dataList: [{
  245 + value: formatDataEvent(Obj.PV17),
  246 + name: "电表功率",
  247 + unit: "W"
  248 + }],
  249 + unit: "W",
  250 + numColor: "#28CD6F",
  251 + },
  252 + ]
  253 + } else if (n === 5) {// 电能表监视
  254 + res = [// 仪表盘list数据
  255 + {
  256 + dataList: [{
  257 + value: Obj.EM01,
  258 + name: "AB线电压",
  259 + unit: "V"
  260 + }],
  261 + numColor: "#46B3FD",
  262 + unit: "V"
  263 + },
  264 + {
  265 + dataList: [{
  266 + value: Obj.EM02,
  267 + name: "BC线电压",
  268 + unit: "V"
  269 + }],
  270 + numColor: "#46B3FD",
  271 + unit: "V"
  272 + },
  273 + {
  274 + dataList: [{
  275 + value: Obj.EM03,
  276 + name: "CA线电压",
  277 + unit: "V"
  278 + }],
  279 + numColor: "#14C9C9",
  280 + unit: "V"
  281 + },
  282 + {
  283 + dataList: [{
  284 + value: Obj.EM04,
  285 + name: "A相电流",
  286 + unit: "A"
  287 + }],
  288 + numColor: "#14C9C9",
  289 + unit: "A"
  290 + },
  291 +
  292 + {
  293 + dataList: [{
  294 + value: Obj.EM05,
  295 + name: "B相电流",
  296 + unit: "A"
  297 + }],
  298 + numColor: "#28CD6F",
  299 + unit: "A"
  300 + },
  301 + {
  302 + dataList: [{
  303 + value: Obj.EM06,
  304 + name: "C相电流",
  305 + unit: "A"
  306 + }],
  307 + unit: "A",
  308 + numColor: "#28CD6F",
  309 + },
  310 + ]
  311 + }
  312 + return res
  313 +}
  314 +
  315 +
  316 +const formatDataEvent = (val:(String|Number)) =>{
  317 + if(val && val !== 'null'){
  318 + return val
  319 + }else if(val === 'null' || !val){
  320 + return 0
  321 + }else {
  322 + return 0
  323 + }
  324 +}
  325 +
  326 +// 卡片数据统一处理
  327 +export const getCardEvent = (n: number, Obj: any) => {
  328 + let res:any = []
  329 + if(n === 1){// BMS
  330 + res = [
  331 + {
  332 + type: "最大允许放电功率",
  333 + num: Obj.BMS07,
  334 + unit: "KW"
  335 + },
  336 + {
  337 + type: "电源电阻R-",
  338 + num: Obj.BMS08,
  339 + unit: "KQ"
  340 + },
  341 + {
  342 + type: "绝缘电阻R+",
  343 + num: Obj.BMS09,
  344 + unit: "KQ"
  345 + },
  346 + {
  347 + type: "供电电压",
  348 + num: Obj.BMS10,
  349 + unit: "V"
  350 + },
  351 + {
  352 + type: "最大允许充电电压",
  353 + num: Obj.BMS11,
  354 + unit: "V"
  355 + },
  356 + {
  357 + type: "单体最高电压",
  358 + num: Obj.BMS12,
  359 + unit: "V"
  360 + },
  361 + {
  362 + type: "单体平均压差",
  363 + num: Obj.BMS13,
  364 + unit: "mV"
  365 + },
  366 + {
  367 + type: "单体压差",
  368 + num: Obj.BMS14,
  369 + unit: "mV"
  370 + },
  371 + {
  372 + type: "单体最高温度",
  373 + num: Obj.BMS15,
  374 + unit: "°C"
  375 + },
  376 + {
  377 + type: "单体最低温度",
  378 + num: Obj.BMS16,
  379 + unit: "°C"
  380 + },
  381 + {
  382 + type: "单体平均温度",
  383 + num: Obj.BMS17,
  384 + unit: "°C"
  385 + },
  386 + {
  387 + type: "单体温度",
  388 + num: Obj.BMS18,
  389 + unit: "°C"
  390 + },
  391 + {
  392 + type: "极柱最低温度",
  393 + num: Obj.BMS19,
  394 + unit: "°C"
  395 + },
  396 + {
  397 + type: "极柱平均温度",
  398 + num: Obj.BMS20,
  399 + unit: "°C"
  400 + },
  401 + {
  402 + type: "极柱温差",
  403 + num: Obj.BMS21,
  404 + unit: "°C"
  405 + },
  406 + {
  407 + type: "最高电压序号",
  408 + num: Obj.BMS22,
  409 + unit: ""
  410 + },
  411 + {
  412 + type: "最低电压序号",
  413 + num: Obj.BMS23,
  414 + unit: ""
  415 + },
  416 + {
  417 + type: "最高温度序号",
  418 + num: Obj.BMS24,
  419 + unit: ""
  420 + },
  421 + {
  422 + type: "极柱最高温度序号",
  423 + num: Obj.BMS25,
  424 + unit: ""
  425 + },
  426 + {
  427 + type: "极柱最低温度序号",
  428 + num: Obj.BMS26,
  429 + unit: ""
  430 + },
  431 + {
  432 + type: "极柱最高温度模块",
  433 + num: Obj.BMS27,
  434 + unit: ""
  435 + },
  436 +
  437 + {
  438 + type: "极柱最低温度模块",
  439 + num: Obj.BMS28,
  440 + unit: ""
  441 + },
  442 + {
  443 + type: "最高电压模块",
  444 + num: Obj.BMS29,
  445 + unit: ""
  446 + },
  447 + {
  448 + type: "最低电压模块",
  449 + num: Obj.BMS30,
  450 + unit: ""
  451 + },
  452 + {
  453 + type: "最低温度模块",
  454 + num: Obj.BMS31,
  455 + unit: ""
  456 + },
  457 + {
  458 + type: "单次充电电量",
  459 + num: Obj.BMS32,
  460 + unit: "kWh"
  461 + },
  462 + {
  463 + type: "单词放电电量",
  464 + num: Obj.BMS33,
  465 + unit: "kWh"
  466 + },
  467 + {
  468 + type: "当日充电电量",
  469 + num: Obj.BMS34,
  470 + unit: "kWh"
  471 + },
  472 + {
  473 + type: "当日放电电量",
  474 + num: Obj.BMS35,
  475 + unit: "kWh"
  476 + },
  477 + {
  478 + type: "总电池结数",
  479 + num: Obj.BMS36,
  480 + unit: ""
  481 + },
  482 + ]
  483 + } else if (n === 2) {//PCS监控
  484 + res = [
  485 + {
  486 + type: "模块温度",
  487 + num: Obj.PCS07,
  488 + unit: "℃"
  489 + },
  490 + {
  491 + type: "环境温度",
  492 + num: Obj.PCS08,
  493 + unit: "℃"
  494 + },
  495 + {
  496 + type: "机柜温度",
  497 + num: Obj.PCS09,
  498 + unit: "℃"
  499 + },
  500 + {
  501 + type: "交流AB线电压",
  502 + num: Obj.PCS10,
  503 + unit: "V"
  504 + },
  505 + {
  506 + type: "交流BC线电压",
  507 + num: Obj.PCS11,
  508 + unit: "V"
  509 + },
  510 + {
  511 + type: "交流CA线电压",
  512 + num: Obj.PCS12,
  513 + unit: "V"
  514 + },
  515 + {
  516 + type: "交流总无功率",
  517 + num: Obj.PCS13,
  518 + unit: "kW"
  519 + },
  520 + {
  521 + type: "交流总有功功率",
  522 + num: Obj.PCS14,
  523 + unit: "kW"
  524 + },
  525 + {
  526 + type: "交流A相有功功率",
  527 + num: Obj.PCS15,
  528 + unit: "kW"
  529 + },
  530 + {
  531 + type: "交流B相有功功率",
  532 + num: Obj.PCS16,
  533 + unit: "kW"
  534 + },
  535 + {
  536 + type: "交流C相有功功率",
  537 + num: Obj.PCS17,
  538 + unit: "kW"
  539 + },
  540 + {
  541 + type: "交流A相无功功率",
  542 + num: Obj.PCS18,
  543 + unit: "kVar"
  544 + },
  545 + {
  546 + type: "交流B相无功功率",
  547 + num: Obj.PCS19,
  548 + unit: "kVar"
  549 + },
  550 + {
  551 + type: "交流C相无功功率",
  552 + num: Obj.PCS20,
  553 + unit: "kVar"
  554 + },
  555 + {
  556 + type: "交流A相电流",
  557 + num: Obj.PCS21,
  558 + unit: "A"
  559 + },
  560 + {
  561 + type: "交流B相电流",
  562 + num: Obj.PCS22,
  563 + unit: "A"
  564 + },
  565 + {
  566 + type: "交流C相电流",
  567 + num: Obj.PCS23,
  568 + unit: "A"
  569 + },
  570 + {
  571 + type: "交流频率",
  572 + num: Obj.PCS24,
  573 + unit: "Hz"
  574 + },
  575 + {
  576 + type: "最大充电电流",
  577 + num: Obj.PCS25,
  578 + unit: "A"
  579 + },
  580 + {
  581 + type: "最大放电电流",
  582 + num: Obj.PCS26,
  583 + unit: "A"
  584 + },
  585 + {
  586 + type: "累计交流放电电量",
  587 + num: Obj.PCS27,
  588 + unit: "kWh"
  589 + },
  590 +
  591 + {
  592 + type: "累计交流充电电量",
  593 + num: Obj.PCS28,
  594 + unit: "kWh"
  595 + },
  596 + {
  597 + type: "累计交流无功电量",
  598 + num: Obj.PCS29,
  599 + unit: "kVarh"
  600 + },
  601 + ]
  602 + } else if (n === 3) {//充电桩
  603 + res = [
  604 + {
  605 + type: "A枪编号",
  606 + num: Obj.CP07,
  607 + unit: ""
  608 + },
  609 + {
  610 + type: "A枪额定功率",
  611 + num: Obj.CP08,
  612 + unit: "kW"
  613 + },
  614 + {
  615 + type: "A枪类型",
  616 + num: Obj.CP09,
  617 + unit: ""
  618 + },
  619 + {
  620 + type: "A枪SOC",
  621 + num: Obj.CP10,
  622 + unit: "%"
  623 + },
  624 + {
  625 + type: "A枪插枪状态",
  626 + num: Obj.CP11,
  627 + unit: ""
  628 + },
  629 + {
  630 + type: "A枪充电状态",
  631 + num: Obj.CP12,
  632 + unit: ""
  633 + },
  634 + {
  635 + type: "A枪输出电压",
  636 + num: Obj.CP13,
  637 + unit: "V"
  638 + },
  639 + {
  640 + type: "A枪输出电流",
  641 + num: Obj.CP14,
  642 + unit: "A"
  643 + },
  644 + {
  645 + type: "A枪需求功率",
  646 + num: Obj.CP15,
  647 + unit: "kW"
  648 + },
  649 + {
  650 + type: "A枪需求电流",
  651 + num: Obj.CP16,
  652 + unit: "A"
  653 + },
  654 + {
  655 + type: "A枪最小输出功率",
  656 + num: Obj.CP17,
  657 + unit: "kW"
  658 + },
  659 + {
  660 + type: "A枪当前限定功率",
  661 + num: Obj.CP18,
  662 + unit: "kW"
  663 + },
  664 + {
  665 + type: "B枪编号",
  666 + num: Obj.CP19,
  667 + unit: ""
  668 + },
  669 + {
  670 + type: "B枪额定功率",
  671 + num: Obj.CP20,
  672 + unit: "kW"
  673 + },
  674 + {
  675 + type: "B枪类型",
  676 + num: Obj.CP21,
  677 + unit: ""
  678 + },
  679 + {
  680 + type: "B枪soc",
  681 + num: Obj.CP22,
  682 + unit: "%"
  683 + },
  684 + {
  685 + type: "B枪插枪状态",
  686 + num: Obj.CP23,
  687 + unit: ""
  688 + },
  689 + {
  690 + type: "B枪充电状态",
  691 + num: Obj.CP24,
  692 + unit: ""
  693 + },
  694 + {
  695 + type: "B枪输出电压",
  696 + num: Obj.CP25,
  697 + unit: "V"
  698 + },
  699 + {
  700 + type: "B枪输出电流",
  701 + num: Obj.CP26,
  702 + unit: "A"
  703 + },
  704 + {
  705 + type: "B枪需求功率",
  706 + num: Obj.CP27,
  707 + unit: "kW"
  708 + },
  709 + {
  710 + type: "B枪需求电流",
  711 + num: Obj.CP28,
  712 + unit: "A"
  713 + },
  714 + {
  715 + type: "B枪最小输出功率",
  716 + num: Obj.CP29,
  717 + unit: "kW"
  718 + },
  719 + {
  720 + type: "B枪当前限定功率",
  721 + num: Obj.CP30,
  722 + unit: "kW"
  723 + }
  724 + ]
  725 + } else if (n === 4) {//光伏
  726 +
  727 + res = [
  728 + {
  729 + type: "AB线电压/A相电压",
  730 + num: Obj.PV07,
  731 + unit: "V"
  732 + },
  733 + {
  734 + type: "BC线电压/B相电压",
  735 + num: Obj.PV08,
  736 + unit: "V"
  737 + },
  738 + {
  739 + type: "CA线电压/C相电压",
  740 + num: Obj.PV09,
  741 + unit: "V"
  742 + },
  743 + {
  744 + type: "A相电流",
  745 + num: Obj.PV10,
  746 + unit: "A"
  747 + },
  748 + {
  749 + type: "B相电流",
  750 + num: Obj.PV11,
  751 + unit: "A"
  752 + },
  753 + {
  754 + type: "C相电流",
  755 + num: Obj.PV12,
  756 + unit: "A"
  757 + },
  758 + {
  759 + type: "电网频率",
  760 + num: Obj.PV13,
  761 + unit: "Hz"
  762 + },
  763 + {
  764 + type: "逆变器效率",
  765 + num: Obj.PV14,
  766 + unit: "%"
  767 + },
  768 + {
  769 + type: "额定无功功率",
  770 + num: Obj.PV15,
  771 + unit: "kVar"
  772 + },
  773 + {
  774 + type: "方阵绝缘阻抗",
  775 + num: Obj.PV16,
  776 + unit: "kΩ"
  777 + },
  778 + {
  779 + type: "电表功率",
  780 + num: Obj.PV17,
  781 + unit: "W"
  782 + },
  783 + {
  784 + type: "工作状态",
  785 + num: Obj.PV18,
  786 + unit: ""
  787 + },
  788 + {
  789 + type: "电表A相功率",
  790 + num: Obj.PV19,
  791 + unit: "W"
  792 + },
  793 + {
  794 + type: "电表B相功率",
  795 + num: Obj.PV20,
  796 + unit: "W"
  797 + },
  798 + {
  799 + type: "电表C相功率",
  800 + num: Obj.PV21,
  801 + unit: "W"
  802 + },
  803 + {
  804 + type: "负载功率",
  805 + num: Obj.PV22,
  806 + unit: "W"
  807 + },
  808 + {
  809 + type: "日电网取电电量",
  810 + num: Obj.PV23,
  811 + unit: "kWh"
  812 + },
  813 + {
  814 + type: "总电网取电电量",
  815 + num: Obj.PV24,
  816 + unit: "kWh"
  817 + },
  818 + {
  819 + type: "日直接消耗电量",
  820 + num: Obj.PV25,
  821 + unit: "kWh"
  822 + },
  823 + {
  824 + type: "总直接消耗电量",
  825 + num: Obj.PV26,
  826 + unit: "kWh"
  827 + },
  828 + {
  829 + type: "逆变器状态",
  830 + num: Obj.PV27,
  831 + unit: ""
  832 + },
  833 + {
  834 + type: "总发电量",
  835 + num: Obj.PV28,
  836 + unit: "kWh"
  837 + },
  838 + {
  839 + type: "母线电压",
  840 + num: Obj.PV29,
  841 + unit: "V"
  842 + },
  843 + {
  844 + type: "电网频率",
  845 + num: Obj.PV30,
  846 + unit: "Hz"
  847 + }
  848 + ]
  849 + } else if (n === 5) {// 电能表监视
  850 + res = [
  851 + {
  852 + type: "A相有功功率",
  853 + num: Obj.EM07,
  854 + unit: "kW"
  855 + },
  856 + {
  857 + type: "B相有功功率",
  858 + num: Obj.EM08,
  859 + unit: "kW"
  860 + },
  861 + {
  862 + type: "C相有功功率",
  863 + num: Obj.EM09,
  864 + unit: "kW"
  865 + },
  866 + {
  867 + type: "A相无功功率",
  868 + num: Obj.EM10,
  869 + unit: "%"
  870 + },
  871 + {
  872 + type: "B相无功功率",
  873 + num: Obj.EM11,
  874 + unit: "kVar"
  875 + },
  876 + {
  877 + type: "C相无功功率",
  878 + num: Obj.EM12,
  879 + unit: "kVar"
  880 + },
  881 + {
  882 + type: "A相视在功率",
  883 + num: Obj.EM13,
  884 + unit: "kVA"
  885 + },
  886 + {
  887 + type: "B相视在功率",
  888 + num: Obj.EM14,
  889 + unit: "kVA"
  890 + },
  891 + {
  892 + type: "C相视在功率",
  893 + num: Obj.EM15,
  894 + unit: "kVA"
  895 + },
  896 + {
  897 + type: "A相功率因数",
  898 + num: Obj.EM16,
  899 + unit: ""
  900 + },
  901 + {
  902 + type: "B相功率因数",
  903 + num: Obj.EM17,
  904 + unit: ""
  905 + },
  906 + {
  907 + type: "C相功率因数",
  908 + num: Obj.EM18,
  909 + unit: ""
  910 + },
  911 + {
  912 + type: "总有功功率",
  913 + num: Obj.EM19,
  914 + unit: "kW"
  915 + },
  916 + {
  917 + type: "总视在功率",
  918 + num: Obj.EM20,
  919 + unit: "kVA"
  920 + },
  921 + {
  922 + type: "总功率因数",
  923 + num: Obj.EM21,
  924 + unit: ""
  925 + },
  926 + {
  927 + type: "正向有功总电能",
  928 + num: Obj.EM22,
  929 + unit: "kWh"
  930 + },
  931 + {
  932 + type: "反向有功总电能",
  933 + num: Obj.EM23,
  934 + unit: "kWh"
  935 + },
  936 + {
  937 + type: "正向无功总电能",
  938 + num: Obj.EM24,
  939 + unit: "kVarh"
  940 + },
  941 + {
  942 + type: "反向无功总电能",
  943 + num: Obj.EM25,
  944 + unit: "kVarh"
  945 + },
  946 + {
  947 + type: "当日正向有功最大需量",
  948 + num: Obj.EM26,
  949 + unit: "kWh"
  950 + },
  951 + {
  952 + type: "发生时间",
  953 + num: Obj.EM27,
  954 + unit: "kW"
  955 + },
  956 +
  957 + {
  958 + type: "当日反向有功最大需量",
  959 + num: Obj.EM28,
  960 + unit: "kWh"
  961 + },
  962 + {
  963 + type: "电压变比",
  964 + num: Obj.EM28,
  965 + unit: ""
  966 + },
  967 + {
  968 + type: "电流变比",
  969 + num: Obj.EM30,
  970 + unit: ""
  971 + }
  972 + ]
  973 + }
  974 +
  975 + return res
  976 +}
  977 +
... ...