@bit-sun/business-component 2.3.21 → 2.3.22
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/.editorconfig +16 -16
- package/.fatherrc.ts +5 -5
- package/.gitlab-ci.yml +179 -179
- package/.prettierignore +7 -7
- package/.prettierrc +11 -11
- package/.umirc.ts +74 -74
- package/README.md +27 -27
- package/docs/index.md +21 -21
- package/lib/assets/drag.svg +17 -17
- package/lib/assets/exportFail.svg +37 -37
- package/lib/assets/exportProcessing.svg +28 -28
- package/lib/assets/exportSuccess.svg +34 -34
- package/lib/assets/label_icon_bottom.svg +25 -25
- package/lib/assets/upExport.svg +22 -22
- package/package.json +78 -78
- package/src/assets/32.svg +27 -27
- package/src/assets/addIcon.svg +17 -17
- package/src/assets/allfunc.svg +27 -27
- package/src/assets/arrowRight.svg +24 -24
- package/src/assets/btn-delete.svg +29 -29
- package/src/assets/btn-edit.svg +19 -19
- package/src/assets/btn-more.svg +17 -17
- package/src/assets/btn-submit.svg +19 -19
- package/src/assets/caidan.svg +11 -11
- package/src/assets/close.svg +26 -26
- package/src/assets/drag.svg +17 -17
- package/src/assets/exportFail.svg +37 -37
- package/src/assets/exportProcessing.svg +28 -28
- package/src/assets/exportSuccess.svg +34 -34
- package/src/assets/fixed-left-active.svg +11 -11
- package/src/assets/fixed-left.svg +15 -15
- package/src/assets/fixed-right-active.svg +11 -11
- package/src/assets/fixed-right.svg +15 -15
- package/src/assets/guanbi.svg +15 -15
- package/src/assets/icon-quanping.svg +15 -15
- package/src/assets/icon-shezhi.svg +17 -17
- package/src/assets/label_icon_bottom.svg +25 -25
- package/src/assets/list-no-img.svg +21 -21
- package/src/assets/morentouxiang-32.svg +23 -23
- package/src/assets/scanning.svg +24 -24
- package/src/assets/upExport.svg +22 -22
- package/src/common/ENUM.ts +41 -41
- package/src/components/Business/AddSelectBusiness/index.md +162 -162
- package/src/components/Business/AddSelectBusiness/index.tsx +1060 -895
- package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
- package/src/components/Business/BsLayouts/index.less +79 -79
- package/src/components/Business/BsLayouts/index.tsx +1484 -1484
- package/src/components/Business/BsLayouts/service.ts +10 -10
- package/src/components/Business/BsLayouts/utils.tsx +203 -203
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +564 -564
- package/src/components/Business/BsSulaQueryTable/index.less +221 -221
- package/src/components/Business/BsSulaQueryTable/index.tsx +535 -535
- package/src/components/Business/BsSulaQueryTable/setting.tsx +852 -852
- package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
- package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -690
- package/src/components/Business/CommodityEntry/index.md +70 -70
- package/src/components/Business/CommodityEntry/index.tsx +80 -80
- package/src/components/Business/CommonAlert/index.tsx +23 -23
- package/src/components/Business/CommonGuideWrapper/index.less +111 -111
- package/src/components/Business/CommonGuideWrapper/index.md +39 -39
- package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
- package/src/components/Business/DetailPageWrapper/index.less +79 -79
- package/src/components/Business/DetailPageWrapper/index.tsx +313 -313
- package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
- package/src/components/Business/HomePageWrapper/index.less +33 -33
- package/src/components/Business/HomePageWrapper/index.md +45 -45
- package/src/components/Business/HomePageWrapper/index.tsx +162 -162
- package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
- package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
- package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
- package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
- package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
- package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
- package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
- package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
- package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
- package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
- package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
- package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
- package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
- package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
- package/src/components/Business/JsonQueryTable/function.ts +62 -62
- package/src/components/Business/JsonQueryTable/index.less +16 -16
- package/src/components/Business/JsonQueryTable/index.md +328 -328
- package/src/components/Business/JsonQueryTable/index.tsx +535 -535
- package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
- package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
- package/src/components/Business/JsonQueryTable/static.ts +390 -390
- package/src/components/Business/SearchSelect/BusinessUtils.ts +1762 -1762
- package/src/components/Business/SearchSelect/common.ts +75 -75
- package/src/components/Business/SearchSelect/index.md +1329 -1329
- package/src/components/Business/SearchSelect/index.tsx +55 -55
- package/src/components/Business/SearchSelect/utils.ts +100 -100
- package/src/components/Business/StateFlow/index.less +130 -130
- package/src/components/Business/StateFlow/index.md +60 -60
- package/src/components/Business/StateFlow/index.tsx +29 -29
- package/src/components/Business/TreeSearchSelect/index.md +156 -156
- package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
- package/src/components/Business/TreeSearchSelect/utils.ts +75 -75
- package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
- package/src/components/Business/columnSettingTable/index.less +247 -247
- package/src/components/Business/columnSettingTable/index.md +357 -357
- package/src/components/Business/columnSettingTable/index.tsx +232 -232
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
- package/src/components/Business/columnSettingTable/utils.tsx +71 -71
- package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
- package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
- package/src/components/Business/moreTreeTable/index.less +99 -99
- package/src/components/Business/moreTreeTable/index.md +448 -448
- package/src/components/Business/moreTreeTable/index.tsx +387 -387
- package/src/components/Business/moreTreeTable/utils.ts +126 -126
- package/src/components/Functional/AddSelect/helps.ts +79 -14
- package/src/components/Functional/AddSelect/index.less +367 -367
- package/src/components/Functional/AddSelect/index.md +155 -155
- package/src/components/Functional/AddSelect/index.tsx +1170 -1282
- package/src/components/Functional/BillEntry/index.less +371 -371
- package/src/components/Functional/BillEntry/index.md +39 -39
- package/src/components/Functional/BillEntry/index.tsx +772 -772
- package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
- package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
- package/src/components/Functional/BsAntdSula/index.ts +2 -2
- package/src/components/Functional/DataImport/index.less +63 -63
- package/src/components/Functional/DataImport/index.md +44 -44
- package/src/components/Functional/DataImport/index.tsx +695 -695
- package/src/components/Functional/DataValidation/index.less +63 -63
- package/src/components/Functional/DataValidation/index.md +39 -39
- package/src/components/Functional/DataValidation/index.tsx +687 -687
- package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
- package/src/components/Functional/EllipsisTooltip/index.js +36 -36
- package/src/components/Functional/EllipsisTooltip/index.md +30 -30
- package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
- package/src/components/Functional/QueryMutipleInput/index.less +37 -37
- package/src/components/Functional/QueryMutipleInput/index.md +33 -33
- package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
- package/src/components/Functional/SearchSelect/index.less +115 -115
- package/src/components/Functional/SearchSelect/index.md +141 -141
- package/src/components/Functional/SearchSelect/index.tsx +879 -879
- package/src/components/Functional/SearchSelect/utils.ts +3 -3
- package/src/components/Functional/TreeSearchSelect/index.md +47 -47
- package/src/components/Functional/TreeSearchSelect/index.tsx +199 -199
- package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
- package/src/components/Solution/RuleComponent/index.d.ts +29 -29
- package/src/components/Solution/RuleComponent/index.js +2032 -2032
- package/src/components/Solution/RuleComponent/index.less +230 -230
- package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
- package/src/components/Solution/RuleComponent/ruleFiled.js +2107 -2107
- package/src/components/Solution/RuleComponent/services.ts +13 -13
- package/src/components/Solution/RuleComponent/util.js +139 -139
- package/src/index.ts +38 -38
- package/src/plugin/TableColumnSetting/index.less +247 -247
- package/src/plugin/TableColumnSetting/index.md +50 -50
- package/src/plugin/TableColumnSetting/index.tsx +724 -724
- package/src/plugin/TableColumnSetting/utils.ts +19 -19
- package/src/styles/bsDefault.less +1912 -1912
- package/src/utils/CheckOneUser/index.md +39 -39
- package/src/utils/CheckOneUser/index.ts +51 -51
- package/src/utils/LocalstorageUtils.ts +95 -95
- package/src/utils/TableUtils.tsx +18 -18
- package/src/utils/checkUtils.ts +39 -39
- package/src/utils/enumConfig.ts +11 -11
- package/src/utils/getFormMode.js +12 -12
- package/src/utils/index.ts +4 -4
- package/src/utils/requestUtils.ts +34 -34
- package/src/utils/serialize.js +7 -7
- package/src/utils/utils.ts +212 -212
- package/tsconfig.json +29 -29
- package/typings.d.ts +4 -4
- package/dist/common/ENUM.d.ts +0 -40
- package/dist/components/Business/AddSelectBusiness/index.d.ts +0 -3
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +0 -17
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +0 -30
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +0 -3
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +0 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +0 -4
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +0 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +0 -8
- package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +0 -8
- package/dist/components/Business/BsLayouts/index.d.ts +0 -18
- package/dist/components/Business/BsLayouts/service.d.ts +0 -1
- package/dist/components/Business/BsLayouts/utils.d.ts +0 -10
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +0 -60
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +0 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +0 -60
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +0 -98
- package/dist/components/Business/CommodityEntry/index.d.ts +0 -2
- package/dist/components/Business/CommonAlert/index.d.ts +0 -3
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +0 -6
- package/dist/components/Business/DetailPageWrapper/index.d.ts +0 -9
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +0 -8
- package/dist/components/Business/HomePageWrapper/index.d.ts +0 -3
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +0 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +0 -2
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +0 -6
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +0 -2
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +0 -2
- package/dist/components/Business/JsonQueryTable/function.d.ts +0 -37
- package/dist/components/Business/JsonQueryTable/index.d.ts +0 -4
- package/dist/components/Business/JsonQueryTable/static.d.ts +0 -41
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +0 -5
- package/dist/components/Business/SearchSelect/common.d.ts +0 -25
- package/dist/components/Business/SearchSelect/index.d.ts +0 -3
- package/dist/components/Business/SearchSelect/utils.d.ts +0 -5
- package/dist/components/Business/StateFlow/index.d.ts +0 -3
- package/dist/components/Business/TreeSearchSelect/index.d.ts +0 -3
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +0 -4
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +0 -54
- package/dist/components/Business/columnSettingTable/index.d.ts +0 -16
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +0 -17
- package/dist/components/Business/columnSettingTable/utils.d.ts +0 -8
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +0 -3
- package/dist/components/Business/moreTreeTable/hooks/useSticky.d.ts +0 -8
- package/dist/components/Business/moreTreeTable/index.d.ts +0 -4
- package/dist/components/Business/moreTreeTable/utils.d.ts +0 -9
- package/dist/components/Functional/AddSelect/helps.d.ts +0 -1
- package/dist/components/Functional/AddSelect/index.d.ts +0 -3
- package/dist/components/Functional/BillEntry/index.d.ts +0 -4
- package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +0 -18
- package/dist/components/Functional/BsAntdSula/index.d.ts +0 -1
- package/dist/components/Functional/DataImport/index.d.ts +0 -144
- package/dist/components/Functional/DataValidation/index.d.ts +0 -144
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +0 -12
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +0 -5
- package/dist/components/Functional/SearchSelect/index.d.ts +0 -4
- package/dist/components/Functional/SearchSelect/utils.d.ts +0 -1
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +0 -2
- package/dist/components/Solution/RuleComponent/Formula.d.ts +0 -8
- package/dist/components/Solution/RuleComponent/services.d.ts +0 -1
- package/dist/index.d.ts +0 -28
- package/dist/index.esm.js +0 -30692
- package/dist/index.js +0 -30739
- package/dist/plugin/TableColumnSetting/index.d.ts +0 -64
- package/dist/plugin/TableColumnSetting/utils.d.ts +0 -1
- package/dist/utils/CheckOneUser/index.d.ts +0 -2
- package/dist/utils/LocalstorageUtils.d.ts +0 -17
- package/dist/utils/TableUtils.d.ts +0 -11
- package/dist/utils/checkUtils.d.ts +0 -3
- package/dist/utils/enumConfig.d.ts +0 -12
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/requestUtils.d.ts +0 -1
- package/dist/utils/utils.d.ts +0 -23
|
@@ -1,1282 +1,1170 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { useDebounceFn } from 'ahooks';
|
|
4
|
-
import { Input, Button, Modal, Select, InputNumber, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag } from 'antd';
|
|
5
|
-
import { SearchOutlined, CopyOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
|
6
|
-
import axios from 'axios';
|
|
7
|
-
import { stringify } from 'querystring';
|
|
8
|
-
import _ from "lodash"
|
|
9
|
-
import './index.less';
|
|
10
|
-
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
|
-
import { Resizable } from 'react-resizable';
|
|
12
|
-
import { checkQuantityAccuracy, precisionQuantity } from '@/utils/checkUtils';
|
|
13
|
-
import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
14
|
-
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
15
|
-
import { handleAntdColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
16
|
-
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
17
|
-
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
18
|
-
import { getSelectDataList } from './helps';
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if(
|
|
214
|
-
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
if (
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
const dataParams = key.split('*
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
dataParams.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
if (
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
//
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
<span><span>*</span> 快捷键:【Tab】-跳格切换;【Shift+←、→】-当前行左、右移动;【 ↑、↓】-当前列上、下移动;【ctrl+Enter】-保存并继续;【ctrl+Delete】-删除当前行;</span>
|
|
1172
|
-
<span className='add_select_header_close'><CloseCircleOutlined style={{fontSize: '20px'}} onClick={handleCancel} /></span>
|
|
1173
|
-
</div>
|
|
1174
|
-
<div className={'add_select_wrapper'}>
|
|
1175
|
-
<div className={caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'}>
|
|
1176
|
-
<div className={'select_list_columns'}>
|
|
1177
|
-
<div className={'select_list_columns_formItems'}>
|
|
1178
|
-
<Form form={form} layout='vertical' key='modalForm'>
|
|
1179
|
-
{formItem(tableSearchForm)}
|
|
1180
|
-
</Form>
|
|
1181
|
-
</div>
|
|
1182
|
-
</div>
|
|
1183
|
-
<div className={'select_list_searchButton'}>
|
|
1184
|
-
<Button key='reset' className={'select_list_button_space'} onClick={onResetTable}>重置</Button>
|
|
1185
|
-
<Button key='search' type="primary" onClick={onSearchTable}>查询</Button>
|
|
1186
|
-
</div>
|
|
1187
|
-
</div>
|
|
1188
|
-
<div className={caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'}>
|
|
1189
|
-
<div>
|
|
1190
|
-
<div className={'select_list_selectTips'}>
|
|
1191
|
-
<div style={{ marginLeft: 8 }}>搜索结果共 <span style={themeColor}>{tablePagination?.total || 0}</span> 项{selectMode ? <span>, 本次已选 <span style={themeColor}>{selectLength}</span> 项</span> : ''}</div>
|
|
1192
|
-
<div>
|
|
1193
|
-
<span style={{ marginRight: 8 }}>
|
|
1194
|
-
<TableColumnSetting
|
|
1195
|
-
setShowColumns={setShowToChooseColumnsCallback}
|
|
1196
|
-
showColumns={showToChooseColumns}
|
|
1197
|
-
datasource={tableColumns || []}
|
|
1198
|
-
tableCode={codeToChoose}
|
|
1199
|
-
settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
|
|
1200
|
-
/>
|
|
1201
|
-
</span>
|
|
1202
|
-
</div>
|
|
1203
|
-
</div>
|
|
1204
|
-
<Table
|
|
1205
|
-
size='small'
|
|
1206
|
-
rowSelection={rowSelection}
|
|
1207
|
-
columns={showToChooseCol}
|
|
1208
|
-
dataSource={tableData}
|
|
1209
|
-
pagination={tablePagination}
|
|
1210
|
-
loading={fetching}
|
|
1211
|
-
onChange={handleTableChange}
|
|
1212
|
-
rowKey={mappingValueField}
|
|
1213
|
-
rowClassName={'row-class'}
|
|
1214
|
-
scroll={{ y: 500 }}
|
|
1215
|
-
components={{
|
|
1216
|
-
header: {
|
|
1217
|
-
cell: ResizeableTitle,
|
|
1218
|
-
},
|
|
1219
|
-
}}
|
|
1220
|
-
/>
|
|
1221
|
-
</div>
|
|
1222
|
-
</div>
|
|
1223
|
-
{/* <div>
|
|
1224
|
-
<Table
|
|
1225
|
-
size='small'
|
|
1226
|
-
columns={modalTableProps?.tableColumns}
|
|
1227
|
-
dataSource={mapRows(doubleArr)}
|
|
1228
|
-
rowKey={mappingValueField}
|
|
1229
|
-
scroll={{ x: modalTableProps.overScrollX || 'max-content', y: modalTableProps.overScrollY || null }}
|
|
1230
|
-
onRow={record => {
|
|
1231
|
-
return {
|
|
1232
|
-
onDoubleClick: event => onDoubleClickSelect(event, record),
|
|
1233
|
-
};
|
|
1234
|
-
}}
|
|
1235
|
-
/>
|
|
1236
|
-
</div> */}
|
|
1237
|
-
</div>
|
|
1238
|
-
<div className={'add_select_wrapper_select'}>
|
|
1239
|
-
<div className={'select_list_selectTips'}>
|
|
1240
|
-
<div style={{ marginLeft: 8 }}><span>本次已选 <span style={themeColor}>{selectLength}</span> 项</span></div>
|
|
1241
|
-
<div style={{ display: 'flex' }}>
|
|
1242
|
-
<span style={{ marginRight: 8 }}>
|
|
1243
|
-
<TableColumnSetting
|
|
1244
|
-
setShowColumns={setShowColumnsCallback}
|
|
1245
|
-
showColumns={showColumns}
|
|
1246
|
-
datasource={selectColumns || []}
|
|
1247
|
-
tableCode={codeSelected}
|
|
1248
|
-
settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
|
|
1249
|
-
/>
|
|
1250
|
-
</span>
|
|
1251
|
-
<div style={{ marginRight: 8 }}><span onClick={deleteSelectRows} style={{ ...themeColor, cursor: 'pointer' }}>清空所选商品</span></div>
|
|
1252
|
-
</div>
|
|
1253
|
-
</div>
|
|
1254
|
-
<Table
|
|
1255
|
-
size='small'
|
|
1256
|
-
columns={showSelectedCol}
|
|
1257
|
-
dataSource={popvalue}
|
|
1258
|
-
pagination={false}
|
|
1259
|
-
// onChange={handleTableChange}
|
|
1260
|
-
rowKey={selectRowKey}
|
|
1261
|
-
rowClassName={'row-class'}
|
|
1262
|
-
scroll={{ y: 500 }}
|
|
1263
|
-
onRow={record => {
|
|
1264
|
-
return {
|
|
1265
|
-
onDoubleClick: event => onDoubleClickSelect(event, record),
|
|
1266
|
-
};
|
|
1267
|
-
}}
|
|
1268
|
-
components={{
|
|
1269
|
-
header: {
|
|
1270
|
-
cell: ResizeableTitle,
|
|
1271
|
-
},
|
|
1272
|
-
}}
|
|
1273
|
-
/>
|
|
1274
|
-
</div>
|
|
1275
|
-
</div>
|
|
1276
|
-
</Modal>
|
|
1277
|
-
)}
|
|
1278
|
-
</div>
|
|
1279
|
-
);
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
export default AddSelect;
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { useDebounceFn } from 'ahooks';
|
|
4
|
+
import { Input, Button, Modal, Select, InputNumber, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag } from 'antd';
|
|
5
|
+
import { SearchOutlined, CopyOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
|
6
|
+
import axios from 'axios';
|
|
7
|
+
import { stringify } from 'querystring';
|
|
8
|
+
import _ from "lodash"
|
|
9
|
+
import './index.less';
|
|
10
|
+
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
|
+
import { Resizable } from 'react-resizable';
|
|
12
|
+
import { checkQuantityAccuracy, precisionQuantity } from '@/utils/checkUtils';
|
|
13
|
+
import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
14
|
+
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
15
|
+
import { handleAntdColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
16
|
+
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
17
|
+
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
18
|
+
import { getSelectDataList, loadSelectSource, formatFormSourceList } from './helps';
|
|
19
|
+
|
|
20
|
+
const checkSpuMatchCode = (data: any) => {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
axios.post(`/stock/rwFrontRecordSkcDetail/checkSpuMatchCode`,data)
|
|
23
|
+
.then((result: any) => {
|
|
24
|
+
result = result.data;
|
|
25
|
+
if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
|
|
26
|
+
message.error(result.msg);
|
|
27
|
+
reject(false);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
resolve(result);
|
|
31
|
+
})
|
|
32
|
+
.catch((err) => {
|
|
33
|
+
reject(err);
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const ResizeableTitle = (props) => {
|
|
39
|
+
const { onResize, width, ...restProps } = props;
|
|
40
|
+
|
|
41
|
+
if (!width) {
|
|
42
|
+
return <th {...restProps} />;
|
|
43
|
+
}
|
|
44
|
+
return (
|
|
45
|
+
<Resizable
|
|
46
|
+
width={width}
|
|
47
|
+
height={0}
|
|
48
|
+
onResize={onResize}
|
|
49
|
+
draggableOpts={{ enableUserSelectHack: false }}
|
|
50
|
+
>
|
|
51
|
+
<th {...restProps} />
|
|
52
|
+
</Resizable>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const initTableCode = {
|
|
57
|
+
'sku': ['skuSelect-tableOptionsToChoosePartCode','skuSelect-tableSelectedItemPartCode'],
|
|
58
|
+
'skc': ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
|
|
59
|
+
'spu': [['spuSelect-tableOptionsToChoosePartCode','spuSelect-tableSelectedItemPartCode']]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const { Option } = Select;
|
|
63
|
+
|
|
64
|
+
const AddSelect = (props: any) => {
|
|
65
|
+
const {
|
|
66
|
+
value, // 必传
|
|
67
|
+
onChange,
|
|
68
|
+
selectProps = {},
|
|
69
|
+
modalTableProps = {},
|
|
70
|
+
labelInValue = false,
|
|
71
|
+
requestConfig,
|
|
72
|
+
ctx,
|
|
73
|
+
sourceName,
|
|
74
|
+
needModalTable = true,
|
|
75
|
+
getPopupContainer = undefined,
|
|
76
|
+
onSaveCallback,
|
|
77
|
+
buttonText = '添加',
|
|
78
|
+
buttonProps = {},
|
|
79
|
+
beforeShowModal,
|
|
80
|
+
tableCodeList = [], // 非必填 默认取组件定义code,如需自定义----数组第一位为供选择商品的table的code,第二位为已选择商品的table的code
|
|
81
|
+
businessType = 'sku',
|
|
82
|
+
isAllowRepeatedSelect = false,
|
|
83
|
+
|
|
84
|
+
} = props;
|
|
85
|
+
const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField = 'name', mappingTextShowKeyField, mappingValueField = 'code', mappingTextShowTextField } = requestConfig || {};
|
|
86
|
+
const resultSourceKey = sourceName || requestConfig?.sourceName || 'supplierCode'
|
|
87
|
+
const realButtonProps = {type: "primary", ...buttonProps};
|
|
88
|
+
const selectRowKey = isAllowRepeatedSelect ? 'uuid' : mappingValueField
|
|
89
|
+
|
|
90
|
+
const selectMode = selectProps?.mode // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
91
|
+
const initVal = value || (selectMode ? [] : null);
|
|
92
|
+
const pageSize = 100 // 下拉框默认分页 条数
|
|
93
|
+
const tableInitPageSize = 10 // 弹框默认分页 条数
|
|
94
|
+
const currentPage = 1
|
|
95
|
+
const selectParamsKey = requestConfig?.filter || 'qp-codeAndName-like'
|
|
96
|
+
const selectParamsInitKey = requestConfig?.filterInit || selectParamsKey
|
|
97
|
+
const currentSelectProps = {
|
|
98
|
+
...selectProps,
|
|
99
|
+
// 以下属性不可更改----设计配置项
|
|
100
|
+
showSearch: false,
|
|
101
|
+
filterOption: false,
|
|
102
|
+
allowClear: true,
|
|
103
|
+
listHeight: 160,
|
|
104
|
+
optionLabelProp: "label",
|
|
105
|
+
autoClearSearchValue: false
|
|
106
|
+
}
|
|
107
|
+
const [items, setItems] = useState([]);
|
|
108
|
+
const [scrollPage, setScrollPage] = useState(1);
|
|
109
|
+
const [itemsTotal, setItemsTotal] = useState(0);
|
|
110
|
+
const [fetching, setFetching] = useState(false);
|
|
111
|
+
const [searchValue, setSearchValue] = useState('');
|
|
112
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
113
|
+
const [popvalue, setPopValue] = useState(initVal);
|
|
114
|
+
const [uniqueValue, setUniqueValue] = useState(sourceName)
|
|
115
|
+
const { run } = useDebounceFn(
|
|
116
|
+
(v?: any) => {
|
|
117
|
+
// 优化搜索参数 支持传多个
|
|
118
|
+
let searchParams = {};
|
|
119
|
+
if (typeof selectParamsKey === 'string') {
|
|
120
|
+
searchParams = v ? { [selectParamsInitKey]: initVal } : { [selectParamsKey]: searchValue }
|
|
121
|
+
}
|
|
122
|
+
if (Array.isArray(selectParamsKey)) {
|
|
123
|
+
selectParamsKey.forEach((i: any) => {
|
|
124
|
+
searchParams = { ...searchParams, [i]: searchValue }
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
// 防抖函数 待定
|
|
128
|
+
getData(searchParams)
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
wait: 1000,
|
|
132
|
+
},
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const [form] = Form.useForm();
|
|
136
|
+
const [tableSearchForm, setTableSearchForm] = useState(modalTableProps?.tableSearchForm)
|
|
137
|
+
const [caretLeftFlag, setCaretLeftFlag] = useState(true);
|
|
138
|
+
const [tableData, setTableData] = useState([]);
|
|
139
|
+
const [tablePagination, setTablePagination] = useState({ total: 0, size: "small", current: 1, pageSize: tableInitPageSize })
|
|
140
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
141
|
+
const [doubleArr, setDoubleArr] = useState([]); // 存放双数组的数组
|
|
142
|
+
const [checkedAll, setCheckedAll] = useState(false)
|
|
143
|
+
const [indeterminate, setIndeterminate] = useState(false)
|
|
144
|
+
const [tableFormParams, setTableFormParams] = useState({});
|
|
145
|
+
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
146
|
+
const [confirmContinueLoading, setConfirmContinueLoading] = useState(false);
|
|
147
|
+
|
|
148
|
+
const [selectColumns, setSelectColumns] = useState([]);
|
|
149
|
+
const [showColumns, setShowColumns] = useState([]);
|
|
150
|
+
const [tableColumns, setTableColumns] = useState([]);
|
|
151
|
+
const [showToChooseColumns, setShowToChooseColumns] = useState([]);
|
|
152
|
+
const codeToChoose = tableCodeList[0] || initTableCode[businessType][0];
|
|
153
|
+
const codeSelected = tableCodeList[1] || initTableCode[businessType][1];
|
|
154
|
+
|
|
155
|
+
const checkSelectChange = async (bType: string, tList: any, recordKey: string, recordItem: any, selectItem: any, changeValue: string) => {
|
|
156
|
+
if(bType == 'skc' && tList.some((i: any) => i[recordKey] == recordItem[recordKey] && i[selectItem.dataIndex] == changeValue)) {
|
|
157
|
+
message.warning('相同skc配码不可设置相同哦')
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
if(bType == 'spu') {
|
|
161
|
+
if(selectItem.dataIndex == 'colorName' && tList.some((i: any) => i[recordKey] == recordItem[recordKey] && i.selectPropertyGroupCode == recordItem.selectPropertyGroupCode && i[selectItem.dataIndex] == changeValue)){
|
|
162
|
+
message.warning('相同商品相同配码颜色不可设置相同哦')
|
|
163
|
+
return false
|
|
164
|
+
}
|
|
165
|
+
if(selectItem.dataIndex == 'selectPropertyGroupCode' && !recordItem.colorName) {
|
|
166
|
+
message.warning('请先选择颜色!')
|
|
167
|
+
return false
|
|
168
|
+
}
|
|
169
|
+
if(selectItem.dataIndex == 'selectPropertyGroupCode'&& tList.some((i: any) => i[recordKey] == recordItem[recordKey] && i.colorName == recordItem.colorName && i[selectItem.dataIndex] == changeValue)){
|
|
170
|
+
message.warning('相同商品相同颜色配码不可设置相同哦')
|
|
171
|
+
return false
|
|
172
|
+
}
|
|
173
|
+
if(selectItem.dataIndex == 'selectPropertyGroupCode') {
|
|
174
|
+
let result = true
|
|
175
|
+
try {
|
|
176
|
+
result = await checkSpuMatchCode({ skcCode: recordItem[recordKey], matchingCode: changeValue, ext1: recordItem.colorName });
|
|
177
|
+
result = true
|
|
178
|
+
} catch (e) {
|
|
179
|
+
result = typeof e == 'boolean' ? e : false
|
|
180
|
+
}
|
|
181
|
+
return result
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return true
|
|
185
|
+
}
|
|
186
|
+
const setBusinessDefaultValue = (list: any, recordList: any) => {
|
|
187
|
+
let result = list;
|
|
188
|
+
if(businessType == 'spu' && (recordList?.some((i: any) => i?.colorValues?.length == 1) || recordList?.some((i: any) => i?.defaultMatchingCode))) {
|
|
189
|
+
result = list.map((i: any) => {
|
|
190
|
+
recordList.forEach((record: any) => {
|
|
191
|
+
if(i.uuid == record?.uuid) {
|
|
192
|
+
if(record.colorValues?.length == 1) {
|
|
193
|
+
i.colorName = record.colorValues[0]?.value;
|
|
194
|
+
}
|
|
195
|
+
i.selectPropertyGroupCode = record?.defaultMatchingCode;
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
return i
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
return result
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
setTableColumns(modalTableProps?.tableColumns)
|
|
206
|
+
}, [modalTableProps?.tableColumns])
|
|
207
|
+
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
setSelectColumns([... modalTableProps.selectColumn.map(item => {
|
|
210
|
+
const inputLength = modalTableProps.selectColumn.filter(item => item.isInputItem).length
|
|
211
|
+
const currentIndex = inputIndex
|
|
212
|
+
|
|
213
|
+
if (item.isInputItem) {
|
|
214
|
+
inputIndex++;
|
|
215
|
+
return {
|
|
216
|
+
...item,
|
|
217
|
+
render: (text, record, index) => {
|
|
218
|
+
// let
|
|
219
|
+
if(record.needFocus === true && currentIndex === 0) {
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
let precisionObj=businessType == 'skc'?{
|
|
223
|
+
precision: 0
|
|
224
|
+
}:{};
|
|
225
|
+
const unitAccuracy = record.packingUnitList?.[0]?.unitAccuracy
|
|
226
|
+
const isCountUnitAccuracyCheck = item.dataIndex =='count' && unitAccuracy !== undefined
|
|
227
|
+
if(isCountUnitAccuracyCheck) {
|
|
228
|
+
precisionObj = {
|
|
229
|
+
onBlur: (e: any) => {
|
|
230
|
+
const { target: { value } } = e;
|
|
231
|
+
if(!checkQuantityAccuracy(value,Number(unitAccuracy))) {
|
|
232
|
+
record[item.dataIndex] = precisionQuantity(value,Number(unitAccuracy))
|
|
233
|
+
const newPopValue = popvalue.map((i: any, innerIndex: number) => {
|
|
234
|
+
if(innerIndex == index) {
|
|
235
|
+
i[item.dataIndex] = record[item.dataIndex]
|
|
236
|
+
}
|
|
237
|
+
return i
|
|
238
|
+
})
|
|
239
|
+
setPopValue(newPopValue)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// precision: unitAccuracy
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return (
|
|
246
|
+
<InputNumber
|
|
247
|
+
value={text || ''}
|
|
248
|
+
min={0}
|
|
249
|
+
autoFocus={record.needFocus}
|
|
250
|
+
keyboard={false}
|
|
251
|
+
{...precisionObj}
|
|
252
|
+
onChange={(value) => {
|
|
253
|
+
record[item.dataIndex] = value
|
|
254
|
+
const newPopValue = popvalue.map((i: any, innerIndex: number) => {
|
|
255
|
+
if(innerIndex == index) {
|
|
256
|
+
i[item.dataIndex] = record[item.dataIndex]
|
|
257
|
+
}
|
|
258
|
+
return i
|
|
259
|
+
})
|
|
260
|
+
setPopValue(newPopValue)
|
|
261
|
+
}}
|
|
262
|
+
// onFocus={(e)=> {
|
|
263
|
+
// let dom1 = e.currentTarget;
|
|
264
|
+
// dom1.setSelectionRange(100, 0);
|
|
265
|
+
// dom1.select(text);
|
|
266
|
+
// }}
|
|
267
|
+
onKeyDown={(e) => {
|
|
268
|
+
if(e.keyCode === 13 && e.ctrlKey) {
|
|
269
|
+
handleOk(true)
|
|
270
|
+
document.getElementById("first-query")?.focus()
|
|
271
|
+
}
|
|
272
|
+
if(e.keyCode === 8 && e.ctrlKey) {
|
|
273
|
+
message.success('删除当前行')
|
|
274
|
+
e.stopPropagation();
|
|
275
|
+
e.preventDefault();
|
|
276
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
277
|
+
if (dom) {
|
|
278
|
+
dom.select();
|
|
279
|
+
dom.focus();
|
|
280
|
+
dom.scrollIntoView(false)
|
|
281
|
+
}
|
|
282
|
+
dom = null
|
|
283
|
+
deleteRecord(record, popvalue);
|
|
284
|
+
}
|
|
285
|
+
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
e.preventDefault();
|
|
288
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
289
|
+
if (dom) {
|
|
290
|
+
dom.select();
|
|
291
|
+
dom.focus();
|
|
292
|
+
dom.scrollIntoView(false)
|
|
293
|
+
}
|
|
294
|
+
dom = null
|
|
295
|
+
}
|
|
296
|
+
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
300
|
+
if (dom) {
|
|
301
|
+
dom.select();
|
|
302
|
+
dom.focus();
|
|
303
|
+
dom.scrollIntoView(false)
|
|
304
|
+
}
|
|
305
|
+
dom = null
|
|
306
|
+
}
|
|
307
|
+
if (e.keyCode === 40) {
|
|
308
|
+
e.stopPropagation();
|
|
309
|
+
e.preventDefault();
|
|
310
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
311
|
+
if (dom) {
|
|
312
|
+
dom.select();
|
|
313
|
+
dom.focus();
|
|
314
|
+
dom.scrollIntoView(false)
|
|
315
|
+
}
|
|
316
|
+
dom = null
|
|
317
|
+
} else if (e.keyCode === 38) {
|
|
318
|
+
e.stopPropagation();
|
|
319
|
+
e.preventDefault();
|
|
320
|
+
let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
321
|
+
if (dom1) {
|
|
322
|
+
// dom1.value=""
|
|
323
|
+
// dom1.setSelectionRange(100, 0);
|
|
324
|
+
dom1.select();
|
|
325
|
+
dom1.focus();
|
|
326
|
+
dom1.scrollIntoViewIfNeeded(false)
|
|
327
|
+
// dom1.value=record['count']
|
|
328
|
+
}
|
|
329
|
+
dom1 = null
|
|
330
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
331
|
+
e.stopPropagation();
|
|
332
|
+
e.preventDefault();
|
|
333
|
+
}
|
|
334
|
+
}}
|
|
335
|
+
/>
|
|
336
|
+
);
|
|
337
|
+
},
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const selectLength = modalTableProps.selectColumn.filter(item => item.isSelectItem).length
|
|
342
|
+
const currentSelectIndex = selectIndex
|
|
343
|
+
if(item.isSelectItem) {
|
|
344
|
+
selectIndex++;
|
|
345
|
+
return {
|
|
346
|
+
...item,
|
|
347
|
+
render: (text, record, index) => {
|
|
348
|
+
if (item?.dataSource?.length || item?.dataSourceCode) {
|
|
349
|
+
const selectKey = item?.dataSourceMapping?.[0] || 'code';
|
|
350
|
+
const selectText = item?.dataSourceMapping?.[1] || 'name';
|
|
351
|
+
const dataSourceList = getSelectDataList(record,item,selectKey);
|
|
352
|
+
return (
|
|
353
|
+
<Select
|
|
354
|
+
value={text || null}
|
|
355
|
+
onChange={async (value) => {
|
|
356
|
+
const isConformToTheRules = await checkSelectChange(businessType,popvalue,mappingValueField,record,item,value)
|
|
357
|
+
if(isConformToTheRules) {
|
|
358
|
+
record[item.dataIndex] = value
|
|
359
|
+
} else {
|
|
360
|
+
record[item.dataIndex] = null;
|
|
361
|
+
}
|
|
362
|
+
const newPopValue = popvalue.map((i: any, innerIndex: number) => {
|
|
363
|
+
if(innerIndex == index) {
|
|
364
|
+
i[item.dataIndex] = record[item.dataIndex]
|
|
365
|
+
}
|
|
366
|
+
return i
|
|
367
|
+
})
|
|
368
|
+
setPopValue(newPopValue)
|
|
369
|
+
}}
|
|
370
|
+
style={{width: '160px'}}
|
|
371
|
+
>
|
|
372
|
+
{dataSourceList.map((item: any) => {
|
|
373
|
+
return <Select.Option value={item[selectKey]}>{item[selectText]}</Select.Option>
|
|
374
|
+
})}
|
|
375
|
+
</Select>
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
return <></>
|
|
379
|
+
},
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return item
|
|
384
|
+
}), {
|
|
385
|
+
title: '操作',
|
|
386
|
+
width: 50,
|
|
387
|
+
dataIndex: 'operation',
|
|
388
|
+
fixed: 'right',
|
|
389
|
+
render: (text, record, index) => {
|
|
390
|
+
return (
|
|
391
|
+
<span style={{cursor: 'pointer', color: '#005CFF' }} onClick={() => {
|
|
392
|
+
deleteRecord(record)
|
|
393
|
+
}} type={"text"}>删除</span>
|
|
394
|
+
)
|
|
395
|
+
}
|
|
396
|
+
},])
|
|
397
|
+
}, [modalTableProps?.selectColumn,popvalue])
|
|
398
|
+
|
|
399
|
+
// 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
400
|
+
const getData = (params = {}, type = 1) => {
|
|
401
|
+
if (!requestConfig) return;
|
|
402
|
+
|
|
403
|
+
setFetching(true)
|
|
404
|
+
|
|
405
|
+
// 处理dependence参数
|
|
406
|
+
const fixedParam = {};
|
|
407
|
+
if (fixedparameter && fieldValToParam && ctx) {
|
|
408
|
+
fixedparameter.forEach((item: any, index: any) => {
|
|
409
|
+
const fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
410
|
+
if (fixedParamVal) {
|
|
411
|
+
fixedParam[item] = fixedParamVal;
|
|
412
|
+
form.setFieldsValue({ ...form?.getFieldsValue(), [item]: fixedParamVal })
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// 数组对象处理,对带有特殊标记的name进行处理
|
|
418
|
+
for (const key in params) {
|
|
419
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
420
|
+
const element = params[key];
|
|
421
|
+
if (element && key.indexOf('*number*') >= 0) {
|
|
422
|
+
const dataParams = key.split('*number*');
|
|
423
|
+
dataParams.forEach((value, index) => {
|
|
424
|
+
params[value] = element[index];
|
|
425
|
+
});
|
|
426
|
+
delete params[key];
|
|
427
|
+
} else if (element && key.indexOf('*address*') >= 0) {
|
|
428
|
+
const dataParams = key.split('*address*');
|
|
429
|
+
dataParams.forEach((value, index) => {
|
|
430
|
+
params[value] = element.PCDCode[index];
|
|
431
|
+
});
|
|
432
|
+
delete params[key];
|
|
433
|
+
} else if (element && key.indexOf('*costType*') >= 0) {
|
|
434
|
+
const dataParams = key.split('*costType*');
|
|
435
|
+
// eslint-disable-next-line prefer-destructuring
|
|
436
|
+
params[dataParams[0]] = element[1];
|
|
437
|
+
delete params[key];
|
|
438
|
+
} else if (element && key.indexOf('*fullDate*') >= 0) {
|
|
439
|
+
const dataParams = key.split('*fullDate*');
|
|
440
|
+
dataParams.forEach((value, index) => {
|
|
441
|
+
if (index === 0) {
|
|
442
|
+
params[value] = moment(element[index])
|
|
443
|
+
.millisecond(0)
|
|
444
|
+
.second(0)
|
|
445
|
+
.minute(0)
|
|
446
|
+
.hour(0)
|
|
447
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
448
|
+
} else {
|
|
449
|
+
params[value] = moment(element[index])
|
|
450
|
+
.millisecond(59)
|
|
451
|
+
.second(59)
|
|
452
|
+
.minute(59)
|
|
453
|
+
.hour(23)
|
|
454
|
+
.format('YYYY-MM-DD HH:mm:ss');
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
delete params[key];
|
|
458
|
+
} else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
|
|
459
|
+
const dataParams = key.split('*checkBox*');
|
|
460
|
+
if (element) {
|
|
461
|
+
params[dataParams[0]] = 0
|
|
462
|
+
}
|
|
463
|
+
delete params[key];
|
|
464
|
+
} else if (element && key.indexOf('*cascader*') >= 0) {
|
|
465
|
+
const dataParams = key.split('*cascader*');
|
|
466
|
+
params[dataParams[0]] = element[element.length - 1]
|
|
467
|
+
delete params[key];
|
|
468
|
+
} else if (element && key.indexOf('*date*') >= 0) {
|
|
469
|
+
const dataParams = key.split('*date*')
|
|
470
|
+
dataParams.forEach((value, index) => {
|
|
471
|
+
if (index === 0) {
|
|
472
|
+
params[value] = moment(element[index])
|
|
473
|
+
.format('YYYY-MM-DD');
|
|
474
|
+
} else {
|
|
475
|
+
params[value] = moment(element[index])
|
|
476
|
+
.format('YYYY-MM-DD');
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
delete params[key];
|
|
480
|
+
}
|
|
481
|
+
else if (element && key.indexOf('*') >= 0) {
|
|
482
|
+
const dataParams = key.split('*');
|
|
483
|
+
dataParams.forEach((value, index) => {
|
|
484
|
+
params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
|
|
485
|
+
});
|
|
486
|
+
delete params[key];
|
|
487
|
+
} else if (element && key.indexOf('_selectNumberRange') >= 0) { // key = xxxxx_selectNumberRange qp-xxxxx-gt
|
|
488
|
+
const dataParams = key.split('_selectNumberRange')[0]
|
|
489
|
+
if (params[key][0] === 'range') {
|
|
490
|
+
if (params[key][1][0]) {
|
|
491
|
+
params[`qp-${dataParams}-ge`] = params[key][1][0]
|
|
492
|
+
}
|
|
493
|
+
if (params[key][1][1]) {
|
|
494
|
+
params[`qp-${dataParams}-le`] = params[key][1][1]
|
|
495
|
+
}
|
|
496
|
+
} else {
|
|
497
|
+
params[`qp-${dataParams}-${params[key][0]}`] = params[key][1]
|
|
498
|
+
}
|
|
499
|
+
delete params[key]
|
|
500
|
+
} else if (Array.isArray(element)) {
|
|
501
|
+
params[key] = element.join(',');
|
|
502
|
+
} else if (element == null || element === undefined || String(element).trim() === '') {
|
|
503
|
+
delete params[key]
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const queryParams = {
|
|
509
|
+
pageSize,
|
|
510
|
+
currentPage,
|
|
511
|
+
...otherParams, // 默认参数
|
|
512
|
+
...fixedParam,
|
|
513
|
+
...params,
|
|
514
|
+
}
|
|
515
|
+
axios
|
|
516
|
+
.get(`${url}?${stringify(queryParams)}`)
|
|
517
|
+
.then((result: any) => {
|
|
518
|
+
setFetching(false)
|
|
519
|
+
result = result.data;
|
|
520
|
+
if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
|
|
521
|
+
message.error(result.msg);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
const res = result.data;
|
|
525
|
+
let source = [];
|
|
526
|
+
if (isMap) {
|
|
527
|
+
source = Object.keys(res).map((d, i) => {
|
|
528
|
+
return {
|
|
529
|
+
text: Object.values(res)[i],
|
|
530
|
+
value: d,
|
|
531
|
+
};
|
|
532
|
+
});
|
|
533
|
+
} else {
|
|
534
|
+
const keys = res.list ? 'list' : 'items';
|
|
535
|
+
source = res
|
|
536
|
+
? res[keys]
|
|
537
|
+
? res[keys].map((item: any) => {
|
|
538
|
+
let textShowText = item[mappingTextField]
|
|
539
|
+
if (mappingTextShowTextField) {
|
|
540
|
+
textShowText = []
|
|
541
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
542
|
+
mappingTextShowTextField.forEach((r: any) => {
|
|
543
|
+
textShowText.push(item[r])
|
|
544
|
+
})
|
|
545
|
+
} else {
|
|
546
|
+
textShowText = item[mappingTextShowTextField]
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return {
|
|
550
|
+
...item,
|
|
551
|
+
text: item[mappingTextField],
|
|
552
|
+
textShowText,
|
|
553
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
554
|
+
value: item[mappingValueField],
|
|
555
|
+
baseUnitCode: item?.packingUnitList?.find((item: any) => item.baseUnit === true)?.unitCode
|
|
556
|
+
};
|
|
557
|
+
})
|
|
558
|
+
: Array.isArray(res) &&
|
|
559
|
+
res?.map((item: Record<string, any>) => {
|
|
560
|
+
let textShowText = item[mappingTextField]
|
|
561
|
+
if (mappingTextShowTextField) {
|
|
562
|
+
textShowText = []
|
|
563
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
564
|
+
mappingTextShowTextField.forEach((r: any) => {
|
|
565
|
+
textShowText.push(item[r])
|
|
566
|
+
})
|
|
567
|
+
} else {
|
|
568
|
+
textShowText = item[mappingTextShowTextField]
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return {
|
|
572
|
+
...item,
|
|
573
|
+
text: item[mappingTextField],
|
|
574
|
+
textShowText,
|
|
575
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
576
|
+
value: item[mappingValueField],
|
|
577
|
+
baseUnitCode: item?.packingUnitList?.find((item: any) => item.baseUnit === true)?.unitCode
|
|
578
|
+
};
|
|
579
|
+
})
|
|
580
|
+
: [];
|
|
581
|
+
}
|
|
582
|
+
source = Array.isArray(source) ? source : []
|
|
583
|
+
if (type === 1) {
|
|
584
|
+
ctx?.form?.setFieldSource(resultSourceKey, source)
|
|
585
|
+
setItems(source)
|
|
586
|
+
setItemsTotal(Number(res?.total || res?.totalCount || source.length))
|
|
587
|
+
} else {
|
|
588
|
+
setTableData(source)
|
|
589
|
+
setTablePagination({ ...tablePagination, total: Number(res?.total || res?.totalCount || source.length), pageSize: Number(res?.size || res?.pageSize || (params?.pageSize || pageSize)), current: Number(res?.page || res?.currentPage || (params?.currentPage || currentPage)) })
|
|
590
|
+
}
|
|
591
|
+
})
|
|
592
|
+
.catch((err) => { setFetching(false) });
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const SelectScroll = e => {
|
|
596
|
+
e.persist();
|
|
597
|
+
const { target } = e;
|
|
598
|
+
const totalPage = Math.ceil(itemsTotal / pageSize)
|
|
599
|
+
// 判断是否滑动到底部
|
|
600
|
+
const isTouchGround = target.scrollTop + target.offsetHeight === target.scrollHeight // >=scrollHeight
|
|
601
|
+
// 判断数据是否还没有加载到了最后一页
|
|
602
|
+
const canPageAdd = scrollPage < totalPage
|
|
603
|
+
if (isTouchGround && canPageAdd) {
|
|
604
|
+
const nextScrollPage = scrollPage + 1;
|
|
605
|
+
setScrollPage(nextScrollPage);
|
|
606
|
+
getData({ currentPage: nextScrollPage }); // 调用api方法
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
//判断是否滑动到顶部
|
|
610
|
+
const isTouchTop = target.scrollTop === 0 // <=0
|
|
611
|
+
// 判断数据是否到第一页
|
|
612
|
+
const canPageJian = scrollPage > 1
|
|
613
|
+
if (isTouchTop && canPageJian) {
|
|
614
|
+
const preScrollPage = scrollPage - 1;
|
|
615
|
+
setScrollPage(preScrollPage);
|
|
616
|
+
getData({ currentPage: preScrollPage }); // 调用api方法
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
useEffect(() => {
|
|
621
|
+
const pList = modalTableProps?.promiseLoadList || []
|
|
622
|
+
if(!pList?.length) return;
|
|
623
|
+
const list = pList.map((i: any) => {
|
|
624
|
+
return loadSelectSource(i.url, i.params)
|
|
625
|
+
});
|
|
626
|
+
Promise.all(list).then((x: any)=>{
|
|
627
|
+
formatFormSourceList(x,pList,tableSearchForm)
|
|
628
|
+
})
|
|
629
|
+
}, [businessType])
|
|
630
|
+
|
|
631
|
+
useEffect(() => {
|
|
632
|
+
if (value) {
|
|
633
|
+
setPopValue(value);
|
|
634
|
+
}
|
|
635
|
+
}, [value]);
|
|
636
|
+
|
|
637
|
+
useEffect(() => {
|
|
638
|
+
makeUniqueValue();
|
|
639
|
+
}, [sourceName])
|
|
640
|
+
|
|
641
|
+
const showModal = () => {
|
|
642
|
+
// getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
643
|
+
setIsModalVisible(true);
|
|
644
|
+
// 回显
|
|
645
|
+
if (value) {
|
|
646
|
+
if (selectMode) {
|
|
647
|
+
setSelectedRowKeys(labelInValue ? value.map(i => i.key) : value)
|
|
648
|
+
setPopValue(labelInValue ? value.map(i => ({ value: i.key, text: i.label })) : value.map(i => ({ value: i })));
|
|
649
|
+
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
650
|
+
setCheckedAll(itemsTotal && value.length === itemsTotal);
|
|
651
|
+
// 需清空数据
|
|
652
|
+
if (!value.length) {
|
|
653
|
+
setDoubleArr([])
|
|
654
|
+
}
|
|
655
|
+
} else {
|
|
656
|
+
setSelectedRowKeys(labelInValue ? [value.key] : [value])
|
|
657
|
+
setPopValue(labelInValue ? [{ value: value.key, text: value.label }] : [{ value: value }]);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
setTimeout(() => {
|
|
662
|
+
document.getElementById("first-query")?.focus()
|
|
663
|
+
}, 50)
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
const handleShowModal = () => {
|
|
667
|
+
if(beforeShowModal) {
|
|
668
|
+
beforeShowModal(popvalue).then(res => {
|
|
669
|
+
showModal()
|
|
670
|
+
}).catch(Error => {
|
|
671
|
+
message.warning(Error)
|
|
672
|
+
})
|
|
673
|
+
} else {
|
|
674
|
+
showModal()
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
const handleSelectOver = (selectedValue: any) => {
|
|
679
|
+
if (selectedValue?.length) {
|
|
680
|
+
formaData(selectedValue);
|
|
681
|
+
// 解决选择最后1页的sku,返回后,不显示名称问题
|
|
682
|
+
const source = _.uniqBy(items.concat(selectedValue), 'value')
|
|
683
|
+
ctx?.form?.setFieldSource(resultSourceKey, source)
|
|
684
|
+
setItems(source)
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const handleLoading = (isContinue,flag) => {
|
|
689
|
+
isContinue ? setConfirmContinueLoading(flag) : setConfirmLoading(flag);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const handleOk = (isContinue) => {
|
|
693
|
+
if(!popvalue.length) {
|
|
694
|
+
message.warning('至少选中一条数据')
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
// handleSelectOver(popvalue)
|
|
698
|
+
if(onSaveCallback) {
|
|
699
|
+
handleLoading(isContinue,true)
|
|
700
|
+
onSaveCallback(popvalue).then(res => {
|
|
701
|
+
if(true) {
|
|
702
|
+
// 成功信息可以在调用处处理 即resolve({messageSuccessBackInfo: { needThrowSuccess: false } })、resolve({messageSuccessBackInfo: { needThrowSuccess: true, successMessage: '已保存' } })
|
|
703
|
+
let initSuccessMessage = '保存成功'
|
|
704
|
+
const rmsbi = res?.messageSuccessBackInfo || {};
|
|
705
|
+
if(rmsbi && Object.keys(rmsbi)?.length){
|
|
706
|
+
rmsbi?.needThrowSuccess ? message.success(rmsbi?.successMessage || initSuccessMessage) : null
|
|
707
|
+
} else {
|
|
708
|
+
message.success(initSuccessMessage)
|
|
709
|
+
}
|
|
710
|
+
deleteSelectRows();
|
|
711
|
+
document.getElementById('first-query')?.focus()
|
|
712
|
+
!isContinue && handleCancel();
|
|
713
|
+
} else {
|
|
714
|
+
}
|
|
715
|
+
handleLoading(isContinue,false)
|
|
716
|
+
}).catch(Error => {
|
|
717
|
+
if(typeof Error === 'object') {
|
|
718
|
+
!Error.needThrowError ? null : message.error(Error.message)
|
|
719
|
+
} else {
|
|
720
|
+
message.error(Error);
|
|
721
|
+
}
|
|
722
|
+
handleLoading(isContinue,false)
|
|
723
|
+
})
|
|
724
|
+
} else {
|
|
725
|
+
!isContinue && handleCancel();
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
const formaData = (value) => {
|
|
730
|
+
if (labelInValue) {
|
|
731
|
+
const formatResult = value.map((i: any) => ({ key: i[mappingValueField], label: i[mappingTextField], value: i[mappingValueField] }))
|
|
732
|
+
onChange(selectMode ? formatResult : formatResult[0])
|
|
733
|
+
} else {
|
|
734
|
+
const formatResult = selectMode ? value.map((i: any) => i.value) : _.get(value[0], 'value')
|
|
735
|
+
onChange(formatResult)
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
const handleCancel = () => {
|
|
740
|
+
form.resetFields();
|
|
741
|
+
setTableFormParams({});
|
|
742
|
+
setIsModalVisible(false);
|
|
743
|
+
setTableData([])
|
|
744
|
+
// if (selectMode) {
|
|
745
|
+
// run();
|
|
746
|
+
// }
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
const onSearchChange = (e) => {
|
|
750
|
+
setSearchValue(e.target.value);
|
|
751
|
+
run();
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const onSearchBlur = () => {
|
|
755
|
+
setSearchValue('')
|
|
756
|
+
run();
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
const onSearchTable = () => {
|
|
760
|
+
const params = form.getFieldsValue();
|
|
761
|
+
setTableFormParams(params);
|
|
762
|
+
getData({ ...params, pageSize: tableInitPageSize }, 2)
|
|
763
|
+
// if (selectMode) {
|
|
764
|
+
// getData(params)
|
|
765
|
+
// }
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
const onResetTable = () => {
|
|
769
|
+
form.resetFields();
|
|
770
|
+
setTableFormParams({});
|
|
771
|
+
getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const handleTableChange = (pagination) => {
|
|
775
|
+
getData({ ...tableFormParams, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// 扁平化二维数组的方法
|
|
779
|
+
const mapRows = params => {
|
|
780
|
+
var res = [];
|
|
781
|
+
for (var i = 0; i < params.length; i++) {
|
|
782
|
+
if (Array.isArray(params[i])) {
|
|
783
|
+
// 去重
|
|
784
|
+
res = _.uniqBy(res.concat(mapRows(params[i])), 'value');
|
|
785
|
+
} else {
|
|
786
|
+
res.push(params[i]);
|
|
787
|
+
// 去重
|
|
788
|
+
res = _.uniqBy(res, 'value')
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
return res.filter(Boolean); //去掉undefined的情况
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
const onChangeSelectedKeys = (selectKeys, selectRows) => {
|
|
795
|
+
if(selectKeys.length - selectedRowKeys.length > 0) {
|
|
796
|
+
if (selectKeys.length - selectedRowKeys.length === 1) {
|
|
797
|
+
selectRows[selectRows.length -1]['needFocus'] = true;
|
|
798
|
+
} else {
|
|
799
|
+
selectRows[selectedRowKeys.length]['needFocus'] = true;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
if(isAllowRepeatedSelect) {
|
|
803
|
+
const handleSelectRows = selectRows.map((i: any) => {
|
|
804
|
+
const newUuid = uuid();
|
|
805
|
+
return {...i, uuid: newUuid}
|
|
806
|
+
})
|
|
807
|
+
const list = popvalue.concat(handleSelectRows);
|
|
808
|
+
const recordList = handleSelectRows
|
|
809
|
+
setPopValue(setBusinessDefaultValue(list,recordList));
|
|
810
|
+
setSelectedRowKeys([])
|
|
811
|
+
} else {
|
|
812
|
+
setPopValue(selectRows);
|
|
813
|
+
setSelectedRowKeys(selectKeys)
|
|
814
|
+
}
|
|
815
|
+
// setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
|
|
816
|
+
// setCheckedAll(filterRows.length === tablePagination?.total);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// 生成唯一值
|
|
820
|
+
const makeUniqueValue = () => {
|
|
821
|
+
const generateUnitKey = (((1 + Math.random()) * 0x10000) | 0).toString(16);
|
|
822
|
+
setUniqueValue(generateUnitKey);
|
|
823
|
+
return generateUnitKey;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
const rowSelection = {
|
|
827
|
+
type: 'checkbox',
|
|
828
|
+
selectedRowKeys,
|
|
829
|
+
preserveSelectedRowKeys: true,
|
|
830
|
+
onChange: (sks, srs) => {
|
|
831
|
+
onChangeSelectedKeys(sks, srs)
|
|
832
|
+
},
|
|
833
|
+
getCheckboxProps: () => ({
|
|
834
|
+
disabled: selectProps?.disabled || props?.disabled,
|
|
835
|
+
}),
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
const onDoubleClickSelect = (e, record) => {
|
|
839
|
+
if (!selectMode) {
|
|
840
|
+
const srs = [JSON.parse(JSON.stringify(record))]
|
|
841
|
+
const sks = srs.map((i: any) => i.value)
|
|
842
|
+
onChangeSelectedKeys(sks, srs)
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
const themeColor = { color: '#005CFF' }
|
|
847
|
+
|
|
848
|
+
const formItem = (list) => {
|
|
849
|
+
if (isModalVisible && list?.length) {
|
|
850
|
+
return list.map((i: any, index) => {
|
|
851
|
+
if (i?.type === 'select' || i?.field?.type === 'select') {
|
|
852
|
+
return (
|
|
853
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
854
|
+
<Select style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props}>
|
|
855
|
+
{i?.initialSource?.length && i?.initialSource.map((m: any) => (
|
|
856
|
+
<Option value={m.value} key={m.value}>{m.text}</Option>
|
|
857
|
+
))}
|
|
858
|
+
</Select>
|
|
859
|
+
</Form.Item>
|
|
860
|
+
)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
if (i?.type === 'treeSelect' || i?.field?.type === 'treeSelect') {
|
|
864
|
+
return (
|
|
865
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
866
|
+
<TreeSelect style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props}></TreeSelect>
|
|
867
|
+
</Form.Item>
|
|
868
|
+
)
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
if (i?.type === 'BusinessSearchSelect' || i?.field?.type === 'BusinessSearchSelect') {
|
|
872
|
+
return (
|
|
873
|
+
<div>
|
|
874
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
875
|
+
<BusinessSearchSelect {...i.field.props} />
|
|
876
|
+
</Form.Item>
|
|
877
|
+
</div>
|
|
878
|
+
)
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
if (i?.type === 'multipleQueryInput' || i?.field?.type === 'multipleQueryInput') {
|
|
882
|
+
return (
|
|
883
|
+
<div>
|
|
884
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
885
|
+
<QueryMutipleInput onValueChange={(value) => {
|
|
886
|
+
form.setFieldsValue({
|
|
887
|
+
[i.name]: value
|
|
888
|
+
})
|
|
889
|
+
}} />
|
|
890
|
+
</Form.Item>
|
|
891
|
+
</div>
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
// 默认type是input
|
|
896
|
+
return (
|
|
897
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
898
|
+
<Input id={index === 0 ? "first-query" : 'index'} style={{ width: '100%' }} onKeyDown={(e) => {
|
|
899
|
+
if (e.keyCode === 13) {
|
|
900
|
+
onSearchTable()
|
|
901
|
+
}
|
|
902
|
+
}} placeholder='请输入' allowClear maxLength={100} {...i?.field?.props} />
|
|
903
|
+
</Form.Item>
|
|
904
|
+
)
|
|
905
|
+
})
|
|
906
|
+
} else {
|
|
907
|
+
return null
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
const maxTagPlaceholder = (selectedValues) => {
|
|
912
|
+
const onClose = (e: any, item: any) => {
|
|
913
|
+
e.preventDefault();
|
|
914
|
+
const newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter((i: any) => i.value !== item.value) : JSON.parse(JSON.stringify(value)).filter((i: any) => i !== item.value)
|
|
915
|
+
onChange(newValue);
|
|
916
|
+
}
|
|
917
|
+
return (
|
|
918
|
+
<Tooltip title={selectedValues.map((i: any) => (
|
|
919
|
+
<Tag
|
|
920
|
+
closable={true}
|
|
921
|
+
onClose={(e) => onClose(e, i)}
|
|
922
|
+
style={{ marginRight: 3, background: '#f5f5f5', height: '24px', border: '1px solid #f0f0f0' }}
|
|
923
|
+
>
|
|
924
|
+
{i.label}
|
|
925
|
+
</Tag>
|
|
926
|
+
))}>
|
|
927
|
+
{`+ ${selectedValues?.length}`}
|
|
928
|
+
</Tooltip>
|
|
929
|
+
)
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
const deleteSelectRows = () => {
|
|
933
|
+
setPopValue([])
|
|
934
|
+
setSelectedRowKeys([])
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
const deleteRecord = (record) => {
|
|
938
|
+
if(isAllowRepeatedSelect) {
|
|
939
|
+
setPopValue(popvalue.filter(item => item.uuid !== record.uuid))
|
|
940
|
+
setSelectedRowKeys([])
|
|
941
|
+
} else {
|
|
942
|
+
setPopValue(popvalue.filter(item => item[selectRowKey] !== record[selectRowKey]))
|
|
943
|
+
setSelectedRowKeys([...selectedRowKeys.filter(item => item !== record[selectRowKey])])
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
let inputIndex = 0;
|
|
948
|
+
let selectIndex = 0;
|
|
949
|
+
|
|
950
|
+
useEffect(() => {
|
|
951
|
+
setInitialShowColumn(codeSelected,selectColumns,(res) => {
|
|
952
|
+
setShowColumnsCallback(res)
|
|
953
|
+
})
|
|
954
|
+
},[selectColumns])
|
|
955
|
+
useEffect(() => {
|
|
956
|
+
setInitialShowColumn(codeToChoose,tableColumns,(res) => {
|
|
957
|
+
setShowToChooseColumnsCallback(res)
|
|
958
|
+
})
|
|
959
|
+
},[tableColumns])
|
|
960
|
+
|
|
961
|
+
const handleResize = (arr,index: any, callback) => (_: any, { size }: any) => {
|
|
962
|
+
let newColumns = arr.map((col: any) => ({ ...col }));
|
|
963
|
+
const handleIndex = (arr: any, indexArr: any) => {
|
|
964
|
+
let i = indexArr.shift();
|
|
965
|
+
if (indexArr.length > 0) {
|
|
966
|
+
handleIndex(arr[i].children, indexArr);
|
|
967
|
+
} else {
|
|
968
|
+
arr[i] = {
|
|
969
|
+
...arr[i],
|
|
970
|
+
width: size.width,
|
|
971
|
+
};
|
|
972
|
+
handleAntdColumnsSpecialParams(arr[i]);
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
handleIndex(newColumns, [...index]);
|
|
976
|
+
callback(newColumns)
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
const setShowColumnsCallback = (newColumns: Array<any>) => {
|
|
980
|
+
setShowColumns([...newColumns])
|
|
981
|
+
}
|
|
982
|
+
const setShowToChooseColumnsCallback = (newColumns: Array<any>) => {
|
|
983
|
+
setShowToChooseColumns([...newColumns])
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
const handleColumns = (arr: any, indexArr: any[], callback: any) => {
|
|
987
|
+
arr.forEach((item: any, index: any) => {
|
|
988
|
+
let indexArrInside = [...indexArr, index].filter((i: any) => i || i === 0)
|
|
989
|
+
if (noEmptyArray(item.children)) {
|
|
990
|
+
handleColumns(item.children, indexArrInside);
|
|
991
|
+
} else {
|
|
992
|
+
item.width = item.width || getItemDefaultWidth(item);
|
|
993
|
+
item.onHeaderCell = (column: any) => ({
|
|
994
|
+
...item,
|
|
995
|
+
width:
|
|
996
|
+
typeof column.width === 'number'
|
|
997
|
+
? column.width
|
|
998
|
+
: parseInt(column.width.replace('px', '')),
|
|
999
|
+
onResize: handleResize(arr,indexArrInside, callback),
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
})
|
|
1003
|
+
};
|
|
1004
|
+
let showToChooseCol = showToChooseColumns.map((item: any) => {
|
|
1005
|
+
handleAntdColumnsSpecialParams(item);
|
|
1006
|
+
return ({ ...item })
|
|
1007
|
+
})
|
|
1008
|
+
handleColumns(showToChooseCol, [],(res)=> setShowToChooseColumnsCallback(res));
|
|
1009
|
+
let showSelectedCol = showColumns.map((item: any) => {
|
|
1010
|
+
handleAntdColumnsSpecialParams(item);
|
|
1011
|
+
return ({ ...item })
|
|
1012
|
+
})
|
|
1013
|
+
handleColumns(showSelectedCol, [],(res)=> setShowColumnsCallback(res));
|
|
1014
|
+
|
|
1015
|
+
const selectLength = isAllowRepeatedSelect ? (popvalue?.length || 0) : (selectedRowKeys?.length || 0)
|
|
1016
|
+
return (
|
|
1017
|
+
<div className={'add_select'}>
|
|
1018
|
+
<div className="add_select_show" id={`add_select_div_${uniqueValue}`}>
|
|
1019
|
+
<Button onClick={handleShowModal} {...realButtonProps}>
|
|
1020
|
+
{buttonText}
|
|
1021
|
+
</Button>
|
|
1022
|
+
</div>
|
|
1023
|
+
{needModalTable && isModalVisible && (
|
|
1024
|
+
<Modal
|
|
1025
|
+
width='1200px'
|
|
1026
|
+
style={{ top: 20 }}
|
|
1027
|
+
bodyStyle={{ padding: '0px' }}
|
|
1028
|
+
// title={modalTableProps?.modalTableTitle}
|
|
1029
|
+
visible={isModalVisible}
|
|
1030
|
+
closable={false}
|
|
1031
|
+
onCancel={handleCancel}
|
|
1032
|
+
footer={selectMode ? [
|
|
1033
|
+
<Button key="back" onClick={handleCancel}>
|
|
1034
|
+
取消
|
|
1035
|
+
</Button>,
|
|
1036
|
+
<Button
|
|
1037
|
+
key="save-and-continue"
|
|
1038
|
+
style={{color: '#005CFF', borderColor: '#005CFF'}}
|
|
1039
|
+
onClick={() => {handleOk(true)}}
|
|
1040
|
+
loading={confirmContinueLoading}
|
|
1041
|
+
disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
|
|
1042
|
+
>
|
|
1043
|
+
保存并继续
|
|
1044
|
+
</Button>,
|
|
1045
|
+
<Button
|
|
1046
|
+
key="submit"
|
|
1047
|
+
type="primary"
|
|
1048
|
+
onClick={() => {handleOk(false)}}
|
|
1049
|
+
loading={confirmLoading}
|
|
1050
|
+
disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
|
|
1051
|
+
>
|
|
1052
|
+
确定
|
|
1053
|
+
</Button>,
|
|
1054
|
+
] : null}
|
|
1055
|
+
>
|
|
1056
|
+
<div>
|
|
1057
|
+
<div className='add_select_header'>
|
|
1058
|
+
{modalTableProps?.modalTableTitle}
|
|
1059
|
+
<span><span>*</span> 快捷键:【Tab】-跳格切换;【Shift+←、→】-当前行左、右移动;【 ↑、↓】-当前列上、下移动;【ctrl+Enter】-保存并继续;【ctrl+Delete】-删除当前行;</span>
|
|
1060
|
+
<span className='add_select_header_close'><CloseCircleOutlined style={{fontSize: '20px'}} onClick={handleCancel} /></span>
|
|
1061
|
+
</div>
|
|
1062
|
+
<div className={'add_select_wrapper'}>
|
|
1063
|
+
<div className={caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'}>
|
|
1064
|
+
<div className={'select_list_columns'}>
|
|
1065
|
+
<div className={'select_list_columns_formItems'}>
|
|
1066
|
+
<Form form={form} layout='vertical' key='modalForm'>
|
|
1067
|
+
{formItem(tableSearchForm)}
|
|
1068
|
+
</Form>
|
|
1069
|
+
</div>
|
|
1070
|
+
</div>
|
|
1071
|
+
<div className={'select_list_searchButton'}>
|
|
1072
|
+
<Button key='reset' className={'select_list_button_space'} onClick={onResetTable}>重置</Button>
|
|
1073
|
+
<Button key='search' type="primary" onClick={onSearchTable}>查询</Button>
|
|
1074
|
+
</div>
|
|
1075
|
+
</div>
|
|
1076
|
+
<div className={caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'}>
|
|
1077
|
+
<div>
|
|
1078
|
+
<div className={'select_list_selectTips'}>
|
|
1079
|
+
<div style={{ marginLeft: 8 }}>搜索结果共 <span style={themeColor}>{tablePagination?.total || 0}</span> 项{selectMode ? <span>, 本次已选 <span style={themeColor}>{selectLength}</span> 项</span> : ''}</div>
|
|
1080
|
+
<div>
|
|
1081
|
+
<span style={{ marginRight: 8 }}>
|
|
1082
|
+
<TableColumnSetting
|
|
1083
|
+
setShowColumns={setShowToChooseColumnsCallback}
|
|
1084
|
+
showColumns={showToChooseColumns}
|
|
1085
|
+
datasource={tableColumns || []}
|
|
1086
|
+
tableCode={codeToChoose}
|
|
1087
|
+
settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
|
|
1088
|
+
/>
|
|
1089
|
+
</span>
|
|
1090
|
+
</div>
|
|
1091
|
+
</div>
|
|
1092
|
+
<Table
|
|
1093
|
+
size='small'
|
|
1094
|
+
rowSelection={rowSelection}
|
|
1095
|
+
columns={showToChooseCol}
|
|
1096
|
+
dataSource={tableData}
|
|
1097
|
+
pagination={tablePagination}
|
|
1098
|
+
loading={fetching}
|
|
1099
|
+
onChange={handleTableChange}
|
|
1100
|
+
rowKey={mappingValueField}
|
|
1101
|
+
rowClassName={'row-class'}
|
|
1102
|
+
scroll={{ y: 500 }}
|
|
1103
|
+
components={{
|
|
1104
|
+
header: {
|
|
1105
|
+
cell: ResizeableTitle,
|
|
1106
|
+
},
|
|
1107
|
+
}}
|
|
1108
|
+
/>
|
|
1109
|
+
</div>
|
|
1110
|
+
</div>
|
|
1111
|
+
{/* <div>
|
|
1112
|
+
<Table
|
|
1113
|
+
size='small'
|
|
1114
|
+
columns={modalTableProps?.tableColumns}
|
|
1115
|
+
dataSource={mapRows(doubleArr)}
|
|
1116
|
+
rowKey={mappingValueField}
|
|
1117
|
+
scroll={{ x: modalTableProps.overScrollX || 'max-content', y: modalTableProps.overScrollY || null }}
|
|
1118
|
+
onRow={record => {
|
|
1119
|
+
return {
|
|
1120
|
+
onDoubleClick: event => onDoubleClickSelect(event, record),
|
|
1121
|
+
};
|
|
1122
|
+
}}
|
|
1123
|
+
/>
|
|
1124
|
+
</div> */}
|
|
1125
|
+
</div>
|
|
1126
|
+
<div className={'add_select_wrapper_select'}>
|
|
1127
|
+
<div className={'select_list_selectTips'}>
|
|
1128
|
+
<div style={{ marginLeft: 8 }}><span>本次已选 <span style={themeColor}>{selectLength}</span> 项</span></div>
|
|
1129
|
+
<div style={{ display: 'flex' }}>
|
|
1130
|
+
<span style={{ marginRight: 8 }}>
|
|
1131
|
+
<TableColumnSetting
|
|
1132
|
+
setShowColumns={setShowColumnsCallback}
|
|
1133
|
+
showColumns={showColumns}
|
|
1134
|
+
datasource={selectColumns || []}
|
|
1135
|
+
tableCode={codeSelected}
|
|
1136
|
+
settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
|
|
1137
|
+
/>
|
|
1138
|
+
</span>
|
|
1139
|
+
<div style={{ marginRight: 8 }}><span onClick={deleteSelectRows} style={{ ...themeColor, cursor: 'pointer' }}>清空所选商品</span></div>
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
<Table
|
|
1143
|
+
size='small'
|
|
1144
|
+
columns={showSelectedCol}
|
|
1145
|
+
dataSource={popvalue}
|
|
1146
|
+
pagination={false}
|
|
1147
|
+
// onChange={handleTableChange}
|
|
1148
|
+
rowKey={selectRowKey}
|
|
1149
|
+
rowClassName={'row-class'}
|
|
1150
|
+
scroll={{ y: 500 }}
|
|
1151
|
+
onRow={record => {
|
|
1152
|
+
return {
|
|
1153
|
+
onDoubleClick: event => onDoubleClickSelect(event, record),
|
|
1154
|
+
};
|
|
1155
|
+
}}
|
|
1156
|
+
components={{
|
|
1157
|
+
header: {
|
|
1158
|
+
cell: ResizeableTitle,
|
|
1159
|
+
},
|
|
1160
|
+
}}
|
|
1161
|
+
/>
|
|
1162
|
+
</div>
|
|
1163
|
+
</div>
|
|
1164
|
+
</Modal>
|
|
1165
|
+
)}
|
|
1166
|
+
</div>
|
|
1167
|
+
);
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
export default AddSelect;
|