@lx-frontend/wrap-element-ui 1.0.19-beta.8 → 1.0.19
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 +9 -17
- package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +1 -6
- package/src/components/EditableTable/index.vue +7 -13
- package/src/components/EditableTable/types/index.ts +1 -7
package/package.json
CHANGED
|
@@ -92,10 +92,6 @@ export function useColumnHeaderOperation({ props, tableDomRef, emit, showingColu
|
|
|
92
92
|
return !!(filteredValue.value[item.prop] as any[]).length
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
if (item.type === 'slot') {
|
|
96
|
-
return item.active
|
|
97
|
-
}
|
|
98
|
-
|
|
99
95
|
return !!filteredValue.value[item.prop]
|
|
100
96
|
}
|
|
101
97
|
)
|
|
@@ -143,17 +139,15 @@ export function useColumnHeaderOperation({ props, tableDomRef, emit, showingColu
|
|
|
143
139
|
const params: Record<string, any> = {};
|
|
144
140
|
|
|
145
141
|
const processFilter = (filters: FilterListType) => {
|
|
146
|
-
filters
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
});
|
|
142
|
+
filters.forEach((item) => {
|
|
143
|
+
if (item.type === 'doubleDatePicker' || item.type === 'monthDayPicker') {
|
|
144
|
+
const [start, end] = item.prop
|
|
145
|
+
params[start] = filteredValue.value[start];
|
|
146
|
+
params[end] = filteredValue.value[end];
|
|
147
|
+
} else {
|
|
148
|
+
params[item.prop] = filteredValue.value[item.prop];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
157
151
|
}
|
|
158
152
|
|
|
159
153
|
// 仅提交显示的列的相关数据
|
|
@@ -248,7 +242,6 @@ export function useColumnHeaderOperation({ props, tableDomRef, emit, showingColu
|
|
|
248
242
|
|
|
249
243
|
function handleResetFilterValue (column: IColumnConfig) {
|
|
250
244
|
(column.filters || [])
|
|
251
|
-
.filter(item => item.type !== 'slot')
|
|
252
245
|
.forEach(
|
|
253
246
|
(item) => {
|
|
254
247
|
if (item.type === 'radio' || item.type === 'checkbox') {
|
|
@@ -294,7 +287,6 @@ export function useColumnHeaderOperation({ props, tableDomRef, emit, showingColu
|
|
|
294
287
|
// 设置搜索和过滤参数时,如果使用 showingColumns 遍历,会导致通过外部设置未显示的列的搜索和过滤参数丢失
|
|
295
288
|
[props.colorFilterConfig, ...props.columnConfig].forEach(column => {
|
|
296
289
|
(column?.filters ?? [])
|
|
297
|
-
.filter(item => item.type !== 'slot')
|
|
298
290
|
.forEach(
|
|
299
291
|
(item) => {
|
|
300
292
|
if (item.type === 'doubleDatePicker' || item.type === 'monthDayPicker') {
|
|
@@ -40,12 +40,7 @@
|
|
|
40
40
|
:key="index"
|
|
41
41
|
class="editable-table-sort-filter__item editable-table__filter-group__filter"
|
|
42
42
|
>
|
|
43
|
-
<slot
|
|
44
|
-
v-if="filterItem.type === 'slot'"
|
|
45
|
-
:name="filterItem.slotName"
|
|
46
|
-
/>
|
|
47
43
|
<component
|
|
48
|
-
v-else
|
|
49
44
|
:is="componentMap[filterItem.type]"
|
|
50
45
|
:config="filterItem"
|
|
51
46
|
:temp-filtered-value="tempFilteredValue"
|
|
@@ -130,7 +125,7 @@ const emit = defineEmits<{
|
|
|
130
125
|
}>()
|
|
131
126
|
|
|
132
127
|
// 把 filterItem.type 映射到组件
|
|
133
|
-
const componentMap: Record<
|
|
128
|
+
const componentMap: Record<FilterItem['type'], any> = {
|
|
134
129
|
/** 输入框 */
|
|
135
130
|
input: BizInputFilter,
|
|
136
131
|
/** 日期范围 */
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
@selection-change="handleSelectionChange"
|
|
45
45
|
@cell-mouse-enter="debouncedHoverHandler"
|
|
46
46
|
@header-dragend="doTableLayout"
|
|
47
|
+
@row-dblclick="handleRowDblClick"
|
|
47
48
|
>
|
|
48
49
|
<el-table-column
|
|
49
50
|
v-if="rowDragAble"
|
|
@@ -161,7 +162,7 @@
|
|
|
161
162
|
:temp-filtered-value="tempFilteredValue"
|
|
162
163
|
@update:tempSummaryList="val => { tempSummaryList = val }"
|
|
163
164
|
@update:tempFilteredValue="(key, value) => { $set(tempFilteredValue, key, value) }"
|
|
164
|
-
@popover-show="() =>
|
|
165
|
+
@popover-show="() => handleHeaderPopoverShow(column)"
|
|
165
166
|
@update:sort="handleSort"
|
|
166
167
|
@reset="() => handleHeaderOperationReset(column)"
|
|
167
168
|
@confirm="() => handleHeaderOperationConfirm(column)"
|
|
@@ -174,12 +175,6 @@
|
|
|
174
175
|
{{ column.label }}
|
|
175
176
|
</slot>
|
|
176
177
|
</template>
|
|
177
|
-
<template v-for="(_, name) in $slots">
|
|
178
|
-
<slot
|
|
179
|
-
:name="name"
|
|
180
|
-
v-bind="column"
|
|
181
|
-
/>
|
|
182
|
-
</template>
|
|
183
178
|
</biz-table-header-popover>
|
|
184
179
|
</template>
|
|
185
180
|
<!-- 默认操作按钮,defaultOperations属性不为空数组时展示。编辑状态下隐藏 -->
|
|
@@ -400,8 +395,8 @@ interface IEmits {
|
|
|
400
395
|
(e: 'search', param: Record<string, any>): void
|
|
401
396
|
/** 排序 */
|
|
402
397
|
(e: 'sort-change', param: { order: 'descending' | 'ascending' | null, prop: string }): void
|
|
403
|
-
/**
|
|
404
|
-
(e: '
|
|
398
|
+
/** 双击某一行 */
|
|
399
|
+
(e: 'row-dblclick', param: any): void
|
|
405
400
|
}
|
|
406
401
|
|
|
407
402
|
const props = withDefaults(defineProps<IProps>(), {
|
|
@@ -609,10 +604,9 @@ const handleSelectionChange = (e) => {
|
|
|
609
604
|
emit('selection-change', e);
|
|
610
605
|
};
|
|
611
606
|
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
607
|
+
const handleRowDblClick = (e) => {
|
|
608
|
+
emit('row-dblclick', e);
|
|
609
|
+
};
|
|
616
610
|
|
|
617
611
|
const bizViewSettingDialogRef = ref(null as unknown as InstanceType<typeof BizViewSettingDialog>)
|
|
618
612
|
const handleViewSettingShow = () => bizViewSettingDialogRef.value.open()
|
|
@@ -60,13 +60,7 @@ export interface IFilterColorRadio {
|
|
|
60
60
|
options: Array<IFilterSelectOptions & { color: string }>
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export
|
|
64
|
-
type: 'slot',
|
|
65
|
-
slotName: string,
|
|
66
|
-
active: boolean
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type FilterItem = IFilterInput | IFilterSelect | IFilterDoubleDatePicker | IFilterMonthDayPicker | IFilterColorRadio | IFilterSolt
|
|
63
|
+
export type FilterItem = IFilterInput | IFilterSelect | IFilterDoubleDatePicker | IFilterMonthDayPicker | IFilterColorRadio
|
|
70
64
|
|
|
71
65
|
/** 筛选组件类型 */
|
|
72
66
|
export type FilterListType = Array<FilterItem>
|