@bit-sun/business-component 2.4.22 → 2.4.24
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/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/ChooseStore/services.d.ts +1 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/i18n.d.ts +9 -0
- package/dist/components/Business/BsLayouts/service.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -0
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -1
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +2 -1
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +2 -0
- package/dist/components/Solution/RuleComponent/services.d.ts +1 -1
- package/dist/index.esm.js +1777 -1251
- package/dist/index.js +1760 -1232
- package/dist/utils/TableUtils.d.ts +93 -2
- package/dist/utils/businessUtils.d.ts +27 -0
- package/dist/utils/constant.d.ts +37 -0
- package/dist/utils/index.d.ts +6 -4
- package/dist/utils/request.d.ts +2 -0
- package/dist/utils/utils.d.ts +13 -0
- package/package.json +7 -4
- 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/arrow_top.svg +18 -0
- 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/close.svg +26 -26
- package/src/assets/drag.svg +17 -17
- package/src/assets/fixed-left.svg +15 -15
- 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.tsx +40 -21
- 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/ChooseStore/index.less +0 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
- 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/customMenuHeader.tsx +74 -74
- 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.tsx +163 -157
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
- package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +19 -2
- 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 +1494 -1484
- package/src/components/Business/BsLayouts/service.ts +2 -2
- package/src/components/Business/BsLayouts/utils.tsx +203 -203
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +9 -9
- package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
- package/src/components/Business/BsSulaQueryTable/index.less +221 -221
- package/src/components/Business/BsSulaQueryTable/index.tsx +346 -175
- package/src/components/Business/BsSulaQueryTable/setting.tsx +125 -87
- package/src/components/Business/BsSulaQueryTable/utils.tsx +57 -34
- package/src/components/Business/CommodityEntry/index.md +70 -70
- package/src/components/Business/CommodityEntry/index.tsx +80 -80
- package/src/components/Business/CommonGuideWrapper/index.less +121 -112
- package/src/components/Business/CommonGuideWrapper/index.md +39 -39
- package/src/components/Business/CommonGuideWrapper/index.tsx +94 -84
- package/src/components/Business/DetailPageWrapper/index.less +9 -1
- package/src/components/Business/DetailPageWrapper/index.tsx +121 -110
- package/src/components/Business/HomePageWrapper/index.md +45 -45
- package/src/components/Business/HomePageWrapper/index.tsx +162 -162
- 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/index.less +16 -16
- package/src/components/Business/JsonQueryTable/index.md +328 -328
- package/src/components/Business/JsonQueryTable/index.tsx +535 -537
- 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/SearchSelect/utils.ts +3 -3
- package/src/components/Business/StateFlow/index.md +60 -60
- package/src/components/Business/StateFlow/index.tsx +29 -29
- package/src/components/Business/columnSettingTable/columnSetting.tsx +10 -8
- package/src/components/Business/columnSettingTable/index.less +247 -247
- package/src/components/Business/columnSettingTable/index.md +357 -357
- 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.tsx +387 -387
- package/src/components/Business/moreTreeTable/utils.ts +126 -126
- package/src/components/Functional/AddSelect/helps.ts +4 -3
- package/src/components/Functional/AddSelect/index.less +367 -367
- package/src/components/Functional/AddSelect/index.tsx +79 -33
- package/src/components/Functional/BillEntry/index.less +371 -371
- package/src/components/Functional/BillEntry/index.tsx +3 -3
- package/src/components/Functional/BsAntdSula/index.ts +2 -2
- package/src/components/Functional/DataImport/index.less +63 -63
- package/src/components/Functional/DataImport/index.tsx +3 -3
- package/src/components/Functional/DataValidation/index.less +63 -63
- package/src/components/Functional/DataValidation/index.tsx +3 -3
- package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
- package/src/components/Functional/EllipsisTooltip/index.js +36 -36
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +10 -5
- package/src/components/Functional/QueryMutipleInput/index.less +37 -37
- package/src/components/Functional/QueryMutipleInput/index.tsx +2 -1
- package/src/components/Functional/SearchSelect/index.less +6 -0
- package/src/components/Functional/SearchSelect/index.tsx +152 -45
- package/src/components/Functional/SearchSelect/utils.ts +3 -3
- package/src/components/Functional/TreeSearchSelect/index.tsx +24 -22
- package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +637 -0
- package/src/components/Solution/RuleComponent/index.d.ts +29 -29
- package/src/components/Solution/RuleComponent/index.js +7 -652
- package/src/components/Solution/RuleComponent/index.less +230 -230
- package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
- package/src/components/Solution/RuleComponent/services.ts +13 -13
- package/src/plugin/TableColumnSetting/index.less +247 -247
- package/src/plugin/TableColumnSetting/index.md +50 -50
- package/src/plugin/TableColumnSetting/index.tsx +2 -2
- package/src/plugin/TableColumnSetting/utils.ts +19 -19
- 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.less +52 -0
- package/src/utils/TableUtils.tsx +691 -18
- package/src/utils/businessUtils.ts +441 -0
- package/src/utils/checkUtils.ts +39 -39
- package/src/utils/constant.ts +39 -0
- package/src/utils/enumConfig.ts +11 -11
- package/src/utils/getFormMode.js +12 -12
- package/src/utils/index.ts +6 -4
- package/src/utils/request.ts +53 -0
- package/src/utils/requestUtils.ts +29 -2
- package/src/utils/serialize.js +7 -7
- package/src/utils/utils.ts +64 -21
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SortableElement,
|
|
16
16
|
SortableHandle,
|
|
17
17
|
} from 'react-sortable-hoc';
|
|
18
|
-
import
|
|
18
|
+
import request from '@/utils/request';
|
|
19
19
|
import { SearchOutlined } from '@ant-design/icons';
|
|
20
20
|
import { arrayMoveImmutable } from 'array-move';
|
|
21
21
|
import shezhi from '../../../assets/icon-shezhi.svg';
|
|
@@ -28,6 +28,7 @@ import fixedRightActive from '../../../assets/fixed-right-active.svg';
|
|
|
28
28
|
import './index.less';
|
|
29
29
|
import ENUM from '@/utils/enumConfig';
|
|
30
30
|
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
31
|
+
import {renderToString } from './utils';
|
|
31
32
|
|
|
32
33
|
const DragHandle = SortableHandle(() => <img width={25} src={drag} />);
|
|
33
34
|
|
|
@@ -60,7 +61,7 @@ class SortableTable extends React.Component {
|
|
|
60
61
|
}))
|
|
61
62
|
: '';
|
|
62
63
|
return new Promise((resolve: any, reject: any) => {
|
|
63
|
-
|
|
64
|
+
request({
|
|
64
65
|
url: handleRequestUrl('/user','/appConfig/saveUserOrder', appRequestConfig),
|
|
65
66
|
method: 'POST',
|
|
66
67
|
data: {
|
|
@@ -75,8 +76,8 @@ class SortableTable extends React.Component {
|
|
|
75
76
|
message.error('保存表头列自定义失败,请稍后尝试');
|
|
76
77
|
reject('');
|
|
77
78
|
}
|
|
78
|
-
})
|
|
79
|
-
})
|
|
79
|
+
});
|
|
80
|
+
});
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
getConfigFromlocalstorage = () => {
|
|
@@ -93,57 +94,68 @@ class SortableTable extends React.Component {
|
|
|
93
94
|
};
|
|
94
95
|
|
|
95
96
|
patchConfigToLocalstorage = (configvalue) => {
|
|
96
|
-
const { setShowColumns, datasource = []
|
|
97
|
+
const { setShowColumns, datasource = [] } = this.props;
|
|
97
98
|
const { sortDataSource, bsTableCode } = this.state;
|
|
98
|
-
let config =
|
|
99
|
-
|
|
100
|
-
let
|
|
99
|
+
let config =
|
|
100
|
+
localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
|
|
101
|
+
let configArray = JSON.parse(config);
|
|
102
|
+
let currentSetting = configArray.filter(
|
|
103
|
+
(item) => item.code === bsTableCode,
|
|
104
|
+
);
|
|
101
105
|
if (currentSetting.length) {
|
|
102
|
-
currentSetting[0].detail = JSON.stringify(configvalue)
|
|
106
|
+
currentSetting[0].detail = JSON.stringify(configvalue);
|
|
103
107
|
} else {
|
|
104
108
|
configArray.push({
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
})
|
|
109
|
+
code: bsTableCode,
|
|
110
|
+
detail: JSON.stringify(configvalue),
|
|
111
|
+
});
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
localStorage.setItem(
|
|
114
|
+
localStorage.setItem(
|
|
115
|
+
ENUM.BROWSER_CACHE.COLUMN_CONDITION,
|
|
116
|
+
JSON.stringify(configArray),
|
|
117
|
+
);
|
|
111
118
|
this.setState({
|
|
112
119
|
visible: false,
|
|
113
120
|
});
|
|
114
|
-
if(configvalue){
|
|
121
|
+
if (configvalue) {
|
|
115
122
|
setShowColumns([...sortDataSource]);
|
|
116
|
-
}else{
|
|
123
|
+
} else {
|
|
117
124
|
this.setState({
|
|
118
125
|
isDefaultValue: true,
|
|
119
|
-
dataSource: [
|
|
120
|
-
...item
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
dataSource: [
|
|
127
|
+
...datasource.map((item) => ({
|
|
128
|
+
...item,
|
|
129
|
+
hidden: false,
|
|
130
|
+
})),
|
|
131
|
+
],
|
|
132
|
+
sortDataSource: [
|
|
133
|
+
...datasource.map((item) => ({
|
|
134
|
+
...item,
|
|
135
|
+
hidden: false,
|
|
136
|
+
})),
|
|
137
|
+
],
|
|
127
138
|
});
|
|
128
139
|
setShowColumns([...datasource]);
|
|
129
140
|
}
|
|
130
141
|
};
|
|
131
142
|
|
|
132
143
|
setInitValue = (isClick = false) => {
|
|
133
|
-
const { datasource, showColumn }: any =
|
|
134
|
-
this.props;
|
|
144
|
+
const { datasource, showColumn }: any = this.props;
|
|
135
145
|
let config = this.getConfigFromlocalstorage();
|
|
136
146
|
|
|
137
147
|
this.setState({
|
|
138
148
|
isDefaultValue: true,
|
|
139
149
|
dataSource: datasource.map((item) => {
|
|
140
|
-
let innerItem = config.filter(
|
|
141
|
-
(inneritem
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
let innerItem = config.filter((inneritem) => {
|
|
151
|
+
let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex)
|
|
152
|
+
? JSON.stringify(inneritem.key || inneritem.dataIndex)
|
|
153
|
+
: inneritem.key || inneritem.dataIndex;
|
|
154
|
+
let itemKey = Array.isArray(item.key || item.dataIndex)
|
|
155
|
+
? JSON.stringify(item.key || item.dataIndex)
|
|
156
|
+
: item.key || item.dataIndex;
|
|
157
|
+
return innerKey && innerKey === itemKey;
|
|
158
|
+
});
|
|
147
159
|
return {
|
|
148
160
|
...item,
|
|
149
161
|
key: item.key || item.dataIndex,
|
|
@@ -152,13 +164,15 @@ class SortableTable extends React.Component {
|
|
|
152
164
|
};
|
|
153
165
|
}),
|
|
154
166
|
defaultValue: datasource.map((item) => {
|
|
155
|
-
let innerItem = config.filter(
|
|
156
|
-
(inneritem
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
let innerItem = config.filter((inneritem) => {
|
|
168
|
+
let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex)
|
|
169
|
+
? JSON.stringify(inneritem.key || inneritem.dataIndex)
|
|
170
|
+
: inneritem.key || inneritem.dataIndex;
|
|
171
|
+
let itemKey = Array.isArray(item.key || item.dataIndex)
|
|
172
|
+
? JSON.stringify(item.key || item.dataIndex)
|
|
173
|
+
: item.key || item.dataIndex;
|
|
174
|
+
return innerKey && innerKey === itemKey;
|
|
175
|
+
});
|
|
162
176
|
return {
|
|
163
177
|
...item,
|
|
164
178
|
key: item.key || item.dataIndex,
|
|
@@ -166,24 +180,25 @@ class SortableTable extends React.Component {
|
|
|
166
180
|
hidden: config.length ? !innerItem.length : item.hidden,
|
|
167
181
|
};
|
|
168
182
|
}),
|
|
169
|
-
sortDataSource: [...showColumn]
|
|
183
|
+
sortDataSource: [...showColumn],
|
|
170
184
|
});
|
|
171
185
|
};
|
|
172
186
|
|
|
173
187
|
componentDidMount() {
|
|
174
|
-
const { datasource, showColumn, bsTableCode }: any =
|
|
175
|
-
this.props;
|
|
188
|
+
const { datasource, showColumn, bsTableCode }: any = this.props;
|
|
176
189
|
let config = this.getConfigFromlocalstorage();
|
|
177
190
|
|
|
178
191
|
this.setState({
|
|
179
192
|
dataSource: datasource.map((item) => {
|
|
180
|
-
let innerItem = config.filter(
|
|
181
|
-
(inneritem
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
let innerItem = config.filter((inneritem) => {
|
|
194
|
+
let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex)
|
|
195
|
+
? JSON.stringify(inneritem.key || inneritem.dataIndex)
|
|
196
|
+
: inneritem.key || inneritem.dataIndex;
|
|
197
|
+
let itemKey = Array.isArray(item.key || item.dataIndex)
|
|
198
|
+
? JSON.stringify(item.key || item.dataIndex)
|
|
199
|
+
: item.key || item.dataIndex;
|
|
200
|
+
return innerKey && innerKey === itemKey;
|
|
201
|
+
});
|
|
187
202
|
return {
|
|
188
203
|
...item,
|
|
189
204
|
key: item.key || item.dataIndex,
|
|
@@ -192,13 +207,15 @@ class SortableTable extends React.Component {
|
|
|
192
207
|
};
|
|
193
208
|
}),
|
|
194
209
|
defaultValue: datasource.map((item) => {
|
|
195
|
-
let innerItem = config.filter(
|
|
196
|
-
(inneritem
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
let innerItem = config.filter((inneritem) => {
|
|
211
|
+
let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex)
|
|
212
|
+
? JSON.stringify(inneritem.key || inneritem.dataIndex)
|
|
213
|
+
: inneritem.key || inneritem.dataIndex;
|
|
214
|
+
let itemKey = Array.isArray(item.key || item.dataIndex)
|
|
215
|
+
? JSON.stringify(item.key || item.dataIndex)
|
|
216
|
+
: item.key || item.dataIndex;
|
|
217
|
+
return innerKey && innerKey === itemKey;
|
|
218
|
+
});
|
|
202
219
|
return {
|
|
203
220
|
...item,
|
|
204
221
|
key: item.key || item.dataIndex,
|
|
@@ -212,15 +229,17 @@ class SortableTable extends React.Component {
|
|
|
212
229
|
...item,
|
|
213
230
|
key: item.key || item.dataIndex,
|
|
214
231
|
width:
|
|
215
|
-
showColumn.filter(
|
|
216
|
-
(inneritem
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
232
|
+
showColumn.filter((inneritem) => {
|
|
233
|
+
let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex)
|
|
234
|
+
? JSON.stringify(inneritem.key || inneritem.dataIndex)
|
|
235
|
+
: inneritem.key || inneritem.dataIndex;
|
|
236
|
+
let itemKey = Array.isArray(item.key || item.dataIndex)
|
|
237
|
+
? JSON.stringify(item.key || item.dataIndex)
|
|
238
|
+
: item.key || item.dataIndex;
|
|
239
|
+
return innerKey && innerKey === itemKey;
|
|
240
|
+
})[0]?.width || item.width,
|
|
222
241
|
})),
|
|
223
|
-
bsTableCode
|
|
242
|
+
bsTableCode,
|
|
224
243
|
});
|
|
225
244
|
}
|
|
226
245
|
|
|
@@ -299,7 +318,11 @@ class SortableTable extends React.Component {
|
|
|
299
318
|
});
|
|
300
319
|
}
|
|
301
320
|
}}
|
|
302
|
-
style={{
|
|
321
|
+
style={{
|
|
322
|
+
display: 'inline-block',
|
|
323
|
+
width: '24px',
|
|
324
|
+
textAlign: 'center',
|
|
325
|
+
}}
|
|
303
326
|
>
|
|
304
327
|
<Tooltip
|
|
305
328
|
placement="top"
|
|
@@ -382,7 +405,11 @@ class SortableTable extends React.Component {
|
|
|
382
405
|
});
|
|
383
406
|
}
|
|
384
407
|
}}
|
|
385
|
-
style={{
|
|
408
|
+
style={{
|
|
409
|
+
display: 'inline-block',
|
|
410
|
+
width: '24px',
|
|
411
|
+
textAlign: 'center',
|
|
412
|
+
}}
|
|
386
413
|
>
|
|
387
414
|
<Tooltip
|
|
388
415
|
placement="top"
|
|
@@ -454,11 +481,10 @@ class SortableTable extends React.Component {
|
|
|
454
481
|
// this.patchUserColumnConfig('');
|
|
455
482
|
// return;
|
|
456
483
|
// }
|
|
457
|
-
|
|
484
|
+
this.patchUserColumnConfig(sortDataSource);
|
|
458
485
|
};
|
|
459
486
|
|
|
460
487
|
handleCancel = (e: React.MouseEvent<HTMLElement>) => {
|
|
461
|
-
console.log(e);
|
|
462
488
|
this.setState({
|
|
463
489
|
visible: false,
|
|
464
490
|
});
|
|
@@ -538,23 +564,25 @@ class SortableTable extends React.Component {
|
|
|
538
564
|
return <SortableItem index={index} {...restProps} />;
|
|
539
565
|
};
|
|
540
566
|
|
|
567
|
+
|
|
568
|
+
|
|
541
569
|
onChange = (e: CheckboxChangeEvent, title) => {
|
|
542
570
|
const { sortDataSource, dataSource } = this.state;
|
|
571
|
+
|
|
543
572
|
if (!e.target.checked) {
|
|
544
573
|
this.setState({
|
|
545
574
|
sortDataSource: sortDataSource.filter((item) => {
|
|
546
|
-
return item.title !== title;
|
|
575
|
+
return renderToString(item.title) !== renderToString(title);
|
|
547
576
|
}),
|
|
548
577
|
isDefaultValue: false,
|
|
549
578
|
dataSource: [
|
|
550
579
|
...dataSource.map((item) => {
|
|
551
|
-
if (item.title === title) {
|
|
580
|
+
if (renderToString(item.title) === renderToString(title)) {
|
|
552
581
|
return {
|
|
553
582
|
...item,
|
|
554
583
|
hidden: true,
|
|
555
584
|
};
|
|
556
585
|
}
|
|
557
|
-
|
|
558
586
|
return item;
|
|
559
587
|
}),
|
|
560
588
|
],
|
|
@@ -566,7 +594,7 @@ class SortableTable extends React.Component {
|
|
|
566
594
|
let newSortData = [
|
|
567
595
|
...sortDataSource,
|
|
568
596
|
...dataSource
|
|
569
|
-
.filter((item) => item.title === title)
|
|
597
|
+
.filter((item) => renderToString(item.title) === renderToString(title))
|
|
570
598
|
.map((source) => {
|
|
571
599
|
return {
|
|
572
600
|
...source,
|
|
@@ -588,7 +616,7 @@ class SortableTable extends React.Component {
|
|
|
588
616
|
isDefaultValue: false,
|
|
589
617
|
dataSource: [
|
|
590
618
|
...dataSource.map((item) => {
|
|
591
|
-
if (item.title === title) {
|
|
619
|
+
if (renderToString(item.title) === renderToString(title)) {
|
|
592
620
|
return {
|
|
593
621
|
...item,
|
|
594
622
|
hidden: false,
|
|
@@ -606,9 +634,9 @@ class SortableTable extends React.Component {
|
|
|
606
634
|
this.setInitValue(true);
|
|
607
635
|
};
|
|
608
636
|
|
|
609
|
-
handleResetSetting = () =>{
|
|
637
|
+
handleResetSetting = () => {
|
|
610
638
|
this.patchUserColumnConfig('');
|
|
611
|
-
}
|
|
639
|
+
};
|
|
612
640
|
|
|
613
641
|
onSearch = (e: any) => {
|
|
614
642
|
this.setState({
|
|
@@ -622,6 +650,7 @@ class SortableTable extends React.Component {
|
|
|
622
650
|
});
|
|
623
651
|
};
|
|
624
652
|
|
|
653
|
+
|
|
625
654
|
render() {
|
|
626
655
|
const { onlyModal } = this.props;
|
|
627
656
|
const {
|
|
@@ -633,7 +662,8 @@ class SortableTable extends React.Component {
|
|
|
633
662
|
} = this.state;
|
|
634
663
|
|
|
635
664
|
let seatchDataSource = dataSource.filter(
|
|
636
|
-
(item) =>
|
|
665
|
+
(item) =>
|
|
666
|
+
renderToString(item?.title)?.indexOf?.(searchDataSource || '') > -1,
|
|
637
667
|
);
|
|
638
668
|
|
|
639
669
|
return (
|
|
@@ -648,21 +678,29 @@ class SortableTable extends React.Component {
|
|
|
648
678
|
onCancel={this.handleCancel}
|
|
649
679
|
footer={[
|
|
650
680
|
<div>
|
|
651
|
-
<Button
|
|
681
|
+
<Button
|
|
682
|
+
key="back"
|
|
683
|
+
onClick={this.handleReset}
|
|
684
|
+
style={{ marginRight: 0 }}
|
|
685
|
+
>
|
|
652
686
|
恢复默认
|
|
653
|
-
</Button
|
|
687
|
+
</Button>
|
|
654
688
|
<Button key="back" onClick={this.handleResetSetting}>
|
|
655
689
|
重置设置
|
|
656
690
|
</Button>
|
|
657
691
|
</div>,
|
|
658
692
|
<div>
|
|
659
|
-
<Button
|
|
693
|
+
<Button
|
|
694
|
+
key="submit"
|
|
695
|
+
onClick={this.handleCancel}
|
|
696
|
+
style={{ marginRight: 0 }}
|
|
697
|
+
>
|
|
660
698
|
取消
|
|
661
|
-
</Button
|
|
699
|
+
</Button>
|
|
662
700
|
<Button key="submit" type="primary" onClick={this.handleOk}>
|
|
663
701
|
确认
|
|
664
702
|
</Button>
|
|
665
|
-
</div
|
|
703
|
+
</div>,
|
|
666
704
|
]}
|
|
667
705
|
>
|
|
668
706
|
<div className={'sort_table'}>
|
|
@@ -745,9 +783,9 @@ class SortableTable extends React.Component {
|
|
|
745
783
|
: dataSource
|
|
746
784
|
.filter(
|
|
747
785
|
(item) =>
|
|
748
|
-
item
|
|
749
|
-
|
|
750
|
-
|
|
786
|
+
{const title = renderToString(item.title)
|
|
787
|
+
return (title?.indexOf?.('人') === -1 &&
|
|
788
|
+
title?.indexOf?.('日期') === -1)})
|
|
751
789
|
.map((item) => {
|
|
752
790
|
return (
|
|
753
791
|
<Checkbox
|
|
@@ -779,8 +817,8 @@ class SortableTable extends React.Component {
|
|
|
779
817
|
{[...dataSource]
|
|
780
818
|
.filter(
|
|
781
819
|
(item) =>
|
|
782
|
-
item?.title?.indexOf('人') > -1 ||
|
|
783
|
-
item?.title?.indexOf('日期') > -1,
|
|
820
|
+
item?.title?.indexOf?.('人') > -1 ||
|
|
821
|
+
item?.title?.indexOf?.('日期') > -1,
|
|
784
822
|
)
|
|
785
823
|
.map((item) => {
|
|
786
824
|
return (
|
|
@@ -822,7 +860,7 @@ class SortableTable extends React.Component {
|
|
|
822
860
|
dataSource={
|
|
823
861
|
onSearchSort
|
|
824
862
|
? sortDataSource.filter(
|
|
825
|
-
(item) => item?.title?.indexOf(onSearchSort) > -1,
|
|
863
|
+
(item) => renderToString(item?.title)?.indexOf(onSearchSort) > -1,
|
|
826
864
|
)
|
|
827
865
|
: sortDataSource
|
|
828
866
|
}
|
|
@@ -27,8 +27,9 @@ import {
|
|
|
27
27
|
import './utils.less';
|
|
28
28
|
import { request } from 'bssula';
|
|
29
29
|
import ENUM from '@/utils/enumConfig';
|
|
30
|
+
// import ReactDOMServer from 'react-dom/server';
|
|
30
31
|
import noImg from '../../../assets/list-no-img.svg';
|
|
31
|
-
|
|
32
|
+
import qs from 'qs';
|
|
32
33
|
export const handleStatusBadge = (text: any, color: any) => {
|
|
33
34
|
return (
|
|
34
35
|
<Badge
|
|
@@ -315,9 +316,7 @@ export const userInfoCard = (props: any) => {
|
|
|
315
316
|
{props.department || 'XXXXX'}
|
|
316
317
|
</span>
|
|
317
318
|
</p>
|
|
318
|
-
<p className={'card_detailInfo'}>
|
|
319
|
-
职位: {props.position || 'XXXXX'}
|
|
320
|
-
</p>
|
|
319
|
+
<p className={'card_detailInfo'}>职位: {props.position || 'XXXXX'}</p>
|
|
321
320
|
</div>
|
|
322
321
|
</Card>
|
|
323
322
|
);
|
|
@@ -572,35 +571,36 @@ export const renderFixed2 = (text: any) => text;
|
|
|
572
571
|
//设置queryTable默认列宽
|
|
573
572
|
export const getItemDefaultWidth = (item: any) => {
|
|
574
573
|
let defaultWidth = 200;
|
|
574
|
+
if (Array.isArray(item.key) || Array.isArray(item.dataIndex))
|
|
575
|
+
return defaultWidth;
|
|
575
576
|
let lowerCaseKey = (item.key || item.dataIndex)?.toLowerCase();
|
|
576
|
-
if (lowerCaseKey)
|
|
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
|
-
}
|
|
577
|
+
if (!lowerCaseKey) return defaultWidth;
|
|
578
|
+
switch (true) {
|
|
579
|
+
case item?.title === '操作' || lowerCaseKey === 'operate':
|
|
580
|
+
defaultWidth = 60;
|
|
581
|
+
break;
|
|
582
|
+
case lowerCaseKey.indexOf('number') > -1:
|
|
583
|
+
case lowerCaseKey.indexOf('quantity') > -1:
|
|
584
|
+
case lowerCaseKey.indexOf('amount') > -1:
|
|
585
|
+
defaultWidth = 90;
|
|
586
|
+
break;
|
|
587
|
+
case lowerCaseKey.indexOf('no') > -1:
|
|
588
|
+
defaultWidth = 200;
|
|
589
|
+
break;
|
|
590
|
+
case lowerCaseKey.indexOf('code') > -1:
|
|
591
|
+
defaultWidth = 170;
|
|
592
|
+
break;
|
|
593
|
+
case lowerCaseKey.indexOf('time') > -1:
|
|
594
|
+
defaultWidth = 130;
|
|
595
|
+
break;
|
|
596
|
+
case lowerCaseKey.indexOf('status') > -1:
|
|
597
|
+
defaultWidth = 100;
|
|
598
|
+
break;
|
|
599
|
+
case lowerCaseKey.indexOf('user') > -1:
|
|
600
|
+
defaultWidth = 130;
|
|
601
|
+
break;
|
|
602
|
+
default:
|
|
603
|
+
break;
|
|
604
604
|
}
|
|
605
605
|
return defaultWidth;
|
|
606
606
|
};
|
|
@@ -651,6 +651,16 @@ export function queryParams(params: any, flag?: any) {
|
|
|
651
651
|
}
|
|
652
652
|
});
|
|
653
653
|
delete params[key];
|
|
654
|
+
} else if (element && key.indexOf('*multiInput') >= 0) {
|
|
655
|
+
let name = '',
|
|
656
|
+
value = element['value'];
|
|
657
|
+
if (value.indexOf(',') >= 0) {
|
|
658
|
+
name = `qp-${element['name']}-in`;
|
|
659
|
+
} else {
|
|
660
|
+
name = `qp-${element['name']}-like`;
|
|
661
|
+
}
|
|
662
|
+
params[name] = value;
|
|
663
|
+
delete params[key];
|
|
654
664
|
} else if (element && key.indexOf('*') >= 0) {
|
|
655
665
|
const dataParams = key.split('*');
|
|
656
666
|
dataParams.forEach((value, index) => {
|
|
@@ -681,10 +691,23 @@ export function queryParams(params: any, flag?: any) {
|
|
|
681
691
|
* @returns boolean
|
|
682
692
|
*/
|
|
683
693
|
export const authFn = (code?: any) => {
|
|
694
|
+
if (!code) {
|
|
695
|
+
return true;
|
|
696
|
+
}
|
|
684
697
|
const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
|
|
685
|
-
? JSON.parse(
|
|
698
|
+
? JSON.parse(
|
|
699
|
+
localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string,
|
|
700
|
+
)
|
|
686
701
|
: [];
|
|
687
702
|
return authButton.findIndex((d: any) => d === code) !== -1;
|
|
688
703
|
};
|
|
689
704
|
|
|
690
|
-
|
|
705
|
+
// 可以将普通字符串 或者tsx 转换成字符串
|
|
706
|
+
export const renderToString = (
|
|
707
|
+
render: ReactElement<any, string | JSXElementConstructor<any>> | string,
|
|
708
|
+
) => {
|
|
709
|
+
return render;
|
|
710
|
+
// return typeof render === 'string'
|
|
711
|
+
// ? render
|
|
712
|
+
// : ReactDOMServer.renderToString(render);
|
|
713
|
+
};
|