kts-components-document-access-point 1.2.6 → 1.2.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-components-document-access-point",
3
- "version": "1.2.6",
3
+ "version": "1.2.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "dumi dev",
@@ -6,10 +6,14 @@ import { IParams } from '../../../interface'
6
6
 
7
7
  export default async (s: ControllerState, params?: IParams) => {
8
8
  const res = await DocumentsService.instance.service?.call({ url: '/participant/list', data: params, type: 'post' }) as any;
9
+ // return res;
9
10
  if (res.err) {
10
11
  return false;
11
12
  }
12
13
  if (res.res) {
13
- s.didlist = res.res ;
14
+
15
+ s.didlist = res.res;
16
+ return res;
17
+ // console.log(s.didlist);
14
18
  }
15
19
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { IParams, IPageMeta, IFilter } from '../../interface'
2
+ import { IPageMeta, IFilter } from '../../interface'
3
3
 
4
4
  export interface IBillEnum {
5
5
  name: string;
@@ -26,7 +26,6 @@ const Main = (props: any) => {
26
26
  return (
27
27
  <MainContext.Provider value={controller}>
28
28
  <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
29
- {/* <Header /> */}
30
29
  <RulePage />
31
30
  {
32
31
  visible &&
@@ -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='/billwhiteliest'/>
6
+ <DocumentsCont path=''/>
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,10 +22,11 @@ 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
- if (params) {
25
+ const params = props.location.state;
26
+ const tab = params && params.type;
27
+ if (tab) {
26
28
  controller.pipeline(async s => {
27
- s.type = Number(params);
29
+ s.type = Number(tab);
28
30
  })()
29
31
  }
30
32
  }, [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(() => {
@@ -132,6 +133,20 @@ export default () => {
132
133
  "value": 1
133
134
  }]
134
135
  },
136
+ attribution: {
137
+ type: "radio",
138
+ title: "我的收发角色",
139
+ enum: [{
140
+ "label": "发送方",
141
+ "value": '1'
142
+ }, {
143
+ "label": "接收方",
144
+ "value": '0'
145
+ }],
146
+ 'x-props': {
147
+ mode: "multiple"
148
+ }
149
+ },
135
150
  attributionList: {
136
151
  type: "string",
137
152
  title: "发送对象",
@@ -160,20 +175,7 @@ export default () => {
160
175
  enum: profileEnum,
161
176
  visible: false
162
177
  },
163
- attribution: {
164
- type: "radio",
165
- title: "我的收发角色",
166
- enum: [{
167
- "label": "发送方",
168
- "value": '1'
169
- }, {
170
- "label": "接收方",
171
- "value": '0'
172
- }],
173
- 'x-props': {
174
- mode: "multiple"
175
- }
176
- },
178
+
177
179
  '[beginCreateTime,endCreateTime]': {
178
180
  key: "[beginCreateTime,endCreateTime",
179
181
  name: "[beginCreateTime,endCreateTime",
@@ -295,7 +297,7 @@ export default () => {
295
297
  expandLeft={topExpand()}
296
298
  expandRight={[
297
299
  type === 1 && <Button key="1" onClick={batchSend} style={{ marginRight: 10 }}>发布</Button>,
298
- <Dropdown key="2" overlay={menu}>
300
+ type === 1 && <Dropdown key="2" overlay={menu}>
299
301
  <Button type="primary" >创建配置</Button>
300
302
  </Dropdown>
301
303
  ]}
@@ -60,6 +60,7 @@ export default function validaterule(props: any) {
60
60
  controller.pipeline(async s => {
61
61
  s.type = 2;
62
62
  s.params = { configNumber: record.configNumber }
63
+ history.push({ pathname: `/rulelist`, state: { type: 2 } })
63
64
  })()
64
65
  }, []);
65
66
  const onPageChange = (pageNum: any, pageSize: any) => {
@@ -94,32 +94,32 @@ export default function Rule(props: any) {
94
94
  const handleCancel = useCallback(() => {
95
95
  setVisible(false);
96
96
  }, [])
97
- const autoSave = useCallback(() => {
98
- (async () => {
99
- // let url = '/schema/config/save';
100
- let data: any = { ...schema };
101
- const formValue = form.getFieldsValue();
102
- let res;
103
- if (record && record.id) {
104
- // url = '/schema/config/update';
105
- data = { ...record, schemaContent: JSON.stringify(data), ...formValue }
106
- res = await controller.configupdate(data);
107
- } else {
108
- data = { schemaContent: JSON.stringify(data), ...formValue }
109
- res = await controller.configsave(data);
110
- }
111
- // const res = await DocumentsService.instance.service?.call({ url, data, type: 'post' }) as any;
112
- if (res.err) {
113
- return false;
114
- } else {
115
- if (res.res) {
116
- message.success('保存成功');
117
- setChange(false);
118
- setRecord(res.res);
119
- }
120
- }
121
- })()
122
- }, [record, schema]);
97
+ // const autoSave = useCallback(() => {
98
+ // (async () => {
99
+ // // let url = '/schema/config/save';
100
+ // let data: any = { ...schema };
101
+ // const formValue = form.getFieldsValue();
102
+ // let res;
103
+ // if (record && record.id) {
104
+ // // url = '/schema/config/update';
105
+ // data = { ...record, schemaContent: JSON.stringify(data), ...formValue }
106
+ // res = await controller.configupdate(data);
107
+ // } else {
108
+ // data = { schemaContent: JSON.stringify(data), ...formValue }
109
+ // res = await controller.configsave(data);
110
+ // }
111
+ // // const res = await DocumentsService.instance.service?.call({ url, data, type: 'post' }) as any;
112
+ // if (res.err) {
113
+ // return false;
114
+ // } else {
115
+ // if (res.res) {
116
+ // message.success('保存成功');
117
+ // setChange(false);
118
+ // setRecord(res.res);
119
+ // }
120
+ // }
121
+ // })()
122
+ // }, [record, schema]);
123
123
  // useEffect(() => {
124
124
  // if (status !== 0 && !disabled && first === false) {
125
125
  // autoSave();
@@ -134,13 +134,44 @@ export default function Rule(props: any) {
134
134
  /**
135
135
  * 手动保存
136
136
  */
137
- const onSave = useCallback(() => {
138
- autoSave();
137
+ const onSave = useCallback((publish: boolean = false) => {
138
+ (async () => {
139
+ form.validateFields().then(async values => {
140
+ let data: any = { ...schema };
141
+ // const formValue = form.getFieldsValue();
142
+ let res;
143
+ if (record && record.id) {
144
+ data = { ...record, schemaContent: JSON.stringify(data), ...values }
145
+ res = await controller.configupdate(data);
146
+ } else {
147
+ data = { schemaContent: JSON.stringify(data), ...values }
148
+ res = await controller.configsave(data);
149
+ }
150
+ if (res.err) {
151
+ message.error('保存失败');
152
+ return false;
153
+ } else {
154
+ if (res.res) {
155
+ message.success('保存成功');
156
+ setChange(false);
157
+ setRecord(res.res);
158
+ if (publish) {
159
+ onSendCheck();
160
+ }
161
+ }
162
+ }
163
+ }).catch(errorInfo => {
164
+ message.error('请输入必填内容!');
165
+ });
166
+
167
+ })()
139
168
  }, [record, schema]);
169
+ /**
170
+ * 保存并发布
171
+ */
140
172
  const onSendCheck = useCallback(() => {
141
173
  (async () => {
142
174
  const res = await controller.listbysubjectid({});
143
- // const res = await DocumentsService.instance.service?.call({ url: '/dap/web/participant/listBySubjectId', data: null, type: 'get' }) as any;
144
175
  if (res.res) {
145
176
  setVisible(true);
146
177
  setList(res.res);
@@ -170,7 +201,7 @@ export default function Rule(props: any) {
170
201
  return {
171
202
  alignItems: 'center',
172
203
  marginBottom: 10,
173
- lineHeight:1.2
204
+ lineHeight: 1.2
174
205
  };
175
206
  }, [])
176
207
  const updateSchema = useCallback((e) => {
@@ -192,9 +223,9 @@ export default function Rule(props: any) {
192
223
  }, [hasChange]);
193
224
  const goBack = useCallback(() => {
194
225
  if (type === 'record') {
195
- history.push({ pathname: `/rulelist`, search: `?type=2` })
226
+ history.push({ pathname: `/rulelist`, state: { type: 2 } })
196
227
  } else {
197
- history.goBack();
228
+ history.push({ pathname: `/rulelist`, state: { type: 1 } })
198
229
  }
199
230
  }, []);
200
231
  return <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
@@ -203,8 +234,8 @@ export default function Rule(props: any) {
203
234
  style={{ flex: 1 }}
204
235
  title="配置"
205
236
  extra={[
206
- <Button key="2" style={{ display: type === 'record' ? 'none' : '' }} onClick={onSave}>保存</Button>,
207
- <Button key="3" style={{ display: type === 'record' ? 'none' : '' }} onClick={onSendCheck}>发送</Button>,
237
+ <Button key="2" style={{ display: type === 'record' ? 'none' : '' }} onClick={() => { onSave(); }}>保存</Button>,
238
+ <Button key="3" style={{ display: type === 'record' ? 'none' : '' }} onClick={() => { onSave(true); }}>保存并发布</Button>,
208
239
  <Button key="1" type="primary" onClick={onQuit}>
209
240
  退出
210
241
  </Button>,
@@ -288,7 +319,7 @@ export default function Rule(props: any) {
288
319
  </div>
289
320
  </Card>
290
321
  <Modal
291
- title="请选择"
322
+ title="请选择我司对应DID"
292
323
  visible={visible}
293
324
  onOk={handleOk}
294
325
  onCancel={handleCancel}