@pisell/materials 1.0.413 → 1.0.414

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.
@@ -70,10 +70,13 @@ export var batchExport = function batchExport(exportParams, exportImport) {
70
70
  // 所有记录
71
71
  if (type === "all-records") {
72
72
  _name = "".concat(getText("table-action-export-import-all-records")).concat(_name);
73
- var _lists = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.originDataSource) || [];
74
- params.ids = _lists.map(function (item) {
75
- return (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id);
76
- });
73
+ // 表单则直接导出
74
+ if (otherParams !== null && otherParams !== void 0 && otherParams.form_id || otherParams !== null && otherParams !== void 0 && otherParams.code) {
75
+ var _lists = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.originDataSource) || [];
76
+ params.ids = _lists.map(function (item) {
77
+ return (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id);
78
+ });
79
+ }
77
80
  params.file_name = _name;
78
81
  }
79
82
 
@@ -83,5 +86,12 @@ export var batchExport = function batchExport(exportParams, exportImport) {
83
86
  params.ids = selectLists || [];
84
87
  params.file_name = _name;
85
88
  }
89
+
90
+ // 不是所有记录则删除对应的参数
91
+ if (type !== 'all-records') {
92
+ params === null || params === void 0 ? true : delete params.shipping_status;
93
+ params === null || params === void 0 ? true : delete params.payment_status;
94
+ params === null || params === void 0 ? true : delete params.status;
95
+ }
86
96
  return _batchExport(params);
87
97
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export var formatApiUrl = function formatApiUrl(url) {
10
+ return url || '/shop/form/data';
11
+ };
@@ -54,8 +54,10 @@ var batchExport = (exportParams, exportImport) => {
54
54
  }
55
55
  if (type === "all-records") {
56
56
  _name = `${(0, import_locales.getText)("table-action-export-import-all-records")}${_name}`;
57
- const lists = (exportParams == null ? void 0 : exportParams.originDataSource) || [];
58
- params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id));
57
+ if ((otherParams == null ? void 0 : otherParams.form_id) || (otherParams == null ? void 0 : otherParams.code)) {
58
+ const lists = (exportParams == null ? void 0 : exportParams.originDataSource) || [];
59
+ params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id));
60
+ }
59
61
  params.file_name = _name;
60
62
  }
61
63
  if (type === "selected-records") {
@@ -65,6 +67,11 @@ var batchExport = (exportParams, exportImport) => {
65
67
  params.ids = selectLists || [];
66
68
  params.file_name = _name;
67
69
  }
70
+ if (type !== "all-records") {
71
+ params == null ? true : delete params.shipping_status;
72
+ params == null ? true : delete params.payment_status;
73
+ params == null ? true : delete params.status;
74
+ }
68
75
  return _batchExport(params);
69
76
  };
70
77
  // Annotate the CommonJS export names for ESM import in node:
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,31 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/table/Actions/component/ExportImport/utils/index.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ formatApiUrl: () => formatApiUrl
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var formatApiUrl = (url) => {
26
+ return url || "/shop/form/data";
27
+ };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ formatApiUrl
31
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.413",
3
+ "version": "1.0.414",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",