kts-components-document-access-point 1.4.2 → 1.4.5

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 (123) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.prettierignore +7 -7
  4. package/.prettierrc +11 -11
  5. package/.umirc.ts +11 -11
  6. package/README.md +3 -3
  7. package/dist/index.esm.js +28 -8
  8. package/dist/index.js +28 -8
  9. package/docs/index.md +3 -3
  10. package/index.html +12 -12
  11. package/package.json +56 -56
  12. package/src/DocumentWhiteList/___demo___/base/index.tsx +7 -7
  13. package/src/DocumentWhiteList/___demo___/setService/index.tsx +23 -23
  14. package/src/DocumentWhiteList/control/actions/addblack/index.ts +14 -14
  15. package/src/DocumentWhiteList/control/actions/addwhite/index.ts +14 -14
  16. package/src/DocumentWhiteList/control/actions/blacklist/index.ts +22 -22
  17. package/src/DocumentWhiteList/control/actions/checkclient/index.ts +14 -14
  18. package/src/DocumentWhiteList/control/actions/demo/index.ts +4 -4
  19. package/src/DocumentWhiteList/control/actions/didilist/index.ts +18 -18
  20. package/src/DocumentWhiteList/control/actions/enableblacklist/index.ts +17 -17
  21. package/src/DocumentWhiteList/control/actions/enablelist/index.ts +18 -18
  22. package/src/DocumentWhiteList/control/actions/enablewhitelist/index.ts +17 -17
  23. package/src/DocumentWhiteList/control/actions/getmode/index.ts +14 -14
  24. package/src/DocumentWhiteList/control/actions/setmode/index.ts +14 -14
  25. package/src/DocumentWhiteList/control/actions/synclist/index.ts +19 -19
  26. package/src/DocumentWhiteList/control/actions/whitelist/index.ts +22 -22
  27. package/src/DocumentWhiteList/control/index.tsx +42 -42
  28. package/src/DocumentWhiteList/control/state/index.ts +47 -47
  29. package/src/DocumentWhiteList/index.md +5 -5
  30. package/src/DocumentWhiteList/index.tsx +40 -40
  31. package/src/DocumentWhiteList/interface/index.ts +30 -30
  32. package/src/DocumentWhiteList/ui/clientmodal/index.tsx +190 -190
  33. package/src/DocumentWhiteList/ui/main/black.tsx +132 -132
  34. package/src/DocumentWhiteList/ui/main/index.tsx +49 -49
  35. package/src/DocumentWhiteList/ui/main/switchmode.tsx +52 -52
  36. package/src/DocumentWhiteList/ui/main/white.tsx +120 -120
  37. package/src/DocumentWhiteList/ui/pageheader/BlackHeader.tsx +143 -143
  38. package/src/DocumentWhiteList/ui/pageheader/WhiteHeader.tsx +152 -152
  39. package/src/DocumentWhiteList/ui/pageui/index.tsx +64 -64
  40. package/src/DocumentWhiteList/ui/whitemodal/index.tsx +146 -146
  41. package/src/DocumentWhiteList/util/ConfigEnum.ts +8 -8
  42. package/src/DocumentsCont/___demo___/base/index.tsx +7 -7
  43. package/src/DocumentsCont/___demo___/setService/index.tsx +25 -25
  44. package/src/DocumentsCont/index.md +9 -9
  45. package/src/DocumentsCont/index.tsx +54 -51
  46. package/src/DocumentsDemo/Controller/index.tsx +14 -14
  47. package/src/DocumentsDemo/Controller/whitelist.ts +22 -22
  48. package/src/DocumentsDemo/Text.tsx +22 -22
  49. package/src/DocumentsDemo/___demo___/base/index.tsx +7 -7
  50. package/src/DocumentsDemo/index.md +6 -6
  51. package/src/DocumentsDemo/index.tsx +38 -38
  52. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/IProperties/index.ts +69 -69
  53. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/IRules/index.ts +18 -18
  54. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/ISchema/index.ts +14 -14
  55. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/PropertyTableState/index.ts +12 -12
  56. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/RuleState/index.ts +336 -336
  57. package/src/DocumentsEdit/DocumentsEditController/DocumentsEditControllerState/index.ts +51 -51
  58. package/src/DocumentsEdit/DocumentsEditController/actions/addProperties/index.ts +37 -37
  59. package/src/DocumentsEdit/DocumentsEditController/actions/delProperties/index.ts +48 -48
  60. package/src/DocumentsEdit/DocumentsEditController/actions/editProperties/index.ts +93 -79
  61. package/src/DocumentsEdit/DocumentsEditController/index.tsx +21 -21
  62. package/src/DocumentsEdit/___demo___/conventional/index.tsx +10 -10
  63. package/src/DocumentsEdit/___demo___/monitor/index.tsx +1421 -1421
  64. package/src/DocumentsEdit/___demo___/readOnly/index.tsx +16 -16
  65. package/src/DocumentsEdit/constant/propertyColumns/index.tsx +65 -65
  66. package/src/DocumentsEdit/index.less +45 -45
  67. package/src/DocumentsEdit/index.md +10 -10
  68. package/src/DocumentsEdit/index.tsx +117 -117
  69. package/src/DocumentsEdit/tools/index.ts +88 -88
  70. package/src/DocumentsEdit/ui/AddPropertyButton/index.tsx +238 -238
  71. package/src/DocumentsEdit/ui/Breadcrumb/index.tsx +51 -51
  72. package/src/DocumentsEdit/ui/EditProperty/index.tsx +290 -290
  73. package/src/DocumentsEdit/ui/EditRule/index.tsx +156 -156
  74. package/src/DocumentsEdit/ui/EditRule/ui/AddRuleButton/index.tsx +49 -49
  75. package/src/DocumentsEdit/ui/EditRule/ui/DelRuleButton/index.tsx +31 -31
  76. package/src/DocumentsEdit/ui/EditRule/ui/RuleForm/fn/algorithmFormComponent/index.tsx +142 -142
  77. package/src/DocumentsEdit/ui/EditRule/ui/RuleForm/index.tsx +154 -154
  78. package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/index.less +4 -4
  79. package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/index.tsx +70 -70
  80. package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/AddChildPropertyButton/index.tsx +34 -34
  81. package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/AddRuleButton/index.tsx +64 -64
  82. package/src/DocumentsEdit/ui/PropertyTable/hooks/useTableProps/ui/EditPropertyButton/index.tsx +31 -31
  83. package/src/DocumentsEdit/ui/PropertyTable/index.less +19 -19
  84. package/src/DocumentsEdit/ui/PropertyTable/index.tsx +18 -18
  85. package/src/DocumentsEdit/ui/RefPropertyButton/index.tsx +121 -121
  86. package/src/DocumentsList/DocumentsListController/DocumentsListControllerState/index.ts +55 -55
  87. package/src/DocumentsList/DocumentsListController/actions/demo/index.ts +4 -4
  88. package/src/DocumentsList/DocumentsListController/actions/typelist/index.ts +15 -15
  89. package/src/DocumentsList/DocumentsListController/index.tsx +16 -16
  90. package/src/DocumentsList/___demo___/list/index.tsx +4 -4
  91. package/src/DocumentsList/index.less +22 -22
  92. package/src/DocumentsList/index.md +3 -3
  93. package/src/DocumentsList/index.tsx +46 -46
  94. package/src/DocumentsList/ui/ModalComfirm/index.tsx +94 -92
  95. package/src/DocumentsList/ui/PageHeader/SendHeader.tsx +230 -230
  96. package/src/DocumentsList/ui/PageHeader/index.tsx +325 -325
  97. package/src/DocumentsList/ui/PageUI/index.tsx +65 -65
  98. package/src/DocumentsList/ui/RuleTable/index.tsx +163 -163
  99. package/src/DocumentsList/ui/sendlist/index.tsx +151 -151
  100. package/src/DocumentsList/util/ConfigEnum.ts +11 -11
  101. package/src/DocumentsRule/control/actions/batchsend/index.ts +13 -13
  102. package/src/DocumentsRule/control/actions/configsave/index.ts +14 -14
  103. package/src/DocumentsRule/control/actions/configupdate/index.ts +13 -13
  104. package/src/DocumentsRule/control/actions/getconfigbyid/index.ts +14 -14
  105. package/src/DocumentsRule/control/actions/getrecordbyid/index.ts +14 -14
  106. package/src/DocumentsRule/control/actions/gettemplate/index.ts +15 -15
  107. package/src/DocumentsRule/control/actions/listbysubjectid/index.ts +13 -13
  108. package/src/DocumentsRule/control/actions/typelist/index.ts +13 -13
  109. package/src/DocumentsRule/control/index.tsx +30 -30
  110. package/src/DocumentsRule/control/state/index.ts +42 -42
  111. package/src/DocumentsRule/index.md +1 -1
  112. package/src/DocumentsRule/index.tsx +25 -25
  113. package/src/DocumentsRule/interface/index.ts +28 -28
  114. package/src/DocumentsRule/ui/main/index.tsx +362 -362
  115. package/src/DocumentsService/index.ts +18 -18
  116. package/src/index.ts +9 -9
  117. package/tsconfig.json +29 -29
  118. package/typings.d.ts +3 -3
  119. package/docs-dist/404.html +0 -38
  120. package/docs-dist/index.html +0 -38
  121. package/docs-dist/static/icon.050945f2.svg +0 -1
  122. package/docs-dist/umi.css +0 -11
  123. package/docs-dist/umi.js +0 -1
@@ -1,147 +1,147 @@
1
- import React, { useCallback, useState, useEffect } from 'react';
2
- import { Modal, Form, Input, Button, Select } from 'kts-components-antd-x4';
3
- import Main from '../..';
4
- /**
5
- * 手动添加黑白名单弹窗
6
- * @param
7
- * @returns
8
- */
9
- export default function modalcomfirm(props: any) {
10
- const [form] = Form.useForm();
11
- const [data, setData] = useState();
12
- const controller = Main.useController();
13
- const params = controller.useMemo((s) => s.params, []);
14
- const whiteParams = controller.useMemo((s) => s.whiteParams, []);
15
- const pageMeta = controller.useMemo((s) => s.pageMeta, []);
16
- const listNature = controller.useMemo((s) => s.listNature, []);
17
- const didlist = controller.useMemo((s) => s.didlist, []);
18
- const [defaultValue, setDefault] = React.useState('');
19
- const [companyDidNote, setNote] = useState('');
20
- const handleCancel = useCallback(() => {
21
- controller.pipeline(async s => {
22
- s.visible = false;
23
- })()
24
- }, [])
25
- useEffect(() => {
26
- controller.didList({}) as any;
27
- }, []);
28
- useEffect(() => {
29
- if (didlist.length > 0) {
30
- const one = didlist.findIndex(item => item.isDefault === true);
31
- if (~one) {
32
- setDefault(didlist[one].participantId);
33
- setNote(didlist[one].remarkName);
34
- }
35
- }
36
- }, [didlist]);
37
- useEffect(() => {
38
- form.setFieldsValue({ 'companyDid': defaultValue });
39
- }, [defaultValue]);
40
- const onFinish = useCallback((values: any) => {
41
- (async () => {
42
- values = {
43
- ...values,
44
- type:listNature,
45
- companyDidNote
46
- }
47
- let res;
48
- if (listNature === '1') {
49
- res = await controller.addWhite([values]) as any;
50
- } else {
51
- res = await controller.addBlack([values]) as any;
52
- }
53
-
54
- if (res.res) {
55
- if (listNature === '1') {
56
- const data={
57
- ...whiteParams
58
- }
59
- controller.pipeline(async s => {
60
- s.whiteParams = data;
61
- })()
62
- } else {
63
- const data={
64
- ...params
65
- }
66
- controller.pipeline(async s => {
67
- s.params = data;
68
- })()
69
- }
70
- }
71
- handleCancel();
72
- })()
73
-
74
- }, [companyDidNote])
75
- const didChange = useCallback((e) => {
76
- if (e) {
77
- const one = didlist.findIndex(item => item.participantId === e);
78
-
79
- if (~one) {
80
- setNote(didlist[one].remarkName);
81
- }
82
- } else {
83
- setNote('');
84
- }
85
- }, [didlist])
86
- return (
87
- <div>
88
- <Modal
89
- title={`添加${listNature === '1' ? '白名单' : '黑名单'}`}
90
- visible={true}
91
- footer={null}
92
- onCancel={handleCancel}
93
- >
94
- <Form
95
- name="basic"
96
- form={form}
97
- labelCol={{ span: 8 }}
98
- wrapperCol={{ span: 16 }}
99
- initialValues={data}
100
- onFinish={onFinish}
101
- >
102
- <Form.Item
103
- label="DID"
104
- name="customerDid"
105
- rules={[{ required: true, message: '请输入必填项' }]}
106
- >
107
- <Input maxLength={60} placeholder="最多输入60个字符" />
108
- </Form.Item>
109
- <Form.Item
110
- label="DID备注名称"
111
- name="customerDidNote"
112
- rules={[{ required: true, message: '请输入必填项' }]}
113
- >
114
- <Input maxLength={20} placeholder="最多输入20个字符" />
115
- </Form.Item>
116
- <Form.Item
117
- label="所属公司"
118
- name="customerName"
119
- rules={[{ required: true, message: '请输入必填项' }]}
120
- >
121
- <Input maxLength={100} placeholder="最多输入100个字符" />
122
- </Form.Item>
123
- <Form.Item
124
- label="我司对应DID"
125
- name="companyDid"
126
- rules={[{ required: true, message: '请输入必填项' }]}
127
- >
128
- <Select onChange={didChange}>
129
- {didlist.map((item: any, key: number) => {
130
- return <Select.Option key={item.participantId} value={item.participantId}>{item.remarkName + ':' + item.participantId}</Select.Option>;
131
- })}
132
- </Select>
133
- </Form.Item>
134
- <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
135
- <Button type="primary" htmlType="submit" style={{ marginRight: 10 }}>
136
- 提交
137
- </Button>
138
- <Button onClick={handleCancel}>
139
- 取消
140
- </Button>
141
- </Form.Item>
142
- </Form>
143
- </Modal>
144
- </div >
145
-
146
- );
1
+ import React, { useCallback, useState, useEffect } from 'react';
2
+ import { Modal, Form, Input, Button, Select } from 'kts-components-antd-x4';
3
+ import Main from '../..';
4
+ /**
5
+ * 手动添加黑白名单弹窗
6
+ * @param
7
+ * @returns
8
+ */
9
+ export default function modalcomfirm(props: any) {
10
+ const [form] = Form.useForm();
11
+ const [data, setData] = useState();
12
+ const controller = Main.useController();
13
+ const params = controller.useMemo((s) => s.params, []);
14
+ const whiteParams = controller.useMemo((s) => s.whiteParams, []);
15
+ const pageMeta = controller.useMemo((s) => s.pageMeta, []);
16
+ const listNature = controller.useMemo((s) => s.listNature, []);
17
+ const didlist = controller.useMemo((s) => s.didlist, []);
18
+ const [defaultValue, setDefault] = React.useState('');
19
+ const [companyDidNote, setNote] = useState('');
20
+ const handleCancel = useCallback(() => {
21
+ controller.pipeline(async s => {
22
+ s.visible = false;
23
+ })()
24
+ }, [])
25
+ useEffect(() => {
26
+ controller.didList({}) as any;
27
+ }, []);
28
+ useEffect(() => {
29
+ if (didlist.length > 0) {
30
+ const one = didlist.findIndex(item => item.isDefault === true);
31
+ if (~one) {
32
+ setDefault(didlist[one].participantId);
33
+ setNote(didlist[one].remarkName);
34
+ }
35
+ }
36
+ }, [didlist]);
37
+ useEffect(() => {
38
+ form.setFieldsValue({ 'companyDid': defaultValue });
39
+ }, [defaultValue]);
40
+ const onFinish = useCallback((values: any) => {
41
+ (async () => {
42
+ values = {
43
+ ...values,
44
+ type:listNature,
45
+ companyDidNote
46
+ }
47
+ let res;
48
+ if (listNature === '1') {
49
+ res = await controller.addWhite([values]) as any;
50
+ } else {
51
+ res = await controller.addBlack([values]) as any;
52
+ }
53
+
54
+ if (res.res) {
55
+ if (listNature === '1') {
56
+ const data={
57
+ ...whiteParams
58
+ }
59
+ controller.pipeline(async s => {
60
+ s.whiteParams = data;
61
+ })()
62
+ } else {
63
+ const data={
64
+ ...params
65
+ }
66
+ controller.pipeline(async s => {
67
+ s.params = data;
68
+ })()
69
+ }
70
+ }
71
+ handleCancel();
72
+ })()
73
+
74
+ }, [companyDidNote])
75
+ const didChange = useCallback((e) => {
76
+ if (e) {
77
+ const one = didlist.findIndex(item => item.participantId === e);
78
+
79
+ if (~one) {
80
+ setNote(didlist[one].remarkName);
81
+ }
82
+ } else {
83
+ setNote('');
84
+ }
85
+ }, [didlist])
86
+ return (
87
+ <div>
88
+ <Modal
89
+ title={`添加${listNature === '1' ? '白名单' : '黑名单'}`}
90
+ visible={true}
91
+ footer={null}
92
+ onCancel={handleCancel}
93
+ >
94
+ <Form
95
+ name="basic"
96
+ form={form}
97
+ labelCol={{ span: 8 }}
98
+ wrapperCol={{ span: 16 }}
99
+ initialValues={data}
100
+ onFinish={onFinish}
101
+ >
102
+ <Form.Item
103
+ label="DID"
104
+ name="customerDid"
105
+ rules={[{ required: true, message: '请输入必填项' }]}
106
+ >
107
+ <Input maxLength={60} placeholder="最多输入60个字符" />
108
+ </Form.Item>
109
+ <Form.Item
110
+ label="DID备注名称"
111
+ name="customerDidNote"
112
+ rules={[{ required: true, message: '请输入必填项' }]}
113
+ >
114
+ <Input maxLength={20} placeholder="最多输入20个字符" />
115
+ </Form.Item>
116
+ <Form.Item
117
+ label="所属公司"
118
+ name="customerName"
119
+ rules={[{ required: true, message: '请输入必填项' }]}
120
+ >
121
+ <Input maxLength={100} placeholder="最多输入100个字符" />
122
+ </Form.Item>
123
+ <Form.Item
124
+ label="我司对应DID"
125
+ name="companyDid"
126
+ rules={[{ required: true, message: '请输入必填项' }]}
127
+ >
128
+ <Select onChange={didChange}>
129
+ {didlist.map((item: any, key: number) => {
130
+ return <Select.Option key={item.participantId} value={item.participantId}>{item.remarkName + ':' + item.participantId}</Select.Option>;
131
+ })}
132
+ </Select>
133
+ </Form.Item>
134
+ <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
135
+ <Button type="primary" htmlType="submit" style={{ marginRight: 10 }}>
136
+ 提交
137
+ </Button>
138
+ <Button onClick={handleCancel}>
139
+ 取消
140
+ </Button>
141
+ </Form.Item>
142
+ </Form>
143
+ </Modal>
144
+ </div >
145
+
146
+ );
147
147
  }
@@ -1,9 +1,9 @@
1
- const dataStatusEnum:{[key:string]:string} = {
2
- '1': '使用中',
3
- '2': '停用',
4
- }
5
- const listNatureEnum:{[key:string]:string} = {
6
- '1': '白名单',
7
- '2': '黑名单',
8
- }
1
+ const dataStatusEnum:{[key:string]:string} = {
2
+ '1': '使用中',
3
+ '2': '停用',
4
+ }
5
+ const listNatureEnum:{[key:string]:string} = {
6
+ '1': '白名单',
7
+ '2': '黑名单',
8
+ }
9
9
  export { dataStatusEnum,listNatureEnum }
@@ -1,8 +1,8 @@
1
- import { DocumentsCont } from "../../../";
2
- import React from "react";
3
-
4
- export default () => {
5
- return (
6
- <DocumentsCont path=''/>
7
- );
1
+ import { DocumentsCont } from "../../../";
2
+ import React from "react";
3
+
4
+ export default () => {
5
+ return (
6
+ <DocumentsCont path=''/>
7
+ );
8
8
  };
@@ -1,25 +1,25 @@
1
- import React from "react";
2
- import { ComponentServicePlatform } from 'kts-component-service';
3
- import { ComponentService } from 'kts-component-service';
4
- import { DocumentsService } from "../../../";
5
- import { extract } from "query-string";
6
-
7
- export default () => {
8
- React.useEffect(() => {
9
-
10
- // 解决前端跨越问题,此代码跨越忽悠
11
- try {
12
- window.document.domain = window.location.host.split('.').slice(-2).join('.').split(':')[0];
13
-
14
- // 设置 sdk
15
- DocumentsService.instance.service = new ComponentServicePlatform((window.top as any)['$$_kxl_sdk']);
16
-
17
- // 设置上下文
18
- DocumentsService.instance.service.context = '/dap/web';
19
- } catch (err) {
20
- console.log(err)
21
- }
22
- }, [])
23
-
24
- return <p>设置通信模块</p>;
25
- };
1
+ import React from "react";
2
+ import { ComponentServicePlatform } from 'kts-component-service';
3
+ import { ComponentService } from 'kts-component-service';
4
+ import { DocumentsService } from "../../../";
5
+ import { extract } from "query-string";
6
+
7
+ export default () => {
8
+ React.useEffect(() => {
9
+
10
+ // 解决前端跨越问题,此代码跨越忽悠
11
+ try {
12
+ window.document.domain = window.location.host.split('.').slice(-2).join('.').split(':')[0];
13
+
14
+ // 设置 sdk
15
+ DocumentsService.instance.service = new ComponentServicePlatform((window.top as any)['$$_kxl_sdk']);
16
+
17
+ // 设置上下文
18
+ DocumentsService.instance.service.context = '/dap/web';
19
+ } catch (err) {
20
+ console.log(err)
21
+ }
22
+ }, [])
23
+
24
+ return <p>设置通信模块</p>;
25
+ };
@@ -1,9 +1,9 @@
1
- # DocumentsCont
2
-
3
-
4
- <code src="./___demo___/setService/index.tsx" ></code>
5
-
6
- ## 基础用法
7
- <code src="./___demo___/base/index.tsx" ></code>
8
-
9
-
1
+ # DocumentsCont
2
+
3
+
4
+ <code src="./___demo___/setService/index.tsx" ></code>
5
+
6
+ ## 基础用法
7
+ <code src="./___demo___/base/index.tsx" ></code>
8
+
9
+
@@ -1,52 +1,55 @@
1
- // import { Tabs } from 'kts-components-antd-x4';
2
- import React from 'react';
3
- import { MemoryRouter, Switch, Route, Redirect } from 'react-router-dom';
4
- import { DocumentsList, DocumentsRule, DocumentWhiteList } from '../';
5
- import { ConfigProvider } from 'kts-components-antd-x4';
6
- import zhCN from 'kts-components-antd-x4/lib/locale/zh_CN';
7
-
8
- export default class DocumentsCont extends React.Component<any> {
9
- render = () => <Main {...this.props} />
10
- }
11
-
12
- const Main = (props: any) => {
13
- const initRoute = props.path || '/rulelist'
14
- return (
15
- <ConfigProvider locale={zhCN}>
16
- <MemoryRouter>
17
- <Switch>
18
- {/* <Route path="/home/:key?" component={DocumentsTabs} /> */}
19
- <Route path="/rulelist" component={DocumentsList} />
20
- <Route path="/billwhiteliest" component={DocumentWhiteList} />
21
- <Route path="/rule/:id?/:type?/:profile?" component={DocumentsRule} />
22
- <Route render={() => <Redirect to={initRoute} />} />
23
- </Switch>
24
- </MemoryRouter>
25
- </ConfigProvider>
26
- );
27
- };
28
-
29
- // const DocumentsTabs = () => {
30
-
31
- // const history = useHistory();
32
-
33
- // const { key } = useParams<{ key: string }>();
34
-
35
- // React.useEffect(() => {
36
- // if (!key) {
37
- // history.push(`/home/1`);
38
- // }
39
- // }, [key])
40
-
41
- // return (
42
- // <Switch>
43
- // <Tabs accessKey={key} onChange={e => { history.push(`/home/${e}`) }} >
44
- // <Tabs.TabPane tab="单据校验设置" key="1">
45
- // <Route path="/home/1" component={DocumentsList} />
46
- // <Route path="/home/1" component={DocumentWhiteList} />
47
-
48
- // </Tabs.TabPane>
49
- // </Tabs>
50
- // </Switch>
51
- // )
1
+ // import { Tabs } from 'kts-components-antd-x4';
2
+ import React from 'react';
3
+ import { MemoryRouter, Switch, Route, Redirect } from 'react-router-dom';
4
+ import { DocumentsList, DocumentsRule, DocumentWhiteList, DocumentsService } from '../';
5
+ import { ConfigProvider } from 'kts-components-antd-x4';
6
+ import zhCN from 'kts-components-antd-x4/lib/locale/zh_CN';
7
+
8
+ export default class DocumentsCont extends React.Component<any> {
9
+ render = () => <Main {...this.props} />
10
+ }
11
+
12
+ const Main = (props: any) => {
13
+ const initRoute = props.path || '/rulelist';
14
+ // const uploadConfig = { domain: (DocumentsService.instance.service as any).sdk.service.domain, token: (DocumentsService.instance.service as any).sdk.user.cToken };
15
+ // console.log(uploadConfig);
16
+ return (
17
+ <ConfigProvider locale={zhCN}>
18
+ <MemoryRouter>
19
+ <Switch>
20
+ {/* <Route path="/home/:key?" component={DocumentsTabs} /> */}
21
+ <Route path="/rulelist" component={DocumentsList} />
22
+ <Route path="/billwhiteliest" component={DocumentWhiteList} />
23
+ <Route path="/rule/:id?/:type?/:profile?" component={DocumentsRule} />
24
+
25
+ <Route render={() => <Redirect to={initRoute} />} />
26
+ </Switch>
27
+ </MemoryRouter>
28
+ </ConfigProvider>
29
+ );
30
+ };
31
+
32
+ // const DocumentsTabs = () => {
33
+
34
+ // const history = useHistory();
35
+
36
+ // const { key } = useParams<{ key: string }>();
37
+
38
+ // React.useEffect(() => {
39
+ // if (!key) {
40
+ // history.push(`/home/1`);
41
+ // }
42
+ // }, [key])
43
+
44
+ // return (
45
+ // <Switch>
46
+ // <Tabs accessKey={key} onChange={e => { history.push(`/home/${e}`) }} >
47
+ // <Tabs.TabPane tab="单据校验设置" key="1">
48
+ // <Route path="/home/1" component={DocumentsList} />
49
+ // <Route path="/home/1" component={DocumentWhiteList} />
50
+
51
+ // </Tabs.TabPane>
52
+ // </Tabs>
53
+ // </Switch>
54
+ // )
52
55
  // }
@@ -1,15 +1,15 @@
1
- import GreyReactBox from "grey-react-box";
2
- import getWhitelist from './whitelist';
3
-
4
-
5
- export class ControllerState{
6
-
7
- }
8
-
9
- export default class Controller extends GreyReactBox<ControllerState> {
10
- constructor(){
11
- super(new ControllerState)
12
- }
13
-
14
- getWhitelist = this.pipeline(getWhitelist);
1
+ import GreyReactBox from "grey-react-box";
2
+ import getWhitelist from './whitelist';
3
+
4
+
5
+ export class ControllerState{
6
+
7
+ }
8
+
9
+ export default class Controller extends GreyReactBox<ControllerState> {
10
+ constructor(){
11
+ super(new ControllerState)
12
+ }
13
+
14
+ getWhitelist = this.pipeline(getWhitelist);
15
15
  }
@@ -1,23 +1,23 @@
1
- import { ControllerState } from '.';
2
- import { DocumentsService } from "../../";
3
-
4
- export default async (s: any) => {
5
-
6
- console.log('DocumentsService.instance.service ===>', DocumentsService.instance.service);
7
- const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/queryWhiteListPage', data: { pageSize: 10, pageNum: 1 }, type: 'post' }) as any;
8
-
9
- if (res.err) {
10
- return false;
11
- }
12
- if (res.res) {
13
- res.res.items = res.res.items.map((item: any, index: any) => {
14
- return {
15
- ...item,
16
- index
17
- }
18
- })
19
- s.whiteblacklist = res.res.items || [];
20
- return res;
21
- // s.pageMeta = res.res.pageMeta;
22
- }
1
+ import { ControllerState } from '.';
2
+ import { DocumentsService } from "../../";
3
+
4
+ export default async (s: any) => {
5
+
6
+ console.log('DocumentsService.instance.service ===>', DocumentsService.instance.service);
7
+ const res = await DocumentsService.instance.service?.call({ url: '/whiteblacklist/config/queryWhiteListPage', data: { pageSize: 10, pageNum: 1 }, type: 'post' }) as any;
8
+
9
+ if (res.err) {
10
+ return false;
11
+ }
12
+ if (res.res) {
13
+ res.res.items = res.res.items.map((item: any, index: any) => {
14
+ return {
15
+ ...item,
16
+ index
17
+ }
18
+ })
19
+ s.whiteblacklist = res.res.items || [];
20
+ return res;
21
+ // s.pageMeta = res.res.pageMeta;
22
+ }
23
23
  }
@@ -1,23 +1,23 @@
1
-
2
- import { Button } from 'kts-components-antd-x4';
3
- import React from 'react';
4
- import DocumentsDemo from './'
5
-
6
- export default (props: any) => {
7
-
8
- const controller = DocumentsDemo.useController()
9
-
10
- const whiteblacklist = controller.useMemo((s: any) => s.whiteblacklist, [])
11
-
12
- console.log(whiteblacklist);
13
-
14
- React.useEffect(() => {
15
- controller.getWhitelist()
16
- }, [])
17
-
18
- return (
19
- <div>
20
- <Button>发送</Button>
21
- </div>
22
- );
1
+
2
+ import { Button } from 'kts-components-antd-x4';
3
+ import React from 'react';
4
+ import DocumentsDemo from './'
5
+
6
+ export default (props: any) => {
7
+
8
+ const controller = DocumentsDemo.useController()
9
+
10
+ const whiteblacklist = controller.useMemo((s: any) => s.whiteblacklist, [])
11
+
12
+ console.log(whiteblacklist);
13
+
14
+ React.useEffect(() => {
15
+ controller.getWhitelist()
16
+ }, [])
17
+
18
+ return (
19
+ <div>
20
+ <Button>发送</Button>
21
+ </div>
22
+ );
23
23
  };
@@ -1,8 +1,8 @@
1
- import { DocumentsDemo } from "../../../";
2
- import React from "react";
3
-
4
- export default () => {
5
- return (
6
- <DocumentsDemo />
7
- );
1
+ import { DocumentsDemo } from "../../../";
2
+ import React from "react";
3
+
4
+ export default () => {
5
+ return (
6
+ <DocumentsDemo />
7
+ );
8
8
  };