@vtx/modals2 5.0.46 → 5.0.48

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.
Files changed (35) hide show
  1. package/lib/_components/vm-card-statistics/index.less +27 -27
  2. package/lib/_components/vm-factor-list/index.less +11 -11
  3. package/lib/_components/vm-map/index.js +9 -0
  4. package/lib/_components/vm-popover/index.less +7 -7
  5. package/lib/_service/index.js +18 -1
  6. package/lib/vtx-base-modal/Header/index.less +98 -98
  7. package/lib/vtx-base-modal/Tabs/index.less +68 -68
  8. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  9. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  10. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  11. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  12. package/lib/vtx-default-modal/index.js +3 -3
  13. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  14. package/lib/vtx-df-modal/api-zd-reborn.js +246 -0
  15. package/lib/vtx-df-modal/components/BaseInfoZdReborn/Jcqsfx.js +71 -0
  16. package/lib/vtx-df-modal/components/BaseInfoZdReborn/Jczbqs.js +96 -0
  17. package/lib/vtx-df-modal/components/BaseInfoZdReborn/Qyjcl.js +41 -0
  18. package/lib/vtx-df-modal/components/BaseInfoZdReborn/RealtimeMonitor.js +149 -0
  19. package/lib/vtx-df-modal/components/BaseInfoZdReborn/Situation.js +47 -0
  20. package/lib/vtx-df-modal/components/BaseInfoZdReborn/index.js +140 -0
  21. package/lib/vtx-df-modal/components/BaseInfoZdReborn/index.less +161 -0
  22. package/lib/vtx-df-modal/components/Calendar/zd-reborn.js +142 -0
  23. package/lib/vtx-df-modal/components/MeteringZdReborn/ChartJccc.js +62 -0
  24. package/lib/vtx-df-modal/components/MeteringZdReborn/ChartJcqs.js +83 -0
  25. package/lib/vtx-df-modal/components/MeteringZdReborn/List.js +125 -0
  26. package/lib/vtx-df-modal/components/MeteringZdReborn/index.js +185 -0
  27. package/lib/vtx-df-modal/components/MeteringZdReborn/index.less +68 -0
  28. package/lib/vtx-df-modal/components/index.js +4 -1
  29. package/lib/vtx-df-modal/index.js +20 -8
  30. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  31. package/lib/vtx-restaurant-modal/config.js +52 -52
  32. package/lib/vtx-road-modal/components/Statistical/index.less +32 -32
  33. package/lib/vtx-staff-modal/components/BaseInfo/WorkStatic.js +2 -2
  34. package/lib/vtx-zzz-modal/index.js +4 -4
  35. package/package.json +81 -78
@@ -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
+ }
@@ -0,0 +1,140 @@
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
+ import { VtxImage } from '@vtx/components';
8
+ import { getVtxToken } from '@vtx/utils';
9
+ import { useSetState } from 'ahooks';
10
+ import { Col, Row } from 'antd';
11
+ import dayjs from 'dayjs';
12
+ import { useRef } from 'react';
13
+ import { VmEmpty, VmInfoCollection, VmWrapper } from "../../../_components";
14
+ import { CommonService } from "../../../_service";
15
+ import { getFieldRender } from "../../../_util";
16
+ import { BaseService } from "../../api-zd-reborn";
17
+ import "./index.less";
18
+ import Jcqsfx from "./Jcqsfx";
19
+ import Qyjcl from "./Qyjcl";
20
+ import RealtimeMonitor from "./RealtimeMonitor";
21
+ import Situation from "./Situation";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ var BaseInfo = function BaseInfo(props) {
24
+ var info = props.info,
25
+ detail = props.detail,
26
+ photos = props.photos,
27
+ code = props.code,
28
+ hasLm = props.hasLm,
29
+ realtimeMonitor = props.realtimeMonitor;
30
+ var nowDate = dayjs().format('YYYY-MM-DD');
31
+ var _useSetState = useSetState({
32
+ startDate: dayjs().subtract(1, 'month').format('YYYY-MM-DD'),
33
+ endDate: nowDate
34
+ }),
35
+ _useSetState2 = _slicedToArray(_useSetState, 2),
36
+ state = _useSetState2[0],
37
+ setState = _useSetState2[1];
38
+ var imgRef = useRef(null);
39
+ var startDate = state.startDate,
40
+ endDate = state.endDate;
41
+ var fields = CommonService.useGetFields(info === null || info === void 0 ? void 0 : info.typeCode);
42
+ var _BaseService$useSitua = BaseService.useSituation(detail === null || detail === void 0 ? void 0 : detail.deviceId, nowDate),
43
+ situationRes = _BaseService$useSitua.situationRes;
44
+ var handleAbility = detail === null || detail === void 0 ? void 0 : detail.handleAbility;
45
+ return /*#__PURE__*/_jsxs("div", {
46
+ className: "df-base-content",
47
+ children: [/*#__PURE__*/_jsx("div", {
48
+ className: "df-base-content-left",
49
+ children: /*#__PURE__*/_jsxs(VmWrapper, {
50
+ title: "\u57FA\u672C\u4FE1\u606F",
51
+ children: [/*#__PURE__*/_jsx("div", {
52
+ className: "base-top-img",
53
+ ref: imgRef,
54
+ children: photos.length ? /*#__PURE__*/_jsx("div", {
55
+ style: {
56
+ padding: '0 12px 12px'
57
+ },
58
+ children: /*#__PURE__*/_jsx(VtxImage, {
59
+ src: "/cloudFile/common/downloadFile?id=".concat(photos[0].id, "&token=").concat(getVtxToken('token')),
60
+ alt: photos[0].name,
61
+ isDark: true,
62
+ style: {
63
+ maxWidth: '340px',
64
+ height: 220,
65
+ overflow: 'hidden'
66
+ }
67
+ }, photos[0].id)
68
+ }) : /*#__PURE__*/_jsx(VmEmpty, {
69
+ type: "NO_PICTURE",
70
+ style: {
71
+ height: 220
72
+ }
73
+ })
74
+ }), /*#__PURE__*/_jsx("div", {
75
+ className: "base-top--base",
76
+ children: /*#__PURE__*/_jsx(VmInfoCollection, {
77
+ data: getFieldRender(fields, info),
78
+ horizontal: true,
79
+ width: "50%",
80
+ ellipsis: true,
81
+ padding: '0 12px 12px'
82
+ })
83
+ })]
84
+ })
85
+ }), /*#__PURE__*/_jsxs("div", {
86
+ className: "df-base-content-right",
87
+ children: [hasLm && /*#__PURE__*/_jsxs(Row, {
88
+ gutter: [16, 16],
89
+ style: {
90
+ marginBottom: 10
91
+ },
92
+ children: [/*#__PURE__*/_jsx(Col, {
93
+ span: 8,
94
+ children: /*#__PURE__*/_jsx(VmWrapper, {
95
+ title: "\u5B9E\u65F6\u8FDB\u573A\u60C5\u51B5",
96
+ style: {
97
+ height: 280
98
+ },
99
+ children: /*#__PURE__*/_jsx(Situation, {
100
+ situationRes: situationRes
101
+ })
102
+ })
103
+ }), /*#__PURE__*/_jsx(Col, {
104
+ span: 16,
105
+ children: /*#__PURE__*/_jsx(VmWrapper, {
106
+ style: {
107
+ height: 280
108
+ },
109
+ title: "\u533A\u57DF\u8FDB\u573A\u91CF\u5206\u6790",
110
+ filterType: "rangePicker",
111
+ dateValue: [dayjs(startDate), dayjs(endDate)],
112
+ filterChange: function filterChange(dates) {
113
+ return dates && setState({
114
+ startDate: dayjs(dates[0]).format('YYYY-MM-DD'),
115
+ endDate: dayjs(dates[1]).format('YYYY-MM-DD')
116
+ });
117
+ },
118
+ children: /*#__PURE__*/_jsx(Qyjcl, {
119
+ deviceId: detail === null || detail === void 0 ? void 0 : detail.deviceId,
120
+ startDate: startDate,
121
+ endDate: endDate
122
+ })
123
+ })
124
+ })]
125
+ }), (realtimeMonitor === null || realtimeMonitor === void 0 ? void 0 : realtimeMonitor.length) > 0 ? /*#__PURE__*/_jsx(RealtimeMonitor, {
126
+ realtimeMonitor: realtimeMonitor,
127
+ hasLm: hasLm
128
+ }) : null, hasLm && !(realtimeMonitor !== null && realtimeMonitor !== void 0 && realtimeMonitor.length) ?
129
+ /*#__PURE__*/
130
+ // 仅有计量
131
+ _jsx(Jcqsfx, {
132
+ deviceId: detail === null || detail === void 0 ? void 0 : detail.deviceId,
133
+ startDate: startDate,
134
+ endDate: endDate,
135
+ handleAbility: handleAbility
136
+ }) : null]
137
+ })]
138
+ });
139
+ };
140
+ export default BaseInfo;
@@ -0,0 +1,161 @@
1
+ .df-base-content {
2
+ height: 100%;
3
+ display: flex;
4
+ justify-content: start;
5
+ gap: 16px;
6
+
7
+ &-left {
8
+ width: 400px;
9
+ height: 616px;
10
+ }
11
+ &-right {
12
+ width: calc(100% - 416px);
13
+ }
14
+
15
+ .base-top {
16
+ &-desc {
17
+ &-exec {
18
+ color: var(--info-danger);
19
+ height: 40px;
20
+ }
21
+ }
22
+
23
+ &-img {
24
+ img {
25
+ width: 100%;
26
+ }
27
+ }
28
+
29
+ &--base {
30
+ max-height: 480px;
31
+ background-color: var(--content-bg-color);
32
+ overflow: auto;
33
+ margin-top: 12px;
34
+ }
35
+ &--jcqsfx {
36
+ margin-top: 14px;
37
+ }
38
+ &--chart {
39
+ height: 298px;
40
+ width: 100%;
41
+ }
42
+ }
43
+
44
+ .base-bottom {
45
+ margin-top: 10px;
46
+
47
+ &--right {
48
+ &-content {
49
+ width: 100%;
50
+ text-align: center;
51
+ overflow-y: auto;
52
+ }
53
+ }
54
+ }
55
+
56
+ .df-qyjcl {
57
+ height: 215px;
58
+ }
59
+
60
+ .df-overview-trend {
61
+ width: 100%;
62
+ margin-top: 16px;
63
+ &-content {
64
+ width: 100%;
65
+ height: 191px;
66
+ }
67
+ }
68
+ }
69
+
70
+ .df-situation {
71
+ overflow-y: auto;
72
+ padding: 0 12px;
73
+ display: flex;
74
+ flex-direction: column;
75
+ flex: 1 1;
76
+ gap: 24px;
77
+
78
+ .df-situation-item-compare {
79
+ margin-left: 56px;
80
+ font-family: Alibaba PuHuiTi 3, Alibaba PuHuiTi 30;
81
+ font-size: 14px;
82
+ display: flex;
83
+ color: var(--img-text-color);
84
+ line-height: 14px;
85
+ margin-top: 10px;
86
+
87
+ img {
88
+ transform: translateY(2px);
89
+ }
90
+ }
91
+ }
92
+
93
+ .df-monitor {
94
+ &-head {
95
+ width: 100%;
96
+ padding-left: 16px;
97
+
98
+ &-item {
99
+ display: flex;
100
+ justify-content: start;
101
+ align-items: start;
102
+ cursor: pointer;
103
+
104
+ img {
105
+ width: 36px;
106
+ height: 36px;
107
+ margin-right: 12px;
108
+ display: inline-block;
109
+ }
110
+ &-right {
111
+ text-align: left;
112
+ &-name {
113
+ color: var(--modal-title-color);
114
+ font-size: 14px;
115
+ }
116
+ &-valueNormal {
117
+ color: #52c41a;
118
+ line-height: 22px;
119
+ padding-left: 2px;
120
+
121
+ &::before {
122
+ content: '';
123
+ display: inline-block;
124
+ margin: 0 10px 2px 0;
125
+ width: 6px;
126
+ height: 6px;
127
+ border-radius: 50%;
128
+ background: #0fb964;
129
+ box-shadow: 0px 0px 3px 2px rgba(15, 185, 100, 0.5);
130
+ }
131
+ }
132
+
133
+ &-valueAlarm {
134
+ color: var(--info-danger);
135
+ line-height: 22px;
136
+ padding-left: 2px;
137
+
138
+ &::before {
139
+ content: '';
140
+ display: inline-block;
141
+ margin: 0 10px 2px 0;
142
+ width: 6px;
143
+ height: 6px;
144
+ border-radius: 50%;
145
+ background: #f5222d;
146
+ box-shadow: 0px 0px 3px 2px rgba(245, 34, 45, 0.5);
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ &-table {
153
+ height: 166px;
154
+ overflow-y: hidden;
155
+ }
156
+ }
157
+
158
+ .slick-track {
159
+ width: 340px;
160
+ overflow: hidden;
161
+ }
@@ -0,0 +1,142 @@
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
+ import { useSetState } from 'ahooks';
14
+ import dayjs from 'dayjs';
15
+ import { VmCalendar, VmCalendarInner, VmWrapper } from "../../../_components";
16
+ import useSettings from "../../../_hooks/useSettings";
17
+ import { CalendarService } from "../../api-zd-reborn";
18
+ import blockA from "../../../_imgs/block_alarm.png";
19
+ import blockN from "../../../_imgs/block_normal.png";
20
+ import car from "../../imgs/c_car.png";
21
+ import jcl from "../../imgs/c_jcl.png";
22
+ import "./index.less";
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
+ var Charts = function Charts(_ref) {
25
+ var code = _ref.code,
26
+ deviceId = _ref.deviceId,
27
+ handleAbility = _ref.handleAbility;
28
+ var _useSettings = useSettings(),
29
+ isDark = _useSettings.isDark;
30
+ var _useSetState = useSetState({
31
+ date: dayjs(),
32
+ data: []
33
+ }),
34
+ _useSetState2 = _slicedToArray(_useSetState, 2),
35
+ state = _useSetState2[0],
36
+ setState = _useSetState2[1];
37
+ var date = state.date;
38
+ var _CalendarService$useF = CalendarService.useFetchData(deviceId, date.startOf('M').format('YYYY-MM-DD'), date.endOf('M').format('YYYY-MM-DD')),
39
+ data1 = _CalendarService$useF.data1;
40
+ var _CalendarService$useF2 = CalendarService.useFetchData2(code, date.startOf('M').format('YYYY-MM-DD 00:00:00'), date.endOf('M').format('YYYY-MM-DD 23:59:59')),
41
+ data2 = _CalendarService$useF2.data2;
42
+ var dateCellRender = function dateCellRender(value) {
43
+ var _data2$filter;
44
+ var obj1 = (data1 === null || data1 === void 0 ? void 0 : data1.find(function (ele) {
45
+ return ele.date === value.format('YYYY-MM-DD');
46
+ })) || {}; // carNums、netWeight
47
+ var obj2 = (data2 === null || data2 === void 0 || (_data2$filter = data2.filter(function (ele) {
48
+ return !dayjs(ele.date).isAfter(dayjs(), 'day');
49
+ }) // 筛选出当前日期之前的数据
50
+ ) === null || _data2$filter === void 0 ? void 0 : _data2$filter.find(function (ele) {
51
+ return ele.date === value.format('YYYY-MM-DD');
52
+ })) || {}; // alarmNum、beenNormal
53
+ var hasLm = (obj1 === null || obj1 === void 0 ? void 0 : obj1.todayTotalInWeight) > 0;
54
+ var isOverWeight = (obj1 === null || obj1 === void 0 ? void 0 : obj1.todayTotalInWeight) / 1000 > handleAbility; // 进厂量是否超过设计能力
55
+ var isNormal = obj2 === null || obj2 === void 0 ? void 0 : obj2.beenNormal;
56
+ var showTip = Object.prototype.hasOwnProperty.call(obj2, 'beenNormal');
57
+ return /*#__PURE__*/_jsxs("div", {
58
+ className: "df-calendar-cell",
59
+ children: [!!data2 && /*#__PURE__*/_jsxs("div", {
60
+ className: "df-calendar-cell-head",
61
+ style: {
62
+ color: isNormal ? '#0FB964' : '#F5222D',
63
+ top: hasLm ? '-30px' : '-22px'
64
+ },
65
+ children: [showTip && /*#__PURE__*/_jsx("img", {
66
+ src: isNormal ? blockN : blockA
67
+ }), showTip ? isNormal ? '正常' : '异常' : '']
68
+ }), hasLm && /*#__PURE__*/_jsxs(_Fragment, {
69
+ children: [/*#__PURE__*/_jsx(VmCalendarInner, {
70
+ type: "blue",
71
+ img: jcl,
72
+ isAlarm: isOverWeight,
73
+ value: (((obj1 === null || obj1 === void 0 ? void 0 : obj1.todayTotalInWeight) || 0) / 1000).toFixed(2),
74
+ style: {
75
+ width: '139px',
76
+ justifyContent: 'space-between',
77
+ margin: '8px 0',
78
+ color: '#0FB964'
79
+ }
80
+ }), /*#__PURE__*/_jsx(VmCalendarInner, {
81
+ type: "green",
82
+ img: car,
83
+ value: (obj1 === null || obj1 === void 0 ? void 0 : obj1.todayTotalInCar) || 0,
84
+ style: {
85
+ width: '139px',
86
+ justifyContent: 'space-between'
87
+ }
88
+ })]
89
+ })]
90
+ });
91
+ };
92
+ return /*#__PURE__*/_jsx("div", {
93
+ className: "df-calendar ".concat(isDark ? 'dark' : ''),
94
+ children: /*#__PURE__*/_jsxs(VmWrapper, {
95
+ title: "\u8FD0\u884C\u603B\u89C8",
96
+ needChange: false,
97
+ filterType: "monthPicker",
98
+ dateValue: date,
99
+ filterChange: function filterChange(dates) {
100
+ return dates && setState({
101
+ date: dates
102
+ });
103
+ },
104
+ disabledDate: function disabledDate(current) {
105
+ return current && current > dayjs().endOf('M');
106
+ },
107
+ contentStyle: {
108
+ marginBottom: 16,
109
+ height: '440px'
110
+ },
111
+ children: [/*#__PURE__*/_jsx("div", {
112
+ className: "df-calendar-head",
113
+ children: [{
114
+ name: '进场量(吨)',
115
+ img: jcl,
116
+ type: 'blue'
117
+ }, {
118
+ name: '车次',
119
+ img: car,
120
+ type: 'green'
121
+ }, {
122
+ name: '工况正常',
123
+ imgType: 'normal'
124
+ }, {
125
+ name: '工况异常',
126
+ imgType: 'alarm'
127
+ }].map(function (item, index) {
128
+ return /*#__PURE__*/_jsx(VmCalendarInner, _objectSpread(_objectSpread({}, item), {}, {
129
+ value: item.name
130
+ }), index);
131
+ })
132
+ }), /*#__PURE__*/_jsx("div", {
133
+ className: "df-calendar-content",
134
+ children: /*#__PURE__*/_jsx(VmCalendar, {
135
+ dateCellRender: dateCellRender,
136
+ value: date
137
+ })
138
+ })]
139
+ })
140
+ });
141
+ };
142
+ export default Charts;