@pisell/materials 6.3.6 → 6.3.7
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +39 -28
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +45 -34
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +10 -11
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/date-picker/datePickerCpt.d.ts +1 -0
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/list/index.d.ts +1 -0
- package/es/components/lowCodePage/index.d.ts +1 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellCamera/index.d.ts +4 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellDatePicker/datePickerCpt.d.ts +1 -0
- package/es/components/pisellInput/components/BankCard/index.d.ts +1 -0
- package/es/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/es/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
- package/es/components/pisellInput/index.d.ts +1 -0
- package/es/components/pisellTooltip/index.d.ts +1 -0
- package/es/components/productCard/components/Action/index.d.ts +1 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/es/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/es/components/productCard/components/Header/index.d.ts +1 -0
- package/es/components/productCard/components/Note/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/components/Sales/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/es/components/qrcode/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/Group/index.d.ts +0 -1
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/Actions/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/View/index.d.ts +0 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +17 -0
- package/es/locales/en-US.d.ts +10 -0
- package/es/locales/en-US.js +13 -1
- package/es/locales/zh-CN.d.ts +10 -0
- package/es/locales/zh-CN.js +13 -1
- package/es/locales/zh-TW.d.ts +10 -0
- package/es/locales/zh-TW.js +13 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +10 -11
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/date-picker/datePickerCpt.d.ts +1 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/list/index.d.ts +1 -0
- package/lib/components/lowCodePage/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellCamera/index.d.ts +4 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellDatePicker/datePickerCpt.d.ts +1 -0
- package/lib/components/pisellInput/components/BankCard/index.d.ts +1 -0
- package/lib/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
- package/lib/components/pisellInput/index.d.ts +1 -0
- package/lib/components/pisellTooltip/index.d.ts +1 -0
- package/lib/components/productCard/components/Action/index.d.ts +1 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/index.d.ts +1 -0
- package/lib/components/productCard/components/Note/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/components/Sales/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/lib/components/qrcode/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/Group/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/Actions/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/View/index.d.ts +0 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +17 -0
- package/lib/locales/en-US.d.ts +10 -0
- package/lib/locales/en-US.js +13 -1
- package/lib/locales/zh-CN.d.ts +10 -0
- package/lib/locales/zh-CN.js +13 -1
- package/lib/locales/zh-TW.d.ts +10 -0
- package/lib/locales/zh-TW.js +13 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/data-source-table/meta.ts +239 -0
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/table/meta.ts +104 -0
- package/package.json +4 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterType } from "../../filter/types";
|
|
2
|
-
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType } from "../types";
|
|
2
|
+
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType, LocalSettingsType } from "../types";
|
|
3
3
|
declare type UseTableSettingProps = {
|
|
4
4
|
tableId?: string;
|
|
5
5
|
filter: FilterType;
|
|
@@ -12,11 +12,10 @@ declare type UseTableSettingProps = {
|
|
|
12
12
|
gallery?: GallerySettingType;
|
|
13
13
|
currentSettingHash: string;
|
|
14
14
|
exportImport?: ExportImportModeType;
|
|
15
|
+
localSettings?: LocalSettingsType;
|
|
15
16
|
};
|
|
16
17
|
declare const useTableSetting: (params: UseTableSettingProps) => {
|
|
17
18
|
setTableSetting: (values: Record<string, any>) => void;
|
|
18
|
-
tableSetting:
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
};
|
|
19
|
+
tableSetting: any;
|
|
21
20
|
};
|
|
22
21
|
export default useTableSetting;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/table/hooks/useTableSetting.ts
|
|
@@ -25,6 +35,7 @@ module.exports = __toCommonJS(useTableSetting_exports);
|
|
|
25
35
|
var import_react = require("react");
|
|
26
36
|
var import_utils = require("../Table/utils");
|
|
27
37
|
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_react2 = __toESM(require("react"));
|
|
28
39
|
var useTableSetting = (params) => {
|
|
29
40
|
const {
|
|
30
41
|
tableId,
|
|
@@ -37,7 +48,8 @@ var useTableSetting = (params) => {
|
|
|
37
48
|
columns: propsColumns,
|
|
38
49
|
gallery,
|
|
39
50
|
currentSettingHash,
|
|
40
|
-
exportImport
|
|
51
|
+
exportImport,
|
|
52
|
+
localSettings
|
|
41
53
|
} = params;
|
|
42
54
|
const columnsMap = (0, import_react.useMemo)(() => {
|
|
43
55
|
return new Map(propsColumns.map((item) => [item.key, item]));
|
|
@@ -67,7 +79,8 @@ var useTableSetting = (params) => {
|
|
|
67
79
|
};
|
|
68
80
|
}, [gallery, columns]);
|
|
69
81
|
const localStorageSettingKeyArr = (0, import_react.useMemo)(() => {
|
|
70
|
-
|
|
82
|
+
var _a;
|
|
83
|
+
const keys = (0, import_utils.getSettingKeyArrByMode)({
|
|
71
84
|
filter,
|
|
72
85
|
columnSetting,
|
|
73
86
|
dataSourceGroup,
|
|
@@ -75,6 +88,12 @@ var useTableSetting = (params) => {
|
|
|
75
88
|
mode: "localStorage",
|
|
76
89
|
currentViewMode
|
|
77
90
|
});
|
|
91
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
92
|
+
if (!keys.includes("filters")) {
|
|
93
|
+
keys.push("filters");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return keys;
|
|
78
97
|
}, [tableId, filter, columnSetting, dataSourceGroup, sort, currentViewMode]);
|
|
79
98
|
const defaultKeyArr = (0, import_react.useMemo)(() => {
|
|
80
99
|
return (0, import_utils.getSettingKeyArrByMode)({
|
|
@@ -129,6 +148,8 @@ var useTableSetting = (params) => {
|
|
|
129
148
|
compactMode: ((_c = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _c.compactMode) || defaultGalleryCoverSetting.compactMode,
|
|
130
149
|
isShowLabel: ((_d = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _d.isShowLabel) ?? defaultGalleryCoverSetting.isShowLabel
|
|
131
150
|
};
|
|
151
|
+
} else if (item === "filters") {
|
|
152
|
+
setting[item] = (mergedSetting == null ? void 0 : mergedSetting[item]) || {};
|
|
132
153
|
} else {
|
|
133
154
|
setting[item] = mergedSetting == null ? void 0 : mergedSetting[item];
|
|
134
155
|
}
|
|
@@ -187,20 +208,109 @@ var useTableSetting = (params) => {
|
|
|
187
208
|
sortButtonShow
|
|
188
209
|
]);
|
|
189
210
|
const setTableSetting = (0, import_ahooks.useMemoizedFn)((values) => {
|
|
211
|
+
var _a;
|
|
212
|
+
let valuesForSave = values;
|
|
213
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
214
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
215
|
+
const filterValue = {};
|
|
216
|
+
((filter == null ? void 0 : filter.list) || []).forEach((item) => {
|
|
217
|
+
const rawName = item == null ? void 0 : item.name;
|
|
218
|
+
if (!rawName) return;
|
|
219
|
+
const key = Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
220
|
+
if (excluded.has(key)) return;
|
|
221
|
+
if (values.hasOwnProperty(key)) {
|
|
222
|
+
filterValue[key] = values[key];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
valuesForSave = {
|
|
226
|
+
...values,
|
|
227
|
+
filters: filterValue
|
|
228
|
+
};
|
|
229
|
+
}
|
|
190
230
|
(0, import_utils.setFormValuesToLocalStorage)({
|
|
191
231
|
tableId,
|
|
192
|
-
allValues:
|
|
232
|
+
allValues: valuesForSave,
|
|
193
233
|
keys: localStorageSettingKeyArr,
|
|
194
234
|
currentViewMode,
|
|
195
235
|
currentSettingHash
|
|
196
236
|
});
|
|
197
237
|
});
|
|
198
238
|
const tableSetting = (0, import_react.useMemo)(() => {
|
|
199
|
-
|
|
239
|
+
var _a;
|
|
240
|
+
const merged = {
|
|
200
241
|
...tableLocalSetting,
|
|
201
242
|
...defaultTableSetting
|
|
202
243
|
};
|
|
244
|
+
if ((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters"))) {
|
|
245
|
+
const persistedFilter = tableLocalSetting == null ? void 0 : tableLocalSetting.filters;
|
|
246
|
+
if (persistedFilter && typeof persistedFilter === "object") {
|
|
247
|
+
return {
|
|
248
|
+
...merged,
|
|
249
|
+
...persistedFilter
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return merged;
|
|
203
254
|
}, [tableLocalSetting, defaultTableSetting]);
|
|
255
|
+
(0, import_react.useMemo)(() => {
|
|
256
|
+
var _a;
|
|
257
|
+
try {
|
|
258
|
+
if (!tableId) return;
|
|
259
|
+
const current = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode) || {};
|
|
260
|
+
const persistedFilters = (current == null ? void 0 : current.filters) || {};
|
|
261
|
+
let nextFilters = { ...persistedFilters };
|
|
262
|
+
let shouldUpdate = false;
|
|
263
|
+
const enableFiltersMemory = !!((localSettings == null ? void 0 : localSettings.enable) && ((_a = localSettings.scope) == null ? void 0 : _a.includes("filters")));
|
|
264
|
+
if (!enableFiltersMemory) {
|
|
265
|
+
if (Object.keys(persistedFilters || {}).length > 0) {
|
|
266
|
+
nextFilters = {};
|
|
267
|
+
shouldUpdate = true;
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
let names = /* @__PURE__ */ new Set();
|
|
271
|
+
if (import_react2.default.isValidElement(filter)) {
|
|
272
|
+
names = new Set(
|
|
273
|
+
((filter == null ? void 0 : filter.items) || []).filter((item) => !item.isHidden).map((item) => {
|
|
274
|
+
const rawName = item == null ? void 0 : item.value;
|
|
275
|
+
if (!rawName) return void 0;
|
|
276
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
} else {
|
|
280
|
+
names = new Set(
|
|
281
|
+
((filter == null ? void 0 : filter.list) || []).map((item) => {
|
|
282
|
+
const rawName = item == null ? void 0 : item.name;
|
|
283
|
+
if (!rawName) return void 0;
|
|
284
|
+
return Array.isArray(rawName) ? rawName.join(",") : String(rawName);
|
|
285
|
+
}).filter(Boolean)
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
const excluded = new Set((localSettings == null ? void 0 : localSettings.excludedFilterFields) || []);
|
|
289
|
+
const allowed = new Set(Array.from(names).filter((k) => !excluded.has(k)));
|
|
290
|
+
const filtered = {};
|
|
291
|
+
Object.keys(persistedFilters || {}).forEach((k) => {
|
|
292
|
+
if (allowed.has(k)) {
|
|
293
|
+
filtered[k] = persistedFilters[k];
|
|
294
|
+
} else {
|
|
295
|
+
shouldUpdate = true;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
if (Object.keys(filtered).length !== Object.keys(persistedFilters || {}).length) {
|
|
299
|
+
shouldUpdate = true;
|
|
300
|
+
}
|
|
301
|
+
nextFilters = filtered;
|
|
302
|
+
}
|
|
303
|
+
if (shouldUpdate) {
|
|
304
|
+
(0, import_utils.setTableSettingToLocalStorage)({
|
|
305
|
+
tableId,
|
|
306
|
+
tableSettingObj: { filters: nextFilters },
|
|
307
|
+
currentViewMode,
|
|
308
|
+
currentSettingHash
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
} catch (e) {
|
|
312
|
+
}
|
|
313
|
+
}, []);
|
|
204
314
|
return {
|
|
205
315
|
setTableSetting,
|
|
206
316
|
tableSetting
|
|
@@ -76,6 +76,7 @@ var GridView = (0, import_model.Provider)(
|
|
|
76
76
|
onValuesChange,
|
|
77
77
|
columnSetting,
|
|
78
78
|
dataSourceGroup: propsDataSourceGroup,
|
|
79
|
+
localSettings: _localSettings,
|
|
79
80
|
view = defaultView,
|
|
80
81
|
gallery,
|
|
81
82
|
currentSettingKey,
|
|
@@ -171,7 +172,8 @@ var GridView = (0, import_model.Provider)(
|
|
|
171
172
|
view,
|
|
172
173
|
currentViewMode,
|
|
173
174
|
gallery,
|
|
174
|
-
currentSettingHash
|
|
175
|
+
currentSettingHash,
|
|
176
|
+
localSettings: _localSettings
|
|
175
177
|
});
|
|
176
178
|
const getIsTriggerValuesChange = (0, import_useTriggerValuesChange.default)({
|
|
177
179
|
filter,
|
|
@@ -260,6 +262,15 @@ var GridView = (0, import_model.Provider)(
|
|
|
260
262
|
(0, import_react.useImperativeHandle)(ref, () => {
|
|
261
263
|
if (wrapRef.current) {
|
|
262
264
|
wrapRef.current.formInstance = form;
|
|
265
|
+
wrapRef.current.getCachedFilters = () => {
|
|
266
|
+
try {
|
|
267
|
+
if (!tableId) return {};
|
|
268
|
+
const setting = (0, import_utils.getTableSettingByCurrentViewMode)(tableId, currentViewMode);
|
|
269
|
+
return (setting == null ? void 0 : setting.filters) || {};
|
|
270
|
+
} catch (e) {
|
|
271
|
+
return {};
|
|
272
|
+
}
|
|
273
|
+
};
|
|
263
274
|
}
|
|
264
275
|
return wrapRef.current;
|
|
265
276
|
});
|
|
@@ -191,6 +191,21 @@ export declare type ExportImportType = {
|
|
|
191
191
|
apiUrl?: ApiProps;
|
|
192
192
|
otherParams?: any;
|
|
193
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* 设置记忆范围
|
|
196
|
+
*/
|
|
197
|
+
export declare type LocalSettingsScope = "filters" | "sorting" | "columns";
|
|
198
|
+
/**
|
|
199
|
+
* 本地记忆设置
|
|
200
|
+
*/
|
|
201
|
+
export declare type LocalSettingsType = {
|
|
202
|
+
/** 启用设置记忆 */
|
|
203
|
+
enable: boolean;
|
|
204
|
+
/** 记忆范围 */
|
|
205
|
+
scope: LocalSettingsScope[];
|
|
206
|
+
/** 不需要记忆的筛选字段(当 scope 包含 filters 时生效) */
|
|
207
|
+
excludedFilterFields?: string[];
|
|
208
|
+
};
|
|
194
209
|
export declare type GridViewProps = {
|
|
195
210
|
columns: any;
|
|
196
211
|
dataSource: any[];
|
|
@@ -247,5 +262,7 @@ export declare type GridViewProps = {
|
|
|
247
262
|
sortBy?: string;
|
|
248
263
|
}[];
|
|
249
264
|
};
|
|
265
|
+
/** 本地记忆设置 */
|
|
266
|
+
localSettings?: LocalSettingsType;
|
|
250
267
|
};
|
|
251
268
|
export {};
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -276,5 +276,15 @@ declare const _default: {
|
|
|
276
276
|
'pisell2.text.goodpass.last-settlement': string;
|
|
277
277
|
'pisell2.text.goodpass.view-more': string;
|
|
278
278
|
'pisell2.text.goodpass.save': string;
|
|
279
|
+
'pisell-camera-no-camera-accessible': string;
|
|
280
|
+
'pisell-camera-permission-denied': string;
|
|
281
|
+
'pisell-camera-switch-camera': string;
|
|
282
|
+
'pisell-camera-canvas': string;
|
|
283
|
+
'pisell-camera-checking': string;
|
|
284
|
+
'pisell-camera-no-camera-desc': string;
|
|
285
|
+
'pisell-upload-camera-local-files': string;
|
|
286
|
+
'pisell-upload-camera-capture': string;
|
|
287
|
+
'pisell-upload-camera-retake': string;
|
|
288
|
+
'pisell-upload-camera-use': string;
|
|
279
289
|
};
|
|
280
290
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -328,5 +328,17 @@ var en_US_default = {
|
|
|
328
328
|
"pisell2.text.goodpass.product-vouchers": "Promotions & Vouchers",
|
|
329
329
|
"pisell2.text.goodpass.last-settlement": "(Last payment)",
|
|
330
330
|
"pisell2.text.goodpass.view-more": "View More",
|
|
331
|
-
"pisell2.text.goodpass.save": "Save"
|
|
331
|
+
"pisell2.text.goodpass.save": "Save",
|
|
332
|
+
// 相机组件
|
|
333
|
+
"pisell-camera-no-camera-accessible": "No camera accessible",
|
|
334
|
+
"pisell-camera-permission-denied": "Permission denied",
|
|
335
|
+
"pisell-camera-switch-camera": "Switch camera",
|
|
336
|
+
"pisell-camera-canvas": "Canvas not supported",
|
|
337
|
+
"pisell-camera-checking": "Detecting camera...",
|
|
338
|
+
"pisell-camera-no-camera-desc": "Please check if your device has a camera or grant browser permission to access camera",
|
|
339
|
+
// 拍照组件
|
|
340
|
+
"pisell-upload-camera-local-files": "Local Files",
|
|
341
|
+
"pisell-upload-camera-capture": "Capture",
|
|
342
|
+
"pisell-upload-camera-retake": "Retake",
|
|
343
|
+
"pisell-upload-camera-use": "Use photo"
|
|
332
344
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -271,5 +271,15 @@ declare const _default: {
|
|
|
271
271
|
'pisell2.text.goodpass.last-settlement': string;
|
|
272
272
|
'pisell2.text.goodpass.view-more': string;
|
|
273
273
|
'pisell2.text.goodpass.save': string;
|
|
274
|
+
'pisell-camera-no-camera-accessible': string;
|
|
275
|
+
'pisell-camera-permission-denied': string;
|
|
276
|
+
'pisell-camera-switch-camera': string;
|
|
277
|
+
'pisell-camera-canvas': string;
|
|
278
|
+
'pisell-camera-checking': string;
|
|
279
|
+
'pisell-camera-no-camera-desc': string;
|
|
280
|
+
'pisell-upload-camera-local-files': string;
|
|
281
|
+
'pisell-upload-camera-capture': string;
|
|
282
|
+
'pisell-upload-camera-retake': string;
|
|
283
|
+
'pisell-upload-camera-use': string;
|
|
274
284
|
};
|
|
275
285
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -319,5 +319,17 @@ var zh_CN_default = {
|
|
|
319
319
|
"pisell2.text.goodpass.product-vouchers": "优惠促销",
|
|
320
320
|
"pisell2.text.goodpass.last-settlement": "(上次结算)",
|
|
321
321
|
"pisell2.text.goodpass.view-more": "查看更多",
|
|
322
|
-
"pisell2.text.goodpass.save": "节省"
|
|
322
|
+
"pisell2.text.goodpass.save": "节省",
|
|
323
|
+
// 相机组件
|
|
324
|
+
"pisell-camera-no-camera-accessible": "没有找到摄像头",
|
|
325
|
+
"pisell-camera-permission-denied": "没有权限使用摄像头",
|
|
326
|
+
"pisell-camera-switch-camera": "切换摄像头",
|
|
327
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
328
|
+
"pisell-camera-checking": "正在检测摄像头...",
|
|
329
|
+
"pisell-camera-no-camera-desc": "请检查设备是否连接摄像头或授权浏览器访问摄像头",
|
|
330
|
+
// 拍照组件
|
|
331
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
332
|
+
"pisell-upload-camera-capture": "拍摄/拍照",
|
|
333
|
+
"pisell-upload-camera-retake": "重拍",
|
|
334
|
+
"pisell-upload-camera-use": "使用照片"
|
|
323
335
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -271,5 +271,15 @@ declare const _default: {
|
|
|
271
271
|
'pisell2.text.goodpass.last-settlement': string;
|
|
272
272
|
'pisell2.text.goodpass.view-more': string;
|
|
273
273
|
'pisell2.text.goodpass.save': string;
|
|
274
|
+
'pisell-camera-no-camera-accessible': string;
|
|
275
|
+
'pisell-camera-permission-denied': string;
|
|
276
|
+
'pisell-camera-switch-camera': string;
|
|
277
|
+
'pisell-camera-canvas': string;
|
|
278
|
+
'pisell-camera-checking': string;
|
|
279
|
+
'pisell-camera-no-camera-desc': string;
|
|
280
|
+
'pisell-upload-camera-local-files': string;
|
|
281
|
+
'pisell-upload-camera-capture': string;
|
|
282
|
+
'pisell-upload-camera-retake': string;
|
|
283
|
+
'pisell-upload-camera-use': string;
|
|
274
284
|
};
|
|
275
285
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -320,5 +320,17 @@ var zh_TW_default = {
|
|
|
320
320
|
"pisell2.text.goodpass.product-vouchers": "優惠促銷",
|
|
321
321
|
"pisell2.text.goodpass.last-settlement": "(上次結算)",
|
|
322
322
|
"pisell2.text.goodpass.view-more": "查看更多",
|
|
323
|
-
"pisell2.text.goodpass.save": "節省"
|
|
323
|
+
"pisell2.text.goodpass.save": "節省",
|
|
324
|
+
// 相机组件
|
|
325
|
+
"pisell-camera-no-camera-accessible": "沒有找到攝像頭",
|
|
326
|
+
"pisell-camera-permission-denied": "沒有權限使用攝像頭",
|
|
327
|
+
"pisell-camera-switch-camera": "切換攝像頭",
|
|
328
|
+
"pisell-camera-canvas": "canvas不支持",
|
|
329
|
+
"pisell-camera-checking": "正在檢測攝像頭...",
|
|
330
|
+
"pisell-camera-no-camera-desc": "請檢查設備是否連接攝像頭或授權瀏覽器訪問攝像頭",
|
|
331
|
+
// 拍照组件
|
|
332
|
+
"pisell-upload-camera-local-files": "本地文件",
|
|
333
|
+
"pisell-upload-camera-capture": "拍攝/拍照",
|
|
334
|
+
"pisell-upload-camera-retake": "重拍",
|
|
335
|
+
"pisell-upload-camera-use": "使用照片"
|
|
324
336
|
};
|
package/lib/utils/platform.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isMobile: () =>
|
|
1
|
+
export declare const isMobile: () => boolean;
|
|
@@ -3050,6 +3050,132 @@ const dataSourceTable = {
|
|
|
3050
3050
|
},
|
|
3051
3051
|
],
|
|
3052
3052
|
},
|
|
3053
|
+
|
|
3054
|
+
{
|
|
3055
|
+
type: 'group',
|
|
3056
|
+
title: {
|
|
3057
|
+
type: 'i18n',
|
|
3058
|
+
'en-US': 'Other',
|
|
3059
|
+
'zh-CN': '其他',
|
|
3060
|
+
},
|
|
3061
|
+
display: 'accordion',
|
|
3062
|
+
items: [
|
|
3063
|
+
{
|
|
3064
|
+
title: "本地记忆",
|
|
3065
|
+
display: "block",
|
|
3066
|
+
type: "group",
|
|
3067
|
+
items: [
|
|
3068
|
+
{
|
|
3069
|
+
name: "localSettings.enable",
|
|
3070
|
+
title: {
|
|
3071
|
+
label: {
|
|
3072
|
+
type: 'i18n',
|
|
3073
|
+
'en-US': 'Enable settings memory',
|
|
3074
|
+
'zh-CN': '启用设置记忆',
|
|
3075
|
+
'zh-HK': '啟用設置記憶',
|
|
3076
|
+
},
|
|
3077
|
+
tip: {
|
|
3078
|
+
type: 'i18n',
|
|
3079
|
+
'en-US': 'Automatically save and restore table settings',
|
|
3080
|
+
'zh-CN': '自动保存和恢复表格设置',
|
|
3081
|
+
'zh-HK': '自動保存和恢復表格設置',
|
|
3082
|
+
},
|
|
3083
|
+
},
|
|
3084
|
+
propType: "bool",
|
|
3085
|
+
setter: "BoolSetter",
|
|
3086
|
+
defaultValue: true,
|
|
3087
|
+
},
|
|
3088
|
+
{
|
|
3089
|
+
name: "localSettings.scope",
|
|
3090
|
+
title: {
|
|
3091
|
+
label: {
|
|
3092
|
+
type: 'i18n',
|
|
3093
|
+
'en-US': 'Memory scope',
|
|
3094
|
+
'zh-CN': '记忆范围',
|
|
3095
|
+
'zh-HK': '記憶範圍',
|
|
3096
|
+
},
|
|
3097
|
+
tip: {
|
|
3098
|
+
type: 'i18n',
|
|
3099
|
+
'en-US': 'Choose which settings to remember',
|
|
3100
|
+
'zh-CN': '选择要记忆的设置项',
|
|
3101
|
+
'zh-HK': '選擇要記憶的設置項',
|
|
3102
|
+
},
|
|
3103
|
+
},
|
|
3104
|
+
condition: {
|
|
3105
|
+
type: "JSFunction",
|
|
3106
|
+
value: 'target => !!target.getProps().getPropValue("localSettings.enable")',
|
|
3107
|
+
},
|
|
3108
|
+
setter: {
|
|
3109
|
+
componentName: "SelectSetter",
|
|
3110
|
+
props: {
|
|
3111
|
+
mode: "multiple",
|
|
3112
|
+
options: [
|
|
3113
|
+
{ title: '筛选', value: "filters" },
|
|
3114
|
+
{ title: '排序', value: "sorting" },
|
|
3115
|
+
{ title: '列配置', value: "columns" },
|
|
3116
|
+
],
|
|
3117
|
+
},
|
|
3118
|
+
},
|
|
3119
|
+
defaultValue: ["filters", "sorting", "columns"],
|
|
3120
|
+
},
|
|
3121
|
+
{
|
|
3122
|
+
name: "localSettings.excludedFilterFields",
|
|
3123
|
+
title: {
|
|
3124
|
+
label: {
|
|
3125
|
+
type: 'i18n',
|
|
3126
|
+
'en-US': 'Excluded filter fields',
|
|
3127
|
+
'zh-CN': '筛选排除字段',
|
|
3128
|
+
'zh-HK': '篩選排除字段',
|
|
3129
|
+
},
|
|
3130
|
+
tip: {
|
|
3131
|
+
type: 'i18n',
|
|
3132
|
+
'en-US': 'Filter fields that should not be remembered',
|
|
3133
|
+
'zh-CN': '不需要记忆的筛选字段',
|
|
3134
|
+
'zh-HK': '不需要記憶的篩選字段',
|
|
3135
|
+
},
|
|
3136
|
+
},
|
|
3137
|
+
condition: {
|
|
3138
|
+
type: "JSFunction",
|
|
3139
|
+
value: 'target => { const enable = !!target.getProps().getPropValue("localSettings.enable"); const scope = target.getProps().getPropValue("localSettings.scope") || []; return enable && Array.isArray(scope) && scope.includes("filters"); }',
|
|
3140
|
+
},
|
|
3141
|
+
setter: {
|
|
3142
|
+
componentName: "SelectSetter",
|
|
3143
|
+
props: (target: any) => {
|
|
3144
|
+
const filterList = (target.parent.parent.getPropValue("filter.items") || []) as any[];
|
|
3145
|
+
|
|
3146
|
+
|
|
3147
|
+
const searchDetail = target.parent.parent.getPropValue("search");
|
|
3148
|
+
|
|
3149
|
+
if (searchDetail && searchDetail.show) {
|
|
3150
|
+
filterList.unshift({
|
|
3151
|
+
label: "搜索",
|
|
3152
|
+
value: searchDetail.key || "_keywords",
|
|
3153
|
+
isHidden: false,
|
|
3154
|
+
});
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
return {
|
|
3158
|
+
mode: "multiple",
|
|
3159
|
+
options: filterList
|
|
3160
|
+
.map((item: any) => ({
|
|
3161
|
+
title:
|
|
3162
|
+
(item && (typeof item.label === 'string' ? item.label : item.label?.["zh-CN"] || item.label?.["zh-HK"] || item.label?.en)) ||
|
|
3163
|
+
item?.key ||
|
|
3164
|
+
item?.columnKey ||
|
|
3165
|
+
"",
|
|
3166
|
+
value: item?.value || "",
|
|
3167
|
+
isHidden: item?.isHidden,
|
|
3168
|
+
}))
|
|
3169
|
+
.filter((opt: any) => opt.value && !opt.isHidden),
|
|
3170
|
+
};
|
|
3171
|
+
},
|
|
3172
|
+
},
|
|
3173
|
+
},
|
|
3174
|
+
],
|
|
3175
|
+
},
|
|
3176
|
+
|
|
3177
|
+
],
|
|
3178
|
+
},
|
|
3053
3179
|
],
|
|
3054
3180
|
configure: {
|
|
3055
3181
|
props: [
|
|
@@ -4536,6 +4662,119 @@ const dataSourceTable = {
|
|
|
4536
4662
|
},
|
|
4537
4663
|
],
|
|
4538
4664
|
},
|
|
4665
|
+
{
|
|
4666
|
+
title: "本地记忆",
|
|
4667
|
+
display: "block",
|
|
4668
|
+
type: "group",
|
|
4669
|
+
items: [
|
|
4670
|
+
{
|
|
4671
|
+
name: "localSettings.enable",
|
|
4672
|
+
title: {
|
|
4673
|
+
label: {
|
|
4674
|
+
type: 'i18n',
|
|
4675
|
+
'en-US': 'Enable settings memory',
|
|
4676
|
+
'zh-CN': '启用设置记忆',
|
|
4677
|
+
'zh-HK': '啟用設置記憶',
|
|
4678
|
+
},
|
|
4679
|
+
tip: {
|
|
4680
|
+
type: 'i18n',
|
|
4681
|
+
'en-US': 'Automatically save and restore table settings',
|
|
4682
|
+
'zh-CN': '自动保存和恢复表格设置',
|
|
4683
|
+
'zh-HK': '自動保存和恢復表格設置',
|
|
4684
|
+
},
|
|
4685
|
+
},
|
|
4686
|
+
propType: "bool",
|
|
4687
|
+
setter: "BoolSetter",
|
|
4688
|
+
defaultValue: true,
|
|
4689
|
+
},
|
|
4690
|
+
{
|
|
4691
|
+
name: "localSettings.scope",
|
|
4692
|
+
title: {
|
|
4693
|
+
label: {
|
|
4694
|
+
type: 'i18n',
|
|
4695
|
+
'en-US': 'Memory scope',
|
|
4696
|
+
'zh-CN': '记忆范围',
|
|
4697
|
+
'zh-HK': '記憶範圍',
|
|
4698
|
+
},
|
|
4699
|
+
tip: {
|
|
4700
|
+
type: 'i18n',
|
|
4701
|
+
'en-US': 'Choose which settings to remember',
|
|
4702
|
+
'zh-CN': '选择要记忆的设置项',
|
|
4703
|
+
'zh-HK': '選擇要記憶的設置項',
|
|
4704
|
+
},
|
|
4705
|
+
},
|
|
4706
|
+
condition: {
|
|
4707
|
+
type: "JSFunction",
|
|
4708
|
+
value: 'target => !!target.getProps().getPropValue("localSettings.enable")',
|
|
4709
|
+
},
|
|
4710
|
+
setter: {
|
|
4711
|
+
componentName: "SelectSetter",
|
|
4712
|
+
props: {
|
|
4713
|
+
mode: "multiple",
|
|
4714
|
+
options: [
|
|
4715
|
+
{ title: '筛选', value: "filters" },
|
|
4716
|
+
{ title: '排序', value: "sorting" },
|
|
4717
|
+
{ title: '列配置', value: "columns" },
|
|
4718
|
+
],
|
|
4719
|
+
},
|
|
4720
|
+
},
|
|
4721
|
+
defaultValue: ["filters", "sorting", "columns"],
|
|
4722
|
+
},
|
|
4723
|
+
{
|
|
4724
|
+
name: "localSettings.excludedFilterFields",
|
|
4725
|
+
title: {
|
|
4726
|
+
label: {
|
|
4727
|
+
type: 'i18n',
|
|
4728
|
+
'en-US': 'Excluded filter fields',
|
|
4729
|
+
'zh-CN': '筛选排除字段',
|
|
4730
|
+
'zh-HK': '篩選排除字段',
|
|
4731
|
+
},
|
|
4732
|
+
tip: {
|
|
4733
|
+
type: 'i18n',
|
|
4734
|
+
'en-US': 'Filter fields that should not be remembered',
|
|
4735
|
+
'zh-CN': '不需要记忆的筛选字段',
|
|
4736
|
+
'zh-HK': '不需要記憶的篩選字段',
|
|
4737
|
+
},
|
|
4738
|
+
},
|
|
4739
|
+
condition: {
|
|
4740
|
+
type: "JSFunction",
|
|
4741
|
+
value: 'target => { const enable = !!target.getProps().getPropValue("localSettings.enable"); const scope = target.getProps().getPropValue("localSettings.scope") || []; return enable && Array.isArray(scope) && scope.includes("filters"); }',
|
|
4742
|
+
},
|
|
4743
|
+
setter: {
|
|
4744
|
+
componentName: "SelectSetter",
|
|
4745
|
+
props: (target: any) => {
|
|
4746
|
+
const filterList = (target.parent.parent.getPropValue("filter.items") || []) as any[];
|
|
4747
|
+
|
|
4748
|
+
|
|
4749
|
+
const searchDetail = target.parent.parent.getPropValue("search");
|
|
4750
|
+
|
|
4751
|
+
if (searchDetail && searchDetail.show) {
|
|
4752
|
+
filterList.unshift({
|
|
4753
|
+
label: "搜索",
|
|
4754
|
+
value: searchDetail.key || "_keywords",
|
|
4755
|
+
isHidden: false,
|
|
4756
|
+
});
|
|
4757
|
+
}
|
|
4758
|
+
|
|
4759
|
+
return {
|
|
4760
|
+
mode: "multiple",
|
|
4761
|
+
options: filterList
|
|
4762
|
+
.map((item: any) => ({
|
|
4763
|
+
title:
|
|
4764
|
+
(item && (typeof item.label === 'string' ? item.label : item.label?.["zh-CN"] || item.label?.["zh-HK"] || item.label?.en)) ||
|
|
4765
|
+
item?.key ||
|
|
4766
|
+
item?.columnKey ||
|
|
4767
|
+
"",
|
|
4768
|
+
value: item?.value || "",
|
|
4769
|
+
isHidden: item?.isHidden,
|
|
4770
|
+
}))
|
|
4771
|
+
.filter((opt: any) => opt.value && !opt.isHidden),
|
|
4772
|
+
};
|
|
4773
|
+
},
|
|
4774
|
+
},
|
|
4775
|
+
},
|
|
4776
|
+
],
|
|
4777
|
+
},
|
|
4539
4778
|
{
|
|
4540
4779
|
title: { label: '列配置', tip: '表格的列配置' },
|
|
4541
4780
|
display: 'block',
|