@pisell/materials 2.2.1 → 2.2.3

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.
Files changed (134) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +20 -20
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +20 -20
  11. package/es/components/Pagination/index.d.ts +1 -1
  12. package/es/components/page/index.js +12 -8
  13. package/es/components/table/Actions/component/ColumnsSetting/PopoverContent.js +1 -1
  14. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  15. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +143 -0
  16. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  17. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  18. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +87 -0
  19. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  20. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.js +41 -0
  21. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  22. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  23. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +97 -0
  24. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  25. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +137 -0
  26. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  27. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  28. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +149 -0
  29. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  30. package/es/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  31. package/es/components/table/Actions/component/ExportImport/index.js +232 -0
  32. package/es/components/table/Actions/component/ExportImport/index.less +194 -0
  33. package/es/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  34. package/es/components/table/Actions/component/ExportImport/utils/date.js +19 -0
  35. package/es/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  36. package/es/components/table/Actions/component/ExportImport/utils/download.js +39 -0
  37. package/es/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  38. package/es/components/table/Actions/component/ExportImport/utils/file.js +21 -0
  39. package/es/components/table/Actions/index.d.ts +3 -2
  40. package/es/components/table/Actions/index.js +12 -8
  41. package/es/components/table/BasicTable/index.js +11 -1
  42. package/es/components/table/Table/index.js +17 -2
  43. package/es/components/table/Table/utils.d.ts +11 -2
  44. package/es/components/table/Table/utils.js +5 -1
  45. package/es/components/table/hooks/useGenScroll.d.ts +1 -0
  46. package/es/components/table/hooks/useGenScroll.js +4 -3
  47. package/es/components/table/hooks/useTableSetting.d.ts +2 -1
  48. package/es/components/table/hooks/useTableSetting.js +2 -1
  49. package/es/components/table/index.js +15 -13
  50. package/es/components/table/model.d.ts +2 -0
  51. package/es/components/table/model.js +15 -1
  52. package/es/components/table/serve.d.ts +11 -0
  53. package/es/components/table/serve.js +38 -0
  54. package/es/components/table/status.d.ts +19 -0
  55. package/es/components/table/status.js +26 -0
  56. package/es/components/table/types.d.ts +20 -0
  57. package/es/components/table/utils.d.ts +15 -0
  58. package/es/components/table/utils.js +26 -0
  59. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +1 -1
  60. package/es/locales/en-US.d.ts +47 -0
  61. package/es/locales/en-US.js +60 -1
  62. package/es/locales/zh-CN.d.ts +47 -0
  63. package/es/locales/zh-CN.js +60 -1
  64. package/es/locales/zh-TW.d.ts +47 -0
  65. package/es/locales/zh-TW.js +60 -1
  66. package/lib/components/Pagination/index.d.ts +1 -1
  67. package/lib/components/page/index.js +6 -6
  68. package/lib/components/table/Actions/component/ColumnsSetting/PopoverContent.js +1 -1
  69. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  70. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +150 -0
  71. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  72. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  73. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +78 -0
  74. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  75. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.js +60 -0
  76. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  77. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  78. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +117 -0
  79. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  80. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +141 -0
  81. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  82. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  83. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +124 -0
  84. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  85. package/lib/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  86. package/lib/components/table/Actions/component/ExportImport/index.js +210 -0
  87. package/lib/components/table/Actions/component/ExportImport/index.less +194 -0
  88. package/lib/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  89. package/lib/components/table/Actions/component/ExportImport/utils/date.js +49 -0
  90. package/lib/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  91. package/lib/components/table/Actions/component/ExportImport/utils/download.js +62 -0
  92. package/lib/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  93. package/lib/components/table/Actions/component/ExportImport/utils/file.js +55 -0
  94. package/lib/components/table/Actions/index.d.ts +3 -2
  95. package/lib/components/table/Actions/index.js +11 -7
  96. package/lib/components/table/BasicTable/index.js +9 -0
  97. package/lib/components/table/Table/index.js +28 -3
  98. package/lib/components/table/Table/utils.d.ts +11 -2
  99. package/lib/components/table/Table/utils.js +4 -1
  100. package/lib/components/table/hooks/useGenScroll.d.ts +1 -0
  101. package/lib/components/table/hooks/useGenScroll.js +3 -3
  102. package/lib/components/table/hooks/useTableSetting.d.ts +2 -1
  103. package/lib/components/table/hooks/useTableSetting.js +2 -1
  104. package/lib/components/table/index.js +14 -12
  105. package/lib/components/table/model.d.ts +2 -0
  106. package/lib/components/table/model.js +11 -1
  107. package/lib/components/table/serve.d.ts +11 -0
  108. package/lib/components/table/serve.js +41 -0
  109. package/lib/components/table/status.d.ts +19 -0
  110. package/lib/components/table/status.js +55 -0
  111. package/lib/components/table/types.d.ts +20 -0
  112. package/lib/components/table/utils.d.ts +15 -0
  113. package/lib/components/table/utils.js +40 -0
  114. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +2 -2
  115. package/lib/locales/en-US.d.ts +47 -0
  116. package/lib/locales/en-US.js +52 -1
  117. package/lib/locales/zh-CN.d.ts +47 -0
  118. package/lib/locales/zh-CN.js +52 -1
  119. package/lib/locales/zh-TW.d.ts +47 -0
  120. package/lib/locales/zh-TW.js +52 -1
  121. package/lowcode/button/meta.ts +10 -5
  122. package/lowcode/list/meta.ts +6 -6
  123. package/lowcode/select-time/meta.ts +8 -8
  124. package/lowcode/table/meta.ts +84 -1
  125. package/lowcode/table/snippets.ts +8 -0
  126. package/package.json +4 -4
  127. package/dist/umd/materials.min.css +0 -1
  128. package/dist/umd/materials.min.js +0 -1
  129. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  130. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  131. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  132. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  133. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  134. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -36,6 +36,8 @@ var import_antd = require("antd");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_Pagination = require("../../Pagination");
38
38
  var import_utils = require("../Table/utils");
39
+ var import_hooks = require("../../../hooks");
40
+ var import_model = require("../model");
39
41
  var import_utils2 = require("@pisell/utils");
40
42
  var BasicTable = (props) => {
41
43
  var _a;
@@ -48,6 +50,7 @@ var BasicTable = (props) => {
48
50
  size: 10
49
51
  };
50
52
  const group = import_antd.Form.useWatch("group_by", { form, preserve: true });
53
+ const { dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
51
54
  const isGroup = (0, import_react.useMemo)(() => (0, import_utils2.isArr)(group) && group.length > 0, [group]);
52
55
  const { showTotal, localPagination } = pagination;
53
56
  const _showTotal = (0, import_react.useCallback)(
@@ -103,6 +106,12 @@ var BasicTable = (props) => {
103
106
  });
104
107
  return _expandedRowKeys;
105
108
  }, [_dataSource == null ? void 0 : _dataSource.list]);
109
+ (0, import_react.useEffect)(() => {
110
+ dispatch({
111
+ type: "setCurrentDataSource",
112
+ payload: (_dataSource == null ? void 0 : _dataSource.list) || []
113
+ });
114
+ }, [_dataSource == null ? void 0 : _dataSource.list]);
106
115
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
107
116
  import_antd.Table,
108
117
  {
@@ -46,8 +46,13 @@ var import_useGenTableComponents = __toESM(require("../hooks/useGenTableComponen
46
46
  var import_useGenScroll = __toESM(require("../hooks/useGenScroll"));
47
47
  var import_hooks = require("../../../hooks");
48
48
  var import_index = require("./index.less");
49
- var GridViewTable = ({ tableProps, filter, setTableSetting, onDataSourceChange }) => {
50
- var _a, _b;
49
+ var GridViewTable = ({
50
+ tableProps,
51
+ filter,
52
+ setTableSetting,
53
+ onDataSourceChange
54
+ }) => {
55
+ var _a, _b, _c, _d, _e, _f;
51
56
  const responsive = (0, import_hooks.useResponsive)();
52
57
  const { state, dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
53
58
  const form = import_antd.Form.useFormInstance();
@@ -93,16 +98,36 @@ var GridViewTable = ({ tableProps, filter, setTableSetting, onDataSourceChange }
93
98
  rowKey: tableProps.rowKey,
94
99
  filter
95
100
  });
101
+ (0, import_react.useEffect)(() => {
102
+ dispatch({
103
+ type: "setOriginResultDataSource",
104
+ payload: dataSource || []
105
+ });
106
+ }, [dataSource]);
96
107
  (0, import_react.useEffect)(() => {
97
108
  onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
98
109
  }, [JSON.stringify(dataSource)]);
99
110
  const components = (0, import_useGenTableComponents.default)({
100
111
  form
101
112
  });
113
+ const isShowPagination = (0, import_react.useMemo)(() => {
114
+ var _a2, _b2, _c2, _d2;
115
+ let total = ((_a2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a2.total) || (dataSource == null ? void 0 : dataSource.length) || 0;
116
+ if ((_b2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b2.localPagination) {
117
+ total = (dataSource == null ? void 0 : dataSource.length) || 0;
118
+ }
119
+ return total > (((_d2 = (_c2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c2.pageSizeOptions) == null ? void 0 : _d2[0]) || 10);
120
+ }, [
121
+ (_c = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c.localPagination,
122
+ (_d = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _d.total,
123
+ dataSource.length,
124
+ (_f = (_e = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _e.pageSizeOptions) == null ? void 0 : _f[0]
125
+ ]);
102
126
  const scroll = (0, import_useGenScroll.default)({
103
127
  wrapHeight: height || 500,
104
128
  scroll: tableProps.scroll,
105
- columns
129
+ columns,
130
+ isShowPagination
106
131
  });
107
132
  const showTotal = (0, import_react.useCallback)(
108
133
  (total, range, pageSize) => {
@@ -13,7 +13,16 @@ export declare const mergeColumnSetting: ({ columns, tableId, currentViewMode, }
13
13
  columns: Record<string, any>[];
14
14
  tableId?: string | undefined;
15
15
  currentViewMode: ModeType;
16
- }) => Record<string, any>[];
16
+ }) => {
17
+ isShow: boolean;
18
+ }[] | ({
19
+ width: any;
20
+ isShow: any;
21
+ sortIndex: number;
22
+ } | {
23
+ isShow: boolean;
24
+ sortIndex: number;
25
+ })[];
17
26
  /**
18
27
  * 对数据源进行排序
19
28
  * @param dataSource 数据源数组
@@ -146,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
146
155
  sort?: SortType | undefined;
147
156
  mode: "" | "localStorage" | "remote";
148
157
  currentViewMode: ModeType;
149
- }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
158
+ }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
150
159
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
151
160
  export declare const stringify: (obj: Record<string, any>) => string;
152
161
  export {};
@@ -152,7 +152,10 @@ var mergeColumnSetting = ({
152
152
  currentViewMode
153
153
  }) => {
154
154
  if (!tableId)
155
- return columns;
155
+ return columns.map((item) => ({
156
+ ...item,
157
+ isShow: true
158
+ }));
156
159
  const colKeyMap = getColumnsFromLocalStorage(tableId, currentViewMode);
157
160
  const newColumns = columns.map((item, index) => {
158
161
  const col = colKeyMap[item.key];
@@ -7,6 +7,7 @@ declare type useGenScrollParams = {
7
7
  autoCalc?: boolean;
8
8
  };
9
9
  columns: any[];
10
+ isShowPagination: boolean;
10
11
  };
11
12
  declare const useGenScroll: (params: useGenScrollParams) => {
12
13
  x: number;
@@ -24,19 +24,19 @@ __export(useGenScroll_exports, {
24
24
  module.exports = __toCommonJS(useGenScroll_exports);
25
25
  var import_react = require("react");
26
26
  var useGenScroll = (params) => {
27
- const { wrapHeight, scroll: propsScroll, columns } = params;
27
+ const { wrapHeight, scroll: propsScroll, columns, isShowPagination } = params;
28
28
  const scroll = (0, import_react.useMemo)(() => {
29
29
  if (propsScroll == null ? void 0 : propsScroll.autoCalc) {
30
30
  return {
31
31
  x: (propsScroll == null ? void 0 : propsScroll.x) || columns.reduce((p, c) => {
32
32
  return p + (c.width || 250);
33
33
  }, 0) || 2e3,
34
- y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - 50 - 24, 100),
34
+ y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 : 0), 100),
35
35
  scrollToFirstRowOnChange: propsScroll == null ? void 0 : propsScroll.scrollToFirstRowOnChange
36
36
  };
37
37
  }
38
38
  return propsScroll;
39
- }, [propsScroll, wrapHeight, columns]);
39
+ }, [propsScroll, wrapHeight, columns, isShowPagination]);
40
40
  return scroll;
41
41
  };
42
42
  var useGenScroll_default = useGenScroll;
@@ -1,5 +1,5 @@
1
1
  import { FilterType } from "../../filter/types";
2
- import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType } from "../types";
2
+ import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType } from "../types";
3
3
  declare type UseTableSettingProps = {
4
4
  tableId?: string;
5
5
  filter: FilterType;
@@ -11,6 +11,7 @@ declare type UseTableSettingProps = {
11
11
  currentViewMode: ModeType;
12
12
  gallery?: GallerySettingType;
13
13
  currentSettingHash: string;
14
+ exportImport?: ExportImportModeType;
14
15
  };
15
16
  declare const useTableSetting: (params: UseTableSettingProps) => {
16
17
  setTableSetting: (values: Record<string, any>) => void;
@@ -35,7 +35,8 @@ var useTableSetting = (params) => {
35
35
  currentViewMode,
36
36
  columns: propsColumns,
37
37
  gallery,
38
- currentSettingHash
38
+ currentSettingHash,
39
+ exportImport
39
40
  } = params;
40
41
  const columnsMap = (0, import_react.useMemo)(() => {
41
42
  return new Map(propsColumns.map((item) => [item.key, item]));
@@ -32,22 +32,22 @@ __export(table_exports, {
32
32
  default: () => table_default
33
33
  });
34
34
  module.exports = __toCommonJS(table_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
35
  var import_ahooks = require("ahooks");
38
- var import_View = __toESM(require("./View"));
39
- var import_Header = __toESM(require("./Header"));
40
- var import_Actions = __toESM(require("./Actions"));
41
- var import_Summary = __toESM(require("./Summary"));
36
+ var import_antd = require("antd");
37
+ var import_react = __toESM(require("react"));
42
38
  var import_hooks = require("../../hooks");
43
- var import_model = require("./model");
44
39
  var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
45
- var import_useTableSetting = __toESM(require("./hooks/useTableSetting"));
46
- var import_useTriggerValuesChange = __toESM(require("./hooks/useTriggerValuesChange"));
40
+ var import_Actions = __toESM(require("./Actions"));
41
+ var import_Header = __toESM(require("./Header"));
42
+ var import_Summary = __toESM(require("./Summary"));
47
43
  var import_utils = require("./Table/utils");
48
- var import_useTransSortSetting = __toESM(require("./hooks/useTransSortSetting"));
49
- var import_useTransFilterSetting = __toESM(require("./hooks/useTransFilterSetting"));
44
+ var import_View = __toESM(require("./View"));
45
+ var import_useTableSetting = __toESM(require("./hooks/useTableSetting"));
50
46
  var import_useTransDataSourceGroupSetting = __toESM(require("./hooks/useTransDataSourceGroupSetting"));
47
+ var import_useTransFilterSetting = __toESM(require("./hooks/useTransFilterSetting"));
48
+ var import_useTransSortSetting = __toESM(require("./hooks/useTransSortSetting"));
49
+ var import_useTriggerValuesChange = __toESM(require("./hooks/useTriggerValuesChange"));
50
+ var import_model = require("./model");
51
51
  var import_index = require("./index.less");
52
52
  var defaultView = {
53
53
  defaultViewMode: "grid",
@@ -75,6 +75,7 @@ var GridView = (0, import_model.Provider)(
75
75
  gallery,
76
76
  currentSettingKey,
77
77
  // pagination,
78
+ exportImport,
78
79
  ...other
79
80
  } = props;
80
81
  const modal = (0, import_hooks.useSharedState)(import_model.Context);
@@ -307,7 +308,8 @@ var GridView = (0, import_model.Provider)(
307
308
  sort,
308
309
  tableId,
309
310
  localPagination: (_e = other == null ? void 0 : other.pagination) == null ? void 0 : _e.localPagination,
310
- gallery
311
+ gallery,
312
+ exportImport
311
313
  }
312
314
  ), /* @__PURE__ */ import_react.default.createElement(import_Summary.default, { summary }), /* @__PURE__ */ import_react.default.createElement(
313
315
  import_View.default,
@@ -14,6 +14,8 @@ interface FormState {
14
14
  utils: any;
15
15
  localPagination: boolean;
16
16
  tableWidth: number;
17
+ currentDataSource: any[];
18
+ originResultDataSource: any[];
17
19
  }
18
20
  export declare const Provider: (ComponentUi: any) => (props: any, ref: any) => import("react").JSX.Element, Context: import("react").Context<{
19
21
  state: FormState;
@@ -59,7 +59,11 @@ var defaultState = {
59
59
  edit: 0
60
60
  }
61
61
  },
62
- tableWidth: 500
62
+ tableWidth: 500,
63
+ // 当前页展示的数据
64
+ currentDataSource: [],
65
+ // 经过一系列格式化之后的所有数据
66
+ originResultDataSource: []
63
67
  };
64
68
  var { Provider, Context } = (0, import_miniRedux.default)({
65
69
  namespace: "state",
@@ -114,6 +118,12 @@ var { Provider, Context } = (0, import_miniRedux.default)({
114
118
  },
115
119
  setTableWidth(state, payload) {
116
120
  return { ...state, tableWidth: payload };
121
+ },
122
+ setCurrentDataSource(state, payload) {
123
+ return { ...state, currentDataSource: payload };
124
+ },
125
+ setOriginResultDataSource(state, payload) {
126
+ return { ...state, originResultDataSource: payload };
117
127
  }
118
128
  }
119
129
  });
@@ -0,0 +1,11 @@
1
+ declare type exportParams = {
2
+ ids?: Array<string | number>;
3
+ file_name?: string;
4
+ form_id?: string | number;
5
+ code?: string;
6
+ };
7
+ export declare const exportData: (params: exportParams) => Promise<any>;
8
+ export declare const batchImport: (params: any) => Promise<any>;
9
+ export declare const importTemplate: (params: exportParams) => Promise<any>;
10
+ export declare const historyData: (params: any) => Promise<any>;
11
+ export {};
@@ -0,0 +1,41 @@
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/serve.ts
20
+ var serve_exports = {};
21
+ __export(serve_exports, {
22
+ batchImport: () => batchImport,
23
+ exportData: () => exportData,
24
+ historyData: () => historyData,
25
+ importTemplate: () => importTemplate
26
+ });
27
+ module.exports = __toCommonJS(serve_exports);
28
+ var import_utils = require("./utils");
29
+ var exportData = (params) => {
30
+ return import_utils.request.getRequest().post(`/shop/form/data/export`, params);
31
+ };
32
+ var batchImport = (params) => import_utils.request.getRequest().post("/shop/form/data/import", params);
33
+ var importTemplate = (params) => import_utils.request.getRequest().post("/shop/form/data/download-template", params);
34
+ var historyData = async (params) => await import_utils.request.getRequest().get("/shop/form/data/task", params);
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ batchImport,
38
+ exportData,
39
+ historyData,
40
+ importTemplate
41
+ });
@@ -0,0 +1,19 @@
1
+ interface defaultOptions {
2
+ exportType: string;
3
+ footerHintTypes: string[];
4
+ okShowButtonTypes: string[];
5
+ exportValue: string;
6
+ importValue: string;
7
+ }
8
+ export declare const defaultOptions: defaultOptions;
9
+ interface SomeArray {
10
+ [index: string]: string;
11
+ }
12
+ export declare const suffixOptions: SomeArray;
13
+ export declare const exportImportOptions: {
14
+ import: any;
15
+ export: any;
16
+ export_file: any;
17
+ import_log: any;
18
+ };
19
+ export {};
@@ -0,0 +1,55 @@
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/status.ts
20
+ var status_exports = {};
21
+ __export(status_exports, {
22
+ defaultOptions: () => defaultOptions,
23
+ exportImportOptions: () => exportImportOptions,
24
+ suffixOptions: () => suffixOptions
25
+ });
26
+ module.exports = __toCommonJS(status_exports);
27
+ var import_locales = require("../../locales/index");
28
+ var defaultOptions = {
29
+ exportType: "current-page",
30
+ footerHintTypes: ["export_file", "import_log"],
31
+ okShowButtonTypes: ["export", "import"],
32
+ exportValue: "export",
33
+ importValue: "import"
34
+ };
35
+ var suffixOptions = {
36
+ "1": `${(0, import_locales.getText)("page.customer.list.table.num")}`,
37
+ "2": `${(0, import_locales.getText)("page.customer.suffix")}`,
38
+ product: `${(0, import_locales.getText)("page.product.suffix")}`,
39
+ "4": `${(0, import_locales.getText)("page.voucher.suffix")}`,
40
+ "5": `${(0, import_locales.getText)("page.recharge.suffix")}`,
41
+ "6": `${(0, import_locales.getText)("page.ticket.suffix")}`,
42
+ "7": `${(0, import_locales.getText)("page.package.ticket.suffix")}`
43
+ };
44
+ var exportImportOptions = {
45
+ import: (0, import_locales.getText)("table-action-export-import-button-import"),
46
+ export: (0, import_locales.getText)("table-action-export-import-button"),
47
+ export_file: (0, import_locales.getText)("table-action-export-import-export-title"),
48
+ import_log: (0, import_locales.getText)("table-action-export-import-import-title")
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ defaultOptions,
53
+ exportImportOptions,
54
+ suffixOptions
55
+ });
@@ -158,6 +158,25 @@ declare type SortDetail = {
158
158
  fromItem: Record<string, any>;
159
159
  toItem: Record<string, any>;
160
160
  };
161
+ /** 导入导出模式 */
162
+ export declare type ExportImportModeType = "import" | "export" | "export_file" | "import_log";
163
+ /**
164
+ * 导入导出配置
165
+ */
166
+ export declare type ExportImportType = {
167
+ /** 是否展示 */
168
+ show: boolean;
169
+ /** 表id */
170
+ formId?: string;
171
+ /** 表key */
172
+ formCode?: string;
173
+ /** 当前所选项 */
174
+ selectLists: string[];
175
+ /** 导入模版链接 */
176
+ templateFileUrl: string;
177
+ /** 标题 */
178
+ title: string;
179
+ };
161
180
  export declare type GridViewProps = {
162
181
  columns: any;
163
182
  dataSource: any[];
@@ -177,6 +196,7 @@ export declare type GridViewProps = {
177
196
  actionButtons: any;
178
197
  sort: SortType;
179
198
  title: any;
199
+ exportImport: ExportImportType;
180
200
  onValuesChange: (changedValues: any, values: any) => void;
181
201
  summary: any;
182
202
  utils: any;
@@ -0,0 +1,15 @@
1
+ declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
2
+ declare class Request {
3
+ private request;
4
+ constructor();
5
+ setRequest(val: any): void;
6
+ getRequest(): {
7
+ get: RType;
8
+ post: RType;
9
+ put: RType;
10
+ remove: RType;
11
+ custom: RType;
12
+ };
13
+ }
14
+ export declare const request: Request;
15
+ export {};
@@ -0,0 +1,40 @@
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/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ request: () => request
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var Request = class {
26
+ constructor() {
27
+ this.request = {};
28
+ }
29
+ setRequest(val) {
30
+ this.request = val;
31
+ }
32
+ getRequest() {
33
+ return this.request;
34
+ }
35
+ };
36
+ var request = new Request();
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ request
40
+ });
@@ -34,7 +34,7 @@ __export(VirtualKeyInput_exports, {
34
34
  module.exports = __toCommonJS(VirtualKeyInput_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
- var import_icon = require("@pisell/icon");
37
+ var import_Delete = __toESM(require("@pisell/icon/es/Delete"));
38
38
  var import_ahooks = require("ahooks");
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var import_index = require("./index.less");
@@ -85,6 +85,6 @@ var VirtualKeyInput = (props) => {
85
85
  readOnly: true,
86
86
  value: previewValue
87
87
  }
88
- ), (value == null ? void 0 : value.length) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "virtual-keyboard-input-delete", onClick: _onDelete }, /* @__PURE__ */ import_react.default.createElement(import_icon.Delete, { className: "virtual-keyboard-input-delete-icon" })) : null);
88
+ ), (value == null ? void 0 : value.length) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "virtual-keyboard-input-delete", onClick: _onDelete }, /* @__PURE__ */ import_react.default.createElement(import_Delete.default, { className: "virtual-keyboard-input-delete-icon" })) : null);
89
89
  };
90
90
  var VirtualKeyInput_default = VirtualKeyInput;
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  "table-action-group-by-title-tip": string;
27
27
  "table-action-column-title": string;
28
28
  "table-column-group-records": string;
29
+ "table-column-group-lock-tip": string;
29
30
  "table-column-drag-sort-disabled-tip": string;
30
31
  "table-action-filter-no-filter": string;
31
32
  "table-action-range-picker-presets-today": string;
@@ -49,5 +50,51 @@ declare const _default: {
49
50
  'batch-editor-what-price': string;
50
51
  'batch-editor-quick-edit-title': (product: string, num: string) => string;
51
52
  'batch-editor-quick-edit-title-2': (product: string) => string;
53
+ 'table-action-export-import-export-success': string;
54
+ 'table-action-export-import-button': string;
55
+ 'table-action-export-import-export-range': string;
56
+ 'table-action-export-import-current-page': string;
57
+ 'table-action-export-import-all-records': string;
58
+ 'table-action-export-import-selected-records': string;
59
+ 'table-action-export-import-selected': string;
60
+ 'table-action-export-import-item': (length: number) => string;
61
+ 'table-action-export-import-product': string;
62
+ 'table-action-export-import-table-text-input-title': string;
63
+ 'table-action-export-import-table-text-input-describe': string;
64
+ 'table-action-export-import-table-error-file': string;
65
+ 'table-action-export-import-import-success': string;
66
+ 'table-action-export-import-import-phone': string;
67
+ 'table-action-export-import-table-success-download': string;
68
+ 'table-action-export-import-table-textimport-product': string;
69
+ 'table-action-export-import-table-text-product-template': string;
70
+ 'table-action-export-import-table-text-click-download': string;
71
+ 'table-action-export-import-table-text-edit-file': string;
72
+ 'table-action-export-import-button-import': string;
73
+ 'table-action-export-import-cancel': string;
74
+ 'table-action-export-import-file-completed': string;
75
+ 'table-action-export-import-file-processing': string;
76
+ 'table-action-export-import-file-pending': string;
77
+ 'table-action-export-import-file-refresh': string;
78
+ 'table-action-export-import-export-title': string;
79
+ 'table-action-export-import-file-hint': string;
80
+ 'table-action-export-import-file-name': string;
81
+ 'table-action-export-import-file-content': string;
82
+ 'table-action-export-import-file-content-all': string;
83
+ 'table-action-export-import-file-content-part': string;
84
+ 'table-action-export-import-file-status': string;
85
+ 'table-action-export-import-file-account': string;
86
+ 'table-action-export-import-file-created': string;
87
+ 'table-action-export-import-file-record': (length: number) => string;
88
+ 'table-action-export-import-import-title': string;
89
+ 'table-action-export-import-log-hint': string;
90
+ 'table-action-export-import-log-name': string;
91
+ 'table-action-export-import-log-result': string;
92
+ 'table-action-export-import-log-ok': (num: number) => string;
93
+ 'table-action-export-import-log-err': (num: number) => string;
94
+ 'table-action-export-import-log-check': string;
95
+ 'table-action-export-import-log-detail-title': string;
96
+ 'table-action-export-import-log-err-log': string;
97
+ 'table-action-export-import-log-copy': string;
98
+ 'table-action-export-import-table-success-copy': string;
52
99
  };
53
100
  export default _default;
@@ -50,6 +50,7 @@ var en_US_default = {
50
50
  "table-action-group-by-title-tip": "Please select the field from the dropdown menu to group the data for better organization and browsing.",
51
51
  "table-action-column-title": "Header settings",
52
52
  "table-column-group-records": "records",
53
+ "table-column-group-lock-tip": "Fixed column immutable order",
53
54
  "table-column-drag-sort-disabled-tip": "Automatic sorting is enabled, manual dragging is disabled.",
54
55
  "table-action-filter-no-filter": "No filter options available.",
55
56
  "table-action-range-picker-presets-today": "Today",
@@ -72,5 +73,55 @@ var en_US_default = {
72
73
  "batch-editor-quick-edit": "Quick edit",
73
74
  "batch-editor-what-price": "What price",
74
75
  "batch-editor-quick-edit-title": (product, num) => `You have selected ${num} products including ${product}`,
75
- "batch-editor-quick-edit-title-2": (product) => `You have selected ${product}`
76
+ "batch-editor-quick-edit-title-2": (product) => `You have selected ${product}`,
77
+ // 导出
78
+ "table-action-export-import-export-success": "Export successful! ",
79
+ "table-action-export-import-button": "Export",
80
+ "table-action-export-import-export-range": "Export Range",
81
+ "table-action-export-import-current-page": "Current Page",
82
+ "table-action-export-import-all-records": "All Records",
83
+ "table-action-export-import-selected-records": "Selected Records",
84
+ "table-action-export-import-selected": "Selected",
85
+ "table-action-export-import-item": (length) => `${length} ${length > 1 ? "items" : "item"}`,
86
+ "table-action-export-import-product": "Export Products",
87
+ // 导入
88
+ "table-action-export-import-table-text-input-title": "Click or drag file to this area to upload",
89
+ "table-action-export-import-table-text-input-describe": "Support both single and bulk uploads. Do not upload data file other than supported template.",
90
+ "table-action-export-import-table-error-file": "Only supports uploading files in.csv,.xls,.xlsx format.",
91
+ "table-action-export-import-import-success": "Import successful! ",
92
+ "table-action-export-import-import-phone": "Whether to replace data with the same mobile number?",
93
+ "table-action-export-import-table-success-download": "Download Success",
94
+ "table-action-export-import-table-textimport-product": "Import Products",
95
+ "table-action-export-import-table-text-product-template": "Import Template",
96
+ "table-action-export-import-table-text-click-download": "Click to download",
97
+ "table-action-export-import-table-text-edit-file": "Replace file",
98
+ "table-action-export-import-button-import": "Import",
99
+ "table-action-export-import-cancel": "Cancel",
100
+ "table-action-export-import-file-completed": "completed",
101
+ "table-action-export-import-file-processing": "processing",
102
+ "table-action-export-import-file-pending": "pending",
103
+ "table-action-export-import-file-refresh": "Refresh",
104
+ "table-action-export-import-export-title": "Export File",
105
+ "table-action-export-import-file-hint": "Display only the last 10 export histories",
106
+ "table-action-export-import-file-name": "Export File",
107
+ "table-action-export-import-file-content": "Content",
108
+ "table-action-export-import-file-content-all": "All",
109
+ "table-action-export-import-file-content-part": "Selected",
110
+ "table-action-export-import-file-status": "Status",
111
+ "table-action-export-import-file-account": "Operator",
112
+ "table-action-export-import-file-created": "Operation Time",
113
+ "table-action-export-import-file-record": (length) => `${length} ${length > 1 ? "records" : "record"}`,
114
+ // 导入日志
115
+ "table-action-export-import-import-title": "Import Log",
116
+ "table-action-export-import-log-hint": "Display only the last 10 import histories",
117
+ "table-action-export-import-log-name": "Import File",
118
+ "table-action-export-import-log-result": "Import Results",
119
+ "table-action-export-import-log-ok": (num) => `${num} successful`,
120
+ "table-action-export-import-log-err": (num) => `, ${num} failures`,
121
+ "table-action-export-import-log-check": `View more`,
122
+ // 导入详情
123
+ "table-action-export-import-log-detail-title": "Import Details",
124
+ "table-action-export-import-log-err-log": "Failure Log",
125
+ "table-action-export-import-log-copy": "Copy",
126
+ "table-action-export-import-table-success-copy": "Copy Success"
76
127
  };