@pisell/materials 1.0.413 → 1.0.415

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
+ };
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
@@ -29,6 +29,13 @@ var formatApiParams = function formatApiParams(params, type) {
29
29
  var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
30
30
  var _params = _objectSpread({}, params);
31
31
  delete _params.url;
32
+
33
+ // 删除无用数据
34
+ if (type !== 'export') {
35
+ _params === null || _params === void 0 ? true : delete _params.shipping_status;
36
+ _params === null || _params === void 0 ? true : delete _params.payment_status;
37
+ _params === null || _params === void 0 ? true : delete _params.status;
38
+ }
32
39
  return {
33
40
  url: _url,
34
41
  params: _objectSpread({}, _params)
@@ -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
+ });
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
@@ -38,6 +38,11 @@ var formatApiParams = (params, type) => {
38
38
  const _url = (params == null ? void 0 : params.url) || (defaultUrl == null ? void 0 : defaultUrl[type]);
39
39
  let _params = { ...params };
40
40
  delete _params.url;
41
+ if (type !== "export") {
42
+ _params == null ? true : delete _params.shipping_status;
43
+ _params == null ? true : delete _params.payment_status;
44
+ _params == null ? true : delete _params.status;
45
+ }
41
46
  return {
42
47
  url: _url,
43
48
  params: { ..._params }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.413",
3
+ "version": "1.0.415",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",