@riil-frontend/component-topology 11.0.27 → 11.0.29
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/README.md +2 -1
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/components/BatchAttrMetric/index.js +9 -19
- package/es/components/BatchAttrMetric/setting.js +64 -30
- package/es/components/BatchAttrMetric/utils.js +14 -199
- package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +6 -7
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +30 -58
- package/es/core/components/TopoView/topoView.js +0 -1
- package/es/core/components/titlebar/TitleBar.module.scss +0 -9
- package/es/core/components/titlebar/widgets/TitleWidget.js +2 -5
- package/es/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
- package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -5
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
- package/es/core/hooks/usePolling.js +8 -8
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +2 -2
- package/es/core/store/models/topoConfig.js +3 -4
- package/es/core/test/Test.js +4 -5
- package/es/utils/topoData.js +0 -142
- package/lib/components/BatchAttrMetric/index.js +9 -19
- package/lib/components/BatchAttrMetric/setting.js +58 -24
- package/lib/components/BatchAttrMetric/utils.js +16 -206
- package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +5 -6
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +28 -56
- package/lib/core/components/TopoView/topoView.js +0 -1
- package/lib/core/components/titlebar/TitleBar.module.scss +0 -9
- package/lib/core/components/titlebar/widgets/TitleWidget.js +2 -7
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +3 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
- package/lib/core/hooks/usePolling.js +8 -8
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +2 -2
- package/lib/core/store/models/topoConfig.js +3 -6
- package/lib/core/test/Test.js +4 -5
- package/lib/utils/topoData.js +0 -145
- package/package.json +2 -2
- package/es/components/BatchAttrMetric2/SelectTable.js +0 -21
- package/es/components/BatchAttrMetric2/constant.js +0 -30
- package/es/components/BatchAttrMetric2/index.js +0 -68
- package/es/components/BatchAttrMetric2/index.module.scss +0 -76
- package/es/components/BatchAttrMetric2/setting.js +0 -181
- package/es/components/BatchAttrMetric2/utils.js +0 -42
- package/es/components/IndexSettingDrawer/CiList.js +0 -26
- package/es/components/IndexSettingDrawer/CiListItem.js +0 -37
- package/es/components/IndexSettingDrawer/IndexList.js +0 -62
- package/es/components/IndexSettingDrawer/index.js +0 -60
- package/es/components/IndexSettingDrawer/index.module.scss +0 -44
- package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -5
- package/es/core/components/TopoApp.js +0 -7
- package/es/core/components/TopoAppView.js +0 -24
- package/es/core/editor/components/Toolbar/widgets/Dropdown.js +0 -12
- package/es/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -28
- package/es/networkTopo/components/Link/index copy.js +0 -213
- package/es/networkTopo/store/linkDynamicStyle.js +0 -259
- package/es/networkTopo/store/linkDynamicStyleConfig.js +0 -180
- package/es/networkTopo/store/linkManager.js +0 -38
- package/lib/components/BatchAttrMetric2/SelectTable.js +0 -26
- package/lib/components/BatchAttrMetric2/constant.js +0 -36
- package/lib/components/BatchAttrMetric2/index.js +0 -75
- package/lib/components/BatchAttrMetric2/index.module.scss +0 -76
- package/lib/components/BatchAttrMetric2/setting.js +0 -189
- package/lib/components/BatchAttrMetric2/utils.js +0 -48
- package/lib/components/IndexSettingDrawer/CiList.js +0 -32
- package/lib/components/IndexSettingDrawer/CiListItem.js +0 -43
- package/lib/components/IndexSettingDrawer/IndexList.js +0 -70
- package/lib/components/IndexSettingDrawer/index.js +0 -68
- package/lib/components/IndexSettingDrawer/index.module.scss +0 -44
- package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -11
- package/lib/core/components/TopoApp.js +0 -13
- package/lib/core/components/TopoAppView.js +0 -32
- package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +0 -18
- package/lib/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -34
- package/lib/networkTopo/components/Link/index copy.js +0 -220
- package/lib/networkTopo/store/linkDynamicStyle.js +0 -263
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +0 -186
- package/lib/networkTopo/store/linkManager.js +0 -42
package/lib/utils/topoData.js
CHANGED
|
@@ -13,7 +13,6 @@ exports.getCiTypesFromCiElements = getCiTypesFromCiElements;
|
|
|
13
13
|
exports.getLinksBetweenTwoNodes = getLinksBetweenTwoNodes;
|
|
14
14
|
exports.parseTopoData = parseTopoData;
|
|
15
15
|
exports.transtormElementsToMap = transtormElementsToMap;
|
|
16
|
-
exports.updateCiDoc = exports.updateAllCiDoc = void 0;
|
|
17
16
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
18
17
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
19
18
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
@@ -357,156 +356,12 @@ function getLinksBetweenTwoNodes(links, id1, id2) {
|
|
|
357
356
|
});
|
|
358
357
|
}
|
|
359
358
|
|
|
360
|
-
// 批量更新指标状态
|
|
361
|
-
var updateAllCiDoc = function updateAllCiDoc(dataType, doc, ciDoc, allCiSet) {
|
|
362
|
-
_rlog["default"].debug("updateAllCiDoc", dataType, doc, ciDoc);
|
|
363
|
-
var cidoc = _lodash["default"].cloneDeep(ciDoc);
|
|
364
|
-
var allciset = _lodash["default"].cloneDeep(allCiSet);
|
|
365
|
-
var ciArr = Object.keys(cidoc);
|
|
366
|
-
ciArr.map(function (key) {
|
|
367
|
-
_rlog["default"].debug("Object.keys", allciset, cidoc, key);
|
|
368
|
-
var arr = [];
|
|
369
|
-
var list = cidoc[key].list.map(function (d) {
|
|
370
|
-
var ciType = cidoc[key].code;
|
|
371
|
-
|
|
372
|
-
// rlog.debug('Object.keys---list-item', cidoc[key], ciType, d);
|
|
373
|
-
var item = findItem(doc[ciType], "code", d.code);
|
|
374
|
-
// rlog.debug('Object.keys---list-findItem', doc[ciType], item);
|
|
375
|
-
var r = (0, _extends2["default"])({}, d);
|
|
376
|
-
var name = cidoc[key].name;
|
|
377
|
-
// rlog.debug('Object.keys---r', r);
|
|
378
|
-
if (item) {
|
|
379
|
-
r[dataType] = true;
|
|
380
|
-
var num = 0;
|
|
381
|
-
var nameArr = [];
|
|
382
|
-
ciArr.map(function (ci) {
|
|
383
|
-
var ciItem = cidoc[ci];
|
|
384
|
-
if (ciItem.code === ciType) {
|
|
385
|
-
num += 1;
|
|
386
|
-
nameArr.push(ciItem.name);
|
|
387
|
-
}
|
|
388
|
-
return "";
|
|
389
|
-
});
|
|
390
|
-
_rlog["default"].debug("Object.keys---nameArr", num, nameArr);
|
|
391
|
-
if (dataType === "tip") {
|
|
392
|
-
r.ciTipNum = num;
|
|
393
|
-
r.ciTipArr = nameArr;
|
|
394
|
-
} else if (dataType === "tag") {
|
|
395
|
-
r.ciTagNum = num;
|
|
396
|
-
r.ciTagArr = nameArr;
|
|
397
|
-
}
|
|
398
|
-
arr.push(item);
|
|
399
|
-
} else {
|
|
400
|
-
r[dataType] = false;
|
|
401
|
-
if (dataType === "tip") {
|
|
402
|
-
r.ciTipNum = 0;
|
|
403
|
-
r.ciTipArr = [];
|
|
404
|
-
} else if (dataType === "tag") {
|
|
405
|
-
r.ciTagNum = 0;
|
|
406
|
-
r.ciTagArr = [];
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
return r;
|
|
410
|
-
});
|
|
411
|
-
var uniqArr = _lodash["default"].uniqWith(arr, _lodash["default"].isEqual);
|
|
412
|
-
_rlog["default"].debug("Object.keys---list-result-arr,list", arr, uniqArr, list);
|
|
413
|
-
allciset[cidoc[key].code].list = list;
|
|
414
|
-
cidoc[key][dataType] = uniqArr;
|
|
415
|
-
cidoc[key].list = list;
|
|
416
|
-
return "";
|
|
417
|
-
});
|
|
418
|
-
_rlog["default"].debug("updateAllCiDoc-result", cidoc);
|
|
419
|
-
return {
|
|
420
|
-
cidoc: cidoc,
|
|
421
|
-
allciset: allciset
|
|
422
|
-
};
|
|
423
|
-
};
|
|
424
|
-
// 更新指标状态
|
|
425
|
-
exports.updateAllCiDoc = updateAllCiDoc;
|
|
426
|
-
var updateCiDoc = function updateCiDoc(dataType, doc, ciDoc, allCiSet) {
|
|
427
|
-
_rlog["default"].debug("updateCiDoc", dataType, doc, ciDoc, allCiSet);
|
|
428
|
-
var dt = {
|
|
429
|
-
attribute: "attributes",
|
|
430
|
-
metric: "metrics"
|
|
431
|
-
};
|
|
432
|
-
var cidoc = _lodash["default"].cloneDeep(ciDoc);
|
|
433
|
-
var allciset = _lodash["default"].cloneDeep(allCiSet);
|
|
434
|
-
Object.keys(doc).map(function (key) {
|
|
435
|
-
var arr = doc[key].map(function (item) {
|
|
436
|
-
return item;
|
|
437
|
-
});
|
|
438
|
-
var list = cidoc[key].list.map(function (d) {
|
|
439
|
-
var r = (0, _extends2["default"])({}, d);
|
|
440
|
-
var ciname = cidoc[key].name;
|
|
441
|
-
if (findItemIndex(arr, "code", d.code) < 0) {
|
|
442
|
-
r[dataType] = false;
|
|
443
|
-
if (dataType === "tip") {
|
|
444
|
-
r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
|
|
445
|
-
r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
|
|
446
|
-
} else if (dataType === "tag") {
|
|
447
|
-
r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
|
|
448
|
-
r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
|
|
449
|
-
}
|
|
450
|
-
} else {
|
|
451
|
-
r[dataType] = true;
|
|
452
|
-
if (dataType === "tip") {
|
|
453
|
-
if (r.ciTipArr.indexOf(ciname) < 0) {
|
|
454
|
-
r.ciTipNum += 1;
|
|
455
|
-
r.ciTipArr.push(ciname);
|
|
456
|
-
}
|
|
457
|
-
} else if (dataType === "tag") {
|
|
458
|
-
if (r.ciTagArr.indexOf(ciname) < 0) {
|
|
459
|
-
r.ciTagNum += 1;
|
|
460
|
-
r.ciTagArr.push(ciname);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return r;
|
|
465
|
-
});
|
|
466
|
-
var list2 = cidoc[key].list.map(function (d) {
|
|
467
|
-
var r = (0, _extends2["default"])({}, d);
|
|
468
|
-
var ciname = cidoc[key].name;
|
|
469
|
-
if (findItemIndex(arr, "code", d.code) < 0) {
|
|
470
|
-
if (dataType === "tip") {
|
|
471
|
-
r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
|
|
472
|
-
r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
|
|
473
|
-
} else if (dataType === "tag") {
|
|
474
|
-
r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
|
|
475
|
-
r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
|
|
476
|
-
}
|
|
477
|
-
} else if (dataType === "tip") {
|
|
478
|
-
if (r.ciTipArr.indexOf(ciname) < 0) {
|
|
479
|
-
r.ciTipNum += 1;
|
|
480
|
-
r.ciTipArr.push(ciname);
|
|
481
|
-
}
|
|
482
|
-
} else if (dataType === "tag") {
|
|
483
|
-
if (r.ciTagArr.indexOf(ciname) < 0) {
|
|
484
|
-
r.ciTagNum += 1;
|
|
485
|
-
r.ciTagArr.push(ciname);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
return r;
|
|
489
|
-
});
|
|
490
|
-
_rlog["default"].debug("updateCiDoc-result-----list", list, list2);
|
|
491
|
-
allciset[cidoc[key].code].list = list2;
|
|
492
|
-
cidoc[key][dataType] = arr;
|
|
493
|
-
cidoc[key].list = list;
|
|
494
|
-
return "";
|
|
495
|
-
});
|
|
496
|
-
// rlog.debug('updateCiDoc-result', cidoc);
|
|
497
|
-
return {
|
|
498
|
-
cidoc: cidoc,
|
|
499
|
-
allciset: allciset
|
|
500
|
-
};
|
|
501
|
-
};
|
|
502
|
-
|
|
503
359
|
/**
|
|
504
360
|
* 将从topo组件返回的数据(global)转化为后端接收的数据
|
|
505
361
|
* 具体格式内容参考
|
|
506
362
|
* https://shimo.im/docs/VKt3HCKHYgJ9kvGP#anchor-g6Hw
|
|
507
363
|
* @param {} conditions
|
|
508
364
|
*/
|
|
509
|
-
exports.updateCiDoc = updateCiDoc;
|
|
510
365
|
var combSaveTopoData = function combSaveTopoData(_ref4) {
|
|
511
366
|
var global = _ref4.global;
|
|
512
367
|
var topoDisplayConfig = global.topoDisplayConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.29",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -118,6 +118,6 @@
|
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
120
|
"license": "MIT",
|
|
121
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.
|
|
121
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.29/build/index.html",
|
|
122
122
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
123
123
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export default function SelectTable(props) {
|
|
3
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
4
|
-
fixedHeader: true,
|
|
5
|
-
hasBorder: false,
|
|
6
|
-
dataSource: tableData,
|
|
7
|
-
emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
|
|
8
|
-
type: "table"
|
|
9
|
-
}),
|
|
10
|
-
rowSelection: {
|
|
11
|
-
selectedRowKeys: selectedRowKeys,
|
|
12
|
-
onChange: onTableSelect,
|
|
13
|
-
getProps: function getProps(_ref) {
|
|
14
|
-
var id = _ref.id;
|
|
15
|
-
return {
|
|
16
|
-
disabled: !selectedRowKeys.includes(id) && selectedRowKeys.length >= limit
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, columnNodes);
|
|
21
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// 选择类型
|
|
2
|
-
export var SELECT_TYPE = {
|
|
3
|
-
single: {
|
|
4
|
-
showTree: false,
|
|
5
|
-
showCiNum: false,
|
|
6
|
-
drawerWidth: "calc(" + 5 + "/24 * 100%)"
|
|
7
|
-
},
|
|
8
|
-
batch: {
|
|
9
|
-
showTree: true,
|
|
10
|
-
showCiNum: true,
|
|
11
|
-
drawerWidth: "calc(" + 10 + "/24 * 100%)"
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
// 数据类型
|
|
15
|
-
export var DATA_TYPE = {
|
|
16
|
-
tag: {
|
|
17
|
-
drawerTitle: '选择图数据',
|
|
18
|
-
maxSelect: 4,
|
|
19
|
-
label: '图',
|
|
20
|
-
poslabel: '拓扑图上',
|
|
21
|
-
message: "\u56FE\u6570\u636E\uFF1A\u9009\u62E9\u7684\u6307\u6807\u548C\u5C5E\u6027\u5C06\u4F1A\u663E\u793A\u5728\u62D3\u6251\u56FE\u4E0A\uFF0C\u6700\u591A\u652F\u6301\u52FE\u9009 4 \u9879\u3002"
|
|
22
|
-
},
|
|
23
|
-
tip: {
|
|
24
|
-
drawerTitle: '选择Tooltips显示数据',
|
|
25
|
-
maxSelect: 10,
|
|
26
|
-
label: 'Tootip',
|
|
27
|
-
poslabel: 'Tooltip中',
|
|
28
|
-
message: "Tootip\u6570\u636E\uFF1A\u9009\u62E9\u7684\u6307\u6807\u548C\u5C5E\u6027\u5C06\u4F1A\u663E\u793A\u5728Tooltip\u4E2D\uFF0C\u6700\u591A\u652F\u6301\u52FE\u9009 10 \u9879\u3002"
|
|
29
|
-
}
|
|
30
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import _Drawer from "@alifd/next/es/drawer";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["saveCb", "showType"],
|
|
5
|
-
_excluded2 = ["drawerTitle", "drawerWidth"];
|
|
6
|
-
import React, { forwardRef, useImperativeHandle, useState } from 'react';
|
|
7
|
-
import { useBoolean } from 'ahooks';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import styles from "./index.module.scss";
|
|
10
|
-
import SettingPage from "./setting";
|
|
11
|
-
import { SELECT_TYPE, DATA_TYPE } from "./constant";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 属性指标配置抽屉
|
|
15
|
-
*/
|
|
16
|
-
var BatchAttrMetricDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
17
|
-
var _saveCb = props.saveCb,
|
|
18
|
-
showType = props.showType,
|
|
19
|
-
settingProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
|
-
var _useBoolean = useBoolean(false),
|
|
21
|
-
visible = _useBoolean[0],
|
|
22
|
-
_useBoolean$ = _useBoolean[1],
|
|
23
|
-
setTrue = _useBoolean$.setTrue,
|
|
24
|
-
setFalse = _useBoolean$.setFalse;
|
|
25
|
-
var selectType = 'batch';
|
|
26
|
-
useImperativeHandle(ref, function () {
|
|
27
|
-
return {
|
|
28
|
-
/**
|
|
29
|
-
* 展开抽屉
|
|
30
|
-
*/
|
|
31
|
-
show: function show(entryConfig) {
|
|
32
|
-
if (entryConfig === void 0) {
|
|
33
|
-
entryConfig = {};
|
|
34
|
-
}
|
|
35
|
-
setTrue();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
var config = _extends({}, SELECT_TYPE[selectType], DATA_TYPE[showType]);
|
|
40
|
-
var drawerTitle = config.drawerTitle,
|
|
41
|
-
drawerWidth = config.drawerWidth,
|
|
42
|
-
pageConfig = _objectWithoutPropertiesLoose(config, _excluded2);
|
|
43
|
-
return /*#__PURE__*/React.createElement(_Drawer, {
|
|
44
|
-
closeMode: ['close', 'esc'],
|
|
45
|
-
visible: visible,
|
|
46
|
-
onClose: setFalse,
|
|
47
|
-
title: drawerTitle,
|
|
48
|
-
className: styles.drawer,
|
|
49
|
-
width: drawerWidth
|
|
50
|
-
}, visible && /*#__PURE__*/React.createElement(SettingPage, _extends({}, pageConfig, settingProps, {
|
|
51
|
-
cancelCb: setFalse,
|
|
52
|
-
saveCb: function saveCb(values) {
|
|
53
|
-
setFalse();
|
|
54
|
-
_saveCb(showType, values);
|
|
55
|
-
}
|
|
56
|
-
})));
|
|
57
|
-
});
|
|
58
|
-
BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawer';
|
|
59
|
-
BatchAttrMetricDrawer.propTypes = {
|
|
60
|
-
// 数据项
|
|
61
|
-
dataSource: PropTypes.array.isRequired,
|
|
62
|
-
// 保存回调
|
|
63
|
-
saveCb: PropTypes.func
|
|
64
|
-
};
|
|
65
|
-
BatchAttrMetricDrawer.defaultProps = {
|
|
66
|
-
saveCb: function saveCb() {}
|
|
67
|
-
};
|
|
68
|
-
export default BatchAttrMetricDrawer;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
@import "@alifd/next/variables";
|
|
2
|
-
|
|
3
|
-
.drawer {
|
|
4
|
-
& > div {
|
|
5
|
-
overflow: hidden !important;
|
|
6
|
-
}
|
|
7
|
-
:global {
|
|
8
|
-
.#{$css-prefix}drawer-body {
|
|
9
|
-
padding: 0;
|
|
10
|
-
height: calc(100% - 45px);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
.layout {
|
|
15
|
-
height: 100%;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
& > div:last-child > button:first-child {
|
|
19
|
-
float: left;
|
|
20
|
-
line-height: 24px;
|
|
21
|
-
}
|
|
22
|
-
:global {
|
|
23
|
-
.riil-footer {
|
|
24
|
-
position: unset;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
.message {
|
|
29
|
-
padding: 16px 24px 0;
|
|
30
|
-
}
|
|
31
|
-
.content {
|
|
32
|
-
padding: 16px 24px 0;
|
|
33
|
-
flex: auto;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
& > div:first-child:not(:last-child) {
|
|
36
|
-
box-shadow: 1px 0px 0px 0px #E4E9EE;
|
|
37
|
-
padding-right: $s-4;
|
|
38
|
-
}
|
|
39
|
-
& > div:last-child:not(:first-child) {
|
|
40
|
-
padding-left: $s-4;
|
|
41
|
-
}
|
|
42
|
-
:global {
|
|
43
|
-
.#{$css-prefix}table-header-node.#{$css-prefix}table-selection {
|
|
44
|
-
.#{$css-prefix}checkbox-wrapper {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
.#{$css-prefix}table-cell-wrapper {
|
|
49
|
-
white-space: unset !important;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
.tree-wrap {
|
|
54
|
-
:global {
|
|
55
|
-
.#{$css-prefix}tree-node-label-wrapper {
|
|
56
|
-
width: 1px;
|
|
57
|
-
.tree-node-label > span {
|
|
58
|
-
display: inline-block;
|
|
59
|
-
width: calc(100% - 24px);
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
text-overflow: ellipsis;
|
|
62
|
-
white-space: nowrap;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
.table-wrap {
|
|
68
|
-
height: calc(100% + 1.5px);
|
|
69
|
-
}
|
|
70
|
-
.tip-content {
|
|
71
|
-
max-height: 250px;
|
|
72
|
-
overflow: auto;
|
|
73
|
-
& > div {
|
|
74
|
-
line-height: 20px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import _Button from "@alifd/next/es/button";
|
|
2
|
-
import _Table from "@alifd/next/es/table";
|
|
3
|
-
import _Search from "@alifd/next/es/search";
|
|
4
|
-
import _Grid from "@alifd/next/es/grid";
|
|
5
|
-
import _Message from "@alifd/next/es/message";
|
|
6
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
7
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
8
|
-
var _excluded = ["value", "defaultSet", "dataSource"];
|
|
9
|
-
import React, { useState, useMemo, useEffect } from 'react';
|
|
10
|
-
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
11
|
-
import ActionTree from '@riil-frontend/component-action-tree';
|
|
12
|
-
import NoDataPage from '@riil-frontend/component-topology-common/es/components/NoDataPage';
|
|
13
|
-
import TableLayout from '@riil-frontend/component-table-layout';
|
|
14
|
-
import RiilHooks from '@riil-frontend/hooks';
|
|
15
|
-
import * as utils from "./utils";
|
|
16
|
-
import styles from "./index.module.scss";
|
|
17
|
-
import { loopTreeNode } from "../../utils/treeUtil";
|
|
18
|
-
var Setting = function Setting(_ref) {
|
|
19
|
-
var _ref$value = _ref.value,
|
|
20
|
-
value = _ref$value === void 0 ? {} : _ref$value,
|
|
21
|
-
defaultSet = _ref.defaultSet,
|
|
22
|
-
dataSource = _ref.dataSource,
|
|
23
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
24
|
-
var limit = props.limit,
|
|
25
|
-
saveCb = props.saveCb;
|
|
26
|
-
var allCiSet = useMemo(function () {
|
|
27
|
-
var map = {};
|
|
28
|
-
loopTreeNode(dataSource, function (item) {
|
|
29
|
-
if (item.type !== 'folder') {
|
|
30
|
-
map[item.id] = item;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return map;
|
|
34
|
-
}, [dataSource]);
|
|
35
|
-
var _useState = useState(utils.getDefaultSelectedCiType(dataSource)),
|
|
36
|
-
ciType = _useState[0],
|
|
37
|
-
setCiType = _useState[1];
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
setCiType(utils.getDefaultSelectedCiType(dataSource));
|
|
40
|
-
}, [dataSource]);
|
|
41
|
-
var _useState2 = useState(''),
|
|
42
|
-
search = _useState2[0],
|
|
43
|
-
setSearch = _useState2[1];
|
|
44
|
-
var _useState3 = useState(value),
|
|
45
|
-
selected = _useState3[0],
|
|
46
|
-
setSelected = _useState3[1];
|
|
47
|
-
var selectedRowKeys = selected[ciType] || [];
|
|
48
|
-
var _RiilHooks$useTableCo = RiilHooks.useTableColumn({
|
|
49
|
-
columns: [{
|
|
50
|
-
width: '100%',
|
|
51
|
-
dataIndex: 'name',
|
|
52
|
-
title: '数据',
|
|
53
|
-
cellOption: {
|
|
54
|
-
nowrap: true
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
width: '70px',
|
|
58
|
-
dataIndex: 'type',
|
|
59
|
-
title: '类型',
|
|
60
|
-
cellOption: {
|
|
61
|
-
nowrap: {
|
|
62
|
-
nowrapCell: utils.typeCell,
|
|
63
|
-
title: utils.typeCell
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}]
|
|
67
|
-
}),
|
|
68
|
-
columnNodes = _RiilHooks$useTableCo.columnNodes;
|
|
69
|
-
var onTreeSelect = function onTreeSelect(_ref2) {
|
|
70
|
-
var selectedKey = _ref2[0];
|
|
71
|
-
if (selectedKey && allCiSet[selectedKey] && allCiSet[selectedKey].type !== 'folder') {
|
|
72
|
-
setCiType(selectedKey);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var onTableSelect = function onTableSelect(selectedKeys) {
|
|
76
|
-
var values = _extends({}, selected);
|
|
77
|
-
rlog.debug('Setting-allCiSet-onTableSelect', limit, selectedKeys, selected);
|
|
78
|
-
values[ciType] = selectedKeys;
|
|
79
|
-
setSelected(values);
|
|
80
|
-
};
|
|
81
|
-
var saveSelected = function saveSelected() {
|
|
82
|
-
saveCb(selected);
|
|
83
|
-
};
|
|
84
|
-
var onReset = function onReset() {
|
|
85
|
-
setSelected({});
|
|
86
|
-
};
|
|
87
|
-
var tableData = useMemo(function () {
|
|
88
|
-
var _allCiSet$ciType;
|
|
89
|
-
var list = ((_allCiSet$ciType = allCiSet[ciType]) === null || _allCiSet$ciType === void 0 ? void 0 : _allCiSet$ciType.list) || [];
|
|
90
|
-
if (search) {
|
|
91
|
-
list = list.filter(function (item) {
|
|
92
|
-
var _item$name;
|
|
93
|
-
return ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.toUpperCase().indexOf(search.toUpperCase())) !== -1;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return list;
|
|
97
|
-
}, [allCiSet, ciType, search]);
|
|
98
|
-
function onSearch(searchValue) {
|
|
99
|
-
setSearch(searchValue);
|
|
100
|
-
}
|
|
101
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className: styles.layout
|
|
103
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
className: styles.message
|
|
105
|
-
}, /*#__PURE__*/React.createElement(_Message, {
|
|
106
|
-
type: "notice"
|
|
107
|
-
}, props.label + "\u6570\u636E\uFF1A\u9009\u62E9\u7684\u6307\u6807\u548C\u5C5E\u6027\u5C06\u4F1A\u663E\u793A\u5728" + props.poslabel + "\uFF0C\u6700\u591A\u652F\u6301\u52FE\u9009 " + limit + " \u9879\u3002")), /*#__PURE__*/React.createElement(_Grid.Row, {
|
|
108
|
-
className: styles.content
|
|
109
|
-
}, /*#__PURE__*/React.createElement(_Grid.Col, {
|
|
110
|
-
span: 8,
|
|
111
|
-
className: styles['tree-wrap']
|
|
112
|
-
}, dataSource.length && /*#__PURE__*/React.createElement(ActionTree, {
|
|
113
|
-
dataSource: dataSource,
|
|
114
|
-
onSelect: onTreeSelect,
|
|
115
|
-
draggable: false,
|
|
116
|
-
treeProps: {
|
|
117
|
-
selectedKeys: [ciType],
|
|
118
|
-
defaultExpandedKeys: dataSource.filter(function (item) {
|
|
119
|
-
return item.type === 'folder';
|
|
120
|
-
}).map(function (item) {
|
|
121
|
-
return item.id;
|
|
122
|
-
}),
|
|
123
|
-
expandedKeys: dataSource.filter(function (item) {
|
|
124
|
-
return item.type === 'folder';
|
|
125
|
-
}).map(function (item) {
|
|
126
|
-
return item.id;
|
|
127
|
-
}),
|
|
128
|
-
defaultExpandAll: true
|
|
129
|
-
}
|
|
130
|
-
})), /*#__PURE__*/React.createElement(_Grid.Col, {
|
|
131
|
-
className: styles['table-wrap']
|
|
132
|
-
}, /*#__PURE__*/React.createElement(TableLayout, {
|
|
133
|
-
filterItems: /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className: styles.filter
|
|
135
|
-
}, /*#__PURE__*/React.createElement(_Search, {
|
|
136
|
-
// className={styles.search}
|
|
137
|
-
style: {
|
|
138
|
-
width: 200
|
|
139
|
-
},
|
|
140
|
-
shape: "simple",
|
|
141
|
-
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57",
|
|
142
|
-
onSearch: onSearch,
|
|
143
|
-
onChange: function onChange(val) {
|
|
144
|
-
return !val && onSearch('');
|
|
145
|
-
},
|
|
146
|
-
hasClear: true
|
|
147
|
-
})),
|
|
148
|
-
table: /*#__PURE__*/React.createElement(_Table, {
|
|
149
|
-
fixedHeader: true,
|
|
150
|
-
hasBorder: false,
|
|
151
|
-
dataSource: tableData,
|
|
152
|
-
emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
|
|
153
|
-
type: "table"
|
|
154
|
-
}),
|
|
155
|
-
rowSelection: {
|
|
156
|
-
selectedRowKeys: selectedRowKeys,
|
|
157
|
-
onChange: onTableSelect,
|
|
158
|
-
getProps: function getProps(_ref3) {
|
|
159
|
-
var id = _ref3.id;
|
|
160
|
-
return {
|
|
161
|
-
disabled: !selectedRowKeys.includes(id) && selectedRowKeys.length >= limit
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}, columnNodes)
|
|
166
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
167
|
-
className: "riil-footer right"
|
|
168
|
-
}, /*#__PURE__*/React.createElement(_Button, {
|
|
169
|
-
text: true,
|
|
170
|
-
type: "primary",
|
|
171
|
-
onClick: onReset
|
|
172
|
-
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(_Button, {
|
|
173
|
-
type: "primary",
|
|
174
|
-
onClick: function onClick() {
|
|
175
|
-
saveSelected();
|
|
176
|
-
}
|
|
177
|
-
}, "\u786E\u5B9A"), /*#__PURE__*/React.createElement(_Button, {
|
|
178
|
-
onClick: props.cancelCb
|
|
179
|
-
}, "\u53D6\u6D88")));
|
|
180
|
-
};
|
|
181
|
-
export default Setting;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { loopTreeNode } from "../../utils/treeUtil";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 获取树结构数据源
|
|
5
|
-
* @param {*} allCiSet 数据源
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export var treeDs = function treeDs(allCiSet) {
|
|
9
|
-
return Object.keys(allCiSet).map(function (key) {
|
|
10
|
-
var _allCiSet$key, _allCiSet$key2;
|
|
11
|
-
return {
|
|
12
|
-
id: key,
|
|
13
|
-
label: (_allCiSet$key = allCiSet[key]) === null || _allCiSet$key === void 0 ? void 0 : _allCiSet$key.name,
|
|
14
|
-
icon: "/img/model/" + ((_allCiSet$key2 = allCiSet[key]) === null || _allCiSet$key2 === void 0 ? void 0 : _allCiSet$key2.icon) + ".svg"
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export var typeCell = function typeCell(text) {
|
|
19
|
-
if (text === 'attribute') {
|
|
20
|
-
return '属性';
|
|
21
|
-
} else if (text === 'metric') {
|
|
22
|
-
return '指标';
|
|
23
|
-
}
|
|
24
|
-
return '-';
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 获得默认选中第一个模型
|
|
29
|
-
* @param {*} tree
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
export function getDefaultSelectedCiType(tree) {
|
|
33
|
-
var ciType = null;
|
|
34
|
-
loopTreeNode(tree, function (item) {
|
|
35
|
-
if (item.type !== 'folder') {
|
|
36
|
-
if (!ciType) {
|
|
37
|
-
ciType = item.id;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return ciType;
|
|
42
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import _List from "@alifd/next/es/list";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ListItem from "./CiListItem";
|
|
4
|
-
import styles from "./index.module.scss";
|
|
5
|
-
var CiList = function CiList(props) {
|
|
6
|
-
var data = props.data,
|
|
7
|
-
onSelect = props.onSelect,
|
|
8
|
-
selected = props.selected,
|
|
9
|
-
loading = props.loading;
|
|
10
|
-
var renderItem = function renderItem(item) {
|
|
11
|
-
return /*#__PURE__*/React.createElement(ListItem, {
|
|
12
|
-
key: item.value,
|
|
13
|
-
data: item,
|
|
14
|
-
onSelect: onSelect,
|
|
15
|
-
selected: item.value === selected
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
return /*#__PURE__*/React.createElement(_List, {
|
|
19
|
-
className: styles.cilist,
|
|
20
|
-
size: "small",
|
|
21
|
-
loading: loading,
|
|
22
|
-
dataSource: data,
|
|
23
|
-
renderItem: renderItem
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export default CiList;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import _Icon from "@alifd/next/es/icon";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styles from "./index.module.scss";
|
|
4
|
-
var getIcon = function getIcon(icon) {
|
|
5
|
-
return "/img/model/" + icon + ".svg";
|
|
6
|
-
};
|
|
7
|
-
var onIconError = function onIconError(e) {
|
|
8
|
-
var image = e.target;
|
|
9
|
-
if (!image.isLoaded) {
|
|
10
|
-
image.isLoaded = true;
|
|
11
|
-
image.src = getIcon('backupOnError');
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
var CiListItem = function CiListItem(props) {
|
|
15
|
-
var data = props.data,
|
|
16
|
-
onSelect = props.onSelect,
|
|
17
|
-
selected = props.selected;
|
|
18
|
-
var onClick = function onClick() {
|
|
19
|
-
return onSelect(data);
|
|
20
|
-
};
|
|
21
|
-
var isCustom = data.icon === 'custom';
|
|
22
|
-
var className = selected ? styles.ciitem + " " + styles.selected : styles.ciitem;
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: className,
|
|
25
|
-
onClick: onClick
|
|
26
|
-
}, isCustom ? /*#__PURE__*/React.createElement(_Icon, {
|
|
27
|
-
className: styles.icon,
|
|
28
|
-
size: "xs",
|
|
29
|
-
type: data.icon
|
|
30
|
-
}) : /*#__PURE__*/React.createElement("img", {
|
|
31
|
-
className: styles.icon,
|
|
32
|
-
src: getIcon(data.icon),
|
|
33
|
-
alt: data.icon,
|
|
34
|
-
onError: onIconError
|
|
35
|
-
}), /*#__PURE__*/React.createElement("span", null, data.label));
|
|
36
|
-
};
|
|
37
|
-
export default CiListItem;
|