@riil-frontend/component-topology 2.5.1 → 2.5.5
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.html +1 -1
- package/build/index.js +21 -21
- package/es/components/Drawer/index.js +2 -2
- package/es/components/FormTable/index.js +16 -4
- package/es/components/MultiResourceDrawer/ResourceSelect.d.ts +2 -0
- package/es/components/MultiResourceDrawer/ResourceSelect.js +37 -0
- package/es/components/MultiResourceDrawer/Static.js +3 -12
- package/es/components/MultiResourceDrawer/index.js +3 -2
- package/es/components/ResourceSelect/ResourceSelectDrawer.module.scss +2 -0
- package/es/components/TemplateButton/index.js +4 -3
- package/es/components/TemplateButton/index.module.scss +8 -3
- package/es/components/TemplateGroup/index.js +8 -4
- package/es/components/TemplateGroup/index.module.scss +0 -4
- package/es/components/TemplateSelect/index.d.ts +2 -0
- package/es/components/TemplateSelect/index.js +32 -0
- package/es/components/TemplateSelect/index.module.scss +3 -0
- package/es/core/components/titlebar/TitleBar.module.scss +6 -2
- package/es/core/editor/components/settings/Settings.module.scss +11 -0
- package/es/core/editor/components/settings/common/tab/TabView.d.ts +1 -0
- package/es/core/editor/components/settings/common/tab/TabView.js +8 -0
- package/es/core/editor/components/settings/common/tab/TabView.module.scss +13 -0
- package/es/core/editor/components/settings/node/NodePropertyView.js +5 -1
- package/es/core/editor/components/settings/node/NodePropertyView.module.scss +3 -0
- package/es/core/editor/components/settings/text/TextPropertyView.js +5 -1
- package/es/core/editor/components/settings/view/ViewPropertyView.js +6 -2
- package/es/core/viewer/components/titlebar/TopoViewerTitleBar.js +4 -5
- package/es/core/viewer/components/titlebar/ViewerTools.js +1 -4
- package/es/style.js +0 -1
- package/lib/components/Drawer/index.js +2 -2
- package/lib/components/FormTable/index.js +18 -4
- package/lib/components/MultiResourceDrawer/ResourceSelect.d.ts +2 -0
- package/lib/components/MultiResourceDrawer/ResourceSelect.js +49 -0
- package/lib/components/MultiResourceDrawer/Static.js +3 -12
- package/lib/components/MultiResourceDrawer/index.js +3 -1
- package/lib/components/ResourceSelect/ResourceSelectDrawer.module.scss +2 -0
- package/lib/components/TemplateButton/index.js +4 -3
- package/lib/components/TemplateButton/index.module.scss +8 -3
- package/lib/components/TemplateGroup/index.js +9 -4
- package/lib/components/TemplateGroup/index.module.scss +0 -4
- package/lib/components/TemplateSelect/index.d.ts +2 -0
- package/lib/components/TemplateSelect/index.js +45 -0
- package/lib/components/TemplateSelect/index.module.scss +3 -0
- package/lib/core/components/titlebar/TitleBar.module.scss +6 -2
- package/lib/core/editor/components/settings/Settings.module.scss +11 -0
- package/lib/core/editor/components/settings/common/tab/TabView.d.ts +1 -0
- package/lib/core/editor/components/settings/common/tab/TabView.js +20 -0
- package/lib/core/editor/components/settings/common/tab/TabView.module.scss +13 -0
- package/lib/core/editor/components/settings/node/NodePropertyView.js +7 -1
- package/lib/core/editor/components/settings/node/NodePropertyView.module.scss +3 -0
- package/lib/core/editor/components/settings/text/TextPropertyView.js +5 -1
- package/lib/core/editor/components/settings/view/ViewPropertyView.js +6 -2
- package/lib/core/viewer/components/titlebar/TopoViewerTitleBar.js +7 -9
- package/lib/core/viewer/components/titlebar/ViewerTools.js +1 -5
- package/lib/style.js +0 -1
- package/package.json +6 -6
- package/CHANGELOG.md +0 -26
|
@@ -2,7 +2,7 @@ import _Table from "@alifd/next/lib/table";
|
|
|
2
2
|
import _Button from "@alifd/next/lib/button";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _Search from "@alifd/next/lib/search";
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
6
|
import { SchemaForm, SchemaMarkupField as Field } from '@formily/next';
|
|
7
7
|
import Pagination from '@riil-frontend/component-pager';
|
|
8
8
|
import MoreButtonsMenu from '@riil-frontend/component-more-buttons-menu';
|
|
@@ -11,6 +11,8 @@ import TableLayout from '@riil-frontend/component-table-layout';
|
|
|
11
11
|
import NoDataPage from '@riil-frontend/component-topology-utils/es/components/NoDataPage';
|
|
12
12
|
|
|
13
13
|
var FormTable = function FormTable(props) {
|
|
14
|
+
var _tableProps$filterPar;
|
|
15
|
+
|
|
14
16
|
var className = props.className,
|
|
15
17
|
children = props.children,
|
|
16
18
|
formProps = props.formProps,
|
|
@@ -23,6 +25,12 @@ var FormTable = function FormTable(props) {
|
|
|
23
25
|
showChecked = _props$showChecked === void 0 ? false : _props$showChecked,
|
|
24
26
|
_props$showPageSizeSe = props.showPageSizeSelector,
|
|
25
27
|
showPageSizeSelector = _props$showPageSizeSe === void 0 ? false : _props$showPageSizeSe;
|
|
28
|
+
|
|
29
|
+
var _useState = useState(false),
|
|
30
|
+
isSearching = _useState[0],
|
|
31
|
+
setIsSearching = _useState[1];
|
|
32
|
+
|
|
33
|
+
var isFilter = isSearching || ((_tableProps$filterPar = tableProps.filterParams.typeCode) === null || _tableProps$filterPar === void 0 ? void 0 : _tableProps$filterPar.selectedKeys.length);
|
|
26
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
35
|
className: "riil-table-common " + className,
|
|
28
36
|
style: {
|
|
@@ -43,8 +51,12 @@ var FormTable = function FormTable(props) {
|
|
|
43
51
|
"x-component-props": {
|
|
44
52
|
shape: 'simple',
|
|
45
53
|
placeholder: '请输入关键字',
|
|
46
|
-
onSearch: function onSearch() {
|
|
47
|
-
|
|
54
|
+
onSearch: function onSearch(val) {
|
|
55
|
+
setIsSearching(!!val);
|
|
56
|
+
formProps.actions.submit();
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
width: 200
|
|
48
60
|
}
|
|
49
61
|
}
|
|
50
62
|
}))), menu && /*#__PURE__*/React.createElement("div", {
|
|
@@ -75,7 +87,7 @@ var FormTable = function FormTable(props) {
|
|
|
75
87
|
table: /*#__PURE__*/React.createElement(_Table, _extends({}, tableProps, {
|
|
76
88
|
fixedHeader: true,
|
|
77
89
|
hasBorder: false,
|
|
78
|
-
emptyContent:
|
|
90
|
+
emptyContent: !isFilter ? '暂无数据' : '暂无搜索结果'
|
|
79
91
|
}), columns.map(function (column) {
|
|
80
92
|
return /*#__PURE__*/React.createElement(_Table.Column, _extends({}, column, {
|
|
81
93
|
key: column.dataIndex
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
|
|
2
|
+
import Static from "./Static";
|
|
3
|
+
|
|
4
|
+
function ResourceSelect(props, ref) {
|
|
5
|
+
var store = props.store,
|
|
6
|
+
initialData = props.initialData,
|
|
7
|
+
totalSelection = props.totalSelection;
|
|
8
|
+
var dynamicRes = initialData.dynamic,
|
|
9
|
+
staticRes = initialData["static"];
|
|
10
|
+
var staticRef = useRef();
|
|
11
|
+
useImperativeHandle(ref, function () {
|
|
12
|
+
return {
|
|
13
|
+
getData: function getData() {
|
|
14
|
+
var staticResData = staticRef.current.getSelectedData();
|
|
15
|
+
return {
|
|
16
|
+
dynamic: {
|
|
17
|
+
selected: false,
|
|
18
|
+
condition: null,
|
|
19
|
+
data: null
|
|
20
|
+
},
|
|
21
|
+
"static": {
|
|
22
|
+
selected: true,
|
|
23
|
+
data: staticResData
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Static, {
|
|
30
|
+
ref: staticRef,
|
|
31
|
+
store: store,
|
|
32
|
+
selectedKeys: staticRes.data,
|
|
33
|
+
totalSelection: totalSelection
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default /*#__PURE__*/React.forwardRef(ResourceSelect);
|
|
@@ -5,28 +5,19 @@ import styles from "./index.module.scss";
|
|
|
5
5
|
|
|
6
6
|
var Static = function Static(props, ref) {
|
|
7
7
|
var store = props.store,
|
|
8
|
-
checked = props.checked,
|
|
9
8
|
selectedKeys = props.selectedKeys,
|
|
10
|
-
totalSelection = props.totalSelection
|
|
11
|
-
onChange = props.onChange;
|
|
9
|
+
totalSelection = props.totalSelection;
|
|
12
10
|
var initialData = {
|
|
13
11
|
selected: selectedKeys,
|
|
14
12
|
total: totalSelection
|
|
15
13
|
};
|
|
16
|
-
return /*#__PURE__*/React.createElement(
|
|
17
|
-
title: "\u56FA\u5B9A\u8D44\u6E90",
|
|
18
|
-
checked: checked,
|
|
19
|
-
onCheckChange: onChange,
|
|
20
|
-
style: {
|
|
21
|
-
marginBottom: 0
|
|
22
|
-
}
|
|
23
|
-
}, /*#__PURE__*/React.createElement(ResourceList, {
|
|
14
|
+
return /*#__PURE__*/React.createElement(ResourceList, {
|
|
24
15
|
ref: ref,
|
|
25
16
|
store: store,
|
|
26
17
|
className: styles.table,
|
|
27
18
|
initialData: initialData,
|
|
28
19
|
selectionMode: "multiple"
|
|
29
|
-
})
|
|
20
|
+
});
|
|
30
21
|
};
|
|
31
22
|
|
|
32
23
|
export default /*#__PURE__*/React.forwardRef(Static);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
|
|
3
3
|
import Drawer from "../Drawer";
|
|
4
|
-
import Content from "./Content";
|
|
4
|
+
import Content from "./Content";
|
|
5
|
+
import ResourceSelect from "./ResourceSelect"; // import styles from './index.module.scss';
|
|
5
6
|
|
|
6
7
|
var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
7
8
|
var store = props.store,
|
|
@@ -43,7 +44,7 @@ var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
|
43
44
|
width: '80%'
|
|
44
45
|
},
|
|
45
46
|
buttons: ['确定', '取消']
|
|
46
|
-
}, initialData && /*#__PURE__*/React.createElement(
|
|
47
|
+
}, initialData && /*#__PURE__*/React.createElement(ResourceSelect, {
|
|
47
48
|
ref: contentRef,
|
|
48
49
|
store: store,
|
|
49
50
|
initialData: initialData,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["children", "icon", "id", "selected", "onSelect", "size"];
|
|
3
|
+
var _excluded = ["className", "children", "icon", "id", "selected", "onSelect", "size"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import Icon from "./Icon";
|
|
@@ -9,7 +9,8 @@ import styles from "./index.module.scss";
|
|
|
9
9
|
var TemplateButton = function TemplateButton(props) {
|
|
10
10
|
var _classnames;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var className = props.className,
|
|
13
|
+
children = props.children,
|
|
13
14
|
icon = props.icon,
|
|
14
15
|
id = props.id,
|
|
15
16
|
selected = props.selected,
|
|
@@ -23,7 +24,7 @@ var TemplateButton = function TemplateButton(props) {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: classnames(styles.card, (_classnames = {}, _classnames[styles.selected] = selected, _classnames[styles.sizeSmall] = size === 'small', _classnames)),
|
|
27
|
+
className: classnames(styles.card, className, (_classnames = {}, _classnames[styles.selected] = selected, _classnames[styles.sizeSmall] = size === 'small', _classnames[styles.sizeLarge] = size === 'large', _classnames)),
|
|
27
28
|
onClick: handleClick
|
|
28
29
|
}, /*#__PURE__*/React.createElement(Icon, _extends({
|
|
29
30
|
className: styles.icon,
|
|
@@ -6,18 +6,23 @@
|
|
|
6
6
|
justify-content: center;
|
|
7
7
|
align-items: center;
|
|
8
8
|
border: 1px solid #c4c6cf;
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
11
|
-
margin: 10px;
|
|
9
|
+
width: 120px;
|
|
10
|
+
height: 136px;
|
|
12
11
|
background-color: #fff;
|
|
13
12
|
text-align: center;
|
|
14
13
|
cursor: pointer;
|
|
15
14
|
vertical-align: middle;
|
|
15
|
+
margin-right: 12px;
|
|
16
16
|
|
|
17
17
|
&:hover, &:focus, &.selected {
|
|
18
18
|
border-color: $color-brand1-5;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
&.sizeNormal {
|
|
22
|
+
width: 120px;
|
|
23
|
+
height: 136px;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
&.sizeSmall {
|
|
22
27
|
width: 50px;
|
|
23
28
|
height: 50px;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _Box from "@alifd/next/lib/box";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import TemplateButton from "../TemplateButton";
|
|
@@ -7,17 +8,20 @@ var TemplateGroup = function TemplateGroup(props) {
|
|
|
7
8
|
var name = props.name,
|
|
8
9
|
_props$data = props.data,
|
|
9
10
|
data = _props$data === void 0 ? [] : _props$data,
|
|
10
|
-
size = props.size
|
|
11
|
+
size = props.size,
|
|
12
|
+
_props$itemProps = props.itemProps,
|
|
13
|
+
itemProps = _props$itemProps === void 0 ? {} : _props$itemProps;
|
|
11
14
|
return /*#__PURE__*/React.createElement(React.Fragment, null, name && /*#__PURE__*/React.createElement("div", {
|
|
12
15
|
className: styles.name
|
|
13
|
-
}, name), /*#__PURE__*/React.createElement(
|
|
14
|
-
|
|
16
|
+
}, name), /*#__PURE__*/React.createElement(_Box, {
|
|
17
|
+
direction: "row",
|
|
18
|
+
spacing: 32
|
|
15
19
|
}, data.map(function (item) {
|
|
16
20
|
return /*#__PURE__*/React.createElement(TemplateButton, _extends({
|
|
17
21
|
key: item.id
|
|
18
22
|
}, item, {
|
|
19
23
|
size: size
|
|
20
|
-
}), item.name);
|
|
24
|
+
}, itemProps), item.name);
|
|
21
25
|
})));
|
|
22
26
|
};
|
|
23
27
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _Tag from "@alifd/next/lib/tag";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import TemplateButton from "../TemplateButton";
|
|
4
|
+
import styles from "./index.module.scss";
|
|
5
|
+
import TemplateGroup from "../TemplateGroup";
|
|
6
|
+
var TagGroup = _Tag.Group,
|
|
7
|
+
SelectableTag = _Tag.Selectable;
|
|
8
|
+
|
|
9
|
+
var TemplateSelect = function TemplateSelect(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement(TemplateGroup, props); // const { data = [], size } = props;
|
|
11
|
+
// return (
|
|
12
|
+
// <TagGroup>
|
|
13
|
+
// {data.map((item) => (
|
|
14
|
+
// <SelectableTag
|
|
15
|
+
// key={item.name}
|
|
16
|
+
// checked={item.selected}
|
|
17
|
+
// onChange={() => {}}
|
|
18
|
+
// >
|
|
19
|
+
// <TemplateButton
|
|
20
|
+
// key={item.id}
|
|
21
|
+
// {...item}
|
|
22
|
+
// size={size}
|
|
23
|
+
// >
|
|
24
|
+
// {item.name}
|
|
25
|
+
// </TemplateButton>
|
|
26
|
+
// </SelectableTag>
|
|
27
|
+
// ))}
|
|
28
|
+
// </TagGroup>
|
|
29
|
+
// )
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default TemplateSelect;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
.titlebar {
|
|
2
2
|
display: flex;
|
|
3
|
-
padding: 16px;
|
|
4
3
|
|
|
5
4
|
.left {
|
|
5
|
+
display: flex;
|
|
6
6
|
flex: 1;
|
|
7
|
-
|
|
7
|
+
align-items: center;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.right {
|
|
11
11
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
&.titlebarViewMode {
|
|
15
|
+
padding: 16px 16px 16px 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
&.titlebarEditMode {
|
|
15
19
|
padding: 10px 16px;
|
|
16
20
|
}
|
|
@@ -20,11 +20,13 @@
|
|
|
20
20
|
width: 7px;
|
|
21
21
|
height: 7px;
|
|
22
22
|
}
|
|
23
|
+
|
|
23
24
|
::-webkit-scrollbar-thumb {
|
|
24
25
|
background-color: rgba(0, 0, 0, 0.2);
|
|
25
26
|
border-radius: 7px;
|
|
26
27
|
transition: all 0.25s ease-in-out;
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
::-webkit-scrollbar-thumb:hover {
|
|
29
31
|
background-color: rgba(0, 0, 0, 0.3);
|
|
30
32
|
}
|
|
@@ -33,14 +35,23 @@
|
|
|
33
35
|
.next-collapse-panel:not(:first-child) {
|
|
34
36
|
border-top: none;
|
|
35
37
|
}
|
|
38
|
+
|
|
36
39
|
.next-collapse-panel-title {
|
|
37
40
|
background: none;
|
|
38
41
|
font-size: 12px;
|
|
39
42
|
padding-bottom: 0;
|
|
40
43
|
padding-left: 32px;
|
|
44
|
+
|
|
45
|
+
& > .next-collapse-panel-icon {
|
|
46
|
+
left: 12px;
|
|
47
|
+
margin-top: 0;
|
|
48
|
+
margin-left: 0;
|
|
49
|
+
}
|
|
41
50
|
}
|
|
51
|
+
|
|
42
52
|
.next-collapse-panel-content {
|
|
43
53
|
padding-left: 32px;
|
|
54
|
+
padding-top: 8px;
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
57
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TabView(props: any): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _Tab from "@alifd/next/lib/tab";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import styles from "./TabView.module.scss";
|
|
4
|
+
export default function TabView(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement(_Tab, {
|
|
6
|
+
className: styles.tabs
|
|
7
|
+
}, props.children);
|
|
8
|
+
}
|
|
@@ -11,6 +11,8 @@ import textStyles from "../../../../common/text.module.scss";
|
|
|
11
11
|
import TopoTreeSelect from "./TopoTreeSelect";
|
|
12
12
|
import NodeIconSelect from "./NodeIconSelect";
|
|
13
13
|
import NodeRelateResourceButton from "./NodeRelateResourceButton";
|
|
14
|
+
import styles from "./NodePropertyView.module.scss";
|
|
15
|
+
import TabView from "../common/tab/TabView";
|
|
14
16
|
var Option = _Select.Option;
|
|
15
17
|
var CollapsePanel = _Collapse.Panel;
|
|
16
18
|
|
|
@@ -151,7 +153,9 @@ export default function NodePropertyView(props) {
|
|
|
151
153
|
|
|
152
154
|
|
|
153
155
|
var showRelateResource = !!values.tag || !values.tag && ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.enableRelateResource) !== false;
|
|
154
|
-
return /*#__PURE__*/React.createElement("div",
|
|
156
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: styles.NodePropertyView
|
|
158
|
+
}, showRelateResource ? /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
|
155
159
|
title: "\u6570\u636E",
|
|
156
160
|
key: "1"
|
|
157
161
|
}, renderData()), /*#__PURE__*/React.createElement(_Tab.Item, {
|
|
@@ -52,7 +52,11 @@ export default function TextPropertyView(props) {
|
|
|
52
52
|
useEffect(function () {
|
|
53
53
|
field.setValues(parseValues(values));
|
|
54
54
|
}, [values]);
|
|
55
|
-
return /*#__PURE__*/React.createElement("div",
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
style: {
|
|
57
|
+
paddingTop: 4
|
|
58
|
+
}
|
|
59
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
56
60
|
field: field,
|
|
57
61
|
labelAlign: "top"
|
|
58
62
|
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
@@ -77,7 +77,11 @@ export default function ViewPropertyView(props) {
|
|
|
77
77
|
useEffect(function () {
|
|
78
78
|
field.setValues(parseValues(values));
|
|
79
79
|
}, [values]);
|
|
80
|
-
return /*#__PURE__*/React.createElement("div",
|
|
80
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
style: {
|
|
82
|
+
paddingTop: 4
|
|
83
|
+
}
|
|
84
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
81
85
|
field: field,
|
|
82
86
|
labelAlign: "top"
|
|
83
87
|
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
@@ -101,5 +105,5 @@ export default function ViewPropertyView(props) {
|
|
|
101
105
|
title: "\u56FE\u7247"
|
|
102
106
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
103
107
|
label: "\u56FE\u7247\u5C3A\u5BF8"
|
|
104
|
-
}
|
|
108
|
+
}))))));
|
|
105
109
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import _MenuButton from "@alifd/next/lib/menu-button";
|
|
2
1
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
3
|
import ViewerTools from "./ViewerTools";
|
|
4
|
-
import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
|
5
4
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
6
|
-
|
|
5
|
+
import SearchWidget from "./widgets/SearchWidget";
|
|
7
6
|
export default function TopoViewerTitleBar(props) {
|
|
8
7
|
var topo = props.topo,
|
|
9
8
|
showEditButton = props.showEditButton,
|
|
10
9
|
onEnterEdit = props.onEnterEdit,
|
|
11
10
|
children = props.children;
|
|
12
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
-
className: styles.titlebar
|
|
12
|
+
className: classnames(styles.titlebar, styles.titlebarViewMode)
|
|
14
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
15
14
|
className: styles.left
|
|
16
|
-
}, children || /*#__PURE__*/React.createElement(
|
|
15
|
+
}, children || /*#__PURE__*/React.createElement(SearchWidget, {
|
|
17
16
|
topo: topo
|
|
18
17
|
})), /*#__PURE__*/React.createElement("div", {
|
|
19
18
|
className: styles.right
|
|
@@ -4,16 +4,13 @@ import _Button from "@alifd/next/lib/button";
|
|
|
4
4
|
import _Icon from "@alifd/next/lib/icon";
|
|
5
5
|
import _extends from "@babel/runtime/helpers/extends";
|
|
6
6
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
7
|
-
import SearchWidget from "./widgets/SearchWidget";
|
|
8
7
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
9
8
|
import EditButton from "./widgets/EditButton";
|
|
10
9
|
export default function ViewerTools(props) {
|
|
11
10
|
var topo = props.topo,
|
|
12
11
|
_props$showEditButton = props.showEditButton,
|
|
13
12
|
showEditButton = _props$showEditButton === void 0 ? true : _props$showEditButton;
|
|
14
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
15
|
-
topo: topo
|
|
16
|
-
}), showEditButton && /*#__PURE__*/React.createElement(EditButton, _extends({
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", null, showEditButton && /*#__PURE__*/React.createElement(EditButton, _extends({
|
|
17
14
|
topo: topo
|
|
18
15
|
}, props)), /*#__PURE__*/React.createElement(_Dropdown, {
|
|
19
16
|
trigger: /*#__PURE__*/React.createElement(_Button, {
|
package/es/style.js
CHANGED
|
@@ -18,7 +18,6 @@ import '@alifd/next/lib/select/style';
|
|
|
18
18
|
import '@alifd/next/lib/balloon/style';
|
|
19
19
|
import '@alifd/next/lib/grid/style';
|
|
20
20
|
import '@alifd/next/lib/box/style';
|
|
21
|
-
import '@alifd/next/lib/menu-button/style';
|
|
22
21
|
import '@alifd/next/lib/dropdown/style';
|
|
23
22
|
import '@alifd/next/lib/menu/style';
|
|
24
23
|
import '@alifd/next/lib/tab/style';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
exports.__esModule = true;
|
|
@@ -13,7 +15,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
15
|
|
|
14
16
|
var _search = _interopRequireDefault(require("@alifd/next/lib/search"));
|
|
15
17
|
|
|
16
|
-
var _react =
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
19
|
|
|
18
20
|
var _next = require("@formily/next");
|
|
19
21
|
|
|
@@ -28,6 +30,8 @@ var _componentTableLayout = _interopRequireDefault(require("@riil-frontend/compo
|
|
|
28
30
|
var _NoDataPage = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/components/NoDataPage"));
|
|
29
31
|
|
|
30
32
|
var FormTable = function FormTable(props) {
|
|
33
|
+
var _tableProps$filterPar;
|
|
34
|
+
|
|
31
35
|
var className = props.className,
|
|
32
36
|
children = props.children,
|
|
33
37
|
formProps = props.formProps,
|
|
@@ -40,6 +44,12 @@ var FormTable = function FormTable(props) {
|
|
|
40
44
|
showChecked = _props$showChecked === void 0 ? false : _props$showChecked,
|
|
41
45
|
_props$showPageSizeSe = props.showPageSizeSelector,
|
|
42
46
|
showPageSizeSelector = _props$showPageSizeSe === void 0 ? false : _props$showPageSizeSe;
|
|
47
|
+
|
|
48
|
+
var _useState = (0, _react.useState)(false),
|
|
49
|
+
isSearching = _useState[0],
|
|
50
|
+
setIsSearching = _useState[1];
|
|
51
|
+
|
|
52
|
+
var isFilter = isSearching || ((_tableProps$filterPar = tableProps.filterParams.typeCode) === null || _tableProps$filterPar === void 0 ? void 0 : _tableProps$filterPar.selectedKeys.length);
|
|
43
53
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
44
54
|
className: "riil-table-common " + className,
|
|
45
55
|
style: {
|
|
@@ -60,8 +70,12 @@ var FormTable = function FormTable(props) {
|
|
|
60
70
|
"x-component-props": {
|
|
61
71
|
shape: 'simple',
|
|
62
72
|
placeholder: '请输入关键字',
|
|
63
|
-
onSearch: function onSearch() {
|
|
64
|
-
|
|
73
|
+
onSearch: function onSearch(val) {
|
|
74
|
+
setIsSearching(!!val);
|
|
75
|
+
formProps.actions.submit();
|
|
76
|
+
},
|
|
77
|
+
style: {
|
|
78
|
+
width: 200
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
81
|
}))), menu && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -92,7 +106,7 @@ var FormTable = function FormTable(props) {
|
|
|
92
106
|
table: /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, tableProps, {
|
|
93
107
|
fixedHeader: true,
|
|
94
108
|
hasBorder: false,
|
|
95
|
-
emptyContent:
|
|
109
|
+
emptyContent: !isFilter ? '暂无数据' : '暂无搜索结果'
|
|
96
110
|
}), columns.map(function (column) {
|
|
97
111
|
return /*#__PURE__*/_react["default"].createElement(_table["default"].Column, (0, _extends2["default"])({}, column, {
|
|
98
112
|
key: column.dataIndex
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
+
|
|
7
|
+
exports.__esModule = true;
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Static = _interopRequireDefault(require("./Static"));
|
|
13
|
+
|
|
14
|
+
function ResourceSelect(props, ref) {
|
|
15
|
+
var store = props.store,
|
|
16
|
+
initialData = props.initialData,
|
|
17
|
+
totalSelection = props.totalSelection;
|
|
18
|
+
var dynamicRes = initialData.dynamic,
|
|
19
|
+
staticRes = initialData["static"];
|
|
20
|
+
var staticRef = (0, _react.useRef)();
|
|
21
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
22
|
+
return {
|
|
23
|
+
getData: function getData() {
|
|
24
|
+
var staticResData = staticRef.current.getSelectedData();
|
|
25
|
+
return {
|
|
26
|
+
dynamic: {
|
|
27
|
+
selected: false,
|
|
28
|
+
condition: null,
|
|
29
|
+
data: null
|
|
30
|
+
},
|
|
31
|
+
"static": {
|
|
32
|
+
selected: true,
|
|
33
|
+
data: staticResData
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Static["default"], {
|
|
40
|
+
ref: staticRef,
|
|
41
|
+
store: store,
|
|
42
|
+
selectedKeys: staticRes.data,
|
|
43
|
+
totalSelection: totalSelection
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var _default = /*#__PURE__*/_react["default"].forwardRef(ResourceSelect);
|
|
48
|
+
|
|
49
|
+
exports["default"] = _default;
|