cnhis-design-vue 3.1.33-beta.5 → 3.1.33-beta.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/README.md +123 -123
- 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 +3 -2
- package/es/components/fabric-chart/index.d.ts +45 -0
- package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +2 -2
- package/es/components/fabric-chart/src/BirthProcessChart.vue.js +118 -0
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +45 -0
- package/es/components/fabric-chart/src/FabricChart.vue.js +3 -2
- package/es/components/fabric-chart/src/hooks/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +123 -0
- package/es/components/fabric-chart/src/hooks/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +13 -1
- package/es/components/fabric-chart/src/hooks/useGrid.d.ts +2 -3
- package/es/components/fabric-chart/src/hooks/useGrid.js +29 -45
- package/es/components/iho-table/index.d.ts +1 -0
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue.d.ts +1 -0
- package/es/components/iho-table/src/IhoTable.vue.js +7 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/index.js +3 -1
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +11 -0
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +26 -0
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +2 -1
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +17 -12
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +16 -5
- package/es/components/iho-table/src/types/index.d.ts +6 -1
- package/es/components/iho-table/src/types/index.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +4 -0
- package/es/components/iho-table/src/types/pluginType.js +3 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/shortcut-provider/src/utils/index.d.ts +0 -1
- package/es/components/shortcut-provider/src/utils/index.js +26 -3
- package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.js +3 -0
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -156,7 +156,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
156
156
|
pointMenuProps.point = { x, y };
|
|
157
157
|
pointMenuProps.show = true;
|
|
158
158
|
const { type } = ((_a = event2.target) == null ? void 0 : _a.origin) || {};
|
|
159
|
-
if (event2.target &&
|
|
159
|
+
if (event2.target && ["temperature", "pain"].includes(type)) {
|
|
160
160
|
if (type === "temperature") {
|
|
161
161
|
pointMenuProps.list = [...TEMPERATURE_MENU];
|
|
162
162
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { IPropItems, IPointType } from '../interface';
|
|
2
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
3
|
export declare function useCumputedPoint(propItems: IPropItems): {
|
|
3
4
|
cumputedX: (value: number | string, setAllCenter?: boolean) => any;
|
|
4
5
|
cumputedY: (type: IPointType, scaleValueList: number[], value: number | string) => number;
|
|
5
6
|
getXValue: (pointX: number) => string | undefined;
|
|
6
7
|
getYValue: (type: IPointType, pointY: number) => number;
|
|
7
8
|
};
|
|
9
|
+
export declare function useBirthProcessCumputedPoint(propItems: AnyObject): {
|
|
10
|
+
cumputedX: (value: number | string) => any;
|
|
11
|
+
};
|
|
@@ -56,5 +56,17 @@ function useCumputedPoint(propItems) {
|
|
|
56
56
|
getYValue
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
function useBirthProcessCumputedPoint(propItems) {
|
|
60
|
+
const { xAxis, originX, originY, xCellWidth } = propItems;
|
|
61
|
+
function cumputedX(value) {
|
|
62
|
+
const time = new Date(value).getTime();
|
|
63
|
+
const startTime = new Date(xAxis.time.startTime).getTime();
|
|
64
|
+
const timeCell = 1 * 60 * 60 * 1e3 / xCellWidth;
|
|
65
|
+
return (time - startTime) / timeCell + originX;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
cumputedX
|
|
69
|
+
};
|
|
70
|
+
}
|
|
59
71
|
|
|
60
|
-
export { useCumputedPoint };
|
|
72
|
+
export { useBirthProcessCumputedPoint, useCumputedPoint };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
|
-
import {
|
|
4
|
-
export default function useGrid(canvas: Ref<fabric.Canvas>, propItems:
|
|
5
|
-
export declare function useBirthProcessGrid(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
|
|
3
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
4
|
+
export default function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject, isBirthProcess?: boolean): void;
|
|
@@ -2,36 +2,46 @@ import { onMounted, nextTick } from 'vue';
|
|
|
2
2
|
import { fabric } from '../utils/index.js';
|
|
3
3
|
import { drawLine, defaultBorderStyle } from './useDraw.js';
|
|
4
4
|
|
|
5
|
-
function useGrid(canvas, propItems) {
|
|
6
|
-
var _a, _b;
|
|
5
|
+
function useGrid(canvas, propItems, isBirthProcess = false) {
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
7
|
const { gridYNumber, originY, grid, originX, endX, xCellWidth, yCellHeight, gridXNumber, endY } = propItems;
|
|
8
8
|
const yList = [];
|
|
9
9
|
const xList = [];
|
|
10
10
|
const mainList = /* @__PURE__ */ new Set();
|
|
11
11
|
for (let i = 0; i <= gridYNumber; i++) {
|
|
12
12
|
const y = originY + parseInt(String(yCellHeight * (gridYNumber - i)));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (i % grid.subYCell === 0) {
|
|
16
|
-
mainList.add(line);
|
|
17
|
-
} else {
|
|
13
|
+
if (isBirthProcess) {
|
|
14
|
+
const line = drawLine([originX, y, endX, y], { ...defaultBorderStyle, ...((_a = grid.mainLineStyle) == null ? void 0 : _a.x) || {} });
|
|
18
15
|
yList.push(line);
|
|
16
|
+
} else {
|
|
17
|
+
const style = i % grid.subYCell === 0 ? ((_b = grid.mainLineStyle) == null ? void 0 : _b.x) || {} : grid.subLineStyle || {};
|
|
18
|
+
const line = drawLine([originX, y, endX, y], style);
|
|
19
|
+
if (i % grid.subYCell === 0) {
|
|
20
|
+
mainList.add(line);
|
|
21
|
+
} else {
|
|
22
|
+
yList.push(line);
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
for (let i = 0; i <= gridXNumber; i++) {
|
|
22
27
|
const x = originX + parseInt(String(xCellWidth * i));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
style = grid.subSecondLineStyle || {};
|
|
26
|
-
}
|
|
27
|
-
if (i % grid.subXCell === 0) {
|
|
28
|
-
style = i !== 0 && i !== gridXNumber ? ((_b = grid.mainLineStyle) == null ? void 0 : _b.y) || {} : defaultBorderStyle;
|
|
29
|
-
}
|
|
30
|
-
const line = drawLine([x, originY, x, endY], style);
|
|
31
|
-
if (i % grid.subXCell === 0 && i !== 0 && i !== gridXNumber) {
|
|
32
|
-
mainList.add(line);
|
|
33
|
-
} else {
|
|
28
|
+
if (isBirthProcess) {
|
|
29
|
+
const line = drawLine([x, originY, x, endY], { ...defaultBorderStyle, ...((_c = grid.mainLineStyle) == null ? void 0 : _c.y) || {} });
|
|
34
30
|
xList.push(line);
|
|
31
|
+
} else {
|
|
32
|
+
let style = grid.subLineStyle || {};
|
|
33
|
+
if (i % grid.subSecondXCell === 0) {
|
|
34
|
+
style = grid.subSecondLineStyle || {};
|
|
35
|
+
}
|
|
36
|
+
if (i % grid.subXCell === 0) {
|
|
37
|
+
style = i !== 0 && i !== gridXNumber ? ((_d = grid.mainLineStyle) == null ? void 0 : _d.y) || {} : defaultBorderStyle;
|
|
38
|
+
}
|
|
39
|
+
const line = drawLine([x, originY, x, endY], style);
|
|
40
|
+
if (i % grid.subXCell === 0 && i !== 0 && i !== gridXNumber) {
|
|
41
|
+
mainList.add(line);
|
|
42
|
+
} else {
|
|
43
|
+
xList.push(line);
|
|
44
|
+
}
|
|
35
45
|
}
|
|
36
46
|
}
|
|
37
47
|
const group = new fabric.Group([...xList, ...yList, ...mainList], {
|
|
@@ -45,31 +55,5 @@ function useGrid(canvas, propItems) {
|
|
|
45
55
|
});
|
|
46
56
|
});
|
|
47
57
|
}
|
|
48
|
-
function useBirthProcessGrid(canvas, propItems) {
|
|
49
|
-
var _a, _b;
|
|
50
|
-
const { gridYNumber, originY, grid, originX, endX, xCellWidth, yCellHeight, gridXNumber, endY } = propItems;
|
|
51
|
-
const yList = [];
|
|
52
|
-
const xList = [];
|
|
53
|
-
for (let i = 0; i <= gridYNumber; i++) {
|
|
54
|
-
const y = originY + parseInt(String(yCellHeight * (gridYNumber - i)));
|
|
55
|
-
const line = drawLine([originX, y, endX, y], { ...defaultBorderStyle, ...((_a = grid.mainLineStyle) == null ? void 0 : _a.x) || {} });
|
|
56
|
-
yList.push(line);
|
|
57
|
-
}
|
|
58
|
-
for (let i = 0; i <= gridXNumber; i++) {
|
|
59
|
-
const x = originX + parseInt(String(xCellWidth * i));
|
|
60
|
-
const line = drawLine([x, originY, x, endY], { ...defaultBorderStyle, ...((_b = grid.mainLineStyle) == null ? void 0 : _b.y) || {} });
|
|
61
|
-
xList.push(line);
|
|
62
|
-
}
|
|
63
|
-
const group = new fabric.Group([...xList, ...yList], {
|
|
64
|
-
evented: false,
|
|
65
|
-
selectable: false
|
|
66
|
-
});
|
|
67
|
-
onMounted(() => {
|
|
68
|
-
nextTick(() => {
|
|
69
|
-
canvas.value.add(group);
|
|
70
|
-
canvas.value.sendToBack(group);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
58
|
|
|
75
|
-
export { useGrid as default
|
|
59
|
+
export { useGrid as default };
|
|
@@ -111,6 +111,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
111
111
|
dataHooks: import("../../../es/components/iho-table/src/types").AbstractDataHooks;
|
|
112
112
|
setupHooks: import("../../../es/components/iho-table/src/types").AbstractSetupHooks;
|
|
113
113
|
domInsertHooks: import("../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
|
|
114
|
+
exposeHooks: import("../../../es/components/iho-table/src/types").AbstractExposeHooks;
|
|
114
115
|
}>;
|
|
115
116
|
configRef: import("vue").Ref<{
|
|
116
117
|
[x: string]: unknown;
|
|
@@ -15,7 +15,7 @@ import '../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
|
15
15
|
import '../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
16
16
|
import '../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
17
17
|
import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
18
|
-
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './src/types/pluginType.js';
|
|
18
|
+
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractExposeHooks, AbstractFieldHooks, AbstractSetupHooks } from './src/types/pluginType.js';
|
|
19
19
|
import { useTablePlugin } from './src/hooks/useTablePlugin.js';
|
|
20
20
|
export { defineTablePlugin, useTablePlugin } from './src/hooks/useTablePlugin.js';
|
|
21
21
|
export { useColumnConfigAdaptor } from './src/hooks/useColumnConfigAdaptor.js';
|
|
@@ -110,6 +110,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
dataHooks: import("../../../../es/components/iho-table/src/types").AbstractDataHooks;
|
|
111
111
|
setupHooks: import("../../../../es/components/iho-table/src/types").AbstractSetupHooks;
|
|
112
112
|
domInsertHooks: import("../../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
|
|
113
|
+
exposeHooks: import("../../../../es/components/iho-table/src/types").AbstractExposeHooks;
|
|
113
114
|
}>;
|
|
114
115
|
configRef: import("vue").Ref<{
|
|
115
116
|
[x: string]: unknown;
|
|
@@ -90,7 +90,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
90
90
|
_updateFieldListRef();
|
|
91
91
|
_updateTableDataRef();
|
|
92
92
|
const { header, footer } = createDomInsertComponent(hooks);
|
|
93
|
-
expose({
|
|
93
|
+
expose({
|
|
94
|
+
$table,
|
|
95
|
+
setFilter(fieldName, value) {
|
|
96
|
+
return { fieldName, value };
|
|
97
|
+
},
|
|
98
|
+
...hooks.exposeHooks.expose.call({}, configRef)
|
|
99
|
+
});
|
|
94
100
|
hooks.setupHooks.setup.call(configRef, fieldListRef);
|
|
95
101
|
return (_ctx, _cache) => {
|
|
96
102
|
const _component_vxe_table = resolveComponent("vxe-table");
|
|
@@ -10,6 +10,7 @@ export declare const createTableHooks: () => Readonly<{
|
|
|
10
10
|
dataHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDataHooks;
|
|
11
11
|
setupHooks: import("../../../../../../es/components/iho-table/src/types").AbstractSetupHooks;
|
|
12
12
|
domInsertHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
|
|
13
|
+
exposeHooks: import("../../../../../../es/components/iho-table/src/types").AbstractExposeHooks;
|
|
13
14
|
}>;
|
|
14
15
|
export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig): IhoTableConfig;
|
|
15
16
|
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig): IhoTableFieldItem[];
|
|
@@ -5,6 +5,7 @@ import { VxeEventListenerNameList } from '../../constants/index.js';
|
|
|
5
5
|
import { useDataHooks } from './useDataHooks.js';
|
|
6
6
|
import { useDomInsertHooks } from './useDomInsertHooks.js';
|
|
7
7
|
import { useEventHooks } from './useEventHooks.js';
|
|
8
|
+
import { useExposeHooks } from './useExposeHooks.js';
|
|
8
9
|
import { useSetupHooks } from './useSetupHooks.js';
|
|
9
10
|
import { getEventName } from '../../utils/index.js';
|
|
10
11
|
import { useConfigHooks } from './useConfigHooks.js';
|
|
@@ -19,7 +20,8 @@ const createTableHooks = (() => {
|
|
|
19
20
|
eventHooks: useEventHooks().create(),
|
|
20
21
|
dataHooks: useDataHooks().create(),
|
|
21
22
|
setupHooks: useSetupHooks().create(),
|
|
22
|
-
domInsertHooks: useDomInsertHooks().create()
|
|
23
|
+
domInsertHooks: useDomInsertHooks().create(),
|
|
24
|
+
exposeHooks: useExposeHooks().create()
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
return () => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Func } from '../../../../../../es/shared/types';
|
|
2
|
+
import { SyncWaterfallHook } from '../../../../../../es/shared/utils/tapable';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
import { AbstractExposeHooks, IhoTableConfig } from '../../../../../../es/components/iho-table/src/types';
|
|
5
|
+
declare class ExposeHooks extends AbstractExposeHooks {
|
|
6
|
+
readonly expose: SyncWaterfallHook<[Record<string, Func<any[], any>>, Ref<IhoTableConfig>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
7
|
+
}
|
|
8
|
+
export declare function useExposeHooks(): {
|
|
9
|
+
create: () => ExposeHooks;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
2
|
+
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
3
|
+
import SyncWaterfallHook from '../../../../../shared/utils/tapable/SyncWaterfallHook.js';
|
|
4
|
+
import '../../../../../shared/utils/tapable/SyncLoopHook.js';
|
|
5
|
+
import '../../../../../shared/utils/tapable/AsyncParallelHook.js';
|
|
6
|
+
import '../../../../../shared/utils/tapable/AsyncParallelBailHook.js';
|
|
7
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
8
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
9
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
10
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
11
|
+
import { AbstractExposeHooks } from '../../types/pluginType.js';
|
|
12
|
+
|
|
13
|
+
class ExposeHooks extends AbstractExposeHooks {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.expose = new SyncWaterfallHook(["expose", "config"]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function useExposeHooks() {
|
|
20
|
+
function create() {
|
|
21
|
+
return new ExposeHooks();
|
|
22
|
+
}
|
|
23
|
+
return { create };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useExposeHooks };
|
|
@@ -53,8 +53,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
text: string;
|
|
54
54
|
}[];
|
|
55
55
|
setSortStatus: (value: IHO_TABLE_FILTER_STATUS) => void;
|
|
56
|
+
iconActive: import("vue").ComputedRef<number>;
|
|
56
57
|
toggleFilter: () => void;
|
|
57
|
-
|
|
58
|
+
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<{}>>, {}>;
|
|
58
59
|
ref: typeof ref;
|
|
59
60
|
NButton: any;
|
|
60
61
|
NButtonGroup: any;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent, inject, toRefs, ref, onDeactivated, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList,
|
|
1
|
+
import { defineComponent, inject, toRefs, ref, onDeactivated, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, normalizeClass, createElementVNode, Fragment, renderList, isRef, normalizeStyle } from 'vue';
|
|
2
2
|
import { widthAppend } from '../../../../../shared/utils/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { FunnelSharp } from '@vicons/ionicons5';
|
|
4
4
|
import { useVirtualList } from '@vueuse/core';
|
|
5
5
|
import { InjectionIhoTableUUID, InjectionIhoTableEmits } from '../../constants/index.js';
|
|
6
6
|
import { IHO_TABLE_FILTER_STATUS } from './types.js';
|
|
7
7
|
import { NEllipsis, NPopover, NIcon, NInput, NCheckboxGroup, NCheckbox, NButtonGroup, NButton } from 'naive-ui';
|
|
8
8
|
import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
|
|
9
9
|
|
|
10
|
-
const _hoisted_1 = {
|
|
11
|
-
const _hoisted_2 =
|
|
12
|
-
const _hoisted_3 =
|
|
10
|
+
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
11
|
+
const _hoisted_2 = { class: "iho-table__filterWrapper" };
|
|
12
|
+
const _hoisted_3 = ["onClick"];
|
|
13
|
+
const _hoisted_4 = { class: "iho-table__filterFooter" };
|
|
13
14
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
15
|
__name: "filter",
|
|
15
16
|
props: {
|
|
@@ -75,6 +76,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
76
|
close();
|
|
76
77
|
globEmit("sortChange", { type: "sort", value: sortStatus.value });
|
|
77
78
|
}
|
|
79
|
+
const iconActive = computed(() => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
return ((_a = props.filterState) == null ? void 0 : _a.checked.length) || ((_b = props.filterState) == null ? void 0 : _b.sortStatus);
|
|
82
|
+
});
|
|
78
83
|
function toggleFilter() {
|
|
79
84
|
filterVisible.value = !filterVisible.value;
|
|
80
85
|
if (filterVisible.value) {
|
|
@@ -85,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
return (_ctx, _cache) => {
|
|
88
|
-
return openBlock(), createElementBlock("section",
|
|
93
|
+
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
89
94
|
createVNode(unref(NEllipsis), { style: { "max-width": "calc(100% - 22px)" } }, {
|
|
90
95
|
default: withCtx(() => [
|
|
91
96
|
createTextVNode(toDisplayString(__props.payload.column.title), 1)
|
|
@@ -98,19 +103,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
98
103
|
}, {
|
|
99
104
|
trigger: withCtx(() => [
|
|
100
105
|
createVNode(unref(NIcon), {
|
|
101
|
-
class: "iho-table__filterIcon",
|
|
102
|
-
component: unref(
|
|
106
|
+
class: normalizeClass(["iho-table__filterIcon", { "is-active": unref(iconActive) }]),
|
|
107
|
+
component: unref(FunnelSharp),
|
|
103
108
|
onClick: toggleFilter
|
|
104
|
-
}, null, 8, ["component"])
|
|
109
|
+
}, null, 8, ["class", "component"])
|
|
105
110
|
]),
|
|
106
111
|
default: withCtx(() => [
|
|
107
|
-
createElementVNode("section",
|
|
112
|
+
createElementVNode("section", _hoisted_2, [
|
|
108
113
|
(openBlock(), createElementBlock(Fragment, null, renderList(sortStatusList, (item) => {
|
|
109
114
|
return createElementVNode("div", {
|
|
110
115
|
key: item.status,
|
|
111
116
|
class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(sortStatus) === item.status }]),
|
|
112
117
|
onClick: ($event) => setSortStatus(item.status)
|
|
113
|
-
}, toDisplayString(item.text), 11,
|
|
118
|
+
}, toDisplayString(item.text), 11, _hoisted_3);
|
|
114
119
|
}), 64)),
|
|
115
120
|
createVNode(unref(NInput), {
|
|
116
121
|
value: searchFilterText.value,
|
|
@@ -146,7 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
146
151
|
]),
|
|
147
152
|
_: 1
|
|
148
153
|
}, 8, ["value"]),
|
|
149
|
-
createElementVNode("footer",
|
|
154
|
+
createElementVNode("footer", _hoisted_4, [
|
|
150
155
|
createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${unref(checked).length}\u9879`), 1),
|
|
151
156
|
createVNode(unref(NButtonGroup), { size: "tiny" }, {
|
|
152
157
|
default: withCtx(() => [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isObject, isArray } from 'lodash-es';
|
|
1
|
+
import { isObject, pick, isArray } from 'lodash-es';
|
|
2
2
|
import { h, onBeforeUnmount } from 'vue';
|
|
3
3
|
import '../../../index.js';
|
|
4
4
|
import { IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS } from '../../constants/index.js';
|
|
@@ -10,14 +10,14 @@ import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
|
|
|
10
10
|
function filterPlugin() {
|
|
11
11
|
const pluginName = "filterPlugin";
|
|
12
12
|
const { getItemFromUUID, removeItemFromUUID } = useUUIDMap(() => /* @__PURE__ */ new Map());
|
|
13
|
-
function initFilterState(uuid, fieldName) {
|
|
13
|
+
function initFilterState(uuid, fieldName, initValue = {}) {
|
|
14
14
|
const stateMap = getItemFromUUID(uuid);
|
|
15
15
|
return stateMap.set(
|
|
16
16
|
fieldName,
|
|
17
17
|
stateMap.get(fieldName) || {
|
|
18
18
|
options: [],
|
|
19
|
-
checked: [],
|
|
20
|
-
sortStatus: IHO_TABLE_FILTER_STATUS.DEFAULT
|
|
19
|
+
checked: initValue.checked || [],
|
|
20
|
+
sortStatus: initValue.sortStatus || IHO_TABLE_FILTER_STATUS.DEFAULT
|
|
21
21
|
}
|
|
22
22
|
).get(fieldName);
|
|
23
23
|
}
|
|
@@ -38,7 +38,7 @@ function filterPlugin() {
|
|
|
38
38
|
if (isCompatibleColumn(lowCodeField)) {
|
|
39
39
|
options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({ ...option, key: option.label }))) != null ? _f : [];
|
|
40
40
|
}
|
|
41
|
-
const filterState = initFilterState(uuid, fieldItem.field);
|
|
41
|
+
const filterState = initFilterState(uuid, fieldItem.field, lowCodeField.filterDefaultValue);
|
|
42
42
|
filterState.options = options;
|
|
43
43
|
const oldHeader = (_g = fieldItem.slots) == null ? void 0 : _g.header;
|
|
44
44
|
fieldItem.slots = {
|
|
@@ -55,6 +55,17 @@ function filterPlugin() {
|
|
|
55
55
|
hooks.setupHooks.setup.tap(pluginName, (config) => {
|
|
56
56
|
onBeforeUnmount(() => config.value.uuid && removeItemFromUUID(config.value.uuid));
|
|
57
57
|
});
|
|
58
|
+
hooks.exposeHooks.expose.tap(pluginName, (expose, configRef) => {
|
|
59
|
+
return {
|
|
60
|
+
...expose,
|
|
61
|
+
setFilter(fieldName, value) {
|
|
62
|
+
if (!configRef.value.uuid)
|
|
63
|
+
return;
|
|
64
|
+
const state = initFilterState(configRef.value.uuid, fieldName);
|
|
65
|
+
Object.assign(state, pick(value, ["checked", "sortStatus"]));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
58
69
|
function isCompatibleColumn(field) {
|
|
59
70
|
const filterTypes = ["SEARCH", "SELECT", "RADIO", "CHECKBOX"];
|
|
60
71
|
const notParticipatingSearch = field.notParticipatingSearch || "";
|
|
@@ -2,7 +2,7 @@ import { AnyObject, TupleToUnion } from '../../../../../es/shared/types';
|
|
|
2
2
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes } from 'vxe-table';
|
|
3
3
|
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
4
4
|
import { IHO_TABLE_STRING_STATUS, IhoTableCustomEventNameTuple, IhoTableEventNameTuple, IhoTableRowGroupSequence, VxeEventListenerNameList } from '../../../../../es/components/iho-table/src/constants';
|
|
5
|
-
import { IHO_TABLE_FILTER_STATUS } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
5
|
+
import { FilterState, IHO_TABLE_FILTER_STATUS } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
6
6
|
export * from './pluginType';
|
|
7
7
|
export interface IhoTableRowGroupItem {
|
|
8
8
|
groupName: string;
|
|
@@ -59,6 +59,10 @@ export declare type LowCodeTableFieldItem = {
|
|
|
59
59
|
showOverflow: VxeTableDefines.ColumnInfo['showOverflow'];
|
|
60
60
|
options: AnyObject[];
|
|
61
61
|
annotation: boolean;
|
|
62
|
+
filterDefaultValue: Partial<{
|
|
63
|
+
checked: string[];
|
|
64
|
+
sortStatus: 0 | 1 | 2;
|
|
65
|
+
}>;
|
|
62
66
|
}> & Partial<Pick<VxeTableDefines.ColumnInfo, 'resizable'>>;
|
|
63
67
|
export declare type IhoTableFormChangePayload = {
|
|
64
68
|
column: IhoTableFieldItem;
|
|
@@ -89,4 +93,5 @@ export declare type IhoTableAnchorItem = {
|
|
|
89
93
|
};
|
|
90
94
|
export declare type IhoTableExpose = {
|
|
91
95
|
$table: VxeTableInstance;
|
|
96
|
+
setFilter(fieldName: string, value: Partial<Omit<FilterState, 'options'>>): void;
|
|
92
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './pluginType.js';
|
|
1
|
+
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractExposeHooks, AbstractFieldHooks, AbstractSetupHooks } from './pluginType.js';
|
|
@@ -26,6 +26,7 @@ export declare type TableHooks = Readonly<{
|
|
|
26
26
|
dataHooks: AbstractDataHooks;
|
|
27
27
|
setupHooks: AbstractSetupHooks;
|
|
28
28
|
domInsertHooks: AbstractDomInsertHooks;
|
|
29
|
+
exposeHooks: AbstractExposeHooks;
|
|
29
30
|
}>;
|
|
30
31
|
export declare type WithTableConfig<T = []> = T extends any[] ? [...T, IhoTableConfig] : [T, IhoTableConfig];
|
|
31
32
|
declare type ConfigHookType<T> = SyncWaterfallHook<WithTableConfig<T>>;
|
|
@@ -150,4 +151,7 @@ export declare abstract class AbstractDomInsertHooks {
|
|
|
150
151
|
abstract readonly header: SyncWaterfallHook<[VNode[]]>;
|
|
151
152
|
abstract readonly footer: SyncWaterfallHook<[VNode[]]>;
|
|
152
153
|
}
|
|
154
|
+
export declare abstract class AbstractExposeHooks {
|
|
155
|
+
abstract readonly expose: SyncWaterfallHook<[Record<string, Func>, Ref<IhoTableConfig>]>;
|
|
156
|
+
}
|
|
153
157
|
export {};
|
|
@@ -10,5 +10,7 @@ class AbstractSetupHooks {
|
|
|
10
10
|
}
|
|
11
11
|
class AbstractDomInsertHooks {
|
|
12
12
|
}
|
|
13
|
+
class AbstractExposeHooks {
|
|
14
|
+
}
|
|
13
15
|
|
|
14
|
-
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks };
|
|
16
|
+
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractExposeHooks, AbstractFieldHooks, AbstractSetupHooks };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.iho-table .vxe-table--render-default .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)}.iho-table .vxe-table--render-default .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#f2f2f2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;width:200px}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:#5585f5}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05)}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;height:32px;padding:0 8px}.iho-table__filterListItem:hover{background:rgba(0,0,0,.05)}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}.iho-table__headerWrapper{display:inline-flex}
|
|
1
|
+
.iho-table .vxe-table--render-default .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)}.iho-table .vxe-table--render-default .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#f2f2f2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterIcon.is-active{color:#5585f5}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;width:200px}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:#5585f5}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05)}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;height:32px;padding:0 8px}.iho-table__filterListItem:hover{background:rgba(0,0,0,.05)}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}.iho-table__headerWrapper{display:inline-flex}
|