ztxkui 4.2.18-102 → 4.2.18-104
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/dist/UI/Form/index.js +1 -0
- package/dist/UI/InputNumber/index.d.ts +3 -0
- package/dist/UI/InputNumber/index.js +45 -0
- package/dist/UI/TreeSelect/index.d.ts +3 -0
- package/dist/UI/TreeSelect/index.js +120 -0
- package/dist/UI/index.js +9 -1
- package/dist/components/Button/button.d.ts +6 -0
- package/dist/components/Button/button.js +8 -2
- package/dist/components/EnhanceTreeSelect/index.d.ts +5 -1
- package/dist/components/EnhanceTreeSelect/index.js +47 -3
- package/dist/components/Form/form.d.ts +11 -1
- package/dist/components/Form/form.js +5 -3
- package/dist/components/ProForm/index.d.ts +3 -0
- package/dist/components/ProForm/index.js +78 -11
- package/dist/components/ProForm/interface.d.ts +31 -0
- package/dist/components/ProForm/item.js +2 -1
- package/dist/components/ProForm/record-common-list.d.ts +18 -0
- package/dist/components/ProForm/record-common-list.js +83 -0
- package/dist/components/ProForm/search-drawer.d.ts +2 -0
- package/dist/components/ProForm/search-drawer.js +48 -13
- package/dist/components/ProForm/setting.js +6 -7
- package/dist/components/ProForm/useCommonSearch.d.ts +35 -0
- package/dist/components/ProForm/useCommonSearch.js +352 -0
- package/dist/components/Table/table-dynamic.d.ts +1 -0
- package/dist/components/Table/table-dynamic.js +191 -30
- package/dist/components/Table/table.js +1 -1
- package/dist/components/TreeSelect/index.d.ts +4 -0
- package/dist/components/TreeSelect/index.js +61 -2
- package/dist/components/ZtIcon/index.js +2 -0
- package/dist/components/business/SearchContainer/hooks/useDynamic.d.ts +2 -1
- package/dist/components/business/SearchContainer/hooks/useDynamic.js +6 -3
- package/dist/components/business/SearchContainer/hooks/useToggle.d.ts +1 -1
- package/dist/components/business/SearchContainer/hooks/useToggle.js +28 -10
- package/dist/components/business/SearchContainer/record-common-item.js +3 -2
- package/dist/components/business/SearchContainer/record-common-list.js +41 -10
- package/dist/components/business/SearchContainer/search-container.d.ts +9 -0
- package/dist/components/business/SearchContainer/search-container.js +53 -19
- package/dist/components/business/SearchContainer/search-drawer.js +38 -10
- package/dist/components/business/SearchContainer/search-left.d.ts +7 -0
- package/dist/components/business/SearchContainer/search-left.js +103 -74
- package/dist/components/business/SearchContainer/search-right.d.ts +4 -0
- package/dist/components/business/SearchContainer/search-right.js +53 -15
- package/dist/components/business/SearchContainer/useRecordCommonInit.d.ts +4 -1
- package/dist/components/business/SearchContainer/useRecordCommonInit.js +37 -21
- package/dist/components/business/SearchContainer/useRecordCommonSearch.d.ts +1 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearch.js +21 -16
- package/dist/components/business/SearchContainer/useRecordCommonSearchContext.d.ts +8 -2
- package/dist/components/business/SearchContainer/useTemplate.d.ts +20 -0
- package/dist/components/business/SearchContainer/useTemplate.js +347 -0
- package/dist/components/utils/ZtxkContext.d.ts +8 -0
- package/dist/components/utils/ZtxkContext.js +2 -0
- package/dist/components/utils/index.d.ts +9 -0
- package/dist/components/utils/index.js +11 -0
- package/dist/components/utils/useBaseContext.d.ts +14 -1
- package/dist/components/utils/useBaseContext.js +23 -2
- package/dist/index.css +326 -63
- package/dist/index.css.map +1 -1
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/UI/Form/index.js
CHANGED
|
@@ -313,6 +313,7 @@ function Home() {
|
|
|
313
313
|
React.createElement(ProForm, { form: form, items: items, initialValues: initialValues, showDynamic: true, showDynamicKey: "my-coco", configInfo: configInfoMemo,
|
|
314
314
|
// outsideState={outsideState}
|
|
315
315
|
rightWrapVisible: true, onSearchHandle: searchHandle, onResetHandle: resetHandle }),
|
|
316
|
+
React.createElement(ProForm, { form: form, items: items }),
|
|
316
317
|
React.createElement(Button, { onClick: function () {
|
|
317
318
|
setState(state + 1);
|
|
318
319
|
console.log(form.getFieldsValue());
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { InputNumber } from '../../index';
|
|
3
|
+
var sectionStyle = {
|
|
4
|
+
marginBottom: 24,
|
|
5
|
+
};
|
|
6
|
+
var labelStyle = {
|
|
7
|
+
display: 'block',
|
|
8
|
+
marginBottom: 8,
|
|
9
|
+
fontSize: 14,
|
|
10
|
+
fontWeight: 600,
|
|
11
|
+
color: '#333',
|
|
12
|
+
};
|
|
13
|
+
var InputNumberDemo = function () {
|
|
14
|
+
var _a = useState(10), basicValue = _a[0], setBasicValue = _a[1];
|
|
15
|
+
var _b = useState(3.14), precisionValue = _b[0], setPrecisionValue = _b[1];
|
|
16
|
+
var _c = useState(), rangeValue = _c[0], setRangeValue = _c[1];
|
|
17
|
+
return (React.createElement("div", { style: { padding: '20px', maxWidth: 500 } },
|
|
18
|
+
React.createElement("h2", null, "\u6570\u5B57\u8F93\u5165\u6846"),
|
|
19
|
+
React.createElement("div", { style: sectionStyle },
|
|
20
|
+
React.createElement("label", { style: labelStyle }, "\u57FA\u7840\u7528\u6CD5"),
|
|
21
|
+
React.createElement(InputNumber, { formatterType: "currency", value: basicValue, onChange: function (v) { return setBasicValue(v); } }),
|
|
22
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
23
|
+
"\u5F53\u524D\u503C\uFF1A",
|
|
24
|
+
basicValue)),
|
|
25
|
+
React.createElement("div", { style: sectionStyle },
|
|
26
|
+
React.createElement("label", { style: labelStyle }, "\u7CBE\u5EA6\uFF082\u4F4D\u5C0F\u6570\uFF09"),
|
|
27
|
+
React.createElement(InputNumber, { value: precisionValue, onChange: function (v) { return setPrecisionValue(v); }, precision: 2, step: 0.1 }),
|
|
28
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
29
|
+
"\u5F53\u524D\u503C\uFF1A",
|
|
30
|
+
precisionValue)),
|
|
31
|
+
React.createElement("div", { style: sectionStyle },
|
|
32
|
+
React.createElement("label", { style: labelStyle }, "\u8303\u56F4\u9650\u5236\uFF081~100\uFF09"),
|
|
33
|
+
React.createElement(InputNumber, { value: rangeValue, onChange: function (v) { return setRangeValue(v); }, min: 1, max: 100, placeholder: "\u8BF7\u8F93\u5165 1-100 \u7684\u6570\u5B57" }),
|
|
34
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
35
|
+
"\u5F53\u524D\u503C\uFF1A", rangeValue !== null && rangeValue !== void 0 ? rangeValue : '空')),
|
|
36
|
+
React.createElement("div", { style: sectionStyle },
|
|
37
|
+
React.createElement("label", { style: labelStyle }, "\u7981\u7528\u72B6\u6001"),
|
|
38
|
+
React.createElement(InputNumber, { value: 50, disabled: true })),
|
|
39
|
+
React.createElement("div", { style: sectionStyle },
|
|
40
|
+
React.createElement("label", { style: labelStyle }, "\u5E26\u524D\u540E\u7F00"),
|
|
41
|
+
React.createElement(InputNumber, { defaultValue: 100, formatter: function (value) {
|
|
42
|
+
return ("\u00A5 " + value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
43
|
+
}, parser: function (value) { return value.replace(/¥\s?|(,*)/g, ''); } }))));
|
|
44
|
+
};
|
|
45
|
+
export default InputNumberDemo;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { TreeSelect, Button } from '../../index';
|
|
3
|
+
var treeData = [
|
|
4
|
+
{
|
|
5
|
+
title: '总公司',
|
|
6
|
+
value: '0-0',
|
|
7
|
+
key: '0-0',
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
title: '研发部',
|
|
11
|
+
value: '0-0-1',
|
|
12
|
+
key: '0-0-1',
|
|
13
|
+
children: [
|
|
14
|
+
{ title: '前端组', value: '0-0-1-1', key: '0-0-1-1' },
|
|
15
|
+
{ title: '后端组', value: '0-0-1-2', key: '0-0-1-2' },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: '产品部',
|
|
20
|
+
value: '0-0-2',
|
|
21
|
+
key: '0-0-2',
|
|
22
|
+
children: [
|
|
23
|
+
{ title: '产品设计', value: '0-0-2-1', key: '0-0-2-1' },
|
|
24
|
+
{ title: 'UI设计', value: '0-0-2-2', key: '0-0-2-2' },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '运营部',
|
|
29
|
+
value: '0-0-3',
|
|
30
|
+
key: '0-0-3',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: '分公司',
|
|
36
|
+
value: '0-1',
|
|
37
|
+
key: '0-1',
|
|
38
|
+
children: [
|
|
39
|
+
{ title: '北京分公司', value: '0-1-1', key: '0-1-1' },
|
|
40
|
+
{ title: '上海分公司', value: '0-1-2', key: '0-1-2' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
// 自定义字段名的数据(label / id 而非 title / value)
|
|
45
|
+
var customFieldData = [
|
|
46
|
+
{
|
|
47
|
+
label: '类别A',
|
|
48
|
+
id: 'a',
|
|
49
|
+
key: 'a',
|
|
50
|
+
children: [
|
|
51
|
+
{ label: '选项A1', id: 'a1', key: 'a1' },
|
|
52
|
+
{ label: '选项A2', id: 'a2', key: 'a2' },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: '类别B',
|
|
57
|
+
id: 'b',
|
|
58
|
+
key: 'b',
|
|
59
|
+
children: [{ label: '选项B1', id: 'b1', key: 'b1' }],
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
var sectionStyle = {
|
|
63
|
+
marginBottom: 24,
|
|
64
|
+
};
|
|
65
|
+
var labelStyle = {
|
|
66
|
+
display: 'block',
|
|
67
|
+
marginBottom: 8,
|
|
68
|
+
fontSize: 14,
|
|
69
|
+
fontWeight: 600,
|
|
70
|
+
color: '#333',
|
|
71
|
+
};
|
|
72
|
+
var formatValue = function (val) {
|
|
73
|
+
if (val === undefined || val === null)
|
|
74
|
+
return '无';
|
|
75
|
+
if (Array.isArray(val))
|
|
76
|
+
return val.filter(function (v) { return v !== ''; }).join(', ') || '无';
|
|
77
|
+
return String(val);
|
|
78
|
+
};
|
|
79
|
+
var TreeSelectDemo = function () {
|
|
80
|
+
var _a = useState(), singleValue = _a[0], setSingleValue = _a[1];
|
|
81
|
+
var _b = useState(), multiValue = _b[0], setMultiValue = _b[1];
|
|
82
|
+
var _c = useState(), showAllValue = _c[0], setShowAllValue = _c[1];
|
|
83
|
+
var _d = useState(), customValue = _d[0], setCustomValue = _d[1];
|
|
84
|
+
return (React.createElement("div", { style: { padding: '20px', maxWidth: 500 } },
|
|
85
|
+
React.createElement("h2", null, "\u6811\u4E0B\u62C9\u6846\u9009\u62E9"),
|
|
86
|
+
React.createElement("div", { style: sectionStyle },
|
|
87
|
+
React.createElement("label", { style: labelStyle }, "1. \u57FA\u7840\u5355\u9009"),
|
|
88
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9", treeData: treeData, value: singleValue, onChange: setSingleValue, treeDefaultExpandAll: true, allowClear: true }),
|
|
89
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
90
|
+
"\u9009\u4E2D\u503C\uFF1A",
|
|
91
|
+
formatValue(singleValue))),
|
|
92
|
+
React.createElement("div", { style: sectionStyle },
|
|
93
|
+
React.createElement("label", { style: labelStyle }, "2. \u591A\u9009\uFF08showAll \u9ED8\u8BA4\u5F00\u542F\uFF0C\u5168\u90E8\u4E0E\u5176\u4ED6\u4E92\u65A5\uFF09"),
|
|
94
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9", treeData: treeData, value: multiValue, onChange: setMultiValue, treeCheckable: true, showCheckedStrategy: TreeSelect.SHOW_CHILD, treeDefaultExpandAll: true, allowClear: true }),
|
|
95
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
96
|
+
"\u9009\u4E2D\u503C\uFF1A",
|
|
97
|
+
formatValue(multiValue)),
|
|
98
|
+
React.createElement(Button, { type: "default", size: "small", style: { marginTop: 8 }, onClick: function () { return setMultiValue(['']); } }, "\u8BBE\u7F6E\u4E3A\u300C\u5168\u90E8\u300D")),
|
|
99
|
+
React.createElement("div", { style: sectionStyle },
|
|
100
|
+
React.createElement("label", { style: labelStyle }, "3. \u591A\u9009\uFF08showAll=false\uFF0C\u4E0D\u663E\u793A\u5168\u90E8\uFF09"),
|
|
101
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9", treeData: treeData, value: showAllValue, onChange: setShowAllValue, treeCheckable: true, showCheckedStrategy: TreeSelect.SHOW_CHILD, treeDefaultExpandAll: true, allowClear: true, showAll: false }),
|
|
102
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
103
|
+
"\u9009\u4E2D\u503C\uFF1A",
|
|
104
|
+
formatValue(showAllValue))),
|
|
105
|
+
React.createElement("div", { style: sectionStyle },
|
|
106
|
+
React.createElement("label", { style: labelStyle }, "4. \u591A\u9009 + \u81EA\u5B9A\u4E49\u5B57\u6BB5\u540D\uFF08label/id\uFF09+ showAll \u5168\u90E8\u4E92\u65A5"),
|
|
107
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9", treeData: customFieldData, fieldNames: { label: 'label', value: 'id', children: 'children' }, value: customValue, onChange: setCustomValue, treeCheckable: true, showCheckedStrategy: TreeSelect.SHOW_CHILD, treeDefaultExpandAll: true, allowClear: true }),
|
|
108
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } },
|
|
109
|
+
"\u9009\u4E2D\u503C\uFF1A",
|
|
110
|
+
formatValue(customValue)),
|
|
111
|
+
React.createElement("div", { style: { marginTop: 2, fontSize: 12, color: '#999' } }, "\u6570\u636E\u4F7F\u7528 label/id \u5B57\u6BB5\uFF0C\u901A\u8FC7 fieldNames \u6620\u5C04")),
|
|
112
|
+
React.createElement("div", { style: sectionStyle },
|
|
113
|
+
React.createElement("label", { style: labelStyle }, "5. \u652F\u6301\u641C\u7D22\uFF08\u5355\u9009\uFF09"),
|
|
114
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22", treeData: treeData, showSearch: true, treeDefaultExpandAll: true, allowClear: true })),
|
|
115
|
+
React.createElement("div", { style: sectionStyle },
|
|
116
|
+
React.createElement("label", { style: labelStyle }, "6. \u5355\u9009 + showAll\uFF08\u591A\u9009\u6A21\u5F0F\u4E0B\u9ED8\u8BA4\u5F00\u542F\uFF09"),
|
|
117
|
+
React.createElement(TreeSelect, { style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9", treeData: treeData, showAll: true, treeDefaultExpandAll: true, allowClear: true }),
|
|
118
|
+
React.createElement("div", { style: { marginTop: 4, fontSize: 12, color: '#999' } }, "\u9009\u4E2D\u300C\u5168\u90E8\u300D\u65F6\u503C\u4E3A\u7A7A\u5B57\u7B26\u4E32"))));
|
|
119
|
+
};
|
|
120
|
+
export default TreeSelectDemo;
|
package/dist/UI/index.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Link, Switch, Route } from 'react-router-dom';
|
|
3
3
|
import Form from './Form';
|
|
4
|
+
import TreeSelectDemo from './TreeSelect';
|
|
5
|
+
import InputNumberDemo from './InputNumber';
|
|
4
6
|
export default function UIComponent() {
|
|
5
7
|
return (React.createElement("div", { style: { padding: '10px' } },
|
|
6
8
|
React.createElement(Link, { to: "/ui/form", style: { marginRight: '10px' } }, "\u8868\u5355"),
|
|
9
|
+
React.createElement(Link, { to: "/ui/tree-select", style: { marginRight: '10px' } }, "\u6811\u4E0B\u62C9\u6846"),
|
|
10
|
+
React.createElement(Link, { to: "/ui/input-number", style: { marginRight: '10px' } }, "\u6570\u5B57\u8F93\u5165\u6846"),
|
|
7
11
|
React.createElement(Switch, null,
|
|
8
12
|
React.createElement(Route, { path: "/ui/form" },
|
|
9
|
-
React.createElement(Form, null))
|
|
13
|
+
React.createElement(Form, null)),
|
|
14
|
+
React.createElement(Route, { path: "/ui/tree-select" },
|
|
15
|
+
React.createElement(TreeSelectDemo, null)),
|
|
16
|
+
React.createElement(Route, { path: "/ui/input-number" },
|
|
17
|
+
React.createElement(InputNumberDemo, null)))));
|
|
10
18
|
}
|
|
@@ -8,6 +8,12 @@ export interface IProps extends ButtonProps {
|
|
|
8
8
|
showCopy?: boolean | string;
|
|
9
9
|
/** copy容器样式 */
|
|
10
10
|
copyContainerStyle?: any;
|
|
11
|
+
/** 紧凑布局 */
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
/** 是否按UI周查样式调整,可覆盖全局配置 */
|
|
14
|
+
isUIWeeklyReview?: boolean;
|
|
15
|
+
/** 按钮旁显示Tooltip提示图标 */
|
|
16
|
+
toolTip?: React.ReactNode;
|
|
11
17
|
}
|
|
12
18
|
declare const Button: React.FC<IProps>;
|
|
13
19
|
export default Button;
|
|
@@ -24,17 +24,23 @@ import i18next from 'ztxkutils/dist/i18next';
|
|
|
24
24
|
import React, { useRef } from 'react';
|
|
25
25
|
import { Button as AntButton } from 'antd';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
|
+
import useBaseContext from '../utils/useBaseContext';
|
|
28
|
+
import { getFinalValue } from '../utils';
|
|
27
29
|
var maxClickTime = 1000;
|
|
28
30
|
var Button = function (props) {
|
|
29
31
|
var _a;
|
|
30
|
-
var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, showCopy = props.showCopy, copyContainerStyle = props.copyContainerStyle, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle"]);
|
|
32
|
+
var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, showCopy = props.showCopy, copyContainerStyle = props.copyContainerStyle, compact = props.compact, componentUIWeeklyReview = props.isUIWeeklyReview, toolTip = props.toolTip, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle", "compact", "isUIWeeklyReview", "toolTip"]);
|
|
33
|
+
var contextUIWeeklyReview = useBaseContext().isUIWeeklyReview;
|
|
34
|
+
var isUIWeeklyReviewBool = getFinalValue(contextUIWeeklyReview, componentUIWeeklyReview);
|
|
35
|
+
var finalType = isUIWeeklyReviewBool ? type || 'default' : type;
|
|
31
36
|
var startTimeRef = useRef(0);
|
|
32
37
|
var btnRef = useRef();
|
|
33
38
|
var classes = classNames('zt-btn', className, (_a = {},
|
|
34
|
-
_a["zt-btn-" +
|
|
39
|
+
_a["zt-btn-" + finalType] = finalType,
|
|
35
40
|
_a["zt-btn-disabled"] = disabled,
|
|
36
41
|
_a["zt-btn-" + size] = size,
|
|
37
42
|
_a["zt-btn-dangerous"] = danger,
|
|
43
|
+
_a["zt-button--compact"] = compact,
|
|
38
44
|
_a));
|
|
39
45
|
var myOnClick = function (event) {
|
|
40
46
|
if (agentClick) {
|
|
@@ -42,12 +42,16 @@ export interface IProps<T> extends Omit<TreeSelectProps<T>, 'onChange'> {
|
|
|
42
42
|
* 数据发生改变时触发
|
|
43
43
|
*/
|
|
44
44
|
onChange?: any;
|
|
45
|
+
/**
|
|
46
|
+
* 是否显示全部,全部的value为空字符串
|
|
47
|
+
*/
|
|
48
|
+
showAll?: boolean;
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
51
|
* 增强下拉树
|
|
48
52
|
* 添加远程搜索
|
|
49
53
|
*/
|
|
50
|
-
declare function EnhanceTreeSelect<VT extends SelectValue = SelectValue>({ treeData: outTreeData, defaultTreeData, params, url, method, request, asyncLoadChildren, asyncLoadChildrenKey, transformData, treeDataSimpleMode, onCompleted, ...restProps }: IProps<VT>): JSX.Element;
|
|
54
|
+
declare function EnhanceTreeSelect<VT extends SelectValue = SelectValue>({ treeData: outTreeData, defaultTreeData, params, url, method, request, asyncLoadChildren, asyncLoadChildrenKey, transformData, treeDataSimpleMode, onCompleted, showAll, onChange, fieldNames, ...restProps }: IProps<VT>): JSX.Element;
|
|
51
55
|
declare namespace EnhanceTreeSelect {
|
|
52
56
|
var SHOW_PARENT: "SHOW_PARENT";
|
|
53
57
|
}
|
|
@@ -20,6 +20,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
24
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
25
|
+
to[j] = from[i];
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
23
28
|
import i18next from 'ztxkutils/dist/i18next';
|
|
24
29
|
import React, { useEffect, useCallback, useRef, useState } from 'react';
|
|
25
30
|
import { TreeSelect } from 'antd';
|
|
@@ -47,7 +52,7 @@ function getData(request, options) {
|
|
|
47
52
|
* 添加远程搜索
|
|
48
53
|
*/
|
|
49
54
|
function EnhanceTreeSelect(_a) {
|
|
50
|
-
var outTreeData = _a.treeData, defaultTreeData = _a.defaultTreeData, params = _a.params, url = _a.url, _b = _a.method, method = _b === void 0 ? 'GET' : _b, request = _a.request, asyncLoadChildren = _a.asyncLoadChildren, _c = _a.asyncLoadChildrenKey, asyncLoadChildrenKey = _c === void 0 ? 'parentId' : _c, transformData = _a.transformData, treeDataSimpleMode = _a.treeDataSimpleMode, onCompleted = _a.onCompleted, restProps = __rest(_a, ["treeData", "defaultTreeData", "params", "url", "method", "request", "asyncLoadChildren", "asyncLoadChildrenKey", "transformData", "treeDataSimpleMode", "onCompleted"]);
|
|
55
|
+
var outTreeData = _a.treeData, defaultTreeData = _a.defaultTreeData, params = _a.params, url = _a.url, _b = _a.method, method = _b === void 0 ? 'GET' : _b, request = _a.request, asyncLoadChildren = _a.asyncLoadChildren, _c = _a.asyncLoadChildrenKey, asyncLoadChildrenKey = _c === void 0 ? 'parentId' : _c, transformData = _a.transformData, treeDataSimpleMode = _a.treeDataSimpleMode, onCompleted = _a.onCompleted, showAll = _a.showAll, onChange = _a.onChange, fieldNames = _a.fieldNames, restProps = __rest(_a, ["treeData", "defaultTreeData", "params", "url", "method", "request", "asyncLoadChildren", "asyncLoadChildrenKey", "transformData", "treeDataSimpleMode", "onCompleted", "showAll", "onChange", "fieldNames"]);
|
|
51
56
|
/**
|
|
52
57
|
* treeData 为当前组件使用的数据源
|
|
53
58
|
* 这样做的目的,是因为如果做远程搜索和搜索方法组件内部处理时
|
|
@@ -134,9 +139,48 @@ function EnhanceTreeSelect(_a) {
|
|
|
134
139
|
var onSearch = function (value) {
|
|
135
140
|
setSearchValue(value);
|
|
136
141
|
};
|
|
137
|
-
|
|
142
|
+
// 多选模式下,showAll 未显式传值时默认为 true
|
|
143
|
+
var isShowAll = showAll !== undefined ? showAll : !!restProps.treeCheckable;
|
|
144
|
+
// 根据 fieldNames 配置确定「全部」节点的字段名
|
|
145
|
+
var labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'title';
|
|
146
|
+
var valueKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value';
|
|
147
|
+
// 多选模式下,「全部」与其他选项互斥(用 ref 追踪前值)
|
|
148
|
+
var prevValueRef = useRef(restProps.value);
|
|
149
|
+
useEffect(function () {
|
|
150
|
+
prevValueRef.current = restProps.value;
|
|
151
|
+
}, [restProps.value]);
|
|
152
|
+
var handleChange = function (value, labelList, extra) {
|
|
153
|
+
if (isShowAll && restProps.treeCheckable && Array.isArray(value)) {
|
|
154
|
+
var prev = Array.isArray(prevValueRef.current)
|
|
155
|
+
? prevValueRef.current
|
|
156
|
+
: [];
|
|
157
|
+
var prevHasAll = prev.includes('');
|
|
158
|
+
var nowHasAll = value.includes('');
|
|
159
|
+
var nowHasOther = value.some(function (v) { return v !== ''; });
|
|
160
|
+
if (nowHasAll && !prevHasAll) {
|
|
161
|
+
value = [''];
|
|
162
|
+
}
|
|
163
|
+
else if (prevHasAll && nowHasOther) {
|
|
164
|
+
value = value.filter(function (v) { return v !== ''; });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
prevValueRef.current = value;
|
|
168
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value, labelList, extra);
|
|
169
|
+
};
|
|
170
|
+
// 合并最终树数据,isShowAll 时在顶部插入「全部」节点
|
|
171
|
+
var finalTreeData = (function () {
|
|
172
|
+
var _a;
|
|
173
|
+
var data = Array.isArray(defaultTreeData)
|
|
138
174
|
? defaultTreeData.concat(treeData)
|
|
139
|
-
: treeData
|
|
175
|
+
: treeData;
|
|
176
|
+
if (isShowAll) {
|
|
177
|
+
data = __spreadArray([
|
|
178
|
+
(_a = {}, _a[labelKey] = i18next.t('全部'), _a[valueKey] = '', _a.key = '__all__', _a)
|
|
179
|
+
], data);
|
|
180
|
+
}
|
|
181
|
+
return data;
|
|
182
|
+
})();
|
|
183
|
+
return (React.createElement(TreeSelect, __assign({ allowClear: true, showSearch: true, filterTreeNode: true, treeNodeFilterProp: "title", treeData: finalTreeData, searchValue: searchValue, onSearch: onSearch, treeDataSimpleMode: asyncLoadChildren, loadData: asyncLoadChildren ? onLoadDataHandle : undefined, onChange: handleChange, fieldNames: fieldNames }, restProps)));
|
|
140
184
|
}
|
|
141
185
|
EnhanceTreeSelect.SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
|
142
186
|
export default EnhanceTreeSelect;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormProps } from 'antd/lib/form';
|
|
2
|
+
import { FormProps, FormInstance as AntFormInstance } from 'antd/lib/form';
|
|
3
3
|
export interface IProps extends FormProps {
|
|
4
4
|
}
|
|
5
|
+
interface FormInstance extends AntFormInstance {
|
|
6
|
+
setDynamicList?: (list: any[]) => void;
|
|
7
|
+
/** 这里存储一些自定义校验 规则的数据 */
|
|
8
|
+
myMatchRule?: any;
|
|
9
|
+
/** 是否开启校验下拉框选项值不存在的情况 */
|
|
10
|
+
enableDropdownValueValidation?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormContext: React.Context<{
|
|
13
|
+
form?: FormInstance;
|
|
14
|
+
}>;
|
|
5
15
|
declare function Form(props: IProps): JSX.Element;
|
|
6
16
|
declare namespace Form {
|
|
7
17
|
var Item: typeof import("antd/lib/form/FormItem").default;
|
|
@@ -20,12 +20,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { createContext } from 'react';
|
|
24
24
|
import { Form as AntForm } from 'antd';
|
|
25
25
|
import { FormProvider } from 'antd/lib/form/context';
|
|
26
|
+
export var FormContext = createContext({});
|
|
26
27
|
function Form(props) {
|
|
27
|
-
var children = props.children, resetProps = __rest(props, ["children"]);
|
|
28
|
-
return React.createElement(
|
|
28
|
+
var children = props.children, form = props.form, resetProps = __rest(props, ["children", "form"]);
|
|
29
|
+
return (React.createElement(FormContext.Provider, { value: { form: form } },
|
|
30
|
+
React.createElement(AntForm, __assign({ form: form }, resetProps), children)));
|
|
29
31
|
}
|
|
30
32
|
Form.Item = AntForm.Item;
|
|
31
33
|
Form.List = AntForm.List;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IProFormProps } from './interface';
|
|
3
|
+
export declare const FormContext: React.Context<{
|
|
4
|
+
onSearch?: () => void;
|
|
5
|
+
}>;
|
|
3
6
|
declare function ProForm(props: IProFormProps): JSX.Element;
|
|
4
7
|
export declare const useForm: typeof import("antd/lib/form/Form").useForm;
|
|
5
8
|
declare const _default: React.MemoExoticComponent<typeof ProForm>;
|
|
@@ -20,23 +20,40 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
24
|
+
import React, { memo, useCallback, useMemo, createContext, useRef, useImperativeHandle, } from 'react';
|
|
24
25
|
import { Form } from 'antd';
|
|
25
|
-
import { Button } from '../../index';
|
|
26
|
+
import { Button, ZtIcon } from '../../index';
|
|
26
27
|
import { useDynamic } from './hooks';
|
|
27
28
|
import Items from './items';
|
|
28
29
|
import Setting from './setting';
|
|
29
30
|
import classNames from 'classnames';
|
|
31
|
+
import useToggle from '../business/SearchContainer/hooks/useToggle';
|
|
32
|
+
import useBaseContext from '../utils/useBaseContext';
|
|
33
|
+
import { getFinalValue } from '../utils';
|
|
34
|
+
import { useCommonSearch, useCommonSearchModal } from './useCommonSearch';
|
|
35
|
+
import RecordCommonList from './record-common-list';
|
|
36
|
+
export var FormContext = createContext({});
|
|
30
37
|
function ProForm(props) {
|
|
31
|
-
var items = props.items, noBottom = props.noBottom, wrapClassName = props.wrapClassName, leftClassName = props.leftClassName, itemClassName = props.itemClassName, _a = props.isFlex, isFlex = _a === void 0 ? true : _a, rightWrapVisible = props.rightWrapVisible, rightClassName = props.rightClassName, onResetHandle = props.onResetHandle, onSearchHandle = props.onSearchHandle, showDynamic = props.showDynamic, showDynamicKey = props.showDynamicKey, form = props.form, onValuesChange = props.onValuesChange, configInfo = props.configInfo, outsideState = props.outsideState, restProps = __rest(props, ["items", "noBottom", "wrapClassName", "leftClassName", "itemClassName", "isFlex", "rightWrapVisible", "rightClassName", "onResetHandle", "onSearchHandle", "showDynamic", "showDynamicKey", "form", "onValuesChange", "configInfo", "outsideState"]);
|
|
32
|
-
var
|
|
38
|
+
var items = props.items, noBottom = props.noBottom, wrapClassName = props.wrapClassName, leftClassName = props.leftClassName, itemClassName = props.itemClassName, _a = props.isFlex, isFlex = _a === void 0 ? true : _a, isToggle = props.isToggle, _b = props.toggleNum, toggleNum = _b === void 0 ? 2 : _b, defaultToggle = props.defaultToggle, rightWrapVisible = props.rightWrapVisible, rightClassName = props.rightClassName, onResetHandle = props.onResetHandle, onSearchHandle = props.onSearchHandle, showDynamic = props.showDynamic, showDynamicKey = props.showDynamicKey, disabledHideItem = props.disabledHideItem, form = props.form, onValuesChange = props.onValuesChange, configInfo = props.configInfo, outsideState = props.outsideState, handleRef = props.handleRef, recordCommonSearch = props.recordCommonSearch, hideDynamic = props.hideDynamic, addRightMarginBottom = props.addRightMarginBottom, restProps = __rest(props, ["items", "noBottom", "wrapClassName", "leftClassName", "itemClassName", "isFlex", "isToggle", "toggleNum", "defaultToggle", "rightWrapVisible", "rightClassName", "onResetHandle", "onSearchHandle", "showDynamic", "showDynamicKey", "disabledHideItem", "form", "onValuesChange", "configInfo", "outsideState", "handleRef", "recordCommonSearch", "hideDynamic", "addRightMarginBottom"]);
|
|
39
|
+
var _c = useDynamic(showDynamic, showDynamicKey, items), initDynamicList = _c.initDynamicList, currentDynamicList = _c.currentDynamicList, setCurrentDynamicList = _c.setCurrentDynamicList, currentItems = _c.currentItems;
|
|
40
|
+
var settingRef = useRef(null);
|
|
41
|
+
var _d = useBaseContext(), isRecordCommonSearch = _d.isRecordCommonSearch, isUIWeeklyReview = _d.isUIWeeklyReview;
|
|
33
42
|
var wrapClasses = classNames('pro-form', wrapClassName, {
|
|
34
43
|
'pro-form--no-bottom': noBottom,
|
|
44
|
+
'pro-form--weekly-review': isUIWeeklyReview,
|
|
35
45
|
});
|
|
36
46
|
var leftClasses = classNames('pro-form__left', leftClassName, {
|
|
37
47
|
'pro-form__left--flex': isFlex,
|
|
48
|
+
'pro-form__left--istoggle': isToggle,
|
|
38
49
|
});
|
|
39
50
|
var rightClasses = classNames('pro-form__right', rightClassName);
|
|
51
|
+
/** 表单容器Ref */
|
|
52
|
+
var containerRef = useRef(null);
|
|
53
|
+
var _e = useToggle(containerRef, currentDynamicList, isToggle, toggleNum, defaultToggle), toggle = _e.toggle, onToggleChange = _e.onToggleChange, setToggleHandle = _e.setToggleHandle;
|
|
54
|
+
useImperativeHandle(handleRef, function () { return ({
|
|
55
|
+
setToggleHandle: setToggleHandle,
|
|
56
|
+
}); });
|
|
40
57
|
// 获取依赖项关联
|
|
41
58
|
var itemsShouldUpdate = useMemo(function () {
|
|
42
59
|
var result = {};
|
|
@@ -89,13 +106,63 @@ function ProForm(props) {
|
|
|
89
106
|
form.setFieldsValue(fieldsValue_1);
|
|
90
107
|
}
|
|
91
108
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
109
|
+
// 是否开启常用搜索
|
|
110
|
+
// 如果全局开启了默认添加,那么只要没有单独配置关闭,都认为需要打开
|
|
111
|
+
var isCommonSearchEnabled = rightWrapVisible && getFinalValue(isRecordCommonSearch, recordCommonSearch);
|
|
112
|
+
// 常用搜索hooks
|
|
113
|
+
var _f = useCommonSearch({
|
|
114
|
+
commonSearchKey: showDynamicKey || window.location.pathname,
|
|
115
|
+
isCommonSearchEnabled: isCommonSearchEnabled,
|
|
116
|
+
}), commonSearchList = _f.commonSearchList, setCommonSearchList = _f.setCommonSearchList, currentCommonSearchKey = _f.currentCommonSearchKey, setCurrentCommonSearchKey = _f.setCurrentCommonSearchKey, setData = _f.setData, deleteData = _f.deleteData, setReplaceData = _f.setReplaceData, reTransformData = _f.reTransformData, updateServerData = _f.updateServerData;
|
|
117
|
+
var onCommonSearchHandle = useCommonSearchModal({
|
|
118
|
+
commonSearchList: commonSearchList,
|
|
119
|
+
currentCommonSearchKey: currentCommonSearchKey,
|
|
120
|
+
form: form,
|
|
121
|
+
setData: setData,
|
|
122
|
+
isCommonSearchEnabled: isCommonSearchEnabled,
|
|
123
|
+
setCurrentCommonSearchKey: setCurrentCommonSearchKey,
|
|
124
|
+
currentDynamicList: currentDynamicList,
|
|
125
|
+
setCurrentDynamicList: setCurrentDynamicList,
|
|
126
|
+
}).onCommonSearchHandle;
|
|
127
|
+
// 查询按钮
|
|
128
|
+
var onSearchHandleInner = useCallback(function () {
|
|
129
|
+
// 当前表单数据
|
|
130
|
+
var currentFormParams = form === null || form === void 0 ? void 0 : form.getFieldsValue(true);
|
|
131
|
+
onSearchHandle && onSearchHandle(currentFormParams);
|
|
132
|
+
}, [form, onSearchHandle]);
|
|
133
|
+
// 重置按钮
|
|
134
|
+
var selfOnResetHandle = function () {
|
|
135
|
+
setCurrentCommonSearchKey === null || setCurrentCommonSearchKey === void 0 ? void 0 : setCurrentCommonSearchKey('');
|
|
136
|
+
onResetHandle === null || onResetHandle === void 0 ? void 0 : onResetHandle();
|
|
137
|
+
};
|
|
138
|
+
return (React.createElement(FormContext.Provider, { value: { onSearch: onSearchHandleInner } },
|
|
139
|
+
React.createElement(Form, __assign({ form: form, onValuesChange: onValuesChangeHandle }, restProps, { className: wrapClasses }),
|
|
140
|
+
React.createElement("div", { className: leftClasses, ref: containerRef },
|
|
141
|
+
React.createElement(Items, { items: currentItems, itemClassName: itemClassName, form: form, configInfo: configInfo, outsideState: outsideState })),
|
|
142
|
+
React.createElement("div", { className: "pro-form__middle", style: { display: !isToggle && !showDynamic ? 'none' : 'block' } },
|
|
143
|
+
showDynamic && !hideDynamic && (React.createElement(Setting, { list: currentDynamicList, initList: initDynamicList, showDynamicKey: showDynamicKey, setCurrentDynamicList: setCurrentDynamicList, disabledHideItem: disabledHideItem, handleRef: settingRef })),
|
|
144
|
+
isToggle ? (React.createElement("div", { className: "pro-form__middle--toggle", onClick: function () { return onToggleChange(); }, style: {
|
|
145
|
+
// top: showDynamic ? '30px' : '7px',
|
|
146
|
+
top: '5px',
|
|
147
|
+
} },
|
|
148
|
+
React.createElement(ZtIcon, { type: "icon-a-lujingbiankuang", style: {
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
color: '#768696',
|
|
151
|
+
transition: 'transform 0.3s ease-in-out',
|
|
152
|
+
transform: "rotate(" + (toggle ? '180deg' : 0) + ")",
|
|
153
|
+
} }))) : null),
|
|
154
|
+
rightWrapVisible ? (React.createElement("div", { className: rightClasses, style: { marginBottom: addRightMarginBottom ? '10px' : 0 } },
|
|
155
|
+
React.createElement("div", { className: classNames('pro-form__right-buttons'), style: {
|
|
156
|
+
marginRight: showDynamic && !hideDynamic ? '0px' : '5px',
|
|
157
|
+
} },
|
|
158
|
+
onResetHandle ? (React.createElement(Button, { type: "default", onClick: onResetHandle, style: { marginTop: 0 } }, "\u91CD\u7F6E")) : null,
|
|
159
|
+
showDynamic && !hideDynamic && (React.createElement(Button, { onClick: function () { var _a, _b; return (_b = (_a = settingRef === null || settingRef === void 0 ? void 0 : settingRef.current) === null || _a === void 0 ? void 0 : _a.open) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "default", compact: true }, i18next.t('自定义')))),
|
|
160
|
+
React.createElement("div", { className: classNames('pro-form__right-buttons') },
|
|
161
|
+
onSearchHandle ? (React.createElement(Button, { type: "primary", onClick: onSearchHandle }, i18next.t('查询'))) : null,
|
|
162
|
+
isCommonSearchEnabled ? (React.createElement(Button, { style: {
|
|
163
|
+
width: '100%',
|
|
164
|
+
}, onClick: onCommonSearchHandle, type: "default", compact: true }, i18next.t('常用搜索'))) : null))) : null),
|
|
165
|
+
isCommonSearchEnabled ? (React.createElement(RecordCommonList, { recordCommonList: commonSearchList, setRecordCommonList: setCommonSearchList, currentRecordCommonSearchKey: currentCommonSearchKey, setCurrentRecordCommonSearchKey: setCurrentCommonSearchKey, form: form, reTransformData: reTransformData, deleteData: deleteData, setReplaceData: setReplaceData, updateServerData: updateServerData, onSearchHandle: onSearchHandleInner, setCurrentDynamicList: setCurrentDynamicList, showDynamicKey: showDynamicKey })) : null));
|
|
99
166
|
}
|
|
100
167
|
export var useForm = Form.useForm;
|
|
101
168
|
export default memo(ProForm);
|
|
@@ -80,6 +80,10 @@ export interface IFormItem extends FormItemProps {
|
|
|
80
80
|
* 即 你的items 可能因为某个state的改变而重新生成时,可选择开启
|
|
81
81
|
*/
|
|
82
82
|
shouldUpdateBeOutsideState?: (prevOutsideState: any, nextOutsideState: any) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 是否隐藏表单项内的圆角
|
|
85
|
+
*/
|
|
86
|
+
hideItemBorderRadius?: boolean;
|
|
83
87
|
}
|
|
84
88
|
export interface IProFormProps extends FormProps {
|
|
85
89
|
items: IFormItem[];
|
|
@@ -99,6 +103,10 @@ export interface IProFormProps extends FormProps {
|
|
|
99
103
|
* 是否开启做容器flex布局
|
|
100
104
|
*/
|
|
101
105
|
isFlex?: boolean;
|
|
106
|
+
isToggle?: boolean;
|
|
107
|
+
/** 收起时 展示几行 */
|
|
108
|
+
toggleNum?: number;
|
|
109
|
+
defaultToggle?: boolean;
|
|
102
110
|
/**
|
|
103
111
|
* 子项类名
|
|
104
112
|
*/
|
|
@@ -107,6 +115,10 @@ export interface IProFormProps extends FormProps {
|
|
|
107
115
|
* 是否显示右侧容器
|
|
108
116
|
*/
|
|
109
117
|
rightWrapVisible?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* 右侧容器是否添加下边距
|
|
120
|
+
*/
|
|
121
|
+
addRightMarginBottom?: boolean;
|
|
110
122
|
/**
|
|
111
123
|
* 右容器
|
|
112
124
|
*/
|
|
@@ -124,6 +136,14 @@ export interface IProFormProps extends FormProps {
|
|
|
124
136
|
*/
|
|
125
137
|
showDynamic?: boolean;
|
|
126
138
|
showDynamicKey?: string;
|
|
139
|
+
/**
|
|
140
|
+
* 是否不显示自定义配置按钮
|
|
141
|
+
*/
|
|
142
|
+
hideDynamic?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* 是否禁止隐藏项
|
|
145
|
+
*/
|
|
146
|
+
disabledHideItem?: boolean;
|
|
127
147
|
/**
|
|
128
148
|
* 表单配置信息,配置优先
|
|
129
149
|
*/
|
|
@@ -134,6 +154,13 @@ export interface IProFormProps extends FormProps {
|
|
|
134
154
|
* 表单内部需要的外部参数
|
|
135
155
|
*/
|
|
136
156
|
outsideState?: any;
|
|
157
|
+
handleRef?: React.MutableRefObject<{
|
|
158
|
+
setToggleHandle: (toggle: boolean) => void;
|
|
159
|
+
} | null>;
|
|
160
|
+
/**
|
|
161
|
+
* 是否记录常用搜索
|
|
162
|
+
*/
|
|
163
|
+
recordCommonSearch?: boolean;
|
|
137
164
|
}
|
|
138
165
|
export interface IFormItemProps {
|
|
139
166
|
items: IFormItem[];
|
|
@@ -166,4 +193,8 @@ export interface ISettingProps {
|
|
|
166
193
|
list: ISearchLayout[];
|
|
167
194
|
initList: ISearchLayout[];
|
|
168
195
|
setCurrentDynamicList: any;
|
|
196
|
+
disabledHideItem?: boolean;
|
|
197
|
+
handleRef?: any;
|
|
198
|
+
hideTemplateSetting?: boolean;
|
|
199
|
+
title?: string;
|
|
169
200
|
}
|
|
@@ -28,7 +28,7 @@ function runHandle(form, handle) {
|
|
|
28
28
|
}
|
|
29
29
|
function Item(item) {
|
|
30
30
|
var _a, _b, _c;
|
|
31
|
-
var render = item.render, isRequired = item.isRequired, isDisplay = item.isDisplay, isChangeable = item.isChangeable, dependencies = item.dependencies, shouldUpdate = item.shouldUpdate, preText = item.preText, nextText = item.nextText, disabled = item.disabled, noBorder = item.noBorder, noLabel = item.noLabel, showBoxBorder = item.showBoxBorder, width = item.width, shouldUpdateNames = item.shouldUpdateNames, shouldUpdateClear = item.shouldUpdateClear, configName = item.configName, index = item.index, itemClassName = item.itemClassName, form = item.form, _isDisplayConfigInfo = item._isDisplayConfigInfo, _isRequireConfigInfo = item._isRequireConfigInfo, _isChangeableConfigInfo = item._isChangeableConfigInfo, outsideState = item.outsideState, shouldUpdateBeOutsideState = item.shouldUpdateBeOutsideState, resetItem = __rest(item, ["render", "isRequired", "isDisplay", "isChangeable", "dependencies", "shouldUpdate", "preText", "nextText", "disabled", "noBorder", "noLabel", "showBoxBorder", "width", "shouldUpdateNames", "shouldUpdateClear", "configName", "index", "itemClassName", "form", "_isDisplayConfigInfo", "_isRequireConfigInfo", "_isChangeableConfigInfo", "outsideState", "shouldUpdateBeOutsideState"]);
|
|
31
|
+
var render = item.render, isRequired = item.isRequired, isDisplay = item.isDisplay, isChangeable = item.isChangeable, dependencies = item.dependencies, shouldUpdate = item.shouldUpdate, preText = item.preText, nextText = item.nextText, disabled = item.disabled, noBorder = item.noBorder, noLabel = item.noLabel, showBoxBorder = item.showBoxBorder, width = item.width, shouldUpdateNames = item.shouldUpdateNames, shouldUpdateClear = item.shouldUpdateClear, configName = item.configName, index = item.index, itemClassName = item.itemClassName, form = item.form, _isDisplayConfigInfo = item._isDisplayConfigInfo, _isRequireConfigInfo = item._isRequireConfigInfo, _isChangeableConfigInfo = item._isChangeableConfigInfo, outsideState = item.outsideState, shouldUpdateBeOutsideState = item.shouldUpdateBeOutsideState, hideItemBorderRadius = item.hideItemBorderRadius, resetItem = __rest(item, ["render", "isRequired", "isDisplay", "isChangeable", "dependencies", "shouldUpdate", "preText", "nextText", "disabled", "noBorder", "noLabel", "showBoxBorder", "width", "shouldUpdateNames", "shouldUpdateClear", "configName", "index", "itemClassName", "form", "_isDisplayConfigInfo", "_isRequireConfigInfo", "_isChangeableConfigInfo", "outsideState", "shouldUpdateBeOutsideState", "hideItemBorderRadius"]);
|
|
32
32
|
// 更新是否必填配置
|
|
33
33
|
var updateIsRequired = function (isRequired) {
|
|
34
34
|
var _a;
|
|
@@ -115,6 +115,7 @@ function Item(item) {
|
|
|
115
115
|
'pro-form__item--noborder': noBorder,
|
|
116
116
|
'pro-form__item--nolabel': noLabel,
|
|
117
117
|
'pro-form__item--showboxborder': showBoxBorder,
|
|
118
|
+
'pro-form__item--hideitemborderradius': hideItemBorderRadius,
|
|
118
119
|
'pro-form__item--required': (resetItem === null || resetItem === void 0 ? void 0 : resetItem.rules) &&
|
|
119
120
|
((_c = (_b = resetItem.rules) === null || _b === void 0 ? void 0 : _b.find) === null || _c === void 0 ? void 0 : _c.call(_b, function (item) { return !!item.required; })),
|
|
120
121
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ISearchLayout } from './interface';
|
|
3
|
+
interface IRecordCommonList {
|
|
4
|
+
recordCommonList: any[];
|
|
5
|
+
setRecordCommonList: (list: any[]) => void;
|
|
6
|
+
currentRecordCommonSearchKey: string;
|
|
7
|
+
setCurrentRecordCommonSearchKey: (key: string) => void;
|
|
8
|
+
form: any;
|
|
9
|
+
reTransformData?: any;
|
|
10
|
+
deleteData?: any;
|
|
11
|
+
setReplaceData?: any;
|
|
12
|
+
updateServerData?: any;
|
|
13
|
+
onSearchHandle?: any;
|
|
14
|
+
setCurrentDynamicList?: (list: ISearchLayout[]) => void;
|
|
15
|
+
showDynamicKey?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const RecordCommonList: React.FC<IRecordCommonList>;
|
|
18
|
+
export default RecordCommonList;
|