@lx-frontend/wrap-element-ui 1.0.1-beta.6 → 1.0.1-beta.8
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/package.json +1 -1
- package/src/components/EditableTable/bizHooks/index.ts +17 -0
- package/src/components/EditableTable/{useColumnHeaderOperation.ts → bizHooks/useColumnHeaderOperation.ts} +6 -6
- package/src/components/EditableTable/{useDefaultOperation.ts → bizHooks/useDefaultOperation.ts} +1 -1
- package/src/components/EditableTable/{useDragSort.ts → bizHooks/useDragSort.ts} +1 -1
- package/src/components/EditableTable/{usePagination.ts → bizHooks/usePagination.ts} +1 -1
- package/src/components/EditableTable/{useRowBgColor.ts → bizHooks/useRowBgColor.ts} +7 -7
- package/src/components/EditableTable/{useViewSetting.ts → bizHooks/useViewSetting.ts} +64 -65
- package/src/components/EditableTable/features/bizColorSelect.vue +63 -0
- package/src/components/EditableTable/features/bizEditCell.vue +44 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover.vue +202 -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 +13 -4
- package/src/components/EditableTable/index.vue +90 -371
- package/src/components/EditableTable/{types.ts → types/index.ts} +116 -116
- package/src/components/EditableTable/viewColorSelect.vue +0 -65
- /package/src/components/EditableTable/{useCellHover.ts → bizHooks/useCellHover.ts} +0 -0
|
@@ -16,93 +16,17 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<!-- <div class="view-setting__content-left-title">
|
|
31
|
-
表头设置
|
|
32
|
-
</div> -->
|
|
33
|
-
<div class="view-setting__checkbox-wrapper">
|
|
34
|
-
<el-checkbox-group v-model="columnsToBeShown">
|
|
35
|
-
<el-checkbox
|
|
36
|
-
v-for="item in columnConfig"
|
|
37
|
-
:key="item.label"
|
|
38
|
-
:label="item.prop"
|
|
39
|
-
:disabled="item.isAlwaysShow"
|
|
40
|
-
>
|
|
41
|
-
<div class="view-setting__content-left-item">
|
|
42
|
-
{{ item.label }}
|
|
43
|
-
</div>
|
|
44
|
-
</el-checkbox>
|
|
45
|
-
</el-checkbox-group>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="view-setting__content-right">
|
|
49
|
-
<div class="view-setting__content-right-title">
|
|
50
|
-
已选择
|
|
51
|
-
<div class="view-setting__selected-count">
|
|
52
|
-
{{ columnsToBeShown.length }}
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="view-setting__content-right-frize">
|
|
56
|
-
冻结前
|
|
57
|
-
<el-input
|
|
58
|
-
class="view-setting__content-right-input"
|
|
59
|
-
:value="tempLeftFixedColumnCount"
|
|
60
|
-
@input="handleInputTempLeftFixedColumnCount"
|
|
61
|
-
/>
|
|
62
|
-
列
|
|
63
|
-
</div>
|
|
64
|
-
<div class="view-setting__content-right-selected">
|
|
65
|
-
<div
|
|
66
|
-
v-for="(item, index) in viewSettingDragSortOptions"
|
|
67
|
-
:key="item.prop"
|
|
68
|
-
class="view-setting__selected-item view-setting-draggable-item"
|
|
69
|
-
>
|
|
70
|
-
<div class="view-setting__selected-item-left">
|
|
71
|
-
<div
|
|
72
|
-
class="view-setting-drag-target view-setting__icon-wrapper"
|
|
73
|
-
:data-index="index"
|
|
74
|
-
>
|
|
75
|
-
<div
|
|
76
|
-
class="view-setting-drag-target editable-table-drag-icon"
|
|
77
|
-
:data-index="index"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="view-setting__selected-item-name">
|
|
81
|
-
{{ item.label }}
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
<div
|
|
85
|
-
:class="['view-setting__selected-item-close', item.isAlwaysShow ? 'view-setting__selected-item-close--disabled' : '']"
|
|
86
|
-
@click="handleColumnClose(item)"
|
|
87
|
-
>
|
|
88
|
-
<i class="el-icon-close" />
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
<template #footer>
|
|
95
|
-
<el-button @click="handleViewSettingClose">
|
|
96
|
-
取消
|
|
97
|
-
</el-button>
|
|
98
|
-
<el-button
|
|
99
|
-
type="primary"
|
|
100
|
-
@click="handleViewSettingConfirm"
|
|
101
|
-
>
|
|
102
|
-
确认
|
|
103
|
-
</el-button>
|
|
104
|
-
</template>
|
|
105
|
-
</el-dialog>
|
|
19
|
+
<biz-view-setting-dialog
|
|
20
|
+
ref="bizViewSettingDialogRef"
|
|
21
|
+
:props="props"
|
|
22
|
+
:actual-columns="actualColumns"
|
|
23
|
+
:showing-columns="showingColumns"
|
|
24
|
+
:view-setting-drag-sort-options="viewSettingDragSortOptions"
|
|
25
|
+
@update:leftFixedColumnCount="(val) => { leftFixedColumnCount = val }"
|
|
26
|
+
@update:showingColumns="(val) => { showingColumns = val }"
|
|
27
|
+
@update:viewSettingDragSortOptions="(val) => { viewSettingDragSortOptions = val }"
|
|
28
|
+
@tableDoLayout="doTableLayout"
|
|
29
|
+
/>
|
|
106
30
|
</div>
|
|
107
31
|
|
|
108
32
|
<!-- 列表展示,属性透传,列编辑 -->
|
|
@@ -125,7 +49,7 @@
|
|
|
125
49
|
v-if="rowDragAble"
|
|
126
50
|
width="30px"
|
|
127
51
|
class-name="editable-table__drag-cell no-inner-cell-border"
|
|
128
|
-
:fixed="leftFixedColumnCount > 0 ? 'left' :
|
|
52
|
+
:fixed="leftFixedColumnCount > 0 ? 'left' : false"
|
|
129
53
|
>
|
|
130
54
|
<template #default="scope">
|
|
131
55
|
<div
|
|
@@ -145,7 +69,7 @@
|
|
|
145
69
|
v-if="hasExpandRow"
|
|
146
70
|
width="30px"
|
|
147
71
|
type="expand"
|
|
148
|
-
:fixed="leftFixedColumnCount > 0 ? 'left' :
|
|
72
|
+
:fixed="leftFixedColumnCount > 0 ? 'left' : false"
|
|
149
73
|
class-name="no-inner-cell-border"
|
|
150
74
|
>
|
|
151
75
|
<template #default="scope">
|
|
@@ -161,7 +85,7 @@
|
|
|
161
85
|
width="45px"
|
|
162
86
|
align="center"
|
|
163
87
|
type="selection"
|
|
164
|
-
:fixed="leftFixedColumnCount > 0 ? 'left' :
|
|
88
|
+
:fixed="leftFixedColumnCount > 0 ? 'left' : false"
|
|
165
89
|
class-name="no-inner-cell-border"
|
|
166
90
|
/>
|
|
167
91
|
<!-- 编号列 -->
|
|
@@ -169,7 +93,7 @@
|
|
|
169
93
|
v-if="hasIndexColumn"
|
|
170
94
|
min-width="30px"
|
|
171
95
|
type="index"
|
|
172
|
-
:fixed="leftFixedColumnCount > 0 ? 'left' :
|
|
96
|
+
:fixed="leftFixedColumnCount > 0 ? 'left' : false"
|
|
173
97
|
class-name="no-inner-cell-border"
|
|
174
98
|
/>
|
|
175
99
|
<!-- 颜色选择列 -->
|
|
@@ -177,13 +101,13 @@
|
|
|
177
101
|
v-if="colorList && colorList.length > 0"
|
|
178
102
|
width="22px"
|
|
179
103
|
class-name="editable-table__color-column no-inner-cell-border"
|
|
180
|
-
:fixed="leftFixedColumnCount > 0 ? 'left' :
|
|
104
|
+
:fixed="leftFixedColumnCount > 0 ? 'left' : false"
|
|
181
105
|
>
|
|
182
106
|
<template #header>
|
|
183
107
|
<div class="editable-table__color-icon" />
|
|
184
108
|
</template>
|
|
185
109
|
<template #default="scope">
|
|
186
|
-
<
|
|
110
|
+
<biz-color-select
|
|
187
111
|
:color-list="colorList"
|
|
188
112
|
:scope="scope"
|
|
189
113
|
@row-bg-change="(params) => emit('row-bg-change', params)"
|
|
@@ -203,217 +127,63 @@
|
|
|
203
127
|
v-if="showColumnHeadSortIcon(column)"
|
|
204
128
|
#header="scope"
|
|
205
129
|
>
|
|
206
|
-
<
|
|
130
|
+
<biz-table-header-popover
|
|
207
131
|
ref="sortFilterPopoverRef"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
:
|
|
212
|
-
|
|
132
|
+
:head-active="isColumnHeadActive(column)"
|
|
133
|
+
:column="column"
|
|
134
|
+
:showing-columns="showingColumns"
|
|
135
|
+
:temp-summary-list="tempSummaryList"
|
|
136
|
+
:temp-sorting-column="tempSortingColumn"
|
|
137
|
+
:temp-sort-type="tempSortType"
|
|
138
|
+
:temp-filtered-value="tempFilteredValue"
|
|
139
|
+
:temp-search-value="tempSearchValue"
|
|
140
|
+
@update:tempSummaryList="val => { tempSummaryList = val }"
|
|
141
|
+
@update:tempFilteredValue="(key, value) => { tempFilteredValue[key] = value }"
|
|
142
|
+
@update:tempSearchValue="(key, value) => { tempSearchValue[key] = value }"
|
|
143
|
+
@popover-show="() => handleHeaderPopoverShow(column)"
|
|
144
|
+
@update:sort="(type) => handleSort(type, column)"
|
|
145
|
+
@reset="() => handleHeaderOperationReset(column, scope)"
|
|
146
|
+
@confirm="() => handleHeaderOperationConfirm(column, scope)"
|
|
213
147
|
>
|
|
214
|
-
<template
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
<div :class="['editable-table__sort-icon', isColumnHeadActive(column) && 'editable-table__sort-icon--active']" />
|
|
219
|
-
</span>
|
|
220
|
-
</template>
|
|
221
|
-
<div class="sort-filter">
|
|
222
|
-
<div class="sort-filter__column-title">
|
|
223
|
-
{{ column.label }}
|
|
224
|
-
</div>
|
|
225
|
-
<div
|
|
226
|
-
v-if="column.isColumnSortable"
|
|
227
|
-
class="sort-filter__sort"
|
|
228
|
-
>
|
|
229
|
-
<div class="sort-filter__sort-title">
|
|
230
|
-
排序
|
|
231
|
-
</div>
|
|
232
|
-
<div class="sort-filter__sort-btns">
|
|
233
|
-
<el-button
|
|
234
|
-
:class="['sort-filter__sort-btn', tempSortingColumn?.prop === column.prop && tempSortType === 'ascending' && 'sort-filter__sort-btn--active']"
|
|
235
|
-
@click="handleSort('ascending', column)"
|
|
236
|
-
>
|
|
237
|
-
升序
|
|
238
|
-
</el-button>
|
|
239
|
-
<el-button
|
|
240
|
-
:class="['sort-filter__sort-btn', tempSortingColumn?.prop === column.prop && tempSortType === 'descending' && 'sort-filter__sort-btn--active']"
|
|
241
|
-
@click="handleSort('descending', column)"
|
|
242
|
-
>
|
|
243
|
-
降序
|
|
244
|
-
</el-button>
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
<div
|
|
248
|
-
v-if="column.search && !Array.isArray(column.search)"
|
|
249
|
-
class="sort-filter__search"
|
|
250
|
-
>
|
|
251
|
-
<div class="sort-filter__search-title">
|
|
252
|
-
搜索
|
|
253
|
-
</div>
|
|
254
|
-
<el-input
|
|
255
|
-
v-model.trim="tempSearchValue[column.prop]"
|
|
256
|
-
class="sort-filter__search-input"
|
|
257
|
-
placeholder="请输入内容"
|
|
258
|
-
/>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<div
|
|
262
|
-
v-if="column.search && Array.isArray(column.search)"
|
|
263
|
-
class="sort-filter__search"
|
|
264
|
-
style="display: flex;flex-direction: column;gap: 12px;"
|
|
265
|
-
>
|
|
266
|
-
<div
|
|
267
|
-
v-for="item in column.search"
|
|
268
|
-
:key="item.prop"
|
|
269
|
-
>
|
|
270
|
-
<div class="sort-filter__search-title">
|
|
271
|
-
{{ item.label }}
|
|
272
|
-
</div>
|
|
273
|
-
<el-input
|
|
274
|
-
v-model.trim="tempSearchValue[item.prop]"
|
|
275
|
-
class="sort-filter__search-input"
|
|
276
|
-
placeholder="请输入内容"
|
|
277
|
-
/>
|
|
278
|
-
</div>
|
|
279
|
-
</div>
|
|
280
|
-
|
|
281
|
-
<div
|
|
282
|
-
v-if="column.filters && ((Array.isArray(column.filters) ? column.filters : column.filters.options).length > 0)"
|
|
283
|
-
class="sort-filter__filter"
|
|
148
|
+
<template #filter-item="item">
|
|
149
|
+
<slot
|
|
150
|
+
:name="column.prop + '-filter-item'"
|
|
151
|
+
v-bind="item"
|
|
284
152
|
>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
>
|
|
293
|
-
<el-checkbox
|
|
294
|
-
v-for="item in (Array.isArray(column.filters) ? column.filters : column.filters.options)"
|
|
295
|
-
:key="item.value"
|
|
296
|
-
:label="item.value"
|
|
297
|
-
class="sort-filter__filter-checkbox"
|
|
298
|
-
>
|
|
299
|
-
<slot
|
|
300
|
-
:name="column.prop + '-filter-item'"
|
|
301
|
-
v-bind="item"
|
|
302
|
-
>
|
|
303
|
-
{{ item.text }}
|
|
304
|
-
</slot>
|
|
305
|
-
</el-checkbox>
|
|
306
|
-
</el-checkbox-group>
|
|
307
|
-
|
|
308
|
-
<el-radio-group
|
|
309
|
-
v-if="column.filters && !Array.isArray(column.filters) && column.filters.type === 'radio'"
|
|
310
|
-
v-model="tempFilteredValue[column.prop]"
|
|
311
|
-
style="display: flex;flex-direction: column;gap: 6px;"
|
|
312
|
-
>
|
|
313
|
-
<el-radio
|
|
314
|
-
v-for="item in column.filters.options"
|
|
315
|
-
:key="item.value"
|
|
316
|
-
:label="item.value"
|
|
317
|
-
>
|
|
318
|
-
<slot
|
|
319
|
-
:name="column.prop + '-filter-item'"
|
|
320
|
-
v-bind="item"
|
|
321
|
-
>
|
|
322
|
-
{{ item.text }}
|
|
323
|
-
</slot>
|
|
324
|
-
</el-radio>
|
|
325
|
-
</el-radio-group>
|
|
326
|
-
</div>
|
|
327
|
-
<div
|
|
328
|
-
v-if="column.summary"
|
|
329
|
-
class="sort-filter__filter"
|
|
153
|
+
{{ item.text }}
|
|
154
|
+
</slot>
|
|
155
|
+
</template>
|
|
156
|
+
<template #summay-item>
|
|
157
|
+
<slot
|
|
158
|
+
:name="column.prop + '-summay-item'"
|
|
159
|
+
v-bind="column"
|
|
330
160
|
>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
v-model="tempSummaryList"
|
|
336
|
-
class="sort-filter__filter-checkbox-group"
|
|
337
|
-
>
|
|
338
|
-
<el-checkbox
|
|
339
|
-
:label="column.prop"
|
|
340
|
-
class="sort-filter__filter-checkbox"
|
|
341
|
-
>
|
|
342
|
-
<slot
|
|
343
|
-
:name="column.prop + '-summay-item'"
|
|
344
|
-
v-bind="column"
|
|
345
|
-
>
|
|
346
|
-
{{ column.label }}
|
|
347
|
-
</slot>
|
|
348
|
-
</el-checkbox>
|
|
349
|
-
</el-checkbox-group>
|
|
350
|
-
</div>
|
|
351
|
-
<div class="sort-filter__footer">
|
|
352
|
-
<el-button
|
|
353
|
-
class="sort-filter__reset-btn"
|
|
354
|
-
@click="handleHeaderOperationReset(column, scope)"
|
|
355
|
-
>
|
|
356
|
-
重置
|
|
357
|
-
</el-button>
|
|
358
|
-
<el-button
|
|
359
|
-
class="sort-filter__confirm-btn"
|
|
360
|
-
type="primary"
|
|
361
|
-
@click="handleHeaderOperationConfirm(column, scope)"
|
|
362
|
-
>
|
|
363
|
-
确定
|
|
364
|
-
</el-button>
|
|
365
|
-
</div>
|
|
366
|
-
</div>
|
|
367
|
-
</el-popover>
|
|
161
|
+
{{ column.label }}
|
|
162
|
+
</slot>
|
|
163
|
+
</template>
|
|
164
|
+
</biz-table-header-popover>
|
|
368
165
|
</template>
|
|
369
166
|
<!-- 默认操作按钮,defaultOperations属性不为空数组时展示。编辑状态下隐藏 -->
|
|
370
167
|
<template
|
|
371
168
|
v-if="column.prop === '$$operation'"
|
|
372
169
|
#default="scope"
|
|
373
170
|
>
|
|
374
|
-
<
|
|
171
|
+
<biz-table-operate-popover
|
|
375
172
|
v-if="editingRowIndex !== scope.$index"
|
|
376
173
|
ref="operationPopoverRef"
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
174
|
+
:default-operations="defaultOperations"
|
|
175
|
+
:hovering-cell-info="hoveringCellInfo"
|
|
176
|
+
:scope="scope"
|
|
177
|
+
@edit="() => handleEdit(scope)"
|
|
178
|
+
@delete="() => handleDelete(scope.row, scope.$index)"
|
|
179
|
+
@rowPinToTop="() => handleRowPinToTop(scope)"
|
|
380
180
|
>
|
|
381
|
-
<
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
</el-button>
|
|
388
|
-
</div>
|
|
389
|
-
<div class="operation-popover__operation">
|
|
390
|
-
<div
|
|
391
|
-
v-if="defaultOperations.includes('delete')"
|
|
392
|
-
class="operation-popover__operation-item btn-pointer"
|
|
393
|
-
@click="handleDelete(scope.row, scope.$index)"
|
|
394
|
-
>
|
|
395
|
-
删除
|
|
396
|
-
</div>
|
|
397
|
-
<div
|
|
398
|
-
v-if="defaultOperations.includes('edit')"
|
|
399
|
-
class="operation-popover__operation-item btn-pointer"
|
|
400
|
-
@click="handleEdit(scope)"
|
|
401
|
-
>
|
|
402
|
-
编辑
|
|
403
|
-
</div>
|
|
404
|
-
<div
|
|
405
|
-
v-if="defaultOperations.includes('top')"
|
|
406
|
-
class="operation-popover__operation-item btn-pointer"
|
|
407
|
-
@click="handleRowPinToTop(scope)"
|
|
408
|
-
>
|
|
409
|
-
置顶
|
|
410
|
-
</div>
|
|
411
|
-
<slot
|
|
412
|
-
name="custom-operation"
|
|
413
|
-
v-bind="scope"
|
|
414
|
-
/>
|
|
415
|
-
</div>
|
|
416
|
-
</el-popover>
|
|
181
|
+
<slot
|
|
182
|
+
name="custom-operation"
|
|
183
|
+
v-bind="scope"
|
|
184
|
+
/>
|
|
185
|
+
</biz-table-operate-popover>
|
|
186
|
+
|
|
417
187
|
<div
|
|
418
188
|
v-else
|
|
419
189
|
class="operation-popover__save-cancel"
|
|
@@ -453,30 +223,11 @@
|
|
|
453
223
|
:name="column.editSlotName"
|
|
454
224
|
/>
|
|
455
225
|
<!-- 内置编辑类型 -->
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
/>
|
|
462
|
-
</div>
|
|
463
|
-
<div v-if="column.editType === 'select'">
|
|
464
|
-
<el-select v-model="editingRowData[column.prop]">
|
|
465
|
-
<el-option
|
|
466
|
-
v-for="item in column.selectOptions"
|
|
467
|
-
:key="item.label"
|
|
468
|
-
:label="item.label"
|
|
469
|
-
:value="item.value"
|
|
470
|
-
/>
|
|
471
|
-
</el-select>
|
|
472
|
-
</div>
|
|
473
|
-
<el-date-picker
|
|
474
|
-
v-if="column.editType === 'date'"
|
|
475
|
-
v-model="editingRowData[column.prop]"
|
|
476
|
-
type="date"
|
|
477
|
-
placeholder="选择日期"
|
|
478
|
-
/>
|
|
479
|
-
</div>
|
|
226
|
+
<biz-edit-cell
|
|
227
|
+
v-else-if="column.editType"
|
|
228
|
+
v-model="editingRowData[column.prop]"
|
|
229
|
+
:column="column"
|
|
230
|
+
/>
|
|
480
231
|
<!-- 不支持编辑 -->
|
|
481
232
|
<slot
|
|
482
233
|
v-else
|
|
@@ -491,32 +242,11 @@
|
|
|
491
242
|
#default="scope"
|
|
492
243
|
>
|
|
493
244
|
<!-- 当前行编辑中,内置编辑类型 -->
|
|
494
|
-
<
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
type="text"
|
|
500
|
-
/>
|
|
501
|
-
</div>
|
|
502
|
-
<div v-if="column.editType === 'select'">
|
|
503
|
-
<el-select v-model="editingRowData[column.prop]">
|
|
504
|
-
<el-option
|
|
505
|
-
v-for="item in column.selectOptions"
|
|
506
|
-
:key="item.value"
|
|
507
|
-
:label="item.label"
|
|
508
|
-
:value="item.value"
|
|
509
|
-
/>
|
|
510
|
-
</el-select>
|
|
511
|
-
</div>
|
|
512
|
-
<div v-if="column.editType === 'date'">
|
|
513
|
-
<el-date-picker
|
|
514
|
-
v-model="editingRowData[column.prop]"
|
|
515
|
-
type="date"
|
|
516
|
-
placeholder="选择日期"
|
|
517
|
-
/>
|
|
518
|
-
</div>
|
|
519
|
-
</template>
|
|
245
|
+
<biz-edit-cell
|
|
246
|
+
v-if="editingRowIndex === scope.$index && column.editType"
|
|
247
|
+
v-model="editingRowData[column.prop]"
|
|
248
|
+
:column="column"
|
|
249
|
+
/>
|
|
520
250
|
<!-- 当前行编辑中,自定义编辑类型 -->
|
|
521
251
|
<slot
|
|
522
252
|
v-else-if="column.editSlotName && scope.$index === editingRowIndex"
|
|
@@ -567,17 +297,24 @@
|
|
|
567
297
|
</template>
|
|
568
298
|
|
|
569
299
|
<script lang="ts" setup>
|
|
570
|
-
import
|
|
300
|
+
import BizColorSelect from './features/bizColorSelect.vue';
|
|
301
|
+
import BizViewSettingDialog from './features/bizViewSettingDialog.vue'
|
|
302
|
+
import BizTableHeaderPopover from './features/bizTableHeaderPopover.vue'
|
|
303
|
+
import BizEditCell from './features/bizEditCell.vue'
|
|
304
|
+
import BizTableOperatePopover from './features/bizTableOperatePopover.vue'
|
|
571
305
|
|
|
572
306
|
import { computed, nextTick, ref, watch } from 'vue';
|
|
573
307
|
import { Message } from 'element-ui';
|
|
574
|
-
|
|
575
|
-
import
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
308
|
+
|
|
309
|
+
import {
|
|
310
|
+
usePagination,
|
|
311
|
+
useCellHover,
|
|
312
|
+
useRowBgColor,
|
|
313
|
+
useDefaultOperation,
|
|
314
|
+
useColumnHeaderOperation,
|
|
315
|
+
useDragSort,
|
|
316
|
+
} from './bizHooks'
|
|
317
|
+
|
|
581
318
|
import { ITableDataItem, IColumnConfig, IDefaultOperationType, IColorList } from './types';
|
|
582
319
|
|
|
583
320
|
// defineProps泛型参数如果从外部传入,编译报错
|
|
@@ -667,6 +404,8 @@ const props = withDefaults(defineProps<IProps>(), {
|
|
|
667
404
|
const emit = defineEmits<IEmits>();
|
|
668
405
|
|
|
669
406
|
const showingColumns = ref<string[]>([]); // 表格中实际展示的列
|
|
407
|
+
const leftFixedColumnCount = ref(0) // 左侧固定列数量
|
|
408
|
+
const viewSettingDragSortOptions = ref<IColumnConfig[]>([])
|
|
670
409
|
|
|
671
410
|
const actualColumns = computed(() => {
|
|
672
411
|
const res: IColumnConfig[] = [];
|
|
@@ -754,24 +493,6 @@ const {
|
|
|
754
493
|
hasExpandRow: props.hasExpandRow
|
|
755
494
|
});
|
|
756
495
|
|
|
757
|
-
/************ 显示设置相关 ************ */
|
|
758
|
-
const {
|
|
759
|
-
viewSettingDragSortOptions,
|
|
760
|
-
columnsToBeShown,
|
|
761
|
-
viewSettingVisible,
|
|
762
|
-
leftFixedColumnCount,
|
|
763
|
-
tempLeftFixedColumnCount,
|
|
764
|
-
handleInputTempLeftFixedColumnCount,
|
|
765
|
-
handleViewSettingShow,
|
|
766
|
-
handleViewSettingClose,
|
|
767
|
-
handleViewSettingConfirm
|
|
768
|
-
} = useViewSetting({
|
|
769
|
-
tableDomRef,
|
|
770
|
-
showingColumns,
|
|
771
|
-
actualColumns,
|
|
772
|
-
props
|
|
773
|
-
});
|
|
774
|
-
|
|
775
496
|
/************ 列头部操作相关 ************ */
|
|
776
497
|
const {
|
|
777
498
|
setSort,
|
|
@@ -856,10 +577,8 @@ const handleSelectionChange = (e) => {
|
|
|
856
577
|
emit('selection-change', e);
|
|
857
578
|
};
|
|
858
579
|
|
|
859
|
-
const
|
|
860
|
-
|
|
861
|
-
columnsToBeShown.value = columnsToBeShown.value.filter(c => c !== item.prop);
|
|
862
|
-
};
|
|
580
|
+
const bizViewSettingDialogRef = ref(null as unknown as InstanceType<typeof BizViewSettingDialog>)
|
|
581
|
+
const handleViewSettingShow = () => bizViewSettingDialogRef.value.open()
|
|
863
582
|
|
|
864
583
|
defineExpose({
|
|
865
584
|
closeAllExpandedRows,
|