@riil-frontend/component-topology 0.2.2 → 0.2.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/README.md +5 -1
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.js +37 -37
- package/demo/{usage.md → 1/345/237/272/346/234/254/usage.md} +0 -0
- package/demo/{usage1.md → 1/345/237/272/346/234/254/usage1.md} +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/TopoCenterViewer.jsx +75 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/createMockRequest.js +38 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/api/v1/model/getAllDict +1029 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/alarm +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/alarm.json +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/once +2596 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/once.json +2596 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/polling +2293 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/polling.json +2293 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/auth/permission/2 +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/auth/permission/2.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/menu +48 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/menu.json +48 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/shape +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/shape.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/both/2 +618 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/both/2.json +618 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/relationList +192 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/relationList.json +192 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/webUrl/list +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/webUrl/list.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/v1/api/authFunc/checkFuncAuthentication +14 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/v1/api/authFunc/checkFuncAuthentication.json +14 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/request.js +7 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203//345/261/225/347/244/272/346/250/241/345/274/217.md +10 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/AppInstallTopo.jsx +90 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/api/v1/model/getAllDict +1029 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/alarm +0 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/alarm.json +0 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/once +2596 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/once.json +2596 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/polling +2293 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/polling.json +2293 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/auth/permission/2 +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/auth/permission/2.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/menu +48 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/menu.json +48 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/shape +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/shape.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/1 +3 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/2 +618 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/2.json +618 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/webUrl/list +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/webUrl/list.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/v1/api/authFunc/checkFuncAuthentication +14 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/v1/api/authFunc/checkFuncAuthentication.json +14 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/data/simple.json +190 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/request.js +7 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221//345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221.md +10 -0
- package/demo/{/346/213/223/346/211/221/344/270/255/345/277/203.md → 4/345/210/206/345/261/202/351/205/215/347/275/256/347/273/204/344/273/266/js/a.js} +15 -25
- package/demo/4/345/210/206/345/261/202/351/205/215/347/275/256/347/273/204/344/273/266//345/261/225/347/244/272/347/273/204/344/273/266.md +10 -0
- package/demo/{API.md → API/API.md} +0 -0
- package/es/components/BatchAttrMetric/index.js +2 -2
- package/es/components/BatchAttrMetric/setting.js +12 -9
- package/es/components/BatchAttrMetric/utils.js +4 -3
- package/es/components/Drawer/index.js +5 -4
- package/es/components/FormTable/index.js +7 -5
- package/es/components/IndexSettingDrawer/CiList.js +2 -2
- package/es/components/IndexSettingDrawer/CiListItem.js +2 -2
- package/es/components/IndexSettingDrawer/IndexList.js +3 -3
- package/es/components/IndexSettingDrawer/index.js +2 -2
- package/es/components/Link/form.js +19 -13
- package/es/components/Link/index.js +4 -3
- package/es/components/Link/setting.js +12 -9
- package/es/components/MultiResourceDrawer/Content.js +5 -3
- package/es/components/MultiResourceDrawer/ResourceCard/index.js +5 -4
- package/es/components/SingleResourceDrawer/index.js +3 -2
- package/es/components/TopoView/Topo.js +2 -2
- package/es/components/TopoView/plugins/ResourceDetail/topoDrawer.js +6 -4
- package/es/components/TopoView/plugins/ResourceWebControllUrlSettingDialog.js +13 -7
- package/es/components/TopoView/settings/LayerSettingsForm.js +35 -26
- package/es/components/TopoView/settings/ResourceList.js +4 -3
- package/es/components/TopoView/settings/SelectResource/index.js +18 -12
- package/es/components/TopoView/settings/Settings.js +0 -1
- package/es/components/TopoView/settings/SettingsForm.js +4 -3
- package/es/components/TopoView/settings/Style.js +22 -14
- package/es/components/TopoView/toolbar/TopoEditorTitleBar.js +3 -3
- package/es/components/TopoView/toolbar/TopoViewerTitleBar.js +2 -2
- package/es/components/TopoView/toolbar/ViewTools.js +8 -6
- package/es/components/TopoView/toolbar/widgets/SearchWidget.js +2 -2
- package/es/components/TopoView/topoView.js +9 -23
- package/es/components/edit/EditPlugin.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/RuleSetting.js +4 -3
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/ColorPicker.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/Rule.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +18 -17
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +16 -11
- package/es/components/edit/iconManage/RenameDialog.js +11 -6
- package/es/components/edit/iconManage/UploadIconDialog.js +11 -7
- package/es/core/models/TopoApp.js +73 -107
- package/es/core/models/cache/DictCache.js +79 -0
- package/es/core/models/plugins/resourceWebControllUrl.js +8 -4
- package/es/core/utils/showMessage.js +2 -2
- package/es/createTopo.js +2 -31
- package/es/hooks/usePolling.js +9 -5
- package/es/hooks/useTopoEdit.js +14 -8
- package/es/models/iconManage.js +9 -5
- package/es/models/linkDynamicStyleConfig.js +3 -2
- package/es/models/linkManager.js +0 -1
- package/es/models/resourceWebControllUrlSetting.js +0 -1
- package/es/models/topoAlarm.js +0 -1
- package/es/models/topoBizMod.js +11 -8
- package/es/models/topoEdit.js +0 -1
- package/es/models/topoGraphView.js +0 -1
- package/es/models/topoMod.js +54 -30
- package/es/models/topoView.js +0 -1
- package/es/models/topocenter/functionAuth.js +0 -1
- package/es/models/topocenter/topoCenter.js +0 -1
- package/es/style.js +25 -1
- package/es/topoCenter/getTopoData.js +41 -0
- package/es/topoCenter/models/Topo.js +0 -0
- package/es/topoCenter/models/TopoCenter.js +104 -0
- package/es/topoCenter/viewer/TitleBar.js +10 -0
- package/es/topoCenter/viewer/components/TopologyViewer.js +27 -0
- package/es/topoCenter/viewer/createTopoViewer.js +2 -34
- package/es/topoCenter/viewer/index.js +2 -2
- package/es/utils/topoData.js +8 -5
- package/lib/components/BatchAttrMetric/index.js +3 -3
- package/lib/components/BatchAttrMetric/setting.js +16 -10
- package/lib/components/BatchAttrMetric/utils.js +6 -4
- package/lib/components/Drawer/index.js +7 -5
- package/lib/components/FormTable/index.js +13 -9
- package/lib/components/IndexSettingDrawer/CiList.js +3 -3
- package/lib/components/IndexSettingDrawer/CiListItem.js +3 -3
- package/lib/components/IndexSettingDrawer/IndexList.js +7 -7
- package/lib/components/IndexSettingDrawer/index.js +3 -3
- package/lib/components/Link/form.js +24 -14
- package/lib/components/Link/index.js +6 -4
- package/lib/components/Link/setting.js +16 -10
- package/lib/components/MultiResourceDrawer/Content.js +4 -4
- package/lib/components/MultiResourceDrawer/ResourceCard/index.js +7 -5
- package/lib/components/SingleResourceDrawer/index.js +3 -3
- package/lib/components/TopoView/Topo.js +3 -3
- package/lib/components/TopoView/plugins/ResourceDetail/topoDrawer.js +9 -5
- package/lib/components/TopoView/plugins/ResourceWebControllUrlSettingDialog.js +16 -8
- package/lib/components/TopoView/settings/LayerSettingsForm.js +41 -27
- package/lib/components/TopoView/settings/ResourceList.js +6 -4
- package/lib/components/TopoView/settings/SelectResource/index.js +25 -13
- package/lib/components/TopoView/settings/Settings.js +0 -2
- package/lib/components/TopoView/settings/SettingsForm.js +6 -4
- package/lib/components/TopoView/settings/Style.js +27 -15
- package/lib/components/TopoView/toolbar/TopoEditorTitleBar.js +4 -4
- package/lib/components/TopoView/toolbar/TopoViewerTitleBar.js +3 -3
- package/lib/components/TopoView/toolbar/ViewTools.js +11 -7
- package/lib/components/TopoView/toolbar/widgets/SearchWidget.js +5 -3
- package/lib/components/TopoView/topoView.js +11 -26
- package/lib/components/edit/EditPlugin.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/RuleSetting.js +6 -4
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/ColorPicker.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/Rule.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +20 -18
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +18 -12
- package/lib/components/edit/iconManage/RenameDialog.js +13 -7
- package/lib/components/edit/iconManage/UploadIconDialog.js +14 -8
- package/lib/core/models/TopoApp.js +73 -107
- package/lib/core/models/cache/DictCache.js +95 -0
- package/lib/core/models/plugins/resourceWebControllUrl.js +5 -5
- package/lib/core/utils/showMessage.js +3 -3
- package/lib/createTopo.js +3 -34
- package/lib/hooks/usePolling.js +10 -5
- package/lib/hooks/useTopoEdit.js +11 -9
- package/lib/models/iconManage.js +8 -6
- package/lib/models/linkDynamicStyleConfig.js +3 -3
- package/lib/models/linkManager.js +0 -2
- package/lib/models/resourceWebControllUrlSetting.js +0 -2
- package/lib/models/topoAlarm.js +0 -2
- package/lib/models/topoBizMod.js +11 -8
- package/lib/models/topoEdit.js +0 -2
- package/lib/models/topoGraphView.js +0 -2
- package/lib/models/topoMod.js +54 -30
- package/lib/models/topoView.js +0 -2
- package/lib/models/topocenter/functionAuth.js +0 -2
- package/lib/models/topocenter/topoCenter.js +0 -2
- package/lib/style.js +25 -1
- package/lib/topoCenter/getTopoData.js +53 -0
- package/lib/topoCenter/models/Topo.js +1 -0
- package/lib/topoCenter/models/TopoCenter.js +118 -0
- package/lib/topoCenter/viewer/TitleBar.js +21 -0
- package/lib/topoCenter/viewer/components/TopologyViewer.js +43 -0
- package/lib/topoCenter/viewer/createTopoViewer.js +3 -36
- package/lib/topoCenter/viewer/index.js +4 -4
- package/lib/utils/topoData.js +7 -5
- package/package.json +7 -5
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
|
2
|
+
import _NumberPicker from "@alifd/next/es/number-picker";
|
|
3
|
+
import _Input from "@alifd/next/es/input";
|
|
4
|
+
import _Field from "@alifd/next/es/field";
|
|
5
|
+
import _Select from "@alifd/next/es/select";
|
|
6
|
+
import _Grid from "@alifd/next/es/grid";
|
|
7
|
+
import _Form from "@alifd/next/es/form";
|
|
1
8
|
import React, { useEffect } from 'react';
|
|
2
|
-
import { Field, Form, Input, NumberPicker, Select, Grid, Tab } from '@alifd/next';
|
|
3
9
|
import isEqual from 'lodash/isEqual';
|
|
4
10
|
import ColorPicker from '../../edit/LinkDynamicStyleSettingDrawer/rule/ColorPicker';
|
|
5
11
|
import styles from '../../edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss';
|
|
6
|
-
var FormItem =
|
|
7
|
-
var Row =
|
|
8
|
-
Col =
|
|
9
|
-
var Option =
|
|
12
|
+
var FormItem = _Form.Item;
|
|
13
|
+
var Row = _Grid.Row,
|
|
14
|
+
Col = _Grid.Col;
|
|
15
|
+
var Option = _Select.Option;
|
|
10
16
|
export default function Style(props) {
|
|
11
17
|
var values = props.values,
|
|
12
18
|
_onChange = props.onChange;
|
|
13
|
-
|
|
19
|
+
|
|
20
|
+
var field = _Field.useField({
|
|
14
21
|
autoUnmount: false,
|
|
15
22
|
values: values,
|
|
16
23
|
onChange: function onChange(name, value) {
|
|
@@ -21,6 +28,7 @@ export default function Style(props) {
|
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
});
|
|
31
|
+
|
|
24
32
|
useEffect(function () {
|
|
25
33
|
field.setValues(values);
|
|
26
34
|
}, [values]);
|
|
@@ -28,21 +36,21 @@ export default function Style(props) {
|
|
|
28
36
|
style: {
|
|
29
37
|
padding: 12
|
|
30
38
|
}
|
|
31
|
-
}, /*#__PURE__*/React.createElement(
|
|
39
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
32
40
|
field: field,
|
|
33
41
|
labelAlign: "top"
|
|
34
|
-
}, /*#__PURE__*/React.createElement(
|
|
42
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
35
43
|
label: "\u540D\u79F0"
|
|
36
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
37
45
|
name: "attrObject.name"
|
|
38
|
-
})), values.attrObject.type !== 'link' && /*#__PURE__*/React.createElement(
|
|
46
|
+
})), values.attrObject.type !== 'link' && /*#__PURE__*/React.createElement(_Form.Item, {
|
|
39
47
|
label: "\u5750\u6807"
|
|
40
48
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
41
49
|
gutter: "16"
|
|
42
50
|
}, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
|
|
43
51
|
required: true,
|
|
44
52
|
requiredTrigger: "onBlur"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(
|
|
53
|
+
}, /*#__PURE__*/React.createElement(_NumberPicker, {
|
|
46
54
|
name: "position.x",
|
|
47
55
|
min: 0,
|
|
48
56
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
@@ -52,17 +60,17 @@ export default function Style(props) {
|
|
|
52
60
|
}))), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
|
|
53
61
|
required: true,
|
|
54
62
|
requiredTrigger: "onBlur"
|
|
55
|
-
}, /*#__PURE__*/React.createElement(
|
|
63
|
+
}, /*#__PURE__*/React.createElement(_NumberPicker, {
|
|
56
64
|
name: "position.y",
|
|
57
65
|
min: 0,
|
|
58
66
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
59
67
|
style: {
|
|
60
68
|
width: '100%'
|
|
61
69
|
}
|
|
62
|
-
}))))), /*#__PURE__*/React.createElement(
|
|
70
|
+
}))))), /*#__PURE__*/React.createElement(_Tab, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
|
63
71
|
title: "\u6570\u636E",
|
|
64
72
|
key: "1"
|
|
65
|
-
}, "\u6570\u636E"), /*#__PURE__*/React.createElement(
|
|
73
|
+
}, "\u6570\u636E"), /*#__PURE__*/React.createElement(_Tab.Item, {
|
|
66
74
|
title: "\u6837\u5F0F",
|
|
67
75
|
key: "2"
|
|
68
76
|
}, "\u6837\u5F0F"))));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _Button from "@alifd/next/es/button";
|
|
1
2
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import { Button } from '@alifd/next';
|
|
3
3
|
import TitleWidget from './widgets/TitleWidget';
|
|
4
4
|
import styles from './TitleBar.module.scss';
|
|
5
5
|
export default function TopoEditorTitleBar(props) {
|
|
@@ -14,12 +14,12 @@ export default function TopoEditorTitleBar(props) {
|
|
|
14
14
|
className: styles.right
|
|
15
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: styles.rightTools
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
17
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
18
18
|
type: "primary",
|
|
19
19
|
onClick: function onClick() {
|
|
20
20
|
topo.save();
|
|
21
21
|
}
|
|
22
|
-
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(
|
|
22
|
+
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
|
|
23
23
|
onClick: function onClick() {
|
|
24
24
|
topo.exitEditMode();
|
|
25
25
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import _MenuButton from "@alifd/next/es/menu-button";
|
|
1
2
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import { Button, Search, Icon, MenuButton } from '@alifd/next';
|
|
3
3
|
import ViewTools from './ViewTools';
|
|
4
4
|
import TitleWidget from './widgets/TitleWidget';
|
|
5
5
|
import styles from './TitleBar.module.scss';
|
|
6
|
-
var Item =
|
|
6
|
+
var Item = _MenuButton.Item;
|
|
7
7
|
export default function TopoViewerTitleBar(props) {
|
|
8
8
|
var topo = props.topo,
|
|
9
9
|
showEditButton = props.showEditButton,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import _Icon from "@alifd/next/es/icon";
|
|
2
|
+
import _Button from "@alifd/next/es/button";
|
|
3
|
+
import _MenuButton from "@alifd/next/es/menu-button";
|
|
1
4
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import { Button, Icon, MenuButton } from '@alifd/next';
|
|
3
5
|
import SearchWidget from './widgets/SearchWidget';
|
|
4
6
|
import topoPermissonUtil from '../../../utils/topoPermissonUtil';
|
|
5
7
|
import styles from './TitleBar.module.scss';
|
|
6
|
-
var Item =
|
|
8
|
+
var Item = _MenuButton.Item;
|
|
7
9
|
export default function ViewTools(props) {
|
|
8
10
|
var topo = props.topo,
|
|
9
11
|
_props$showEditButton = props.showEditButton,
|
|
@@ -17,21 +19,21 @@ export default function ViewTools(props) {
|
|
|
17
19
|
var topoPermission = topoState.topoPermission;
|
|
18
20
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchWidget, {
|
|
19
21
|
topo: topo
|
|
20
|
-
}), showEditButton && topoPermissonUtil.isEditable(topoPermission) && /*#__PURE__*/React.createElement(
|
|
22
|
+
}), showEditButton && topoPermissonUtil.isEditable(topoPermission) && /*#__PURE__*/React.createElement(_Button, {
|
|
21
23
|
type: "primary",
|
|
22
24
|
className: styles.button,
|
|
23
25
|
onClick: function onClick() {
|
|
24
26
|
onEnterEdit ? onEnterEdit() : topo.enterEditMode();
|
|
25
27
|
}
|
|
26
|
-
}, "\u7F16\u8F91"), /*#__PURE__*/React.createElement(
|
|
27
|
-
label: /*#__PURE__*/React.createElement(
|
|
28
|
+
}, "\u7F16\u8F91"), /*#__PURE__*/React.createElement(_MenuButton, {
|
|
29
|
+
label: /*#__PURE__*/React.createElement(_Icon, {
|
|
28
30
|
type: "ellipsis-vertical"
|
|
29
31
|
}),
|
|
30
32
|
autoWidth: false,
|
|
31
33
|
className: styles.moreMenuButton
|
|
32
34
|
}, /*#__PURE__*/React.createElement(Item, {
|
|
33
35
|
key: "PermissionSetting"
|
|
34
|
-
}, /*#__PURE__*/React.createElement(
|
|
36
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
35
37
|
text: true,
|
|
36
38
|
onClick: function onClick() {
|
|
37
39
|
topo.exportImage();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _Search from "@alifd/next/es/search";
|
|
1
2
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import { Button, Search, Icon, MenuButton } from '@alifd/next';
|
|
3
3
|
var searchTypes = [{
|
|
4
4
|
label: '设备名称',
|
|
5
5
|
value: 'name'
|
|
@@ -17,7 +17,7 @@ export default function SearchWidget(props) {
|
|
|
17
17
|
// htTopoClient.search({type: filterValue, value});
|
|
18
18
|
topo.searchElements(filterType, value);
|
|
19
19
|
}, []);
|
|
20
|
-
return /*#__PURE__*/React.createElement(
|
|
20
|
+
return /*#__PURE__*/React.createElement(_Search, {
|
|
21
21
|
shape: "simple",
|
|
22
22
|
filter: searchTypes,
|
|
23
23
|
defaultFilterValue: "name",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
|
|
3
3
|
import TopoContainer, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
4
|
-
import { dictFormat } from '@riil-frontend/utils';
|
|
5
4
|
import useTopoEdit from '../../hooks/useTopoEdit';
|
|
6
5
|
import usePolling from '../../hooks/usePolling';
|
|
7
6
|
import useAlarm from '../../hooks/useAlarm';
|
|
@@ -71,29 +70,11 @@ var TopoView = function TopoView(props) {
|
|
|
71
70
|
tData = _useState[0],
|
|
72
71
|
setTData = _useState[1];
|
|
73
72
|
|
|
74
|
-
var _useState2 = useState(),
|
|
75
|
-
dictObj = _useState2[0],
|
|
76
|
-
setDictObj = _useState2[1];
|
|
77
|
-
|
|
78
73
|
var containerLinkTopo = useContainerLinkTopo({
|
|
79
74
|
topoApp: topoApp
|
|
80
75
|
});
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
var dis = sessionStorage.getItem('dists');
|
|
83
|
-
|
|
84
|
-
if (dis) {
|
|
85
|
-
var dictObject = dictFormat(JSON.parse(dis));
|
|
86
|
-
setDictObj(dictObject);
|
|
87
|
-
}
|
|
88
|
-
}, []);
|
|
89
|
-
var onCreatedTopo = useCallback(function (htTopoClient) {
|
|
90
|
-
topoApp.view.onCreatedView(htTopoClient);
|
|
91
|
-
rlog.info('TopoView.onCreatedTopo');
|
|
92
|
-
initSelection();
|
|
93
|
-
}, []);
|
|
94
76
|
usePolling({
|
|
95
|
-
topoApp: topoApp
|
|
96
|
-
dictObj: dictObj
|
|
77
|
+
topoApp: topoApp
|
|
97
78
|
});
|
|
98
79
|
useAlarm({
|
|
99
80
|
topoApp: topoApp
|
|
@@ -118,7 +99,12 @@ var TopoView = function TopoView(props) {
|
|
|
118
99
|
currentTopo: topoData.config
|
|
119
100
|
});
|
|
120
101
|
}
|
|
121
|
-
}, [topoData, resAndMetrics]);
|
|
102
|
+
}, [topoData, resAndMetrics]);
|
|
103
|
+
var onCreatedTopo = useCallback(function (htTopoClient) {
|
|
104
|
+
topoApp.view.onCreatedView(htTopoClient);
|
|
105
|
+
rlog.info('TopoView.onCreatedTopo');
|
|
106
|
+
initSelection();
|
|
107
|
+
}, []); // TODO 之后把事件方法都转移出去
|
|
122
108
|
|
|
123
109
|
var rightEventHandle = function rightEventHandle(event) {
|
|
124
110
|
rlog.debug('右键事件', event);
|
|
@@ -192,11 +178,11 @@ var TopoView = function TopoView(props) {
|
|
|
192
178
|
|
|
193
179
|
return /*#__PURE__*/React.createElement("div", {
|
|
194
180
|
className: styles.topoView
|
|
195
|
-
}, titleBar || /*#__PURE__*/React.createElement(TitleBar, {
|
|
181
|
+
}, titleBar !== false && (titleBar || /*#__PURE__*/React.createElement(TitleBar, {
|
|
196
182
|
topo: topoApp,
|
|
197
183
|
isEditMode: isEditMode,
|
|
198
184
|
onEnterEdit: onEnterEdit
|
|
199
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
185
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
200
186
|
className: styles.viewPanel
|
|
201
187
|
}, /*#__PURE__*/React.createElement(TopoContainer, {
|
|
202
188
|
ref: topoRef,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _Loading from "@alifd/next/es/loading";
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Loading } from '@alifd/next';
|
|
3
3
|
import IconManage from './iconManage/IconManage';
|
|
4
4
|
import LinkDynamicStyleSettingDrawer from './LinkDynamicStyleSettingDrawer';
|
|
5
5
|
import ResourceViewAttributeSettingPlugin from './ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin';
|
|
@@ -13,7 +13,7 @@ export default function TopoEditPlugin(props) {
|
|
|
13
13
|
topoEditState = _store$useModel[0],
|
|
14
14
|
topoEditDispatchers = _store$useModel[1];
|
|
15
15
|
|
|
16
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Loading, {
|
|
17
17
|
visible: topoEditState.saving,
|
|
18
18
|
fullScreen: true
|
|
19
19
|
}), /*#__PURE__*/React.createElement(ResourceViewAttributeSettingPlugin, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import _Button from "@alifd/next/es/button";
|
|
2
|
+
import _Icon from "@alifd/next/es/icon";
|
|
1
3
|
import React, { useRef, useState } from 'react';
|
|
2
|
-
import { Button, Icon, Card } from '@alifd/next';
|
|
3
4
|
import Rule from './rule/Rule';
|
|
4
5
|
import styles from './RuleSetting.module.scss';
|
|
5
6
|
export default function RuleSetting(props) {
|
|
@@ -27,7 +28,7 @@ export default function RuleSetting(props) {
|
|
|
27
28
|
_onDelete(index);
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
})), /*#__PURE__*/React.createElement(
|
|
31
|
+
})), /*#__PURE__*/React.createElement(_Button, {
|
|
31
32
|
disabled: rules.length >= 10,
|
|
32
33
|
style: {
|
|
33
34
|
width: '100%'
|
|
@@ -35,7 +36,7 @@ export default function RuleSetting(props) {
|
|
|
35
36
|
onClick: function onClick() {
|
|
36
37
|
onAdd();
|
|
37
38
|
}
|
|
38
|
-
}, /*#__PURE__*/React.createElement(
|
|
39
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
39
40
|
type: "add"
|
|
40
41
|
}), " \u6DFB\u52A0\u6761\u4EF6"));
|
|
41
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _Balloon from "@alifd/next/es/balloon";
|
|
1
2
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
2
3
|
import React, { Component, useRef } from 'react';
|
|
3
|
-
import { Balloon } from '@alifd/next';
|
|
4
4
|
import { SketchPicker } from 'react-color';
|
|
5
5
|
import styles from './ColorPicker.module.scss';
|
|
6
6
|
import './ColorPicker.scss';
|
|
@@ -44,7 +44,7 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
44
44
|
});
|
|
45
45
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
46
|
className: "topo-color-picker"
|
|
47
|
-
}, /*#__PURE__*/React.createElement(
|
|
47
|
+
}, /*#__PURE__*/React.createElement(_Balloon, {
|
|
48
48
|
trigger: defaultTrigger,
|
|
49
49
|
closable: false,
|
|
50
50
|
triggerType: "click",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _Icon from "@alifd/next/es/icon";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import React from 'react';
|
|
3
|
-
import { Icon } from '@alifd/next';
|
|
4
4
|
import RuleCondition from './RuleCondition';
|
|
5
5
|
import RuleStyle from './RuleStyle';
|
|
6
6
|
import styles from './Rule.module.scss';
|
|
@@ -31,7 +31,7 @@ export default function Rule(props) {
|
|
|
31
31
|
className: styles.headerAction,
|
|
32
32
|
onClick: onDelete,
|
|
33
33
|
title: "\u5220\u9664"
|
|
34
|
-
}, /*#__PURE__*/React.createElement(
|
|
34
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
35
35
|
type: "ashbin",
|
|
36
36
|
size: "xs",
|
|
37
37
|
style: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import _NumberPicker from "@alifd/next/es/number-picker";
|
|
2
|
+
import _Select from "@alifd/next/es/select";
|
|
1
3
|
import React, { Component, useCallback, useState } from 'react';
|
|
2
4
|
import RiilRuleTree from '@riil-frontend/component-riil-rule-tree';
|
|
3
|
-
import { Select, Input, NumberPicker } from '@alifd/next';
|
|
4
5
|
import isEqual from 'lodash/isEqual';
|
|
5
6
|
import './RuleCondition.scss';
|
|
6
7
|
|
|
@@ -14,16 +15,16 @@ function getFields(type) {
|
|
|
14
15
|
}, 0);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
return /*#__PURE__*/React.createElement(
|
|
18
|
+
return /*#__PURE__*/React.createElement(_Select, {
|
|
18
19
|
value: type,
|
|
19
20
|
disabled: true,
|
|
20
21
|
style: {
|
|
21
22
|
width: 120
|
|
22
23
|
},
|
|
23
24
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
24
|
-
}, type === 'networkLink' ? /*#__PURE__*/React.createElement(
|
|
25
|
+
}, type === 'networkLink' ? /*#__PURE__*/React.createElement(_Select.Option, {
|
|
25
26
|
value: "networkLink"
|
|
26
|
-
}, "\u7F51\u7EDC\u94FE\u8DEF") : /*#__PURE__*/React.createElement(
|
|
27
|
+
}, "\u7F51\u7EDC\u94FE\u8DEF") : /*#__PURE__*/React.createElement(_Select.Option, {
|
|
27
28
|
value: "networkAggLink"
|
|
28
29
|
}, "\u805A\u5408\u94FE\u8DEF"));
|
|
29
30
|
}
|
|
@@ -36,47 +37,47 @@ function getFields(type) {
|
|
|
36
37
|
}, 0);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
+
return /*#__PURE__*/React.createElement(_Select, {
|
|
40
41
|
defaultValue: "attribute",
|
|
41
42
|
disabled: true,
|
|
42
43
|
style: {
|
|
43
44
|
width: 100
|
|
44
45
|
},
|
|
45
46
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
46
|
-
}, /*#__PURE__*/React.createElement(
|
|
47
|
+
}, /*#__PURE__*/React.createElement(_Select.Option, {
|
|
47
48
|
value: "attribute"
|
|
48
49
|
}, "\u5C5E\u6027"));
|
|
49
50
|
}
|
|
50
51
|
}, {
|
|
51
52
|
id: 'field',
|
|
52
|
-
element: /*#__PURE__*/React.createElement(
|
|
53
|
+
element: /*#__PURE__*/React.createElement(_Select, {
|
|
53
54
|
style: {
|
|
54
55
|
width: 120
|
|
55
56
|
},
|
|
56
57
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
57
|
-
}, /*#__PURE__*/React.createElement(
|
|
58
|
+
}, /*#__PURE__*/React.createElement(_Select.Option, {
|
|
58
59
|
value: "linkBandwidth"
|
|
59
|
-
}, "\u7F51\u7EDC\u94FE\u8DEF\u5E26\u5BBD"), /*#__PURE__*/React.createElement(
|
|
60
|
+
}, "\u7F51\u7EDC\u94FE\u8DEF\u5E26\u5BBD"), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
60
61
|
value: "linkRealBandwidth"
|
|
61
62
|
}, "\u94FE\u8DEF\u5B9E\u9645\u5E26\u5BBD"))
|
|
62
63
|
}, {
|
|
63
64
|
id: 'operator',
|
|
64
|
-
element: /*#__PURE__*/React.createElement(
|
|
65
|
+
element: /*#__PURE__*/React.createElement(_Select, {
|
|
65
66
|
style: {
|
|
66
67
|
width: 100
|
|
67
68
|
},
|
|
68
69
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
69
|
-
}, /*#__PURE__*/React.createElement(
|
|
70
|
+
}, /*#__PURE__*/React.createElement(_Select.Option, {
|
|
70
71
|
value: "=="
|
|
71
|
-
}, "=="), /*#__PURE__*/React.createElement(
|
|
72
|
+
}, "=="), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
72
73
|
value: "!="
|
|
73
|
-
}, "!="), /*#__PURE__*/React.createElement(
|
|
74
|
+
}, "!="), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
74
75
|
value: ">"
|
|
75
|
-
}, '>'), /*#__PURE__*/React.createElement(
|
|
76
|
+
}, '>'), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
76
77
|
value: ">="
|
|
77
|
-
}, '>='), /*#__PURE__*/React.createElement(
|
|
78
|
+
}, '>='), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
78
79
|
value: "<"
|
|
79
|
-
}, '<'), /*#__PURE__*/React.createElement(
|
|
80
|
+
}, '<'), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
80
81
|
value: "<="
|
|
81
82
|
}, '<='))
|
|
82
83
|
}, {
|
|
@@ -85,7 +86,7 @@ function getFields(type) {
|
|
|
85
86
|
required: true,
|
|
86
87
|
message: '不能为空'
|
|
87
88
|
}],
|
|
88
|
-
element: /*#__PURE__*/React.createElement(
|
|
89
|
+
element: /*#__PURE__*/React.createElement(_NumberPicker, {
|
|
89
90
|
min: 0,
|
|
90
91
|
max: 10000,
|
|
91
92
|
style: {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import _NumberPicker from "@alifd/next/es/number-picker";
|
|
2
|
+
import _Form from "@alifd/next/es/form";
|
|
3
|
+
import _Field from "@alifd/next/es/field";
|
|
4
|
+
import _Select from "@alifd/next/es/select";
|
|
1
5
|
import React, { useEffect } from 'react';
|
|
2
|
-
import { Field, Form, NumberPicker, Select } from '@alifd/next';
|
|
3
6
|
import isEqual from 'lodash/isEqual';
|
|
4
7
|
import ColorPicker from './ColorPicker';
|
|
5
8
|
import styles from './RuleStyle.module.scss';
|
|
6
|
-
var Option =
|
|
9
|
+
var Option = _Select.Option;
|
|
7
10
|
export default function RuleStyle(props) {
|
|
8
11
|
var values = props.values,
|
|
9
12
|
_onChange = props.onChange;
|
|
10
|
-
|
|
13
|
+
|
|
14
|
+
var field = _Field.useField({
|
|
11
15
|
autoUnmount: false,
|
|
12
16
|
values: values,
|
|
13
17
|
onChange: function onChange(name, value) {
|
|
@@ -16,17 +20,18 @@ export default function RuleStyle(props) {
|
|
|
16
20
|
_onChange(newValues);
|
|
17
21
|
}
|
|
18
22
|
});
|
|
23
|
+
|
|
19
24
|
useEffect(function () {
|
|
20
25
|
field.setValues(values);
|
|
21
26
|
}, [values]);
|
|
22
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
28
|
className: styles.container
|
|
24
|
-
}, /*#__PURE__*/React.createElement(
|
|
29
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
25
30
|
field: field,
|
|
26
31
|
inline: true
|
|
27
|
-
}, /*#__PURE__*/React.createElement(
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
28
33
|
label: "\u7EBF\u578B"
|
|
29
|
-
}, /*#__PURE__*/React.createElement(
|
|
34
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
30
35
|
name: "lineType",
|
|
31
36
|
style: {
|
|
32
37
|
marginRight: 8
|
|
@@ -35,14 +40,14 @@ export default function RuleStyle(props) {
|
|
|
35
40
|
value: "solid"
|
|
36
41
|
}, "\u5B9E\u7EBF\u4E00"), /*#__PURE__*/React.createElement(Option, {
|
|
37
42
|
value: "dash"
|
|
38
|
-
}, "\u865A\u7EBF---"))), /*#__PURE__*/React.createElement(
|
|
43
|
+
}, "\u865A\u7EBF---"))), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
39
44
|
label: "\u7EBF\u5BBD",
|
|
40
45
|
hasFeedback: true,
|
|
41
46
|
required: true,
|
|
42
47
|
requiredMessage: "\u4E0D\u80FD\u4E3A\u7A7A",
|
|
43
48
|
requiredTrigger: "onBlur",
|
|
44
49
|
asterisk: false
|
|
45
|
-
}, /*#__PURE__*/React.createElement(
|
|
50
|
+
}, /*#__PURE__*/React.createElement(_NumberPicker, {
|
|
46
51
|
name: "lineWidth",
|
|
47
52
|
min: 1,
|
|
48
53
|
max: 5,
|
|
@@ -50,9 +55,9 @@ export default function RuleStyle(props) {
|
|
|
50
55
|
marginRight: 8
|
|
51
56
|
},
|
|
52
57
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
53
|
-
})), /*#__PURE__*/React.createElement(
|
|
58
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
54
59
|
label: "\u65B9\u5411"
|
|
55
|
-
}, /*#__PURE__*/React.createElement(
|
|
60
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
56
61
|
name: "direction",
|
|
57
62
|
style: {
|
|
58
63
|
marginRight: 8
|
|
@@ -65,7 +70,7 @@ export default function RuleStyle(props) {
|
|
|
65
70
|
value: "left"
|
|
66
71
|
}, "\u2190"), /*#__PURE__*/React.createElement(Option, {
|
|
67
72
|
value: "both"
|
|
68
|
-
}, "\u2194"))), /*#__PURE__*/React.createElement(
|
|
73
|
+
}, "\u2194"))), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
69
74
|
label: "\u989C\u8272"
|
|
70
75
|
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
71
76
|
name: "color"
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import _Dialog from "@alifd/next/es/dialog";
|
|
2
|
+
import _Input from "@alifd/next/es/input";
|
|
1
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
import _Field from "@alifd/next/es/field";
|
|
5
|
+
import _Form from "@alifd/next/es/form";
|
|
2
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
7
|
import React, { useEffect } from 'react';
|
|
4
|
-
import { Button, Dialog, Field, Form, Icon, Input, Message, Upload } from '@alifd/next';
|
|
5
8
|
import _ from 'lodash';
|
|
6
|
-
var FormItem =
|
|
9
|
+
var FormItem = _Form.Item;
|
|
7
10
|
export default function RenameDialog(props) {
|
|
8
11
|
var topo = props.topo;
|
|
9
12
|
var store = topo.store;
|
|
@@ -17,12 +20,14 @@ export default function RenameDialog(props) {
|
|
|
17
20
|
icon = _state$rename.icon;
|
|
18
21
|
var name = icon === null || icon === void 0 ? void 0 : icon.name;
|
|
19
22
|
var loading = false;
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
var field = _Field.useField({
|
|
21
25
|
autoUnmount: true,
|
|
22
26
|
values: {
|
|
23
27
|
name: name
|
|
24
28
|
}
|
|
25
29
|
});
|
|
30
|
+
|
|
26
31
|
useEffect(function () {
|
|
27
32
|
field.setValues({
|
|
28
33
|
name: name
|
|
@@ -69,7 +74,7 @@ export default function RenameDialog(props) {
|
|
|
69
74
|
};
|
|
70
75
|
}();
|
|
71
76
|
|
|
72
|
-
var renameIconForm = visible && /*#__PURE__*/React.createElement(
|
|
77
|
+
var renameIconForm = visible && /*#__PURE__*/React.createElement(_Form, {
|
|
73
78
|
field: field
|
|
74
79
|
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
75
80
|
required: true,
|
|
@@ -78,12 +83,12 @@ export default function RenameDialog(props) {
|
|
|
78
83
|
maxLength: 32,
|
|
79
84
|
minmaxLengthMessage: "\u540D\u79F0\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC732\u4E2A\u5B57\u7B26",
|
|
80
85
|
minmaxLengthTrigger: "onBlur"
|
|
81
|
-
}, /*#__PURE__*/React.createElement(
|
|
86
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
82
87
|
name: "name",
|
|
83
88
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
84
89
|
trim: true
|
|
85
90
|
})));
|
|
86
|
-
return /*#__PURE__*/React.createElement(
|
|
91
|
+
return /*#__PURE__*/React.createElement(_Dialog, {
|
|
87
92
|
title: "\u91CD\u547D\u540D",
|
|
88
93
|
visible: visible,
|
|
89
94
|
okProps: {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import _Dialog from "@alifd/next/es/dialog";
|
|
2
|
+
import _Upload from "@alifd/next/es/upload";
|
|
3
|
+
import _Icon from "@alifd/next/es/icon";
|
|
1
4
|
import _extends from "@babel/runtime/helpers/extends";
|
|
5
|
+
import _Message from "@alifd/next/es/message";
|
|
2
6
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
7
|
import React from 'react';
|
|
4
|
-
import { Button, Dialog, Icon, Message, Upload } from '@alifd/next';
|
|
5
8
|
import topoServer from '@riil-frontend/component-topology-utils/es/services/topo';
|
|
6
9
|
import _ from 'lodash';
|
|
7
10
|
import _svgToShape from './utils/svgToShape';
|
|
@@ -68,7 +71,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
68
71
|
});
|
|
69
72
|
|
|
70
73
|
if (errorMsg) {
|
|
71
|
-
|
|
74
|
+
_Message.show({
|
|
72
75
|
type: 'error',
|
|
73
76
|
title: errorMsg
|
|
74
77
|
});
|
|
@@ -145,10 +148,11 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
145
148
|
uploading: false
|
|
146
149
|
});
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
_Message.show({
|
|
149
152
|
type: 'success',
|
|
150
153
|
title: '图标上传成功'
|
|
151
154
|
});
|
|
155
|
+
|
|
152
156
|
var dispatchers = _this.props.dispatchers;
|
|
153
157
|
dispatchers.uploadSuccess({
|
|
154
158
|
type: _this.props.type,
|
|
@@ -170,7 +174,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
170
174
|
uploading: false
|
|
171
175
|
});
|
|
172
176
|
|
|
173
|
-
|
|
177
|
+
_Message.show({
|
|
174
178
|
type: 'error',
|
|
175
179
|
title: '上传失败'
|
|
176
180
|
});
|
|
@@ -235,7 +239,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
235
239
|
|
|
236
240
|
_proto.renderUpload = function renderUpload() {
|
|
237
241
|
var files = this.state.files;
|
|
238
|
-
return /*#__PURE__*/React.createElement(
|
|
242
|
+
return /*#__PURE__*/React.createElement(_Upload.Dragger, {
|
|
239
243
|
ref: this.saveUploaderRef,
|
|
240
244
|
value: files,
|
|
241
245
|
action: UPLOAD_ICON_URL,
|
|
@@ -260,7 +264,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
260
264
|
className: "next-upload-drag"
|
|
261
265
|
}, /*#__PURE__*/React.createElement("p", {
|
|
262
266
|
className: "next-upload-drag-icon"
|
|
263
|
-
}, /*#__PURE__*/React.createElement(
|
|
267
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
264
268
|
type: "upload"
|
|
265
269
|
})), /*#__PURE__*/React.createElement("p", {
|
|
266
270
|
className: "next-upload-drag-text"
|
|
@@ -277,7 +281,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
277
281
|
var disabled = !files.length || !!files.filter(function (file) {
|
|
278
282
|
return file.state === 'error';
|
|
279
283
|
}).length;
|
|
280
|
-
return /*#__PURE__*/React.createElement(
|
|
284
|
+
return /*#__PURE__*/React.createElement(_Dialog, {
|
|
281
285
|
title: "\u4E0A\u4F20\u56FE\u6807",
|
|
282
286
|
visible: visible,
|
|
283
287
|
okProps: {
|