wargerm 0.3.16 → 0.3.19

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);
@@ -6628,6 +6628,7 @@ var TreeSelect = function TreeSelect(_ref) {
6628
6628
  }, []);
6629
6629
  return /*#__PURE__*/React.createElement(_TreeSelect, _objectSpread2({
6630
6630
  showSearch: true,
6631
+ treeNodeFilterProp: "title",
6631
6632
  treeDefaultExpandAll: true
6632
6633
  }, props), !props.children ? renderTree(treeData) : props.children);
6633
6634
  };
@@ -10038,7 +10039,7 @@ var ModalForm = function ModalForm(props, ref) {
10038
10039
 
10039
10040
  useImperativeHandle(ref, function () {
10040
10041
  return {
10041
- formRef: formRef,
10042
+ formRef: formRef.current,
10042
10043
  onSubmit: onSubmit
10043
10044
  };
10044
10045
  });
@@ -10134,8 +10135,7 @@ var ModalForm = function ModalForm(props, ref) {
10134
10135
 
10135
10136
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10136
10137
 
10137
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"],
10138
- _excluded2$3 = ["actionMethod"];
10138
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
10139
10139
 
10140
10140
  var TabelCard = function TabelCard(props, ref) {
10141
10141
  var columns = props.columns,
@@ -10154,7 +10154,8 @@ var TabelCard = function TabelCard(props, ref) {
10154
10154
  extraProps = _objectWithoutProperties(props, _excluded$h);
10155
10155
 
10156
10156
  var actionRef = useRef();
10157
- var formRef = useRef(null);
10157
+ var modalFormRef = useRef(null);
10158
+ var searchFormRef = useRef(null);
10158
10159
 
10159
10160
  var _useState = useState(false),
10160
10161
  _useState2 = _slicedToArray(_useState, 2),
@@ -10174,7 +10175,8 @@ var TabelCard = function TabelCard(props, ref) {
10174
10175
  useImperativeHandle(ref, function () {
10175
10176
  return {
10176
10177
  actionRef: actionRef.current,
10177
- formRef: formRef.current
10178
+ modalFormRef: modalFormRef.current,
10179
+ searchFormRef: searchFormRef.current
10178
10180
  };
10179
10181
  });
10180
10182
 
@@ -10318,67 +10320,6 @@ var TabelCard = function TabelCard(props, ref) {
10318
10320
  }
10319
10321
  }, _callee4);
10320
10322
  })), index);
10321
- },
10322
- more: function more(item, record, index) {
10323
- var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
10324
- var btn = actionConfig[b.key];
10325
-
10326
- if (btn) {
10327
- b.name = btn.title;
10328
- b.icon = btn.icon;
10329
- }
10330
-
10331
- return b;
10332
- });
10333
-
10334
- var selectHandler = function selectHandler(key, item, record, index) {
10335
- var _item$actionMethod;
10336
-
10337
- if (key == 'more') {
10338
- // No more recursion
10339
- return;
10340
- }
10341
-
10342
- var customMenu = menus.find(function (m) {
10343
- return m.key === key;
10344
- });
10345
-
10346
- var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
10347
- type: key
10348
- });
10349
-
10350
- var handler = actionHandler[key];
10351
-
10352
- if (handler) {
10353
- return handler(_item, record, index);
10354
- }
10355
-
10356
- return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
10357
- var _actionRef$current4;
10358
-
10359
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10360
- });
10361
- };
10362
-
10363
- var m = _toConsumableArray(menus).map(function (e) {
10364
- if (!('actionMethod' in e)) {
10365
- return e;
10366
- }
10367
-
10368
- var actionMethod = e.actionMethod,
10369
- b = _objectWithoutProperties(e, _excluded2$3);
10370
-
10371
- return _objectSpread2({}, b);
10372
- });
10373
-
10374
- return /*#__PURE__*/React.createElement(TableDropdown, {
10375
- key: "actionGroup",
10376
- children: /*#__PURE__*/React.createElement(MoreOutlined, null),
10377
- menus: m,
10378
- onSelect: function onSelect(key) {
10379
- return selectHandler(key, item, record, index);
10380
- }
10381
- });
10382
10323
  }
10383
10324
  };
10384
10325
  var actionConfig = {
@@ -10400,27 +10341,86 @@ var TabelCard = function TabelCard(props, ref) {
10400
10341
  };
10401
10342
 
10402
10343
  var tableActionDom = function tableActionDom(record, index) {
10403
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item) {
10404
- var _actionHandler$item$t2;
10344
+ var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10405
10345
 
10406
- 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;
10407
10351
 
10408
- if (btn) {
10409
- return /*#__PURE__*/React.createElement(_Tooltip, {
10410
- title: btn.title,
10411
- key: btn.key
10412
- }, /*#__PURE__*/React.createElement("a", {
10413
- key: btn.key,
10414
- onClick: function onClick() {
10415
- var _actionHandler$item$t;
10352
+ var btn = actionConfig[item.type];
10416
10353
 
10417
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10418
- }
10419
- }, btn.icon, " ", btn.title));
10420
- }
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
+ }
10421
10366
 
10422
- return (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index);
10423
- });
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
+ }
10424
10424
  };
10425
10425
 
10426
10426
  var tableBarDom = useMemo(function () {
@@ -10449,10 +10449,10 @@ var TabelCard = function TabelCard(props, ref) {
10449
10449
 
10450
10450
  _context5.next = 3;
10451
10451
  return item.actionMethod(values, function () {
10452
- var _actionRef$current5;
10452
+ var _actionRef$current4;
10453
10453
 
10454
10454
  loading();
10455
- 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();
10456
10456
  });
10457
10457
 
10458
10458
  case 3:
@@ -10477,9 +10477,9 @@ var TabelCard = function TabelCard(props, ref) {
10477
10477
 
10478
10478
  return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
10479
10479
  item.actionMethod && item.actionMethod(actionRef, function () {
10480
- var _actionRef$current6;
10480
+ var _actionRef$current5;
10481
10481
 
10482
- 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();
10483
10483
  });
10484
10484
  });
10485
10485
  }
@@ -10487,22 +10487,22 @@ var TabelCard = function TabelCard(props, ref) {
10487
10487
  }, [actionRef]);
10488
10488
 
10489
10489
  var onSubmit = function onSubmit(values) {
10490
- var _actionRef$current7;
10490
+ var _actionRef$current6;
10491
10491
 
10492
10492
  setFormSearch(values);
10493
- 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();
10494
10494
  };
10495
10495
 
10496
10496
  var onReset = function onReset() {
10497
- var _actionRef$current8;
10497
+ var _actionRef$current7;
10498
10498
 
10499
10499
  setFormSearch({});
10500
- 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();
10501
10501
  };
10502
10502
 
10503
10503
  var formSearchColumn = columns || [];
10504
10504
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10505
- ref: formRef,
10505
+ ref: modalFormRef,
10506
10506
  title: modalFormConfig.type || '新增',
10507
10507
  visible: visible,
10508
10508
  record: modalFormConfig.record,
@@ -10556,8 +10556,10 @@ var TabelCard = function TabelCard(props, ref) {
10556
10556
  return true;
10557
10557
  })
10558
10558
  })), /*#__PURE__*/React.createElement(WForm$1, {
10559
- ref: ref,
10560
- search: _objectSpread2(_objectSpread2({
10559
+ ref: searchFormRef,
10560
+ search: search == false ? {
10561
+ hideSubmit: true
10562
+ } : _objectSpread2(_objectSpread2({
10561
10563
  labelWidth: 'auto',
10562
10564
  searchText: '查询',
10563
10565
  span: 6
package/dist/index.js CHANGED
@@ -6662,6 +6662,7 @@ var TreeSelect = function TreeSelect(_ref) {
6662
6662
  }, []);
6663
6663
  return /*#__PURE__*/React__default['default'].createElement(_TreeSelect__default['default'], _objectSpread2({
6664
6664
  showSearch: true,
6665
+ treeNodeFilterProp: "title",
6665
6666
  treeDefaultExpandAll: true
6666
6667
  }, props), !props.children ? renderTree(treeData) : props.children);
6667
6668
  };
@@ -10072,7 +10073,7 @@ var ModalForm = function ModalForm(props, ref) {
10072
10073
 
10073
10074
  React.useImperativeHandle(ref, function () {
10074
10075
  return {
10075
- formRef: formRef,
10076
+ formRef: formRef.current,
10076
10077
  onSubmit: onSubmit
10077
10078
  };
10078
10079
  });
@@ -10168,8 +10169,7 @@ var ModalForm = function ModalForm(props, ref) {
10168
10169
 
10169
10170
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
10170
10171
 
10171
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"],
10172
- _excluded2$3 = ["actionMethod"];
10172
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
10173
10173
 
10174
10174
  var TabelCard = function TabelCard(props, ref) {
10175
10175
  var columns = props.columns,
@@ -10188,7 +10188,8 @@ var TabelCard = function TabelCard(props, ref) {
10188
10188
  extraProps = _objectWithoutProperties(props, _excluded$h);
10189
10189
 
10190
10190
  var actionRef = React.useRef();
10191
- var formRef = React.useRef(null);
10191
+ var modalFormRef = React.useRef(null);
10192
+ var searchFormRef = React.useRef(null);
10192
10193
 
10193
10194
  var _useState = React.useState(false),
10194
10195
  _useState2 = _slicedToArray(_useState, 2),
@@ -10208,7 +10209,8 @@ var TabelCard = function TabelCard(props, ref) {
10208
10209
  React.useImperativeHandle(ref, function () {
10209
10210
  return {
10210
10211
  actionRef: actionRef.current,
10211
- formRef: formRef.current
10212
+ modalFormRef: modalFormRef.current,
10213
+ searchFormRef: searchFormRef.current
10212
10214
  };
10213
10215
  });
10214
10216
 
@@ -10352,67 +10354,6 @@ var TabelCard = function TabelCard(props, ref) {
10352
10354
  }
10353
10355
  }, _callee4);
10354
10356
  })), index);
10355
- },
10356
- more: function more(item, record, index) {
10357
- var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
10358
- var btn = actionConfig[b.key];
10359
-
10360
- if (btn) {
10361
- b.name = btn.title;
10362
- b.icon = btn.icon;
10363
- }
10364
-
10365
- return b;
10366
- });
10367
-
10368
- var selectHandler = function selectHandler(key, item, record, index) {
10369
- var _item$actionMethod;
10370
-
10371
- if (key == 'more') {
10372
- // No more recursion
10373
- return;
10374
- }
10375
-
10376
- var customMenu = menus.find(function (m) {
10377
- return m.key === key;
10378
- });
10379
-
10380
- var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
10381
- type: key
10382
- });
10383
-
10384
- var handler = actionHandler[key];
10385
-
10386
- if (handler) {
10387
- return handler(_item, record, index);
10388
- }
10389
-
10390
- return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
10391
- var _actionRef$current4;
10392
-
10393
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
10394
- });
10395
- };
10396
-
10397
- var m = _toConsumableArray(menus).map(function (e) {
10398
- if (!('actionMethod' in e)) {
10399
- return e;
10400
- }
10401
-
10402
- var actionMethod = e.actionMethod,
10403
- b = _objectWithoutProperties(e, _excluded2$3);
10404
-
10405
- return _objectSpread2({}, b);
10406
- });
10407
-
10408
- return /*#__PURE__*/React__default['default'].createElement(ProTable.TableDropdown, {
10409
- key: "actionGroup",
10410
- children: /*#__PURE__*/React__default['default'].createElement(icons.MoreOutlined, null),
10411
- menus: m,
10412
- onSelect: function onSelect(key) {
10413
- return selectHandler(key, item, record, index);
10414
- }
10415
- });
10416
10357
  }
10417
10358
  };
10418
10359
  var actionConfig = {
@@ -10434,27 +10375,86 @@ var TabelCard = function TabelCard(props, ref) {
10434
10375
  };
10435
10376
 
10436
10377
  var tableActionDom = function tableActionDom(record, index) {
10437
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item) {
10438
- var _actionHandler$item$t2;
10378
+ var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10439
10379
 
10440
- 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;
10441
10385
 
10442
- if (btn) {
10443
- return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
10444
- title: btn.title,
10445
- key: btn.key
10446
- }, /*#__PURE__*/React__default['default'].createElement("a", {
10447
- key: btn.key,
10448
- onClick: function onClick() {
10449
- var _actionHandler$item$t;
10386
+ var btn = actionConfig[item.type];
10450
10387
 
10451
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10452
- }
10453
- }, btn.icon, " ", btn.title));
10454
- }
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
+ }
10455
10400
 
10456
- return (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index);
10457
- });
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
+ }
10458
10458
  };
10459
10459
 
10460
10460
  var tableBarDom = React.useMemo(function () {
@@ -10483,10 +10483,10 @@ var TabelCard = function TabelCard(props, ref) {
10483
10483
 
10484
10484
  _context5.next = 3;
10485
10485
  return item.actionMethod(values, function () {
10486
- var _actionRef$current5;
10486
+ var _actionRef$current4;
10487
10487
 
10488
10488
  loading();
10489
- 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();
10490
10490
  });
10491
10491
 
10492
10492
  case 3:
@@ -10511,9 +10511,9 @@ var TabelCard = function TabelCard(props, ref) {
10511
10511
 
10512
10512
  return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
10513
10513
  item.actionMethod && item.actionMethod(actionRef, function () {
10514
- var _actionRef$current6;
10514
+ var _actionRef$current5;
10515
10515
 
10516
- 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();
10517
10517
  });
10518
10518
  });
10519
10519
  }
@@ -10521,22 +10521,22 @@ var TabelCard = function TabelCard(props, ref) {
10521
10521
  }, [actionRef]);
10522
10522
 
10523
10523
  var onSubmit = function onSubmit(values) {
10524
- var _actionRef$current7;
10524
+ var _actionRef$current6;
10525
10525
 
10526
10526
  setFormSearch(values);
10527
- 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();
10528
10528
  };
10529
10529
 
10530
10530
  var onReset = function onReset() {
10531
- var _actionRef$current8;
10531
+ var _actionRef$current7;
10532
10532
 
10533
10533
  setFormSearch({});
10534
- 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();
10535
10535
  };
10536
10536
 
10537
10537
  var formSearchColumn = columns || [];
10538
10538
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10539
- ref: formRef,
10539
+ ref: modalFormRef,
10540
10540
  title: modalFormConfig.type || '新增',
10541
10541
  visible: visible,
10542
10542
  record: modalFormConfig.record,
@@ -10590,8 +10590,10 @@ var TabelCard = function TabelCard(props, ref) {
10590
10590
  return true;
10591
10591
  })
10592
10592
  })), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
10593
- ref: ref,
10594
- search: _objectSpread2(_objectSpread2({
10593
+ ref: searchFormRef,
10594
+ search: search == false ? {
10595
+ hideSubmit: true
10596
+ } : _objectSpread2(_objectSpread2({
10595
10597
  labelWidth: 'auto',
10596
10598
  searchText: '查询',
10597
10599
  span: 6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.16",
4
+ "version": "0.3.19",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",
@@ -76,4 +76,4 @@
76
76
  "react": "^16.12.0",
77
77
  "yorkie": "^2.0.0"
78
78
  }
79
- }
79
+ }