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