@riil-frontend/component-topology 2.15.18 → 2.15.21
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 +3 -3
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +4 -1
- package/es/core/components/TopoView/topoView.js +2 -3
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
- package/es/core/models/TopoApp.js +8 -14
- package/es/core/models/topoFactory.js +25 -0
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +3 -2
- package/es/core/viewer/components/plugins/BaseInfo/index.js +71 -17
- package/es/hooks/useTopoEdit.js +16 -5
- package/es/topoCenter/components/Topology.js +4 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +4 -1
- package/lib/core/components/TopoView/topoView.js +2 -3
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
- package/lib/core/models/TopoApp.js +8 -13
- package/lib/core/models/topoFactory.js +30 -0
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +3 -2
- package/lib/core/viewer/components/plugins/BaseInfo/index.js +71 -17
- package/lib/hooks/useTopoEdit.js +16 -5
- package/lib/topoCenter/components/Topology.js +4 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
- package/package.json +2 -2
|
@@ -23,7 +23,10 @@ function ResourceSelectList(props, ref) {
|
|
|
23
23
|
limitTypes: limitTypes || RESOURCE_LIMIT_TYPES,
|
|
24
24
|
defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
|
|
25
25
|
request: getRequest(),
|
|
26
|
-
tableProps: tableProps
|
|
26
|
+
tableProps: tableProps,
|
|
27
|
+
paginationProps: {
|
|
28
|
+
type: 'simple'
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -122,6 +122,7 @@ var TopoView = function TopoView(props) {
|
|
|
122
122
|
useEffect(function () {
|
|
123
123
|
return function () {
|
|
124
124
|
topoDispatchers.reset();
|
|
125
|
+
clearSelection();
|
|
125
126
|
};
|
|
126
127
|
}, []);
|
|
127
128
|
var onGraphCreated = useCallback(function (topoClient) {
|
|
@@ -240,9 +241,7 @@ var TopoView = function TopoView(props) {
|
|
|
240
241
|
className: classnames(styles.viewPanel, (_classnames = {}, _classnames[styles.viewPanelEditMode] = isEditMode, _classnames))
|
|
241
242
|
}, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
|
|
242
243
|
createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
|
|
243
|
-
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {}
|
|
244
|
-
useNewElementsDeleteEvent: true
|
|
245
|
-
})
|
|
244
|
+
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
246
245
|
}),
|
|
247
246
|
data: tData,
|
|
248
247
|
defaultEnterEditMode: defaultEnterEditMode,
|
|
@@ -28,9 +28,7 @@ export default function CommonEdgePropertyView(props) {
|
|
|
28
28
|
onChange: function onChange(name, value) {
|
|
29
29
|
var newValues = field.getValues();
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
_onChange(name, value, newValues);
|
|
33
|
-
}
|
|
31
|
+
_onChange(name, value, newValues);
|
|
34
32
|
}
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -22,9 +22,7 @@ export default function EdgeGroupSetting(props) {
|
|
|
22
22
|
onChange: function onChange(name, value) {
|
|
23
23
|
var newValues = field.getValues();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
_onChange(name, value, newValues);
|
|
27
|
-
}
|
|
25
|
+
_onChange(name, value, newValues);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
|
|
@@ -30,9 +30,7 @@ export default function GroupSetting(props) {
|
|
|
30
30
|
|
|
31
31
|
var newValues = field.getValues();
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
_onChange(name, value, newValues);
|
|
35
|
-
}
|
|
33
|
+
_onChange(name, value, newValues);
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
|
|
@@ -92,7 +90,8 @@ export default function GroupSetting(props) {
|
|
|
92
90
|
}
|
|
93
91
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
94
92
|
name: "attrObject.name",
|
|
95
|
-
maxLength: 30
|
|
93
|
+
maxLength: 30,
|
|
94
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
96
95
|
})), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
|
|
97
96
|
group: group,
|
|
98
97
|
expanded: expanded,
|
|
@@ -23,11 +23,10 @@ export default function LayerSettingTab(props) {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
console.error(values[name], value);
|
|
26
27
|
var newValues = field.getValues();
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
_onChange(name, value, newValues);
|
|
30
|
-
}
|
|
29
|
+
_onChange(name, value, newValues);
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -56,7 +55,8 @@ export default function LayerSettingTab(props) {
|
|
|
56
55
|
}
|
|
57
56
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
58
57
|
name: "styleMap.label",
|
|
59
|
-
maxLength: 30
|
|
58
|
+
maxLength: 30,
|
|
59
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
60
60
|
})), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
61
61
|
defaultExpandedKeys: ['图片', '对齐方式', '线形'],
|
|
62
62
|
style: {
|
|
@@ -27,9 +27,7 @@ export default function MultipleElementPropertyView(props) {
|
|
|
27
27
|
onChange: function onChange(name, value) {
|
|
28
28
|
var newValues = field.getValues();
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
_onChange(name, value, newValues);
|
|
32
|
-
}
|
|
30
|
+
_onChange(name, value, newValues);
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
|
|
@@ -57,9 +57,7 @@ export default function NodePropertyView(props) {
|
|
|
57
57
|
onChange: function onChange(name, value) {
|
|
58
58
|
var newValues = field.getValues();
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
_onChange(name, value, newValues);
|
|
62
|
-
}
|
|
60
|
+
_onChange(name, value, newValues);
|
|
63
61
|
}
|
|
64
62
|
});
|
|
65
63
|
|
|
@@ -19,6 +19,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
19
19
|
|
|
20
20
|
var handleSave = /*#__PURE__*/function () {
|
|
21
21
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
|
22
|
+
var result;
|
|
22
23
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
23
24
|
while (1) {
|
|
24
25
|
switch (_context.prev = _context.next) {
|
|
@@ -41,6 +42,10 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
case 5:
|
|
45
|
+
result = _context.sent;
|
|
46
|
+
return _context.abrupt("return", result);
|
|
47
|
+
|
|
48
|
+
case 7:
|
|
44
49
|
case "end":
|
|
45
50
|
return _context.stop();
|
|
46
51
|
}
|
|
@@ -46,15 +46,13 @@ export default function TextPropertyView(props) {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
49
|
+
if (name === 'styleMap.text' && !value) {
|
|
50
|
+
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_onChange(name, value, newValues);
|
|
52
|
+
return;
|
|
57
53
|
}
|
|
54
|
+
|
|
55
|
+
_onChange(name, value, newValues);
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
58
|
|
|
@@ -17,15 +17,11 @@ import AttributeMetricDisplay from "./AttributeMetricDisplay";
|
|
|
17
17
|
import DataModel from "./DataModel";
|
|
18
18
|
import GraphDataModel from "./GraphDataModel";
|
|
19
19
|
import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
20
|
-
import PluginManager from "./PluginManager";
|
|
20
|
+
import PluginManager from "./PluginManager";
|
|
21
|
+
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
21
22
|
|
|
22
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.21" === 'string' ? "2.15.21" : null;
|
|
23
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
24
|
-
var topoDebug = {};
|
|
25
|
-
window.topoDebug = topoDebug;
|
|
26
|
-
var htTopo = {};
|
|
27
|
-
window.htTopo = htTopo;
|
|
28
|
-
var n = 0;
|
|
29
25
|
/**
|
|
30
26
|
* 拓扑显示和编辑
|
|
31
27
|
*/
|
|
@@ -35,7 +31,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
35
31
|
* @type TopoGraphView
|
|
36
32
|
*/
|
|
37
33
|
function Topo(options) {
|
|
38
|
-
this.version = version;
|
|
39
34
|
this.options = void 0;
|
|
40
35
|
this.id = void 0;
|
|
41
36
|
this.view = void 0;
|
|
@@ -46,6 +41,8 @@ var Topo = /*#__PURE__*/function () {
|
|
|
46
41
|
this.ciTyeCache = CiTyeCache;
|
|
47
42
|
this.dictCache = DictCache;
|
|
48
43
|
this.test = void 0;
|
|
44
|
+
this.uid = void 0;
|
|
45
|
+
this.version = version;
|
|
49
46
|
this.options = _extends({
|
|
50
47
|
enableDefaultAlarmLoader: true,
|
|
51
48
|
enableDefaultMetricLoader: true,
|
|
@@ -58,9 +55,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
this.initialize(options);
|
|
61
|
-
this.debugId = options.name || "t" + n++;
|
|
62
|
-
topoDebug[this.debugId] = this;
|
|
63
|
-
htTopo[this.debugId] = this.getHtTopo.bind(this);
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
var _proto = Topo.prototype;
|
|
@@ -80,6 +74,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
80
74
|
this.alarm.init(this); // 指标
|
|
81
75
|
|
|
82
76
|
this.test = new Test(this);
|
|
77
|
+
this.uid = topoFactory.add(options.name, this);
|
|
83
78
|
}
|
|
84
79
|
/**
|
|
85
80
|
* TODO 移除
|
|
@@ -100,10 +95,9 @@ var Topo = /*#__PURE__*/function () {
|
|
|
100
95
|
return topoDispatchers.exit();
|
|
101
96
|
|
|
102
97
|
case 3:
|
|
103
|
-
|
|
104
|
-
delete htTopo[this.debugId];
|
|
98
|
+
topoFactory.remove(this.uid);
|
|
105
99
|
|
|
106
|
-
case
|
|
100
|
+
case 4:
|
|
107
101
|
case "end":
|
|
108
102
|
return _context.stop();
|
|
109
103
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var n = 0;
|
|
2
|
+
|
|
3
|
+
var TopoFactory = /*#__PURE__*/function () {
|
|
4
|
+
function TopoFactory() {
|
|
5
|
+
this.map = {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
var _proto = TopoFactory.prototype;
|
|
9
|
+
|
|
10
|
+
_proto.add = function add(name, topo) {
|
|
11
|
+
var uid = name || "" + n++;
|
|
12
|
+
this.map[uid] = topo;
|
|
13
|
+
return uid;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
_proto.remove = function remove(name) {
|
|
17
|
+
delete this.map[name];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return TopoFactory;
|
|
21
|
+
}();
|
|
22
|
+
|
|
23
|
+
var topoFactory = new TopoFactory();
|
|
24
|
+
window.topoFactory = topoFactory;
|
|
25
|
+
export default topoFactory;
|
|
@@ -20,12 +20,13 @@ import { queryCisByIds } from "../../../../../../services";
|
|
|
20
20
|
import styles from "./index.module.scss"; // 基本信息
|
|
21
21
|
|
|
22
22
|
function BaseInfoRender(type, data) {
|
|
23
|
+
var _itemCols$type;
|
|
24
|
+
|
|
23
25
|
var itemCols = {
|
|
24
26
|
node: [{
|
|
25
27
|
label: '资源名称:',
|
|
26
28
|
objKey: 'resource',
|
|
27
29
|
render: function render(valueData, key) {
|
|
28
|
-
console.log('资源名称:', valueData, key);
|
|
29
30
|
var display_name = valueData.display_name,
|
|
30
31
|
link = valueData.link;
|
|
31
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -80,7 +81,7 @@ function BaseInfoRender(type, data) {
|
|
|
80
81
|
};
|
|
81
82
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
83
|
className: styles['base-info']
|
|
83
|
-
}, itemCols[type].map(function (_ref, key) {
|
|
84
|
+
}, (_itemCols$type = itemCols[type]) === null || _itemCols$type === void 0 ? void 0 : _itemCols$type.map(function (_ref, key) {
|
|
84
85
|
var label = _ref.label,
|
|
85
86
|
objKey = _ref.objKey,
|
|
86
87
|
style = _ref.style,
|
|
@@ -100,8 +100,11 @@ function BaseInfo(props) {
|
|
|
100
100
|
userId = _useState4[0],
|
|
101
101
|
setUserId = _useState4[1];
|
|
102
102
|
|
|
103
|
+
var _useState5 = useState(null),
|
|
104
|
+
paramData = _useState5[0],
|
|
105
|
+
setParamData = _useState5[1];
|
|
106
|
+
|
|
103
107
|
useEffect(function () {
|
|
104
|
-
getUser();
|
|
105
108
|
var notifier = topo.view.topoClient.notifier;
|
|
106
109
|
notifier.on(TopoEvent.EVENT_DOUBLE_CLICK, openOverview);
|
|
107
110
|
notifier.on('topo_element_click', changeOverview);
|
|
@@ -117,12 +120,51 @@ function BaseInfo(props) {
|
|
|
117
120
|
}, []); // 解决切换拓扑图隐藏概览
|
|
118
121
|
|
|
119
122
|
useEffect(function () {
|
|
120
|
-
setVisible(false);
|
|
123
|
+
setVisible(false);
|
|
124
|
+
setParamData(null); // TODO 其他数据重置
|
|
121
125
|
}, [topoId]);
|
|
122
126
|
|
|
123
127
|
function getUser() {
|
|
124
128
|
return _getUser.apply(this, arguments);
|
|
125
|
-
}
|
|
129
|
+
} // function changeOverview (node) {
|
|
130
|
+
// const data = node.getAttrObject()
|
|
131
|
+
// console.log('单击切换基本信息', data);
|
|
132
|
+
// setVisible(prev => {
|
|
133
|
+
// prev && openOverview(data)
|
|
134
|
+
// return prev
|
|
135
|
+
// })
|
|
136
|
+
// }
|
|
137
|
+
// function openOverview (data) {
|
|
138
|
+
// console.log('双击打开基本信息', data);
|
|
139
|
+
// const {
|
|
140
|
+
// id,
|
|
141
|
+
// name,
|
|
142
|
+
// type,
|
|
143
|
+
// ciType,
|
|
144
|
+
// ciName,
|
|
145
|
+
// operation,
|
|
146
|
+
// } = data
|
|
147
|
+
// // 仅展示资源和链路的概览
|
|
148
|
+
// if (!['node', 'link', 'linkGroup'].includes(type)) return
|
|
149
|
+
// // 应用拓扑中没有链路详情
|
|
150
|
+
// if (topo.options.resourceOverviewDrawer?.getData && type === 'link') return
|
|
151
|
+
// // 没有权限不显示
|
|
152
|
+
// if (!operation) return
|
|
153
|
+
// setActiveData({
|
|
154
|
+
// id,
|
|
155
|
+
// name,
|
|
156
|
+
// type: type === 'linkGroup' ? 'link' : type,
|
|
157
|
+
// ciType,
|
|
158
|
+
// ciName
|
|
159
|
+
// })
|
|
160
|
+
// const { metrics } = topo.ciTyeCache.getCiType(ciType)
|
|
161
|
+
// topoDispatchers.update({
|
|
162
|
+
// id,
|
|
163
|
+
// metricCodes: metrics.slice(0, 6).map(item => item.code), // 需要展示的关键指标 code
|
|
164
|
+
// })
|
|
165
|
+
// setVisible(true)
|
|
166
|
+
// }
|
|
167
|
+
|
|
126
168
|
|
|
127
169
|
function _getUser() {
|
|
128
170
|
_getUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -148,25 +190,41 @@ function BaseInfo(props) {
|
|
|
148
190
|
return _getUser.apply(this, arguments);
|
|
149
191
|
}
|
|
150
192
|
|
|
193
|
+
function onChangeActive(activeNode) {
|
|
194
|
+
console.log('切换基本信息资源', activeNode);
|
|
195
|
+
activeNode && openOverview(_extends({}, activeNode, {
|
|
196
|
+
type: 'node'
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
useEffect(function () {
|
|
201
|
+
(visible || (paramData === null || paramData === void 0 ? void 0 : paramData.isVisible)) && paramData && init(paramData);
|
|
202
|
+
}, [paramData, visible]);
|
|
203
|
+
|
|
151
204
|
function changeOverview(node) {
|
|
152
205
|
var data = node.getAttrObject();
|
|
153
206
|
console.log('单击切换基本信息', data);
|
|
154
|
-
|
|
155
|
-
prev && openOverview(data);
|
|
156
|
-
return prev;
|
|
157
|
-
});
|
|
207
|
+
setParamData(data);
|
|
158
208
|
}
|
|
159
209
|
|
|
160
210
|
function openOverview(data) {
|
|
211
|
+
console.log('双击打开基本信息', data);
|
|
212
|
+
setParamData(_extends({}, data, {
|
|
213
|
+
isVisible: true
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function init(data) {
|
|
161
218
|
var _topo$options$resourc;
|
|
162
219
|
|
|
163
|
-
console.log('
|
|
220
|
+
console.log('初始化基本信息', data);
|
|
164
221
|
var id = data.id,
|
|
165
222
|
name = data.name,
|
|
166
223
|
type = data.type,
|
|
167
224
|
ciType = data.ciType,
|
|
168
225
|
ciName = data.ciName,
|
|
169
|
-
operation = data.operation
|
|
226
|
+
operation = data.operation,
|
|
227
|
+
isVisible = data.isVisible; // 仅展示资源和链路的概览
|
|
170
228
|
|
|
171
229
|
if (!['node', 'link', 'linkGroup'].includes(type)) return; // 应用拓扑中没有链路详情
|
|
172
230
|
|
|
@@ -190,15 +248,11 @@ function BaseInfo(props) {
|
|
|
190
248
|
return item.code;
|
|
191
249
|
}) // 需要展示的关键指标 code
|
|
192
250
|
|
|
193
|
-
});
|
|
194
|
-
setVisible(true);
|
|
195
|
-
}
|
|
251
|
+
}); // 显示隐藏
|
|
196
252
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
type: 'node'
|
|
201
|
-
}));
|
|
253
|
+
isVisible && setVisible(true); // userId
|
|
254
|
+
|
|
255
|
+
userId || getUser();
|
|
202
256
|
}
|
|
203
257
|
|
|
204
258
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Drawer, {
|
package/es/hooks/useTopoEdit.js
CHANGED
|
@@ -818,7 +818,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
818
818
|
|
|
819
819
|
var bindNodeResource = /*#__PURE__*/function () {
|
|
820
820
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
|
|
821
|
-
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements,
|
|
821
|
+
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedDatas, replaceOrAddRes;
|
|
822
822
|
|
|
823
823
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
824
824
|
while (1) {
|
|
@@ -845,7 +845,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
845
845
|
|
|
846
846
|
groupTag = groupElement.a('tag'); // 容器临时id
|
|
847
847
|
|
|
848
|
-
config.groups = groups.map(function (g) {
|
|
848
|
+
config.groups = config.groups.map(function (g) {
|
|
849
849
|
// 匹配到容器,替换资源或增加
|
|
850
850
|
if (g.id === groupId || g.tag === groupTag) {
|
|
851
851
|
return _extends({}, g, {
|
|
@@ -872,15 +872,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
872
872
|
_yield$editDispatcher = _context7.sent;
|
|
873
873
|
elements = _yield$editDispatcher.topoDataTrans;
|
|
874
874
|
// 过滤出关联的节点和连线,通知ht更新
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
nodeRelatedDatas = filterElementsByNodeId(elements, newResId);
|
|
876
|
+
|
|
877
|
+
if (nodeRelatedDatas.length) {
|
|
878
|
+
_context7.next = 17;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
_Message.error('关联资源失败');
|
|
883
|
+
|
|
884
|
+
return _context7.abrupt("return", false);
|
|
885
|
+
|
|
886
|
+
case 17:
|
|
887
|
+
saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedDatas);
|
|
877
888
|
node.a('customName', null); // 临时放这里,仅拓扑中心有
|
|
878
889
|
|
|
879
890
|
if (topo.linkDynamicStyleExecutor) {
|
|
880
891
|
topo.linkDynamicStyleExecutor.execute();
|
|
881
892
|
}
|
|
882
893
|
|
|
883
|
-
case
|
|
894
|
+
case 20:
|
|
884
895
|
case "end":
|
|
885
896
|
return _context7.stop();
|
|
886
897
|
}
|
|
@@ -43,7 +43,10 @@ export default function NetworkTopologyFull(props) {
|
|
|
43
43
|
graphViewProps: _extends({}, props.graphViewProps, {
|
|
44
44
|
onElementsDelete: topoEdit.onElementsDelete,
|
|
45
45
|
createHtTopoProps: {
|
|
46
|
-
elementChangeLayerByDrag: true
|
|
46
|
+
elementChangeLayerByDrag: true,
|
|
47
|
+
editor: {
|
|
48
|
+
useNewElementsDeleteEvent: true
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
})
|
|
49
52
|
}));
|
package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js
CHANGED
|
@@ -22,9 +22,7 @@ export default function LinkSetting(props) {
|
|
|
22
22
|
onChange: function onChange(name, value) {
|
|
23
23
|
var newValues = field.getValues();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
_onChange(name, value, newValues);
|
|
27
|
-
}
|
|
25
|
+
_onChange(name, value, newValues);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
|
|
@@ -37,7 +37,10 @@ function ResourceSelectList(props, ref) {
|
|
|
37
37
|
limitTypes: limitTypes || _ResourceTypeLimit.RESOURCE_LIMIT_TYPES,
|
|
38
38
|
defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
|
|
39
39
|
request: (0, _componentTopologyCommon.getRequest)(),
|
|
40
|
-
tableProps: tableProps
|
|
40
|
+
tableProps: tableProps,
|
|
41
|
+
paginationProps: {
|
|
42
|
+
type: 'simple'
|
|
43
|
+
}
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
|
|
@@ -151,6 +151,7 @@ var TopoView = function TopoView(props) {
|
|
|
151
151
|
(0, _react.useEffect)(function () {
|
|
152
152
|
return function () {
|
|
153
153
|
topoDispatchers.reset();
|
|
154
|
+
clearSelection();
|
|
154
155
|
};
|
|
155
156
|
}, []);
|
|
156
157
|
var onGraphCreated = (0, _react.useCallback)(function (topoClient) {
|
|
@@ -276,9 +277,7 @@ var TopoView = function TopoView(props) {
|
|
|
276
277
|
className: (0, _classnames2["default"])(_TopoViewModule["default"].viewPanel, (_classnames = {}, _classnames[_TopoViewModule["default"].viewPanelEditMode] = isEditMode, _classnames))
|
|
277
278
|
}, /*#__PURE__*/_react["default"].createElement(_componentTopologyGraph["default"], (0, _extends2["default"])({}, graphViewProps, {
|
|
278
279
|
createHtTopoProps: (0, _extends2["default"])({}, graphViewProps.createHtTopoProps, {
|
|
279
|
-
editor: (0, _extends2["default"])({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {}
|
|
280
|
-
useNewElementsDeleteEvent: true
|
|
281
|
-
})
|
|
280
|
+
editor: (0, _extends2["default"])({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
282
281
|
}),
|
|
283
282
|
data: tData,
|
|
284
283
|
defaultEnterEditMode: defaultEnterEditMode,
|
|
@@ -47,9 +47,7 @@ function CommonEdgePropertyView(props) {
|
|
|
47
47
|
onChange: function onChange(name, value) {
|
|
48
48
|
var newValues = field.getValues();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
_onChange(name, value, newValues);
|
|
52
|
-
}
|
|
50
|
+
_onChange(name, value, newValues);
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -53,9 +53,7 @@ function GroupSetting(props) {
|
|
|
53
53
|
|
|
54
54
|
var newValues = field.getValues();
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
_onChange(name, value, newValues);
|
|
58
|
-
}
|
|
56
|
+
_onChange(name, value, newValues);
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
|
|
@@ -115,7 +113,8 @@ function GroupSetting(props) {
|
|
|
115
113
|
}
|
|
116
114
|
}), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
117
115
|
name: "attrObject.name",
|
|
118
|
-
maxLength: 30
|
|
116
|
+
maxLength: 30,
|
|
117
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
119
118
|
})), expanded ? /*#__PURE__*/_react["default"].createElement(_GroupExpandSetting["default"], {
|
|
120
119
|
group: group,
|
|
121
120
|
expanded: expanded,
|
|
@@ -43,11 +43,10 @@ function LayerSettingTab(props) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
console.error(values[name], value);
|
|
46
47
|
var newValues = field.getValues();
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
_onChange(name, value, newValues);
|
|
50
|
-
}
|
|
49
|
+
_onChange(name, value, newValues);
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
52
|
|
|
@@ -76,7 +75,8 @@ function LayerSettingTab(props) {
|
|
|
76
75
|
}
|
|
77
76
|
}), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
78
77
|
name: "styleMap.label",
|
|
79
|
-
maxLength: 30
|
|
78
|
+
maxLength: 30,
|
|
79
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
80
80
|
})), /*#__PURE__*/_react["default"].createElement(_form["default"].Item, null, /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
|
81
81
|
defaultExpandedKeys: ['图片', '对齐方式', '线形'],
|
|
82
82
|
style: {
|
|
@@ -47,9 +47,7 @@ function MultipleElementPropertyView(props) {
|
|
|
47
47
|
onChange: function onChange(name, value) {
|
|
48
48
|
var newValues = field.getValues();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
_onChange(name, value, newValues);
|
|
52
|
-
}
|
|
50
|
+
_onChange(name, value, newValues);
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -34,6 +34,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
34
34
|
|
|
35
35
|
var handleSave = /*#__PURE__*/function () {
|
|
36
36
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
|
37
|
+
var result;
|
|
37
38
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
38
39
|
while (1) {
|
|
39
40
|
switch (_context.prev = _context.next) {
|
|
@@ -56,6 +57,10 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
case 5:
|
|
60
|
+
result = _context.sent;
|
|
61
|
+
return _context.abrupt("return", result);
|
|
62
|
+
|
|
63
|
+
case 7:
|
|
59
64
|
case "end":
|
|
60
65
|
return _context.stop();
|
|
61
66
|
}
|