kts-components-document-access-point 1.4.4 → 1.4.7
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 +13 -12
- package/dist/index.js +13 -12
- 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 +126 -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 +119 -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,191 +1,191 @@
|
|
|
1
|
-
import React, { useCallback, useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import { Button, Modal } from 'kts-components-antd-x4';
|
|
3
|
-
import { Table, Pagination } from 'kts-xui';
|
|
4
|
-
import { AdvancedSearch, KtsForm } from 'kts-components';
|
|
5
|
-
import Main from '../..';
|
|
6
|
-
import PageUI from '../pageui';
|
|
7
|
-
import _ from 'lodash';
|
|
8
|
-
//同步批量添加
|
|
9
|
-
export default function modalcomfirm(props: any) {
|
|
10
|
-
const controller = Main.useController();
|
|
11
|
-
const clientInfo = controller.useMemo(s => s.clientInfo, [])
|
|
12
|
-
const [params, setParams] = useState({});
|
|
13
|
-
const whiteParams = controller.useMemo(s => s.whiteParams, [])
|
|
14
|
-
const blackParams = controller.useMemo(s => s.params, [])
|
|
15
|
-
const [pageMeta, setPage] = useState<{ pageSize: number, pageNum: number, total?: number }>({ pageNum: 1, pageSize: 10, total: 0, });
|
|
16
|
-
const [selectedRowKeys, setKey] = useState([]);
|
|
17
|
-
const [list, setList] = useState([]);
|
|
18
|
-
const didlist = controller.useMemo((s) => s.didlist, []);
|
|
19
|
-
const listNature = controller.useMemo((s) => s.listNature, []);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
(async () => {
|
|
22
|
-
const res = await controller.synclist({ ...params, type: listNature, ...pageMeta })
|
|
23
|
-
if (res.res) {
|
|
24
|
-
res.res.items = res.res.items.map((item: any, index: number) => {
|
|
25
|
-
return {
|
|
26
|
-
...item,
|
|
27
|
-
index
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
setList(res.res.items);
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
33
|
-
}, [params, pageMeta])
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
controller.didList({}) as any;
|
|
36
|
-
}, []);
|
|
37
|
-
const onSearchFormSubmit = useCallback((value) => {
|
|
38
|
-
value = {
|
|
39
|
-
...value,
|
|
40
|
-
}
|
|
41
|
-
setParams(value);
|
|
42
|
-
}, []);
|
|
43
|
-
const schema = useMemo(() => {
|
|
44
|
-
const didEnum = didlist.map(item => {
|
|
45
|
-
return { label: item.remarkName + ':' + item.participantId, value: item.participantId };
|
|
46
|
-
})
|
|
47
|
-
return {
|
|
48
|
-
'type': "object",
|
|
49
|
-
properties: {
|
|
50
|
-
customerDid: {
|
|
51
|
-
type: "string",
|
|
52
|
-
title: "DID",
|
|
53
|
-
},
|
|
54
|
-
customerName: {
|
|
55
|
-
type: "string",
|
|
56
|
-
title: "所属公司",
|
|
57
|
-
},
|
|
58
|
-
companyDid: {
|
|
59
|
-
type: "string",
|
|
60
|
-
title: "我司对应DID",
|
|
61
|
-
enum: didEnum
|
|
62
|
-
},
|
|
63
|
-
customerDidNote: {
|
|
64
|
-
type: "string",
|
|
65
|
-
title: "DID备注名称",
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [didlist])
|
|
71
|
-
const onPageChange = (pageNum: any, pageSize: any) => {
|
|
72
|
-
setPage({ pageNum, pageSize })
|
|
73
|
-
}
|
|
74
|
-
const columns = useMemo(() => [
|
|
75
|
-
{
|
|
76
|
-
title: 'DID',
|
|
77
|
-
dataIndex: 'customerDid',
|
|
78
|
-
render: (text: any, record: any) => {
|
|
79
|
-
if (text) {
|
|
80
|
-
return <div><div>{record.customerDidNote}</div>{text}</div>
|
|
81
|
-
} else {
|
|
82
|
-
return ''
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
title: '所属公司',
|
|
88
|
-
dataIndex: 'customerName',
|
|
89
|
-
width: 200
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
title: '我司对应DID',
|
|
93
|
-
dataIndex: 'companyDid',
|
|
94
|
-
render: (text: any, record: any) => {
|
|
95
|
-
if (text) {
|
|
96
|
-
return <div><div>{record.companyDidNote}</div>{text}</div>
|
|
97
|
-
} else {
|
|
98
|
-
return ''
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
], []);
|
|
103
|
-
const rowSelection = useMemo(() => {
|
|
104
|
-
return {
|
|
105
|
-
onChange: (selectedRowKeys: any, rows: any) => {
|
|
106
|
-
|
|
107
|
-
rows = rows && rows.map((item: any) => {
|
|
108
|
-
return {
|
|
109
|
-
...item,
|
|
110
|
-
type: listNature
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
setKey(rows)
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}, []);
|
|
117
|
-
const handleCancel = useCallback(() => {
|
|
118
|
-
controller.pipeline(async s => {
|
|
119
|
-
s.clientModal = false;
|
|
120
|
-
})()
|
|
121
|
-
}, [])
|
|
122
|
-
const onSubmit = useCallback(() => {
|
|
123
|
-
(async () => {
|
|
124
|
-
let res;
|
|
125
|
-
if (listNature === '1') {
|
|
126
|
-
res = await controller.addWhite(selectedRowKeys) as any;
|
|
127
|
-
} else {
|
|
128
|
-
res = await controller.addBlack(selectedRowKeys) as any;
|
|
129
|
-
}
|
|
130
|
-
if (res.res) {
|
|
131
|
-
|
|
132
|
-
if (listNature === '1') {
|
|
133
|
-
const data = {
|
|
134
|
-
...whiteParams,
|
|
135
|
-
type: listNature
|
|
136
|
-
}
|
|
137
|
-
controller.getWhitelist(data);
|
|
138
|
-
} else {
|
|
139
|
-
const data = {
|
|
140
|
-
...blackParams,
|
|
141
|
-
type: listNature
|
|
142
|
-
}
|
|
143
|
-
controller.getBlacklist(data);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
handleCancel();
|
|
147
|
-
})()
|
|
148
|
-
}, [selectedRowKeys]);
|
|
149
|
-
return (
|
|
150
|
-
<div>
|
|
151
|
-
<Modal
|
|
152
|
-
title={clientInfo.buttonName}
|
|
153
|
-
visible={true}
|
|
154
|
-
footer={null}
|
|
155
|
-
onCancel={handleCancel}
|
|
156
|
-
width={1000}
|
|
157
|
-
>
|
|
158
|
-
<div style={{ marginBottom: 24, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
159
|
-
<AdvancedSearch
|
|
160
|
-
width={480}
|
|
161
|
-
height={44}
|
|
162
|
-
compact={true}
|
|
163
|
-
defaultKey="customerDid"
|
|
164
|
-
placeholder="输入DID"
|
|
165
|
-
searchFormSubmit={onSearchFormSubmit}
|
|
166
|
-
>
|
|
167
|
-
<KtsForm
|
|
168
|
-
labelCol={9}
|
|
169
|
-
wrapperCol={15}
|
|
170
|
-
labelAlign='left'
|
|
171
|
-
compact={true}
|
|
172
|
-
schema={schema}
|
|
173
|
-
defaultValue={_.pick(params, ['customerDid', 'customerDidNote', 'companyDid', 'customerName'])}
|
|
174
|
-
>
|
|
175
|
-
</KtsForm>
|
|
176
|
-
</AdvancedSearch>
|
|
177
|
-
<div>
|
|
178
|
-
<Button onClick={handleCancel} style={{ marginRight: 20 }}>取消</Button>
|
|
179
|
-
<Button disabled={selectedRowKeys.length > 0 ? false : true} type="primary" onClick={onSubmit}>提交</Button>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
<p>{clientInfo.noticeMessage}</p>
|
|
183
|
-
<Table rowSelection={rowSelection} columns={columns} rowKey="index" dataSource={list} pagination={false} />
|
|
184
|
-
{/* {pageMeta && <PageUI data={pageMeta} onChange={onPageChange} />} */}
|
|
185
|
-
{pageMeta && <Pagination onChange={onPageChange} style={{ padding: '16px 0', flex: 'none', background: 'white', textAlign: 'center' }} total={pageMeta.total} pageSize={pageMeta.pageSize} current={pageMeta.pageNum} showSizeChanger={true} />}
|
|
186
|
-
|
|
187
|
-
</Modal>
|
|
188
|
-
</div >
|
|
189
|
-
|
|
190
|
-
);
|
|
1
|
+
import React, { useCallback, useState, useEffect, useMemo } from 'react';
|
|
2
|
+
import { Button, Modal } from 'kts-components-antd-x4';
|
|
3
|
+
import { Table, Pagination } from 'kts-xui';
|
|
4
|
+
import { AdvancedSearch, KtsForm } from 'kts-components';
|
|
5
|
+
import Main from '../..';
|
|
6
|
+
import PageUI from '../pageui';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
//同步批量添加
|
|
9
|
+
export default function modalcomfirm(props: any) {
|
|
10
|
+
const controller = Main.useController();
|
|
11
|
+
const clientInfo = controller.useMemo(s => s.clientInfo, [])
|
|
12
|
+
const [params, setParams] = useState({});
|
|
13
|
+
const whiteParams = controller.useMemo(s => s.whiteParams, [])
|
|
14
|
+
const blackParams = controller.useMemo(s => s.params, [])
|
|
15
|
+
const [pageMeta, setPage] = useState<{ pageSize: number, pageNum: number, total?: number }>({ pageNum: 1, pageSize: 10, total: 0, });
|
|
16
|
+
const [selectedRowKeys, setKey] = useState([]);
|
|
17
|
+
const [list, setList] = useState([]);
|
|
18
|
+
const didlist = controller.useMemo((s) => s.didlist, []);
|
|
19
|
+
const listNature = controller.useMemo((s) => s.listNature, []);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
(async () => {
|
|
22
|
+
const res = await controller.synclist({ ...params, type: listNature, ...pageMeta })
|
|
23
|
+
if (res.res) {
|
|
24
|
+
res.res.items = res.res.items.map((item: any, index: number) => {
|
|
25
|
+
return {
|
|
26
|
+
...item,
|
|
27
|
+
index
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
setList(res.res.items);
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
}, [params, pageMeta])
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
controller.didList({}) as any;
|
|
36
|
+
}, []);
|
|
37
|
+
const onSearchFormSubmit = useCallback((value) => {
|
|
38
|
+
value = {
|
|
39
|
+
...value,
|
|
40
|
+
}
|
|
41
|
+
setParams(value);
|
|
42
|
+
}, []);
|
|
43
|
+
const schema = useMemo(() => {
|
|
44
|
+
const didEnum = didlist.map(item => {
|
|
45
|
+
return { label: item.remarkName + ':' + item.participantId, value: item.participantId };
|
|
46
|
+
})
|
|
47
|
+
return {
|
|
48
|
+
'type': "object",
|
|
49
|
+
properties: {
|
|
50
|
+
customerDid: {
|
|
51
|
+
type: "string",
|
|
52
|
+
title: "DID",
|
|
53
|
+
},
|
|
54
|
+
customerName: {
|
|
55
|
+
type: "string",
|
|
56
|
+
title: "所属公司",
|
|
57
|
+
},
|
|
58
|
+
companyDid: {
|
|
59
|
+
type: "string",
|
|
60
|
+
title: "我司对应DID",
|
|
61
|
+
enum: didEnum
|
|
62
|
+
},
|
|
63
|
+
customerDidNote: {
|
|
64
|
+
type: "string",
|
|
65
|
+
title: "DID备注名称",
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [didlist])
|
|
71
|
+
const onPageChange = (pageNum: any, pageSize: any) => {
|
|
72
|
+
setPage({ pageNum, pageSize })
|
|
73
|
+
}
|
|
74
|
+
const columns = useMemo(() => [
|
|
75
|
+
{
|
|
76
|
+
title: 'DID',
|
|
77
|
+
dataIndex: 'customerDid',
|
|
78
|
+
render: (text: any, record: any) => {
|
|
79
|
+
if (text) {
|
|
80
|
+
return <div><div>{record.customerDidNote}</div>{text}</div>
|
|
81
|
+
} else {
|
|
82
|
+
return ''
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: '所属公司',
|
|
88
|
+
dataIndex: 'customerName',
|
|
89
|
+
width: 200
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: '我司对应DID',
|
|
93
|
+
dataIndex: 'companyDid',
|
|
94
|
+
render: (text: any, record: any) => {
|
|
95
|
+
if (text) {
|
|
96
|
+
return <div><div>{record.companyDidNote}</div>{text}</div>
|
|
97
|
+
} else {
|
|
98
|
+
return ''
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
], []);
|
|
103
|
+
const rowSelection = useMemo(() => {
|
|
104
|
+
return {
|
|
105
|
+
onChange: (selectedRowKeys: any, rows: any) => {
|
|
106
|
+
|
|
107
|
+
rows = rows && rows.map((item: any) => {
|
|
108
|
+
return {
|
|
109
|
+
...item,
|
|
110
|
+
type: listNature
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
setKey(rows)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, []);
|
|
117
|
+
const handleCancel = useCallback(() => {
|
|
118
|
+
controller.pipeline(async s => {
|
|
119
|
+
s.clientModal = false;
|
|
120
|
+
})()
|
|
121
|
+
}, [])
|
|
122
|
+
const onSubmit = useCallback(() => {
|
|
123
|
+
(async () => {
|
|
124
|
+
let res;
|
|
125
|
+
if (listNature === '1') {
|
|
126
|
+
res = await controller.addWhite(selectedRowKeys) as any;
|
|
127
|
+
} else {
|
|
128
|
+
res = await controller.addBlack(selectedRowKeys) as any;
|
|
129
|
+
}
|
|
130
|
+
if (res.res) {
|
|
131
|
+
|
|
132
|
+
if (listNature === '1') {
|
|
133
|
+
const data = {
|
|
134
|
+
...whiteParams,
|
|
135
|
+
type: listNature
|
|
136
|
+
}
|
|
137
|
+
controller.getWhitelist(data);
|
|
138
|
+
} else {
|
|
139
|
+
const data = {
|
|
140
|
+
...blackParams,
|
|
141
|
+
type: listNature
|
|
142
|
+
}
|
|
143
|
+
controller.getBlacklist(data);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
handleCancel();
|
|
147
|
+
})()
|
|
148
|
+
}, [selectedRowKeys]);
|
|
149
|
+
return (
|
|
150
|
+
<div>
|
|
151
|
+
<Modal
|
|
152
|
+
title={clientInfo.buttonName}
|
|
153
|
+
visible={true}
|
|
154
|
+
footer={null}
|
|
155
|
+
onCancel={handleCancel}
|
|
156
|
+
width={1000}
|
|
157
|
+
>
|
|
158
|
+
<div style={{ marginBottom: 24, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
159
|
+
<AdvancedSearch
|
|
160
|
+
width={480}
|
|
161
|
+
height={44}
|
|
162
|
+
compact={true}
|
|
163
|
+
defaultKey="customerDid"
|
|
164
|
+
placeholder="输入DID"
|
|
165
|
+
searchFormSubmit={onSearchFormSubmit}
|
|
166
|
+
>
|
|
167
|
+
<KtsForm
|
|
168
|
+
labelCol={9}
|
|
169
|
+
wrapperCol={15}
|
|
170
|
+
labelAlign='left'
|
|
171
|
+
compact={true}
|
|
172
|
+
schema={schema}
|
|
173
|
+
defaultValue={_.pick(params, ['customerDid', 'customerDidNote', 'companyDid', 'customerName'])}
|
|
174
|
+
>
|
|
175
|
+
</KtsForm>
|
|
176
|
+
</AdvancedSearch>
|
|
177
|
+
<div>
|
|
178
|
+
<Button onClick={handleCancel} style={{ marginRight: 20 }}>取消</Button>
|
|
179
|
+
<Button disabled={selectedRowKeys.length > 0 ? false : true} type="primary" onClick={onSubmit}>提交</Button>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<p>{clientInfo.noticeMessage}</p>
|
|
183
|
+
<Table rowSelection={rowSelection} columns={columns} rowKey="index" dataSource={list} pagination={false} />
|
|
184
|
+
{/* {pageMeta && <PageUI data={pageMeta} onChange={onPageChange} />} */}
|
|
185
|
+
{pageMeta && <Pagination onChange={onPageChange} style={{ padding: '16px 0', flex: 'none', background: 'white', textAlign: 'center' }} total={pageMeta.total} pageSize={pageMeta.pageSize} current={pageMeta.pageNum} showSizeChanger={true} />}
|
|
186
|
+
|
|
187
|
+
</Modal>
|
|
188
|
+
</div >
|
|
189
|
+
|
|
190
|
+
);
|
|
191
191
|
}
|
|
@@ -1,133 +1,127 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
2
|
-
import { Table, AutoTableContainer, Pagination, message } from 'kts-xui';
|
|
3
|
-
import { dataStatusEnum, listNatureEnum } from '../../util/ConfigEnum';
|
|
4
|
-
import Main from '../..';
|
|
5
|
-
import moment from 'moment';
|
|
6
|
-
import Header from '../pageheader/BlackHeader'
|
|
7
|
-
export default function Rule(props: any) {
|
|
8
|
-
const controller = Main.useController();
|
|
9
|
-
const list = controller.useMemo((s) => s.blacklist, []);
|
|
10
|
-
const [pageMeta, setpageMeta] = useState<{ pageSize: number, pageNum: number, total?: number }>({ pageSize: 10, pageNum: 1, total: 0, });
|
|
11
|
-
// const [pageParams, setpageParams] = useState<{ pageSize?: number, pageNum?: number, total?: number }>({ pageSize: 10, pageNum: 1, });
|
|
12
|
-
// const pageMeta = controller.useMemo((s) => s.pageMeta, []);
|
|
13
|
-
const params = controller.useMemo((s) => s.params, []);
|
|
14
|
-
const onPageChange = (pageNum: any, pageSize: any) => {
|
|
15
|
-
controller.pipeline(async s => {
|
|
16
|
-
s.params = { ...s.params, pageNum, pageSize };
|
|
17
|
-
})()
|
|
18
|
-
}
|
|
19
|
-
const onEnablehander = useCallback((type: number, record: any) => {
|
|
20
|
-
(async () => {
|
|
21
|
-
const res = await controller.enableblacklist({
|
|
22
|
-
flag: type,
|
|
23
|
-
didList: [record]
|
|
24
|
-
})
|
|
25
|
-
if (res.res) {
|
|
26
|
-
refreshList();
|
|
27
|
-
}
|
|
28
|
-
})()
|
|
29
|
-
}, [params]);
|
|
30
|
-
const columns = useMemo(() => [
|
|
31
|
-
{
|
|
32
|
-
title: 'DID',
|
|
33
|
-
dataIndex: 'customerDid',
|
|
34
|
-
render: (text: any, record: any) => {
|
|
35
|
-
if (text) {
|
|
36
|
-
return <div><div>{record.customerDidNote}</div>{text}</div>
|
|
37
|
-
} else {
|
|
38
|
-
return ''
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: '所属公司',
|
|
44
|
-
width: 200,
|
|
45
|
-
dataIndex: 'customerName',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
title: '数据状态',
|
|
49
|
-
dataIndex: 'dataStatus',
|
|
50
|
-
width: 100,
|
|
51
|
-
render: (text: any) => {
|
|
52
|
-
if (text === 2) {
|
|
53
|
-
return <span>停用</span>
|
|
54
|
-
}
|
|
55
|
-
if (text === 1) {
|
|
56
|
-
return <span style={{ color: '#0074ff' }}>使用中</span>
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
title: '我司对应DID',
|
|
62
|
-
dataIndex: 'companyDid',
|
|
63
|
-
render: (text: any, record: any) => {
|
|
64
|
-
if (text) {
|
|
65
|
-
return <div><div>{record.companyDidNote}</div>{text}</div>
|
|
66
|
-
} else {
|
|
67
|
-
return ''
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
title: '加入时间',
|
|
73
|
-
dataIndex: 'createTime',
|
|
74
|
-
width: 200,
|
|
75
|
-
render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<a className="tabel-action" onClick={() => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<Header />
|
|
128
|
-
<AutoTableContainer style={{ flex: 1, padding: '0 20px', backgroundColor: '#efefef' }} >
|
|
129
|
-
<Table rowSelection={rowSelection} columns={columns} rowKey="index" dataSource={list} pagination={false} />
|
|
130
|
-
</AutoTableContainer>
|
|
131
|
-
{pageMeta && <Pagination onChange={onPageChange} style={{ padding: '16px 0', flex: 'none', background: 'white', textAlign: 'center' }} total={pageMeta.total} pageSize={pageMeta.pageSize} current={pageMeta.pageNum} showSizeChanger={true} />}
|
|
132
|
-
</>);
|
|
1
|
+
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
2
|
+
import { Table, AutoTableContainer, Pagination, message } from 'kts-xui';
|
|
3
|
+
import { dataStatusEnum, listNatureEnum } from '../../util/ConfigEnum';
|
|
4
|
+
import Main from '../..';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import Header from '../pageheader/BlackHeader'
|
|
7
|
+
export default function Rule(props: any) {
|
|
8
|
+
const controller = Main.useController();
|
|
9
|
+
const list = controller.useMemo((s) => s.blacklist, []);
|
|
10
|
+
const [pageMeta, setpageMeta] = useState<{ pageSize: number, pageNum: number, total?: number }>({ pageSize: 10, pageNum: 1, total: 0, });
|
|
11
|
+
// const [pageParams, setpageParams] = useState<{ pageSize?: number, pageNum?: number, total?: number }>({ pageSize: 10, pageNum: 1, });
|
|
12
|
+
// const pageMeta = controller.useMemo((s) => s.pageMeta, []);
|
|
13
|
+
const params = controller.useMemo((s) => s.params, []);
|
|
14
|
+
const onPageChange = (pageNum: any, pageSize: any) => {
|
|
15
|
+
controller.pipeline(async s => {
|
|
16
|
+
s.params = { ...s.params, pageNum, pageSize };
|
|
17
|
+
})()
|
|
18
|
+
}
|
|
19
|
+
const onEnablehander = useCallback((type: number, record: any) => {
|
|
20
|
+
(async () => {
|
|
21
|
+
const res = await controller.enableblacklist({
|
|
22
|
+
flag: type,
|
|
23
|
+
didList: [record]
|
|
24
|
+
})
|
|
25
|
+
if (res.res) {
|
|
26
|
+
refreshList();
|
|
27
|
+
}
|
|
28
|
+
})()
|
|
29
|
+
}, [params]);
|
|
30
|
+
const columns = useMemo(() => [
|
|
31
|
+
{
|
|
32
|
+
title: 'DID',
|
|
33
|
+
dataIndex: 'customerDid',
|
|
34
|
+
render: (text: any, record: any) => {
|
|
35
|
+
if (text) {
|
|
36
|
+
return <div><div>{record.customerDidNote}</div>{text}</div>
|
|
37
|
+
} else {
|
|
38
|
+
return ''
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: '所属公司',
|
|
44
|
+
width: 200,
|
|
45
|
+
dataIndex: 'customerName',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: '数据状态',
|
|
49
|
+
dataIndex: 'dataStatus',
|
|
50
|
+
width: 100,
|
|
51
|
+
render: (text: any) => {
|
|
52
|
+
if (text === 2) {
|
|
53
|
+
return <span>停用</span>
|
|
54
|
+
}
|
|
55
|
+
if (text === 1) {
|
|
56
|
+
return <span style={{ color: '#0074ff' }}>使用中</span>
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: '我司对应DID',
|
|
62
|
+
dataIndex: 'companyDid',
|
|
63
|
+
render: (text: any, record: any) => {
|
|
64
|
+
if (text) {
|
|
65
|
+
return <div><div>{record.companyDidNote}</div>{text}</div>
|
|
66
|
+
} else {
|
|
67
|
+
return ''
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: '加入时间',
|
|
73
|
+
dataIndex: 'createTime',
|
|
74
|
+
width: 200,
|
|
75
|
+
render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: '操作',
|
|
79
|
+
width: 80,
|
|
80
|
+
dataIndex: 'console',
|
|
81
|
+
render: (text: any, record: any) => (
|
|
82
|
+
<span>
|
|
83
|
+
{/* {
|
|
84
|
+
record.listNature === 1 ?
|
|
85
|
+
<a className="tabel-action" onClick={() => { onBlackhander(2, record); }}>标记黑名单</a>
|
|
86
|
+
: <a className="tabel-action" onClick={() => { onBlackhander(1, record); }}>取消黑名单</a>
|
|
87
|
+
} */}
|
|
88
|
+
{
|
|
89
|
+
record.dataStatus === 1 ?
|
|
90
|
+
<a className="tabel-action" onClick={() => { onEnablehander(2, record); }}>停用</a>
|
|
91
|
+
: <a className="tabel-action" onClick={() => { onEnablehander(1, record); }}>启用</a>
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
</span>
|
|
95
|
+
)
|
|
96
|
+
},
|
|
97
|
+
], [onEnablehander]);
|
|
98
|
+
|
|
99
|
+
const refreshList=useCallback(()=>{
|
|
100
|
+
(async () => {
|
|
101
|
+
const res = await controller.getBlacklist(params);
|
|
102
|
+
if (res.res) {
|
|
103
|
+
setpageMeta(res.res.pageMeta);
|
|
104
|
+
}
|
|
105
|
+
})()
|
|
106
|
+
},[params]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
refreshList();
|
|
109
|
+
}, [params]);
|
|
110
|
+
const rowSelection = useMemo(() => {
|
|
111
|
+
return {
|
|
112
|
+
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
|
113
|
+
controller.pipeline(async s => {
|
|
114
|
+
s.selectedBlackRowKey = selectedRows;
|
|
115
|
+
})()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, []);
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<Header />
|
|
122
|
+
<AutoTableContainer style={{ flex: 1, padding: '0 20px', backgroundColor: '#efefef' }} >
|
|
123
|
+
<Table rowSelection={rowSelection} columns={columns} rowKey="index" dataSource={list} pagination={false} />
|
|
124
|
+
</AutoTableContainer>
|
|
125
|
+
{pageMeta && <Pagination onChange={onPageChange} style={{ padding: '16px 0', flex: 'none', background: 'white', textAlign: 'center' }} total={pageMeta.total} pageSize={pageMeta.pageSize} current={pageMeta.pageNum} showSizeChanger={true} />}
|
|
126
|
+
</>);
|
|
133
127
|
}
|