@lx-frontend/wrap-element-ui 1.0.7-beta.1 → 1.0.7-beta.2
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/useColumnHeaderOperation.ts +14 -6
- package/src/components/EditableTable/features/bizTableHeaderPopover.vue +2 -0
- package/src/components/EditableTable/index.less +33 -1
- package/src/components/EditableTable/index.vue +1 -1
- package/src/components/EditableTable/types/index.ts +2 -0
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
|
|
|
46
46
|
watch(
|
|
47
47
|
() => props.columnConfig,
|
|
48
48
|
(val) => {
|
|
49
|
-
|
|
49
|
+
val?.forEach(v => handleResetFilterValue(v));
|
|
50
50
|
tempFilteredValue.value = { ...filteredValue.value };
|
|
51
51
|
},
|
|
52
52
|
{ immediate: true }
|
|
@@ -226,6 +226,18 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
function handleResetFilterValue (column: IColumnConfig) {
|
|
230
|
+
if (column.filters) {
|
|
231
|
+
if (Array.isArray(column.filters)) {
|
|
232
|
+
filteredValue.value[column.prop] = []
|
|
233
|
+
} else if (column.filters.default) {
|
|
234
|
+
filteredValue.value[column.prop] = column.filters.default
|
|
235
|
+
} else {
|
|
236
|
+
filteredValue.value[column.prop] = column.filters.type === 'radio' ? '' : []
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
229
241
|
const handleHeaderOperationReset = async (column: IColumnConfig, scope) => {
|
|
230
242
|
if (sortingColumn.value && sortingColumn.value.prop === column.prop) {
|
|
231
243
|
clearSort();
|
|
@@ -234,11 +246,7 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
|
|
|
234
246
|
// 合计
|
|
235
247
|
summaryList.value = summaryList.value.filter(item => item !== column.prop);
|
|
236
248
|
|
|
237
|
-
|
|
238
|
-
filteredValue.value[column.prop] = Array.isArray(column.filters)
|
|
239
|
-
? []
|
|
240
|
-
: column.filters.default ?? []
|
|
241
|
-
}
|
|
249
|
+
handleResetFilterValue(column)
|
|
242
250
|
if (column.search) {
|
|
243
251
|
if (!Array.isArray(column.search)) {
|
|
244
252
|
searchValue.value[column.prop] = '';
|
|
@@ -125,6 +125,7 @@
|
|
|
125
125
|
v-for="item in (Array.isArray(column.filters) ? column.filters : column.filters.options)"
|
|
126
126
|
:key="item.value"
|
|
127
127
|
:label="item.value"
|
|
128
|
+
:title="item.text"
|
|
128
129
|
class="editable-table-sort-filter__filter-checkbox"
|
|
129
130
|
>
|
|
130
131
|
<slot
|
|
@@ -146,6 +147,7 @@
|
|
|
146
147
|
v-for="item in column.filters.options"
|
|
147
148
|
:key="item.value"
|
|
148
149
|
:label="item.value"
|
|
150
|
+
:title="item.text"
|
|
149
151
|
>
|
|
150
152
|
<slot
|
|
151
153
|
name="filter-item"
|
|
@@ -387,10 +387,26 @@
|
|
|
387
387
|
&__sort,
|
|
388
388
|
&__search {
|
|
389
389
|
padding: 14px;
|
|
390
|
+
|
|
391
|
+
.el-radio__label {
|
|
392
|
+
white-space: nowrap;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
width: calc(100% + 10px);
|
|
396
|
+
display: inline-block;
|
|
397
|
+
vertical-align: middle;
|
|
398
|
+
}
|
|
390
399
|
}
|
|
391
400
|
|
|
392
401
|
&__filter {
|
|
393
402
|
padding-top: 0;
|
|
403
|
+
|
|
404
|
+
.el-radio-group,
|
|
405
|
+
.el-checkbox-group {
|
|
406
|
+
max-height: 166px;
|
|
407
|
+
overflow-y: auto;
|
|
408
|
+
overflow-x: hidden;
|
|
409
|
+
}
|
|
394
410
|
}
|
|
395
411
|
|
|
396
412
|
&__filter-title,
|
|
@@ -447,6 +463,7 @@
|
|
|
447
463
|
}
|
|
448
464
|
|
|
449
465
|
&__filter-checkbox-group {
|
|
466
|
+
width: 100%;
|
|
450
467
|
display: flex;
|
|
451
468
|
flex-direction: column;
|
|
452
469
|
justify-content: flex-start;
|
|
@@ -456,10 +473,20 @@
|
|
|
456
473
|
&__filter-checkbox {
|
|
457
474
|
margin-top: 10px;
|
|
458
475
|
font-size: 14px;
|
|
476
|
+
width: 100%;
|
|
459
477
|
|
|
460
478
|
&:first-child {
|
|
461
479
|
margin-top: 0;
|
|
462
480
|
}
|
|
481
|
+
|
|
482
|
+
.el-checkbox__label {
|
|
483
|
+
white-space: nowrap;
|
|
484
|
+
overflow: hidden;
|
|
485
|
+
text-overflow: ellipsis;
|
|
486
|
+
width: calc(100% - 20px);
|
|
487
|
+
display: inline-block;
|
|
488
|
+
vertical-align: middle;
|
|
489
|
+
}
|
|
463
490
|
}
|
|
464
491
|
|
|
465
492
|
&__footer {
|
|
@@ -496,6 +523,11 @@
|
|
|
496
523
|
background: @--theme-blue--;
|
|
497
524
|
border-color: @--theme-blue--;
|
|
498
525
|
}
|
|
526
|
+
|
|
527
|
+
.el-checkbox__input.is-checked+.el-checkbox__label,
|
|
528
|
+
.el-radio__input.is-checked+.el-radio__label {
|
|
529
|
+
color: @--theme-blue--;
|
|
530
|
+
}
|
|
499
531
|
}
|
|
500
532
|
|
|
501
533
|
&__pin-top {
|
|
@@ -725,4 +757,4 @@
|
|
|
725
757
|
&::before {
|
|
726
758
|
bottom: -4px;
|
|
727
759
|
}
|
|
728
|
-
}
|
|
760
|
+
}
|
|
@@ -12,6 +12,8 @@ type _IColumnConfigRequired = {
|
|
|
12
12
|
editType?: IEditType; // 编辑格式
|
|
13
13
|
editSlotName?: string; // 编辑时,自定义编辑组件的slotName
|
|
14
14
|
sortable?: boolean; // 该列是否允许排序,ture则表头弹窗会显示升降序按钮
|
|
15
|
+
/** 内部使用, */
|
|
16
|
+
isColumnSortable?: boolean;
|
|
15
17
|
slotName?: string; // 如果要自定义,传入 slotName
|
|
16
18
|
hoverSlotName?: string; // 悬浮时,自定义悬浮组件的slotName
|
|
17
19
|
isAlwaysShow?: boolean; // 不可隐藏,显示设置中,该列不允许隐藏
|