@vtx/modals2 5.0.46 → 5.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_components/vm-card-statistics/index.less +27 -27
- package/lib/_components/vm-factor-list/index.less +11 -11
- package/lib/_components/vm-popover/index.less +7 -7
- package/lib/_service/index.js +16 -0
- package/lib/vtx-base-modal/Header/index.less +98 -98
- package/lib/vtx-base-modal/Tabs/index.less +68 -68
- package/lib/vtx-car-modal/components/Info/index.less +6 -6
- package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
- package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
- package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
- package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
- package/lib/vtx-df-modal/api-zd-reborn.js +246 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/Jcqsfx.js +71 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/Jczbqs.js +96 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/Qyjcl.js +41 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/RealtimeMonitor.js +149 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/Situation.js +47 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/index.js +140 -0
- package/lib/vtx-df-modal/components/BaseInfoZdReborn/index.less +161 -0
- package/lib/vtx-df-modal/components/Calendar/zd-reborn.js +142 -0
- package/lib/vtx-df-modal/components/MeteringZdReborn/ChartJccc.js +62 -0
- package/lib/vtx-df-modal/components/MeteringZdReborn/ChartJcqs.js +83 -0
- package/lib/vtx-df-modal/components/MeteringZdReborn/List.js +125 -0
- package/lib/vtx-df-modal/components/MeteringZdReborn/index.js +185 -0
- package/lib/vtx-df-modal/components/MeteringZdReborn/index.less +68 -0
- package/lib/vtx-df-modal/components/index.js +4 -1
- package/lib/vtx-df-modal/index.js +19 -7
- package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
- package/lib/vtx-restaurant-modal/config.js +52 -52
- package/lib/vtx-road-modal/components/Statistical/index.less +32 -32
- package/lib/vtx-staff-modal/components/BaseInfo/WorkStatic.js +2 -2
- package/package.json +78 -78
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { request } from '@vtx/utils';
|
|
2
|
+
import { useRequest } from 'ahooks';
|
|
3
|
+
import http from "../_util/http";
|
|
4
|
+
var BaseService = {
|
|
5
|
+
// 实时运行(进场)情况
|
|
6
|
+
useSituation: function useSituation(deviceIds, date) {
|
|
7
|
+
var _useRequest = useRequest(function () {
|
|
8
|
+
return request.get('/cloud/zd-reborn/api/dataBoard/getSumYesterday', {
|
|
9
|
+
data: {
|
|
10
|
+
deviceIds: deviceIds,
|
|
11
|
+
date: date
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}, {
|
|
15
|
+
ready: !!deviceIds,
|
|
16
|
+
refreshDeps: [date]
|
|
17
|
+
}),
|
|
18
|
+
situationRes = _useRequest.data;
|
|
19
|
+
return {
|
|
20
|
+
situationRes: situationRes === null || situationRes === void 0 ? void 0 : situationRes.data
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
useSituationSummary: function useSituationSummary(deviceIds, startDate, endDate) {
|
|
24
|
+
// 汇总
|
|
25
|
+
var _useRequest2 = useRequest(function () {
|
|
26
|
+
return request.get('/cloud/zd-reborn/api/dataBoard/getSumOperationData', {
|
|
27
|
+
data: {
|
|
28
|
+
deviceIds: deviceIds,
|
|
29
|
+
startDate: startDate,
|
|
30
|
+
endDate: endDate
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}, {
|
|
34
|
+
ready: !!deviceIds,
|
|
35
|
+
refreshDeps: [startDate, endDate]
|
|
36
|
+
}),
|
|
37
|
+
situationRes = _useRequest2.data;
|
|
38
|
+
return {
|
|
39
|
+
situationRes: (situationRes === null || situationRes === void 0 ? void 0 : situationRes.data) || []
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
useQyjcl: function useQyjcl(deviceId, startDate, endDate) {
|
|
43
|
+
var _useRequest3 = useRequest(function () {
|
|
44
|
+
return request.get('/cloud/zd-reborn/api/dataBoard/getSumGroup', {
|
|
45
|
+
data: {
|
|
46
|
+
deviceId: deviceId,
|
|
47
|
+
startDate: startDate,
|
|
48
|
+
endDate: endDate,
|
|
49
|
+
groupType: 'byArea'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}, {
|
|
53
|
+
ready: !!deviceId,
|
|
54
|
+
refreshDeps: [deviceId, startDate, endDate]
|
|
55
|
+
}),
|
|
56
|
+
res = _useRequest3.data;
|
|
57
|
+
return {
|
|
58
|
+
areaSumData: res === null || res === void 0 ? void 0 : res.data
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
useRealtimeMonitor: function useRealtimeMonitor(factoryCode) {
|
|
62
|
+
var _res$data;
|
|
63
|
+
// 实时监测
|
|
64
|
+
var _useRequest4 = useRequest(function () {
|
|
65
|
+
return request.get('/cloud/sjzt-reborn/api/v101/zdjg/jg/data/getJgDataStatistics', {
|
|
66
|
+
data: {
|
|
67
|
+
factoryCode: factoryCode
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}, {
|
|
71
|
+
ready: !!factoryCode,
|
|
72
|
+
refreshDeps: [factoryCode]
|
|
73
|
+
}),
|
|
74
|
+
res = _useRequest4.data;
|
|
75
|
+
return {
|
|
76
|
+
realtimeMonitor: (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.deviceList) || []
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
useRealtime: function useRealtime(deviceId) {
|
|
80
|
+
// 实时监测情况
|
|
81
|
+
var _useRequest5 = useRequest(function () {
|
|
82
|
+
return http.getForTenantId('/cloud/sjzt-reborn/api/v101/zdjg/jg/data/getJgDataDeviceRealTime', {
|
|
83
|
+
body: {
|
|
84
|
+
deviceId: deviceId
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}, {
|
|
88
|
+
ready: !!deviceId,
|
|
89
|
+
refreshDeps: [deviceId]
|
|
90
|
+
}),
|
|
91
|
+
res = _useRequest5.data;
|
|
92
|
+
return {
|
|
93
|
+
realtimeRes: (res === null || res === void 0 ? void 0 : res.data) || []
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
useJczbqsfx: function useJczbqsfx(code, deviceId, startTime, endTime) {
|
|
97
|
+
var _useRequest6 = useRequest(function () {
|
|
98
|
+
return request.get('/cloud/sjzt-reborn/api/v101/zdjg/jg/data/getJgDataChart', {
|
|
99
|
+
data: {
|
|
100
|
+
monitorItemCode: code,
|
|
101
|
+
deviceId: deviceId,
|
|
102
|
+
startTime: startTime,
|
|
103
|
+
endTime: endTime
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}, {
|
|
107
|
+
ready: !!code,
|
|
108
|
+
refreshDeps: [code, deviceId, startTime, endTime]
|
|
109
|
+
}),
|
|
110
|
+
res = _useRequest6.data;
|
|
111
|
+
return {
|
|
112
|
+
timeSumData: code ? res === null || res === void 0 ? void 0 : res.data : {}
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
useJcccsjfb: function useJcccsjfb(deviceIds, startDate, endDate) {
|
|
116
|
+
// 实时运行情况
|
|
117
|
+
var _useRequest7 = useRequest(function () {
|
|
118
|
+
return http.get('/cloud/zd-reborn/api/dataBoard/getSumCarNumHourLine', {
|
|
119
|
+
body: {
|
|
120
|
+
deviceIds: deviceIds,
|
|
121
|
+
startDate: startDate,
|
|
122
|
+
endDate: endDate
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}, {
|
|
126
|
+
ready: !!deviceIds,
|
|
127
|
+
refreshDeps: [startDate, endDate]
|
|
128
|
+
}),
|
|
129
|
+
jcccsjfbRes = _useRequest7.data;
|
|
130
|
+
return {
|
|
131
|
+
jcccsjfbRes: (jcccsjfbRes === null || jcccsjfbRes === void 0 ? void 0 : jcccsjfbRes.data) || []
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var MeteringService = {
|
|
136
|
+
useRecord: function useRecord(deviceId, startTime, endTime, page) {
|
|
137
|
+
var _useRequest8 = useRequest(function () {
|
|
138
|
+
return request.get('/cloud/zd-reborn/api/weightData/pageList', {
|
|
139
|
+
data: {
|
|
140
|
+
deviceId: deviceId,
|
|
141
|
+
startTime: startTime,
|
|
142
|
+
endTime: endTime,
|
|
143
|
+
page: page,
|
|
144
|
+
rows: 10
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}, {
|
|
148
|
+
ready: !!deviceId,
|
|
149
|
+
refreshDeps: [startTime, endTime, page]
|
|
150
|
+
}),
|
|
151
|
+
recordRes = _useRequest8.data;
|
|
152
|
+
var records = (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || {
|
|
153
|
+
total: 0,
|
|
154
|
+
rows: []
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
records: records
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
useSummary: function useSummary(deviceId, startTime, endTime) {
|
|
161
|
+
var _useRequest9 = useRequest(function () {
|
|
162
|
+
return request.get('/cloud/zd-reborn/api/weightData/summary', {
|
|
163
|
+
data: {
|
|
164
|
+
deviceId: deviceId,
|
|
165
|
+
startTime: startTime,
|
|
166
|
+
endTime: endTime,
|
|
167
|
+
page: 1,
|
|
168
|
+
rows: 10000
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}, {
|
|
172
|
+
ready: !!deviceId,
|
|
173
|
+
refreshDeps: [startTime, endTime]
|
|
174
|
+
}),
|
|
175
|
+
summaryRes = _useRequest9.data;
|
|
176
|
+
var summary = (summaryRes === null || summaryRes === void 0 ? void 0 : summaryRes.data) || {};
|
|
177
|
+
return {
|
|
178
|
+
summary: summary
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// 工况
|
|
184
|
+
var WorkConditionService = {
|
|
185
|
+
useFetchData: function useFetchData(code, startDateTime, endDateTime) {
|
|
186
|
+
var _useRequest10 = useRequest(function () {
|
|
187
|
+
return request.get('/cloud/zd/jg/api/cp/historyValue/getMonitorItemSum.smvc', {
|
|
188
|
+
data: {
|
|
189
|
+
factoryCode: code,
|
|
190
|
+
startDateTime: startDateTime,
|
|
191
|
+
endDateTime: endDateTime,
|
|
192
|
+
monitorItemCodes: 'MI_TRW_LJ_RL,MI_CW_FDL,MI_CW_SLY,MI_CW_FH,MI_CW_LZH'
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}, {
|
|
196
|
+
ready: !!code,
|
|
197
|
+
refreshDeps: [startDateTime, endDateTime]
|
|
198
|
+
}),
|
|
199
|
+
res = _useRequest10.data;
|
|
200
|
+
var situationData = (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
201
|
+
return {
|
|
202
|
+
situationData: situationData
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// 日历
|
|
208
|
+
var CalendarService = {
|
|
209
|
+
useFetchData: function useFetchData(deviceIds, startDate, endDate) {
|
|
210
|
+
var _useRequest11 = useRequest(function () {
|
|
211
|
+
return request.get('/cloud/zd-reborn/api/dataBoard/getSumLoad', {
|
|
212
|
+
data: {
|
|
213
|
+
deviceIds: deviceIds,
|
|
214
|
+
startDate: startDate,
|
|
215
|
+
endDate: endDate
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}, {
|
|
219
|
+
ready: !!deviceIds,
|
|
220
|
+
refreshDeps: [startDate, endDate]
|
|
221
|
+
}),
|
|
222
|
+
res = _useRequest11.data;
|
|
223
|
+
return {
|
|
224
|
+
data1: (res === null || res === void 0 ? void 0 : res.data) || []
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
useFetchData2: function useFetchData2(code, startTime, endTime) {
|
|
228
|
+
var _useRequest12 = useRequest(function () {
|
|
229
|
+
return request.get('/cloud/sjzt-reborn/api/v101/zdjg/jg/data/getJgDataAlarmNumByDate', {
|
|
230
|
+
data: {
|
|
231
|
+
factoryCode: code,
|
|
232
|
+
startTime: startTime,
|
|
233
|
+
endTime: endTime
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}, {
|
|
237
|
+
ready: !!code,
|
|
238
|
+
refreshDeps: [startTime, endTime]
|
|
239
|
+
}),
|
|
240
|
+
res2 = _useRequest12.data;
|
|
241
|
+
return {
|
|
242
|
+
data2: (res2 === null || res2 === void 0 ? void 0 : res2.data) || []
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
export { BaseService, CalendarService, MeteringService, WorkConditionService };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
import { max } from 'lodash';
|
|
8
|
+
import { VmLineCharts, VmWrapper } from "../../../_components";
|
|
9
|
+
import useSettings from "../../../_hooks/useSettings";
|
|
10
|
+
import { CalendarService } from "../../api-zd-reborn";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export default function Jcqsfx(props) {
|
|
13
|
+
var _useSettings = useSettings(),
|
|
14
|
+
isDark = _useSettings.isDark,
|
|
15
|
+
chartFontColor = _useSettings.chartFontColor;
|
|
16
|
+
var deviceId = props.deviceId,
|
|
17
|
+
startDate = props.startDate,
|
|
18
|
+
endDate = props.endDate,
|
|
19
|
+
handleAbility = props.handleAbility;
|
|
20
|
+
var _CalendarService$useF = CalendarService.useFetchData(deviceId, startDate, endDate),
|
|
21
|
+
data1 = _CalendarService$useF.data1;
|
|
22
|
+
var maxNum = max([handleAbility].concat(_toConsumableArray((data1 === null || data1 === void 0 ? void 0 : data1.map(function (ele) {
|
|
23
|
+
return ele.todayTotalInWeight;
|
|
24
|
+
})) || []))) || 0;
|
|
25
|
+
return /*#__PURE__*/_jsx("div", {
|
|
26
|
+
className: "base-top--jcqsfx",
|
|
27
|
+
children: /*#__PURE__*/_jsx(VmWrapper, {
|
|
28
|
+
title: "\u8FDB\u573A\u8D8B\u52BF\u5206\u6790",
|
|
29
|
+
needChange: false,
|
|
30
|
+
children: /*#__PURE__*/_jsx(VmLineCharts, {
|
|
31
|
+
unit: "\u5428",
|
|
32
|
+
height: 240,
|
|
33
|
+
showLegend: false,
|
|
34
|
+
yMax: maxNum,
|
|
35
|
+
xAxis: (data1 === null || data1 === void 0 ? void 0 : data1.map(function (ele) {
|
|
36
|
+
return ele.date;
|
|
37
|
+
})) || [],
|
|
38
|
+
legendOption: {
|
|
39
|
+
data: ['进场量']
|
|
40
|
+
},
|
|
41
|
+
dataList: [{
|
|
42
|
+
data: (data1 === null || data1 === void 0 ? void 0 : data1.map(function (ele) {
|
|
43
|
+
return ele.todayTotalInWeight;
|
|
44
|
+
})) || [],
|
|
45
|
+
name: '进场量',
|
|
46
|
+
markLine: {
|
|
47
|
+
data: [{
|
|
48
|
+
yAxis: handleAbility,
|
|
49
|
+
lineStyle: {
|
|
50
|
+
normal: {
|
|
51
|
+
color: '#FFE25D'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
name: '设计能力(吨/日)'
|
|
55
|
+
}],
|
|
56
|
+
lineStyle: {
|
|
57
|
+
color: '#52C41A'
|
|
58
|
+
},
|
|
59
|
+
label: {
|
|
60
|
+
show: true,
|
|
61
|
+
position: 'insideEndTop',
|
|
62
|
+
formatter: '{b}: {c}',
|
|
63
|
+
color: isDark ? '#fff' : chartFontColor,
|
|
64
|
+
fontWeight: 'normal'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}]
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/**
|
|
8
|
+
* 监测指标趋势分析
|
|
9
|
+
*/
|
|
10
|
+
import { useSetState } from 'ahooks';
|
|
11
|
+
import dayjs from 'dayjs';
|
|
12
|
+
import * as echarts from 'echarts';
|
|
13
|
+
import { useEffect } from 'react';
|
|
14
|
+
import { VmEmpty, VmFilter, VmLineCharts, VmWrapper } from "../../../_components";
|
|
15
|
+
import useSettings from "../../../_hooks/useSettings";
|
|
16
|
+
import { BaseService } from "../../api";
|
|
17
|
+
import "./index.less";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
function Jczbqs(props) {
|
|
20
|
+
var _timeSumData$extraDat, _timeSumData$values;
|
|
21
|
+
var _useSettings = useSettings(),
|
|
22
|
+
chartFontColor = _useSettings.chartFontColor,
|
|
23
|
+
theme = _useSettings.theme;
|
|
24
|
+
var deviceId = props.deviceId,
|
|
25
|
+
realtimeRes = props.realtimeRes;
|
|
26
|
+
var _useSetState = useSetState({
|
|
27
|
+
value: ''
|
|
28
|
+
}),
|
|
29
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
30
|
+
state = _useSetState2[0],
|
|
31
|
+
setState = _useSetState2[1];
|
|
32
|
+
var value = state.value;
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var _realtimeRes$;
|
|
35
|
+
setState({
|
|
36
|
+
value: realtimeRes === null || realtimeRes === void 0 || (_realtimeRes$ = realtimeRes[0]) === null || _realtimeRes$ === void 0 ? void 0 : _realtimeRes$.monitorItemCode
|
|
37
|
+
});
|
|
38
|
+
}, [realtimeRes]);
|
|
39
|
+
var _BaseService$useJczbq = BaseService.useJczbqsfx(value, deviceId, dayjs().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')),
|
|
40
|
+
timeSumData = _BaseService$useJczbq.timeSumData;
|
|
41
|
+
return /*#__PURE__*/_jsx("div", {
|
|
42
|
+
className: "df-overview-trend",
|
|
43
|
+
children: /*#__PURE__*/_jsx(VmWrapper, {
|
|
44
|
+
title: "\u76D1\u6D4B\u6307\u6807\u8D8B\u52BF\u5206\u6790\uFF0824\u5C0F\u65F6\uFF09",
|
|
45
|
+
extra: /*#__PURE__*/_jsx(VmFilter.VMSelect, {
|
|
46
|
+
value: value,
|
|
47
|
+
onChange: function onChange(val) {
|
|
48
|
+
setState({
|
|
49
|
+
value: val
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
options: realtimeRes === null || realtimeRes === void 0 ? void 0 : realtimeRes.map(function (item) {
|
|
53
|
+
return {
|
|
54
|
+
value: item.monitorItemCode,
|
|
55
|
+
label: item.monitorItemName
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
style: {
|
|
59
|
+
width: 150
|
|
60
|
+
},
|
|
61
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
62
|
+
allowClear: false
|
|
63
|
+
}),
|
|
64
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
65
|
+
className: "df-overview-trend-content",
|
|
66
|
+
children: timeSumData ? /*#__PURE__*/_jsx(VmLineCharts, {
|
|
67
|
+
title: '总数',
|
|
68
|
+
height: 191,
|
|
69
|
+
unit: (timeSumData === null || timeSumData === void 0 || (_timeSumData$extraDat = timeSumData.extraData) === null || _timeSumData$extraDat === void 0 || (_timeSumData$extraDat = _timeSumData$extraDat[0]) === null || _timeSumData$extraDat === void 0 ? void 0 : _timeSumData$extraDat.unit) || '',
|
|
70
|
+
xAxis: (timeSumData === null || timeSumData === void 0 ? void 0 : timeSumData.names) || [],
|
|
71
|
+
dataList: timeSumData === null || timeSumData === void 0 || (_timeSumData$values = timeSumData.values) === null || _timeSumData$values === void 0 ? void 0 : _timeSumData$values.map(function (ele, index) {
|
|
72
|
+
var _timeSumData$extraDat2;
|
|
73
|
+
return {
|
|
74
|
+
data: ele,
|
|
75
|
+
name: (timeSumData === null || timeSumData === void 0 || (_timeSumData$extraDat2 = timeSumData.extraData[index]) === null || _timeSumData$extraDat2 === void 0 ? void 0 : _timeSumData$extraDat2.monitorItemName) || '',
|
|
76
|
+
smooth: true,
|
|
77
|
+
areaStyle: {
|
|
78
|
+
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
|
|
79
|
+
offset: 0,
|
|
80
|
+
color: theme === 'blue' ? 'rgba(0,157,255,0.1)' : 'rgba(22, 119, 255, 0.10)'
|
|
81
|
+
}, {
|
|
82
|
+
offset: 0.5,
|
|
83
|
+
color: theme === 'blue' ? 'rgba(0,157,255,0.3)' : 'rgba(22, 119, 255, 0.30)'
|
|
84
|
+
}, {
|
|
85
|
+
offset: 1,
|
|
86
|
+
color: theme === 'blue' ? 'rgba(0,157,255,0.75)' : 'rgba(22, 119, 255, 0.75)'
|
|
87
|
+
}])
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
})
|
|
91
|
+
}) : /*#__PURE__*/_jsx(VmEmpty, {})
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export default Jczbqs;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 区域进场量分析
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { sumBy } from 'lodash';
|
|
6
|
+
import { VmEmpty, VmPieCharts } from "../../../_components";
|
|
7
|
+
import { BaseService } from "../../api-zd-reborn";
|
|
8
|
+
import "./index.less";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
function Qyjcl(props) {
|
|
11
|
+
var deviceId = props.deviceId,
|
|
12
|
+
startDate = props.startDate,
|
|
13
|
+
endDate = props.endDate;
|
|
14
|
+
var _BaseService$useQyjcl = BaseService.useQyjcl(deviceId, startDate, endDate),
|
|
15
|
+
areaSumData = _BaseService$useQyjcl.areaSumData;
|
|
16
|
+
var total = sumBy(areaSumData || [], 'netWeight') || 0;
|
|
17
|
+
return /*#__PURE__*/_jsx("div", {
|
|
18
|
+
className: "df-qyjcl",
|
|
19
|
+
children: areaSumData !== null && areaSumData !== void 0 && areaSumData.length ? /*#__PURE__*/_jsx(VmPieCharts, {
|
|
20
|
+
height: 216,
|
|
21
|
+
total: total === null || total === void 0 ? void 0 : total.toFixed(2),
|
|
22
|
+
title: "\u5428",
|
|
23
|
+
unit: "\u5428",
|
|
24
|
+
name: "\u533A\u57DF\u8FDB\u573A\u91CF",
|
|
25
|
+
innerRadius: ['50%', '65%'],
|
|
26
|
+
outerRadius: ['65%', '70%'],
|
|
27
|
+
dataList: (areaSumData === null || areaSumData === void 0 ? void 0 : areaSumData.map(function (ele) {
|
|
28
|
+
return {
|
|
29
|
+
name: ele.groupName,
|
|
30
|
+
value: ele.netWeight
|
|
31
|
+
};
|
|
32
|
+
})) || [],
|
|
33
|
+
legendConfig: {
|
|
34
|
+
right: 16
|
|
35
|
+
}
|
|
36
|
+
}) : /*#__PURE__*/_jsx(VmEmpty, {
|
|
37
|
+
type: "NO_CHART"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export default Qyjcl;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/**
|
|
14
|
+
* 实时监测情况
|
|
15
|
+
*/
|
|
16
|
+
import { Tabs } from 'antd';
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
import { VmEmpty, VmTable, VmWrapper } from "../../../_components";
|
|
19
|
+
import useSettings from "../../../_hooks/useSettings";
|
|
20
|
+
import { BaseService } from "../../api";
|
|
21
|
+
import alarm from "../../imgs/alarm.png";
|
|
22
|
+
import alarmLight from "../../imgs/alarm_light.png";
|
|
23
|
+
import normal from "../../imgs/normal.png";
|
|
24
|
+
import normalLight from "../../imgs/normal_light.png";
|
|
25
|
+
import more from "../../imgs/tab_more.png";
|
|
26
|
+
import moreLight from "../../imgs/tab_more_light.png";
|
|
27
|
+
import Jczbqs from "./Jczbqs";
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
+
export default function RealtimeMonitor(_ref) {
|
|
30
|
+
var realtimeMonitor = _ref.realtimeMonitor,
|
|
31
|
+
hasLm = _ref.hasLm;
|
|
32
|
+
var _useSettings = useSettings(),
|
|
33
|
+
isDark = _useSettings.isDark,
|
|
34
|
+
tabPosition = _useSettings.tabPosition;
|
|
35
|
+
var _useState = useState('1'),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
active = _useState2[0],
|
|
38
|
+
setActive = _useState2[1];
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if ((realtimeMonitor === null || realtimeMonitor === void 0 ? void 0 : realtimeMonitor.length) > 0) {
|
|
41
|
+
setActive(realtimeMonitor[0].deviceId);
|
|
42
|
+
}
|
|
43
|
+
}, [realtimeMonitor]);
|
|
44
|
+
var _BaseService$useRealt = BaseService.useRealtime(active),
|
|
45
|
+
realtimeRes = _BaseService$useRealt.realtimeRes;
|
|
46
|
+
var columns = [{
|
|
47
|
+
title: '监测项',
|
|
48
|
+
dataIndex: 'monitorItemName',
|
|
49
|
+
key: 'monitorItemName'
|
|
50
|
+
}, {
|
|
51
|
+
title: '单位',
|
|
52
|
+
dataIndex: 'unit',
|
|
53
|
+
key: 'unit',
|
|
54
|
+
render: function render(text) {
|
|
55
|
+
return text || '-';
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
title: '监测值',
|
|
59
|
+
dataIndex: 'value',
|
|
60
|
+
key: 'value',
|
|
61
|
+
render: function render(text, record) {
|
|
62
|
+
return /*#__PURE__*/_jsx("span", {
|
|
63
|
+
style: {
|
|
64
|
+
color: (record === null || record === void 0 ? void 0 : record.beenAlarm) && '#fd3a15'
|
|
65
|
+
},
|
|
66
|
+
children: text !== null && text !== void 0 ? text : '-'
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
title: '更新时间',
|
|
71
|
+
dataIndex: 'time',
|
|
72
|
+
key: 'time',
|
|
73
|
+
render: function render(text) {
|
|
74
|
+
return text || '-';
|
|
75
|
+
}
|
|
76
|
+
}];
|
|
77
|
+
var tableProps = {
|
|
78
|
+
height: 120,
|
|
79
|
+
paganitation: false,
|
|
80
|
+
dataSource: realtimeRes || []
|
|
81
|
+
};
|
|
82
|
+
var alarmImg = isDark ? alarm : alarmLight;
|
|
83
|
+
var normalImg = isDark ? normal : normalLight;
|
|
84
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
85
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: "base-bottom--right",
|
|
87
|
+
children: /*#__PURE__*/_jsx(VmWrapper, {
|
|
88
|
+
title: "\u5B9E\u65F6\u76D1\u6D4B\u60C5\u51B5",
|
|
89
|
+
needChange: false,
|
|
90
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
91
|
+
className: "base-bottom--right-content",
|
|
92
|
+
children: (realtimeMonitor === null || realtimeMonitor === void 0 ? void 0 : realtimeMonitor.length) > 0 ? /*#__PURE__*/_jsxs("div", {
|
|
93
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
94
|
+
className: "df-monitor-head",
|
|
95
|
+
children: /*#__PURE__*/_jsx(Tabs, {
|
|
96
|
+
centered: true,
|
|
97
|
+
moreIcon: /*#__PURE__*/_jsx("img", {
|
|
98
|
+
src: isDark ? more : moreLight
|
|
99
|
+
}),
|
|
100
|
+
popupClassName: "df-popup-className ".concat(isDark ? 'dark' : ''),
|
|
101
|
+
onChange: function onChange(key) {
|
|
102
|
+
setActive(key);
|
|
103
|
+
},
|
|
104
|
+
size: "small",
|
|
105
|
+
items: (realtimeMonitor === null || realtimeMonitor === void 0 ? void 0 : realtimeMonitor.map(function (item) {
|
|
106
|
+
var flag = item.beenNormal;
|
|
107
|
+
return {
|
|
108
|
+
label: /*#__PURE__*/_jsxs("div", {
|
|
109
|
+
className: "df-monitor-head-item",
|
|
110
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
111
|
+
src: flag ? normalImg : alarmImg
|
|
112
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
113
|
+
className: "df-monitor-head-item-right",
|
|
114
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
115
|
+
className: "df-monitor-head-item-right-name",
|
|
116
|
+
children: item.deviceName
|
|
117
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
118
|
+
className: "df-monitor-head-item-right-".concat(flag ? 'valueNormal' : 'valueAlarm'),
|
|
119
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
120
|
+
children: flag ? '正常' : '异常'
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
}),
|
|
125
|
+
key: item.deviceId
|
|
126
|
+
};
|
|
127
|
+
})) || []
|
|
128
|
+
})
|
|
129
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
130
|
+
className: "df-monitor-table",
|
|
131
|
+
children: /*#__PURE__*/_jsx(VmTable, _objectSpread({
|
|
132
|
+
columns: columns,
|
|
133
|
+
rowKey: "factorId"
|
|
134
|
+
}, tableProps))
|
|
135
|
+
})]
|
|
136
|
+
}) : /*#__PURE__*/_jsx(VmEmpty, {
|
|
137
|
+
type: "NO_DATA",
|
|
138
|
+
style: {
|
|
139
|
+
height: 244
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
}), !hasLm && /*#__PURE__*/_jsx(Jczbqs, {
|
|
145
|
+
realtimeRes: realtimeRes,
|
|
146
|
+
deviceId: active
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* 实时运行情况
|
|
9
|
+
*/
|
|
10
|
+
import { VmFactor } from "../../../_components";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export default function Situation(_ref) {
|
|
13
|
+
var situationRes = _ref.situationRes;
|
|
14
|
+
return /*#__PURE__*/_jsx("div", {
|
|
15
|
+
className: "df-situation",
|
|
16
|
+
children: [{
|
|
17
|
+
name: '进场量',
|
|
18
|
+
value: situationRes === null || situationRes === void 0 ? void 0 : situationRes.todayInWeight,
|
|
19
|
+
rate: ((situationRes === null || situationRes === void 0 ? void 0 : situationRes.todayInWeight) || 0) / ((situationRes === null || situationRes === void 0 ? void 0 : situationRes.yesterdayInWeight) || 1) * 100,
|
|
20
|
+
unit: '吨',
|
|
21
|
+
img: 'jcl'
|
|
22
|
+
}, {
|
|
23
|
+
name: '进场车次',
|
|
24
|
+
value: situationRes === null || situationRes === void 0 ? void 0 : situationRes.todayInCar,
|
|
25
|
+
rate: ((situationRes === null || situationRes === void 0 ? void 0 : situationRes.todayInCar) || 0) / ((situationRes === null || situationRes === void 0 ? void 0 : situationRes.yesterdayInCar) || 1) * 100,
|
|
26
|
+
img: 'jccc'
|
|
27
|
+
}].map(function (item, index) {
|
|
28
|
+
var _item$rate;
|
|
29
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
30
|
+
children: [/*#__PURE__*/_jsx(VmFactor, _objectSpread(_objectSpread({}, item), {}, {
|
|
31
|
+
img: require("../../imgs/".concat(item.img, ".png"))
|
|
32
|
+
})), /*#__PURE__*/_jsxs("div", {
|
|
33
|
+
className: "df-situation-item-compare",
|
|
34
|
+
children: ["\u4E0E\u6628\u65E5\u6BD4 ", /*#__PURE__*/_jsxs("span", {
|
|
35
|
+
children: [(_item$rate = item.rate) === null || _item$rate === void 0 ? void 0 : _item$rate.toFixed(2), "%"]
|
|
36
|
+
}), /*#__PURE__*/_jsx("img", {
|
|
37
|
+
style: {
|
|
38
|
+
width: 14,
|
|
39
|
+
height: 14
|
|
40
|
+
},
|
|
41
|
+
src: require("../../imgs/".concat(item.rate > 100 ? 'up' : 'down', ".png"))
|
|
42
|
+
})]
|
|
43
|
+
})]
|
|
44
|
+
}, index);
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|