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.
@@ -185,7 +185,7 @@ function useSingle(inParam) {
185
185
 
186
186
 
187
187
  var onRemove = function onRemove(row) {
188
- if (!row || !selectedRows.length) {
188
+ if (!row && !selectedRows.length) {
189
189
  showWarn('请选择需要删除的数据');
190
190
  return;
191
191
  }
@@ -259,7 +259,7 @@ function useSingle(inParam) {
259
259
 
260
260
  case 20:
261
261
  if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
262
- showSuccess(result.flag.retMsg);
262
+ showSuccess(result.flag.retMsg || '删除成功');
263
263
 
264
264
  if (tableRef.current) {
265
265
  tableRef.current.reload(false);
@@ -317,69 +317,83 @@ function useSingle(inParam) {
317
317
 
318
318
  obj[statusField] = auditStatus;
319
319
  return obj;
320
- }); // beforeAudit 强式终止
320
+ });
321
+ _context4.prev = 7;
322
+ _context4.next = 10;
323
+ return showConfirm('确认要审核选中的数据?', '审核提示');
321
324
 
322
- _context4.t0 = beforeAudit;
325
+ case 10:
326
+ _context4.next = 16;
327
+ break;
323
328
 
324
- if (!_context4.t0) {
325
- _context4.next = 13;
329
+ case 12:
330
+ _context4.prev = 12;
331
+ _context4.t0 = _context4["catch"](7);
332
+ console.log(_context4.t0);
333
+ return _context4.abrupt("return");
334
+
335
+ case 16:
336
+ _context4.t1 = beforeAudit;
337
+
338
+ if (!_context4.t1) {
339
+ _context4.next = 22;
326
340
  break;
327
341
  }
328
342
 
329
- _context4.next = 11;
343
+ _context4.next = 20;
330
344
  return beforeAudit(rows);
331
345
 
332
- case 11:
333
- _context4.t1 = _context4.sent;
334
- _context4.t0 = _context4.t1 === false;
346
+ case 20:
347
+ _context4.t2 = _context4.sent;
348
+ _context4.t1 = _context4.t2 === false;
335
349
 
336
- case 13:
337
- if (!_context4.t0) {
338
- _context4.next = 15;
350
+ case 22:
351
+ if (!_context4.t1) {
352
+ _context4.next = 24;
339
353
  break;
340
354
  }
341
355
 
342
356
  return _context4.abrupt("return");
343
357
 
344
- case 15:
345
- _context4.prev = 15;
346
- _context4.next = 18;
358
+ case 24:
359
+ _context4.prev = 24;
360
+ _context4.next = 27;
347
361
  return service.audit(rows);
348
362
 
349
- case 18:
363
+ case 27:
350
364
  result = _context4.sent;
351
365
 
352
366
  if (!afterAudit) {
353
- _context4.next = 22;
367
+ _context4.next = 31;
354
368
  break;
355
369
  }
356
370
 
357
371
  afterAudit(result, rows);
358
372
  return _context4.abrupt("return");
359
373
 
360
- case 22:
374
+ case 31:
361
375
  if ((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0') {
362
- showSuccess(result.flag.retMsg);
376
+ showSuccess(result.flag.retMsg || '审核成功');
363
377
 
364
378
  if (tableRef.current) {
365
379
  tableRef.current.reload(false);
366
380
  }
367
381
  }
368
382
 
369
- _context4.next = 28;
383
+ _context4.next = 37;
370
384
  break;
371
385
 
372
- case 25:
373
- _context4.prev = 25;
374
- _context4.t2 = _context4["catch"](15);
375
- console.log(_context4.t2);
386
+ case 34:
387
+ _context4.prev = 34;
388
+ _context4.t3 = _context4["catch"](24);
389
+ console.log(_context4.t3);
376
390
 
377
- case 28:
391
+ case 37:
378
392
  case "end":
379
393
  return _context4.stop();
380
394
  }
381
395
  }
382
- }, _callee4, null, [[15, 25]]);
396
+ }, _callee4, null, [[7, 12], [24, 34]]);
383
397
  }));
384
398
 
385
399
  return function onAudit(_x3) {
@@ -445,7 +459,7 @@ function useSingle(inParam) {
445
459
  break;
446
460
  }
447
461
 
448
- showSuccess(result.flag.retMsg);
462
+ showSuccess(result.flag.retMsg || '操作成功');
449
463
 
450
464
  if (tableRef.current) {
451
465
  tableRef.current.reload(false);
@@ -482,6 +496,8 @@ function useSingle(inParam) {
482
496
 
483
497
  var onLoad = /*#__PURE__*/function () {
484
498
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(params, sort, filter) {
499
+ var _tableRef$current, _tableRef$current$cle;
500
+
485
501
  var current, pageSize, rest, param, key, result;
486
502
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
487
503
  while (1) {
@@ -505,23 +521,25 @@ function useSingle(inParam) {
505
521
  param.where = rest;
506
522
  }
507
523
 
524
+ setSelectedRows([]);
525
+ (_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
526
  _context6.t0 = beforeLoad;
509
527
 
510
528
  if (!_context6.t0) {
511
- _context6.next = 11;
529
+ _context6.next = 13;
512
530
  break;
513
531
  }
514
532
 
515
- _context6.next = 9;
533
+ _context6.next = 11;
516
534
  return beforeLoad(param);
517
535
 
518
- case 9:
536
+ case 11:
519
537
  _context6.t1 = _context6.sent;
520
538
  _context6.t0 = _context6.t1 === false;
521
539
 
522
- case 11:
540
+ case 13:
523
541
  if (!_context6.t0) {
524
- _context6.next = 13;
542
+ _context6.next = 15;
525
543
  break;
526
544
  }
527
545
 
@@ -531,17 +549,17 @@ function useSingle(inParam) {
531
549
  total: 0
532
550
  });
533
551
 
534
- case 13:
535
- _context6.next = 15;
552
+ case 15:
553
+ _context6.next = 17;
536
554
  return service.load(param);
537
555
 
538
- case 15:
556
+ case 17:
539
557
  result = _context6.sent;
540
558
  result.data = result.rows;
541
559
  result.success = true;
542
560
  return _context6.abrupt("return", result);
543
561
 
544
- case 19:
562
+ case 21:
545
563
  case "end":
546
564
  return _context6.stop();
547
565
  }
@@ -663,6 +681,7 @@ function useSingle(inParam) {
663
681
  onClick: function onClick() {
664
682
  return onAdd(null);
665
683
  },
684
+ disabled: btnDisabled('add'),
666
685
  icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
667
686
  }, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && checkRight(4) ? /*#__PURE__*/React.createElement(_Button, {
668
687
  key: "edit",
@@ -689,18 +708,20 @@ function useSingle(inParam) {
689
708
  }, "\u5BA1\u6838") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) && checkRight(128) ? /*#__PURE__*/React.createElement(_Button, {
690
709
  key: "import",
691
710
  onClick: function onClick() {
692
- var _tableRef$current, _tableRef$current$sho;
711
+ var _tableRef$current2, _tableRef$current2$sh;
693
712
 
694
- 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);
713
+ 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
714
  },
715
+ disabled: btnDisabled('import'),
696
716
  icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
697
- }, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) && checkRight(256) ? /*#__PURE__*/React.createElement(_Button, {
717
+ }, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) && checkRight(256) ? /*#__PURE__*/React.createElement(_Button, {
698
718
  key: "export",
699
719
  onClick: function onClick() {
700
- var _tableRef$current2, _tableRef$current2$sh;
720
+ var _tableRef$current3, _tableRef$current3$sh;
701
721
 
702
- 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);
722
+ 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
723
  },
724
+ disabled: btnDisabled('export'),
704
725
  icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
705
726
  }, "\u5BFC\u51FA") : false].filter(function (o) {
706
727
  return o !== false;
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),
@@ -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;
@@ -99,7 +102,13 @@ export declare type UserType = {
99
102
  phoneNumber?: string;
100
103
  remarks?: string;
101
104
  };
105
+ /** @name 用户信息 */
102
106
  export declare const getUserInfo: () => UserType | null;
107
+ /** @name 用户名 */
103
108
  export declare const getUserName: () => string | undefined;
109
+ /** @name 登录名 */
104
110
  export declare const getLoginName: () => string | undefined;
111
+ /** @name 公司Id */
105
112
  export declare const getCompanyId: () => string | undefined;
113
+ /** @name 微前端原生路径 */
114
+ export declare const appPath: (path?: string) => any;
package/es/utils/index.js CHANGED
@@ -217,21 +217,43 @@ export var treeFind = function treeFind(list, key, val) {
217
217
 
218
218
  return item;
219
219
  };
220
+ export var isDev = location.href.includes("//localhost");
221
+ /** @name 用户信息 */
222
+
220
223
  export var getUserInfo = function getUserInfo() {
221
224
  return getCache('user');
222
225
  };
226
+ /** @name 用户名 */
227
+
223
228
  export var getUserName = function getUserName() {
224
229
  var _getUserInfo;
225
230
 
226
231
  return (_getUserInfo = getUserInfo()) === null || _getUserInfo === void 0 ? void 0 : _getUserInfo.userName;
227
232
  };
233
+ /** @name 登录名 */
234
+
228
235
  export var getLoginName = function getLoginName() {
229
236
  var _getUserInfo2;
230
237
 
231
238
  return (_getUserInfo2 = getUserInfo()) === null || _getUserInfo2 === void 0 ? void 0 : _getUserInfo2.loginName;
232
239
  };
240
+ /** @name 公司Id */
241
+
233
242
  export var getCompanyId = function getCompanyId() {
234
243
  var _getUserInfo3;
235
244
 
236
245
  return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
246
+ };
247
+ /** @name 微前端原生路径 */
248
+
249
+ export var appPath = function appPath() {
250
+ var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
251
+
252
+ // @ts-ignore
253
+ if (window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__) {
254
+ // @ts-ignore
255
+ return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
256
+ }
257
+
258
+ return path ? path : './';
237
259
  };
@@ -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
  /** 返回按钮文本 */
@@ -36,7 +36,8 @@ function DtlLayout(props) {
36
36
  _props$btnSaveText = props.btnSaveText,
37
37
  btnSaveText = _props$btnSaveText === void 0 ? '保存' : _props$btnSaveText,
38
38
  _props$btnExitText = props.btnExitText,
39
- btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText;
39
+ btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText,
40
+ btnStatus = props.btnStatus;
40
41
  var dtlTitle = (0, _react.useMemo)(function () {
41
42
  if (title) return title;
42
43
  if (!masterObject) return '';
@@ -54,6 +55,7 @@ function DtlLayout(props) {
54
55
 
55
56
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.submit();
56
57
  },
58
+ disabled: btnStatus ? btnStatus('btnSave') || false : false,
57
59
  icon: /*#__PURE__*/_react.default.createElement(_icons.SaveOutlined, null)
58
60
  }, btnSaveText), /*#__PURE__*/_react.default.createElement(_button.default, {
59
61
  key: "btnBack",
@@ -66,6 +68,11 @@ function DtlLayout(props) {
66
68
  if (props.onAudit) {
67
69
  b.unshift( /*#__PURE__*/_react.default.createElement(_button.default, {
68
70
  key: "btnAudit",
71
+ disabled: btnStatus ? btnStatus('btnAudit') || false : false,
72
+ onClick: function onClick() {
73
+ if (!props.onAudit) return;
74
+ props.onAudit();
75
+ },
69
76
  icon: /*#__PURE__*/_react.default.createElement(_icons.CheckOutlined, null)
70
77
  }, "\u5BA1\u6838"));
71
78
  }
@@ -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;
@@ -43,7 +43,7 @@ var _icons = require("@ant-design/icons");
43
43
 
44
44
  var _http = require("../http");
45
45
 
46
- var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange"],
46
+ var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect"],
47
47
  _excluded2 = ["current", "pageSize"];
48
48
 
49
49
  function InputTable(prop) {
@@ -85,38 +85,70 @@ function InputTable(prop) {
85
85
  labelWidth = _prop$labelWidth === void 0 ? 70 : _prop$labelWidth,
86
86
  textField = prop.textField,
87
87
  onSelectChange = prop.onSelectChange,
88
+ beforeLoad = prop.beforeLoad,
89
+ afterLoad = prop.afterLoad,
90
+ _prop$isV = prop.isV2,
91
+ isV2 = _prop$isV === void 0 ? false : _prop$isV,
92
+ _prop$allowClear = prop.allowClear,
93
+ allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
94
+ _prop$keepSelect = prop.keepSelect,
95
+ keepSelect = _prop$keepSelect === void 0 ? false : _prop$keepSelect,
88
96
  rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
89
97
  var textNameProp = textName || name + '__text';
90
98
 
91
99
  var loadData = /*#__PURE__*/function () {
92
100
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
93
- var current, pageSize, rest, data, result;
101
+ var current, pageSize, rest, data, _tableRef$current, _tableRef$current$cle, result, rows;
102
+
94
103
  return _regenerator.default.wrap(function _callee$(_context) {
95
104
  while (1) {
96
105
  switch (_context.prev = _context.next) {
97
106
  case 0:
98
107
  current = param.current, pageSize = param.pageSize, rest = (0, _objectWithoutProperties2.default)(param, _excluded2);
99
- data = {
100
- page: current,
101
- pageSize: pageSize
102
- };
108
+ data = {};
109
+
110
+ if (isV2) {
111
+ data['page.pn'] = current;
112
+ data['page.size'] = pageSize;
113
+ } else {
114
+ data.page = current;
115
+ data.pageSize = pageSize;
116
+ }
117
+
118
+ ;
103
119
 
104
- if (Object.keys(rest).length) {
120
+ if (Object.keys(rest).length && !isV2) {
105
121
  data.where = rest;
106
122
  }
107
123
 
108
- _context.next = 5;
124
+ if (!keepSelect) {
125
+ setSelectedRows([]);
126
+ (_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);
127
+ }
128
+
129
+ if (beforeLoad) {
130
+ beforeLoad(data);
131
+ }
132
+
133
+ ;
134
+ _context.next = 10;
109
135
  return (0, _http.httpGet)(url, data);
110
136
 
111
- case 5:
137
+ case 10:
112
138
  result = _context.sent;
139
+ rows = result.rows || [];
140
+
141
+ if (afterLoad) {
142
+ afterLoad(rows);
143
+ }
144
+
113
145
  return _context.abrupt("return", {
114
- data: result.rows || [],
146
+ data: rows,
115
147
  total: result.total || 0,
116
148
  success: true
117
149
  });
118
150
 
119
- case 7:
151
+ case 14:
120
152
  case "end":
121
153
  return _context.stop();
122
154
  }
@@ -133,10 +165,10 @@ function InputTable(prop) {
133
165
  var _formRef$current;
134
166
 
135
167
  var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
136
- var txt = formValue[textName || name];
137
168
 
138
- if (txt) {
139
- setText(txt);
169
+ if (!textName && formValue[name]) {
170
+ formValue[textNameProp] = formValue[name];
171
+ formRef === null || formRef === void 0 ? void 0 : formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
140
172
  }
141
173
  }, []);
142
174
 
@@ -175,12 +207,9 @@ function InputTable(prop) {
175
207
 
176
208
  var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
177
209
  formValue[name] = record[valueField];
178
- setText(record[textField || valueField]); // 如果需要接收名称(指定了名称属性名),则反回名称
179
-
180
- if (textName) {
181
- formValue[textNameProp] = record[textField || valueField];
182
- }
183
-
210
+ var txt = record[textField || valueField];
211
+ formValue[textNameProp] = txt;
212
+ setText(txt);
184
213
  (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldsValue((0, _objectSpread2.default)({}, formValue));
185
214
  setVisible(false);
186
215
  onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(record);
@@ -190,25 +219,19 @@ function InputTable(prop) {
190
219
  toolBarRender: function toolBarRender() {
191
220
  return [/*#__PURE__*/_react.default.createElement(_button.default, {
192
221
  onClick: function onClick() {
193
- if (selectedRows.length) {
194
- var _formRef$current4, _formRef$current5;
195
-
196
- var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
197
- formValue[name] = selectedRows.map(function (o) {
198
- return o[valueField];
199
- }).join(',');
200
- var txt = selectedRows.map(function (o) {
201
- return o[textField || valueField];
202
- }).join(',');
203
- setText(txt); // 如果需要接收名称,则反回名称
204
-
205
- if (textName) {
206
- formValue[textNameProp] = txt;
207
- }
208
-
209
- (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue((0, _objectSpread2.default)({}, formValue));
210
- }
211
-
222
+ var _formRef$current4, _formRef$current5;
223
+
224
+ var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
225
+ formValue[name] = selectedRows.map(function (o) {
226
+ return o[valueField];
227
+ }).join(',');
228
+ var txt = selectedRows.map(function (o) {
229
+ return o[textField || valueField];
230
+ }).join(',');
231
+ formValue[textNameProp] = txt;
232
+ setText(txt);
233
+ (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue((0, _objectSpread2.default)({}, formValue));
234
+ onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(selectedRows);
212
235
  setVisible(false);
213
236
  }
214
237
  }, "\u786E\u8BA4")];
@@ -222,7 +245,7 @@ function InputTable(prop) {
222
245
  }
223
246
  }, /*#__PURE__*/_react.default.createElement(_lsProForm.ProFormText, {
224
247
  name: name
225
- })), /*#__PURE__*/_react.default.createElement(_lsProForm.ProFormText, (0, _extends2.default)({
248
+ })), rest.label ? /*#__PURE__*/_react.default.createElement(_lsProForm.ProFormText, (0, _extends2.default)({
226
249
  name: textNameProp
227
250
  }, rest), /*#__PURE__*/_react.default.createElement(_input.default, {
228
251
  suffix: /*#__PURE__*/_react.default.createElement(_popover.default, {
@@ -245,12 +268,66 @@ function InputTable(prop) {
245
268
  var _formRef$current6;
246
269
 
247
270
  var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.getFieldsValue();
248
- formValue[name] = e.target.value;
271
+ var val = e.target.value;
272
+ formValue[name] = val;
273
+ formValue[textNameProp] = val;
274
+ formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
275
+ },
276
+ onChange: function onChange(e) {
277
+ if (!e.target.value) {
278
+ var _formRef$current7;
279
+
280
+ var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.getFieldsValue();
281
+ formValue[name] = '';
282
+ formValue[textNameProp] = '';
283
+ formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
284
+ }
285
+ },
286
+ readOnly: readonly,
287
+ allowClear: allowClear
288
+ })) : /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({
289
+ suffix: /*#__PURE__*/_react.default.createElement(_popover.default, {
290
+ content: /*#__PURE__*/_react.default.createElement("div", {
291
+ style: {
292
+ width: tableWidth + 'px',
293
+ height: tableHeight + 'px',
294
+ maxHeight: '95vh',
295
+ overflow: 'auto'
296
+ }
297
+ }, tableDom),
298
+ trigger: "click",
299
+ visible: visible,
300
+ onVisibleChange: setVisible
301
+ }, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, null)),
302
+ onClick: function onClick() {
303
+ return setVisible(true);
304
+ },
305
+ onInput: function onInput(e) {
306
+ var _formRef$current8;
307
+
308
+ var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.getFieldsValue();
309
+ var val = e.target.value;
310
+ formValue[name] = val;
311
+ formValue[textNameProp] = val;
312
+ setText(val);
249
313
  formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
250
314
  },
315
+ onChange: function onChange(e) {
316
+ //用于清除当前组件值
317
+ if (!e.target.value) {
318
+ var _formRef$current9;
319
+
320
+ setText('');
321
+ var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.getFieldsValue();
322
+ formValue[name] = '';
323
+ formValue[textNameProp] = '';
324
+ formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
325
+ }
326
+ },
251
327
  readOnly: readonly,
252
- value: text
253
- })));
328
+ value: text,
329
+ allowClear: allowClear
330
+ }, rest === null || rest === void 0 ? void 0 : rest.fieldProps)));
254
331
  }
255
332
 
256
333
  var _default = InputTable;