@lx-frontend/wrap-element-ui 0.4.6-beta.2 → 1.0.0-beta

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.
Files changed (73) hide show
  1. package/dist/AddMembers/index.vue.d.ts +31 -0
  2. package/dist/AuditSteps/index.vue.d.ts +46 -0
  3. package/dist/DemoComponent/index.vue.d.ts +2 -0
  4. package/dist/EditableTable/index.vue.d.ts +186 -0
  5. package/dist/EditableTable/types.d.ts +123 -0
  6. package/dist/EditableTable/useCellHover.d.ts +11 -0
  7. package/dist/EditableTable/useColumnHeaderOperation.d.ts +106 -0
  8. package/dist/EditableTable/useDefaultOperation.d.ts +22 -0
  9. package/dist/EditableTable/useDragSort.d.ts +15 -0
  10. package/dist/EditableTable/usePagination.d.ts +13 -0
  11. package/dist/EditableTable/useRowBgColor.d.ts +16 -0
  12. package/dist/EditableTable/useViewSetting.d.ts +58 -0
  13. package/dist/Ellipsis/MultilineEllipsis.vue.d.ts +91 -0
  14. package/dist/Ellipsis/index.vue.d.ts +89 -0
  15. package/dist/LxTable/index.vue.d.ts +2 -0
  16. package/dist/PopoverForm/index.vue.d.ts +50 -0
  17. package/dist/SearchForm/index.vue.d.ts +105 -0
  18. package/dist/SearchSelect/index.vue.d.ts +53 -0
  19. package/dist/index.css +1 -0
  20. package/dist/index.d.ts +11 -0
  21. package/dist/index.mjs +40808 -0
  22. package/dist/singleMessage/index.d.ts +4 -0
  23. package/package.json +60 -36
  24. package/{packages/AddMembers/src/AddMembers.vue → src/components/AddMembers/index.vue} +35 -13
  25. package/{packages/AuditSteps/src/AuditSteps.vue → src/components/AuditSteps/index.vue} +55 -0
  26. package/{packages/DemoComponent/src/DemoComponent.vue → src/components/DemoComponent/index.vue} +11 -0
  27. package/src/components/EditableTable/README.md +147 -0
  28. package/src/components/EditableTable/index.less +716 -0
  29. package/src/components/EditableTable/index.vue +842 -0
  30. package/src/components/EditableTable/pin-top.png +0 -0
  31. package/src/components/EditableTable/types.ts +94 -0
  32. package/src/components/EditableTable/useCellHover.ts +72 -0
  33. package/src/components/EditableTable/useColumnHeaderOperation.ts +188 -0
  34. package/src/components/EditableTable/useDefaultOperation.ts +96 -0
  35. package/src/components/EditableTable/useDragSort.ts +292 -0
  36. package/src/components/EditableTable/usePagination.ts +34 -0
  37. package/src/components/EditableTable/useRowBgColor.ts +51 -0
  38. package/src/components/EditableTable/useViewSetting.ts +67 -0
  39. package/{packages/Ellipsis/src → src/components/Ellipsis}/MultilineEllipsis.vue +1 -1
  40. package/{packages/Ellipsis/src/Ellipsis.vue → src/components/Ellipsis/index.vue} +5 -5
  41. package/src/components/LxTable/index.vue +296 -0
  42. package/{packages/SearchForm/src/SearchForm.vue → src/components/SearchForm/index.vue} +47 -21
  43. package/{packages/SearchSelect/src/SearchSelect.vue → src/components/SearchSelect/index.vue} +7 -4
  44. package/src/components/index.ts +22 -0
  45. package/babel.config.js +0 -5
  46. package/global.d.ts +0 -23
  47. package/packages/AddMembers/index.js +0 -11
  48. package/packages/AuditSteps/index.js +0 -7
  49. package/packages/DemoComponent/index.js +0 -7
  50. package/packages/Ellipsis/index.js +0 -7
  51. package/packages/LxTable/index.js +0 -11
  52. package/packages/LxTable/src/LxTable.vue +0 -296
  53. package/packages/PopoverForm/index.js +0 -7
  54. package/packages/SearchForm/index.js +0 -7
  55. package/packages/SearchSelect/index.js +0 -7
  56. package/packages/index.js +0 -59
  57. package/packages/theme-default/gulpfile.js +0 -25
  58. package/packages/theme-default/lib/AuditSteps.css +0 -1
  59. package/packages/theme-default/lib/DemoComponent.css +0 -1
  60. package/packages/theme-default/lib/index.css +0 -1
  61. package/packages/theme-default/package.json +0 -23
  62. package/packages/theme-default/src/AuditSteps.scss +0 -52
  63. package/packages/theme-default/src/DemoComponent.scss +0 -9
  64. package/packages/theme-default/src/common/var.scss +0 -0
  65. package/packages/theme-default/src/fonts/.gitkeep +0 -0
  66. package/packages/theme-default/src/index.css +0 -11
  67. package/packages/theme-default/src/index.scss +0 -2
  68. package/packages/utils/.gitkeep +0 -0
  69. package/plugins/wrap.js +0 -22
  70. package/postcss.config.js +0 -5
  71. package/tsconfig.json +0 -41
  72. /package/{packages/PopoverForm/src/PopoverForm.vue → src/components/PopoverForm/index.vue} +0 -0
  73. /package/{packages → src/components}/singleMessage/index.ts +0 -0
@@ -0,0 +1,292 @@
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
+ currentPage: Ref<number>
12
+ pageSize: Ref<number>
13
+ tableDomRef: Ref<any>
14
+ }
15
+ export default function useDragSort({props, emit, viewSettingDragSortOptions, currentPage, pageSize, beforeDragStart, currScope, tableDomRef }: IUseDragSortParams) {
16
+
17
+ const draggingData = ref<IDraggingData>({}); // 拖拽相关数据
18
+ const isMouseDown = ref(false);
19
+ const dragType = ref<'row' | 'view-setting'>('row');
20
+ // 如果页面存在多个table实例,如果没有这个值来区分正在操作哪个表格,拖拽功能会有异常
21
+ const isOperating = ref(false);
22
+
23
+ onMounted(() => {
24
+ tableDomRef.value.$el.addEventListener('mousedown', () => {isOperating.value = true});
25
+ document.addEventListener('mousedown', handleDocumentMouseDown);
26
+ document.addEventListener('mousemove', handleDocumentMouseMove);
27
+ document.addEventListener('mouseup', handleDocumentMouseUp);
28
+ })
29
+
30
+ onBeforeUnmount(() => {
31
+ tableDomRef.value.$el.removeEventListener('mousedown', () => isOperating.value = true);
32
+ document.removeEventListener('mousedown', handleDocumentMouseDown);
33
+ document.removeEventListener('mousemove', handleDocumentMouseMove);
34
+ document.removeEventListener('mouseup', handleDocumentMouseUp);
35
+ })
36
+
37
+ const handleDocumentMouseDown = (e) => {
38
+ isMouseDown.value = true;
39
+ const target = e.target as HTMLElement
40
+
41
+ if (typeof target.dataset?.index === 'undefined') return
42
+
43
+ if ([...target.classList].includes('row-drag-target')) {
44
+ dragType.value = 'row';
45
+ if (!isOperating.value) return
46
+ // 处理列表行拖拽
47
+ handleDragMouseDown(e, +target.dataset.index);
48
+ }
49
+
50
+ if ([...target.classList].includes('view-setting-drag-target')) {
51
+ dragType.value = 'view-setting';
52
+ // 处理显示设置拖拽
53
+ handleViewSettingDragMouseDown(e, +target.dataset.index);
54
+ }
55
+ }
56
+
57
+ const handleDocumentMouseMove = (e) => {
58
+ if (!isMouseDown.value || typeof draggingData.value.draggingIndex === 'undefined') {
59
+ return;
60
+ }
61
+
62
+ throttledMoveHandler(e);
63
+ }
64
+
65
+ const handleDocumentMouseUp = (e) => {
66
+ isOperating.value = false;
67
+ isMouseDown.value = false;
68
+ if (typeof draggingData.value.draggingIndex === 'undefined') {
69
+ return;
70
+ }
71
+ if (dragType.value === 'row') {
72
+ handleDragDrop(e, currScope.value);
73
+ }
74
+
75
+ if (dragType.value === 'view-setting') {
76
+ handleViewSettingDragDrop();
77
+ }
78
+ }
79
+
80
+ const handleDragMouseDown = (event, draggingIndex) => {
81
+ if (!beforeDragStart()) return
82
+ const rows = [...document.getElementsByClassName(`custom-row-classname`)] as HTMLElement[];
83
+ const rowDoms: Record<number, HTMLElement[]> = [];
84
+ for (let i = 0; i < rows.length; i++) {
85
+ const row = rows[i];
86
+ const clsIndex = ([...row.classList].find(cls => cls.startsWith(`custom-row-classname-`)) ?? '').split('-').pop() ?? 'NaN';
87
+ if (typeof +clsIndex === 'number') {
88
+ rowDoms[+clsIndex] = rowDoms[+clsIndex] || [];
89
+ rowDoms[+clsIndex].push(row);
90
+ }
91
+ }
92
+
93
+ draggingData.value.isDragging = true;
94
+ draggingData.value.rowDoms = rowDoms;
95
+ draggingData.value.draggingIndex = +draggingIndex;
96
+ draggingData.value.rowsRange = [];
97
+
98
+ draggingData.value.startPosition = {
99
+ x: event.clientX,
100
+ y: event.clientY
101
+ };
102
+
103
+ // 列表过大时拖拽有性能问题,所以拖拽范围限制在拖拽元素的上下15个元素内
104
+ const dragSemiRange = props.dragSemiRange ?? 15;
105
+ for (const i of Object.keys(rowDoms).map(Number)) {
106
+ if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange) {
107
+ draggingData.value.rowsRange[i] = undefined
108
+ continue
109
+ }
110
+ const rowdom = rowDoms[i];
111
+ // 在Chrom中,relative加z-index可以让拖拽更流畅,然而在Safari中无效
112
+ // 如果在Safari中relative有效,其实蒙层都没有必要了
113
+ rowdom.forEach(el => el.style.setProperty('position', 'relative'));
114
+
115
+ if (i !== draggingData.value.draggingIndex) {
116
+ rowdom.forEach(el => el.style.setProperty('transition', 'transform 0.25s ease'));
117
+ } else {
118
+ rowdom.forEach(el => el.style.setProperty('z-index', '100'));
119
+ // 当有固定列时,一行的内容并不是一个tr,而是两个或多个tr的叠加显示,其中有的列内容被隐藏
120
+ // 所以拖拽时,需要同时拖拽所有的tr,并显示所有内容,否则拖拽效果会显示异常
121
+ const tds = rowdom
122
+ .map(dom => dom.querySelectorAll('td'))
123
+ .reduce((pre, curr) => ([...pre, ...curr]), [] as HTMLElement[])
124
+ .filter(td => td.classList.contains('is-hidden'));
125
+ draggingData.value.hiddenTds = tds;
126
+ tds.forEach(td => td.classList.remove('is-hidden'));
127
+
128
+ // 生成一个蒙层,防止拖动时文字被选中
129
+ const fullScreenDiv = document.createElement('div');
130
+ fullScreenDiv.style.position = 'fixed';
131
+ fullScreenDiv.style.top = '0';
132
+ fullScreenDiv.style.left = '0';
133
+ fullScreenDiv.style.right = '0';
134
+ fullScreenDiv.style.bottom = '0';
135
+ fullScreenDiv.style.zIndex = '999';
136
+ fullScreenDiv.style.cursor = 'grabbing';
137
+ document.body.appendChild(fullScreenDiv);
138
+ draggingData.value.fullScreenDiv = fullScreenDiv;
139
+ }
140
+ // 计算每一行的高度范围
141
+ const rect = rowdom[0].getBoundingClientRect()
142
+ draggingData.value.rowsRange = draggingData.value.rowsRange || [];
143
+ draggingData.value.rowsRange[i] = ([
144
+ rect.top,
145
+ rect.bottom
146
+ ]);
147
+ }
148
+ }
149
+
150
+ const calcPositionRowShouldBePlace = (rowsRange: ([number, number])[], draggingClientY: number) => {
151
+ if (!draggingData.value.rowsRange ||
152
+ typeof draggingData.value.draggingIndex === 'undefined' ||
153
+ typeof props.dragSemiRange === 'undefined'
154
+ ) return;
155
+ const rangeLeft = draggingData.value.draggingIndex - props.dragSemiRange <= 0 ? 0 : draggingData.value.draggingIndex - props.dragSemiRange
156
+ const rangeRight = draggingData.value.draggingIndex + props.dragSemiRange >= draggingData.value.rowsRange.length ? draggingData.value.rowsRange.length - 1 : draggingData.value.draggingIndex + props.dragSemiRange
157
+ if (!rowsRange) return -1;
158
+ if (draggingClientY <= rowsRange[rangeLeft][0]) return rangeLeft;
159
+ if (draggingClientY >= rowsRange[rangeRight][1]) return rangeRight;
160
+ for (let i = rangeLeft; i <= rangeRight; i++) {
161
+ const [top, bottom] = rowsRange[i];
162
+ if (draggingClientY > top && draggingClientY < bottom) {
163
+ return i;
164
+ }
165
+ }
166
+ return -1;
167
+ }
168
+
169
+ const clearMovingData = () => {
170
+ const rowdoms = draggingData.value.rowDoms || [];
171
+ const draggingIndex = draggingData.value.draggingIndex ?? -1
172
+ const dragSemiRange = props.dragSemiRange ?? 15;
173
+ for (const i of Object.keys(rowdoms).map(Number)) {
174
+ if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange) continue
175
+ const doms = rowdoms[i];
176
+ doms.forEach(el => {
177
+ el.style.removeProperty('position');
178
+ el.style.removeProperty('transition');
179
+ el.style.removeProperty('transform');
180
+ el.style.removeProperty('z-index');
181
+ });
182
+ }
183
+ draggingData.value.fullScreenDiv?.parentNode?.removeChild(draggingData.value.fullScreenDiv);
184
+ draggingData.value.hiddenTds?.forEach(el => el.classList.add('is-hidden'));
185
+ draggingData.value = {};
186
+ currScope.value = null
187
+ }
188
+
189
+ const handleDragDrop = (event, scope) => {
190
+ if (!scope) return
191
+ const { draggingIndex = 0, dropIndex = draggingIndex } = draggingData.value;
192
+ const dataList = scope.store.states.data;
193
+ const movedRow = dataList[draggingIndex];
194
+ const newList = [
195
+ ...dataList.slice(0, +draggingIndex),
196
+ ...dataList.slice(draggingIndex + 1)
197
+ ];
198
+ newList.splice(dropIndex, 0, movedRow);
199
+ scope.store.states.data = newList;
200
+ emit('row-drag-drop', {
201
+ row: movedRow,
202
+ fromIndex: draggingIndex,
203
+ toIndex: dropIndex,
204
+ page: currentPage.value,
205
+ size: pageSize.value
206
+ });
207
+ // 清理工作
208
+ clearMovingData();
209
+ }
210
+
211
+ const handleViewSettingDragMouseDown = (event, index) => {
212
+ const rowDoms = [...document.getElementsByClassName('view-setting-draggable-item')]
213
+ .reduce((pre, item, index) => ({...pre, [index]: [item]}), {});
214
+ draggingData.value.isDragging = true;
215
+ draggingData.value.rowDoms = rowDoms;
216
+ draggingData.value.draggingIndex = +index;
217
+ draggingData.value.startPosition = {
218
+ x: event.clientX,
219
+ y: event.clientY
220
+ };
221
+
222
+ for (const i of Object.keys(rowDoms).map(Number)) {
223
+ const rowdoms = rowDoms[i];
224
+ rowdoms.forEach((el) => {
225
+ el.style.setProperty('position', 'relative');
226
+ });
227
+
228
+ if (i !== draggingData.value.draggingIndex) {
229
+ rowdoms.forEach(el => el.style.setProperty('transition', 'transform 0.25s ease'));
230
+ }
231
+ const rect = rowdoms[0].getBoundingClientRect();
232
+ draggingData.value.rowsRange = draggingData.value.rowsRange || [];
233
+ draggingData.value.rowsRange.push([
234
+ rect.top,
235
+ rect.bottom
236
+ ]);
237
+ }
238
+ }
239
+
240
+ const handleMove = (event) => {
241
+ if (!draggingData.value.isDragging) return;
242
+ const { y = 0 } = draggingData.value.startPosition || {};
243
+ const { draggingIndex = -1, rowDoms = {} } = draggingData.value;
244
+ const draggingRow = rowDoms?.[draggingIndex ?? 0];
245
+ for (let i = 0; i < draggingRow.length; i++) {
246
+ const dom = draggingRow[i];
247
+ dom?.style.setProperty('transform', `translateY(${event.clientY - y}px)`);
248
+ }
249
+
250
+ // 判断应该落在第几行
251
+ const idx = calcPositionRowShouldBePlace(draggingData.value.rowsRange as [number, number][], event.clientY);
252
+ if (typeof idx !== 'number') return;
253
+ const [top, bottom] = draggingData.value.rowsRange![draggingIndex] as [number, number];
254
+ draggingData.value.dropIndex = idx;
255
+ const rowHeight = bottom - top;
256
+ const dragSemiRange = props.dragSemiRange ?? 15;
257
+ for (const i of Object.keys(rowDoms).map(Number)) {
258
+ if (i < draggingIndex - dragSemiRange || i > draggingIndex + dragSemiRange || draggingIndex === i) continue
259
+ const doms = rowDoms[i];
260
+ if (idx < draggingIndex) {
261
+ if (i >= idx && i < draggingIndex) {
262
+ doms.forEach(el => el.style.setProperty('transform', `translateY(${rowHeight}px)`));
263
+ } else {
264
+ doms.forEach(el => el.style.removeProperty('transform'));
265
+ }
266
+ } else if (idx > draggingIndex) {
267
+ if (i <= idx && i > draggingIndex) {
268
+ doms.forEach(el => el.style.setProperty('transform', `translateY(${-rowHeight}px)`));
269
+ } else {
270
+ doms.forEach(el => el.style.removeProperty('transform'));
271
+ }
272
+ } else {
273
+ doms.forEach(el => el.style.removeProperty('transform'));
274
+ }
275
+ }
276
+ }
277
+
278
+ const handleViewSettingDragDrop = () => {
279
+ const { draggingIndex = 0, dropIndex = draggingIndex } = draggingData.value;
280
+ const movedRow = viewSettingDragSortOptions.value[draggingIndex];
281
+ const newList = [
282
+ ...viewSettingDragSortOptions.value.slice(0, draggingIndex),
283
+ ...viewSettingDragSortOptions.value.slice(draggingIndex + 1)
284
+ ];
285
+ newList.splice(dropIndex, 0, movedRow);
286
+ viewSettingDragSortOptions.value = newList;
287
+ // 清理工作
288
+ clearMovingData();
289
+ }
290
+
291
+ const throttledMoveHandler = throttle(handleMove, 10);
292
+ }
@@ -0,0 +1,34 @@
1
+ import { ref } from "vue"
2
+ import { IEmits } from "./types"
3
+
4
+ interface IParams {
5
+ emit: IEmits
6
+ beforePageChange: () => void
7
+ }
8
+
9
+ export default function usePagination({emit, beforePageChange}: IParams) {
10
+
11
+ const pageSize = ref(10);
12
+ const currentPage = ref(1);
13
+
14
+ const handlePageSizeChange = (size: number) => {
15
+ pageSize.value = size;
16
+ currentPage.value = 1;
17
+ // searchValue.value = {};
18
+ beforePageChange();
19
+ emit('page-change', {size, page: currentPage.value});
20
+ }
21
+
22
+ const handleCurrPageChange = (curr: number) => {
23
+ // searchValue.value = {};
24
+ beforePageChange();
25
+ emit('page-change', {size: pageSize.value, page: curr});
26
+ }
27
+
28
+ return {
29
+ pageSize,
30
+ currentPage,
31
+ handlePageSizeChange,
32
+ handleCurrPageChange
33
+ }
34
+ }
@@ -0,0 +1,51 @@
1
+ import { ref, nextTick } from "vue"
2
+ import { IColorList, IEmits } from "./types"
3
+
4
+ interface IUseRowBgColorParams {
5
+ colorList: IColorList;
6
+ emit: IEmits;
7
+ }
8
+
9
+ export default function useRowBgColor({colorList, emit}: IUseRowBgColorParams) {
10
+ const colorPopoverRef = ref<any>(null);
11
+
12
+ const isDefaultColor = (id: number) => {
13
+ if (!id) {
14
+ // 没有颜色id,则认为是默认色
15
+ return true;
16
+ }
17
+ return colorList.find(c => +c.id === +id)?.default;
18
+ }
19
+
20
+ const getColorById = (id: number, type: 'bg' | 'sample' = 'bg') => {
21
+ return colorList.find(c => +c.id === +id)?.[`${type}Color`] || '';
22
+ }
23
+
24
+ const setRowStyle = (scope) => {
25
+ const row = scope.row;
26
+ return {
27
+ backgroundColor: row.colorId ? getColorById(row.colorId) : ''
28
+ }
29
+ }
30
+
31
+ const handleColorChange = async (colorId: number, scope) => {
32
+ const { row, $index: rowIndex, store } = scope;
33
+ const dataList = store.states.data;
34
+ const curRow = {...dataList[rowIndex], colorId: +colorId};
35
+ const newList = [...dataList];
36
+ newList.splice(rowIndex, 1, curRow);
37
+ store.states.data = newList;
38
+ emit('row-bg-change', {colorId, row, rowIndex});
39
+ await nextTick();
40
+ // TODO: 为什么不是数组?为什么关闭弹窗不生效了?
41
+ colorPopoverRef.value?.doClose();
42
+ }
43
+
44
+ return {
45
+ isDefaultColor,
46
+ getColorById,
47
+ setRowStyle,
48
+ handleColorChange,
49
+ colorPopoverRef
50
+ }
51
+ }
@@ -0,0 +1,67 @@
1
+ import { ref, nextTick, watch, ComputedRef, Ref, onMounted } from "vue"
2
+ import { IColumnConfig, IProps } from "./types"
3
+
4
+ interface IViewSettingParams {
5
+ tableDomRef: any
6
+ showingColumns: Ref<string[]>
7
+ actualColumns: ComputedRef<IColumnConfig[]>
8
+ props: IProps
9
+ }
10
+
11
+ export default function useViewSetting({ tableDomRef, showingColumns, actualColumns, props }: IViewSettingParams) {
12
+ const viewSettingDragSortOptions = ref<IColumnConfig[]>([]);
13
+ const columnsToBeShown = ref<string[]>([]); // 显示设置弹窗中勾选的列
14
+ const viewSettingVisible = ref(false);
15
+ const leftFixedColumnCount = ref(0);
16
+
17
+ watch(
18
+ () => columnsToBeShown.value,
19
+ (val) => {
20
+ viewSettingDragSortOptions.value = props.columnConfig
21
+ .filter(c => val.includes(c.prop));
22
+ },
23
+ { immediate: true }
24
+ )
25
+
26
+ watch(
27
+ () => showingColumns.value,
28
+ (val) => {
29
+ // 只要正在显示的列发生变化,dialog中的显示项也要同步变化,反之不然
30
+ columnsToBeShown.value = [...val];
31
+ },
32
+ { immediate: true }
33
+ )
34
+
35
+ onMounted(() => {
36
+ leftFixedColumnCount.value = props.leftFixedCount as number;
37
+ })
38
+
39
+ const handleViewSettingShow = () => {
40
+ viewSettingDragSortOptions.value = actualColumns.value
41
+ .filter(c => columnsToBeShown.value.includes(c.prop));
42
+ viewSettingVisible.value = true;
43
+ }
44
+
45
+ const handleViewSettingClose = () => {
46
+ viewSettingVisible.value = false;
47
+ // 恢复显示的列
48
+ showingColumns.value = actualColumns.value.map(c => c.prop);
49
+ }
50
+
51
+ const handleViewSettingConfirm = async () => {
52
+ viewSettingVisible.value = false;
53
+ showingColumns.value = viewSettingDragSortOptions.value.map(c => c.prop);
54
+ await nextTick();
55
+ tableDomRef.value?.doLayout();
56
+ }
57
+
58
+ return {
59
+ viewSettingDragSortOptions,
60
+ columnsToBeShown,
61
+ viewSettingVisible,
62
+ leftFixedColumnCount,
63
+ handleViewSettingShow,
64
+ handleViewSettingClose,
65
+ handleViewSettingConfirm
66
+ }
67
+ }
@@ -122,7 +122,7 @@ export default {
122
122
  }
123
123
  </script>
124
124
 
125
- <style lang="scss">
125
+ <style lang="less">
126
126
  .ellipsis {
127
127
  width: 100%;
128
128
  margin: 5px auto;
@@ -4,16 +4,16 @@
4
4
  :disabled="showPopover === 'off' || (showPopover !== 'always' && !isOverflow)"
5
5
  :popper-class="popoverName"
6
6
  placement="top-start"
7
- trigger="hover">
7
+ trigger="hover"
8
+ >
8
9
  <div class="popover-content">
9
10
  <slot name="popover">
10
11
  <div v-for="(item, index) in contentArr" :key="getKey(item, index)">{{ item }}</div>
11
12
  </slot>
12
13
  </div>
13
14
  <div slot="reference">
14
- <template v-for="(item, index) in contentArr">
15
+ <div v-for="(item, index) in contentArr" :key="getKey(item, index)">
15
16
  <MultilineEllipsis
16
- :key="getKey(item, index)"
17
17
  :content="item"
18
18
  :fontSize="fontSize"
19
19
  :color="color"
@@ -29,7 +29,7 @@
29
29
  }"
30
30
  :isOverflow.sync="overflowArr[index]">
31
31
  </MultilineEllipsis>
32
- </template>
32
+ </div>
33
33
  </div>
34
34
  </ElPopover>
35
35
  </div>
@@ -108,7 +108,7 @@ export default {
108
108
  }
109
109
  </script>
110
110
 
111
- <style lang="scss">
111
+ <style lang="less">
112
112
  .ellipsis-popover {
113
113
  width: 100%;
114
114
  }