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

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": "2.0.0",
3
+ "version": "2.0.1",
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,64 @@ 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={css.underline} allowClear>
67
+ {didEnum?.map(item => (
68
+ <Option key={item.value} value={item.value}>
69
+ {item.label}
70
+ </Option>
71
+ ))}
72
+ </SearchSelect>
73
+ ),
74
+ });
75
+
76
+ // 数据状态
77
+ items.push({
78
+ name: "dataStatus",
79
+ label: "数据状态",
80
+ children: (
81
+ <SearchSelect className={css.underline} allowClear>
82
+ <Option value={1}>使用中</Option>
83
+ <Option value={2}>停用</Option>
84
+ </SearchSelect>
85
+ ),
86
+ });
87
+
88
+ // 创建时间
89
+ items.push({
90
+ name: "createTime",
91
+ label: "创建时间",
92
+ children: <RangePicker className={css.underline} />,
93
+ });
94
+
95
+ return items;
96
+ }, [didlist]);
27
97
  const batchBlockList = useCallback((type: number) => {
28
98
  (async () => {
29
99
  const res = await controller.enableblacklist({
@@ -47,16 +117,27 @@ export default () => {
47
117
  s.listNature = '2';
48
118
  })()
49
119
  }, []);
120
+ // 创建搜索组件
121
+ const { search } = SearchXui.useCreate({
122
+ labelCol: 9,
123
+ onSubmit: (e) => {
124
+ onSearchFormSubmit(e);
125
+ },
126
+ values: React.useMemo(() => {
127
+ return searchUnFormat(params, formItems);
128
+ }, [params, formItems]),
129
+ formItems,
130
+ });
131
+
50
132
  const topExpand = useCallback(() => {
51
133
  return (
52
- <UnifiedSearch
53
- searchFormSubmit={onSearchFormSubmit}
54
- searchValues={params}
55
- didlist={didlist}
56
- labelCol={9}
57
- />
134
+ <div style={{ width: "100%" }}>
135
+ <div style={{ display: "flex", alignItems: "flex-start", gap: "16px" }}>
136
+ <div style={{ flex: 1 }}>{search}</div>
137
+ </div>
138
+ </div>
58
139
  );
59
- }, [params, didlist]);
140
+ }, [search]);
60
141
  return (
61
142
  <div style={{ flex: 'none', position: 'relative', zIndex: 1 }} >
62
143
  <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,64 @@ 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={css.underline} allowClear>
76
+ {didEnum?.map(item => (
77
+ <Option key={item.value} value={item.value}>
78
+ {item.label}
79
+ </Option>
80
+ ))}
81
+ </SearchSelect>
82
+ ),
83
+ });
84
+
85
+ // 数据状态
86
+ items.push({
87
+ name: "dataStatus",
88
+ label: "数据状态",
89
+ children: (
90
+ <SearchSelect className={css.underline} allowClear>
91
+ <Option value={1}>使用中</Option>
92
+ <Option value={2}>停用</Option>
93
+ </SearchSelect>
94
+ ),
95
+ });
96
+
97
+ // 创建时间
98
+ items.push({
99
+ name: "createTime",
100
+ label: "创建时间",
101
+ children: <RangePicker className={css.underline}/>,
102
+ });
103
+
104
+ return items;
105
+ }, [didlist]);
35
106
  const batchBlockList = useCallback((type: number) => {
36
107
  (async () => {
37
108
  const res = await controller.enablewhitelist({
@@ -55,16 +126,27 @@ export default () => {
55
126
  s.listNature = '1';
56
127
  })()
57
128
  }, []);
129
+ // 创建搜索组件
130
+ const { search } = SearchXui.useCreate({
131
+ labelCol: 9,
132
+ onSubmit: (e) => {
133
+ onSearchFormSubmit(e);
134
+ },
135
+ values: React.useMemo(() => {
136
+ return searchUnFormat(whiteParams, formItems);
137
+ }, [whiteParams, formItems]),
138
+ formItems,
139
+ });
140
+
58
141
  const topExpand = useCallback(() => {
59
142
  return (
60
- <UnifiedSearch
61
- searchFormSubmit={onSearchFormSubmit}
62
- searchValues={whiteParams}
63
- didlist={didlist}
64
- labelCol={9}
65
- />
143
+ <div style={{ width: "100%" }} className={'unifiedSearch'}>
144
+ <div style={{ display: "flex", alignItems: "flex-start", gap: "16px" }}>
145
+ <div style={{ flex: 1 }}>{search}</div>
146
+ </div>
147
+ </div>
66
148
  );
67
- }, [whiteParams, didlist]);
149
+ }, [search]);
68
150
  return (
69
151
  <div style={{ flex: 'none', position: 'relative', zIndex: 1 }} >
70
152
  <PageHeaderFoot
@@ -0,0 +1,10 @@
1
+ .underline{
2
+ :global(.ktsAntX-select-selector){
3
+ border: none !important;
4
+ border-bottom: 1px solid #d9d9d9 !important;
5
+ }
6
+ :global(.ant-input){
7
+ border: none !important;
8
+ border-bottom: 1px solid #d9d9d9 !important;
9
+ }
10
+ }
@@ -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}