@lx-frontend/wrap-element-ui 1.0.26 → 1.0.27
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 +4 -54
- package/package.json +8 -38
- package/src/components/AddMembers/index.vue +149 -0
- package/src/components/AuditSteps/index.vue +140 -0
- package/src/components/DemoComponent/index.vue +21 -0
- package/src/components/EditableTable/README.md +147 -0
- package/{dist/vue2/types/components/EditableTable/bizHooks/index.d.ts → src/components/EditableTable/bizHooks/index.ts} +1 -1
- package/src/components/EditableTable/bizHooks/useCellHover.ts +72 -0
- package/src/components/EditableTable/bizHooks/useColumnHeaderOperation.ts +339 -0
- package/src/components/EditableTable/bizHooks/useDefaultOperation.ts +96 -0
- package/src/components/EditableTable/bizHooks/useDragSort.ts +291 -0
- package/src/components/EditableTable/bizHooks/usePagination.ts +31 -0
- package/src/components/EditableTable/bizHooks/useRowBgColor.ts +44 -0
- package/src/components/EditableTable/bizHooks/useViewSetting.ts +206 -0
- package/src/components/EditableTable/features/bizColorSelect.vue +63 -0
- package/src/components/EditableTable/features/bizEditCell.vue +44 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue +40 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue +56 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue +94 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue +26 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.ts +131 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue +115 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue +39 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue +50 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +160 -0
- package/src/components/EditableTable/features/bizTableOperatePopover.vue +67 -0
- package/src/components/EditableTable/features/bizViewSettingDialog.vue +137 -0
- package/src/components/EditableTable/index.less +820 -0
- package/src/components/EditableTable/index.vue +682 -0
- package/src/components/EditableTable/pin-top.png +0 -0
- package/src/components/EditableTable/types/index.ts +212 -0
- package/src/components/Ellipsis/MultilineEllipsis.vue +141 -0
- package/src/components/Ellipsis/index.vue +119 -0
- package/src/components/LxTable/index.vue +296 -0
- package/src/components/PopoverForm/index.vue +66 -0
- package/src/components/SearchForm/index.vue +262 -0
- package/src/components/SearchForm/types/index.ts +81 -0
- package/src/components/SearchSelect/index.vue +153 -0
- package/src/components/helper.ts +37 -0
- package/src/components/index.ts +24 -0
- package/src/components/singleMessage/index.ts +44 -0
- package/dist/auto/index.mjs +0 -21
- package/dist/auto/types/index.d.ts +0 -9
- package/dist/vue2/index.css +0 -1
- package/dist/vue2/index.mjs +0 -3017
- package/dist/vue2/types/components/AddMembers/index.vue.d.ts +0 -31
- package/dist/vue2/types/components/AuditSteps/index.vue.d.ts +0 -46
- package/dist/vue2/types/components/DemoComponent/index.vue.d.ts +0 -2
- package/dist/vue2/types/components/EditableTable/bizHooks/useCellHover.d.ts +0 -11
- package/dist/vue2/types/components/EditableTable/bizHooks/useColumnHeaderOperation.d.ts +0 -34
- package/dist/vue2/types/components/EditableTable/bizHooks/useDefaultOperation.d.ts +0 -22
- package/dist/vue2/types/components/EditableTable/bizHooks/useDragSort.d.ts +0 -14
- package/dist/vue2/types/components/EditableTable/bizHooks/usePagination.d.ts +0 -12
- package/dist/vue2/types/components/EditableTable/bizHooks/useRowBgColor.d.ts +0 -15
- package/dist/vue2/types/components/EditableTable/bizHooks/useViewSetting.d.ts +0 -26
- package/dist/vue2/types/components/EditableTable/features/bizColorSelect.vue.d.ts +0 -25
- package/dist/vue2/types/components/EditableTable/features/bizEditCell.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.d.ts +0 -48
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue.d.ts +0 -21
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue.d.ts +0 -23
- package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/index.vue.d.ts +0 -311
- package/dist/vue2/types/components/EditableTable/features/bizTableOperatePopover.vue.d.ts +0 -32
- package/dist/vue2/types/components/EditableTable/features/bizViewSettingDialog.vue.d.ts +0 -30
- package/dist/vue2/types/components/EditableTable/index.vue.d.ts +0 -472
- package/dist/vue2/types/components/EditableTable/types/index.d.ts +0 -235
- package/dist/vue2/types/components/Ellipsis/MultilineEllipsis.vue.d.ts +0 -91
- package/dist/vue2/types/components/Ellipsis/index.vue.d.ts +0 -89
- package/dist/vue2/types/components/LxTable/index.vue.d.ts +0 -2
- package/dist/vue2/types/components/PopoverForm/index.vue.d.ts +0 -50
- package/dist/vue2/types/components/SearchForm/index.vue.d.ts +0 -116
- package/dist/vue2/types/components/SearchForm/types/index.d.ts +0 -65
- package/dist/vue2/types/components/SearchSelect/index.vue.d.ts +0 -53
- package/dist/vue2/types/components/helper.d.ts +0 -8
- package/dist/vue2/types/components/index.d.ts +0 -12
- package/dist/vue2/types/components/singleMessage/index.d.ts +0 -4
- package/dist/vue2/types/vue2/index.d.ts +0 -1363
- package/dist/vue3/index.css +0 -1
- package/dist/vue3/index.mjs +0 -2306
- package/dist/vue3/index.mjs.map +0 -1
- package/dist/vue3/types/components/EditableTable/features/bizColorSelect.vue.d.ts +0 -31
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.d.ts +0 -48
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue.d.ts +0 -23
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue.d.ts +0 -25
- package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/index.vue.d.ts +0 -77
- package/dist/vue3/types/components/EditableTable/features/bizTableOperatePopover.vue.d.ts +0 -36
- package/dist/vue3/types/components/EditableTable/features/bizViewSettingDialog.vue.d.ts +0 -35
- package/dist/vue3/types/components/EditableTable/hooks/index.d.ts +0 -9
- package/dist/vue3/types/components/EditableTable/hooks/useCellHover.d.ts +0 -19
- package/dist/vue3/types/components/EditableTable/hooks/useColumnHeaderOperation.d.ts +0 -37
- package/dist/vue3/types/components/EditableTable/hooks/useDefaultOperation.d.ts +0 -22
- package/dist/vue3/types/components/EditableTable/hooks/useDragSort.d.ts +0 -15
- package/dist/vue3/types/components/EditableTable/hooks/usePagination.d.ts +0 -12
- package/dist/vue3/types/components/EditableTable/hooks/useRowBgColor.d.ts +0 -18
- package/dist/vue3/types/components/EditableTable/hooks/useRowEdit.d.ts +0 -14
- package/dist/vue3/types/components/EditableTable/hooks/useTableRender.d.ts +0 -41
- package/dist/vue3/types/components/EditableTable/hooks/useViewSetting.d.ts +0 -26
- package/dist/vue3/types/components/EditableTable/index.vue.d.ts +0 -4478
- package/dist/vue3/types/components/EditableTable/types.d.ts +0 -419
- package/dist/vue3/types/components/helper.d.ts +0 -8
- package/dist/vue3/types/index.d.ts +0 -7
- package/dist/vue3/types/stories/EditableTable.fake.d.ts +0 -33
- package/dist/vue3/types/stories/EditableTable.hook.d.ts +0 -12
- package/dist/vue3/types/stories/EditableTable.stories.d.ts +0 -18
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { onBeforeUnmount, onMounted, ref, Ref } from 'vue';
|
|
2
|
+
import { IColumnConfig, IDraggingData, IEmits, IProps } from "../types"
|
|
3
|
+
import throttle from "lodash/throttle"
|
|
4
|
+
|
|
5
|
+
interface IUseDragSortParams {
|
|
6
|
+
props: IProps
|
|
7
|
+
emit: IEmits
|
|
8
|
+
viewSettingDragSortOptions: Ref<IColumnConfig[]>
|
|
9
|
+
beforeDragStart: () => boolean
|
|
10
|
+
currScope: Ref<any>
|
|
11
|
+
pageSize: Ref<number>
|
|
12
|
+
tableDomRef: Ref<any>
|
|
13
|
+
}
|
|
14
|
+
export function useDragSort({ props, emit, viewSettingDragSortOptions, pageSize, beforeDragStart, currScope, tableDomRef }: IUseDragSortParams) {
|
|
15
|
+
|
|
16
|
+
const draggingData = ref<IDraggingData>({}); // 拖拽相关数据
|
|
17
|
+
const isMouseDown = ref(false);
|
|
18
|
+
const dragType = ref<'row' | 'view-setting'>('row');
|
|
19
|
+
// 如果页面存在多个table实例,如果没有这个值来区分正在操作哪个表格,拖拽功能会有异常
|
|
20
|
+
const isOperating = ref(false);
|
|
21
|
+
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
tableDomRef.value.$el.addEventListener('mousedown', () => { isOperating.value = true });
|
|
24
|
+
document.addEventListener('mousedown', handleDocumentMouseDown);
|
|
25
|
+
document.addEventListener('mousemove', handleDocumentMouseMove);
|
|
26
|
+
document.addEventListener('mouseup', handleDocumentMouseUp);
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
onBeforeUnmount(() => {
|
|
30
|
+
tableDomRef.value.$el.removeEventListener('mousedown', () => isOperating.value = true);
|
|
31
|
+
document.removeEventListener('mousedown', handleDocumentMouseDown);
|
|
32
|
+
document.removeEventListener('mousemove', handleDocumentMouseMove);
|
|
33
|
+
document.removeEventListener('mouseup', handleDocumentMouseUp);
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const handleDocumentMouseDown = (e) => {
|
|
37
|
+
isMouseDown.value = true;
|
|
38
|
+
const target = e.target as HTMLElement
|
|
39
|
+
|
|
40
|
+
if (typeof target.dataset?.index === 'undefined') return
|
|
41
|
+
|
|
42
|
+
if ([...target.classList].includes('row-drag-target')) {
|
|
43
|
+
dragType.value = 'row';
|
|
44
|
+
if (!isOperating.value) return
|
|
45
|
+
// 处理列表行拖拽
|
|
46
|
+
handleDragMouseDown(e, +target.dataset.index);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if ([...target.classList].includes('editable-table-view-setting-drag-target')) {
|
|
50
|
+
dragType.value = 'view-setting';
|
|
51
|
+
// 处理显示设置拖拽
|
|
52
|
+
handleViewSettingDragMouseDown(e, +target.dataset.index);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const handleDocumentMouseMove = (e) => {
|
|
57
|
+
if (!isMouseDown.value || typeof draggingData.value.draggingIndex === 'undefined') {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
throttledMoveHandler(e);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const handleDocumentMouseUp = (e) => {
|
|
65
|
+
isOperating.value = false;
|
|
66
|
+
isMouseDown.value = false;
|
|
67
|
+
if (typeof draggingData.value.draggingIndex === 'undefined') {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (dragType.value === 'row') {
|
|
71
|
+
handleDragDrop(e, currScope.value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (dragType.value === 'view-setting') {
|
|
75
|
+
handleViewSettingDragDrop();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const handleDragMouseDown = (event, draggingIndex) => {
|
|
80
|
+
if (!beforeDragStart()) return
|
|
81
|
+
const rows = [...document.getElementsByClassName(`custom-row-classname`)] as HTMLElement[];
|
|
82
|
+
const rowDoms: Record<number, HTMLElement[]> = [];
|
|
83
|
+
for (let i = 0; i < rows.length; i++) {
|
|
84
|
+
const row = rows[i];
|
|
85
|
+
const clsIndex = ([...row.classList].find(cls => cls.startsWith(`custom-row-classname-`)) ?? '').split('-').pop() ?? 'NaN';
|
|
86
|
+
if (typeof +clsIndex === 'number') {
|
|
87
|
+
rowDoms[+clsIndex] = rowDoms[+clsIndex] || [];
|
|
88
|
+
rowDoms[+clsIndex].push(row);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
draggingData.value.isDragging = true;
|
|
93
|
+
draggingData.value.rowDoms = rowDoms;
|
|
94
|
+
draggingData.value.draggingIndex = +draggingIndex;
|
|
95
|
+
draggingData.value.rowsRange = [];
|
|
96
|
+
|
|
97
|
+
draggingData.value.startPosition = {
|
|
98
|
+
x: event.clientX,
|
|
99
|
+
y: event.clientY
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// 列表过大时拖拽有性能问题,所以拖拽范围限制在拖拽元素的上下15个元素内
|
|
103
|
+
const dragSemiRange = props.dragSemiRange ?? 15;
|
|
104
|
+
for (const i of Object.keys(rowDoms).map(Number)) {
|
|
105
|
+
if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange) {
|
|
106
|
+
draggingData.value.rowsRange[i] = undefined
|
|
107
|
+
continue
|
|
108
|
+
}
|
|
109
|
+
const rowdom = rowDoms[i];
|
|
110
|
+
// 在Chrom中,relative加z-index可以让拖拽更流畅,然而在Safari中无效
|
|
111
|
+
// 如果在Safari中relative有效,其实蒙层都没有必要了
|
|
112
|
+
rowdom.forEach(el => el.style.setProperty('position', 'relative'));
|
|
113
|
+
|
|
114
|
+
if (i !== draggingData.value.draggingIndex) {
|
|
115
|
+
rowdom.forEach(el => el.style.setProperty('transition', 'transform 0.25s ease'));
|
|
116
|
+
} else {
|
|
117
|
+
rowdom.forEach(el => el.style.setProperty('z-index', '100'));
|
|
118
|
+
// 当有固定列时,一行的内容并不是一个tr,而是两个或多个tr的叠加显示,其中有的列内容被隐藏
|
|
119
|
+
// 所以拖拽时,需要同时拖拽所有的tr,并显示所有内容,否则拖拽效果会显示异常
|
|
120
|
+
const tds = rowdom
|
|
121
|
+
.map(dom => dom.querySelectorAll('td'))
|
|
122
|
+
.reduce((pre, curr) => ([...pre, ...curr]), [] as HTMLElement[])
|
|
123
|
+
.filter(td => td.classList.contains('is-hidden'));
|
|
124
|
+
draggingData.value.hiddenTds = tds;
|
|
125
|
+
tds.forEach(td => td.classList.remove('is-hidden'));
|
|
126
|
+
|
|
127
|
+
// 生成一个蒙层,防止拖动时文字被选中
|
|
128
|
+
const fullScreenDiv = document.createElement('div');
|
|
129
|
+
fullScreenDiv.style.position = 'fixed';
|
|
130
|
+
fullScreenDiv.style.top = '0';
|
|
131
|
+
fullScreenDiv.style.left = '0';
|
|
132
|
+
fullScreenDiv.style.right = '0';
|
|
133
|
+
fullScreenDiv.style.bottom = '0';
|
|
134
|
+
fullScreenDiv.style.zIndex = '999';
|
|
135
|
+
fullScreenDiv.style.cursor = 'grabbing';
|
|
136
|
+
document.body.appendChild(fullScreenDiv);
|
|
137
|
+
draggingData.value.fullScreenDiv = fullScreenDiv;
|
|
138
|
+
}
|
|
139
|
+
// 计算每一行的高度范围
|
|
140
|
+
const rect = rowdom[0].getBoundingClientRect()
|
|
141
|
+
draggingData.value.rowsRange = draggingData.value.rowsRange || [];
|
|
142
|
+
draggingData.value.rowsRange[i] = ([
|
|
143
|
+
rect.top,
|
|
144
|
+
rect.bottom
|
|
145
|
+
]);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const calcPositionRowShouldBePlace = (rowsRange: ([number, number])[], draggingClientY: number) => {
|
|
150
|
+
if (!draggingData.value.rowsRange ||
|
|
151
|
+
typeof draggingData.value.draggingIndex === 'undefined' ||
|
|
152
|
+
typeof props.dragSemiRange === 'undefined'
|
|
153
|
+
) return;
|
|
154
|
+
const rangeLeft = draggingData.value.draggingIndex - props.dragSemiRange <= 0 ? 0 : draggingData.value.draggingIndex - props.dragSemiRange
|
|
155
|
+
const rangeRight = draggingData.value.draggingIndex + props.dragSemiRange >= draggingData.value.rowsRange.length ? draggingData.value.rowsRange.length - 1 : draggingData.value.draggingIndex + props.dragSemiRange
|
|
156
|
+
if (!rowsRange) return -1;
|
|
157
|
+
if (draggingClientY <= rowsRange[rangeLeft][0]) return rangeLeft;
|
|
158
|
+
if (draggingClientY >= rowsRange[rangeRight][1]) return rangeRight;
|
|
159
|
+
for (let i = rangeLeft; i <= rangeRight; i++) {
|
|
160
|
+
const [top, bottom] = rowsRange[i];
|
|
161
|
+
if (draggingClientY > top && draggingClientY < bottom) {
|
|
162
|
+
return i;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return -1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const clearMovingData = () => {
|
|
169
|
+
const rowdoms = draggingData.value.rowDoms || [];
|
|
170
|
+
const draggingIndex = draggingData.value.draggingIndex ?? -1
|
|
171
|
+
const dragSemiRange = props.dragSemiRange ?? 15;
|
|
172
|
+
for (const i of Object.keys(rowdoms).map(Number)) {
|
|
173
|
+
if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange) continue
|
|
174
|
+
const doms = rowdoms[i];
|
|
175
|
+
doms.forEach(el => {
|
|
176
|
+
el.style.removeProperty('position');
|
|
177
|
+
el.style.removeProperty('transition');
|
|
178
|
+
el.style.removeProperty('transform');
|
|
179
|
+
el.style.removeProperty('z-index');
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
draggingData.value.fullScreenDiv?.parentNode?.removeChild(draggingData.value.fullScreenDiv);
|
|
183
|
+
draggingData.value.hiddenTds?.forEach(el => el.classList.add('is-hidden'));
|
|
184
|
+
draggingData.value = {};
|
|
185
|
+
currScope.value = null
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const handleDragDrop = (event, scope) => {
|
|
189
|
+
if (!scope) return
|
|
190
|
+
const { draggingIndex = 0, dropIndex = draggingIndex } = draggingData.value;
|
|
191
|
+
const dataList = scope.store.states.data;
|
|
192
|
+
const movedRow = dataList[draggingIndex];
|
|
193
|
+
const newList = [
|
|
194
|
+
...dataList.slice(0, +draggingIndex),
|
|
195
|
+
...dataList.slice(draggingIndex + 1)
|
|
196
|
+
];
|
|
197
|
+
newList.splice(dropIndex, 0, movedRow);
|
|
198
|
+
scope.store.states.data = newList;
|
|
199
|
+
emit('row-drag-drop', {
|
|
200
|
+
row: movedRow,
|
|
201
|
+
fromIndex: draggingIndex,
|
|
202
|
+
toIndex: dropIndex,
|
|
203
|
+
page: props.currentPage,
|
|
204
|
+
size: pageSize.value
|
|
205
|
+
});
|
|
206
|
+
// 清理工作
|
|
207
|
+
clearMovingData();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const handleViewSettingDragMouseDown = (event, index) => {
|
|
211
|
+
const rowDoms = [...document.getElementsByClassName('editable-table-view-setting-draggable-item')]
|
|
212
|
+
.reduce((pre, item, index) => ({ ...pre, [index]: [item] }), {});
|
|
213
|
+
draggingData.value.isDragging = true;
|
|
214
|
+
draggingData.value.rowDoms = rowDoms;
|
|
215
|
+
draggingData.value.draggingIndex = +index;
|
|
216
|
+
draggingData.value.startPosition = {
|
|
217
|
+
x: event.clientX,
|
|
218
|
+
y: event.clientY
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
for (const i of Object.keys(rowDoms).map(Number)) {
|
|
222
|
+
const rowdoms = rowDoms[i];
|
|
223
|
+
rowdoms.forEach((el) => {
|
|
224
|
+
el.style.setProperty('position', 'relative');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
if (i !== draggingData.value.draggingIndex) {
|
|
228
|
+
rowdoms.forEach(el => el.style.setProperty('transition', 'transform 0.25s ease'));
|
|
229
|
+
}
|
|
230
|
+
const rect = rowdoms[0].getBoundingClientRect();
|
|
231
|
+
draggingData.value.rowsRange = draggingData.value.rowsRange || [];
|
|
232
|
+
draggingData.value.rowsRange.push([
|
|
233
|
+
rect.top,
|
|
234
|
+
rect.bottom
|
|
235
|
+
]);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const handleMove = (event) => {
|
|
240
|
+
if (!draggingData.value.isDragging) return;
|
|
241
|
+
const { y = 0 } = draggingData.value.startPosition || {};
|
|
242
|
+
const { draggingIndex = -1, rowDoms = {} } = draggingData.value;
|
|
243
|
+
const draggingRow = rowDoms?.[draggingIndex ?? 0];
|
|
244
|
+
for (let i = 0; i < draggingRow.length; i++) {
|
|
245
|
+
const dom = draggingRow[i];
|
|
246
|
+
dom?.style.setProperty('transform', `translateY(${event.clientY - y}px)`);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// 判断应该落在第几行
|
|
250
|
+
const idx = calcPositionRowShouldBePlace(draggingData.value.rowsRange as [number, number][], event.clientY);
|
|
251
|
+
if (typeof idx !== 'number') return;
|
|
252
|
+
const [top, bottom] = draggingData.value.rowsRange![draggingIndex] as [number, number];
|
|
253
|
+
draggingData.value.dropIndex = idx;
|
|
254
|
+
const rowHeight = bottom - top;
|
|
255
|
+
const dragSemiRange = props.dragSemiRange ?? 15;
|
|
256
|
+
for (const i of Object.keys(rowDoms).map(Number)) {
|
|
257
|
+
if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange || draggingIndex === i) continue
|
|
258
|
+
const doms = rowDoms[i];
|
|
259
|
+
if (idx < draggingIndex) {
|
|
260
|
+
if (i >= idx && i < draggingIndex) {
|
|
261
|
+
doms.forEach(el => el.style.setProperty('transform', `translateY(${rowHeight}px)`));
|
|
262
|
+
} else {
|
|
263
|
+
doms.forEach(el => el.style.removeProperty('transform'));
|
|
264
|
+
}
|
|
265
|
+
} else if (idx > draggingIndex) {
|
|
266
|
+
if (i <= idx && i > draggingIndex) {
|
|
267
|
+
doms.forEach(el => el.style.setProperty('transform', `translateY(${-rowHeight}px)`));
|
|
268
|
+
} else {
|
|
269
|
+
doms.forEach(el => el.style.removeProperty('transform'));
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
doms.forEach(el => el.style.removeProperty('transform'));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const handleViewSettingDragDrop = () => {
|
|
278
|
+
const { draggingIndex = 0, dropIndex = draggingIndex } = draggingData.value;
|
|
279
|
+
const movedRow = viewSettingDragSortOptions.value[draggingIndex];
|
|
280
|
+
const newList = [
|
|
281
|
+
...viewSettingDragSortOptions.value.slice(0, draggingIndex),
|
|
282
|
+
...viewSettingDragSortOptions.value.slice(draggingIndex + 1)
|
|
283
|
+
];
|
|
284
|
+
newList.splice(dropIndex, 0, movedRow);
|
|
285
|
+
viewSettingDragSortOptions.value = newList;
|
|
286
|
+
// 清理工作
|
|
287
|
+
clearMovingData();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const throttledMoveHandler = throttle(handleMove, 10);
|
|
291
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref } from "vue"
|
|
2
|
+
import { IEmits } from "../types"
|
|
3
|
+
|
|
4
|
+
interface IParams {
|
|
5
|
+
emit: IEmits
|
|
6
|
+
beforePageChange: () => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function usePagination({ emit, beforePageChange }: IParams) {
|
|
10
|
+
|
|
11
|
+
const pageSize = ref(10);
|
|
12
|
+
|
|
13
|
+
const handlePageSizeChange = (size: number) => {
|
|
14
|
+
pageSize.value = size;
|
|
15
|
+
// searchValue.value = {};
|
|
16
|
+
beforePageChange();
|
|
17
|
+
emit('page-change', { size, page: 1 });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const handleCurrPageChange = (curr: number) => {
|
|
21
|
+
// searchValue.value = {};
|
|
22
|
+
beforePageChange();
|
|
23
|
+
emit('page-change', { size: pageSize.value, page: curr });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
pageSize,
|
|
28
|
+
handlePageSizeChange,
|
|
29
|
+
handleCurrPageChange,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IColorList, IEmits } from '../types';
|
|
2
|
+
|
|
3
|
+
interface IUseRowBgColorParams {
|
|
4
|
+
colorList: IColorList;
|
|
5
|
+
emit: IEmits;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function useRowBgColor({ colorList, emit }: IUseRowBgColorParams) {
|
|
9
|
+
const isDefaultColor = (id: number) => {
|
|
10
|
+
if (!id) {
|
|
11
|
+
// 没有颜色id,则认为是默认色
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return colorList.find(c => +c.id === +id)?.default;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const getColorById = (id: number, type: 'bg' | 'sample' = 'bg') => {
|
|
18
|
+
return colorList.find(c => +c.id === +id)?.[`${type}Color`] || '';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const setRowStyle = (scope) => {
|
|
22
|
+
const row = scope.row;
|
|
23
|
+
return {
|
|
24
|
+
backgroundColor: row.__static_bg_color__ ?? (row.colorId ? getColorById(row.colorId) : '')
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const handleColorChange = async (colorId: number, scope) => {
|
|
29
|
+
const { row, $index: rowIndex, store } = scope;
|
|
30
|
+
const dataList = store.states.data;
|
|
31
|
+
const curRow = { ...dataList[rowIndex], colorId: +colorId };
|
|
32
|
+
const newList = [...dataList];
|
|
33
|
+
newList.splice(rowIndex, 1, curRow);
|
|
34
|
+
store.states.data = newList;
|
|
35
|
+
emit('row-bg-change', { colorId, row, rowIndex });
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
isDefaultColor,
|
|
40
|
+
getColorById,
|
|
41
|
+
setRowStyle,
|
|
42
|
+
handleColorChange,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { ref, watch, Ref, computed, nextTick } from "vue"
|
|
2
|
+
import { IColumnConfig, IProps, SettingStorgeConfig } from "../types"
|
|
3
|
+
|
|
4
|
+
interface IViewSettingParams {
|
|
5
|
+
showingColumns: Ref<string[]>
|
|
6
|
+
actualColumns: Ref<IColumnConfig[]>
|
|
7
|
+
viewSettingDragSortOptions: Ref<IColumnConfig[]>
|
|
8
|
+
props: IProps
|
|
9
|
+
emit: {
|
|
10
|
+
(e: 'update:leftFixedColumnCount', val: number): void
|
|
11
|
+
(e: 'update:showingColumns', val: string[]): void
|
|
12
|
+
(e: 'update:viewSettingDragSortOptions', val: IColumnConfig[]): void
|
|
13
|
+
(e: 'tableDoLayout'): void
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** 默认迁移配置 */
|
|
18
|
+
const storgeSchemaMigrationConfig: Record<number, {
|
|
19
|
+
/** 迁移方法 */
|
|
20
|
+
migration: (
|
|
21
|
+
/** 当前本地配置 */
|
|
22
|
+
currentConfig: any,
|
|
23
|
+
/** 当前的列配置 */
|
|
24
|
+
columns: IColumnConfig[]
|
|
25
|
+
) => ({ schemaVersion: number, config: any, version?: string })
|
|
26
|
+
/** 迁移到的下一个版本号 */
|
|
27
|
+
nextSchemaVersion?: number
|
|
28
|
+
}> = {
|
|
29
|
+
'0': {
|
|
30
|
+
migration: (config: { showingColumns: string[], leftFixedColumnCount: number }, columns: IColumnConfig[]) => {
|
|
31
|
+
return {
|
|
32
|
+
config: {
|
|
33
|
+
fields: columns.reduce((acc, curr) => {
|
|
34
|
+
acc[curr.prop] = {
|
|
35
|
+
hidden: config.showingColumns.find(v => v === curr.prop) ? false : true,
|
|
36
|
+
order: config.showingColumns.findIndex(v => v === curr.prop) ?? 0,
|
|
37
|
+
}
|
|
38
|
+
return acc;
|
|
39
|
+
}, {} as Record<string, { hidden: boolean, order: number }>),
|
|
40
|
+
leftFixedColumnCount: config.leftFixedColumnCount,
|
|
41
|
+
},
|
|
42
|
+
schemaVersion: 1,
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
nextSchemaVersion: 1,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function useViewSetting({
|
|
50
|
+
showingColumns,
|
|
51
|
+
actualColumns,
|
|
52
|
+
props,
|
|
53
|
+
viewSettingDragSortOptions,
|
|
54
|
+
emit
|
|
55
|
+
}: IViewSettingParams) {
|
|
56
|
+
const columnsToBeShown = ref<string[]>([]); // 显示设置弹窗中勾选的列
|
|
57
|
+
const viewSettingVisible = ref(false);
|
|
58
|
+
const leftFixedColumnCount = ref(0);
|
|
59
|
+
const tempLeftFixedColumnCount = ref(0);
|
|
60
|
+
|
|
61
|
+
const updateShowingColumns = (val: string[]) => emit('update:showingColumns', val);
|
|
62
|
+
|
|
63
|
+
const storageKey = computed(() => `@lx-frontend/wrap-element-ui/table_setting_cloumns/${props.settingStorgeKey || (location.pathname === '/' ? location.hash : location.pathname)}`);
|
|
64
|
+
|
|
65
|
+
const saveSettingToStorge = async() => {
|
|
66
|
+
await nextTick()
|
|
67
|
+
|
|
68
|
+
const settingStorgeMigrationConfigs = props.settingStorgeMigrationConfigs ?? []
|
|
69
|
+
const len = settingStorgeMigrationConfigs.length
|
|
70
|
+
const version = len ? settingStorgeMigrationConfigs[len - 1].version.to : undefined
|
|
71
|
+
|
|
72
|
+
localStorage.setItem(storageKey.value, JSON.stringify({
|
|
73
|
+
config: {
|
|
74
|
+
fields: props.columnConfig.reduce((acc, curr, index) => {
|
|
75
|
+
const _index = showingColumns.value.findIndex(v => v === curr.prop)
|
|
76
|
+
acc[curr.prop] = {
|
|
77
|
+
hidden: showingColumns.value.find(v => v === curr.prop) ? false : true,
|
|
78
|
+
order: _index === -1 ? index : _index,
|
|
79
|
+
}
|
|
80
|
+
return acc;
|
|
81
|
+
}, {} as Record<string, { hidden: boolean, order: number }>),
|
|
82
|
+
leftFixedColumnCount: leftFixedColumnCount.value,
|
|
83
|
+
},
|
|
84
|
+
version,
|
|
85
|
+
schemaVersion: 1
|
|
86
|
+
}))
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const handleViewSettingShow = () => {
|
|
90
|
+
emit('update:viewSettingDragSortOptions', [...actualColumns.value.filter(v => v?.prop !== '$$operation')]);
|
|
91
|
+
tempLeftFixedColumnCount.value = leftFixedColumnCount.value;
|
|
92
|
+
viewSettingVisible.value = true;
|
|
93
|
+
columnsToBeShown.value = [...showingColumns.value];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const handleViewSettingClose = () => {
|
|
97
|
+
viewSettingVisible.value = false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const handleViewSettingConfirm = async () => {
|
|
101
|
+
viewSettingVisible.value = false;
|
|
102
|
+
updateShowingColumns(viewSettingDragSortOptions.value.map(c => c.prop));
|
|
103
|
+
leftFixedColumnCount.value = tempLeftFixedColumnCount.value;
|
|
104
|
+
await saveSettingToStorge()
|
|
105
|
+
emit('tableDoLayout')
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const handleInputTempLeftFixedColumnCount = (value: string) => {
|
|
109
|
+
const _value = Number(value)
|
|
110
|
+
if (isNaN(_value)) return
|
|
111
|
+
tempLeftFixedColumnCount.value = Math.max(0, Math.min(columnsToBeShown.value.length, Math.floor(_value)))
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
watch(
|
|
115
|
+
() => props.columnConfig,
|
|
116
|
+
async(val) => {
|
|
117
|
+
const _cache = localStorage.getItem(storageKey.value);
|
|
118
|
+
const setColumns = () => updateShowingColumns(val.filter(v => !v.defaultHide).map(c => c.prop));
|
|
119
|
+
if (!_cache) {
|
|
120
|
+
setColumns();
|
|
121
|
+
leftFixedColumnCount.value = props.leftFixedCount as number;
|
|
122
|
+
} else {
|
|
123
|
+
try {
|
|
124
|
+
const handleMigration = (_cache: any) => {
|
|
125
|
+
const schemaVersion = _cache?.schemaVersion ?? 0
|
|
126
|
+
if (!storgeSchemaMigrationConfig[schemaVersion]) { // 没有 schema 变动时,查找需要处理的业务迁移配置
|
|
127
|
+
const bizMigrationConfigs = (props.settingStorgeMigrationConfigs ?? []).filter(v => (v.schemaVersion ?? 1) === _cache.schemaVersion)
|
|
128
|
+
|
|
129
|
+
const _versionIndex = bizMigrationConfigs.findIndex(v => v.version.form === _cache.version)
|
|
130
|
+
if (_versionIndex > -1) {
|
|
131
|
+
for (let i = _versionIndex; i < bizMigrationConfigs.length; i++) {
|
|
132
|
+
const curr = bizMigrationConfigs[i]
|
|
133
|
+
_cache = curr.migration(_cache.config, val)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return _cache
|
|
137
|
+
} else {
|
|
138
|
+
let __cache = storgeSchemaMigrationConfig[schemaVersion].migration(_cache, val)
|
|
139
|
+
|
|
140
|
+
// 处理当前schema版本需要处理的变更
|
|
141
|
+
const bizMigrationConfigs = (props.settingStorgeMigrationConfigs ?? []).filter(v => (v.schemaVersion ?? 1) === __cache.schemaVersion)
|
|
142
|
+
if (bizMigrationConfigs.length) {
|
|
143
|
+
__cache = bizMigrationConfigs.reduce((acc, curr) => ({
|
|
144
|
+
...curr.migration(acc.config, val),
|
|
145
|
+
schemaVersion: __cache.schemaVersion,
|
|
146
|
+
}), __cache)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return storgeSchemaMigrationConfig[schemaVersion].nextSchemaVersion
|
|
150
|
+
? handleMigration(__cache)
|
|
151
|
+
: __cache
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const cache = handleMigration(JSON.parse(_cache)) as SettingStorgeConfig;
|
|
156
|
+
|
|
157
|
+
updateShowingColumns(
|
|
158
|
+
val.filter(v => {
|
|
159
|
+
return cache.config.fields[v.prop] ? !cache.config.fields[v.prop].hidden : !v.defaultHide
|
|
160
|
+
}).sort((a, b) => {
|
|
161
|
+
return (cache.config.fields[a.prop]?.order ?? 0) - (cache.config.fields[b.prop]?.order ?? 0)
|
|
162
|
+
}).map(v => v.prop)
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const _leftFixedColumnCount = Number(cache?.config?.leftFixedColumnCount)
|
|
166
|
+
leftFixedColumnCount.value = isNaN(_leftFixedColumnCount) ? (props.leftFixedCount as number) : _leftFixedColumnCount;
|
|
167
|
+
// 写入清理后的数据
|
|
168
|
+
saveSettingToStorge();
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.error(error);
|
|
171
|
+
localStorage.removeItem(storageKey.value);
|
|
172
|
+
setColumns();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{ immediate: true }
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
watch(columnsToBeShown, (val, oldVal) => {
|
|
180
|
+
if (val.length === oldVal?.length) return // 排序调整时不做处理,避免出现死循环
|
|
181
|
+
const _map = new Map<string, IColumnConfig>()
|
|
182
|
+
props.columnConfig.forEach(c => _map.set(c.prop, c))
|
|
183
|
+
// 展示时保留顺序
|
|
184
|
+
emit('update:viewSettingDragSortOptions', val.map(prop => _map.get(prop)!))
|
|
185
|
+
if (tempLeftFixedColumnCount.value > val.length) tempLeftFixedColumnCount.value = val.length
|
|
186
|
+
}, { immediate: true })
|
|
187
|
+
|
|
188
|
+
// 拖拽调整排序时,同时更新勾选数组的顺序,避免出现拖拽排序操作过程后再勾选新列时被还原成拖拽前的顺序的问题
|
|
189
|
+
watch(viewSettingDragSortOptions, (val, oldVal) => {
|
|
190
|
+
if (!val.length || val.length !== oldVal?.length) return // 不是排序调整
|
|
191
|
+
columnsToBeShown.value = val.map(c => c.prop)
|
|
192
|
+
}, { deep: true })
|
|
193
|
+
|
|
194
|
+
watch(leftFixedColumnCount, (val) => emit('update:leftFixedColumnCount', val), { immediate: true });
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
columnsToBeShown,
|
|
198
|
+
viewSettingVisible,
|
|
199
|
+
leftFixedColumnCount,
|
|
200
|
+
tempLeftFixedColumnCount,
|
|
201
|
+
handleInputTempLeftFixedColumnCount,
|
|
202
|
+
handleViewSettingShow,
|
|
203
|
+
handleViewSettingClose,
|
|
204
|
+
handleViewSettingConfirm,
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- 行颜色选择组件 -->
|
|
2
|
+
<template>
|
|
3
|
+
<el-popover
|
|
4
|
+
v-model="visible"
|
|
5
|
+
placement="right"
|
|
6
|
+
trigger="click"
|
|
7
|
+
popper-class="editable-table-color-popover"
|
|
8
|
+
>
|
|
9
|
+
<div class="color-list">
|
|
10
|
+
<div
|
|
11
|
+
v-for="color in colorList"
|
|
12
|
+
:key="color.id"
|
|
13
|
+
class="color-list__item"
|
|
14
|
+
:style="{ backgroundColor: color.sampleColor }"
|
|
15
|
+
@click="() => {
|
|
16
|
+
visible = false
|
|
17
|
+
handleColorChange(color.id, scope)
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<span :style="{color: color.textColor}">{{ color.name }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div slot="reference">
|
|
25
|
+
<div
|
|
26
|
+
v-if="isDefaultColor(scope.row.colorId)"
|
|
27
|
+
class="editable-table__color-icon"
|
|
28
|
+
/>
|
|
29
|
+
<div
|
|
30
|
+
v-else
|
|
31
|
+
class="editable-table__selected-color"
|
|
32
|
+
:style="{ backgroundColor: getColorById(scope.row.colorId, 'sample') }"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</el-popover>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { ref } from 'vue';
|
|
40
|
+
import { IColorList, IEmits, ITableDataItem } from '../types';
|
|
41
|
+
import { useRowBgColor } from '../bizHooks';
|
|
42
|
+
|
|
43
|
+
const props = defineProps<{
|
|
44
|
+
colorList: IColorList,
|
|
45
|
+
scope: any
|
|
46
|
+
}>();
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits<{
|
|
49
|
+
(e: 'row-bg-change', param: { colorId: number; row: ITableDataItem; rowIndex: number }): void
|
|
50
|
+
}>();
|
|
51
|
+
|
|
52
|
+
const {
|
|
53
|
+
getColorById,
|
|
54
|
+
isDefaultColor,
|
|
55
|
+
handleColorChange,
|
|
56
|
+
} = useRowBgColor({
|
|
57
|
+
colorList: props.colorList,
|
|
58
|
+
emit: emit as IEmits,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const visible = ref(false);
|
|
62
|
+
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-input
|
|
4
|
+
v-if="column.editType === 'input'"
|
|
5
|
+
clearable
|
|
6
|
+
:value="value"
|
|
7
|
+
@input="val => emit('input', val)"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<el-select
|
|
11
|
+
v-if="column.editType === 'select'"
|
|
12
|
+
:value="value"
|
|
13
|
+
@input="val => emit('input', val)"
|
|
14
|
+
>
|
|
15
|
+
<el-option
|
|
16
|
+
v-for="item in column.selectOptions"
|
|
17
|
+
:key="item.label"
|
|
18
|
+
:label="item.label"
|
|
19
|
+
:value="item.value"
|
|
20
|
+
/>
|
|
21
|
+
</el-select>
|
|
22
|
+
|
|
23
|
+
<el-date-picker
|
|
24
|
+
v-if="column.editType === 'date'"
|
|
25
|
+
type="date"
|
|
26
|
+
placeholder="选择日期"
|
|
27
|
+
:value="value"
|
|
28
|
+
@input="val => emit('input', val)"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { IColumnConfig } from '../types'
|
|
35
|
+
|
|
36
|
+
defineProps<{
|
|
37
|
+
column: IColumnConfig;
|
|
38
|
+
value: any;
|
|
39
|
+
}>()
|
|
40
|
+
|
|
41
|
+
const emit = defineEmits<{
|
|
42
|
+
(e: 'input', value: any): void;
|
|
43
|
+
}>()
|
|
44
|
+
</script>
|