wargerm 0.3.17 → 0.3.18

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/index.esm.js CHANGED
@@ -5,7 +5,7 @@ import _Dropdown from 'antd/es/dropdown';
5
5
  import 'antd/es/menu/style';
6
6
  import _Menu from 'antd/es/menu';
7
7
  import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
8
- import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, ExclamationCircleOutlined, MoreOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
8
+ import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
11
11
  import 'antd/es/input-number/style';
@@ -46,7 +46,7 @@ import _Breadcrumb from 'antd/es/breadcrumb';
46
46
  import ReactDOM from 'react-dom';
47
47
  import 'antd/es/modal/style';
48
48
  import _Modal from 'antd/es/modal';
49
- import ProTable, { TableDropdown } from '@ant-design/pro-table';
49
+ import ProTable from '@ant-design/pro-table';
50
50
 
51
51
  function ownKeys(object, enumerableOnly) {
52
52
  var keys = Object.keys(object);
@@ -10039,7 +10039,7 @@ var ModalForm = function ModalForm(props, ref) {
10039
10039
 
10040
10040
  useImperativeHandle(ref, function () {
10041
10041
  return {
10042
- formRef: formRef,
10042
+ formRef: formRef.current,
10043
10043
  onSubmit: onSubmit
10044
10044
  };
10045
10045
  });
@@ -10135,8 +10135,7 @@ var ModalForm = function ModalForm(props, ref) {
10135
10135
 
10136
10136
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10137
10137
 
10138
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"],
10139
- _excluded2$3 = ["actionMethod"];
10138
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
10140
10139
 
10141
10140
  var TabelCard = function TabelCard(props, ref) {
10142
10141
  var columns = props.columns,
@@ -10155,7 +10154,8 @@ var TabelCard = function TabelCard(props, ref) {
10155
10154
  extraProps = _objectWithoutProperties(props, _excluded$h);
10156
10155
 
10157
10156
  var actionRef = useRef();
10158
- var formRef = useRef(null);
10157
+ var modalFormRef = useRef(null);
10158
+ var searchFormRef = useRef(null);
10159
10159
 
10160
10160
  var _useState = useState(false),
10161
10161
  _useState2 = _slicedToArray(_useState, 2),
@@ -10175,7 +10175,8 @@ var TabelCard = function TabelCard(props, ref) {
10175
10175
  useImperativeHandle(ref, function () {
10176
10176
  return {
10177
10177
  actionRef: actionRef.current,
10178
- formRef: formRef.current
10178
+ modalFormRef: modalFormRef.current,
10179
+ searchFormRef: searchFormRef.current
10179
10180
  };
10180
10181
  });
10181
10182
 
@@ -10319,67 +10320,6 @@ var TabelCard = function TabelCard(props, ref) {
10319
10320
  }
10320
10321
  }, _callee4);
10321
10322
  })), index);
10322
- },
10323
- more: function more(item, record, index) {
10324
- var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
10325
- var btn = actionConfig[b.key];
10326
-
10327
- if (btn) {
10328
- b.name = btn.title;
10329
- b.icon = btn.icon;
10330
- }
10331
-
10332
- return b;
10333
- });
10334
-
10335
- var selectHandler = function selectHandler(key, item, record, index) {
10336
- var _item$actionMethod;
10337
-
10338
- if (key == 'more') {
10339
- // No more recursion
10340
- return;
10341
- }
10342
-
10343
- var customMenu = menus.find(function (m) {
10344
- return m.key === key;
10345
- });
10346
-
10347
- var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
10348
- type: key
10349
- });
10350
-
10351
- var handler = actionHandler[key];
10352
-
10353
- if (handler) {
10354
- return handler(_item, record, index);
10355
- }
10356
-
10357
- return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
10358
- var _actionRef$current4;
10359
-
10360
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10361
- });
10362
- };
10363
-
10364
- var m = _toConsumableArray(menus).map(function (e) {
10365
- if (!('actionMethod' in e)) {
10366
- return e;
10367
- }
10368
-
10369
- var actionMethod = e.actionMethod,
10370
- b = _objectWithoutProperties(e, _excluded2$3);
10371
-
10372
- return _objectSpread2({}, b);
10373
- });
10374
-
10375
- return /*#__PURE__*/React.createElement(TableDropdown, {
10376
- key: "actionGroup",
10377
- children: /*#__PURE__*/React.createElement(MoreOutlined, null),
10378
- menus: m,
10379
- onSelect: function onSelect(key) {
10380
- return selectHandler(key, item, record, index);
10381
- }
10382
- });
10383
10323
  }
10384
10324
  };
10385
10325
  var actionConfig = {
@@ -10401,27 +10341,86 @@ var TabelCard = function TabelCard(props, ref) {
10401
10341
  };
10402
10342
 
10403
10343
  var tableActionDom = function tableActionDom(record, index) {
10404
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item) {
10405
- var _actionHandler$item$t2;
10344
+ var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10406
10345
 
10407
- var btn = actionConfig[item.type];
10346
+ if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10347
+ var tableAction1 = tableAction.slice(0, showMoreNum);
10348
+ var tableAction2 = tableAction.slice(showMoreNum);
10349
+ var menu = /*#__PURE__*/React.createElement(_Menu, null, tableAction2.map(function (item, i) {
10350
+ var _actionHandler$item$t2;
10408
10351
 
10409
- if (btn) {
10410
- return /*#__PURE__*/React.createElement(_Tooltip, {
10411
- title: btn.title,
10412
- key: btn.key
10413
- }, /*#__PURE__*/React.createElement("a", {
10414
- key: btn.key,
10415
- onClick: function onClick() {
10416
- var _actionHandler$item$t;
10352
+ var btn = actionConfig[item.type];
10417
10353
 
10418
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10419
- }
10420
- }, btn.icon, " ", btn.title));
10421
- }
10354
+ if (btn) {
10355
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
10356
+ key: i
10357
+ }, /*#__PURE__*/React.createElement("a", {
10358
+ key: btn.key,
10359
+ onClick: function onClick() {
10360
+ var _actionHandler$item$t;
10361
+
10362
+ return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10363
+ }
10364
+ }, btn.icon, " ", btn.title));
10365
+ }
10422
10366
 
10423
- return (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index);
10424
- });
10367
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
10368
+ key: i
10369
+ }, (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index));
10370
+ }));
10371
+ return [].concat(_toConsumableArray(tableAction1.map(function (item, i) {
10372
+ var _actionHandler$item$t4;
10373
+
10374
+ var btn = actionConfig[item.type];
10375
+
10376
+ if (btn) {
10377
+ return /*#__PURE__*/React.createElement(_Tooltip, {
10378
+ title: btn.title,
10379
+ key: i
10380
+ }, /*#__PURE__*/React.createElement("a", {
10381
+ key: btn.key,
10382
+ onClick: function onClick() {
10383
+ var _actionHandler$item$t3;
10384
+
10385
+ return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
10386
+ }
10387
+ }, btn.icon, " ", btn.title));
10388
+ }
10389
+
10390
+ return /*#__PURE__*/React.createElement("span", {
10391
+ key: i
10392
+ }, (_actionHandler$item$t4 = actionHandler[item.type]) === null || _actionHandler$item$t4 === void 0 ? void 0 : _actionHandler$item$t4.call(actionHandler, item, record, index));
10393
+ })), [/*#__PURE__*/React.createElement(_Dropdown, {
10394
+ overlay: menu,
10395
+ key: 'more'
10396
+ }, /*#__PURE__*/React.createElement("a", {
10397
+ key: "more"
10398
+ }, /*#__PURE__*/React.createElement(EllipsisOutlined, null)))]);
10399
+ } else {
10400
+ return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
10401
+ var _actionHandler$item$t6;
10402
+
10403
+ var btn = actionConfig[item.type];
10404
+
10405
+ if (btn) {
10406
+ return /*#__PURE__*/React.createElement(_Tooltip, {
10407
+ title: btn.title,
10408
+ key: i
10409
+ }, /*#__PURE__*/React.createElement("a", {
10410
+ key: btn.key,
10411
+ onClick: function onClick() {
10412
+ var _actionHandler$item$t5;
10413
+
10414
+ return (_actionHandler$item$t5 = actionHandler[item.type]) === null || _actionHandler$item$t5 === void 0 ? void 0 : _actionHandler$item$t5.call(actionHandler, item, record, index);
10415
+ }
10416
+ }, btn.icon, " ", btn.title));
10417
+ }
10418
+
10419
+ return /*#__PURE__*/React.createElement("span", {
10420
+ key: i
10421
+ }, (_actionHandler$item$t6 = actionHandler[item.type]) === null || _actionHandler$item$t6 === void 0 ? void 0 : _actionHandler$item$t6.call(actionHandler, item, record, index));
10422
+ });
10423
+ }
10425
10424
  };
10426
10425
 
10427
10426
  var tableBarDom = useMemo(function () {
@@ -10450,10 +10449,10 @@ var TabelCard = function TabelCard(props, ref) {
10450
10449
 
10451
10450
  _context5.next = 3;
10452
10451
  return item.actionMethod(values, function () {
10453
- var _actionRef$current5;
10452
+ var _actionRef$current4;
10454
10453
 
10455
10454
  loading();
10456
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
10455
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10457
10456
  });
10458
10457
 
10459
10458
  case 3:
@@ -10478,9 +10477,9 @@ var TabelCard = function TabelCard(props, ref) {
10478
10477
 
10479
10478
  return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
10480
10479
  item.actionMethod && item.actionMethod(actionRef, function () {
10481
- var _actionRef$current6;
10480
+ var _actionRef$current5;
10482
10481
 
10483
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
10482
+ return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
10484
10483
  });
10485
10484
  });
10486
10485
  }
@@ -10488,22 +10487,22 @@ var TabelCard = function TabelCard(props, ref) {
10488
10487
  }, [actionRef]);
10489
10488
 
10490
10489
  var onSubmit = function onSubmit(values) {
10491
- var _actionRef$current7;
10490
+ var _actionRef$current6;
10492
10491
 
10493
10492
  setFormSearch(values);
10494
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10493
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
10495
10494
  };
10496
10495
 
10497
10496
  var onReset = function onReset() {
10498
- var _actionRef$current8;
10497
+ var _actionRef$current7;
10499
10498
 
10500
10499
  setFormSearch({});
10501
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload();
10500
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10502
10501
  };
10503
10502
 
10504
10503
  var formSearchColumn = columns || [];
10505
10504
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10506
- ref: formRef,
10505
+ ref: modalFormRef,
10507
10506
  title: modalFormConfig.type || '新增',
10508
10507
  visible: visible,
10509
10508
  record: modalFormConfig.record,
@@ -10557,7 +10556,7 @@ var TabelCard = function TabelCard(props, ref) {
10557
10556
  return true;
10558
10557
  })
10559
10558
  })), /*#__PURE__*/React.createElement(WForm$1, {
10560
- ref: ref,
10559
+ ref: searchFormRef,
10561
10560
  search: _objectSpread2(_objectSpread2({
10562
10561
  labelWidth: 'auto',
10563
10562
  searchText: '查询',
package/dist/index.js CHANGED
@@ -10073,7 +10073,7 @@ var ModalForm = function ModalForm(props, ref) {
10073
10073
 
10074
10074
  React.useImperativeHandle(ref, function () {
10075
10075
  return {
10076
- formRef: formRef,
10076
+ formRef: formRef.current,
10077
10077
  onSubmit: onSubmit
10078
10078
  };
10079
10079
  });
@@ -10169,8 +10169,7 @@ var ModalForm = function ModalForm(props, ref) {
10169
10169
 
10170
10170
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
10171
10171
 
10172
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"],
10173
- _excluded2$3 = ["actionMethod"];
10172
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
10174
10173
 
10175
10174
  var TabelCard = function TabelCard(props, ref) {
10176
10175
  var columns = props.columns,
@@ -10189,7 +10188,8 @@ var TabelCard = function TabelCard(props, ref) {
10189
10188
  extraProps = _objectWithoutProperties(props, _excluded$h);
10190
10189
 
10191
10190
  var actionRef = React.useRef();
10192
- var formRef = React.useRef(null);
10191
+ var modalFormRef = React.useRef(null);
10192
+ var searchFormRef = React.useRef(null);
10193
10193
 
10194
10194
  var _useState = React.useState(false),
10195
10195
  _useState2 = _slicedToArray(_useState, 2),
@@ -10209,7 +10209,8 @@ var TabelCard = function TabelCard(props, ref) {
10209
10209
  React.useImperativeHandle(ref, function () {
10210
10210
  return {
10211
10211
  actionRef: actionRef.current,
10212
- formRef: formRef.current
10212
+ modalFormRef: modalFormRef.current,
10213
+ searchFormRef: searchFormRef.current
10213
10214
  };
10214
10215
  });
10215
10216
 
@@ -10353,67 +10354,6 @@ var TabelCard = function TabelCard(props, ref) {
10353
10354
  }
10354
10355
  }, _callee4);
10355
10356
  })), index);
10356
- },
10357
- more: function more(item, record, index) {
10358
- var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
10359
- var btn = actionConfig[b.key];
10360
-
10361
- if (btn) {
10362
- b.name = btn.title;
10363
- b.icon = btn.icon;
10364
- }
10365
-
10366
- return b;
10367
- });
10368
-
10369
- var selectHandler = function selectHandler(key, item, record, index) {
10370
- var _item$actionMethod;
10371
-
10372
- if (key == 'more') {
10373
- // No more recursion
10374
- return;
10375
- }
10376
-
10377
- var customMenu = menus.find(function (m) {
10378
- return m.key === key;
10379
- });
10380
-
10381
- var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
10382
- type: key
10383
- });
10384
-
10385
- var handler = actionHandler[key];
10386
-
10387
- if (handler) {
10388
- return handler(_item, record, index);
10389
- }
10390
-
10391
- return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
10392
- var _actionRef$current4;
10393
-
10394
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10395
- });
10396
- };
10397
-
10398
- var m = _toConsumableArray(menus).map(function (e) {
10399
- if (!('actionMethod' in e)) {
10400
- return e;
10401
- }
10402
-
10403
- var actionMethod = e.actionMethod,
10404
- b = _objectWithoutProperties(e, _excluded2$3);
10405
-
10406
- return _objectSpread2({}, b);
10407
- });
10408
-
10409
- return /*#__PURE__*/React__default['default'].createElement(ProTable.TableDropdown, {
10410
- key: "actionGroup",
10411
- children: /*#__PURE__*/React__default['default'].createElement(icons.MoreOutlined, null),
10412
- menus: m,
10413
- onSelect: function onSelect(key) {
10414
- return selectHandler(key, item, record, index);
10415
- }
10416
- });
10417
10357
  }
10418
10358
  };
10419
10359
  var actionConfig = {
@@ -10435,27 +10375,86 @@ var TabelCard = function TabelCard(props, ref) {
10435
10375
  };
10436
10376
 
10437
10377
  var tableActionDom = function tableActionDom(record, index) {
10438
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item) {
10439
- var _actionHandler$item$t2;
10378
+ var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10440
10379
 
10441
- var btn = actionConfig[item.type];
10380
+ if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10381
+ var tableAction1 = tableAction.slice(0, showMoreNum);
10382
+ var tableAction2 = tableAction.slice(showMoreNum);
10383
+ var menu = /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'], null, tableAction2.map(function (item, i) {
10384
+ var _actionHandler$item$t2;
10442
10385
 
10443
- if (btn) {
10444
- return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
10445
- title: btn.title,
10446
- key: btn.key
10447
- }, /*#__PURE__*/React__default['default'].createElement("a", {
10448
- key: btn.key,
10449
- onClick: function onClick() {
10450
- var _actionHandler$item$t;
10386
+ var btn = actionConfig[item.type];
10451
10387
 
10452
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10453
- }
10454
- }, btn.icon, " ", btn.title));
10455
- }
10388
+ if (btn) {
10389
+ return /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'].Item, {
10390
+ key: i
10391
+ }, /*#__PURE__*/React__default['default'].createElement("a", {
10392
+ key: btn.key,
10393
+ onClick: function onClick() {
10394
+ var _actionHandler$item$t;
10395
+
10396
+ return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10397
+ }
10398
+ }, btn.icon, " ", btn.title));
10399
+ }
10456
10400
 
10457
- return (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index);
10458
- });
10401
+ return /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'].Item, {
10402
+ key: i
10403
+ }, (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index));
10404
+ }));
10405
+ return [].concat(_toConsumableArray(tableAction1.map(function (item, i) {
10406
+ var _actionHandler$item$t4;
10407
+
10408
+ var btn = actionConfig[item.type];
10409
+
10410
+ if (btn) {
10411
+ return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
10412
+ title: btn.title,
10413
+ key: i
10414
+ }, /*#__PURE__*/React__default['default'].createElement("a", {
10415
+ key: btn.key,
10416
+ onClick: function onClick() {
10417
+ var _actionHandler$item$t3;
10418
+
10419
+ return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
10420
+ }
10421
+ }, btn.icon, " ", btn.title));
10422
+ }
10423
+
10424
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10425
+ key: i
10426
+ }, (_actionHandler$item$t4 = actionHandler[item.type]) === null || _actionHandler$item$t4 === void 0 ? void 0 : _actionHandler$item$t4.call(actionHandler, item, record, index));
10427
+ })), [/*#__PURE__*/React__default['default'].createElement(_Dropdown__default['default'], {
10428
+ overlay: menu,
10429
+ key: 'more'
10430
+ }, /*#__PURE__*/React__default['default'].createElement("a", {
10431
+ key: "more"
10432
+ }, /*#__PURE__*/React__default['default'].createElement(icons.EllipsisOutlined, null)))]);
10433
+ } else {
10434
+ return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
10435
+ var _actionHandler$item$t6;
10436
+
10437
+ var btn = actionConfig[item.type];
10438
+
10439
+ if (btn) {
10440
+ return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
10441
+ title: btn.title,
10442
+ key: i
10443
+ }, /*#__PURE__*/React__default['default'].createElement("a", {
10444
+ key: btn.key,
10445
+ onClick: function onClick() {
10446
+ var _actionHandler$item$t5;
10447
+
10448
+ return (_actionHandler$item$t5 = actionHandler[item.type]) === null || _actionHandler$item$t5 === void 0 ? void 0 : _actionHandler$item$t5.call(actionHandler, item, record, index);
10449
+ }
10450
+ }, btn.icon, " ", btn.title));
10451
+ }
10452
+
10453
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10454
+ key: i
10455
+ }, (_actionHandler$item$t6 = actionHandler[item.type]) === null || _actionHandler$item$t6 === void 0 ? void 0 : _actionHandler$item$t6.call(actionHandler, item, record, index));
10456
+ });
10457
+ }
10459
10458
  };
10460
10459
 
10461
10460
  var tableBarDom = React.useMemo(function () {
@@ -10484,10 +10483,10 @@ var TabelCard = function TabelCard(props, ref) {
10484
10483
 
10485
10484
  _context5.next = 3;
10486
10485
  return item.actionMethod(values, function () {
10487
- var _actionRef$current5;
10486
+ var _actionRef$current4;
10488
10487
 
10489
10488
  loading();
10490
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
10489
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10491
10490
  });
10492
10491
 
10493
10492
  case 3:
@@ -10512,9 +10511,9 @@ var TabelCard = function TabelCard(props, ref) {
10512
10511
 
10513
10512
  return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
10514
10513
  item.actionMethod && item.actionMethod(actionRef, function () {
10515
- var _actionRef$current6;
10514
+ var _actionRef$current5;
10516
10515
 
10517
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
10516
+ return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
10518
10517
  });
10519
10518
  });
10520
10519
  }
@@ -10522,22 +10521,22 @@ var TabelCard = function TabelCard(props, ref) {
10522
10521
  }, [actionRef]);
10523
10522
 
10524
10523
  var onSubmit = function onSubmit(values) {
10525
- var _actionRef$current7;
10524
+ var _actionRef$current6;
10526
10525
 
10527
10526
  setFormSearch(values);
10528
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10527
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
10529
10528
  };
10530
10529
 
10531
10530
  var onReset = function onReset() {
10532
- var _actionRef$current8;
10531
+ var _actionRef$current7;
10533
10532
 
10534
10533
  setFormSearch({});
10535
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload();
10534
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10536
10535
  };
10537
10536
 
10538
10537
  var formSearchColumn = columns || [];
10539
10538
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10540
- ref: formRef,
10539
+ ref: modalFormRef,
10541
10540
  title: modalFormConfig.type || '新增',
10542
10541
  visible: visible,
10543
10542
  record: modalFormConfig.record,
@@ -10591,7 +10590,7 @@ var TabelCard = function TabelCard(props, ref) {
10591
10590
  return true;
10592
10591
  })
10593
10592
  })), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
10594
- ref: ref,
10593
+ ref: searchFormRef,
10595
10594
  search: _objectSpread2(_objectSpread2({
10596
10595
  labelWidth: 'auto',
10597
10596
  searchText: '查询',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.17",
4
+ "version": "0.3.18",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",