ls-pro-common 1.0.24 → 1.0.27
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/DtlLayout.d.ts +2 -0
- package/es/components/DtlLayout.js +8 -1
- package/es/components/InputTable.d.ts +4 -0
- package/es/components/InputTable.js +119 -42
- package/es/hooks/useDtl/index.js +81 -50
- package/es/hooks/useSingle/index.js +63 -42
- package/es/http/index.js +1 -1
- package/es/utils/index.d.ts +9 -0
- package/es/utils/index.js +22 -0
- package/lib/components/DtlLayout.d.ts +2 -0
- package/lib/components/DtlLayout.js +8 -1
- package/lib/components/InputTable.d.ts +4 -0
- package/lib/components/InputTable.js +120 -43
- package/lib/hooks/useDtl/index.js +81 -50
- package/lib/hooks/useSingle/index.js +63 -42
- package/lib/http/index.js +1 -1
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +29 -2
- package/package.json +3 -3
|
@@ -10,6 +10,8 @@ export declare type DtlLyaoutProps = Record<string, any> & {
|
|
|
10
10
|
renderButton?: (defaultBtn: JSX.Element[]) => JSX.Element[];
|
|
11
11
|
/** 审核方法 */
|
|
12
12
|
onAudit?: () => void;
|
|
13
|
+
/**按钮状态 */
|
|
14
|
+
btnStatus?: (btnKey: string) => boolean | void;
|
|
13
15
|
/** 保存按钮文本 */
|
|
14
16
|
btnSaveText?: string;
|
|
15
17
|
/** 返回按钮文本 */
|
|
@@ -20,7 +20,8 @@ function DtlLayout(props) {
|
|
|
20
20
|
_props$btnSaveText = props.btnSaveText,
|
|
21
21
|
btnSaveText = _props$btnSaveText === void 0 ? '保存' : _props$btnSaveText,
|
|
22
22
|
_props$btnExitText = props.btnExitText,
|
|
23
|
-
btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText
|
|
23
|
+
btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText,
|
|
24
|
+
btnStatus = props.btnStatus;
|
|
24
25
|
var dtlTitle = useMemo(function () {
|
|
25
26
|
if (title) return title;
|
|
26
27
|
if (!masterObject) return '';
|
|
@@ -38,6 +39,7 @@ function DtlLayout(props) {
|
|
|
38
39
|
|
|
39
40
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.submit();
|
|
40
41
|
},
|
|
42
|
+
disabled: btnStatus ? btnStatus('btnSave') || false : false,
|
|
41
43
|
icon: /*#__PURE__*/React.createElement(SaveOutlined, null)
|
|
42
44
|
}, btnSaveText), /*#__PURE__*/React.createElement(_Button, {
|
|
43
45
|
key: "btnBack",
|
|
@@ -50,6 +52,11 @@ function DtlLayout(props) {
|
|
|
50
52
|
if (props.onAudit) {
|
|
51
53
|
b.unshift( /*#__PURE__*/React.createElement(_Button, {
|
|
52
54
|
key: "btnAudit",
|
|
55
|
+
disabled: btnStatus ? btnStatus('btnAudit') || false : false,
|
|
56
|
+
onClick: function onClick() {
|
|
57
|
+
if (!props.onAudit) return;
|
|
58
|
+
props.onAudit();
|
|
59
|
+
},
|
|
53
60
|
icon: /*#__PURE__*/React.createElement(CheckOutlined, null)
|
|
54
61
|
}, "\u5BA1\u6838"));
|
|
55
62
|
}
|
|
@@ -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[textName || name];
|
|
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
|
@@ -143,7 +143,7 @@ function useDtl(dtlParam) {
|
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
showSuccess(result.flag.retMsg);
|
|
146
|
+
showSuccess(result.flag.retMsg || '操作成功');
|
|
147
147
|
Object.assign(masterObject, result.data);
|
|
148
148
|
setEditItem({});
|
|
149
149
|
return _context.abrupt("return", true);
|
|
@@ -252,7 +252,7 @@ function useDtl(dtlParam) {
|
|
|
252
252
|
break;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
showSuccess(result.flag.retMsg);
|
|
255
|
+
showSuccess(result.flag.retMsg || '删除成功');
|
|
256
256
|
return _context2.abrupt("return", true);
|
|
257
257
|
|
|
258
258
|
case 28:
|
|
@@ -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
|
}
|
|
@@ -787,53 +791,48 @@ function useDtl(dtlParam) {
|
|
|
787
791
|
return _context9.abrupt("return");
|
|
788
792
|
|
|
789
793
|
case 3:
|
|
790
|
-
obj = _objectSpread({}, masterObject);
|
|
794
|
+
obj = _objectSpread({}, masterObject);
|
|
791
795
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
if (!_context9.t0) {
|
|
795
|
-
_context9.next = 10;
|
|
796
|
+
if (masterObject[mstKeyField]) {
|
|
797
|
+
_context9.next = 7;
|
|
796
798
|
break;
|
|
797
799
|
}
|
|
798
800
|
|
|
799
|
-
|
|
800
|
-
return
|
|
801
|
+
showWarn('当前数据未保存,不能审核');
|
|
802
|
+
return _context9.abrupt("return");
|
|
801
803
|
|
|
802
|
-
case
|
|
803
|
-
_context9.
|
|
804
|
-
_context9.
|
|
804
|
+
case 7:
|
|
805
|
+
_context9.prev = 7;
|
|
806
|
+
_context9.next = 10;
|
|
807
|
+
return showConfirm('确认要审核此数据?', '审核提示');
|
|
805
808
|
|
|
806
809
|
case 10:
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
return _context9.abrupt("return");
|
|
810
|
+
_context9.next = 16;
|
|
811
|
+
break;
|
|
813
812
|
|
|
814
813
|
case 12:
|
|
815
814
|
_context9.prev = 12;
|
|
816
|
-
_context9.
|
|
817
|
-
|
|
815
|
+
_context9.t0 = _context9["catch"](7);
|
|
816
|
+
console.log('终止审核', _context9.t0);
|
|
817
|
+
return _context9.abrupt("return");
|
|
818
818
|
|
|
819
|
-
case
|
|
820
|
-
|
|
821
|
-
_context9.t2 = afterAudit;
|
|
819
|
+
case 16:
|
|
820
|
+
_context9.t1 = beforeAudit;
|
|
822
821
|
|
|
823
|
-
if (!_context9.
|
|
822
|
+
if (!_context9.t1) {
|
|
824
823
|
_context9.next = 22;
|
|
825
824
|
break;
|
|
826
825
|
}
|
|
827
826
|
|
|
828
827
|
_context9.next = 20;
|
|
829
|
-
return
|
|
828
|
+
return beforeAudit(obj);
|
|
830
829
|
|
|
831
830
|
case 20:
|
|
832
|
-
_context9.
|
|
833
|
-
_context9.
|
|
831
|
+
_context9.t2 = _context9.sent;
|
|
832
|
+
_context9.t1 = _context9.t2 === false;
|
|
834
833
|
|
|
835
834
|
case 22:
|
|
836
|
-
if (!_context9.
|
|
835
|
+
if (!_context9.t1) {
|
|
837
836
|
_context9.next = 24;
|
|
838
837
|
break;
|
|
839
838
|
}
|
|
@@ -841,25 +840,54 @@ function useDtl(dtlParam) {
|
|
|
841
840
|
return _context9.abrupt("return");
|
|
842
841
|
|
|
843
842
|
case 24:
|
|
843
|
+
_context9.prev = 24;
|
|
844
|
+
_context9.next = 27;
|
|
845
|
+
return mstService.audit([obj]);
|
|
846
|
+
|
|
847
|
+
case 27:
|
|
848
|
+
result = _context9.sent;
|
|
849
|
+
_context9.t3 = afterAudit;
|
|
850
|
+
|
|
851
|
+
if (!_context9.t3) {
|
|
852
|
+
_context9.next = 34;
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
_context9.next = 32;
|
|
857
|
+
return afterAudit(result, [obj]);
|
|
858
|
+
|
|
859
|
+
case 32:
|
|
860
|
+
_context9.t4 = _context9.sent;
|
|
861
|
+
_context9.t3 = _context9.t4 === false;
|
|
862
|
+
|
|
863
|
+
case 34:
|
|
864
|
+
if (!_context9.t3) {
|
|
865
|
+
_context9.next = 36;
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
return _context9.abrupt("return");
|
|
870
|
+
|
|
871
|
+
case 36:
|
|
844
872
|
if ((result === null || result === void 0 ? void 0 : (_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retCode) === '0') {
|
|
845
|
-
showSuccess(result.flag.retMsg);
|
|
873
|
+
showSuccess(result.flag.retMsg || '审核成功');
|
|
846
874
|
Object.assign(masterObject, result.data);
|
|
847
875
|
}
|
|
848
876
|
|
|
849
|
-
_context9.next =
|
|
877
|
+
_context9.next = 42;
|
|
850
878
|
break;
|
|
851
879
|
|
|
852
|
-
case
|
|
853
|
-
_context9.prev =
|
|
854
|
-
_context9.
|
|
855
|
-
console.log(_context9.
|
|
880
|
+
case 39:
|
|
881
|
+
_context9.prev = 39;
|
|
882
|
+
_context9.t5 = _context9["catch"](24);
|
|
883
|
+
console.log('审核异常', _context9.t5);
|
|
856
884
|
|
|
857
|
-
case
|
|
885
|
+
case 42:
|
|
858
886
|
case "end":
|
|
859
887
|
return _context9.stop();
|
|
860
888
|
}
|
|
861
889
|
}
|
|
862
|
-
}, _callee9, null, [[12,
|
|
890
|
+
}, _callee9, null, [[7, 12], [24, 39]]);
|
|
863
891
|
}));
|
|
864
892
|
|
|
865
893
|
return function onAudit() {
|
|
@@ -883,25 +911,25 @@ function useDtl(dtlParam) {
|
|
|
883
911
|
};
|
|
884
912
|
|
|
885
913
|
var onExport = function onExport() {
|
|
886
|
-
var _tableRef$
|
|
914
|
+
var _tableRef$current2, _tableRef$current2$sh;
|
|
887
915
|
|
|
888
916
|
if (!masterObject[mstKeyField]) {
|
|
889
917
|
showWarn('主表没保存,无法导出数据');
|
|
890
918
|
return;
|
|
891
919
|
}
|
|
892
920
|
|
|
893
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
921
|
+
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);
|
|
894
922
|
};
|
|
895
923
|
|
|
896
924
|
var onImport = function onImport() {
|
|
897
|
-
var _tableRef$
|
|
925
|
+
var _tableRef$current3, _tableRef$current3$sh;
|
|
898
926
|
|
|
899
927
|
if (!masterObject[mstKeyField]) {
|
|
900
928
|
showWarn('主表没保存,无法导入数据');
|
|
901
929
|
return;
|
|
902
930
|
}
|
|
903
931
|
|
|
904
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
932
|
+
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);
|
|
905
933
|
};
|
|
906
934
|
|
|
907
935
|
var tableTools = useMemo(function () {
|
|
@@ -910,6 +938,7 @@ function useDtl(dtlParam) {
|
|
|
910
938
|
onClick: function onClick() {
|
|
911
939
|
return onAddDtl();
|
|
912
940
|
},
|
|
941
|
+
disabled: btnDisabled('add'),
|
|
913
942
|
icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
|
|
914
943
|
}, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && !isAudit() ? /*#__PURE__*/React.createElement(_Button, {
|
|
915
944
|
key: "edit",
|
|
@@ -931,12 +960,14 @@ function useDtl(dtlParam) {
|
|
|
931
960
|
onClick: function onClick() {
|
|
932
961
|
onImport();
|
|
933
962
|
},
|
|
963
|
+
disabled: btnDisabled('import'),
|
|
934
964
|
icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
|
|
935
|
-
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.
|
|
965
|
+
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) ? /*#__PURE__*/React.createElement(_Button, {
|
|
936
966
|
key: "export",
|
|
937
967
|
onClick: function onClick() {
|
|
938
968
|
onExport();
|
|
939
969
|
},
|
|
970
|
+
disabled: btnDisabled('export'),
|
|
940
971
|
icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
|
|
941
972
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
942
973
|
return o !== false;
|