kts-components-document-access-point 2.0.0 → 2.0.2

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.
Files changed (22) hide show
  1. package/dist/DocumentsList/DocumentsListController/DocumentsListControllerState/index.d.ts +4 -0
  2. package/dist/index.esm.js +540 -476
  3. package/dist/index.js +592 -528
  4. package/package.json +4 -4
  5. package/src/DocumentWhiteList/control/actions/blacklist/index.ts +3 -0
  6. package/src/DocumentWhiteList/control/actions/checkclient/index.ts +4 -1
  7. package/src/DocumentWhiteList/control/actions/didilist/index.ts +3 -0
  8. package/src/DocumentWhiteList/control/actions/enableblacklist/index.ts +3 -0
  9. package/src/DocumentWhiteList/control/actions/enablelist/index.ts +3 -0
  10. package/src/DocumentWhiteList/control/actions/enablewhitelist/index.ts +3 -0
  11. package/src/DocumentWhiteList/control/actions/synclist/index.ts +3 -0
  12. package/src/DocumentWhiteList/control/actions/whitelist/index.ts +3 -0
  13. package/src/DocumentWhiteList/ui/pageheader/BlackHeader.tsx +87 -10
  14. package/src/DocumentWhiteList/ui/pageheader/WhiteHeader.tsx +89 -9
  15. package/src/DocumentsEdit/ui/EditRule/ui/RuleForm/fn/algorithmFormComponent/index.tsx +1 -1
  16. package/src/DocumentsList/DocumentsListController/DocumentsListControllerState/index.ts +4 -0
  17. package/src/DocumentsList/ui/PageHeader/SendHeader.tsx +107 -168
  18. package/src/DocumentsList/ui/PageHeader/index.tsx +150 -213
  19. package/src/DocumentsList/ui/RuleTable/index.tsx +7 -3
  20. package/dist/DocumentWhiteList/ui/UnifiedSearch/index.d.ts +0 -11
  21. package/src/DocumentWhiteList/ui/UnifiedSearch/index.scss +0 -119
  22. package/src/DocumentWhiteList/ui/UnifiedSearch/index.tsx +0 -146
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-components-document-access-point",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "dumi dev",
@@ -35,7 +35,7 @@
35
35
  "kts-component-service": "^1.0.4",
36
36
  "kts-components": "1.3.9",
37
37
  "kts-components-antd-x4": "5.0.0",
38
- "kts-xui": "^2.2.29",
38
+ "kts-xui": "2.1.77",
39
39
  "lodash": "^4.17.21",
40
40
  "moment": "2.29.1",
41
41
  "query-string": "^7.0.1",
@@ -47,10 +47,10 @@
47
47
  "@types/lodash": "^4.14.171",
48
48
  "@umijs/test": "^3.0.5",
49
49
  "dumi": "^1.0.16",
50
- "father-build": "^1.22.5",
50
+ "father-build": "^1.17.2",
51
51
  "gh-pages": "^3.0.0",
52
52
  "lint-staged": "^10.0.7",
53
53
  "prettier": "^2.2.1",
54
54
  "yorkie": "^2.0.0"
55
55
  }
56
- }
56
+ }
@@ -6,6 +6,9 @@ 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: '/whiteblacklist/config/queryBlackListPage', data: params, type: 'post' }) as any;
9
+ if (!res) {
10
+ return false;
11
+ }
9
12
  if (res.err) {
10
13
  return false;
11
14
  }
@@ -4,7 +4,10 @@ import { DocumentsService } from "../../../..";
4
4
 
5
5
 
6
6
  export default async (s: ControllerState,) => {
7
- const res = await DocumentsService.instance.service!.call({ url: '/whiteblacklist/config/showButton', data: {}, type: 'post' }) as any;
7
+ const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/showButton', data: {}, type: 'post' }) as any;
8
+ if (!res) {
9
+ return false;
10
+ }
8
11
  if (res.err) {
9
12
  return false;
10
13
  }
@@ -7,6 +7,9 @@ import { IParams } from '../../../interface'
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
9
  // return res;
10
+ if (!res) {
11
+ return false;
12
+ }
10
13
  if (res.err) {
11
14
  return false;
12
15
  }
@@ -8,6 +8,9 @@ export interface IParams{
8
8
 
9
9
  export default async (s: ControllerState, params?: IParams,) => {
10
10
  const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/enableOrDisableBlackList?status=' + params?.flag, data: params?.didList, type: 'post' }) as any;
11
+ if (!res) {
12
+ return false;
13
+ }
11
14
  if (res.err) {
12
15
  return false;
13
16
  }
@@ -9,6 +9,9 @@ export interface IParams{
9
9
 
10
10
  export default async (s: ControllerState, params?: IParams,) => {
11
11
  const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/enableList?status=' + params?.status, data: params?.didList, type: 'post' }) as any;
12
+ if (!res) {
13
+ return false;
14
+ }
12
15
  if (res.err) {
13
16
  return false;
14
17
  }
@@ -8,6 +8,9 @@ export interface IParams{
8
8
 
9
9
  export default async (s: ControllerState, params?: IParams,) => {
10
10
  const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/enableOrDisableWhiteList?status=' + params?.flag, data: params?.didList, type: 'post' }) as any;
11
+ if (!res) {
12
+ return false;
13
+ }
11
14
  if (res.err) {
12
15
  return false;
13
16
  }
@@ -11,6 +11,9 @@ export interface IParams {
11
11
 
12
12
  export default async (s: ControllerState, params?: IParams) => {
13
13
  const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/querySyncPage', data: params, type: 'post' }) as any;
14
+ if (!res) {
15
+ return false;
16
+ }
14
17
  if (res.err) {
15
18
  return false;
16
19
  }
@@ -6,6 +6,9 @@ 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: '/whiteblacklist/config/queryWhiteListPage', data: params, type: 'post' }) as any;
9
+ if (!res) {
10
+ return false;
11
+ }
9
12
  if (res.err) {
10
13
  return false;
11
14
  }
@@ -1,8 +1,15 @@
1
1
  import React, { useState, useEffect, useCallback } from 'react';
2
2
  import { Button, PageHeaderFoot } from 'kts-xui';
3
+ import { Search as SearchXui, searchUnFormat, ISearchItemProps } from 'kts-xui';
4
+ import { Select as SearchSelect } from 'kts-xui';
5
+ import { Select, DatePicker } from 'antd';
3
6
  import Main from '../../index';
4
- import UnifiedSearch from '../UnifiedSearch';
7
+ // import { LifeCycleTypes } from "@formily/antd";
5
8
  import _ from 'lodash';
9
+ import moment from 'moment';
10
+ import css from './index.less';
11
+ const { Option } = Select;
12
+ const { RangePicker } = DatePicker;
6
13
  export default () => {
7
14
  const controller = Main.useController();
8
15
  const pageMeta = controller.useMemo((s) => s.pageMeta, []);
@@ -11,8 +18,14 @@ export default () => {
11
18
  const selectedRowKey = controller.useMemo(s => s.selectedBlackRowKey, [])
12
19
  const disabled = selectedRowKey.length > 0 ? false : true
13
20
  const didlist = controller.useMemo((s) => s.didlist, []);
14
- const [companyDidNote, setNote] = useState('');
15
21
  const onSearchFormSubmit = React.useCallback((value) => {
22
+ value = {
23
+ ...value,
24
+ beginCreateTime: value['beginCreateTime'] && moment(value['beginCreateTime']).format('YYYY-MM-DD 00:00:00'),
25
+ endCreateTime: value['endCreateTime'] && moment(value['endCreateTime']).format('YYYY-MM-DD 23:59:59'),
26
+ pageNum: 1,
27
+ pageSize: 10
28
+ }
16
29
  controller.pipeline(async s => {
17
30
  s.params = value;
18
31
  })()
@@ -23,7 +36,58 @@ export default () => {
23
36
  useEffect(() => {
24
37
  controller.didList({}) as any;
25
38
  }, []);
26
- // UnifiedSearch 组件内部处理字段定义,不需要 schema
39
+ // 动态生成 formItems
40
+ const formItems: ISearchItemProps[] = React.useMemo(() => {
41
+ const didEnum = didlist?.map(item => {
42
+ return { label: item.remarkName + ':' + item.participantId, value: item.participantId };
43
+ });
44
+
45
+ const items: ISearchItemProps[] = [];
46
+
47
+ // DID
48
+ items.push({
49
+ name: "customerDid",
50
+ label: "DID",
51
+ children: <SearchXui.Input />,
52
+ });
53
+
54
+ // 所属公司
55
+ items.push({
56
+ name: "customerName",
57
+ label: "所属公司",
58
+ children: <SearchXui.Input />,
59
+ });
60
+
61
+ // 我司对应DID
62
+ items.push({
63
+ name: "companyDid",
64
+ label: "我司对应DID",
65
+ children: (
66
+ <SearchSelect className={"underline"} allowClear options={didEnum} />
67
+ ),
68
+ });
69
+
70
+ // 数据状态
71
+ items.push({
72
+ name: "dataStatus",
73
+ label: "数据状态",
74
+ children: (
75
+ <SearchSelect className={"underline"} allowClear options={[
76
+ { label: '使用中', value: 1 },
77
+ { label: '停用', value: 2 },
78
+ ]} />
79
+ ),
80
+ });
81
+
82
+ // 创建时间
83
+ items.push({
84
+ name: "createTime",
85
+ label: "创建时间",
86
+ children: <RangePicker className={"underline-datepicker"} />,
87
+ });
88
+
89
+ return items;
90
+ }, [didlist]);
27
91
  const batchBlockList = useCallback((type: number) => {
28
92
  (async () => {
29
93
  const res = await controller.enableblacklist({
@@ -47,16 +111,29 @@ export default () => {
47
111
  s.listNature = '2';
48
112
  })()
49
113
  }, []);
114
+ // 创建搜索组件
115
+ const { search, inventory } = SearchXui.useCreate({
116
+ labelCol: 9,
117
+ onSubmit: (e) => {
118
+ onSearchFormSubmit(e);
119
+ },
120
+ values: React.useMemo(() => {
121
+ return searchUnFormat(params, formItems);
122
+ }, [params, formItems]),
123
+ formItems,
124
+ });
125
+
50
126
  const topExpand = useCallback(() => {
51
127
  return (
52
- <UnifiedSearch
53
- searchFormSubmit={onSearchFormSubmit}
54
- searchValues={params}
55
- didlist={didlist}
56
- labelCol={9}
57
- />
128
+ <div style={{ width: "100%" }}>
129
+ <div style={{ display: "flex", alignItems: "flex-start", gap: "16px",padding: '10px 0px' }}>
130
+ <div style={{ flex: 1 }}>{search}</div>
131
+ </div>
132
+ {/* 搜索条件标签 */}
133
+ {inventory}
134
+ </div>
58
135
  );
59
- }, [params, didlist]);
136
+ }, [search, inventory]);
60
137
  return (
61
138
  <div style={{ flex: 'none', position: 'relative', zIndex: 1 }} >
62
139
  <PageHeaderFoot
@@ -1,8 +1,15 @@
1
1
  import React, { useState, useEffect, useCallback } from 'react';
2
2
  import { Button, PageHeaderFoot } from 'kts-xui';
3
+ import { Search as SearchXui, searchUnFormat, ISearchItemProps } from 'kts-xui';
4
+ import { Select as SearchSelect } from 'kts-xui';
5
+ import { Select, DatePicker } from 'antd';
3
6
  import Main from '../../index';
4
- import UnifiedSearch from '../UnifiedSearch';
5
7
  import _ from 'lodash';
8
+ import moment from 'moment';
9
+ import css from './index.less';
10
+
11
+ const { Option } = Select;
12
+ const { RangePicker } = DatePicker;
6
13
  export default () => {
7
14
  const controller = Main.useController();
8
15
  const pageMeta = controller.useMemo((s) => s.pageMeta, []);
@@ -12,6 +19,13 @@ export default () => {
12
19
  const disabled = selectedRowKey.length > 0 ? false : true
13
20
  const didlist = controller.useMemo((s) => s.didlist, []);
14
21
  const onSearchFormSubmit = React.useCallback((value) => {
22
+ value = {
23
+ ...value,
24
+ beginCreateTime: value['beginCreateTime'] && moment(value['beginCreateTime']).format('YYYY-MM-DD 00:00:00'),
25
+ endCreateTime: value['endCreateTime'] && moment(value['endCreateTime']).format('YYYY-MM-DD 23:59:59'),
26
+ pageNum: 1,
27
+ pageSize: 10
28
+ }
15
29
  controller.pipeline(async s => {
16
30
  s.whiteParams = value;
17
31
  })()
@@ -31,7 +45,58 @@ export default () => {
31
45
 
32
46
 
33
47
  }, []);
34
- // UnifiedSearch 组件内部处理字段定义,不需要 schema
48
+ // 动态生成 formItems
49
+ const formItems: ISearchItemProps[] = React.useMemo(() => {
50
+ const didEnum = didlist?.map(item => {
51
+ return { label: item.remarkName + ':' + item.participantId, value: item.participantId };
52
+ });
53
+
54
+ const items: ISearchItemProps[] = [];
55
+
56
+ // DID
57
+ items.push({
58
+ name: "customerDid",
59
+ label: "DID",
60
+ children: <SearchXui.Input />,
61
+ });
62
+
63
+ // 所属公司
64
+ items.push({
65
+ name: "customerName",
66
+ label: "所属公司",
67
+ children: <SearchXui.Input />,
68
+ });
69
+
70
+ // 我司对应DID
71
+ items.push({
72
+ name: "companyDid",
73
+ label: "我司对应DID",
74
+ children: (
75
+ <SearchSelect className={"underline"} allowClear options={didEnum} />
76
+ ),
77
+ });
78
+
79
+ // 数据状态
80
+ items.push({
81
+ name: "dataStatus",
82
+ label: "数据状态",
83
+ children: (
84
+ <SearchSelect className={"underline"} allowClear options={[
85
+ { label: '使用中', value: 1 },
86
+ { label: '停用', value: 2 },
87
+ ]} />
88
+ ),
89
+ });
90
+
91
+ // 创建时间
92
+ items.push({
93
+ name: "createTime",
94
+ label: "创建时间",
95
+ children: <RangePicker className={"underline-datepicker"}/>,
96
+ });
97
+
98
+ return items;
99
+ }, [didlist]);
35
100
  const batchBlockList = useCallback((type: number) => {
36
101
  (async () => {
37
102
  const res = await controller.enablewhitelist({
@@ -55,16 +120,31 @@ export default () => {
55
120
  s.listNature = '1';
56
121
  })()
57
122
  }, []);
123
+ // 创建搜索组件
124
+ const { search, inventory } = SearchXui.useCreate({
125
+ labelCol: 9,
126
+ onSubmit: (e) => {
127
+ onSearchFormSubmit(e);
128
+ },
129
+ values: React.useMemo(() => {
130
+ return searchUnFormat(whiteParams, formItems);
131
+ }, [whiteParams, formItems]),
132
+ formItems,
133
+ });
134
+
58
135
  const topExpand = useCallback(() => {
59
136
  return (
60
- <UnifiedSearch
61
- searchFormSubmit={onSearchFormSubmit}
62
- searchValues={whiteParams}
63
- didlist={didlist}
64
- labelCol={9}
65
- />
137
+ <div style={{ width: "100%" }}>
138
+ <div className={'unifiedSearch'}>
139
+ <div style={{ display: "flex", alignItems: "flex-start", gap: "16px",padding: '10px 0px' }}>
140
+ <div style={{ flex: 1 }}>{search}</div>
141
+ </div>
142
+ </div>
143
+ {/* 搜索条件标签 */}
144
+ {inventory}
145
+ </div>
66
146
  );
67
- }, [whiteParams, didlist]);
147
+ }, [search, inventory]);
68
148
  return (
69
149
  <div style={{ flex: 'none', position: 'relative', zIndex: 1 }} >
70
150
  <PageHeaderFoot
@@ -13,7 +13,7 @@ export default function algorithmFormComponent(operator: IOperator, ruleProperti
13
13
 
14
14
  const info = ruleProperties.items ? ruleProperties.items : ruleProperties;
15
15
 
16
- function renderFormItem(child: React.ReactNode) {
16
+ function renderFormItem(child: any) {
17
17
  return (
18
18
  <Form.Item key={`algorithmForm_${operator.name}`} {...operator}>
19
19
  {child}
@@ -29,6 +29,10 @@ export interface ISelectedRowKey {
29
29
  *单据类型
30
30
  */
31
31
  type?: string;
32
+ /**
33
+ * 单据子类
34
+ */
35
+ profile?: string;
32
36
  }
33
37
  export interface IBillEnum {
34
38
  name: string;