@pisell/materials 1.0.316 → 1.0.318

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 (41) 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 +3 -3
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/filter/components/FilterItem/index.js +5 -2
  12. package/es/components/filter/components/QuickFilter/index.js +2 -1
  13. package/es/components/filter/types.d.ts +1 -0
  14. package/es/components/sort/index.js +3 -1
  15. package/es/components/sort/index.less +3 -0
  16. package/es/components/sort/types.d.ts +1 -0
  17. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +2 -1
  18. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +6 -6
  19. package/es/components/table/Actions/component/ExportImport/index.js +4 -4
  20. package/es/components/table/BasicTable/index.js +11 -1
  21. package/es/components/table/Table/index.js +6 -0
  22. package/es/components/table/Table/utils.d.ts +1 -1
  23. package/es/components/table/model.d.ts +2 -0
  24. package/es/components/table/model.js +15 -1
  25. package/lib/components/filter/components/FilterItem/index.js +11 -2
  26. package/lib/components/filter/components/QuickFilter/index.js +2 -1
  27. package/lib/components/filter/types.d.ts +1 -0
  28. package/lib/components/sort/index.js +4 -9
  29. package/lib/components/sort/index.less +3 -0
  30. package/lib/components/sort/types.d.ts +1 -0
  31. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +2 -1
  32. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +5 -4
  33. package/lib/components/table/Actions/component/ExportImport/index.js +3 -3
  34. package/lib/components/table/BasicTable/index.js +9 -0
  35. package/lib/components/table/Table/index.js +6 -0
  36. package/lib/components/table/Table/utils.d.ts +1 -1
  37. package/lib/components/table/model.d.ts +2 -0
  38. package/lib/components/table/model.js +11 -1
  39. package/lowcode/table/meta.ts +22 -0
  40. package/lowcode/table/snippets.ts +4 -0
  41. package/package.json +3 -3
@@ -7,7 +7,8 @@ var FilterItem = function FilterItem(props) {
7
7
  var label = props.label,
8
8
  type = props.type,
9
9
  name = props.name,
10
- other = props.other;
10
+ other = props.other,
11
+ isHidden = props.isHidden;
11
12
  var Com = useMemo(function () {
12
13
  var _fieldMaps;
13
14
  return (_fieldMaps = fieldMaps[type]) === null || _fieldMaps === void 0 ? void 0 : _fieldMaps.edit;
@@ -15,6 +16,8 @@ var FilterItem = function FilterItem(props) {
15
16
  return /*#__PURE__*/React.createElement(Form.Item, _extends({
16
17
  label: label,
17
18
  name: name
18
- }, (other === null || other === void 0 ? void 0 : other.formItemProps) || {}), /*#__PURE__*/React.createElement(Com, other));
19
+ }, (other === null || other === void 0 ? void 0 : other.formItemProps) || {}, {
20
+ hidden: !isHidden
21
+ }), /*#__PURE__*/React.createElement(Com, other));
19
22
  };
20
23
  export default FilterItem;
@@ -28,7 +28,8 @@ var QuickFilter = function QuickFilter(props) {
28
28
  ,
29
29
  type: item.type,
30
30
  other: item.other,
31
- props: item.props
31
+ props: item.props,
32
+ isHidden: item.isHidden
32
33
  });
33
34
  }));
34
35
  };
@@ -28,6 +28,7 @@ export declare type FilterItemProps = {
28
28
  other: Record<string, any>;
29
29
  isCustom?: boolean;
30
30
  columnKey?: string;
31
+ isHidden?: boolean;
31
32
  };
32
33
  /**
33
34
  * 筛选组件属性
@@ -87,7 +87,9 @@ var Sort = function Sort(_ref2) {
87
87
  key: d.name,
88
88
  label: d.label,
89
89
  children: sortChildrenMap[d.type](d.name, !!(d !== null && d !== void 0 && d.localFilter)),
90
- popupClassName: "".concat(prefix, "sort-sub-menu-popup-wrap")
90
+ popupClassName: "".concat(prefix, "sort-sub-menu-popup-wrap"),
91
+ // 增加显示隐藏配置
92
+ className: "".concat(d.isHidden ? "" : "".concat(prefix, "sort-menu-wrap-hide"))
91
93
  };
92
94
  });
93
95
  }, [list, localPagination]);
@@ -31,4 +31,7 @@
31
31
  }
32
32
  }
33
33
  }
34
+ &-sort-menu-wrap-hide{
35
+ display: none!important;
36
+ }
34
37
  }
@@ -7,6 +7,7 @@ export declare type SortItemProps = {
7
7
  isCustom: boolean;
8
8
  columnKey?: string;
9
9
  localFilter?: boolean;
10
+ isHidden?: boolean;
10
11
  };
11
12
  export declare type SortListProps = {
12
13
  list: SortItemProps[];
@@ -1,6 +1,7 @@
1
1
  interface IExportParams {
2
2
  type: string;
3
- dataSource: any;
3
+ originDataSource: any[];
4
+ currentDataSource: any[];
4
5
  }
5
6
  export declare const batchExport: (exportParams: IExportParams, exportImport: any) => Promise<true | undefined>;
6
7
  export {};
@@ -54,26 +54,26 @@ export var batchExport = function batchExport(exportParams, exportImport) {
54
54
  if (formCode) {
55
55
  params.code = formCode;
56
56
  }
57
+ console.log("exportParams", exportParams);
57
58
  var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
58
59
 
59
60
  // 当前页面
60
61
  if (type === defaultOptions.exportType) {
61
- var _exportParams$dataSou;
62
62
  _name = "".concat(getText("table-action-export-import-current-page")).concat(_name);
63
- var lists = (exportParams === null || exportParams === void 0 ? void 0 : (_exportParams$dataSou = exportParams.dataSource) === null || _exportParams$dataSou === void 0 ? void 0 : _exportParams$dataSou.slice(0, 10)) || [];
63
+ var lists = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.currentDataSource) || [];
64
64
  params.ids = lists.map(function (item) {
65
65
  return (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id);
66
- }) || [];
66
+ });
67
67
  params.file_name = _name;
68
68
  }
69
69
 
70
70
  // 所有记录
71
71
  if (type === "all-records") {
72
- var _exportParams$dataSou2;
73
72
  _name = "".concat(getText("table-action-export-import-all-records")).concat(_name);
74
- params.ids = (exportParams === null || exportParams === void 0 ? void 0 : (_exportParams$dataSou2 = exportParams.dataSource) === null || _exportParams$dataSou2 === void 0 ? void 0 : _exportParams$dataSou2.map(function (item) {
73
+ var _lists = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.originDataSource) || [];
74
+ params.ids = _lists.map(function (item) {
75
75
  return (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id);
76
- })) || [];
76
+ });
77
77
  params.file_name = _name;
78
78
  }
79
79
 
@@ -56,11 +56,10 @@ var ExportImport = function ExportImport(_ref) {
56
56
  setErrorStatus = _useState10[1];
57
57
  var _useSharedState = useSharedState(Context),
58
58
  state = _useSharedState.state;
59
- var defaultDataSource = state.dataSource,
60
- originDataSource = state.originDataSource;
59
+ var originResultDataSource = state.originResultDataSource,
60
+ currentDataSource = state.currentDataSource;
61
61
  var context = useEngineContext();
62
62
  request.setRequest(context.appHelper.utils.request);
63
- console.log(defaultDataSource, originDataSource, "wh77");
64
63
  var _items = useMemo(function () {
65
64
  // 将对象转成数组
66
65
  var result = Object.entries(exportImportOptions).map(function (_ref2) {
@@ -146,7 +145,8 @@ var ExportImport = function ExportImport(_ref) {
146
145
  }
147
146
  _params = {
148
147
  type: type,
149
- dataSource: defaultDataSource
148
+ originDataSource: originResultDataSource,
149
+ currentDataSource: currentDataSource
150
150
  };
151
151
  _context.next = 5;
152
152
  return batchExport(_params, exportImport);
@@ -15,9 +15,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  import { Table, Form } from "antd";
18
- import React, { useState, useMemo, useCallback } from "react";
18
+ import React, { useState, useMemo, useCallback, useEffect } from "react";
19
19
  import { FormPagination } from "../../Pagination";
20
20
  import { calcFilterSort } from "../Table/utils";
21
+ import { useSharedState } from "../../../hooks";
22
+ import { Context } from "../model";
21
23
  import { isArr } from "@pisell/utils";
22
24
  var BasicTable = function BasicTable(props) {
23
25
  var _pagination$pageSizeO;
@@ -43,6 +45,8 @@ var BasicTable = function BasicTable(props) {
43
45
  form: form,
44
46
  preserve: true
45
47
  });
48
+ var _useSharedState = useSharedState(Context),
49
+ dispatch = _useSharedState.dispatch;
46
50
  var isGroup = useMemo(function () {
47
51
  return isArr(group) && group.length > 0;
48
52
  }, [group]);
@@ -97,6 +101,12 @@ var BasicTable = function BasicTable(props) {
97
101
  });
98
102
  return _expandedRowKeys;
99
103
  }, [_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list]);
104
+ useEffect(function () {
105
+ dispatch({
106
+ type: "setCurrentDataSource",
107
+ payload: (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list) || []
108
+ });
109
+ }, [_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list]);
100
110
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({
101
111
  key: defaultExpandedRowKeys.join("-")
102
112
  }, other, {
@@ -87,6 +87,12 @@ var GridViewTable = function GridViewTable(_ref) {
87
87
  rowKey: tableProps.rowKey,
88
88
  filter: filter
89
89
  });
90
+ useEffect(function () {
91
+ dispatch({
92
+ type: "setOriginResultDataSource",
93
+ payload: dataSource || []
94
+ });
95
+ }, [dataSource]);
90
96
  useEffect(function () {
91
97
  onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource);
92
98
  }, [JSON.stringify(dataSource)]);
@@ -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
- }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
170
+ }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
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 {};
@@ -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;
@@ -29,7 +29,11 @@ var defaultState = {
29
29
  edit: 0
30
30
  }
31
31
  },
32
- tableWidth: 500
32
+ tableWidth: 500,
33
+ // 当前页展示的数据
34
+ currentDataSource: [],
35
+ // 经过一系列格式化之后的所有数据
36
+ originResultDataSource: []
33
37
  };
34
38
  var _getContext = getContext({
35
39
  namespace: "state",
@@ -105,6 +109,16 @@ var _getContext = getContext({
105
109
  return _objectSpread(_objectSpread({}, state), {}, {
106
110
  tableWidth: payload
107
111
  });
112
+ },
113
+ setCurrentDataSource: function setCurrentDataSource(state, payload) {
114
+ return _objectSpread(_objectSpread({}, state), {}, {
115
+ currentDataSource: payload
116
+ });
117
+ },
118
+ setOriginResultDataSource: function setOriginResultDataSource(state, payload) {
119
+ return _objectSpread(_objectSpread({}, state), {}, {
120
+ originResultDataSource: payload
121
+ });
108
122
  }
109
123
  }
110
124
  }),
@@ -37,11 +37,20 @@ var import_antd = require("antd");
37
37
  var import_fields = require("../../../table/Table/fields");
38
38
  var import_index = require("./index.less");
39
39
  var FilterItem = (props) => {
40
- const { label, type, name, other } = props;
40
+ const { label, type, name, other, isHidden } = props;
41
41
  const Com = (0, import_react.useMemo)(() => {
42
42
  var _a;
43
43
  return (_a = import_fields.fieldMaps[type]) == null ? void 0 : _a.edit;
44
44
  }, [type]);
45
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label, name, ...(other == null ? void 0 : other.formItemProps) || {} }, /* @__PURE__ */ import_react.default.createElement(Com, { ...other }));
45
+ return /* @__PURE__ */ import_react.default.createElement(
46
+ import_antd.Form.Item,
47
+ {
48
+ label,
49
+ name,
50
+ ...(other == null ? void 0 : other.formItemProps) || {},
51
+ hidden: !isHidden
52
+ },
53
+ /* @__PURE__ */ import_react.default.createElement(Com, { ...other })
54
+ );
46
55
  };
47
56
  var FilterItem_default = FilterItem;
@@ -51,7 +51,8 @@ var QuickFilter = (props) => {
51
51
  name,
52
52
  type: item.type,
53
53
  other: item.other,
54
- props: item.props
54
+ props: item.props,
55
+ isHidden: item.isHidden
55
56
  }
56
57
  );
57
58
  }));
@@ -28,6 +28,7 @@ export declare type FilterItemProps = {
28
28
  other: Record<string, any>;
29
29
  isCustom?: boolean;
30
30
  columnKey?: string;
31
+ isHidden?: boolean;
31
32
  };
32
33
  /**
33
34
  * 筛选组件属性
@@ -102,7 +102,9 @@ var Sort = ({
102
102
  key: d.name,
103
103
  label: d.label,
104
104
  children: sortChildrenMap[d.type](d.name, !!(d == null ? void 0 : d.localFilter)),
105
- popupClassName: `${prefix}sort-sub-menu-popup-wrap`
105
+ popupClassName: `${prefix}sort-sub-menu-popup-wrap`,
106
+ // 增加显示隐藏配置
107
+ className: `${d.isHidden ? "" : `${prefix}sort-menu-wrap-hide`}`
106
108
  };
107
109
  });
108
110
  }, [list, localPagination]);
@@ -130,14 +132,7 @@ var Sort = ({
130
132
  );
131
133
  }, [button, style, value, isMobileBool]);
132
134
  const content = (0, import_react.useMemo)(() => {
133
- return /* @__PURE__ */ import_react.default.createElement(
134
- import_InlineMenu.default,
135
- {
136
- items: sortItems,
137
- value: value || "",
138
- onChange
139
- }
140
- );
135
+ return /* @__PURE__ */ import_react.default.createElement(import_InlineMenu.default, { items: sortItems, value: value || "", onChange });
141
136
  }, [value, sortItems, onChange]);
142
137
  if ((0, import_platform.isMobile)()) {
143
138
  return /* @__PURE__ */ import_react.default.createElement(
@@ -31,4 +31,7 @@
31
31
  }
32
32
  }
33
33
  }
34
+ &-sort-menu-wrap-hide{
35
+ display: none!important;
36
+ }
34
37
  }
@@ -7,6 +7,7 @@ export declare type SortItemProps = {
7
7
  isCustom: boolean;
8
8
  columnKey?: string;
9
9
  localFilter?: boolean;
10
+ isHidden?: boolean;
10
11
  };
11
12
  export declare type SortListProps = {
12
13
  list: SortItemProps[];
@@ -1,6 +1,7 @@
1
1
  interface IExportParams {
2
2
  type: string;
3
- dataSource: any;
3
+ originDataSource: any[];
4
+ currentDataSource: any[];
4
5
  }
5
6
  export declare const batchExport: (exportParams: IExportParams, exportImport: any) => Promise<true | undefined>;
6
7
  export {};
@@ -40,7 +40,6 @@ var _batchExport = async (params) => {
40
40
  }
41
41
  };
42
42
  var batchExport = (exportParams, exportImport) => {
43
- var _a, _b;
44
43
  const { selectLists, formId, formCode } = exportImport;
45
44
  let _name = (0, import_file.getFileDateName)();
46
45
  let params = {};
@@ -50,16 +49,18 @@ var batchExport = (exportParams, exportImport) => {
50
49
  if (formCode) {
51
50
  params.code = formCode;
52
51
  }
52
+ console.log("exportParams", exportParams);
53
53
  const type = (exportParams == null ? void 0 : exportParams.type) || import_status.defaultOptions.exportType;
54
54
  if (type === import_status.defaultOptions.exportType) {
55
55
  _name = `${(0, import_locales.getText)("table-action-export-import-current-page")}${_name}`;
56
- const lists = ((_a = exportParams == null ? void 0 : exportParams.dataSource) == null ? void 0 : _a.slice(0, 10)) || [];
57
- params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id)) || [];
56
+ const lists = (exportParams == null ? void 0 : exportParams.currentDataSource) || [];
57
+ params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id));
58
58
  params.file_name = _name;
59
59
  }
60
60
  if (type === "all-records") {
61
61
  _name = `${(0, import_locales.getText)("table-action-export-import-all-records")}${_name}`;
62
- params.ids = ((_b = exportParams == null ? void 0 : exportParams.dataSource) == null ? void 0 : _b.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id))) || [];
62
+ const lists = (exportParams == null ? void 0 : exportParams.originDataSource) || [];
63
+ params.ids = lists.map((item) => (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id));
63
64
  params.file_name = _name;
64
65
  }
65
66
  if (type === "selected-records") {
@@ -63,10 +63,9 @@ var ExportImport = ({ exportImport }) => {
63
63
  const [value, setValue] = (0, import_react.useState)("");
64
64
  const [errorStatus, setErrorStatus] = (0, import_react.useState)();
65
65
  const { state } = (0, import_hooks.useSharedState)(import_model.Context);
66
- const { dataSource: defaultDataSource, originDataSource } = state;
66
+ const { originResultDataSource, currentDataSource } = state;
67
67
  const context = (0, import_useEngineContext.default)();
68
68
  import_utils.request.setRequest(context.appHelper.utils.request);
69
- console.log(defaultDataSource, originDataSource, "wh77");
70
69
  const _items = (0, import_react.useMemo)(() => {
71
70
  const result = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
72
71
  return {
@@ -140,7 +139,8 @@ var ExportImport = ({ exportImport }) => {
140
139
  if (value === import_status.defaultOptions.exportValue) {
141
140
  const _params = {
142
141
  type,
143
- dataSource: defaultDataSource
142
+ originDataSource: originResultDataSource,
143
+ currentDataSource
144
144
  };
145
145
  const result = await (0, import_function.batchExport)(_params, exportImport);
146
146
  if (result) {
@@ -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
  {
@@ -98,6 +98,12 @@ var GridViewTable = ({
98
98
  rowKey: tableProps.rowKey,
99
99
  filter
100
100
  });
101
+ (0, import_react.useEffect)(() => {
102
+ dispatch({
103
+ type: "setOriginResultDataSource",
104
+ payload: dataSource || []
105
+ });
106
+ }, [dataSource]);
101
107
  (0, import_react.useEffect)(() => {
102
108
  onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
103
109
  }, [JSON.stringify(dataSource)]);
@@ -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
- }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
170
+ }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
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 {};
@@ -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
  });
@@ -1810,6 +1810,16 @@ export default {
1810
1810
  setter: "BoolSetter",
1811
1811
  defaultValue: false,
1812
1812
  },
1813
+ {
1814
+ name: "isHidden",
1815
+ title: {
1816
+ label: "是否隐藏",
1817
+ tip: "开启时,当前项展示, 关闭时,当前项隐藏",
1818
+ },
1819
+ propType: "bool",
1820
+ setter: "BoolSetter",
1821
+ defaultValue: true,
1822
+ },
1813
1823
  {
1814
1824
  name: "other",
1815
1825
  title: {
@@ -1828,6 +1838,7 @@ export default {
1828
1838
  key: "name",
1829
1839
  columnKey: "",
1830
1840
  isCustom: false,
1841
+ isHidden: true
1831
1842
  },
1832
1843
  },
1833
1844
  },
@@ -1986,6 +1997,16 @@ export default {
1986
1997
  return target.parent.getPropValue("isCustom");
1987
1998
  },
1988
1999
  },
2000
+ {
2001
+ name: "isHidden",
2002
+ title: {
2003
+ label: "是否隐藏",
2004
+ tip: "开启时,当前项展示, 关闭时,当前项隐藏",
2005
+ },
2006
+ propType: "bool",
2007
+ setter: "BoolSetter",
2008
+ defaultValue: true,
2009
+ },
1989
2010
  {
1990
2011
  name: "type",
1991
2012
  title: { label: "字段类型", tip: "所排序的字段类型" },
@@ -2021,6 +2042,7 @@ export default {
2021
2042
  type: "date",
2022
2043
  columnKey: "",
2023
2044
  isCustom: false,
2045
+ isHidden: true
2024
2046
  },
2025
2047
  },
2026
2048
  },
@@ -330,12 +330,14 @@ export default [
330
330
  type: "string",
331
331
  columnKey: "name",
332
332
  isCustom: false,
333
+ isHidden: true
333
334
  },
334
335
  {
335
336
  label: "标题",
336
337
  type: "number",
337
338
  columnKey: "age",
338
339
  isCustom: false,
340
+ isHidden: true
339
341
  },
340
342
  ],
341
343
  },
@@ -371,6 +373,7 @@ export default [
371
373
  isCustom: false,
372
374
  sort: true,
373
375
  localFilter: true,
376
+ isHidden: true
374
377
  },
375
378
  {
376
379
  label: "标题",
@@ -380,6 +383,7 @@ export default [
380
383
  isCustom: false,
381
384
  sort: true,
382
385
  localFilter: true,
386
+ isHidden: true
383
387
  },
384
388
  ],
385
389
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.316",
3
+ "version": "1.0.318",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -62,9 +62,9 @@
62
62
  "react-window": "^1.8.10",
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
+ "@pisell/icon": "0.0.10",
65
66
  "@pisell/utils": "1.0.27",
66
- "@pisell/date-picker": "1.0.75",
67
- "@pisell/icon": "0.0.10"
67
+ "@pisell/date-picker": "1.0.75"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0",