kts-components-document-access-point 1.2.8 → 1.2.9

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.
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useState, useEffect, useMemo } from 'react';
2
- import { Button, Modal, Table } from 'kts-components-antd-x4';
2
+ import { Button, Modal } from 'kts-components-antd-x4';
3
+ import { Table, Pagination } from 'kts-xui';
3
4
  import { AdvancedSearch, KtsForm } from 'kts-components';
4
5
  import Main from '../..';
5
6
  import PageUI from '../pageui';
@@ -11,15 +12,14 @@ export default function modalcomfirm(props: any) {
11
12
  const [params, setParams] = useState({});
12
13
  const whiteParams = controller.useMemo(s => s.whiteParams, [])
13
14
  const blackParams = controller.useMemo(s => s.params, [])
14
- const [pageMeta, setPage] = useState({ pageNum: 1, pageSize: 10 });
15
+ const [pageMeta, setPage] = useState<{ pageSize: number, pageNum: number, total?: number }>({ pageNum: 1, pageSize: 10, total: 0, });
15
16
  const [selectedRowKeys, setKey] = useState([]);
16
17
  const [list, setList] = useState([]);
17
18
  const didlist = controller.useMemo((s) => s.didlist, []);
18
19
  const listNature = controller.useMemo((s) => s.listNature, []);
19
- const [companyDidNote, setNote] = useState('');
20
20
  useEffect(() => {
21
21
  (async () => {
22
- const res = await controller.synclist({ ...params, type:listNature, ...pageMeta })
22
+ const res = await controller.synclist({ ...params, type: listNature, ...pageMeta })
23
23
  if (res.res) {
24
24
  setList(res.res.items);
25
25
  }
@@ -69,17 +69,25 @@ export default function modalcomfirm(props: any) {
69
69
  {
70
70
  title: 'DID',
71
71
  dataIndex: 'customerDid',
72
+ render: (text: any, record: any) => {
73
+ if (text) {
74
+ return <div><div>{record.customerDidNote}</div>{text}</div>
75
+ } else {
76
+ return ''
77
+ }
78
+ }
72
79
  },
73
80
  {
74
81
  title: '所属公司',
75
82
  dataIndex: 'customerName',
83
+ width: 200
76
84
  },
77
85
  {
78
86
  title: '对应我的DID',
79
87
  dataIndex: 'companyDid',
80
88
  render: (text: any, record: any) => {
81
89
  if (text) {
82
- return <span>{record.companyDidNote}:{text}</span>
90
+ return <div><div>{record.companyDidNote}</div>{text}</div>
83
91
  } else {
84
92
  return ''
85
93
  }
@@ -109,7 +117,7 @@ export default function modalcomfirm(props: any) {
109
117
  (async () => {
110
118
  const res = await controller.addWhite(selectedRowKeys) as any;
111
119
  if (res.res) {
112
-
120
+
113
121
  if (listNature === '1') {
114
122
  const data = {
115
123
  ...whiteParams,
@@ -134,9 +142,9 @@ export default function modalcomfirm(props: any) {
134
142
  visible={true}
135
143
  footer={null}
136
144
  onCancel={handleCancel}
137
- width={800}
145
+ width={1000}
138
146
  >
139
- <div style={{ marginBottom: 24 }}>
147
+ <div style={{ marginBottom: 24, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
140
148
  <AdvancedSearch
141
149
  width={480}
142
150
  height={44}
@@ -155,12 +163,16 @@ export default function modalcomfirm(props: any) {
155
163
  >
156
164
  </KtsForm>
157
165
  </AdvancedSearch>
166
+ <div>
167
+ <Button onClick={handleCancel} style={{ marginRight: 20 }}>取消</Button>
168
+ <Button disabled={selectedRowKeys.length > 0 ? false : true} type="primary" onClick={onSubmit}>提交</Button>
169
+ </div>
158
170
  </div>
159
171
  <p>{clientInfo.noticeMessage}</p>
160
172
  <Table rowSelection={rowSelection} columns={columns} rowKey="customerDid" dataSource={list} pagination={false} />
161
- {pageMeta && <PageUI data={pageMeta} onChange={onPageChange} />}
162
- <Button onClick={handleCancel} style={{ marginRight: 20 }}>取消</Button>
163
- <Button type="primary" onClick={onSubmit}>提交</Button>
173
+ {/* {pageMeta && <PageUI data={pageMeta} onChange={onPageChange} />} */}
174
+ {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} />}
175
+
164
176
  </Modal>
165
177
  </div >
166
178
 
@@ -18,14 +18,23 @@ export default function Rule(props: any) {
18
18
  {
19
19
  title: 'DID',
20
20
  dataIndex: 'customerDid',
21
+ render: (text: any, record: any) => {
22
+ if (text) {
23
+ return <div><div>{record.customerDidNote}</div>{text}</div>
24
+ } else {
25
+ return ''
26
+ }
27
+ }
21
28
  },
22
29
  {
23
30
  title: '所属公司',
31
+ width: 200,
24
32
  dataIndex: 'customerName',
25
33
  },
26
34
  {
27
35
  title: '数据状态',
28
36
  dataIndex: 'dataStatus',
37
+ width: 100,
29
38
  render: (text: any) => dataStatusEnum[text]
30
39
  },
31
40
  {
@@ -33,7 +42,7 @@ export default function Rule(props: any) {
33
42
  dataIndex: 'companyDid',
34
43
  render: (text: any, record: any) => {
35
44
  if (text) {
36
- return <span>{record.customerDidNote}:{text}</span>
45
+ return <div><div>{record.companyDidNote}</div>{text}</div>
37
46
  } else {
38
47
  return ''
39
48
  }
@@ -42,15 +51,18 @@ export default function Rule(props: any) {
42
51
  {
43
52
  title: '加入时间',
44
53
  dataIndex: 'createTime',
54
+ width:200,
45
55
  render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
46
56
  },
47
57
  {
48
58
  title: '最近更新时间',
59
+ width:200,
49
60
  dataIndex: 'updateTime',
50
61
  render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
51
62
  },
52
63
  {
53
64
  title: '操作',
65
+ width: 80,
54
66
  dataIndex: 'console',
55
67
  render: (text: any, record: any) => (
56
68
  <span>
@@ -26,29 +26,6 @@ export default function Rule(props: any) {
26
26
  }, [mode]);
27
27
  return (
28
28
  <>
29
- {/* <PageHeaderTop
30
- activeKey={activeKey}
31
- onChange={tabsOnChange}
32
- tabs={[
33
- {
34
- tab: <div>
35
- <span>白名单设置</span>
36
- </div>, tabKey: '/whitelist'
37
- },
38
- {
39
- tab: <div>
40
- <span>黑名单设置</span>
41
- </div>, tabKey: '/blacklist'
42
- },
43
- {
44
- tab: <div>
45
- <span>切换过滤方式</span>
46
- </div>, tabKey: '/switchmode'
47
- },
48
-
49
- ]}
50
- >
51
- </PageHeaderTop> */}
52
29
  <div style={{ padding: '16px 20px', display: 'flex', justifyContent: "space-between", borderBottom: '1px solid #f0f0f0' }}>
53
30
  <Radio.Group defaultValue="/whitelist" onChange={tabsOnChange}>
54
31
  <Radio.Button value="/whitelist">白名单设置</Radio.Button>
@@ -17,14 +17,23 @@ export default function Rule(props: any) {
17
17
  {
18
18
  title: 'DID',
19
19
  dataIndex: 'customerDid',
20
+ render: (text: any, record: any) => {
21
+ if (text) {
22
+ return <div><div>{record.customerDidNote}</div>{text}</div>
23
+ } else {
24
+ return ''
25
+ }
26
+ }
20
27
  },
21
28
  {
22
29
  title: '所属公司',
23
30
  dataIndex: 'customerName',
31
+ width: 200
24
32
  },
25
33
  {
26
34
  title: '数据状态',
27
35
  dataIndex: 'dataStatus',
36
+ width: 100,
28
37
  render: (text: any) => dataStatusEnum[text]
29
38
  },
30
39
  {
@@ -32,7 +41,7 @@ export default function Rule(props: any) {
32
41
  dataIndex: 'companyDid',
33
42
  render: (text: any, record: any) => {
34
43
  if (text) {
35
- return <span>{record.customerDidNote}:{text}</span>
44
+ return <div><div>{record.companyDidNote}</div>{text}</div>
36
45
  } else {
37
46
  return ''
38
47
  }
@@ -41,16 +50,19 @@ export default function Rule(props: any) {
41
50
  {
42
51
  title: '加入时间',
43
52
  dataIndex: 'createTime',
53
+ width:200,
44
54
  render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
45
55
  },
46
56
  {
47
57
  title: '最近更新时间',
48
58
  dataIndex: 'updateTime',
59
+ width:200,
49
60
  render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm')
50
61
  },
51
62
  {
52
63
  title: '操作',
53
64
  dataIndex: 'console',
65
+ width:80,
54
66
  render: (text: any, record: any) => (
55
67
  <span>
56
68
  {/* {
@@ -25,12 +25,24 @@ export default () => {
25
25
  controller.checkclient();
26
26
  }, []);
27
27
  useEffect(() => {
28
- controller.didList({});
28
+ // console.log(controller);
29
+ // controller.pipeline(controller.didList)({})
30
+ (async () => {
31
+ const res = await controller.didList({}) as any;
32
+ if (!res.err) {
33
+ controller.pipeline(async s => {
34
+ s.didlist = res.res;
35
+ })()
36
+ }
37
+ })();
38
+
39
+
29
40
  }, []);
30
41
  useEffect(() => {
31
42
  const didEnum = didlist.map(item => {
32
43
  return { label: item.remarkName + ':' + item.participantId, value: item.participantId };
33
44
  })
45
+
34
46
  let obj: any = {
35
47
  type: "object",
36
48
  properties: {
@@ -104,21 +104,21 @@ export default function modalcomfirm(props: any) {
104
104
  name="customerDid"
105
105
  rules={[{ required: true, message: '请输入必填项' }]}
106
106
  >
107
- <Input maxLength={200} placeholder="最多输入200个字符" />
107
+ <Input maxLength={60} placeholder="最多输入60个字符" />
108
108
  </Form.Item>
109
109
  <Form.Item
110
110
  label="DID备注名称"
111
111
  name="customerDidNote"
112
112
  rules={[{ required: true, message: '请输入必填项' }]}
113
113
  >
114
- <Input maxLength={200} placeholder="最多输入200个字符" />
114
+ <Input maxLength={20} placeholder="最多输入20个字符" />
115
115
  </Form.Item>
116
116
  <Form.Item
117
117
  label="所属公司"
118
118
  name="customerName"
119
119
  rules={[{ required: true, message: '请输入必填项' }]}
120
120
  >
121
- <Input maxLength={500} placeholder="最多输入500个字符" />
121
+ <Input maxLength={100} placeholder="最多输入100个字符" />
122
122
  </Form.Item>
123
123
  <Form.Item
124
124
  label="对应我的DID"
@@ -3,6 +3,6 @@ import React from "react";
3
3
 
4
4
  export default () => {
5
5
  return (
6
- <DocumentsCont path=''/>
6
+ <DocumentsCont path='/billwhiteliest'/>
7
7
  );
8
8
  };
@@ -1,5 +1,6 @@
1
1
  import React, { createContext, useEffect } from 'react';
2
2
  // import PageHeader from './ui/PageHeader'
3
+ import qs from 'query-string';
3
4
  import RuleTable from './ui/RuleTable'
4
5
  import DocumentsListController from './DocumentsListController';
5
6
  import SendList from './ui/sendlist'
@@ -21,12 +22,12 @@ const Main = (props: any) => {
21
22
  const controller = React.useMemo(() => new DocumentsListController(), []);
22
23
  const type = controller.useMemo(s => s.type, []);
23
24
  useEffect(() => {
24
- const params = props.location.query && props.location.query.type;
25
- console.log(props)
26
- if (params) {
25
+ const params = props.location.state;
26
+ const tab = params && params.type;
27
+ console.log(tab)
28
+ if (tab) {
27
29
  controller.pipeline(async s => {
28
- s.type = Number(params);
29
- console.log(params)
30
+ s.type = Number(tab);
30
31
  })()
31
32
  }
32
33
  }, [type]);
@@ -47,6 +47,7 @@ export default () => {
47
47
  controller.pipeline(async s => {
48
48
  s.type = e.target.value;
49
49
  s.params = {}
50
+ history.push({ pathname: '/rulelist', state: { type: e.target.value } })
50
51
  })()
51
52
  }, [])
52
53
  const handleCancel = React.useCallback(() => {
@@ -155,7 +155,7 @@ export default function Rule(props: any) {
155
155
  message.success('保存成功');
156
156
  setChange(false);
157
157
  setRecord(res.res);
158
- if(publish){
158
+ if (publish) {
159
159
  onSendCheck();
160
160
  }
161
161
  }
@@ -223,9 +223,9 @@ export default function Rule(props: any) {
223
223
  }, [hasChange]);
224
224
  const goBack = useCallback(() => {
225
225
  if (type === 'record') {
226
- history.push({ pathname: `/rulelist`, search: `?type=2` })
226
+ history.push({ pathname: `/rulelist`, state: { type: 2 } })
227
227
  } else {
228
- history.goBack();
228
+ history.push({ pathname: `/rulelist`, state: { type: 1 } })
229
229
  }
230
230
  }, []);
231
231
  return <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>