kts-components-document-access-point 1.4.4 → 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 +6 -2
- package/dist/index.js +6 -2
- 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 -93
- 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,64 +1,64 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Pagination } from 'antd';
|
|
3
|
-
class CustomerPage extends React.Component<any, any> {
|
|
4
|
-
constructor(props: any) {
|
|
5
|
-
super(props);
|
|
6
|
-
this.state = {
|
|
7
|
-
pageMeta: this.props.data
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// 点击下标改变页面
|
|
12
|
-
onPageChange = (page: any, pageSize: any) => {
|
|
13
|
-
this.props.onChange(page, pageSize);
|
|
14
|
-
}
|
|
15
|
-
// 列表显示最多条数
|
|
16
|
-
onShowSizeChange = (current: any, pageSize: any) => {
|
|
17
|
-
this.props.onChange(current, pageSize);
|
|
18
|
-
}
|
|
19
|
-
componentWillReceiveProps(nextProps: any) {
|
|
20
|
-
if (nextProps.data !== this.props.data) {
|
|
21
|
-
this.setState({
|
|
22
|
-
pageMeta: nextProps.data,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
const { pageMeta } = this.state;
|
|
28
|
-
const isShowPageSize = this.props.showSizeChanger !== undefined ? this.props.showSizeChanger : true;
|
|
29
|
-
return (
|
|
30
|
-
<div style={{ padding: '16px 10px',textAlign: 'center'}}>
|
|
31
|
-
<div className="my-pagination-div">
|
|
32
|
-
<Pagination
|
|
33
|
-
size="small"
|
|
34
|
-
showQuickJumper={true}
|
|
35
|
-
defaultCurrent={pageMeta.pageNum}
|
|
36
|
-
total={pageMeta.total}
|
|
37
|
-
current={pageMeta.pageNum}
|
|
38
|
-
pageSize={pageMeta.pageSize}
|
|
39
|
-
pageSizeOptions={this.props.pageSizeOptions || []}
|
|
40
|
-
showTotal={(total, range) => {
|
|
41
|
-
if (total > 0) {
|
|
42
|
-
return (
|
|
43
|
-
<span>
|
|
44
|
-
{!this.props.hideTotal &&
|
|
45
|
-
<span>
|
|
46
|
-
第 {(pageMeta.pageNum - 1) * pageMeta.pageSize + 1} - {pageMeta.pageNum * pageMeta.pageSize} 条,共有
|
|
47
|
-
<span className="number">{total}</span>
|
|
48
|
-
条
|
|
49
|
-
</span>
|
|
50
|
-
}
|
|
51
|
-
</span>);
|
|
52
|
-
}
|
|
53
|
-
return '';
|
|
54
|
-
}}
|
|
55
|
-
onChange={this.onPageChange}
|
|
56
|
-
onShowSizeChange={this.onShowSizeChange}
|
|
57
|
-
showSizeChanger={pageMeta.total > 0 && isShowPageSize === true ? true : false}
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export default CustomerPage;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pagination } from 'antd';
|
|
3
|
+
class CustomerPage extends React.Component<any, any> {
|
|
4
|
+
constructor(props: any) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.state = {
|
|
7
|
+
pageMeta: this.props.data
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// 点击下标改变页面
|
|
12
|
+
onPageChange = (page: any, pageSize: any) => {
|
|
13
|
+
this.props.onChange(page, pageSize);
|
|
14
|
+
}
|
|
15
|
+
// 列表显示最多条数
|
|
16
|
+
onShowSizeChange = (current: any, pageSize: any) => {
|
|
17
|
+
this.props.onChange(current, pageSize);
|
|
18
|
+
}
|
|
19
|
+
componentWillReceiveProps(nextProps: any) {
|
|
20
|
+
if (nextProps.data !== this.props.data) {
|
|
21
|
+
this.setState({
|
|
22
|
+
pageMeta: nextProps.data,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const { pageMeta } = this.state;
|
|
28
|
+
const isShowPageSize = this.props.showSizeChanger !== undefined ? this.props.showSizeChanger : true;
|
|
29
|
+
return (
|
|
30
|
+
<div style={{ padding: '16px 10px',textAlign: 'center'}}>
|
|
31
|
+
<div className="my-pagination-div">
|
|
32
|
+
<Pagination
|
|
33
|
+
size="small"
|
|
34
|
+
showQuickJumper={true}
|
|
35
|
+
defaultCurrent={pageMeta.pageNum}
|
|
36
|
+
total={pageMeta.total}
|
|
37
|
+
current={pageMeta.pageNum}
|
|
38
|
+
pageSize={pageMeta.pageSize}
|
|
39
|
+
pageSizeOptions={this.props.pageSizeOptions || []}
|
|
40
|
+
showTotal={(total, range) => {
|
|
41
|
+
if (total > 0) {
|
|
42
|
+
return (
|
|
43
|
+
<span>
|
|
44
|
+
{!this.props.hideTotal &&
|
|
45
|
+
<span>
|
|
46
|
+
第 {(pageMeta.pageNum - 1) * pageMeta.pageSize + 1} - {pageMeta.pageNum * pageMeta.pageSize} 条,共有
|
|
47
|
+
<span className="number">{total}</span>
|
|
48
|
+
条
|
|
49
|
+
</span>
|
|
50
|
+
}
|
|
51
|
+
</span>);
|
|
52
|
+
}
|
|
53
|
+
return '';
|
|
54
|
+
}}
|
|
55
|
+
onChange={this.onPageChange}
|
|
56
|
+
onShowSizeChange={this.onShowSizeChange}
|
|
57
|
+
showSizeChanger={pageMeta.total > 0 && isShowPageSize === true ? true : false}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export default CustomerPage;
|
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import React, { useCallback, useState, useEffect } from 'react';
|
|
2
|
-
import { Modal, Form, Input, Button, Select } from 'kts-components-antd-x4';
|
|
3
|
-
import Main from '../..';
|
|
4
|
-
/**
|
|
5
|
-
* 手动添加黑白名单弹窗
|
|
6
|
-
* @param
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export default function modalcomfirm(props: any) {
|
|
10
|
-
const [form] = Form.useForm();
|
|
11
|
-
const [data, setData] = useState();
|
|
12
|
-
const controller = Main.useController();
|
|
13
|
-
const params = controller.useMemo((s) => s.params, []);
|
|
14
|
-
const whiteParams = controller.useMemo((s) => s.whiteParams, []);
|
|
15
|
-
const pageMeta = controller.useMemo((s) => s.pageMeta, []);
|
|
16
|
-
const listNature = controller.useMemo((s) => s.listNature, []);
|
|
17
|
-
const didlist = controller.useMemo((s) => s.didlist, []);
|
|
18
|
-
const [defaultValue, setDefault] = React.useState('');
|
|
19
|
-
const [companyDidNote, setNote] = useState('');
|
|
20
|
-
const handleCancel = useCallback(() => {
|
|
21
|
-
controller.pipeline(async s => {
|
|
22
|
-
s.visible = false;
|
|
23
|
-
})()
|
|
24
|
-
}, [])
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
controller.didList({}) as any;
|
|
27
|
-
}, []);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (didlist.length > 0) {
|
|
30
|
-
const one = didlist.findIndex(item => item.isDefault === true);
|
|
31
|
-
if (~one) {
|
|
32
|
-
setDefault(didlist[one].participantId);
|
|
33
|
-
setNote(didlist[one].remarkName);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}, [didlist]);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
form.setFieldsValue({ 'companyDid': defaultValue });
|
|
39
|
-
}, [defaultValue]);
|
|
40
|
-
const onFinish = useCallback((values: any) => {
|
|
41
|
-
(async () => {
|
|
42
|
-
values = {
|
|
43
|
-
...values,
|
|
44
|
-
type:listNature,
|
|
45
|
-
companyDidNote
|
|
46
|
-
}
|
|
47
|
-
let res;
|
|
48
|
-
if (listNature === '1') {
|
|
49
|
-
res = await controller.addWhite([values]) as any;
|
|
50
|
-
} else {
|
|
51
|
-
res = await controller.addBlack([values]) as any;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (res.res) {
|
|
55
|
-
if (listNature === '1') {
|
|
56
|
-
const data={
|
|
57
|
-
...whiteParams
|
|
58
|
-
}
|
|
59
|
-
controller.pipeline(async s => {
|
|
60
|
-
s.whiteParams = data;
|
|
61
|
-
})()
|
|
62
|
-
} else {
|
|
63
|
-
const data={
|
|
64
|
-
...params
|
|
65
|
-
}
|
|
66
|
-
controller.pipeline(async s => {
|
|
67
|
-
s.params = data;
|
|
68
|
-
})()
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
handleCancel();
|
|
72
|
-
})()
|
|
73
|
-
|
|
74
|
-
}, [companyDidNote])
|
|
75
|
-
const didChange = useCallback((e) => {
|
|
76
|
-
if (e) {
|
|
77
|
-
const one = didlist.findIndex(item => item.participantId === e);
|
|
78
|
-
|
|
79
|
-
if (~one) {
|
|
80
|
-
setNote(didlist[one].remarkName);
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
setNote('');
|
|
84
|
-
}
|
|
85
|
-
}, [didlist])
|
|
86
|
-
return (
|
|
87
|
-
<div>
|
|
88
|
-
<Modal
|
|
89
|
-
title={`添加${listNature === '1' ? '白名单' : '黑名单'}`}
|
|
90
|
-
visible={true}
|
|
91
|
-
footer={null}
|
|
92
|
-
onCancel={handleCancel}
|
|
93
|
-
>
|
|
94
|
-
<Form
|
|
95
|
-
name="basic"
|
|
96
|
-
form={form}
|
|
97
|
-
labelCol={{ span: 8 }}
|
|
98
|
-
wrapperCol={{ span: 16 }}
|
|
99
|
-
initialValues={data}
|
|
100
|
-
onFinish={onFinish}
|
|
101
|
-
>
|
|
102
|
-
<Form.Item
|
|
103
|
-
label="DID"
|
|
104
|
-
name="customerDid"
|
|
105
|
-
rules={[{ required: true, message: '请输入必填项' }]}
|
|
106
|
-
>
|
|
107
|
-
<Input maxLength={60} placeholder="最多输入60个字符" />
|
|
108
|
-
</Form.Item>
|
|
109
|
-
<Form.Item
|
|
110
|
-
label="DID备注名称"
|
|
111
|
-
name="customerDidNote"
|
|
112
|
-
rules={[{ required: true, message: '请输入必填项' }]}
|
|
113
|
-
>
|
|
114
|
-
<Input maxLength={20} placeholder="最多输入20个字符" />
|
|
115
|
-
</Form.Item>
|
|
116
|
-
<Form.Item
|
|
117
|
-
label="所属公司"
|
|
118
|
-
name="customerName"
|
|
119
|
-
rules={[{ required: true, message: '请输入必填项' }]}
|
|
120
|
-
>
|
|
121
|
-
<Input maxLength={100} placeholder="最多输入100个字符" />
|
|
122
|
-
</Form.Item>
|
|
123
|
-
<Form.Item
|
|
124
|
-
label="我司对应DID"
|
|
125
|
-
name="companyDid"
|
|
126
|
-
rules={[{ required: true, message: '请输入必填项' }]}
|
|
127
|
-
>
|
|
128
|
-
<Select onChange={didChange}>
|
|
129
|
-
{didlist.map((item: any, key: number) => {
|
|
130
|
-
return <Select.Option key={item.participantId} value={item.participantId}>{item.remarkName + ':' + item.participantId}</Select.Option>;
|
|
131
|
-
})}
|
|
132
|
-
</Select>
|
|
133
|
-
</Form.Item>
|
|
134
|
-
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
|
|
135
|
-
<Button type="primary" htmlType="submit" style={{ marginRight: 10 }}>
|
|
136
|
-
提交
|
|
137
|
-
</Button>
|
|
138
|
-
<Button onClick={handleCancel}>
|
|
139
|
-
取消
|
|
140
|
-
</Button>
|
|
141
|
-
</Form.Item>
|
|
142
|
-
</Form>
|
|
143
|
-
</Modal>
|
|
144
|
-
</div >
|
|
145
|
-
|
|
146
|
-
);
|
|
1
|
+
import React, { useCallback, useState, useEffect } from 'react';
|
|
2
|
+
import { Modal, Form, Input, Button, Select } from 'kts-components-antd-x4';
|
|
3
|
+
import Main from '../..';
|
|
4
|
+
/**
|
|
5
|
+
* 手动添加黑白名单弹窗
|
|
6
|
+
* @param
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export default function modalcomfirm(props: any) {
|
|
10
|
+
const [form] = Form.useForm();
|
|
11
|
+
const [data, setData] = useState();
|
|
12
|
+
const controller = Main.useController();
|
|
13
|
+
const params = controller.useMemo((s) => s.params, []);
|
|
14
|
+
const whiteParams = controller.useMemo((s) => s.whiteParams, []);
|
|
15
|
+
const pageMeta = controller.useMemo((s) => s.pageMeta, []);
|
|
16
|
+
const listNature = controller.useMemo((s) => s.listNature, []);
|
|
17
|
+
const didlist = controller.useMemo((s) => s.didlist, []);
|
|
18
|
+
const [defaultValue, setDefault] = React.useState('');
|
|
19
|
+
const [companyDidNote, setNote] = useState('');
|
|
20
|
+
const handleCancel = useCallback(() => {
|
|
21
|
+
controller.pipeline(async s => {
|
|
22
|
+
s.visible = false;
|
|
23
|
+
})()
|
|
24
|
+
}, [])
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
controller.didList({}) as any;
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (didlist.length > 0) {
|
|
30
|
+
const one = didlist.findIndex(item => item.isDefault === true);
|
|
31
|
+
if (~one) {
|
|
32
|
+
setDefault(didlist[one].participantId);
|
|
33
|
+
setNote(didlist[one].remarkName);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, [didlist]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
form.setFieldsValue({ 'companyDid': defaultValue });
|
|
39
|
+
}, [defaultValue]);
|
|
40
|
+
const onFinish = useCallback((values: any) => {
|
|
41
|
+
(async () => {
|
|
42
|
+
values = {
|
|
43
|
+
...values,
|
|
44
|
+
type:listNature,
|
|
45
|
+
companyDidNote
|
|
46
|
+
}
|
|
47
|
+
let res;
|
|
48
|
+
if (listNature === '1') {
|
|
49
|
+
res = await controller.addWhite([values]) as any;
|
|
50
|
+
} else {
|
|
51
|
+
res = await controller.addBlack([values]) as any;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (res.res) {
|
|
55
|
+
if (listNature === '1') {
|
|
56
|
+
const data={
|
|
57
|
+
...whiteParams
|
|
58
|
+
}
|
|
59
|
+
controller.pipeline(async s => {
|
|
60
|
+
s.whiteParams = data;
|
|
61
|
+
})()
|
|
62
|
+
} else {
|
|
63
|
+
const data={
|
|
64
|
+
...params
|
|
65
|
+
}
|
|
66
|
+
controller.pipeline(async s => {
|
|
67
|
+
s.params = data;
|
|
68
|
+
})()
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
handleCancel();
|
|
72
|
+
})()
|
|
73
|
+
|
|
74
|
+
}, [companyDidNote])
|
|
75
|
+
const didChange = useCallback((e) => {
|
|
76
|
+
if (e) {
|
|
77
|
+
const one = didlist.findIndex(item => item.participantId === e);
|
|
78
|
+
|
|
79
|
+
if (~one) {
|
|
80
|
+
setNote(didlist[one].remarkName);
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
setNote('');
|
|
84
|
+
}
|
|
85
|
+
}, [didlist])
|
|
86
|
+
return (
|
|
87
|
+
<div>
|
|
88
|
+
<Modal
|
|
89
|
+
title={`添加${listNature === '1' ? '白名单' : '黑名单'}`}
|
|
90
|
+
visible={true}
|
|
91
|
+
footer={null}
|
|
92
|
+
onCancel={handleCancel}
|
|
93
|
+
>
|
|
94
|
+
<Form
|
|
95
|
+
name="basic"
|
|
96
|
+
form={form}
|
|
97
|
+
labelCol={{ span: 8 }}
|
|
98
|
+
wrapperCol={{ span: 16 }}
|
|
99
|
+
initialValues={data}
|
|
100
|
+
onFinish={onFinish}
|
|
101
|
+
>
|
|
102
|
+
<Form.Item
|
|
103
|
+
label="DID"
|
|
104
|
+
name="customerDid"
|
|
105
|
+
rules={[{ required: true, message: '请输入必填项' }]}
|
|
106
|
+
>
|
|
107
|
+
<Input maxLength={60} placeholder="最多输入60个字符" />
|
|
108
|
+
</Form.Item>
|
|
109
|
+
<Form.Item
|
|
110
|
+
label="DID备注名称"
|
|
111
|
+
name="customerDidNote"
|
|
112
|
+
rules={[{ required: true, message: '请输入必填项' }]}
|
|
113
|
+
>
|
|
114
|
+
<Input maxLength={20} placeholder="最多输入20个字符" />
|
|
115
|
+
</Form.Item>
|
|
116
|
+
<Form.Item
|
|
117
|
+
label="所属公司"
|
|
118
|
+
name="customerName"
|
|
119
|
+
rules={[{ required: true, message: '请输入必填项' }]}
|
|
120
|
+
>
|
|
121
|
+
<Input maxLength={100} placeholder="最多输入100个字符" />
|
|
122
|
+
</Form.Item>
|
|
123
|
+
<Form.Item
|
|
124
|
+
label="我司对应DID"
|
|
125
|
+
name="companyDid"
|
|
126
|
+
rules={[{ required: true, message: '请输入必填项' }]}
|
|
127
|
+
>
|
|
128
|
+
<Select onChange={didChange}>
|
|
129
|
+
{didlist.map((item: any, key: number) => {
|
|
130
|
+
return <Select.Option key={item.participantId} value={item.participantId}>{item.remarkName + ':' + item.participantId}</Select.Option>;
|
|
131
|
+
})}
|
|
132
|
+
</Select>
|
|
133
|
+
</Form.Item>
|
|
134
|
+
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
|
|
135
|
+
<Button type="primary" htmlType="submit" style={{ marginRight: 10 }}>
|
|
136
|
+
提交
|
|
137
|
+
</Button>
|
|
138
|
+
<Button onClick={handleCancel}>
|
|
139
|
+
取消
|
|
140
|
+
</Button>
|
|
141
|
+
</Form.Item>
|
|
142
|
+
</Form>
|
|
143
|
+
</Modal>
|
|
144
|
+
</div >
|
|
145
|
+
|
|
146
|
+
);
|
|
147
147
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const dataStatusEnum:{[key:string]:string} = {
|
|
2
|
-
'1': '使用中',
|
|
3
|
-
'2': '停用',
|
|
4
|
-
}
|
|
5
|
-
const listNatureEnum:{[key:string]:string} = {
|
|
6
|
-
'1': '白名单',
|
|
7
|
-
'2': '黑名单',
|
|
8
|
-
}
|
|
1
|
+
const dataStatusEnum:{[key:string]:string} = {
|
|
2
|
+
'1': '使用中',
|
|
3
|
+
'2': '停用',
|
|
4
|
+
}
|
|
5
|
+
const listNatureEnum:{[key:string]:string} = {
|
|
6
|
+
'1': '白名单',
|
|
7
|
+
'2': '黑名单',
|
|
8
|
+
}
|
|
9
9
|
export { dataStatusEnum,listNatureEnum }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DocumentsCont } from "../../../";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
export default () => {
|
|
5
|
-
return (
|
|
6
|
-
<DocumentsCont path=''/>
|
|
7
|
-
);
|
|
1
|
+
import { DocumentsCont } from "../../../";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export default () => {
|
|
5
|
+
return (
|
|
6
|
+
<DocumentsCont path=''/>
|
|
7
|
+
);
|
|
8
8
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ComponentServicePlatform } from 'kts-component-service';
|
|
3
|
-
import { ComponentService } from 'kts-component-service';
|
|
4
|
-
import { DocumentsService } from "../../../";
|
|
5
|
-
import { extract } from "query-string";
|
|
6
|
-
|
|
7
|
-
export default () => {
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
|
|
10
|
-
// 解决前端跨越问题,此代码跨越忽悠
|
|
11
|
-
try {
|
|
12
|
-
window.document.domain = window.location.host.split('.').slice(-2).join('.').split(':')[0];
|
|
13
|
-
|
|
14
|
-
// 设置 sdk
|
|
15
|
-
DocumentsService.instance.service = new ComponentServicePlatform((window.top as any)['$$_kxl_sdk']);
|
|
16
|
-
|
|
17
|
-
// 设置上下文
|
|
18
|
-
DocumentsService.instance.service.context = '/dap/web';
|
|
19
|
-
} catch (err) {
|
|
20
|
-
console.log(err)
|
|
21
|
-
}
|
|
22
|
-
}, [])
|
|
23
|
-
|
|
24
|
-
return <p>设置通信模块</p>;
|
|
25
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentServicePlatform } from 'kts-component-service';
|
|
3
|
+
import { ComponentService } from 'kts-component-service';
|
|
4
|
+
import { DocumentsService } from "../../../";
|
|
5
|
+
import { extract } from "query-string";
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
|
|
10
|
+
// 解决前端跨越问题,此代码跨越忽悠
|
|
11
|
+
try {
|
|
12
|
+
window.document.domain = window.location.host.split('.').slice(-2).join('.').split(':')[0];
|
|
13
|
+
|
|
14
|
+
// 设置 sdk
|
|
15
|
+
DocumentsService.instance.service = new ComponentServicePlatform((window.top as any)['$$_kxl_sdk']);
|
|
16
|
+
|
|
17
|
+
// 设置上下文
|
|
18
|
+
DocumentsService.instance.service.context = '/dap/web';
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.log(err)
|
|
21
|
+
}
|
|
22
|
+
}, [])
|
|
23
|
+
|
|
24
|
+
return <p>设置通信模块</p>;
|
|
25
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# DocumentsCont
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<code src="./___demo___/setService/index.tsx" ></code>
|
|
5
|
-
|
|
6
|
-
## 基础用法
|
|
7
|
-
<code src="./___demo___/base/index.tsx" ></code>
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# DocumentsCont
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<code src="./___demo___/setService/index.tsx" ></code>
|
|
5
|
+
|
|
6
|
+
## 基础用法
|
|
7
|
+
<code src="./___demo___/base/index.tsx" ></code>
|
|
8
|
+
|
|
9
|
+
|
|
@@ -1,52 +1,55 @@
|
|
|
1
|
-
// import { Tabs } from 'kts-components-antd-x4';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MemoryRouter, Switch, Route, Redirect } from 'react-router-dom';
|
|
4
|
-
import { DocumentsList, DocumentsRule, DocumentWhiteList } from '../';
|
|
5
|
-
import { ConfigProvider } from 'kts-components-antd-x4';
|
|
6
|
-
import zhCN from 'kts-components-antd-x4/lib/locale/zh_CN';
|
|
7
|
-
|
|
8
|
-
export default class DocumentsCont extends React.Component<any> {
|
|
9
|
-
render = () => <Main {...this.props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Main = (props: any) => {
|
|
13
|
-
const initRoute = props.path || '/rulelist'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<Route path="/
|
|
21
|
-
<Route path="/
|
|
22
|
-
<Route
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
//
|
|
1
|
+
// import { Tabs } from 'kts-components-antd-x4';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MemoryRouter, Switch, Route, Redirect } from 'react-router-dom';
|
|
4
|
+
import { DocumentsList, DocumentsRule, DocumentWhiteList, DocumentsService } from '../';
|
|
5
|
+
import { ConfigProvider } from 'kts-components-antd-x4';
|
|
6
|
+
import zhCN from 'kts-components-antd-x4/lib/locale/zh_CN';
|
|
7
|
+
|
|
8
|
+
export default class DocumentsCont extends React.Component<any> {
|
|
9
|
+
render = () => <Main {...this.props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Main = (props: any) => {
|
|
13
|
+
const initRoute = props.path || '/rulelist';
|
|
14
|
+
// const uploadConfig = { domain: (DocumentsService.instance.service as any).sdk.service.domain, token: (DocumentsService.instance.service as any).sdk.user.cToken };
|
|
15
|
+
// console.log(uploadConfig);
|
|
16
|
+
return (
|
|
17
|
+
<ConfigProvider locale={zhCN}>
|
|
18
|
+
<MemoryRouter>
|
|
19
|
+
<Switch>
|
|
20
|
+
{/* <Route path="/home/:key?" component={DocumentsTabs} /> */}
|
|
21
|
+
<Route path="/rulelist" component={DocumentsList} />
|
|
22
|
+
<Route path="/billwhiteliest" component={DocumentWhiteList} />
|
|
23
|
+
<Route path="/rule/:id?/:type?/:profile?" component={DocumentsRule} />
|
|
24
|
+
|
|
25
|
+
<Route render={() => <Redirect to={initRoute} />} />
|
|
26
|
+
</Switch>
|
|
27
|
+
</MemoryRouter>
|
|
28
|
+
</ConfigProvider>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// const DocumentsTabs = () => {
|
|
33
|
+
|
|
34
|
+
// const history = useHistory();
|
|
35
|
+
|
|
36
|
+
// const { key } = useParams<{ key: string }>();
|
|
37
|
+
|
|
38
|
+
// React.useEffect(() => {
|
|
39
|
+
// if (!key) {
|
|
40
|
+
// history.push(`/home/1`);
|
|
41
|
+
// }
|
|
42
|
+
// }, [key])
|
|
43
|
+
|
|
44
|
+
// return (
|
|
45
|
+
// <Switch>
|
|
46
|
+
// <Tabs accessKey={key} onChange={e => { history.push(`/home/${e}`) }} >
|
|
47
|
+
// <Tabs.TabPane tab="单据校验设置" key="1">
|
|
48
|
+
// <Route path="/home/1" component={DocumentsList} />
|
|
49
|
+
// <Route path="/home/1" component={DocumentWhiteList} />
|
|
50
|
+
|
|
51
|
+
// </Tabs.TabPane>
|
|
52
|
+
// </Tabs>
|
|
53
|
+
// </Switch>
|
|
54
|
+
// )
|
|
52
55
|
// }
|