cnhis-design-vue 3.1.33-beta.9 → 3.1.33
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/big-table/index.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +7 -9
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-time.js +5 -3
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +2 -1
- package/es/components/big-table/src/components/edit-form/useCommon.js +7 -3
- package/es/components/big-table/src/hooks/useFormat.js +1 -1
- package/es/components/button-print/index.d.ts +13 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +6 -1
- package/es/components/button-print/src/utils/print.d.ts +2 -2
- package/es/components/button-print/src/utils/print.js +7 -4
- package/es/components/fabric-chart/index.d.ts +133 -2
- package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +132 -0
- package/es/components/fabric-chart/src/BirthProcessChart.vue.js +62 -8
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +133 -2
- package/es/components/fabric-chart/src/FabricChart.vue.js +2 -2
- package/es/components/fabric-chart/src/TemperatureChart.vue.d.ts +1 -2
- package/es/components/fabric-chart/src/TemperatureChart.vue.js +17 -9
- package/es/components/fabric-chart/src/components/PopupMenu.js +2 -2
- package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +3 -2
- package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +23 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +305 -9
- package/es/components/fabric-chart/src/hooks/useCenter.d.ts +0 -2
- package/es/components/fabric-chart/src/hooks/useCenter.js +27 -45
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +8 -0
- package/es/components/fabric-chart/src/hooks/useCommon.js +32 -0
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +5 -2
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +27 -10
- package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useLeft.js +12 -7
- package/es/components/fabric-chart/src/interface.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/utils.d.ts +11 -0
- package/es/components/fabric-chart/src/utils/utils.js +27 -0
- package/es/components/iho-table/index.d.ts +4 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -3
- package/es/components/iho-table/src/IhoTable.vue.js +6 -4
- package/es/components/iho-table/src/components/IhoTableColumn.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +3 -3
- package/es/components/iho-table/src/constants/index.js +0 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +5 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +10 -9
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +119 -119
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +5 -3
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +16 -4
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.js +9 -4
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +6 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +51 -24
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +37 -51
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +181 -20
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +2 -6
- package/es/components/iho-table/src/plugins/filterPlugin/types.js +0 -7
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +7 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +3 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +3 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +3 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +5 -2
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +7 -4
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +10 -12
- package/es/components/iho-table/src/types/pluginType.d.ts +28 -12
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/keyboard/index.d.ts +62 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +62 -1
- package/es/components/keyboard/src/Keyboard.vue.js +4 -1
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +67 -5
- package/es/components/keyboard/src/components/NumberPanel.vue.js +48 -26
- package/es/components/keyboard/style/index.css +1 -1
- package/package.json +2 -2
- package/es/components/big-table/src/components/edit-form/dist/edit-date.d.ts +0 -36
- package/es/components/big-table/src/components/edit-form/dist/edit-select.d.ts +0 -37
- package/es/components/big-table/src/components/edit-form/dist/edit-time.d.ts +0 -45
- package/es/components/fabric-chart/src/constants/index.d.ts +0 -4
- package/es/components/fabric-chart/src/constants/index.js +0 -4
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +0 -65
- package/es/components/form-render/src/components/renderer/dist/radio.d.ts +0 -64
- package/es/components/form-render/src/components/renderer/dist/remoteSearch.d.ts +0 -46
- package/es/components/form-render/src/components/renderer/dist/search.d.ts +0 -56
- package/es/components/form-render/src/components/renderer/dist/select.d.ts +0 -55
- package/es/components/iho-table/src/components/dist/IhoTableColumn.d.ts +0 -20
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dist/inputRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dist/numberRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dist/timeRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/dist/editSelect.d.ts +0 -42
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/dist/index.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneDeep, isString, isFunction, isArray } from 'lodash-es';
|
|
1
|
+
import { cloneDeep, isString, isFunction, pick, isArray } from 'lodash-es';
|
|
2
2
|
import { isObject } from '@vue/shared';
|
|
3
3
|
|
|
4
4
|
const REMOVE_PROPERTY = Symbol("remove property");
|
|
@@ -139,6 +139,11 @@ function useColumnConfigAdaptor() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
+
result.componentProps = Object.assign(
|
|
143
|
+
{},
|
|
144
|
+
result.componentProps,
|
|
145
|
+
pick(result, ["options", "multiple", "isDateDisabled"])
|
|
146
|
+
);
|
|
142
147
|
return result;
|
|
143
148
|
function valueTransfer(value, rule) {
|
|
144
149
|
var _a, _b;
|
|
@@ -15,7 +15,7 @@ function defaultConfigPlugin() {
|
|
|
15
15
|
showSeq: true,
|
|
16
16
|
selectType: "checkbox",
|
|
17
17
|
columnConfig: { resizable: true },
|
|
18
|
-
rowConfig: { height:
|
|
18
|
+
rowConfig: { height: 36, isHover: true, isCurrent: true, keyField: "theUniqueKey" },
|
|
19
19
|
mouseConfig: { selected: true },
|
|
20
20
|
showOverflow: "tooltip",
|
|
21
21
|
editConfig: {
|
|
@@ -1,38 +1,55 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
1
2
|
import { CSSProperties, PropType, ref } from 'vue';
|
|
2
|
-
import { VxeColumnPropTypes } from 'vxe-table';
|
|
3
|
-
import { FilterState, IHO_TABLE_FILTER_STATUS } from '../../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
3
|
+
import { VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
payload: {
|
|
6
6
|
type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
type: PropType<
|
|
9
|
+
options: {
|
|
10
|
+
type: PropType<AnyObject[]>;
|
|
11
|
+
default: () => never[];
|
|
12
|
+
};
|
|
13
|
+
checked: {
|
|
14
|
+
type: PropType<string[]>;
|
|
11
15
|
required: true;
|
|
12
16
|
};
|
|
17
|
+
sortStatus: {
|
|
18
|
+
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
19
|
+
};
|
|
13
20
|
}, {
|
|
14
21
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
15
22
|
payload: {
|
|
16
23
|
type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
|
|
17
24
|
required: true;
|
|
18
25
|
};
|
|
19
|
-
|
|
20
|
-
type: PropType<
|
|
26
|
+
options: {
|
|
27
|
+
type: PropType<AnyObject[]>;
|
|
28
|
+
default: () => never[];
|
|
29
|
+
};
|
|
30
|
+
checked: {
|
|
31
|
+
type: PropType<string[]>;
|
|
21
32
|
required: true;
|
|
22
33
|
};
|
|
23
|
-
|
|
34
|
+
sortStatus: {
|
|
35
|
+
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
36
|
+
};
|
|
37
|
+
}>> & {
|
|
38
|
+
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
39
|
+
"onUpdate:sortStatus"?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}>>;
|
|
41
|
+
emits: (event: "update:checked" | "update:sortStatus", ...args: any[]) => void;
|
|
24
42
|
uuid: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
sortStatus: import("vue").Ref<IHO_TABLE_FILTER_STATUS>;
|
|
43
|
+
checkedRef: import("vue").Ref<string[]> | import("vue").WritableComputedRef<string[]>;
|
|
44
|
+
sortStatusRef: import("vue").Ref<VxeTablePropTypes.SortOrder | undefined> | import("vue").WritableComputedRef<VxeTablePropTypes.SortOrder | undefined>;
|
|
45
|
+
checkedCacheRef: import("vue").Ref<string[]>;
|
|
29
46
|
filterVisible: import("vue").Ref<boolean>;
|
|
30
47
|
searchFilterText: import("vue").Ref<string>;
|
|
48
|
+
toggleFilterVisible: () => void;
|
|
31
49
|
close: () => void;
|
|
32
50
|
OPTION_ITEM_HEIGHT: number;
|
|
33
51
|
VIEW_CAPACITY: number;
|
|
34
|
-
|
|
35
|
-
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("../../../../../shared/types").AnyObject>[]>;
|
|
52
|
+
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
|
|
36
53
|
containerProps: {
|
|
37
54
|
ref: import("vue").Ref<any>;
|
|
38
55
|
onScroll: () => void;
|
|
@@ -46,17 +63,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
63
|
};
|
|
47
64
|
}>;
|
|
48
65
|
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
|
49
|
-
|
|
50
|
-
cancelSort: () => void;
|
|
66
|
+
confirmFilter: () => void;
|
|
51
67
|
sortStatusList: {
|
|
52
|
-
status:
|
|
68
|
+
status: VxeTablePropTypes.SortOrder;
|
|
53
69
|
text: string;
|
|
54
70
|
}[];
|
|
55
|
-
|
|
56
|
-
iconActive: import("vue").ComputedRef<number>;
|
|
57
|
-
toggleFilter: () => void;
|
|
71
|
+
setSort: (value: VxeTablePropTypes.SortOrder) => void;
|
|
72
|
+
iconActive: import("vue").ComputedRef<number | VxeTablePropTypes.SortOrder | undefined>;
|
|
58
73
|
FunnelSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
59
|
-
ref: typeof ref;
|
|
60
74
|
NButton: any;
|
|
61
75
|
NButtonGroup: any;
|
|
62
76
|
NCheckbox: any;
|
|
@@ -114,14 +128,27 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
128
|
NIcon: any;
|
|
115
129
|
NInput: any;
|
|
116
130
|
NPopover: any;
|
|
117
|
-
|
|
131
|
+
ref: typeof ref;
|
|
132
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:checked" | "update:sortStatus")[], "update:checked" | "update:sortStatus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
118
133
|
payload: {
|
|
119
134
|
type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
|
|
120
135
|
required: true;
|
|
121
136
|
};
|
|
122
|
-
|
|
123
|
-
type: PropType<
|
|
137
|
+
options: {
|
|
138
|
+
type: PropType<AnyObject[]>;
|
|
139
|
+
default: () => never[];
|
|
140
|
+
};
|
|
141
|
+
checked: {
|
|
142
|
+
type: PropType<string[]>;
|
|
124
143
|
required: true;
|
|
125
144
|
};
|
|
126
|
-
|
|
145
|
+
sortStatus: {
|
|
146
|
+
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
147
|
+
};
|
|
148
|
+
}>> & {
|
|
149
|
+
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
150
|
+
"onUpdate:sortStatus"?: ((...args: any[]) => any) | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
options: AnyObject[];
|
|
153
|
+
}>;
|
|
127
154
|
export default _default;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent, inject,
|
|
1
|
+
import { defineComponent, inject, ref, onDeactivated, watch, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle } from 'vue';
|
|
2
2
|
import { widthAppend } from '../../../../../shared/utils/index.js';
|
|
3
3
|
import { FunnelSharp } from '@vicons/ionicons5';
|
|
4
|
-
import { useVirtualList } from '@vueuse/core';
|
|
5
|
-
import { InjectionIhoTableUUID, InjectionIhoTableEmits } from '../../constants/index.js';
|
|
6
|
-
import { IHO_TABLE_FILTER_STATUS } from './types.js';
|
|
4
|
+
import { useVModel, useVirtualList } from '@vueuse/core';
|
|
7
5
|
import { NEllipsis, NPopover, NIcon, NInput, NCheckboxGroup, NCheckbox, NButtonGroup, NButton } from 'naive-ui';
|
|
6
|
+
import { InjectionIhoTableUUID } from '../../constants/index.js';
|
|
8
7
|
import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
|
|
9
8
|
|
|
10
9
|
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
@@ -18,29 +17,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
17
|
type: Object,
|
|
19
18
|
required: true
|
|
20
19
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
20
|
+
options: { type: Array, default: () => [] },
|
|
21
|
+
checked: { type: Array, required: true },
|
|
22
|
+
sortStatus: { type: String }
|
|
25
23
|
},
|
|
26
|
-
|
|
24
|
+
emits: ["update:checked", "update:sortStatus"],
|
|
25
|
+
setup(__props, { emit: emits }) {
|
|
27
26
|
const props = __props;
|
|
28
27
|
const uuid = inject(InjectionIhoTableUUID);
|
|
29
|
-
const
|
|
30
|
-
const
|
|
28
|
+
const checkedRef = useVModel(props, "checked", emits);
|
|
29
|
+
const sortStatusRef = useVModel(props, "sortStatus", emits);
|
|
30
|
+
const checkedCacheRef = ref([]);
|
|
31
31
|
const filterVisible = ref(false);
|
|
32
32
|
const searchFilterText = ref("");
|
|
33
|
+
function toggleFilterVisible() {
|
|
34
|
+
filterVisible.value = !filterVisible.value;
|
|
35
|
+
}
|
|
33
36
|
function close() {
|
|
34
37
|
filterVisible.value = false;
|
|
35
|
-
searchFilterText.value = "";
|
|
36
38
|
}
|
|
37
39
|
onDeactivated(close);
|
|
40
|
+
watch(filterVisible, (visible) => {
|
|
41
|
+
if (visible) {
|
|
42
|
+
checkedCacheRef.value = [...checkedRef.value];
|
|
43
|
+
searchFilterText.value = "";
|
|
44
|
+
}
|
|
45
|
+
});
|
|
38
46
|
const OPTION_ITEM_HEIGHT = 32;
|
|
39
47
|
const VIEW_CAPACITY = 10;
|
|
40
|
-
let checkedCache = [];
|
|
41
48
|
const { list, containerProps, wrapperProps } = useVirtualList(
|
|
42
49
|
computed(() => {
|
|
43
|
-
return searchFilterText.value ? options.
|
|
50
|
+
return searchFilterText.value ? props.options.filter((option) => option.key.includes(searchFilterText.value)) : props.options;
|
|
44
51
|
}),
|
|
45
52
|
{
|
|
46
53
|
itemHeight: OPTION_ITEM_HEIGHT,
|
|
@@ -53,42 +60,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
60
|
height: widthAppend(OPTION_ITEM_HEIGHT * VIEW_CAPACITY)
|
|
54
61
|
};
|
|
55
62
|
});
|
|
56
|
-
function
|
|
57
|
-
sortStatus.value = IHO_TABLE_FILTER_STATUS.DEFAULT;
|
|
58
|
-
close();
|
|
59
|
-
globEmit("sortChange", { type: "filter", value: [...checked.value] });
|
|
60
|
-
}
|
|
61
|
-
function cancelSort() {
|
|
62
|
-
checked.value = checkedCache;
|
|
63
|
+
function confirmFilter() {
|
|
63
64
|
close();
|
|
65
|
+
emits("update:checked", checkedCacheRef.value);
|
|
64
66
|
}
|
|
65
67
|
const sortStatusList = [
|
|
66
|
-
{ status:
|
|
67
|
-
{ status:
|
|
68
|
+
{ status: "asc", text: "\u5347\u5E8F A to Z" },
|
|
69
|
+
{ status: "desc", text: "\u964D\u5E8F Z to A" }
|
|
68
70
|
];
|
|
69
|
-
function
|
|
70
|
-
if (value === sortStatus.value) {
|
|
71
|
-
sortStatus.value = IHO_TABLE_FILTER_STATUS.DEFAULT;
|
|
72
|
-
} else {
|
|
73
|
-
sortStatus.value = value;
|
|
74
|
-
}
|
|
75
|
-
checked.value = [];
|
|
71
|
+
function setSort(value) {
|
|
76
72
|
close();
|
|
77
|
-
|
|
73
|
+
emits("update:sortStatus", value);
|
|
78
74
|
}
|
|
79
75
|
const iconActive = computed(() => {
|
|
80
|
-
|
|
81
|
-
return ((_a = props.filterState) == null ? void 0 : _a.checked.length) || ((_b = props.filterState) == null ? void 0 : _b.sortStatus);
|
|
76
|
+
return checkedRef.value.length || sortStatusRef.value;
|
|
82
77
|
});
|
|
83
|
-
function toggleFilter() {
|
|
84
|
-
filterVisible.value = !filterVisible.value;
|
|
85
|
-
if (filterVisible.value) {
|
|
86
|
-
checkedCache = [...checked.value];
|
|
87
|
-
} else {
|
|
88
|
-
searchFilterText.value = "";
|
|
89
|
-
checkedCache = [];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
78
|
return (_ctx, _cache) => {
|
|
93
79
|
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
94
80
|
createVNode(unref(NEllipsis), { style: { "max-width": "calc(100% - 22px)" } }, {
|
|
@@ -105,7 +91,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
91
|
createVNode(unref(NIcon), {
|
|
106
92
|
class: normalizeClass(["iho-table__filterIcon", { "is-active": unref(iconActive) }]),
|
|
107
93
|
component: unref(FunnelSharp),
|
|
108
|
-
onClick:
|
|
94
|
+
onClick: toggleFilterVisible
|
|
109
95
|
}, null, 8, ["class", "component"])
|
|
110
96
|
]),
|
|
111
97
|
default: withCtx(() => [
|
|
@@ -113,8 +99,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
99
|
(openBlock(), createElementBlock(Fragment, null, renderList(sortStatusList, (item) => {
|
|
114
100
|
return createElementVNode("div", {
|
|
115
101
|
key: item.status,
|
|
116
|
-
class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(
|
|
117
|
-
onClick: ($event) =>
|
|
102
|
+
class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(sortStatusRef) === item.status }]),
|
|
103
|
+
onClick: ($event) => setSort(item.status)
|
|
118
104
|
}, toDisplayString(item.text), 11, _hoisted_3);
|
|
119
105
|
}), 64)),
|
|
120
106
|
createVNode(unref(NInput), {
|
|
@@ -122,8 +108,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
108
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => searchFilterText.value = $event)
|
|
123
109
|
}, null, 8, ["value"]),
|
|
124
110
|
createVNode(unref(NCheckboxGroup), {
|
|
125
|
-
value:
|
|
126
|
-
"onUpdate:value": _cache[2] || (_cache[2] = ($event) =>
|
|
111
|
+
value: checkedCacheRef.value,
|
|
112
|
+
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => checkedCacheRef.value = $event)
|
|
127
113
|
}, {
|
|
128
114
|
default: withCtx(() => [
|
|
129
115
|
createElementVNode("section", {
|
|
@@ -152,18 +138,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
152
138
|
_: 1
|
|
153
139
|
}, 8, ["value"]),
|
|
154
140
|
createElementVNode("footer", _hoisted_4, [
|
|
155
|
-
createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${
|
|
141
|
+
createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${checkedCacheRef.value.length}\u9879`), 1),
|
|
156
142
|
createVNode(unref(NButtonGroup), { size: "tiny" }, {
|
|
157
143
|
default: withCtx(() => [
|
|
158
144
|
createVNode(unref(NButton), {
|
|
159
|
-
onClick: _cache[3] || (_cache[3] = ($event) =>
|
|
145
|
+
onClick: _cache[3] || (_cache[3] = ($event) => checkedCacheRef.value = [])
|
|
160
146
|
}, {
|
|
161
147
|
default: withCtx(() => [
|
|
162
148
|
createTextVNode("\u6E05\u7A7A")
|
|
163
149
|
]),
|
|
164
150
|
_: 1
|
|
165
151
|
}),
|
|
166
|
-
createVNode(unref(NButton), { onClick:
|
|
152
|
+
createVNode(unref(NButton), { onClick: close }, {
|
|
167
153
|
default: withCtx(() => [
|
|
168
154
|
createTextVNode("\u53D6\u6D88")
|
|
169
155
|
]),
|
|
@@ -171,7 +157,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
171
157
|
}),
|
|
172
158
|
createVNode(unref(NButton), {
|
|
173
159
|
type: "primary",
|
|
174
|
-
onClick:
|
|
160
|
+
onClick: confirmFilter
|
|
175
161
|
}, {
|
|
176
162
|
default: withCtx(() => [
|
|
177
163
|
createTextVNode("\u786E\u5B9A")
|
|
@@ -1,30 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { computed, createVNode, onBeforeUnmount, reactive } from 'vue';
|
|
2
|
+
import { isObject, isArray } from 'lodash-es';
|
|
3
3
|
import '../../../index.js';
|
|
4
4
|
import { IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS } from '../../constants/index.js';
|
|
5
|
-
import { IHO_TABLE_FILTER_STATUS } from './types.js';
|
|
6
5
|
import { useUUIDMap, IhoTableUtils } from '../../utils/index.js';
|
|
7
6
|
import FilterComponent from './filter.vue.js';
|
|
8
7
|
import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
|
|
9
8
|
|
|
10
9
|
function filterPlugin() {
|
|
11
10
|
const pluginName = "filterPlugin";
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const {
|
|
12
|
+
getItemFromUUID,
|
|
13
|
+
removeItemFromUUID
|
|
14
|
+
} = useUUIDMap(() => {
|
|
15
|
+
const stateMap = reactive(/* @__PURE__ */ new Map());
|
|
16
|
+
const filterSet = reactive(/* @__PURE__ */ new Set());
|
|
17
|
+
function setSort({
|
|
18
|
+
value,
|
|
19
|
+
field,
|
|
20
|
+
$table,
|
|
21
|
+
emits
|
|
22
|
+
}) {
|
|
23
|
+
const state = stateMap.get(field);
|
|
24
|
+
if (!state)
|
|
25
|
+
return;
|
|
26
|
+
const column = $table.getColumnByField(field);
|
|
27
|
+
if (!column)
|
|
28
|
+
return;
|
|
29
|
+
if (!state.sortStatus && !value)
|
|
30
|
+
return;
|
|
31
|
+
state.sortStatus = value === state.sortStatus ? null : value;
|
|
32
|
+
stateMap.forEach((state2, field2) => {
|
|
33
|
+
if (field2 === column.field)
|
|
34
|
+
return;
|
|
35
|
+
state2.sortStatus = null;
|
|
36
|
+
});
|
|
37
|
+
const payload = {
|
|
38
|
+
column,
|
|
39
|
+
field: column.field,
|
|
40
|
+
order: value,
|
|
41
|
+
property: column.field,
|
|
42
|
+
sortTime: Date.now()
|
|
43
|
+
};
|
|
44
|
+
emits("sortChange", {
|
|
45
|
+
$table,
|
|
46
|
+
$event: new PointerEvent("click"),
|
|
47
|
+
...payload,
|
|
48
|
+
sortList: [payload]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function setChecked({
|
|
52
|
+
value,
|
|
53
|
+
field,
|
|
54
|
+
$table,
|
|
55
|
+
emits
|
|
56
|
+
}) {
|
|
57
|
+
const state = stateMap.get(field);
|
|
58
|
+
if (!state)
|
|
59
|
+
return;
|
|
60
|
+
const column = $table.getColumnByField(field);
|
|
61
|
+
if (!column)
|
|
62
|
+
return;
|
|
63
|
+
if (value.length) {
|
|
64
|
+
filterSet.add(column.field);
|
|
65
|
+
} else {
|
|
66
|
+
filterSet.delete(column.field);
|
|
67
|
+
}
|
|
68
|
+
state.checked = value;
|
|
69
|
+
emits("filterChange", {
|
|
70
|
+
$event: new PointerEvent("click"),
|
|
71
|
+
$table,
|
|
72
|
+
...createFilterPayload(column.field, stateMap),
|
|
73
|
+
filterList: [...filterSet.values()].map((field2) => createFilterPayload(field2, stateMap))
|
|
74
|
+
});
|
|
75
|
+
function createFilterPayload(field2, stateMap2) {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
const column2 = $table.getColumnByField(field2);
|
|
78
|
+
return {
|
|
79
|
+
column: column2,
|
|
80
|
+
field: column2.field,
|
|
81
|
+
datas: [],
|
|
82
|
+
property: column2.field,
|
|
83
|
+
values: [...(_b = (_a = stateMap2.get(field2)) == null ? void 0 : _a.checked) != null ? _b : []]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
stateMap,
|
|
89
|
+
filterSet,
|
|
90
|
+
setChecked,
|
|
91
|
+
setSort
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
function initFilterState(uuid, field, initValue = {}) {
|
|
95
|
+
const {
|
|
96
|
+
stateMap,
|
|
97
|
+
setChecked,
|
|
98
|
+
setSort
|
|
99
|
+
} = getItemFromUUID(uuid);
|
|
100
|
+
return {
|
|
101
|
+
filterState: stateMap.set(field, stateMap.get(field) || {
|
|
18
102
|
options: [],
|
|
19
103
|
checked: initValue.checked || [],
|
|
20
|
-
sortStatus: initValue.sortStatus ||
|
|
21
|
-
}
|
|
22
|
-
|
|
104
|
+
sortStatus: initValue.sortStatus || null
|
|
105
|
+
}).get(field),
|
|
106
|
+
setChecked,
|
|
107
|
+
setSort
|
|
108
|
+
};
|
|
23
109
|
}
|
|
24
110
|
return defineTablePlugin({
|
|
25
111
|
name: pluginName,
|
|
26
112
|
apply(hooks) {
|
|
27
|
-
hooks.fieldHooks.fieldList.tap(pluginName, (fieldList, {
|
|
113
|
+
hooks.fieldHooks.fieldList.tap(pluginName, (fieldList, {
|
|
114
|
+
uuid
|
|
115
|
+
}, {
|
|
116
|
+
$table,
|
|
117
|
+
emits
|
|
118
|
+
}) => {
|
|
28
119
|
fieldList.forEach((fieldItem) => {
|
|
29
120
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
30
121
|
const lowCodeField = (_a = fieldItem.editRender) == null ? void 0 : _a.props;
|
|
@@ -36,15 +127,52 @@ function filterPlugin() {
|
|
|
36
127
|
return;
|
|
37
128
|
let options = (_d = (_c = (_b = fieldSetting.mapping) == null ? void 0 : _b.mappingFiled) == null ? void 0 : _c.map((item) => item.value[0])) != null ? _d : [];
|
|
38
129
|
if (isCompatibleColumn(lowCodeField)) {
|
|
39
|
-
options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({
|
|
130
|
+
options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({
|
|
131
|
+
...option,
|
|
132
|
+
key: option.label
|
|
133
|
+
}))) != null ? _f : [];
|
|
40
134
|
}
|
|
41
|
-
const
|
|
135
|
+
const {
|
|
136
|
+
filterState,
|
|
137
|
+
setChecked,
|
|
138
|
+
setSort
|
|
139
|
+
} = initFilterState(uuid, fieldItem.field, lowCodeField.filterDefaultValue);
|
|
42
140
|
filterState.options = options;
|
|
43
141
|
const oldHeader = (_g = fieldItem.slots) == null ? void 0 : _g.header;
|
|
142
|
+
const sortStatusRef = computed({
|
|
143
|
+
get: () => {
|
|
144
|
+
return filterState.sortStatus;
|
|
145
|
+
},
|
|
146
|
+
set: (value) => setSort({
|
|
147
|
+
field: fieldItem.field,
|
|
148
|
+
value,
|
|
149
|
+
$table: $table.value,
|
|
150
|
+
emits
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
const checkedRef = computed({
|
|
154
|
+
get: () => filterState.checked,
|
|
155
|
+
set: (value) => setChecked({
|
|
156
|
+
field: fieldItem.field,
|
|
157
|
+
value,
|
|
158
|
+
$table: $table.value,
|
|
159
|
+
emits
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
const optionsRef = computed(() => filterState.options);
|
|
44
163
|
fieldItem.slots = {
|
|
45
164
|
...fieldItem.slots,
|
|
46
165
|
header(payload) {
|
|
47
|
-
return
|
|
166
|
+
return createVNode(FilterComponent, {
|
|
167
|
+
"payload": payload,
|
|
168
|
+
"options": optionsRef.value,
|
|
169
|
+
"checked": checkedRef.value,
|
|
170
|
+
"onUpdate:checked": ($event) => checkedRef.value = $event,
|
|
171
|
+
"sortStatus": sortStatusRef.value,
|
|
172
|
+
"onUpdate:sortStatus": ($event) => sortStatusRef.value = $event
|
|
173
|
+
}, {
|
|
174
|
+
header: oldHeader
|
|
175
|
+
});
|
|
48
176
|
}
|
|
49
177
|
};
|
|
50
178
|
} catch (e) {
|
|
@@ -55,14 +183,47 @@ function filterPlugin() {
|
|
|
55
183
|
hooks.setupHooks.setup.tap(pluginName, (config) => {
|
|
56
184
|
onBeforeUnmount(() => config.value.uuid && removeItemFromUUID(config.value.uuid));
|
|
57
185
|
});
|
|
58
|
-
hooks.exposeHooks.expose.tap(pluginName, (expose, configRef
|
|
186
|
+
hooks.exposeHooks.expose.tap(pluginName, (expose, configRef, {
|
|
187
|
+
$table,
|
|
188
|
+
emits
|
|
189
|
+
}) => {
|
|
59
190
|
return {
|
|
60
191
|
...expose,
|
|
61
|
-
|
|
192
|
+
getFilterState(field) {
|
|
193
|
+
if (!configRef.value.uuid)
|
|
194
|
+
return;
|
|
195
|
+
const {
|
|
196
|
+
stateMap
|
|
197
|
+
} = getItemFromUUID(configRef.value.uuid);
|
|
198
|
+
const state = stateMap.get(field);
|
|
199
|
+
return state && {
|
|
200
|
+
checked: [...state.checked],
|
|
201
|
+
sortStatus: state.sortStatus
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
setFilterState(field, value) {
|
|
62
205
|
if (!configRef.value.uuid)
|
|
63
206
|
return;
|
|
64
|
-
const
|
|
65
|
-
|
|
207
|
+
const {
|
|
208
|
+
setChecked,
|
|
209
|
+
setSort
|
|
210
|
+
} = getItemFromUUID(configRef.value.uuid);
|
|
211
|
+
if (Reflect.has(value, "sortStatus")) {
|
|
212
|
+
setSort({
|
|
213
|
+
field,
|
|
214
|
+
value: value.sortStatus,
|
|
215
|
+
$table: $table.value,
|
|
216
|
+
emits
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
if (isArray(value.checked)) {
|
|
220
|
+
setChecked({
|
|
221
|
+
field,
|
|
222
|
+
value: value.checked,
|
|
223
|
+
$table: $table.value,
|
|
224
|
+
emits
|
|
225
|
+
});
|
|
226
|
+
}
|
|
66
227
|
}
|
|
67
228
|
};
|
|
68
229
|
});
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
|
-
|
|
3
|
-
DEFAULT = 0,
|
|
4
|
-
ASCENDING = 1,
|
|
5
|
-
DESCENDING = 2
|
|
6
|
-
}
|
|
2
|
+
import { VxeTablePropTypes } from 'vxe-table';
|
|
7
3
|
export declare type FilterState = {
|
|
8
4
|
options: AnyObject[];
|
|
9
5
|
checked: string[];
|
|
10
|
-
sortStatus:
|
|
6
|
+
sortStatus: VxeTablePropTypes.SortOrder;
|
|
11
7
|
};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
var IHO_TABLE_FILTER_STATUS = /* @__PURE__ */ ((IHO_TABLE_FILTER_STATUS2) => {
|
|
2
|
-
IHO_TABLE_FILTER_STATUS2[IHO_TABLE_FILTER_STATUS2["DEFAULT"] = 0] = "DEFAULT";
|
|
3
|
-
IHO_TABLE_FILTER_STATUS2[IHO_TABLE_FILTER_STATUS2["ASCENDING"] = 1] = "ASCENDING";
|
|
4
|
-
IHO_TABLE_FILTER_STATUS2[IHO_TABLE_FILTER_STATUS2["DESCENDING"] = 2] = "DESCENDING";
|
|
5
|
-
return IHO_TABLE_FILTER_STATUS2;
|
|
6
|
-
})(IHO_TABLE_FILTER_STATUS || {});
|
|
7
1
|
|
|
8
|
-
export { IHO_TABLE_FILTER_STATUS };
|
|
@@ -22,7 +22,7 @@ import { separateMetaModule } from '../../../../shared/utils/index.js';
|
|
|
22
22
|
const modules = Object.assign({
|
|
23
23
|
"./anchorPlugin/index.tsx": index,
|
|
24
24
|
"./defaultConfigPlugin/index.ts": index$1,
|
|
25
|
-
"./filterPlugin/index.
|
|
25
|
+
"./filterPlugin/index.tsx": index$2,
|
|
26
26
|
"./keyboardEventPlugin/index.ts": index$3,
|
|
27
27
|
"./lowCodeFieldAdaptorPlugin/index.ts": index$4,
|
|
28
28
|
"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx": index$5,
|
|
@@ -8,7 +8,7 @@ function keyboardEventPlugin() {
|
|
|
8
8
|
return defineTablePlugin({
|
|
9
9
|
name: pluginName,
|
|
10
10
|
apply(hooks) {
|
|
11
|
-
hooks.eventHooks.onKeydown.tap(pluginName, async ({ $event, $table }, { emits }) => {
|
|
11
|
+
hooks.eventHooks.onKeydown.tap(pluginName, async ({ $event, $table }, _, { emits }) => {
|
|
12
12
|
await promiseTimeout(0);
|
|
13
13
|
const activeCellInfo = $table.getSelectedCell();
|
|
14
14
|
const editCellInfo = $table.getEditRecord();
|
|
@@ -9,7 +9,7 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
9
9
|
return defineTablePlugin({
|
|
10
10
|
name: pluginName,
|
|
11
11
|
apply(hooks) {
|
|
12
|
-
hooks.fieldHooks.field.tap({ name: pluginName, stage: HIGHEST_PRIORITY }, (field) => {
|
|
12
|
+
hooks.fieldHooks.field.tap({ name: pluginName, stage: HIGHEST_PRIORITY }, (field, _, config) => {
|
|
13
13
|
const _field = field;
|
|
14
14
|
const result = {
|
|
15
15
|
className: _field.bold ? "iho-table__boldCell" : "",
|
|
@@ -17,20 +17,23 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
17
17
|
showOverflow: Reflect.has(_field, "showOverflow") ? _field.showOverflow : "tooltip",
|
|
18
18
|
visible: _field.isShow !== IHO_TABLE_NUMBER_STATUS.NEGATIVE,
|
|
19
19
|
width: _field.colWidth,
|
|
20
|
+
slots: { ..._field.slots, default: _field.slotFn, header: _field.headerSlotFn },
|
|
20
21
|
...pick(_field, ["title", "treeNode", "resizable"])
|
|
21
22
|
};
|
|
22
|
-
settingObjAdaptor(result, _field);
|
|
23
|
+
settingObjAdaptor(result, _field, config);
|
|
23
24
|
return result;
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function settingObjAdaptor(fieldItem, lowCodeField) {
|
|
29
|
+
function settingObjAdaptor(fieldItem, lowCodeField, config) {
|
|
29
30
|
var _a;
|
|
31
|
+
const props = cloneDeep(toRaw(lowCodeField));
|
|
32
|
+
props.componentProps = { size: config.size === "mini" ? "small" : config.size, ...props.componentProps };
|
|
30
33
|
fieldItem.editRender = {
|
|
31
34
|
autofocus: "input",
|
|
32
35
|
name: IhoTableUtils.getCellType(lowCodeField),
|
|
33
|
-
props
|
|
36
|
+
props
|
|
34
37
|
};
|
|
35
38
|
fieldItem.editRender.enabled = !Reflect.get(WIDGET_TYPE, fieldItem.editRender.name);
|
|
36
39
|
fieldItem.visible = ((_a = lowCodeField.settingObj) == null ? void 0 : _a.isHide) !== IHO_TABLE_STRING_STATUS.POSITIVE;
|
|
@@ -56,7 +56,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
56
56
|
const style = computed(() => ({
|
|
57
57
|
border: "1px solid #f5f5f5",
|
|
58
58
|
height: props.height - 16 + "px",
|
|
59
|
-
|
|
59
|
+
display: "flex",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
padding: "0",
|
|
60
62
|
background: "white",
|
|
61
63
|
wordBreak: "keep-all",
|
|
62
64
|
boxSizing: "border-box",
|