ls-pro-common 1.0.22 → 1.0.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/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.d.ts +4 -0
- package/es/components/InputTable.js +119 -42
- package/es/hooks/useDtl/index.js +38 -16
- package/es/hooks/useSingle/index.js +18 -14
- package/es/http/index.js +1 -1
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.js +1 -0
- package/lib/components/InputTable.d.ts +4 -0
- package/lib/components/InputTable.js +120 -43
- package/lib/hooks/useDtl/index.js +38 -16
- package/lib/hooks/useSingle/index.js +18 -14
- package/lib/http/index.js +1 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +3 -1
- package/package.json +3 -3
|
@@ -13,7 +13,11 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
13
13
|
textName?: string;
|
|
14
14
|
tableConfig?: any;
|
|
15
15
|
labelWidth?: number;
|
|
16
|
+
isV2?: boolean;
|
|
17
|
+
keepSelect?: boolean;
|
|
16
18
|
onSelectChange?: (item: any) => void;
|
|
19
|
+
beforeLoad?: (param: any) => void;
|
|
20
|
+
afterLoad?: (rows: any[]) => void;
|
|
17
21
|
};
|
|
18
22
|
declare function InputTable(prop: InputTableProps): JSX.Element;
|
|
19
23
|
export default InputTable;
|
|
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
|
-
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange"],
|
|
13
|
+
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect"],
|
|
14
14
|
_excluded2 = ["current", "pageSize"];
|
|
15
15
|
import React from "react";
|
|
16
16
|
import { useRef, useState, useEffect, useContext } from 'react';
|
|
@@ -58,39 +58,71 @@ function InputTable(prop) {
|
|
|
58
58
|
labelWidth = _prop$labelWidth === void 0 ? 70 : _prop$labelWidth,
|
|
59
59
|
textField = prop.textField,
|
|
60
60
|
onSelectChange = prop.onSelectChange,
|
|
61
|
+
beforeLoad = prop.beforeLoad,
|
|
62
|
+
afterLoad = prop.afterLoad,
|
|
63
|
+
_prop$isV = prop.isV2,
|
|
64
|
+
isV2 = _prop$isV === void 0 ? false : _prop$isV,
|
|
65
|
+
_prop$allowClear = prop.allowClear,
|
|
66
|
+
allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
|
|
67
|
+
_prop$keepSelect = prop.keepSelect,
|
|
68
|
+
keepSelect = _prop$keepSelect === void 0 ? false : _prop$keepSelect,
|
|
61
69
|
rest = _objectWithoutProperties(prop, _excluded);
|
|
62
70
|
|
|
63
71
|
var textNameProp = textName || name + '__text';
|
|
64
72
|
|
|
65
73
|
var loadData = /*#__PURE__*/function () {
|
|
66
74
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
67
|
-
var current, pageSize, rest, data, result;
|
|
75
|
+
var current, pageSize, rest, data, _tableRef$current, _tableRef$current$cle, result, rows;
|
|
76
|
+
|
|
68
77
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
69
78
|
while (1) {
|
|
70
79
|
switch (_context.prev = _context.next) {
|
|
71
80
|
case 0:
|
|
72
81
|
current = param.current, pageSize = param.pageSize, rest = _objectWithoutProperties(param, _excluded2);
|
|
73
|
-
data = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
data = {};
|
|
83
|
+
|
|
84
|
+
if (isV2) {
|
|
85
|
+
data['page.pn'] = current;
|
|
86
|
+
data['page.size'] = pageSize;
|
|
87
|
+
} else {
|
|
88
|
+
data.page = current;
|
|
89
|
+
data.pageSize = pageSize;
|
|
90
|
+
}
|
|
77
91
|
|
|
78
|
-
|
|
92
|
+
;
|
|
93
|
+
|
|
94
|
+
if (Object.keys(rest).length && !isV2) {
|
|
79
95
|
data.where = rest;
|
|
80
96
|
}
|
|
81
97
|
|
|
82
|
-
|
|
98
|
+
if (!keepSelect) {
|
|
99
|
+
setSelectedRows([]);
|
|
100
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$cle = _tableRef$current.clearSelected) === null || _tableRef$current$cle === void 0 ? void 0 : _tableRef$current$cle.call(_tableRef$current);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (beforeLoad) {
|
|
104
|
+
beforeLoad(data);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
;
|
|
108
|
+
_context.next = 10;
|
|
83
109
|
return httpGet(url, data);
|
|
84
110
|
|
|
85
|
-
case
|
|
111
|
+
case 10:
|
|
86
112
|
result = _context.sent;
|
|
113
|
+
rows = result.rows || [];
|
|
114
|
+
|
|
115
|
+
if (afterLoad) {
|
|
116
|
+
afterLoad(rows);
|
|
117
|
+
}
|
|
118
|
+
|
|
87
119
|
return _context.abrupt("return", {
|
|
88
|
-
data:
|
|
120
|
+
data: rows,
|
|
89
121
|
total: result.total || 0,
|
|
90
122
|
success: true
|
|
91
123
|
});
|
|
92
124
|
|
|
93
|
-
case
|
|
125
|
+
case 14:
|
|
94
126
|
case "end":
|
|
95
127
|
return _context.stop();
|
|
96
128
|
}
|
|
@@ -107,10 +139,10 @@ function InputTable(prop) {
|
|
|
107
139
|
var _formRef$current;
|
|
108
140
|
|
|
109
141
|
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
|
|
110
|
-
var txt = formValue[textField || valueField];
|
|
111
142
|
|
|
112
|
-
if (
|
|
113
|
-
|
|
143
|
+
if (!textName && formValue[name]) {
|
|
144
|
+
formValue[textNameProp] = formValue[name];
|
|
145
|
+
formRef === null || formRef === void 0 ? void 0 : formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
114
146
|
}
|
|
115
147
|
}, []);
|
|
116
148
|
var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
|
|
@@ -148,12 +180,9 @@ function InputTable(prop) {
|
|
|
148
180
|
|
|
149
181
|
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
|
|
150
182
|
formValue[name] = record[valueField];
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
formValue[textNameProp] = record[textField || valueField];
|
|
155
|
-
}
|
|
156
|
-
|
|
183
|
+
var txt = record[textField || valueField];
|
|
184
|
+
formValue[textNameProp] = txt;
|
|
185
|
+
setText(txt);
|
|
157
186
|
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldsValue(_objectSpread({}, formValue));
|
|
158
187
|
setVisible(false);
|
|
159
188
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(record);
|
|
@@ -163,25 +192,19 @@ function InputTable(prop) {
|
|
|
163
192
|
toolBarRender: function toolBarRender() {
|
|
164
193
|
return [/*#__PURE__*/React.createElement(_Button, {
|
|
165
194
|
onClick: function onClick() {
|
|
166
|
-
|
|
167
|
-
var _formRef$current4, _formRef$current5;
|
|
168
|
-
|
|
169
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
|
|
170
|
-
formValue[name] = selectedRows.map(function (o) {
|
|
171
|
-
return o[valueField];
|
|
172
|
-
}).join(',');
|
|
173
|
-
var txt = selectedRows.map(function (o) {
|
|
174
|
-
return o[textField || valueField];
|
|
175
|
-
}).join(',');
|
|
176
|
-
setText(txt); // 如果需要接收名称,则反回名称
|
|
177
|
-
|
|
178
|
-
if (textName) {
|
|
179
|
-
formValue[textNameProp] = txt;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue(_objectSpread({}, formValue));
|
|
183
|
-
}
|
|
195
|
+
var _formRef$current4, _formRef$current5;
|
|
184
196
|
|
|
197
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
|
|
198
|
+
formValue[name] = selectedRows.map(function (o) {
|
|
199
|
+
return o[valueField];
|
|
200
|
+
}).join(',');
|
|
201
|
+
var txt = selectedRows.map(function (o) {
|
|
202
|
+
return o[textField || valueField];
|
|
203
|
+
}).join(',');
|
|
204
|
+
formValue[textNameProp] = txt;
|
|
205
|
+
setText(txt);
|
|
206
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue(_objectSpread({}, formValue));
|
|
207
|
+
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(selectedRows);
|
|
185
208
|
setVisible(false);
|
|
186
209
|
}
|
|
187
210
|
}, "\u786E\u8BA4")];
|
|
@@ -194,7 +217,7 @@ function InputTable(prop) {
|
|
|
194
217
|
}
|
|
195
218
|
}, /*#__PURE__*/React.createElement(ProFormText, {
|
|
196
219
|
name: name
|
|
197
|
-
})), /*#__PURE__*/React.createElement(ProFormText, _extends({
|
|
220
|
+
})), rest.label ? /*#__PURE__*/React.createElement(ProFormText, _extends({
|
|
198
221
|
name: textNameProp
|
|
199
222
|
}, rest), /*#__PURE__*/React.createElement(_Input, {
|
|
200
223
|
suffix: /*#__PURE__*/React.createElement(_Popover, {
|
|
@@ -217,12 +240,66 @@ function InputTable(prop) {
|
|
|
217
240
|
var _formRef$current6;
|
|
218
241
|
|
|
219
242
|
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.getFieldsValue();
|
|
220
|
-
|
|
243
|
+
var val = e.target.value;
|
|
244
|
+
formValue[name] = val;
|
|
245
|
+
formValue[textNameProp] = val;
|
|
246
|
+
formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
247
|
+
},
|
|
248
|
+
onChange: function onChange(e) {
|
|
249
|
+
if (!e.target.value) {
|
|
250
|
+
var _formRef$current7;
|
|
251
|
+
|
|
252
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.getFieldsValue();
|
|
253
|
+
formValue[name] = '';
|
|
254
|
+
formValue[textNameProp] = '';
|
|
255
|
+
formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
readOnly: readonly,
|
|
259
|
+
allowClear: allowClear
|
|
260
|
+
})) : /*#__PURE__*/React.createElement(_Input, _extends({
|
|
261
|
+
suffix: /*#__PURE__*/React.createElement(_Popover, {
|
|
262
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
263
|
+
style: {
|
|
264
|
+
width: tableWidth + 'px',
|
|
265
|
+
height: tableHeight + 'px',
|
|
266
|
+
maxHeight: '95vh',
|
|
267
|
+
overflow: 'auto'
|
|
268
|
+
}
|
|
269
|
+
}, tableDom),
|
|
270
|
+
trigger: "click",
|
|
271
|
+
visible: visible,
|
|
272
|
+
onVisibleChange: setVisible
|
|
273
|
+
}, /*#__PURE__*/React.createElement(MoreOutlined, null)),
|
|
274
|
+
onClick: function onClick() {
|
|
275
|
+
return setVisible(true);
|
|
276
|
+
},
|
|
277
|
+
onInput: function onInput(e) {
|
|
278
|
+
var _formRef$current8;
|
|
279
|
+
|
|
280
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.getFieldsValue();
|
|
281
|
+
var val = e.target.value;
|
|
282
|
+
formValue[name] = val;
|
|
283
|
+
formValue[textNameProp] = val;
|
|
284
|
+
setText(val);
|
|
221
285
|
formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
222
286
|
},
|
|
287
|
+
onChange: function onChange(e) {
|
|
288
|
+
//用于清除当前组件值
|
|
289
|
+
if (!e.target.value) {
|
|
290
|
+
var _formRef$current9;
|
|
291
|
+
|
|
292
|
+
setText('');
|
|
293
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.getFieldsValue();
|
|
294
|
+
formValue[name] = '';
|
|
295
|
+
formValue[textNameProp] = '';
|
|
296
|
+
formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
297
|
+
}
|
|
298
|
+
},
|
|
223
299
|
readOnly: readonly,
|
|
224
|
-
value: text
|
|
225
|
-
|
|
300
|
+
value: text,
|
|
301
|
+
allowClear: allowClear
|
|
302
|
+
}, rest === null || rest === void 0 ? void 0 : rest.fieldProps)));
|
|
226
303
|
}
|
|
227
304
|
|
|
228
305
|
export default InputTable;
|
package/es/hooks/useDtl/index.js
CHANGED
|
@@ -611,6 +611,8 @@ function useDtl(dtlParam) {
|
|
|
611
611
|
|
|
612
612
|
var onLoadDtl = /*#__PURE__*/function () {
|
|
613
613
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params, sort, filter) {
|
|
614
|
+
var _tableRef$current, _tableRef$current$cle;
|
|
615
|
+
|
|
614
616
|
var current, pageSize, rest, param, key, result;
|
|
615
617
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
616
618
|
while (1) {
|
|
@@ -649,23 +651,25 @@ function useDtl(dtlParam) {
|
|
|
649
651
|
}
|
|
650
652
|
}
|
|
651
653
|
|
|
654
|
+
setSelectedRows([]);
|
|
655
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$cle = _tableRef$current.clearSelected) === null || _tableRef$current$cle === void 0 ? void 0 : _tableRef$current$cle.call(_tableRef$current);
|
|
652
656
|
_context7.t0 = beforeLoad;
|
|
653
657
|
|
|
654
658
|
if (!_context7.t0) {
|
|
655
|
-
_context7.next =
|
|
659
|
+
_context7.next = 17;
|
|
656
660
|
break;
|
|
657
661
|
}
|
|
658
662
|
|
|
659
|
-
_context7.next =
|
|
663
|
+
_context7.next = 15;
|
|
660
664
|
return beforeLoad(param);
|
|
661
665
|
|
|
662
|
-
case
|
|
666
|
+
case 15:
|
|
663
667
|
_context7.t1 = _context7.sent;
|
|
664
668
|
_context7.t0 = _context7.t1 === false;
|
|
665
669
|
|
|
666
|
-
case
|
|
670
|
+
case 17:
|
|
667
671
|
if (!_context7.t0) {
|
|
668
|
-
_context7.next =
|
|
672
|
+
_context7.next = 19;
|
|
669
673
|
break;
|
|
670
674
|
}
|
|
671
675
|
|
|
@@ -674,17 +678,17 @@ function useDtl(dtlParam) {
|
|
|
674
678
|
success: true
|
|
675
679
|
});
|
|
676
680
|
|
|
677
|
-
case
|
|
678
|
-
_context7.next =
|
|
681
|
+
case 19:
|
|
682
|
+
_context7.next = 21;
|
|
679
683
|
return dtlService.load(param);
|
|
680
684
|
|
|
681
|
-
case
|
|
685
|
+
case 21:
|
|
682
686
|
result = _context7.sent;
|
|
683
687
|
result.data = result.rows;
|
|
684
688
|
result.success = true;
|
|
685
689
|
return _context7.abrupt("return", result);
|
|
686
690
|
|
|
687
|
-
case
|
|
691
|
+
case 25:
|
|
688
692
|
case "end":
|
|
689
693
|
return _context7.stop();
|
|
690
694
|
}
|
|
@@ -882,6 +886,28 @@ function useDtl(dtlParam) {
|
|
|
882
886
|
}
|
|
883
887
|
};
|
|
884
888
|
|
|
889
|
+
var onExport = function onExport() {
|
|
890
|
+
var _tableRef$current2, _tableRef$current2$sh;
|
|
891
|
+
|
|
892
|
+
if (!masterObject[mstKeyField]) {
|
|
893
|
+
showWarn('主表没保存,无法导出数据');
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showExport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
var onImport = function onImport() {
|
|
901
|
+
var _tableRef$current3, _tableRef$current3$sh;
|
|
902
|
+
|
|
903
|
+
if (!masterObject[mstKeyField]) {
|
|
904
|
+
showWarn('主表没保存,无法导入数据');
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$sh = _tableRef$current3.showImport) === null || _tableRef$current3$sh === void 0 ? void 0 : _tableRef$current3$sh.call(_tableRef$current3);
|
|
909
|
+
};
|
|
910
|
+
|
|
885
911
|
var tableTools = useMemo(function () {
|
|
886
912
|
return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && !isAudit() ? /*#__PURE__*/React.createElement(_Button, {
|
|
887
913
|
key: "add",
|
|
@@ -907,17 +933,13 @@ function useDtl(dtlParam) {
|
|
|
907
933
|
}, "\u5220\u9664") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) ? /*#__PURE__*/React.createElement(_Button, {
|
|
908
934
|
key: "import",
|
|
909
935
|
onClick: function onClick() {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$sho = _tableRef$current.showImport) === null || _tableRef$current$sho === void 0 ? void 0 : _tableRef$current$sho.call(_tableRef$current);
|
|
936
|
+
onImport();
|
|
913
937
|
},
|
|
914
938
|
icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
|
|
915
|
-
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.
|
|
939
|
+
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) ? /*#__PURE__*/React.createElement(_Button, {
|
|
916
940
|
key: "export",
|
|
917
941
|
onClick: function onClick() {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showExport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
|
|
942
|
+
onExport();
|
|
921
943
|
},
|
|
922
944
|
icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
|
|
923
945
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
@@ -482,6 +482,8 @@ function useSingle(inParam) {
|
|
|
482
482
|
|
|
483
483
|
var onLoad = /*#__PURE__*/function () {
|
|
484
484
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(params, sort, filter) {
|
|
485
|
+
var _tableRef$current, _tableRef$current$cle;
|
|
486
|
+
|
|
485
487
|
var current, pageSize, rest, param, key, result;
|
|
486
488
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
487
489
|
while (1) {
|
|
@@ -505,23 +507,25 @@ function useSingle(inParam) {
|
|
|
505
507
|
param.where = rest;
|
|
506
508
|
}
|
|
507
509
|
|
|
510
|
+
setSelectedRows([]);
|
|
511
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$cle = _tableRef$current.clearSelected) === null || _tableRef$current$cle === void 0 ? void 0 : _tableRef$current$cle.call(_tableRef$current);
|
|
508
512
|
_context6.t0 = beforeLoad;
|
|
509
513
|
|
|
510
514
|
if (!_context6.t0) {
|
|
511
|
-
_context6.next =
|
|
515
|
+
_context6.next = 13;
|
|
512
516
|
break;
|
|
513
517
|
}
|
|
514
518
|
|
|
515
|
-
_context6.next =
|
|
519
|
+
_context6.next = 11;
|
|
516
520
|
return beforeLoad(param);
|
|
517
521
|
|
|
518
|
-
case
|
|
522
|
+
case 11:
|
|
519
523
|
_context6.t1 = _context6.sent;
|
|
520
524
|
_context6.t0 = _context6.t1 === false;
|
|
521
525
|
|
|
522
|
-
case
|
|
526
|
+
case 13:
|
|
523
527
|
if (!_context6.t0) {
|
|
524
|
-
_context6.next =
|
|
528
|
+
_context6.next = 15;
|
|
525
529
|
break;
|
|
526
530
|
}
|
|
527
531
|
|
|
@@ -531,17 +535,17 @@ function useSingle(inParam) {
|
|
|
531
535
|
total: 0
|
|
532
536
|
});
|
|
533
537
|
|
|
534
|
-
case
|
|
535
|
-
_context6.next =
|
|
538
|
+
case 15:
|
|
539
|
+
_context6.next = 17;
|
|
536
540
|
return service.load(param);
|
|
537
541
|
|
|
538
|
-
case
|
|
542
|
+
case 17:
|
|
539
543
|
result = _context6.sent;
|
|
540
544
|
result.data = result.rows;
|
|
541
545
|
result.success = true;
|
|
542
546
|
return _context6.abrupt("return", result);
|
|
543
547
|
|
|
544
|
-
case
|
|
548
|
+
case 21:
|
|
545
549
|
case "end":
|
|
546
550
|
return _context6.stop();
|
|
547
551
|
}
|
|
@@ -689,17 +693,17 @@ function useSingle(inParam) {
|
|
|
689
693
|
}, "\u5BA1\u6838") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) && checkRight(128) ? /*#__PURE__*/React.createElement(_Button, {
|
|
690
694
|
key: "import",
|
|
691
695
|
onClick: function onClick() {
|
|
692
|
-
var _tableRef$
|
|
696
|
+
var _tableRef$current2, _tableRef$current2$sh;
|
|
693
697
|
|
|
694
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
698
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showImport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
|
|
695
699
|
},
|
|
696
700
|
icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
|
|
697
|
-
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.
|
|
701
|
+
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) && checkRight(256) ? /*#__PURE__*/React.createElement(_Button, {
|
|
698
702
|
key: "export",
|
|
699
703
|
onClick: function onClick() {
|
|
700
|
-
var _tableRef$
|
|
704
|
+
var _tableRef$current3, _tableRef$current3$sh;
|
|
701
705
|
|
|
702
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
706
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$sh = _tableRef$current3.showExport) === null || _tableRef$current3$sh === void 0 ? void 0 : _tableRef$current3$sh.call(_tableRef$current3);
|
|
703
707
|
},
|
|
704
708
|
icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
|
|
705
709
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
package/es/http/index.js
CHANGED
|
@@ -23,7 +23,7 @@ request.interceptors.request.use(function (url, options) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var param = {
|
|
26
|
-
resCode: getUrlQuery('resourceId') || getResourceProps('resourceId')
|
|
26
|
+
resCode: getUrlQuery('resCode') || getUrlQuery('resourceId') || getResourceProps('resourceId')
|
|
27
27
|
};
|
|
28
28
|
return {
|
|
29
29
|
url: setUrlQuery(url, param),
|
package/es/utils/index.d.ts
CHANGED
|
@@ -82,12 +82,15 @@ export declare const treeEach: (list: any[], fn: (item: any, index: any, list: a
|
|
|
82
82
|
* @returns 返回符合条件的第一条对象
|
|
83
83
|
*/
|
|
84
84
|
export declare const treeFind: (list: any[], key: string, val: any, children?: string) => any;
|
|
85
|
+
export declare const isDev: boolean;
|
|
85
86
|
export declare type UserType = {
|
|
86
87
|
id?: string;
|
|
87
88
|
userId?: string;
|
|
88
89
|
userName?: string;
|
|
89
90
|
loginName?: string;
|
|
90
91
|
companyId?: string;
|
|
92
|
+
companyCode?: string;
|
|
93
|
+
companyName?: string;
|
|
91
94
|
email?: string;
|
|
92
95
|
employeeAttr?: string;
|
|
93
96
|
expireTime?: string;
|
package/es/utils/index.js
CHANGED
|
@@ -13,7 +13,11 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
13
13
|
textName?: string;
|
|
14
14
|
tableConfig?: any;
|
|
15
15
|
labelWidth?: number;
|
|
16
|
+
isV2?: boolean;
|
|
17
|
+
keepSelect?: boolean;
|
|
16
18
|
onSelectChange?: (item: any) => void;
|
|
19
|
+
beforeLoad?: (param: any) => void;
|
|
20
|
+
afterLoad?: (rows: any[]) => void;
|
|
17
21
|
};
|
|
18
22
|
declare function InputTable(prop: InputTableProps): JSX.Element;
|
|
19
23
|
export default InputTable;
|