yc-pro-components 0.0.57 → 0.0.58
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/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +5 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/header-filter-cell.vue2.mjs +48 -47
- package/es/components/yc-plus-page/src/index.vue.d.ts +1 -0
- package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/index.vue2.mjs +9 -2
- package/es/components/yc-plus-page/src/type.d.ts +4 -0
- package/es/components/yc-plus-page/src/use-header-filter.d.ts +2 -0
- package/es/components/yc-plus-page/src/use-header-filter.mjs +6 -1
- package/es/index.css +10 -10
- package/index.css +12 -12
- package/index.js +65 -52
- package/index.min.css +2 -2
- package/index.min.js +11 -11
- package/index.min.mjs +11 -11
- package/index.mjs +65 -52
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +5 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.js +1 -1
- package/lib/components/yc-plus-page/src/header-filter-cell.vue2.js +47 -46
- package/lib/components/yc-plus-page/src/index.vue.d.ts +1 -0
- package/lib/components/yc-plus-page/src/index.vue.js +1 -1
- package/lib/components/yc-plus-page/src/index.vue2.js +9 -2
- package/lib/components/yc-plus-page/src/type.d.ts +4 -0
- package/lib/components/yc-plus-page/src/use-header-filter.d.ts +2 -0
- package/lib/components/yc-plus-page/src/use-header-filter.js +6 -1
- package/lib/index.css +12 -12
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,8 @@ interface Props {
|
|
|
15
15
|
orderBy?: OrderByItem[];
|
|
16
16
|
/** 是否禁用筛选(仅显示排序) */
|
|
17
17
|
disableFilter?: boolean;
|
|
18
|
+
/** 是否隐藏排序图标(仅显示筛选) */
|
|
19
|
+
hideSort?: boolean;
|
|
18
20
|
/** 字段元数据配置(例如来自后端的 catalog 字典) */
|
|
19
21
|
fieldConfig?: Record<string, unknown>;
|
|
20
22
|
/** 自定义渲染 reference */
|
|
@@ -25,6 +27,7 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRunt
|
|
|
25
27
|
filters: () => never[];
|
|
26
28
|
orderBy: () => never[];
|
|
27
29
|
disableFilter: boolean;
|
|
30
|
+
hideSort: boolean;
|
|
28
31
|
referenceRenderer: undefined;
|
|
29
32
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
30
33
|
reset: (payload: {
|
|
@@ -45,6 +48,7 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRunt
|
|
|
45
48
|
filters: () => never[];
|
|
46
49
|
orderBy: () => never[];
|
|
47
50
|
disableFilter: boolean;
|
|
51
|
+
hideSort: boolean;
|
|
48
52
|
referenceRenderer: undefined;
|
|
49
53
|
}>>> & {
|
|
50
54
|
onReset?: ((payload: {
|
|
@@ -65,6 +69,7 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRunt
|
|
|
65
69
|
orderBy: OrderByItem[];
|
|
66
70
|
operators: OperatorOption[];
|
|
67
71
|
disableFilter: boolean;
|
|
72
|
+
hideSort: boolean;
|
|
68
73
|
referenceRenderer: () => unknown;
|
|
69
74
|
}, {}>;
|
|
70
75
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './header-filter-cell.vue2.mjs';
|
|
2
2
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
3
|
|
|
4
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bc48f1f7"], ["__file", "header-filter-cell.vue"]]);
|
|
5
5
|
|
|
6
6
|
export { YcTableHeaderFilterCellComponent as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, reactive, ref, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, withModifiers, createCommentVNode, createElementVNode, normalizeClass, createBlock, resolveDynamicComponent, Fragment, unref, withCtx, toDisplayString, createTextVNode, mergeProps, createVNode,
|
|
1
|
+
import { defineComponent, computed, reactive, ref, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, withModifiers, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createBlock, resolveDynamicComponent, Fragment, unref, withCtx, toDisplayString, createTextVNode, mergeProps, createVNode, renderList, h } from 'vue';
|
|
2
2
|
import { ElTooltip, ElIcon, ElPopover, ElButton, ElInput } from 'element-plus';
|
|
3
3
|
import { QuestionFilled, CaretTop, CaretBottom } from '@element-plus/icons-vue';
|
|
4
4
|
import { NO_VALUE_OPERATORS } from './constants.mjs';
|
|
@@ -22,19 +22,18 @@ const _hoisted_3 = {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
const _hoisted_4 = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "yc-header-filter-cell__operators"
|
|
27
|
-
};
|
|
28
|
-
const _hoisted_5 = ["onClick"];
|
|
29
|
-
const _hoisted_6 = { key: 0 };
|
|
30
|
-
const _hoisted_7 = {
|
|
31
25
|
class: "yc-header-filter-cell__actions",
|
|
32
26
|
style: {
|
|
33
27
|
display: "flex",
|
|
34
|
-
justifyContent: "
|
|
35
|
-
marginTop: "4px"
|
|
28
|
+
justifyContent: "flex-end"
|
|
36
29
|
}
|
|
37
30
|
};
|
|
31
|
+
const _hoisted_5 = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "yc-header-filter-cell__operators"
|
|
34
|
+
};
|
|
35
|
+
const _hoisted_6 = ["onClick"];
|
|
36
|
+
const _hoisted_7 = { key: 0 };
|
|
38
37
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
39
38
|
...{
|
|
40
39
|
name: "YcTableHeaderFilterCell"
|
|
@@ -47,6 +46,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
46
|
filters: { default: () => [] },
|
|
48
47
|
orderBy: { default: () => [] },
|
|
49
48
|
disableFilter: { type: Boolean, default: false },
|
|
49
|
+
hideSort: { type: Boolean, default: false },
|
|
50
50
|
fieldConfig: {},
|
|
51
51
|
referenceRenderer: { type: Function, default: void 0 }
|
|
52
52
|
},
|
|
@@ -279,9 +279,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
279
279
|
gap: "4px",
|
|
280
280
|
cursor: "default"
|
|
281
281
|
},
|
|
282
|
-
onMousedown: _cache[
|
|
282
|
+
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
283
283
|
}, ["stop"])),
|
|
284
|
-
onClick: _cache[
|
|
284
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(() => {
|
|
285
285
|
}, ["stop"]))
|
|
286
286
|
},
|
|
287
287
|
[
|
|
@@ -292,13 +292,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
292
292
|
{
|
|
293
293
|
class: normalizeClass(["yc-header-filter-cell__label", {
|
|
294
294
|
"yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value,
|
|
295
|
-
"yc-header-filter-cell__label--active": isAscActive.value || isDescActive.value || isActive.value
|
|
295
|
+
"yc-header-filter-cell__label--active": !_ctx.hideSort && (isAscActive.value || isDescActive.value) || isActive.value
|
|
296
296
|
}]),
|
|
297
|
-
style: {
|
|
297
|
+
style: normalizeStyle({
|
|
298
298
|
userSelect: "none",
|
|
299
|
-
cursor: "pointer"
|
|
300
|
-
},
|
|
301
|
-
onClick: withModifiers(cycleSort, ["stop"])
|
|
299
|
+
cursor: _ctx.hideSort ? "default" : "pointer"
|
|
300
|
+
}),
|
|
301
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => !_ctx.hideSort && cycleSort(), ["stop"]))
|
|
302
302
|
},
|
|
303
303
|
[
|
|
304
304
|
_ctx.referenceRenderer ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.referenceRenderer), { key: 0 })) : (openBlock(), createElementBlock(
|
|
@@ -357,8 +357,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
357
357
|
/* STABLE_FRAGMENT */
|
|
358
358
|
))
|
|
359
359
|
],
|
|
360
|
-
|
|
361
|
-
/* CLASS */
|
|
360
|
+
6
|
|
361
|
+
/* CLASS, STYLE */
|
|
362
362
|
),
|
|
363
363
|
createCommentVNode(" tooltip \u56FE\u6807\uFF08\u95EE\u53F7\uFF09- \u4EC5\u5728\u672A\u4F7F\u7528\u81EA\u5B9A\u4E49\u6E32\u67D3\u65F6\u663E\u793A "),
|
|
364
364
|
columnTooltip.value && !_ctx.referenceRenderer ? (openBlock(), createBlock(
|
|
@@ -387,8 +387,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
387
387
|
16
|
|
388
388
|
/* FULL_PROPS */
|
|
389
389
|
)) : createCommentVNode("v-if", true),
|
|
390
|
-
createCommentVNode(" \u6392\u5E8F\u56FE\u6807 "),
|
|
391
|
-
|
|
390
|
+
createCommentVNode(" \u6392\u5E8F\u56FE\u6807\uFF0C\u5F53 hideSort \u4E3A true \u65F6\u9690\u85CF "),
|
|
391
|
+
!_ctx.hideSort ? (openBlock(), createElementBlock("span", {
|
|
392
|
+
key: 1,
|
|
392
393
|
class: "yc-header-filter-cell__sort",
|
|
393
394
|
style: {
|
|
394
395
|
display: "inline-flex",
|
|
@@ -421,10 +422,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
421
422
|
_: 1
|
|
422
423
|
/* STABLE */
|
|
423
424
|
}, 8, ["style"])
|
|
424
|
-
]),
|
|
425
|
+
])) : createCommentVNode("v-if", true),
|
|
425
426
|
createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
|
|
426
427
|
!_ctx.disableFilter ? (openBlock(), createBlock(unref(ElPopover), {
|
|
427
|
-
key:
|
|
428
|
+
key: 2,
|
|
428
429
|
visible: popVisible.value,
|
|
429
430
|
trigger: "click",
|
|
430
431
|
placement: "bottom-start",
|
|
@@ -435,7 +436,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
435
436
|
reference: withCtx(() => [
|
|
436
437
|
createElementVNode("span", {
|
|
437
438
|
style: { cursor: "pointer", display: "inline-flex", alignItems: "center" },
|
|
438
|
-
onClick: _cache[
|
|
439
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => popVisible.value = !popVisible.value, ["stop"]))
|
|
439
440
|
}, [
|
|
440
441
|
createVNode(unref(YcSvgIcon), {
|
|
441
442
|
src: filterIconUrl.value,
|
|
@@ -447,8 +448,28 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
447
448
|
]),
|
|
448
449
|
default: withCtx(() => [
|
|
449
450
|
createElementVNode("div", _hoisted_3, [
|
|
451
|
+
createCommentVNode(" \u64CD\u4F5C\u6309\u94AE\uFF08\u7F6E\u9876\u53F3\u4FA7\uFF0C\u907F\u514D\u4E0B\u62C9\u9009\u62E9\u5668\u906E\u6321\uFF09 "),
|
|
452
|
+
createElementVNode("div", _hoisted_4, [
|
|
453
|
+
createVNode(unref(ElButton), { onClick: handleReset }, {
|
|
454
|
+
default: withCtx(() => [
|
|
455
|
+
createTextVNode("\u91CD\u7F6E")
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
/* STABLE */
|
|
459
|
+
}),
|
|
460
|
+
createVNode(unref(ElButton), {
|
|
461
|
+
type: "primary",
|
|
462
|
+
onClick: handleConfirm
|
|
463
|
+
}, {
|
|
464
|
+
default: withCtx(() => [
|
|
465
|
+
createTextVNode("\u786E\u5B9A")
|
|
466
|
+
]),
|
|
467
|
+
_: 1
|
|
468
|
+
/* STABLE */
|
|
469
|
+
})
|
|
470
|
+
]),
|
|
450
471
|
createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868\uFF08\u591A\u9009/\u65E5\u671F\u533A\u95F4\u7B49\u7531 hideOperatorList \u9690\u85CF\uFF0C\u9ED8\u8BA4 in / between\uFF09 "),
|
|
451
|
-
!hideOperatorList.value ? (openBlock(), createElementBlock("div",
|
|
472
|
+
!hideOperatorList.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
452
473
|
(openBlock(true), createElementBlock(
|
|
453
474
|
Fragment,
|
|
454
475
|
null,
|
|
@@ -475,35 +496,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
475
496
|
1
|
|
476
497
|
/* TEXT */
|
|
477
498
|
),
|
|
478
|
-
state.selectedOp === op.code ? (openBlock(), createElementBlock("span",
|
|
479
|
-
], 12,
|
|
499
|
+
state.selectedOp === op.code ? (openBlock(), createElementBlock("span", _hoisted_7, "\u2713")) : createCommentVNode("v-if", true)
|
|
500
|
+
], 12, _hoisted_6);
|
|
480
501
|
}),
|
|
481
502
|
128
|
|
482
503
|
/* KEYED_FRAGMENT */
|
|
483
504
|
))
|
|
484
505
|
])) : createCommentVNode("v-if", true),
|
|
485
506
|
createCommentVNode(" \u503C\u8F93\u5165 "),
|
|
486
|
-
needValueInput.value ? (openBlock(), createBlock(resolveDynamicComponent(renderValueField), { key: 1 })) : createCommentVNode("v-if", true)
|
|
487
|
-
createCommentVNode(" \u64CD\u4F5C\u6309\u94AE "),
|
|
488
|
-
createElementVNode("div", _hoisted_7, [
|
|
489
|
-
createVNode(unref(ElButton), { onClick: handleReset }, {
|
|
490
|
-
default: withCtx(() => [
|
|
491
|
-
createTextVNode("\u91CD\u7F6E")
|
|
492
|
-
]),
|
|
493
|
-
_: 1
|
|
494
|
-
/* STABLE */
|
|
495
|
-
}),
|
|
496
|
-
createVNode(unref(ElButton), {
|
|
497
|
-
type: "primary",
|
|
498
|
-
onClick: handleConfirm
|
|
499
|
-
}, {
|
|
500
|
-
default: withCtx(() => [
|
|
501
|
-
createTextVNode("\u786E\u5B9A")
|
|
502
|
-
]),
|
|
503
|
-
_: 1
|
|
504
|
-
/* STABLE */
|
|
505
|
-
})
|
|
506
|
-
])
|
|
507
|
+
needValueInput.value ? (openBlock(), createBlock(resolveDynamicComponent(renderValueField), { key: 1 })) : createCommentVNode("v-if", true)
|
|
507
508
|
])
|
|
508
509
|
]),
|
|
509
510
|
_: 1
|
|
@@ -8001,6 +8001,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
8001
8001
|
upsertHeaderFilter: (field: string, op: string, value?: string | undefined) => void;
|
|
8002
8002
|
removeHeaderFilter: (field: string) => void;
|
|
8003
8003
|
setOrderBy: (field: string, direction?: "desc" | "asc" | undefined) => void;
|
|
8004
|
+
resetAllHeaderFilters: () => void;
|
|
8004
8005
|
getList: () => Promise<void> | undefined;
|
|
8005
8006
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8006
8007
|
"header-filter-confirm": (payload: HeaderFilterPayload) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './index.vue2.mjs';
|
|
2
2
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
3
|
|
|
4
|
-
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8c4a287b"], ["__file", "index.vue"]]);
|
|
5
5
|
|
|
6
6
|
export { YcPlusPageComponent as default };
|
|
@@ -78,7 +78,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
78
|
getOpsByProp,
|
|
79
79
|
getMergedQuery,
|
|
80
80
|
updateCatalogs,
|
|
81
|
-
isFieldFilterable
|
|
81
|
+
isFieldFilterable,
|
|
82
|
+
resetAllHeaderFilters
|
|
82
83
|
// isFieldVisible 已在 enhancedColumns 中直接使用 fieldCatalogState 实现
|
|
83
84
|
} = useHeaderFilter({
|
|
84
85
|
headerFilterConfig: () => props.headerFilter,
|
|
@@ -127,6 +128,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
127
128
|
return visibleCols;
|
|
128
129
|
}
|
|
129
130
|
return visibleCols.map((col) => {
|
|
131
|
+
var _a, _b;
|
|
130
132
|
const colHideFilter = col.hideHeaderFilter === true;
|
|
131
133
|
const hasExplicitHeaderFilter = col.headerFilter && typeof col.headerFilter === "object" || col.headerFilter === true;
|
|
132
134
|
const fieldFilterable = hasExplicitHeaderFilter || isFieldFilterable(col.prop);
|
|
@@ -137,9 +139,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
137
139
|
return col;
|
|
138
140
|
}
|
|
139
141
|
const operators = getOpsByProp(col.prop);
|
|
142
|
+
const colHeaderFilter = col.headerFilter && typeof col.headerFilter === "object" ? col.headerFilter : {};
|
|
143
|
+
const globalHeaderFilter = props.headerFilter && typeof props.headerFilter === "object" ? props.headerFilter : {};
|
|
144
|
+
const columnHideSort = (_b = (_a = colHeaderFilter.hideSort) != null ? _a : globalHeaderFilter.hideSort) != null ? _b : false;
|
|
140
145
|
const FILTER_ICON_WIDTH = 24;
|
|
141
146
|
const SORT_ICON_WIDTH = 16;
|
|
142
|
-
const EXTRA_WIDTH = FILTER_ICON_WIDTH + SORT_ICON_WIDTH;
|
|
147
|
+
const EXTRA_WIDTH = FILTER_ICON_WIDTH + (columnHideSort ? 0 : SORT_ICON_WIDTH);
|
|
143
148
|
const originalWidth = col.width || col.minWidth;
|
|
144
149
|
let adjustedWidth = originalWidth;
|
|
145
150
|
if (typeof originalWidth === "number") {
|
|
@@ -166,6 +171,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
166
171
|
operators,
|
|
167
172
|
filters: headerFiltersState.filters,
|
|
168
173
|
orderBy: orderByState,
|
|
174
|
+
hideSort: columnHideSort,
|
|
169
175
|
onConfirm: handleFilterConfirm,
|
|
170
176
|
onReset: handleFilterReset,
|
|
171
177
|
onSortChange: handleSortChange,
|
|
@@ -457,6 +463,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
457
463
|
upsertHeaderFilter,
|
|
458
464
|
removeHeaderFilter,
|
|
459
465
|
setOrderBy,
|
|
466
|
+
resetAllHeaderFilters,
|
|
460
467
|
getList: () => {
|
|
461
468
|
var _a, _b;
|
|
462
469
|
return (_b = (_a = plusPageRef.value) == null ? void 0 : _a.getList) == null ? void 0 : _b.call(_a);
|
|
@@ -63,6 +63,8 @@ export interface HeaderFilterConfig {
|
|
|
63
63
|
field: string;
|
|
64
64
|
direction: 'asc' | 'desc';
|
|
65
65
|
}>;
|
|
66
|
+
/** 是否隐藏所有列的排序图标(全局配置),默认 false。列级 headerFilter.hideSort 优先 */
|
|
67
|
+
hideSort?: boolean;
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* 列级别的表头筛选配置
|
|
@@ -82,6 +84,8 @@ export interface ColumnHeaderFilterConfig {
|
|
|
82
84
|
onConfirm?: (payload: HeaderFilterPayload) => void;
|
|
83
85
|
/** 重置回调 */
|
|
84
86
|
onReset?: (payload: HeaderFilterResetPayload) => void;
|
|
87
|
+
/** 是否隐藏该列的排序图标,默认 false。优先级高于全局 HeaderFilterConfig.hideSort */
|
|
88
|
+
hideSort?: boolean;
|
|
85
89
|
}
|
|
86
90
|
/**
|
|
87
91
|
* 表头筛选确认事件 payload
|
|
@@ -48,6 +48,8 @@ export interface UseHeaderFilterReturn {
|
|
|
48
48
|
isFieldFilterable: (prop?: string) => boolean;
|
|
49
49
|
/** 判断字段是否允许显示(基于 fieldCatalog 的 nullable 属性) */
|
|
50
50
|
isFieldVisible: (prop?: string) => boolean;
|
|
51
|
+
/** 重置所有筛选条件和排序状态 */
|
|
52
|
+
resetAllHeaderFilters: () => void;
|
|
51
53
|
}
|
|
52
54
|
/**
|
|
53
55
|
* 表头筛选 Hook
|
|
@@ -126,6 +126,10 @@ function useHeaderFilter(options = {}) {
|
|
|
126
126
|
orderByState.push(next);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
+
const resetAllHeaderFilters = () => {
|
|
130
|
+
headerFiltersState.filters.splice(0);
|
|
131
|
+
orderByState.splice(0);
|
|
132
|
+
};
|
|
129
133
|
const getMergedQuery = (baseQuery) => {
|
|
130
134
|
const normalizeFilters = (filters) => {
|
|
131
135
|
return filters.map((f) => {
|
|
@@ -178,7 +182,8 @@ function useHeaderFilter(options = {}) {
|
|
|
178
182
|
getMergedQuery,
|
|
179
183
|
updateCatalogs,
|
|
180
184
|
isFieldFilterable,
|
|
181
|
-
isFieldVisible
|
|
185
|
+
isFieldVisible,
|
|
186
|
+
resetAllHeaderFilters
|
|
182
187
|
};
|
|
183
188
|
}
|
|
184
189
|
|