coolcare-lite-scada-component 3.0.1 → 3.0.3
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/es/components/DialogHistory/index.css +22 -0
- package/es/components/DialogHistory/index.js +317 -83
- package/es/components/DialogImagePicker/GroupPanel/index.js +1 -1
- package/es/components/ECharts/index.js +31 -23
- package/es/components/Icon/index.js +1 -1
- package/es/components/ImageUploader/index.js +1 -1
- package/es/components/ModalChoosePoint/index.js +235 -0
- package/es/element/EleFan/Component.js +1 -1
- package/es/element/EleFanBySvg/index.js +3 -3
- package/es/element/EleImage/index.js +1 -1
- package/es/element/ElePointImage/index.js +1 -1
- package/es/element/ElePointValue/Component.js +10 -6
- package/es/element/ElePointValue/PropsSet/StatisticsPropsSet/index.js +77 -0
- package/es/element/ElePointValue/PropsSet/index.js +5 -1
- package/es/element/EleState/index.js +1 -1
- package/es/element/EleSwitch/Component.js +3 -4
- package/es/element/EleSwitch/index.css +3 -0
- package/es/element/PipeNodes/NodeBL/index.js +1 -1
- package/es/element/PipeNodes/NodeBR/index.js +1 -1
- package/es/element/PipeNodes/NodeBottom/index.js +1 -1
- package/es/element/PipeNodes/NodeCenter/index.js +1 -1
- package/es/element/PipeNodes/NodeHorizontal/index.js +1 -1
- package/es/element/PipeNodes/NodeLeft/index.js +1 -1
- package/es/element/PipeNodes/NodeRight/index.js +1 -1
- package/es/element/PipeNodes/NodeTL/index.js +1 -1
- package/es/element/PipeNodes/NodeTR/index.js +1 -1
- package/es/element/PipeNodes/NodeTop/index.js +1 -1
- package/es/element/PipeNodes/NodeVertical/index.js +1 -1
- package/es/element/type.d.ts +1 -0
- package/es/element/utils/pointWrite.js +6 -7
- package/es/pages/display/Player/index.js +104 -16
- package/es/pages/display/index.js +2 -2
- package/es/pages/editor/PanelLeft/BasicShapeList/listData.js +8 -8
- package/es/pages/editor/PanelLeft/ImgGroup/index.js +1 -1
- package/es/pages/editor/PanelLeft/MetaEleList/listData.js +14 -14
- package/es/pages/editor/PanelLeft/PipeEleList/listData.js +11 -11
- package/es/pages/editor/PanelLeft/PointCardEleList/listData.js +6 -6
- package/es/pages/editor/PanelLeft/RecommendEleList/listData.js +4 -4
- package/es/pages/editor/PanelRight/components/FormLayer/index.js +12 -2
- package/es/pages/editor/index.js +15 -2
- package/es/services/gateway/Point.js +56 -7
- package/es/services/request.js +1 -1
- package/es/typings.d.ts +18 -4
- package/es/utils/auth.js +2 -2
- package/es/utils/date.js +7 -0
- package/package.json +3 -3
|
@@ -42,7 +42,8 @@ var LayerForm = function LayerForm() {
|
|
|
42
42
|
backgroundColor = values.backgroundColor,
|
|
43
43
|
borderRadius = values.borderRadius,
|
|
44
44
|
backgroundImage = values.backgroundImage,
|
|
45
|
-
dimensionsSelectValue = values.dimensionsSelectValue
|
|
45
|
+
dimensionsSelectValue = values.dimensionsSelectValue,
|
|
46
|
+
refreshFrequency = values.refreshFrequency;
|
|
46
47
|
var width = values.width,
|
|
47
48
|
height = values.height;
|
|
48
49
|
if (dimensionsSelectValue !== '自定义') {
|
|
@@ -64,7 +65,8 @@ var LayerForm = function LayerForm() {
|
|
|
64
65
|
title: title,
|
|
65
66
|
backgroundColor: backgroundColor,
|
|
66
67
|
backgroundImage: backgroundImage,
|
|
67
|
-
borderRadius: borderRadius
|
|
68
|
+
borderRadius: borderRadius,
|
|
69
|
+
refreshFrequency: refreshFrequency
|
|
68
70
|
}));
|
|
69
71
|
}, {
|
|
70
72
|
leading: false,
|
|
@@ -138,6 +140,14 @@ var LayerForm = function LayerForm() {
|
|
|
138
140
|
autoComplete: "off",
|
|
139
141
|
onValuesChange: onFormChange
|
|
140
142
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
143
|
+
name: "refreshFrequency",
|
|
144
|
+
label: "\u5237\u65B0\u9891\u7387"
|
|
145
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
146
|
+
min: 5,
|
|
147
|
+
max: 999,
|
|
148
|
+
defaultValue: 90,
|
|
149
|
+
addonBefore: "秒"
|
|
150
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
141
151
|
name: "dimensionsSelectValue",
|
|
142
152
|
label: "\u5206\u8FA8\u7387"
|
|
143
153
|
}, /*#__PURE__*/React.createElement(Select, {
|
package/es/pages/editor/index.js
CHANGED
|
@@ -182,7 +182,7 @@ export default (function () {
|
|
|
182
182
|
if (query.scene === 'freedom') {
|
|
183
183
|
var fetchScadaConfig = /*#__PURE__*/function () {
|
|
184
184
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
185
|
-
var hideMsg, _data$list, _yield$GetCompanyConf, success, data, scadaConfig, configJSON, width, height;
|
|
185
|
+
var hideMsg, _data$list, _yield$GetCompanyConf, success, data, scadaConfig, _configJSON$cells, configJSON, width, height;
|
|
186
186
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
187
187
|
while (1) switch (_context2.prev = _context2.next) {
|
|
188
188
|
case 0:
|
|
@@ -207,7 +207,20 @@ export default (function () {
|
|
|
207
207
|
case 10:
|
|
208
208
|
scadaConfig = data.list[0].config;
|
|
209
209
|
if (scadaConfig) {
|
|
210
|
-
configJSON = JSON.parse((scadaConfig || '{}').replaceAll('https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/', '
|
|
210
|
+
configJSON = JSON.parse((scadaConfig || '{}').replaceAll('https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/', '/imgfile/iot/').replaceAll('https://front-end-assets.oss-cn-shanghai.aliyuncs.com/', '/imgfile/iot/')); // 修复后端保存数据时,因json数据种存在"%"而导致的"%"数据丢失问题
|
|
211
|
+
if (configJSON === null || configJSON === void 0 ? void 0 : (_configJSON$cells = configJSON.cells) === null || _configJSON$cells === void 0 ? void 0 : _configJSON$cells.length) {
|
|
212
|
+
configJSON === null || configJSON === void 0 ? void 0 : configJSON.cells.forEach(function (item) {
|
|
213
|
+
var _item$attrs, _item$attrs$body, _item$attrs2, _item$attrs2$body, _item$attrs2$body$ref, _item$attrs3, _item$attrs3$body, _item$attrs5, _item$attrs5$body, _item$attrs6, _item$attrs6$body, _item$attrs6$body$ref, _item$attrs7, _item$attrs7$body;
|
|
214
|
+
if ((item === null || item === void 0 ? void 0 : (_item$attrs = item.attrs) === null || _item$attrs === void 0 ? void 0 : (_item$attrs$body = _item$attrs.body) === null || _item$attrs$body === void 0 ? void 0 : _item$attrs$body.refWidth) && (item === null || item === void 0 ? void 0 : (_item$attrs2 = item.attrs) === null || _item$attrs2 === void 0 ? void 0 : (_item$attrs2$body = _item$attrs2.body) === null || _item$attrs2$body === void 0 ? void 0 : (_item$attrs2$body$ref = _item$attrs2$body.refWidth) === null || _item$attrs2$body$ref === void 0 ? void 0 : _item$attrs2$body$ref.indexOf('%')) === -1 && !isNaN(Number(item === null || item === void 0 ? void 0 : (_item$attrs3 = item.attrs) === null || _item$attrs3 === void 0 ? void 0 : (_item$attrs3$body = _item$attrs3.body) === null || _item$attrs3$body === void 0 ? void 0 : _item$attrs3$body.refWidth))) {
|
|
215
|
+
var _item$attrs4, _item$attrs4$body;
|
|
216
|
+
item.attrs.body.refWidth = "".concat(item === null || item === void 0 ? void 0 : (_item$attrs4 = item.attrs) === null || _item$attrs4 === void 0 ? void 0 : (_item$attrs4$body = _item$attrs4.body) === null || _item$attrs4$body === void 0 ? void 0 : _item$attrs4$body.refWidth, "%");
|
|
217
|
+
}
|
|
218
|
+
if ((item === null || item === void 0 ? void 0 : (_item$attrs5 = item.attrs) === null || _item$attrs5 === void 0 ? void 0 : (_item$attrs5$body = _item$attrs5.body) === null || _item$attrs5$body === void 0 ? void 0 : _item$attrs5$body.refHeight) && (item === null || item === void 0 ? void 0 : (_item$attrs6 = item.attrs) === null || _item$attrs6 === void 0 ? void 0 : (_item$attrs6$body = _item$attrs6.body) === null || _item$attrs6$body === void 0 ? void 0 : (_item$attrs6$body$ref = _item$attrs6$body.refHeight) === null || _item$attrs6$body$ref === void 0 ? void 0 : _item$attrs6$body$ref.indexOf('%')) === -1 && !isNaN(Number(item === null || item === void 0 ? void 0 : (_item$attrs7 = item.attrs) === null || _item$attrs7 === void 0 ? void 0 : (_item$attrs7$body = _item$attrs7.body) === null || _item$attrs7$body === void 0 ? void 0 : _item$attrs7$body.refHeight))) {
|
|
219
|
+
var _item$attrs8, _item$attrs8$body;
|
|
220
|
+
item.attrs.body.refHeight = "".concat(item === null || item === void 0 ? void 0 : (_item$attrs8 = item.attrs) === null || _item$attrs8 === void 0 ? void 0 : (_item$attrs8$body = _item$attrs8.body) === null || _item$attrs8$body === void 0 ? void 0 : _item$attrs8$body.refHeight, "%");
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
211
224
|
graphCore.graph.fromJSON(configJSON);
|
|
212
225
|
if (configJSON.pageConfig) {
|
|
213
226
|
setPageConfig(configJSON.pageConfig);
|
|
@@ -90,8 +90,7 @@ function _GetPointPage() {
|
|
|
90
90
|
export function GetPointHistoryData(_x7, _x8) {
|
|
91
91
|
return _GetPointHistoryData.apply(this, arguments);
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
/** 历史数据导出xlsx货pdf(支持进度条) POST /api/GatewayMicro/Point/DownHistoryDataToExcelOrPdf */
|
|
93
|
+
/** 获取点位历史数据 POST /api/GatewayMicro/Point/GetPointHistoryData */
|
|
95
94
|
function _GetPointHistoryData() {
|
|
96
95
|
_GetPointHistoryData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(body, options) {
|
|
97
96
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -112,15 +111,17 @@ function _GetPointHistoryData() {
|
|
|
112
111
|
}));
|
|
113
112
|
return _GetPointHistoryData.apply(this, arguments);
|
|
114
113
|
}
|
|
115
|
-
export function
|
|
116
|
-
return
|
|
114
|
+
export function GetPointAggregationData(_x9, _x10) {
|
|
115
|
+
return _GetPointAggregationData.apply(this, arguments);
|
|
117
116
|
}
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
|
|
118
|
+
/** 获取点位历史数据 POST /api/GatewayMicro/Point/GetPointHistoryData */
|
|
119
|
+
function _GetPointAggregationData() {
|
|
120
|
+
_GetPointAggregationData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(body, options) {
|
|
120
121
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
121
122
|
while (1) switch (_context5.prev = _context5.next) {
|
|
122
123
|
case 0:
|
|
123
|
-
return _context5.abrupt("return", request('/api/GatewayMicro/Point/
|
|
124
|
+
return _context5.abrupt("return", request('/api/GatewayMicro/Point/GetPointAggregationData', _objectSpread({
|
|
124
125
|
method: 'POST',
|
|
125
126
|
headers: {
|
|
126
127
|
'Content-Type': 'application/json-patch+json'
|
|
@@ -133,5 +134,53 @@ function _DownHistoryDataToExcelOrPdf() {
|
|
|
133
134
|
}
|
|
134
135
|
}, _callee5);
|
|
135
136
|
}));
|
|
137
|
+
return _GetPointAggregationData.apply(this, arguments);
|
|
138
|
+
}
|
|
139
|
+
export function GetTdIndicatorAggregateData(_x11, _x12) {
|
|
140
|
+
return _GetTdIndicatorAggregateData.apply(this, arguments);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** 历史数据导出xlsx货pdf(支持进度条) POST /api/GatewayMicro/Point/DownHistoryDataToExcelOrPdf */
|
|
144
|
+
function _GetTdIndicatorAggregateData() {
|
|
145
|
+
_GetTdIndicatorAggregateData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(body, options) {
|
|
146
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
147
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
148
|
+
case 0:
|
|
149
|
+
return _context6.abrupt("return", request('/api/GatewayMicro/DeviceIndicator/GetTdIndicatorAggregateData', _objectSpread({
|
|
150
|
+
method: 'POST',
|
|
151
|
+
headers: {
|
|
152
|
+
'Content-Type': 'application/json-patch+json'
|
|
153
|
+
},
|
|
154
|
+
data: body
|
|
155
|
+
}, options || {})));
|
|
156
|
+
case 1:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context6.stop();
|
|
159
|
+
}
|
|
160
|
+
}, _callee6);
|
|
161
|
+
}));
|
|
162
|
+
return _GetTdIndicatorAggregateData.apply(this, arguments);
|
|
163
|
+
}
|
|
164
|
+
export function DownHistoryDataToExcelOrPdf(_x13, _x14) {
|
|
165
|
+
return _DownHistoryDataToExcelOrPdf.apply(this, arguments);
|
|
166
|
+
}
|
|
167
|
+
function _DownHistoryDataToExcelOrPdf() {
|
|
168
|
+
_DownHistoryDataToExcelOrPdf = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(body, options) {
|
|
169
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
170
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
return _context7.abrupt("return", request('/api/GatewayMicro/Point/DownHistoryDataToExcelOrPdf', _objectSpread({
|
|
173
|
+
method: 'POST',
|
|
174
|
+
headers: {
|
|
175
|
+
'Content-Type': 'application/json-patch+json'
|
|
176
|
+
},
|
|
177
|
+
data: body
|
|
178
|
+
}, options || {})));
|
|
179
|
+
case 1:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context7.stop();
|
|
182
|
+
}
|
|
183
|
+
}, _callee7);
|
|
184
|
+
}));
|
|
136
185
|
return _DownHistoryDataToExcelOrPdf.apply(this, arguments);
|
|
137
186
|
}
|
package/es/services/request.js
CHANGED
|
@@ -84,7 +84,7 @@ requestClient.use(/*#__PURE__*/function () {
|
|
|
84
84
|
case 0:
|
|
85
85
|
req = ctx.req;
|
|
86
86
|
url = req.url;
|
|
87
|
-
ctx.req.url = "
|
|
87
|
+
ctx.req.url = "".concat(window.location.origin, ".nip.io").concat(url);
|
|
88
88
|
_context.next = 5;
|
|
89
89
|
return next();
|
|
90
90
|
case 5:
|
package/es/typings.d.ts
CHANGED
|
@@ -29,32 +29,38 @@ type EditorQuery =
|
|
|
29
29
|
scadaType: '0' | '1';
|
|
30
30
|
/** 来源 */
|
|
31
31
|
from?: string;
|
|
32
|
+
/** 公司 id */
|
|
33
|
+
companyId: string;
|
|
32
34
|
/** 项目 id */
|
|
33
35
|
projectId?: string;
|
|
34
36
|
}
|
|
35
37
|
| {
|
|
36
38
|
scene: 'device';
|
|
39
|
+
/** 公司 id */
|
|
40
|
+
companyId: string;
|
|
41
|
+
/** 项目 id */
|
|
42
|
+
projectId?: string;
|
|
37
43
|
/** scene = 'device' 时传设备 id */
|
|
38
44
|
deviceId: string;
|
|
39
45
|
/** 组态类型:web | app */
|
|
40
46
|
scadaType: '0' | '1';
|
|
41
47
|
/** 来源 */
|
|
42
48
|
from?: string;
|
|
43
|
-
/** 项目 id */
|
|
44
|
-
projectId?: string;
|
|
45
49
|
}
|
|
46
50
|
| {
|
|
47
51
|
scene: 'freedom';
|
|
48
52
|
/** 组态 id */
|
|
49
53
|
scadaId: string;
|
|
50
|
-
/** 公司 id */
|
|
51
|
-
companyId: string;
|
|
52
54
|
/** 组态标题 */
|
|
53
55
|
title: string;
|
|
54
56
|
/** 来源 */
|
|
55
57
|
from?: string;
|
|
58
|
+
/** 公司 id */
|
|
59
|
+
companyId: string;
|
|
56
60
|
/** 项目 id */
|
|
57
61
|
projectId?: string;
|
|
62
|
+
// 权限
|
|
63
|
+
premission?: string;
|
|
58
64
|
};
|
|
59
65
|
|
|
60
66
|
type PlayerQuery =
|
|
@@ -84,6 +90,10 @@ type PlayerQuery =
|
|
|
84
90
|
token?: string;
|
|
85
91
|
/** 刷新token */
|
|
86
92
|
xToken?: string;
|
|
93
|
+
/** 公司 id */
|
|
94
|
+
companyId: string;
|
|
95
|
+
/** 项目 id */
|
|
96
|
+
projectId?: string;
|
|
87
97
|
}
|
|
88
98
|
| {
|
|
89
99
|
/** 通过输入的环境名 env, 决定接口调用的地址,默认是 prod */
|
|
@@ -134,6 +144,10 @@ type PlayerQuery =
|
|
|
134
144
|
token?: string;
|
|
135
145
|
/** 刷新token */
|
|
136
146
|
xToken?: string;
|
|
147
|
+
/** 项目 id */
|
|
148
|
+
projectId?: string;
|
|
149
|
+
/** 权限 */
|
|
150
|
+
premission: string
|
|
137
151
|
};
|
|
138
152
|
|
|
139
153
|
type WindowCommunicateMsg =
|
package/es/utils/auth.js
CHANGED
|
@@ -45,12 +45,12 @@ export function parseAccessToken(token) {
|
|
|
45
45
|
export function storeToken(accessToken, xAccessToken) {
|
|
46
46
|
// 将 access-token 保存到 cookie
|
|
47
47
|
Cookies.set(accessTokenCookieName, accessToken || '', {
|
|
48
|
-
domain:
|
|
48
|
+
domain: window.location.origin
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
// 将 x-access-token 保存到 cookie
|
|
52
52
|
Cookies.set(xAccessTokenCookieName, xAccessToken || '', {
|
|
53
|
-
domain:
|
|
53
|
+
domain: window.location.origin
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
export function storeAccessToken(token) {
|
package/es/utils/date.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function dateDiff(str, end) {
|
|
2
|
+
var diff = (new Date(end).getTime() - new Date(str).getTime()) / 1000;
|
|
3
|
+
var d = Math.floor(diff / (60 * 60 * 24));
|
|
4
|
+
var h = Math.floor(diff % (60 * 60 * 24) / 60 / 60);
|
|
5
|
+
var m = Math.floor(diff % (60 * 60) / 60);
|
|
6
|
+
return "".concat(d ? "".concat(d, "\u5929") : '').concat(h ? "".concat(h, "\u5C0F\u65F6") : '', "".concat(m, "\u5206\u949F"));
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coolcare-lite-scada-component",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"start": "umi dev",
|
|
5
|
+
"start": " umi dev",
|
|
6
6
|
"build:prod": "UMI_ENV=prod umi build",
|
|
7
7
|
"build:generalfushi": "UMI_ENV=prod REACT_APP_PLATFORM=generalfushi umi build",
|
|
8
8
|
"build:ruijin": "UMI_ENV=prod REACT_APP_PLATFORM=ruijin umi build",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test": "umi-test",
|
|
14
14
|
"test:coverage": "umi-test --coverage",
|
|
15
15
|
"analyze": "ANALYZE=1 umi build",
|
|
16
|
-
"deploy:prod": "docker build -t xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/ruijin:master-2025-1
|
|
16
|
+
"deploy:prod": "docker build -t xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/ruijin:master-2025-4-14-1 . && docker push xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/ruijin:master-2025-4-14-1"
|
|
17
17
|
},
|
|
18
18
|
"main": "./es/componentIndex.js",
|
|
19
19
|
"module": "./es/componentIndex.js",
|