ls-pro-common 1.0.22 → 1.0.23

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.
@@ -882,6 +882,28 @@ function useDtl(dtlParam) {
882
882
  }
883
883
  };
884
884
 
885
+ var onExport = function onExport() {
886
+ var _tableRef$current, _tableRef$current$sho;
887
+
888
+ if (!masterObject[mstKeyField]) {
889
+ showWarn('主表没保存,无法导出数据');
890
+ return;
891
+ }
892
+
893
+ tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$sho = _tableRef$current.showExport) === null || _tableRef$current$sho === void 0 ? void 0 : _tableRef$current$sho.call(_tableRef$current);
894
+ };
895
+
896
+ var onImport = function onImport() {
897
+ var _tableRef$current2, _tableRef$current2$sh;
898
+
899
+ if (!masterObject[mstKeyField]) {
900
+ showWarn('主表没保存,无法导入数据');
901
+ return;
902
+ }
903
+
904
+ 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);
905
+ };
906
+
885
907
  var tableTools = useMemo(function () {
886
908
  return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && !isAudit() ? /*#__PURE__*/React.createElement(_Button, {
887
909
  key: "add",
@@ -907,17 +929,13 @@ function useDtl(dtlParam) {
907
929
  }, "\u5220\u9664") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) ? /*#__PURE__*/React.createElement(_Button, {
908
930
  key: "import",
909
931
  onClick: function onClick() {
910
- var _tableRef$current, _tableRef$current$sho;
911
-
912
- tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$sho = _tableRef$current.showImport) === null || _tableRef$current$sho === void 0 ? void 0 : _tableRef$current$sho.call(_tableRef$current);
932
+ onImport();
913
933
  },
914
934
  icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
915
935
  }, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) ? /*#__PURE__*/React.createElement(_Button, {
916
936
  key: "export",
917
937
  onClick: function onClick() {
918
- var _tableRef$current2, _tableRef$current2$sh;
919
-
920
- tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showExport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
938
+ onExport();
921
939
  },
922
940
  icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
923
941
  }, "\u5BFC\u51FA") : false].filter(function (o) {
@@ -903,6 +903,28 @@ function useDtl(dtlParam) {
903
903
  }
904
904
  };
905
905
 
906
+ var onExport = function onExport() {
907
+ var _tableRef$current, _tableRef$current$sho;
908
+
909
+ if (!masterObject[mstKeyField]) {
910
+ (0, _utils.showWarn)('主表没保存,无法导出数据');
911
+ return;
912
+ }
913
+
914
+ tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$sho = _tableRef$current.showExport) === null || _tableRef$current$sho === void 0 ? void 0 : _tableRef$current$sho.call(_tableRef$current);
915
+ };
916
+
917
+ var onImport = function onImport() {
918
+ var _tableRef$current2, _tableRef$current2$sh;
919
+
920
+ if (!masterObject[mstKeyField]) {
921
+ (0, _utils.showWarn)('主表没保存,无法导入数据');
922
+ return;
923
+ }
924
+
925
+ 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);
926
+ };
927
+
906
928
  var tableTools = (0, _react.useMemo)(function () {
907
929
  return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && !isAudit() ? /*#__PURE__*/_react.default.createElement(_button.default, {
908
930
  key: "add",
@@ -928,17 +950,13 @@ function useDtl(dtlParam) {
928
950
  }, "\u5220\u9664") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) ? /*#__PURE__*/_react.default.createElement(_button.default, {
929
951
  key: "import",
930
952
  onClick: function onClick() {
931
- var _tableRef$current, _tableRef$current$sho;
932
-
933
- 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);
953
+ onImport();
934
954
  },
935
955
  icon: /*#__PURE__*/_react.default.createElement(_icons.ImportOutlined, null)
936
956
  }, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) ? /*#__PURE__*/_react.default.createElement(_button.default, {
937
957
  key: "export",
938
958
  onClick: function onClick() {
939
- var _tableRef$current2, _tableRef$current2$sh;
940
-
941
- 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);
959
+ onExport();
942
960
  },
943
961
  icon: /*#__PURE__*/_react.default.createElement(_icons.ExportOutlined, null)
944
962
  }, "\u5BFC\u51FA") : false].filter(function (o) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "ls-pro-common",
5
5
  "keywords": [
6
6
  "antd",