@lx-frontend/wrap-element-ui 1.0.7-beta.2 → 1.0.7-beta.4
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
CHANGED
|
@@ -166,7 +166,7 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
|
|
|
166
166
|
if (!tempSearchValue.value[v.prop]) tempSearchValue.value[v.prop] = ''
|
|
167
167
|
if (!validate) return
|
|
168
168
|
if (v.validator) {
|
|
169
|
-
const result = v.validator(tempSearchValue.value[v.prop]);
|
|
169
|
+
const result = v.validator(tempSearchValue.value[v.prop]?.trim());
|
|
170
170
|
if (validate && !result) validate = false;
|
|
171
171
|
}
|
|
172
172
|
})
|
|
@@ -194,7 +194,10 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
filteredValue.value = { ...tempFilteredValue.value };
|
|
197
|
-
searchValue.value =
|
|
197
|
+
searchValue.value = Object.keys(tempSearchValue.value).reduce((pre, key) => {
|
|
198
|
+
pre[key] = tempSearchValue.value[key]?.trim() ?? '';
|
|
199
|
+
return pre;
|
|
200
|
+
}, {});
|
|
198
201
|
|
|
199
202
|
emitSearch();
|
|
200
203
|
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
style="display: flex;flex-direction: column;gap: 12px;"
|
|
89
89
|
>
|
|
90
90
|
<el-date-picker
|
|
91
|
-
@input="val => emit('update:tempSearchValue', column.doubleDatePicker.props[0], val)"
|
|
91
|
+
@input="val => emit('update:tempSearchValue', column.doubleDatePicker.props[0], val || '')"
|
|
92
92
|
:value="tempSearchValue[column.doubleDatePicker.props[0]]"
|
|
93
93
|
value-format="yyyy-MM-dd"
|
|
94
94
|
format="yyyy-MM-dd"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
placeholder="开始日期"
|
|
98
98
|
/>
|
|
99
99
|
<el-date-picker
|
|
100
|
-
@input="val => emit('update:tempSearchValue', column.doubleDatePicker.props[1], val)"
|
|
100
|
+
@input="val => emit('update:tempSearchValue', column.doubleDatePicker.props[1], val || '')"
|
|
101
101
|
:value="tempSearchValue[column.doubleDatePicker.props[1]]"
|
|
102
102
|
value-format="yyyy-MM-dd"
|
|
103
103
|
format="yyyy-MM-dd"
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
<el-pagination
|
|
285
285
|
background
|
|
286
286
|
layout="sizes, prev, pager, next, jumper"
|
|
287
|
-
:page-sizes="
|
|
287
|
+
:page-sizes="pageSizes"
|
|
288
288
|
:page-size.sync="pageSize"
|
|
289
289
|
:pager-count="11"
|
|
290
290
|
:current-page="currentPage"
|
|
@@ -353,6 +353,7 @@ interface IProps {
|
|
|
353
353
|
localFilter?: boolean
|
|
354
354
|
/** 页码 */
|
|
355
355
|
currentPage: number
|
|
356
|
+
pageSizes?: number[]
|
|
356
357
|
}
|
|
357
358
|
|
|
358
359
|
interface IEmits {
|
|
@@ -398,6 +399,7 @@ const props = withDefaults(defineProps<IProps>(), {
|
|
|
398
399
|
localSort: false,
|
|
399
400
|
localFilter: false,
|
|
400
401
|
currentPage: 1,
|
|
402
|
+
pageSizes: () => [10, 15, 30, 60, 100],
|
|
401
403
|
});
|
|
402
404
|
|
|
403
405
|
// 同defineProps一样,不支持泛型参数从外部导入
|
|
@@ -514,7 +516,7 @@ const {
|
|
|
514
516
|
tempSortType,
|
|
515
517
|
sortingColumn,
|
|
516
518
|
isColumnFiltering,
|
|
517
|
-
|
|
519
|
+
searchValue,
|
|
518
520
|
inSorting,
|
|
519
521
|
} = useColumnHeaderOperation({
|
|
520
522
|
tableDomRef,
|
|
@@ -561,7 +563,7 @@ const doTableLayout = async () => {
|
|
|
561
563
|
// 过滤出自定义属性,将其它属性全部透传给 el-table-column
|
|
562
564
|
const getColumnBindProps = (column: IColumnConfig) => {
|
|
563
565
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
564
|
-
const {
|
|
566
|
+
const { editType, slotName, inputType, options, filters, ...rest } = column;
|
|
565
567
|
return rest;
|
|
566
568
|
};
|
|
567
569
|
|
|
@@ -593,6 +595,7 @@ defineExpose({
|
|
|
593
595
|
watch([
|
|
594
596
|
() => props.loading,
|
|
595
597
|
() => props.currentPage,
|
|
598
|
+
() => pageSize,
|
|
596
599
|
], ([loading]) => {
|
|
597
600
|
if (loading) return;
|
|
598
601
|
tableDomRef.value.$el.querySelector('.el-table__body-wrapper').scrollTop = 0;
|