kts-components-document-access-point 1.4.2 → 1.4.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/.editorconfig +16 -16
- package/.fatherrc.ts +4 -4
- package/.prettierignore +7 -7
- package/.prettierrc +11 -11
- package/.umirc.ts +11 -11
- package/README.md +3 -3
- package/dist/index.esm.js +28 -8
- package/dist/index.js +28 -8
- package/docs/index.md +3 -3
- package/index.html +12 -12
- package/package.json +56 -56
- package/src/DocumentWhiteList/___demo___/base/index.tsx +7 -7
- package/src/DocumentWhiteList/___demo___/setService/index.tsx +23 -23
- package/src/DocumentWhiteList/control/actions/addblack/index.ts +14 -14
- package/src/DocumentWhiteList/control/actions/addwhite/index.ts +14 -14
- package/src/DocumentWhiteList/control/actions/blacklist/index.ts +22 -22
- package/src/DocumentWhiteList/control/actions/checkclient/index.ts +14 -14
- package/src/DocumentWhiteList/control/actions/demo/index.ts +4 -4
- package/src/DocumentWhiteList/control/actions/didilist/index.ts +18 -18
- package/src/DocumentWhiteList/control/actions/enableblacklist/index.ts +17 -17
- package/src/DocumentWhiteList/control/actions/enablelist/index.ts +18 -18
- package/src/DocumentWhiteList/control/actions/enablewhitelist/index.ts +17 -17
- package/src/DocumentWhiteList/control/actions/getmode/index.ts +14 -14
- package/src/DocumentWhiteList/control/actions/setmode/index.ts +14 -14
- package/src/DocumentWhiteList/control/actions/synclist/index.ts +19 -19
- package/src/DocumentWhiteList/control/actions/whitelist/index.ts +22 -22
- package/src/DocumentWhiteList/control/index.tsx +42 -42
- package/src/DocumentWhiteList/control/state/index.ts +47 -47
- package/src/DocumentWhiteList/index.md +5 -5
- package/src/DocumentWhiteList/index.tsx +40 -40
- package/src/DocumentWhiteList/interface/index.ts +30 -30
- package/src/DocumentWhiteList/ui/clientmodal/index.tsx +190 -190
- package/src/DocumentWhiteList/ui/main/black.tsx +132 -132
- package/src/DocumentWhiteList/ui/main/index.tsx +49 -49
- package/src/DocumentWhiteList/ui/main/switchmode.tsx +52 -52
- package/src/DocumentWhiteList/ui/main/white.tsx +120 -120
- package/src/DocumentWhiteList/ui/pageheader/BlackHeader.tsx +143 -143
- package/src/DocumentWhiteList/ui/pageheader/WhiteHeader.tsx +152 -152
- package/src/DocumentWhiteList/ui/pageui/index.tsx +64 -64
- package/src/DocumentWhiteList/ui/whitemodal/index.tsx +146 -146
- package/src/DocumentWhiteList/util/ConfigEnum.ts +8 -8
- package/src/DocumentsCont/___demo___/base/index.tsx +7 -7
- package/src/DocumentsCont/___demo___/setService/index.tsx +25 -25
- package/src/DocumentsCont/index.md +9 -9
- package/src/DocumentsCont/index.tsx +54 -51
- package/src/DocumentsDemo/Controller/index.tsx +14 -14
- package/src/DocumentsDemo/Controller/whitelist.ts +22 -22
- package/src/DocumentsDemo/Text.tsx +22 -22
- package/src/DocumentsDemo/___demo___/base/index.tsx +7 -7
- package/src/DocumentsDemo/index.md +6 -6
- package/src/DocumentsDemo/index.tsx +38 -38
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/IProperties/index.ts +69 -69
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/IRules/index.ts +18 -18
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/ISchema/index.ts +14 -14
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/PropertyTableState/index.ts +12 -12
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/RuleState/index.ts +336 -336
- package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/index.ts +51 -51
- package/src/DocumentsEdit/DocumentsEditController/actions/addProperties/index.ts +37 -37
- package/src/DocumentsEdit/DocumentsEditController/actions/delProperties/index.ts +48 -48
- package/src/DocumentsEdit/DocumentsEditController/actions/editProperties/index.ts +93 -79
- package/src/DocumentsEdit/DocumentsEditController/index.tsx +21 -21
- package/src/DocumentsEdit/___demo___/conventional/index.tsx +10 -10
- package/src/DocumentsEdit/___demo___/monitor/index.tsx +1421 -1421
- package/src/DocumentsEdit/___demo___/readOnly/index.tsx +16 -16
- package/src/DocumentsEdit/constant/propertyColumns/index.tsx +65 -65
- package/src/DocumentsEdit/index.less +45 -45
- package/src/DocumentsEdit/index.md +10 -10
- package/src/DocumentsEdit/index.tsx +117 -117
- package/src/DocumentsEdit/tools/index.ts +88 -88
- package/src/DocumentsEdit/ui/AddPropertyButton/index.tsx +238 -238
- package/src/DocumentsEdit/ui/Breadcrumb/index.tsx +51 -51
- package/src/DocumentsEdit/ui/EditProperty/index.tsx +290 -290
- package/src/DocumentsEdit/ui/EditRule/index.tsx +156 -156
- package/src/DocumentsEdit/ui/EditRule/ui/AddRuleButton/index.tsx +49 -49
- package/src/DocumentsEdit/ui/EditRule/ui/DelRuleButton/index.tsx +31 -31
- package/src/DocumentsEdit/ui/EditRule/ui/RuleForm/fn/algorithmFormComponent/index.tsx +142 -142
- package/src/DocumentsEdit/ui/EditRule/ui/RuleForm/index.tsx +154 -154
- package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/index.less +4 -4
- package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/index.tsx +70 -70
- package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/AddChildPropertyButton/index.tsx +34 -34
- package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/AddRuleButton/index.tsx +64 -64
- package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/EditPropertyButton/index.tsx +31 -31
- package/src/DocumentsEdit/ui/PropertyTable/index.less +19 -19
- package/src/DocumentsEdit/ui/PropertyTable/index.tsx +18 -18
- package/src/DocumentsEdit/ui/RefPropertyButton/index.tsx +121 -121
- package/src/DocumentsList/DocumentsListController/DocumentsListControllerState/index.ts +55 -55
- package/src/DocumentsList/DocumentsListController/actions/demo/index.ts +4 -4
- package/src/DocumentsList/DocumentsListController/actions/typelist/index.ts +15 -15
- package/src/DocumentsList/DocumentsListController/index.tsx +16 -16
- package/src/DocumentsList/___demo___/list/index.tsx +4 -4
- package/src/DocumentsList/index.less +22 -22
- package/src/DocumentsList/index.md +3 -3
- package/src/DocumentsList/index.tsx +46 -46
- package/src/DocumentsList/ui/ModalComfirm/index.tsx +94 -92
- package/src/DocumentsList/ui/PageHeader/SendHeader.tsx +230 -230
- package/src/DocumentsList/ui/PageHeader/index.tsx +325 -325
- package/src/DocumentsList/ui/PageUI/index.tsx +65 -65
- package/src/DocumentsList/ui/RuleTable/index.tsx +163 -163
- package/src/DocumentsList/ui/sendlist/index.tsx +151 -151
- package/src/DocumentsList/util/ConfigEnum.ts +11 -11
- package/src/DocumentsRule/control/actions/batchsend/index.ts +13 -13
- package/src/DocumentsRule/control/actions/configsave/index.ts +14 -14
- package/src/DocumentsRule/control/actions/configupdate/index.ts +13 -13
- package/src/DocumentsRule/control/actions/getconfigbyid/index.ts +14 -14
- package/src/DocumentsRule/control/actions/getrecordbyid/index.ts +14 -14
- package/src/DocumentsRule/control/actions/gettemplate/index.ts +15 -15
- package/src/DocumentsRule/control/actions/listbysubjectid/index.ts +13 -13
- package/src/DocumentsRule/control/actions/typelist/index.ts +13 -13
- package/src/DocumentsRule/control/index.tsx +30 -30
- package/src/DocumentsRule/control/state/index.ts +42 -42
- package/src/DocumentsRule/index.md +1 -1
- package/src/DocumentsRule/index.tsx +25 -25
- package/src/DocumentsRule/interface/index.ts +28 -28
- package/src/DocumentsRule/ui/main/index.tsx +362 -362
- package/src/DocumentsService/index.ts +18 -18
- package/src/index.ts +9 -9
- package/tsconfig.json +29 -29
- package/typings.d.ts +3 -3
- package/docs-dist/404.html +0 -38
- package/docs-dist/index.html +0 -38
- package/docs-dist/static/icon.050945f2.svg +0 -1
- package/docs-dist/umi.css +0 -11
- package/docs-dist/umi.js +0 -1
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
Drawer,
|
|
5
|
-
Space,
|
|
6
|
-
Table,
|
|
7
|
-
} from 'kts-components-antd-x4';
|
|
8
|
-
import propertyColumns from '../../constant/propertyColumns'
|
|
9
|
-
import DocumentsEdit from '../../'
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
|
|
13
|
-
const controller = DocumentsEdit.useDocumentsEditController();
|
|
14
|
-
|
|
15
|
-
/** 当前正在处理的属性 */
|
|
16
|
-
const current = controller.useMemo(s => s.propertyTableState.current, []);
|
|
17
|
-
|
|
18
|
-
/** 只读模式 */
|
|
19
|
-
const readOnly = controller.useMemo(s => s.readOnly, []);
|
|
20
|
-
|
|
21
|
-
const [visible, setVisible] = React.useState(false);
|
|
22
|
-
|
|
23
|
-
const onOpen = React.useCallback(() => { setVisible(true) }, []);
|
|
24
|
-
|
|
25
|
-
const onClose = React.useCallback(() => { setVisible(false) }, []);
|
|
26
|
-
|
|
27
|
-
const [selectedRowKeys, setSelectedRowKeys] = React.useState<string[]>([])
|
|
28
|
-
|
|
29
|
-
/** 点击了提交 */
|
|
30
|
-
const onSubmit = React.useCallback(async () => {
|
|
31
|
-
await controller.pipeline(async s => {
|
|
32
|
-
const definitions = s.schema.definitions;
|
|
33
|
-
selectedRowKeys.forEach(e => {
|
|
34
|
-
if (!current) return;
|
|
35
|
-
const properties = definitions[e];
|
|
36
|
-
properties.$count++;
|
|
37
|
-
|
|
38
|
-
if (current.type === 'object') {
|
|
39
|
-
if (!current.properties) current.properties = {};
|
|
40
|
-
current.properties[properties.$name] = { $ref: properties.$id, alias: '', detailed: '', $refName: '', $name: '' };
|
|
41
|
-
} else if (current.type === 'array' && current.items) {
|
|
42
|
-
if (!current.items.properties) current.items.properties = {};
|
|
43
|
-
current.items.properties[properties.$name] = { $ref: properties.$id, alias: '', detailed: '', $refName: '', $name: '' };
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
})()
|
|
47
|
-
onClose();
|
|
48
|
-
}, [current, controller, selectedRowKeys])
|
|
49
|
-
|
|
50
|
-
React.useEffect(() => {
|
|
51
|
-
visible && setSelectedRowKeys([])
|
|
52
|
-
}, [visible])
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<>
|
|
56
|
-
{readOnly === false && <Button onClick={onOpen} >引用已有字段</Button>}
|
|
57
|
-
<Drawer
|
|
58
|
-
title="引用已有字段"
|
|
59
|
-
placement="right"
|
|
60
|
-
width={700}
|
|
61
|
-
onClose={onClose}
|
|
62
|
-
visible={visible}
|
|
63
|
-
destroyOnClose={true}
|
|
64
|
-
footer={
|
|
65
|
-
<Space>
|
|
66
|
-
<Button onClick={onSubmit} type="primary" >确定</Button>
|
|
67
|
-
<Button onClick={onClose} >取消</Button>
|
|
68
|
-
</Space>
|
|
69
|
-
}
|
|
70
|
-
>
|
|
71
|
-
<DrawerBody
|
|
72
|
-
selectedRowKeys={selectedRowKeys}
|
|
73
|
-
onChange={(selectedRowKeys: React.Key[]) => {
|
|
74
|
-
setSelectedRowKeys(selectedRowKeys as string[]);
|
|
75
|
-
}} />
|
|
76
|
-
</Drawer>
|
|
77
|
-
</>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const DrawerBody = (props: { selectedRowKeys: string[], onChange: (selectedRowKeys: React.Key[]) => void }) => {
|
|
82
|
-
|
|
83
|
-
const controller = DocumentsEdit.useDocumentsEditController();
|
|
84
|
-
|
|
85
|
-
const columns = React.useMemo(() => {
|
|
86
|
-
return propertyColumns.filter(e => e.key !== 'isRules')
|
|
87
|
-
}, [])
|
|
88
|
-
|
|
89
|
-
const dataSource = controller.useMemo(s => {
|
|
90
|
-
return Object.entries(s.schema.definitions)
|
|
91
|
-
.map(e => e[1])
|
|
92
|
-
.filter(e => {
|
|
93
|
-
return s.breadcrumbState.indexOf(e) < 0;
|
|
94
|
-
})
|
|
95
|
-
.filter(e => {
|
|
96
|
-
if (!s.propertyTableState.current) return true;
|
|
97
|
-
|
|
98
|
-
const properties = s.propertyTableState.current.type === 'object'
|
|
99
|
-
? s.propertyTableState.current.properties
|
|
100
|
-
: s.propertyTableState.current.items?.properties
|
|
101
|
-
|
|
102
|
-
if (!properties) return true;
|
|
103
|
-
return !properties[e.$name];
|
|
104
|
-
})
|
|
105
|
-
}, [])
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<Table
|
|
109
|
-
bordered
|
|
110
|
-
rowKey="$name"
|
|
111
|
-
size="small"
|
|
112
|
-
pagination={false}
|
|
113
|
-
dataSource={dataSource}
|
|
114
|
-
columns={columns}
|
|
115
|
-
rowSelection={{
|
|
116
|
-
type: 'checkbox',
|
|
117
|
-
selectedRowKeys: props.selectedRowKeys,
|
|
118
|
-
onChange: props.onChange,
|
|
119
|
-
}}
|
|
120
|
-
/>
|
|
121
|
-
)
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Drawer,
|
|
5
|
+
Space,
|
|
6
|
+
Table,
|
|
7
|
+
} from 'kts-components-antd-x4';
|
|
8
|
+
import propertyColumns from '../../constant/propertyColumns'
|
|
9
|
+
import DocumentsEdit from '../../'
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
|
|
13
|
+
const controller = DocumentsEdit.useDocumentsEditController();
|
|
14
|
+
|
|
15
|
+
/** 当前正在处理的属性 */
|
|
16
|
+
const current = controller.useMemo(s => s.propertyTableState.current, []);
|
|
17
|
+
|
|
18
|
+
/** 只读模式 */
|
|
19
|
+
const readOnly = controller.useMemo(s => s.readOnly, []);
|
|
20
|
+
|
|
21
|
+
const [visible, setVisible] = React.useState(false);
|
|
22
|
+
|
|
23
|
+
const onOpen = React.useCallback(() => { setVisible(true) }, []);
|
|
24
|
+
|
|
25
|
+
const onClose = React.useCallback(() => { setVisible(false) }, []);
|
|
26
|
+
|
|
27
|
+
const [selectedRowKeys, setSelectedRowKeys] = React.useState<string[]>([])
|
|
28
|
+
|
|
29
|
+
/** 点击了提交 */
|
|
30
|
+
const onSubmit = React.useCallback(async () => {
|
|
31
|
+
await controller.pipeline(async s => {
|
|
32
|
+
const definitions = s.schema.definitions;
|
|
33
|
+
selectedRowKeys.forEach(e => {
|
|
34
|
+
if (!current) return;
|
|
35
|
+
const properties = definitions[e];
|
|
36
|
+
properties.$count++;
|
|
37
|
+
|
|
38
|
+
if (current.type === 'object') {
|
|
39
|
+
if (!current.properties) current.properties = {};
|
|
40
|
+
current.properties[properties.$name] = { $ref: properties.$id, alias: '', detailed: '', $refName: '', $name: '' };
|
|
41
|
+
} else if (current.type === 'array' && current.items) {
|
|
42
|
+
if (!current.items.properties) current.items.properties = {};
|
|
43
|
+
current.items.properties[properties.$name] = { $ref: properties.$id, alias: '', detailed: '', $refName: '', $name: '' };
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
})()
|
|
47
|
+
onClose();
|
|
48
|
+
}, [current, controller, selectedRowKeys])
|
|
49
|
+
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
visible && setSelectedRowKeys([])
|
|
52
|
+
}, [visible])
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
{readOnly === false && <Button onClick={onOpen} >引用已有字段</Button>}
|
|
57
|
+
<Drawer
|
|
58
|
+
title="引用已有字段"
|
|
59
|
+
placement="right"
|
|
60
|
+
width={700}
|
|
61
|
+
onClose={onClose}
|
|
62
|
+
visible={visible}
|
|
63
|
+
destroyOnClose={true}
|
|
64
|
+
footer={
|
|
65
|
+
<Space>
|
|
66
|
+
<Button onClick={onSubmit} type="primary" >确定</Button>
|
|
67
|
+
<Button onClick={onClose} >取消</Button>
|
|
68
|
+
</Space>
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
<DrawerBody
|
|
72
|
+
selectedRowKeys={selectedRowKeys}
|
|
73
|
+
onChange={(selectedRowKeys: React.Key[]) => {
|
|
74
|
+
setSelectedRowKeys(selectedRowKeys as string[]);
|
|
75
|
+
}} />
|
|
76
|
+
</Drawer>
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const DrawerBody = (props: { selectedRowKeys: string[], onChange: (selectedRowKeys: React.Key[]) => void }) => {
|
|
82
|
+
|
|
83
|
+
const controller = DocumentsEdit.useDocumentsEditController();
|
|
84
|
+
|
|
85
|
+
const columns = React.useMemo(() => {
|
|
86
|
+
return propertyColumns.filter(e => e.key !== 'isRules')
|
|
87
|
+
}, [])
|
|
88
|
+
|
|
89
|
+
const dataSource = controller.useMemo(s => {
|
|
90
|
+
return Object.entries(s.schema.definitions)
|
|
91
|
+
.map(e => e[1])
|
|
92
|
+
.filter(e => {
|
|
93
|
+
return s.breadcrumbState.indexOf(e) < 0;
|
|
94
|
+
})
|
|
95
|
+
.filter(e => {
|
|
96
|
+
if (!s.propertyTableState.current) return true;
|
|
97
|
+
|
|
98
|
+
const properties = s.propertyTableState.current.type === 'object'
|
|
99
|
+
? s.propertyTableState.current.properties
|
|
100
|
+
: s.propertyTableState.current.items?.properties
|
|
101
|
+
|
|
102
|
+
if (!properties) return true;
|
|
103
|
+
return !properties[e.$name];
|
|
104
|
+
})
|
|
105
|
+
}, [])
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Table
|
|
109
|
+
bordered
|
|
110
|
+
rowKey="$name"
|
|
111
|
+
size="small"
|
|
112
|
+
pagination={false}
|
|
113
|
+
dataSource={dataSource}
|
|
114
|
+
columns={columns}
|
|
115
|
+
rowSelection={{
|
|
116
|
+
type: 'checkbox',
|
|
117
|
+
selectedRowKeys: props.selectedRowKeys,
|
|
118
|
+
onChange: props.onChange,
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
)
|
|
122
122
|
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
/** */
|
|
3
|
-
export interface ISelectedRowKey {
|
|
4
|
-
/**
|
|
5
|
-
* 配置名称
|
|
6
|
-
*/
|
|
7
|
-
configName?: string;
|
|
8
|
-
/**
|
|
9
|
-
* 配置编号
|
|
10
|
-
*/
|
|
11
|
-
configNumber?: string;
|
|
12
|
-
/**
|
|
13
|
-
* 创建时间
|
|
14
|
-
*/
|
|
15
|
-
createAt?: number;
|
|
16
|
-
/**
|
|
17
|
-
* 更新时间
|
|
18
|
-
*/
|
|
19
|
-
updateAt?: number;
|
|
20
|
-
/**
|
|
21
|
-
* schema字符串,需要json.parse转换
|
|
22
|
-
*/
|
|
23
|
-
schemaContent?: string;
|
|
24
|
-
/**
|
|
25
|
-
* 主键
|
|
26
|
-
*/
|
|
27
|
-
id?: number;
|
|
28
|
-
/**
|
|
29
|
-
*单据类型
|
|
30
|
-
*/
|
|
31
|
-
type?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IBillEnum {
|
|
34
|
-
name: string;
|
|
35
|
-
value: string;
|
|
36
|
-
}
|
|
37
|
-
export interface IParams extends ISelectedRowKey {
|
|
38
|
-
pageSize?: number;
|
|
39
|
-
pageNum?: number;
|
|
40
|
-
}
|
|
41
|
-
export interface IBillType {
|
|
42
|
-
lable: string;
|
|
43
|
-
value: string;
|
|
44
|
-
}
|
|
45
|
-
export default class DocumentsListControllerState {
|
|
46
|
-
|
|
47
|
-
demo: string = 'demo';
|
|
48
|
-
type: number = 1;
|
|
49
|
-
selectedRowKey: ISelectedRowKey[] = [];
|
|
50
|
-
billEnum: IBillEnum[] = [];
|
|
51
|
-
params: IParams = { pageSize: 10, pageNum: 1 };
|
|
52
|
-
visible: boolean = false;
|
|
53
|
-
schema: any;
|
|
54
|
-
targetId: string = '';
|
|
55
|
-
billTypes: IBillType[] = [];
|
|
1
|
+
|
|
2
|
+
/** */
|
|
3
|
+
export interface ISelectedRowKey {
|
|
4
|
+
/**
|
|
5
|
+
* 配置名称
|
|
6
|
+
*/
|
|
7
|
+
configName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 配置编号
|
|
10
|
+
*/
|
|
11
|
+
configNumber?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 创建时间
|
|
14
|
+
*/
|
|
15
|
+
createAt?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 更新时间
|
|
18
|
+
*/
|
|
19
|
+
updateAt?: number;
|
|
20
|
+
/**
|
|
21
|
+
* schema字符串,需要json.parse转换
|
|
22
|
+
*/
|
|
23
|
+
schemaContent?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 主键
|
|
26
|
+
*/
|
|
27
|
+
id?: number;
|
|
28
|
+
/**
|
|
29
|
+
*单据类型
|
|
30
|
+
*/
|
|
31
|
+
type?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IBillEnum {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IParams extends ISelectedRowKey {
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
pageNum?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface IBillType {
|
|
42
|
+
lable: string;
|
|
43
|
+
value: string;
|
|
44
|
+
}
|
|
45
|
+
export default class DocumentsListControllerState {
|
|
46
|
+
|
|
47
|
+
demo: string = 'demo';
|
|
48
|
+
type: number = 1;
|
|
49
|
+
selectedRowKey: ISelectedRowKey[] = [];
|
|
50
|
+
billEnum: IBillEnum[] = [];
|
|
51
|
+
params: IParams = { pageSize: 10, pageNum: 1 };
|
|
52
|
+
visible: boolean = false;
|
|
53
|
+
schema: any;
|
|
54
|
+
targetId: string = '';
|
|
55
|
+
billTypes: IBillType[] = [];
|
|
56
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import DocumentsListControllerState from '../../DocumentsListControllerState';
|
|
2
|
-
|
|
3
|
-
export default async (s: DocumentsListControllerState, value?: string) => {
|
|
4
|
-
s.demo = value || '';
|
|
1
|
+
import DocumentsListControllerState from '../../DocumentsListControllerState';
|
|
2
|
+
|
|
3
|
+
export default async (s: DocumentsListControllerState, value?: string) => {
|
|
4
|
+
s.demo = value || '';
|
|
5
5
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import DocumentsListControllerState from '../../DocumentsListControllerState';
|
|
2
|
-
import { DocumentsService } from "../../../../";
|
|
3
|
-
export default async (s: DocumentsListControllerState, params?: any) => {
|
|
4
|
-
|
|
5
|
-
const res = await DocumentsService.instance.service?.call({ url: '/schema/config/queryConfigSchemaPage', data: params, type: 'post' }) as any;
|
|
6
|
-
|
|
7
|
-
if (res.err) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
if (res.res) {
|
|
11
|
-
const list = res.res.map((item: any) => {
|
|
12
|
-
return { label: item.name, value: item.value }
|
|
13
|
-
})
|
|
14
|
-
s.billTypes = list || [];
|
|
15
|
-
}
|
|
1
|
+
import DocumentsListControllerState from '../../DocumentsListControllerState';
|
|
2
|
+
import { DocumentsService } from "../../../../";
|
|
3
|
+
export default async (s: DocumentsListControllerState, params?: any) => {
|
|
4
|
+
|
|
5
|
+
const res = await DocumentsService.instance.service?.call({ url: '/schema/config/queryConfigSchemaPage', data: params, type: 'post' }) as any;
|
|
6
|
+
|
|
7
|
+
if (res.err) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (res.res) {
|
|
11
|
+
const list = res.res.map((item: any) => {
|
|
12
|
+
return { label: item.name, value: item.value }
|
|
13
|
+
})
|
|
14
|
+
s.billTypes = list || [];
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import GreyReactBox from 'grey-react-box';
|
|
3
|
-
import DocumentsListControllerState from './DocumentsListControllerState';
|
|
4
|
-
import demo from './actions/demo';
|
|
5
|
-
|
|
6
|
-
export default class DocumentsListController extends GreyReactBox<DocumentsListControllerState> {
|
|
7
|
-
constructor(state = new DocumentsListControllerState()) {
|
|
8
|
-
super(state);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** 例子-看了可以删掉 */
|
|
12
|
-
demo = this.pipeline(demo);
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
|
|
2
|
+
import GreyReactBox from 'grey-react-box';
|
|
3
|
+
import DocumentsListControllerState from './DocumentsListControllerState';
|
|
4
|
+
import demo from './actions/demo';
|
|
5
|
+
|
|
6
|
+
export default class DocumentsListController extends GreyReactBox<DocumentsListControllerState> {
|
|
7
|
+
constructor(state = new DocumentsListControllerState()) {
|
|
8
|
+
super(state);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** 例子-看了可以删掉 */
|
|
12
|
+
demo = this.pipeline(demo);
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import List from '../../index'
|
|
3
|
-
export default () => {
|
|
4
|
-
return <List/>
|
|
1
|
+
import React from "react";
|
|
2
|
+
import List from '../../index'
|
|
3
|
+
export default () => {
|
|
4
|
+
return <List/>
|
|
5
5
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
.header{
|
|
2
|
-
padding:10px 0px;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
.buttonGroup{
|
|
6
|
-
margin-right: 20px;
|
|
7
|
-
white-space: nowrap;
|
|
8
|
-
}
|
|
9
|
-
.buttons{
|
|
10
|
-
text-align: right;
|
|
11
|
-
flex: 1;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
.tabel-action{
|
|
16
|
-
padding: 0 5px;
|
|
17
|
-
font-size: 12px;
|
|
18
|
-
font-family: PingFangSC-Regular,PingFang SC;
|
|
19
|
-
font-weight: 400;
|
|
20
|
-
color: #0074ff;
|
|
21
|
-
white-space: nowrap;
|
|
22
|
-
cursor: pointer;
|
|
1
|
+
.header{
|
|
2
|
+
padding:10px 0px;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
.buttonGroup{
|
|
6
|
+
margin-right: 20px;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
}
|
|
9
|
+
.buttons{
|
|
10
|
+
text-align: right;
|
|
11
|
+
flex: 1;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
.tabel-action{
|
|
16
|
+
padding: 0 5px;
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
font-family: PingFangSC-Regular,PingFang SC;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
color: #0074ff;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
cursor: pointer;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# DocumentsList
|
|
2
|
-
|
|
3
|
-
<code src="../DocumentsCont/___demo___/setService/index.tsx" ></code>
|
|
1
|
+
# DocumentsList
|
|
2
|
+
|
|
3
|
+
<code src="../DocumentsCont/___demo___/setService/index.tsx" ></code>
|
|
4
4
|
<code src="./___demo___/list/index.tsx" ></code>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import React, { createContext, useEffect } from 'react';
|
|
2
|
-
// import PageHeader from './ui/PageHeader'
|
|
3
|
-
import RuleTable from './ui/RuleTable'
|
|
4
|
-
import DocumentsListController from './DocumentsListController';
|
|
5
|
-
import SendList from './ui/sendlist'
|
|
6
|
-
const DocumentsListContext = createContext<DocumentsListController>(null as any);
|
|
7
|
-
/**
|
|
8
|
-
* 单据校验列表
|
|
9
|
-
*/
|
|
10
|
-
export default class DocumentsList extends React.Component<{}> {
|
|
11
|
-
|
|
12
|
-
static DocumentsListController = DocumentsListController;
|
|
13
|
-
|
|
14
|
-
static useController = () => React.useContext(DocumentsListContext);
|
|
15
|
-
|
|
16
|
-
render = () => <Main {...this.props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const Main = (props: any) => {
|
|
20
|
-
|
|
21
|
-
const controller = React.useMemo(() => new DocumentsListController(), []);
|
|
22
|
-
const type = controller.useMemo(s => s.type, []);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
const params = props.location.state;
|
|
25
|
-
const tab = params && params.type;
|
|
26
|
-
if (tab) {
|
|
27
|
-
controller.pipeline(async s => {
|
|
28
|
-
s.type = Number(tab);
|
|
29
|
-
})()
|
|
30
|
-
}
|
|
31
|
-
}, [type]);
|
|
32
|
-
return (
|
|
33
|
-
<DocumentsListContext.Provider value={controller}>
|
|
34
|
-
<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
|
|
35
|
-
{/* <PageHeader /> */}
|
|
36
|
-
{
|
|
37
|
-
type === 1 &&
|
|
38
|
-
<RuleTable />
|
|
39
|
-
}
|
|
40
|
-
{
|
|
41
|
-
type === 2 &&
|
|
42
|
-
<SendList />
|
|
43
|
-
}
|
|
44
|
-
</div>
|
|
45
|
-
</DocumentsListContext.Provider>
|
|
46
|
-
);
|
|
1
|
+
import React, { createContext, useEffect } from 'react';
|
|
2
|
+
// import PageHeader from './ui/PageHeader'
|
|
3
|
+
import RuleTable from './ui/RuleTable'
|
|
4
|
+
import DocumentsListController from './DocumentsListController';
|
|
5
|
+
import SendList from './ui/sendlist'
|
|
6
|
+
const DocumentsListContext = createContext<DocumentsListController>(null as any);
|
|
7
|
+
/**
|
|
8
|
+
* 单据校验列表
|
|
9
|
+
*/
|
|
10
|
+
export default class DocumentsList extends React.Component<{}> {
|
|
11
|
+
|
|
12
|
+
static DocumentsListController = DocumentsListController;
|
|
13
|
+
|
|
14
|
+
static useController = () => React.useContext(DocumentsListContext);
|
|
15
|
+
|
|
16
|
+
render = () => <Main {...this.props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const Main = (props: any) => {
|
|
20
|
+
|
|
21
|
+
const controller = React.useMemo(() => new DocumentsListController(), []);
|
|
22
|
+
const type = controller.useMemo(s => s.type, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const params = props.location.state;
|
|
25
|
+
const tab = params && params.type;
|
|
26
|
+
if (tab) {
|
|
27
|
+
controller.pipeline(async s => {
|
|
28
|
+
s.type = Number(tab);
|
|
29
|
+
})()
|
|
30
|
+
}
|
|
31
|
+
}, [type]);
|
|
32
|
+
return (
|
|
33
|
+
<DocumentsListContext.Provider value={controller}>
|
|
34
|
+
<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
|
|
35
|
+
{/* <PageHeader /> */}
|
|
36
|
+
{
|
|
37
|
+
type === 1 &&
|
|
38
|
+
<RuleTable />
|
|
39
|
+
}
|
|
40
|
+
{
|
|
41
|
+
type === 2 &&
|
|
42
|
+
<SendList />
|
|
43
|
+
}
|
|
44
|
+
</div>
|
|
45
|
+
</DocumentsListContext.Provider>
|
|
46
|
+
);
|
|
47
47
|
};
|