coolcare-lite-scada-component 2.0.12 → 2.0.14

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.
@@ -88,7 +88,7 @@ var ImageUploader = function ImageUploader(_ref) {
88
88
  };
89
89
  var customUploadRequest = /*#__PURE__*/function () {
90
90
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
91
- var onSuccess, onError, file, size, _yield$uploadFile, success, data;
91
+ var onSuccess, onError, file, size, _yield$uploadFile, code, data;
92
92
  return _regeneratorRuntime().wrap(function _callee$(_context) {
93
93
  while (1) switch (_context.prev = _context.next) {
94
94
  case 0:
@@ -107,19 +107,19 @@ var ImageUploader = function ImageUploader(_ref) {
107
107
  });
108
108
  case 7:
109
109
  _yield$uploadFile = _context.sent;
110
- success = _yield$uploadFile.success;
110
+ code = _yield$uploadFile.code;
111
111
  data = _yield$uploadFile.data;
112
- if (success && (data === null || data === void 0 ? void 0 : data.length)) {
112
+ if (code == 200 && data) {
113
113
  onChange === null || onChange === void 0 ? void 0 : onChange({
114
- url: data[0],
114
+ url: data,
115
115
  size: size,
116
116
  name: file.name
117
117
  });
118
118
  // @ts-ignore
119
119
  onSuccess({}, // @ts-ignore
120
120
  _objectSpread(_objectSpread({}, options.file), {}, {
121
- uid: data[0],
122
- url: data[0]
121
+ uid: data,
122
+ url: data
123
123
  }));
124
124
  } else {
125
125
  onError === null || onError === void 0 ? void 0 : onError(new Error('文件上传失败'));
@@ -27,7 +27,7 @@ var PointTooltipTitle = function PointTooltipTitle(_ref) {
27
27
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", (point === null || point === void 0 ? void 0 : point.pointName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", (_point$value = point === null || point === void 0 ? void 0 : point.value) !== null && _point$value !== void 0 ? _point$value : '-', " ", (_point$unit = point === null || point === void 0 ? void 0 : point.unit) !== null && _point$unit !== void 0 ? _point$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", (point === null || point === void 0 ? void 0 : point.updateTime) || '-'));
28
28
  };
29
29
  var PointItem = function PointItem(_ref2) {
30
- var _ref3, _point$pointName;
30
+ var _ref3, _point$unit2, _point$pointName;
31
31
  var point = _ref2.point,
32
32
  style = _ref2.style,
33
33
  valueStyles = _ref2.valueStyles,
@@ -57,7 +57,7 @@ var PointItem = function PointItem(_ref2) {
57
57
  style: _objectSpread({
58
58
  marginBottom: 4
59
59
  }, valueStyles)
60
- }, 'value' in point ? (_ref3 = point.pointEnumItemKey || point.value) !== null && _ref3 !== void 0 ? _ref3 : '-' : '点位状态'), /*#__PURE__*/React.createElement("div", {
60
+ }, 'value' in point ? ((_ref3 = point.pointEnumItemKey || point.value) !== null && _ref3 !== void 0 ? _ref3 : '-') + ((_point$unit2 = point.unit) !== null && _point$unit2 !== void 0 ? _point$unit2 : '') : '点位状态'), /*#__PURE__*/React.createElement("div", {
61
61
  style: labelStyles
62
62
  }, 'value' in point ? (_point$pointName = point === null || point === void 0 ? void 0 : point.pointName) !== null && _point$pointName !== void 0 ? _point$pointName : '-' : '点位名称')));
63
63
  };
@@ -188,7 +188,7 @@ var Display = function Display(_ref) {
188
188
  case 10:
189
189
  scadaConfig = data.list[0].config;
190
190
  if (scadaConfig) {
191
- setJsonConfig(JSON.parse(scadaConfig || '{}'));
191
+ setJsonConfig(JSON.parse((scadaConfig || '{}').replaceAll('https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/', '/').replaceAll('https://front-end-assets.oss-cn-shanghai.aliyuncs.com/', '/')));
192
192
  }
193
193
  _context3.next = 18;
194
194
  break;
@@ -207,7 +207,7 @@ export default (function () {
207
207
  case 10:
208
208
  scadaConfig = data.list[0].config;
209
209
  if (scadaConfig) {
210
- configJSON = JSON.parse(scadaConfig || '{}');
210
+ configJSON = JSON.parse((scadaConfig || '{}').replaceAll('https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/', '/').replaceAll('https://front-end-assets.oss-cn-shanghai.aliyuncs.com/', '/'));
211
211
  graphCore.graph.fromJSON(configJSON);
212
212
  if (configJSON.pageConfig) {
213
213
  setPageConfig(configJSON.pageConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "scripts": {
5
5
  "start": "umi dev",
6
6
  "build:prod": "UMI_ENV=prod umi build",