@riil-frontend/component-topology 7.0.0-dev.16 → 7.0.0-dev.17
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/build/index.js +1 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/package.json +2 -2
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "7.0.0-dev.
|
26
|
+
var version = typeof "7.0.0-dev.17" === 'string' ? "7.0.0-dev.17" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -912,6 +912,8 @@ export default function ResourceOverview(props) {
|
|
912
912
|
defaultDisabledCol: ['display_name'],
|
913
913
|
max: 6,
|
914
914
|
columns: baseInfoCol,
|
915
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
916
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
915
917
|
onChange: baseInfoColChange
|
916
918
|
}));
|
917
919
|
}
|
@@ -932,6 +934,8 @@ export default function ResourceOverview(props) {
|
|
932
934
|
defaultCol: defaultCols.keyIndicators,
|
933
935
|
max: 6,
|
934
936
|
columns: metricCol,
|
937
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
938
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
935
939
|
onChange: metricColChange
|
936
940
|
})
|
937
941
|
}, /*#__PURE__*/React.createElement(ResourceOverviewMetric, {
|
@@ -33,7 +33,9 @@ function Configurator(props) {
|
|
33
33
|
type = props.type,
|
34
34
|
max = props.max,
|
35
35
|
_props$btnStyle = props.btnStyle,
|
36
|
-
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle
|
36
|
+
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle,
|
37
|
+
getOverviewConfig = props.getOverviewConfig,
|
38
|
+
saveOverviewConfig = props.saveOverviewConfig; // console.log('Configurator props', props);
|
37
39
|
|
38
40
|
var buttonRef = useRef(null);
|
39
41
|
|
@@ -71,35 +73,33 @@ function Configurator(props) {
|
|
71
73
|
|
72
74
|
function _init() {
|
73
75
|
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
76
|
+
var _overviewConfig;
|
77
|
+
|
74
78
|
var overviewConfig, newPrevCols, newNextCols, oldCols, newCols;
|
75
79
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
76
80
|
while (1) {
|
77
81
|
switch (_context3.prev = _context3.next) {
|
78
82
|
case 0:
|
83
|
+
overviewConfig = {};
|
84
|
+
|
79
85
|
if (!(topoId && templateCode)) {
|
80
|
-
_context3.next =
|
86
|
+
_context3.next = 5;
|
81
87
|
break;
|
82
88
|
}
|
83
89
|
|
84
|
-
_context3.next =
|
85
|
-
return service.getOverviewConfig(topoId, templateCode);
|
90
|
+
_context3.next = 4;
|
91
|
+
return (getOverviewConfig || service.getOverviewConfig)(topoId, templateCode);
|
86
92
|
|
87
|
-
case
|
88
|
-
|
89
|
-
_context3.next = 7;
|
90
|
-
break;
|
93
|
+
case 4:
|
94
|
+
overviewConfig = _context3.sent;
|
91
95
|
|
92
|
-
case
|
93
|
-
_context3.t0 = {};
|
94
|
-
|
95
|
-
case 7:
|
96
|
-
overviewConfig = _context3.t0;
|
96
|
+
case 5:
|
97
97
|
// console.log('overviewConfig', overviewConfig);
|
98
98
|
// const overviewConfig = ''
|
99
99
|
newPrevCols = [];
|
100
100
|
newNextCols = [];
|
101
101
|
|
102
|
-
if (overviewConfig !== null &&
|
102
|
+
if ((_overviewConfig = overviewConfig) !== null && _overviewConfig !== void 0 && _overviewConfig[type]) {
|
103
103
|
oldCols = JSON.parse(overviewConfig[type]) || []; // 已设置
|
104
104
|
|
105
105
|
oldCols.forEach(function (old_item) {
|
@@ -149,7 +149,7 @@ function Configurator(props) {
|
|
149
149
|
setOrgColumns(newCols);
|
150
150
|
onChange(newCols);
|
151
151
|
|
152
|
-
case
|
152
|
+
case 12:
|
153
153
|
case "end":
|
154
154
|
return _context3.stop();
|
155
155
|
}
|
@@ -227,7 +227,7 @@ function Configurator(props) {
|
|
227
227
|
|
228
228
|
var onOk = /*#__PURE__*/function () {
|
229
229
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
230
|
-
var
|
230
|
+
var _ref3;
|
231
231
|
|
232
232
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
233
233
|
while (1) {
|
@@ -242,7 +242,7 @@ function Configurator(props) {
|
|
242
242
|
}
|
243
243
|
|
244
244
|
_context2.next = 5;
|
245
|
-
return service.saveOverviewConfig(topoId, templateCode, (
|
245
|
+
return (saveOverviewConfig || service.saveOverviewConfig)(topoId, templateCode, (_ref3 = {}, _ref3[type] = JSON.stringify(columnsState), _ref3));
|
246
246
|
|
247
247
|
case 5:
|
248
248
|
case "end":
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "7.0.0-dev.
|
57
|
+
var version = typeof "7.0.0-dev.17" === 'string' ? "7.0.0-dev.17" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -947,6 +947,8 @@ function ResourceOverview(props) {
|
|
947
947
|
defaultDisabledCol: ['display_name'],
|
948
948
|
max: 6,
|
949
949
|
columns: baseInfoCol,
|
950
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
951
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
950
952
|
onChange: baseInfoColChange
|
951
953
|
}));
|
952
954
|
}
|
@@ -967,6 +969,8 @@ function ResourceOverview(props) {
|
|
967
969
|
defaultCol: defaultCols.keyIndicators,
|
968
970
|
max: 6,
|
969
971
|
columns: metricCol,
|
972
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
973
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
970
974
|
onChange: metricColChange
|
971
975
|
})
|
972
976
|
}, /*#__PURE__*/_react["default"].createElement(_ResourceOverviewMetric["default"], {
|
@@ -58,7 +58,9 @@ function Configurator(props) {
|
|
58
58
|
type = props.type,
|
59
59
|
max = props.max,
|
60
60
|
_props$btnStyle = props.btnStyle,
|
61
|
-
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle
|
61
|
+
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle,
|
62
|
+
getOverviewConfig = props.getOverviewConfig,
|
63
|
+
saveOverviewConfig = props.saveOverviewConfig; // console.log('Configurator props', props);
|
62
64
|
|
63
65
|
var buttonRef = (0, _react.useRef)(null);
|
64
66
|
|
@@ -96,35 +98,33 @@ function Configurator(props) {
|
|
96
98
|
|
97
99
|
function _init() {
|
98
100
|
_init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
101
|
+
var _overviewConfig;
|
102
|
+
|
99
103
|
var overviewConfig, newPrevCols, newNextCols, oldCols, newCols;
|
100
104
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
101
105
|
while (1) {
|
102
106
|
switch (_context3.prev = _context3.next) {
|
103
107
|
case 0:
|
108
|
+
overviewConfig = {};
|
109
|
+
|
104
110
|
if (!(topoId && templateCode)) {
|
105
|
-
_context3.next =
|
111
|
+
_context3.next = 5;
|
106
112
|
break;
|
107
113
|
}
|
108
114
|
|
109
|
-
_context3.next =
|
110
|
-
return _overview["default"].getOverviewConfig(topoId, templateCode);
|
115
|
+
_context3.next = 4;
|
116
|
+
return (getOverviewConfig || _overview["default"].getOverviewConfig)(topoId, templateCode);
|
111
117
|
|
112
|
-
case
|
113
|
-
|
114
|
-
_context3.next = 7;
|
115
|
-
break;
|
118
|
+
case 4:
|
119
|
+
overviewConfig = _context3.sent;
|
116
120
|
|
117
|
-
case
|
118
|
-
_context3.t0 = {};
|
119
|
-
|
120
|
-
case 7:
|
121
|
-
overviewConfig = _context3.t0;
|
121
|
+
case 5:
|
122
122
|
// console.log('overviewConfig', overviewConfig);
|
123
123
|
// const overviewConfig = ''
|
124
124
|
newPrevCols = [];
|
125
125
|
newNextCols = [];
|
126
126
|
|
127
|
-
if (overviewConfig !== null &&
|
127
|
+
if ((_overviewConfig = overviewConfig) !== null && _overviewConfig !== void 0 && _overviewConfig[type]) {
|
128
128
|
oldCols = JSON.parse(overviewConfig[type]) || []; // 已设置
|
129
129
|
|
130
130
|
oldCols.forEach(function (old_item) {
|
@@ -174,7 +174,7 @@ function Configurator(props) {
|
|
174
174
|
setOrgColumns(newCols);
|
175
175
|
onChange(newCols);
|
176
176
|
|
177
|
-
case
|
177
|
+
case 12:
|
178
178
|
case "end":
|
179
179
|
return _context3.stop();
|
180
180
|
}
|
@@ -251,7 +251,7 @@ function Configurator(props) {
|
|
251
251
|
|
252
252
|
var onOk = /*#__PURE__*/function () {
|
253
253
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
254
|
-
var
|
254
|
+
var _ref3;
|
255
255
|
|
256
256
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
257
257
|
while (1) {
|
@@ -266,7 +266,7 @@ function Configurator(props) {
|
|
266
266
|
}
|
267
267
|
|
268
268
|
_context2.next = 5;
|
269
|
-
return _overview["default"].saveOverviewConfig(topoId, templateCode, (
|
269
|
+
return (saveOverviewConfig || _overview["default"].saveOverviewConfig)(topoId, templateCode, (_ref3 = {}, _ref3[type] = JSON.stringify(columnsState), _ref3));
|
270
270
|
|
271
271
|
case 5:
|
272
272
|
case "end":
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "7.0.0-dev.
|
3
|
+
"version": "7.0.0-dev.17",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.17/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|