fix(组件): ms-form-table 支持表格筛选高亮

This commit is contained in:
baiqi 2024-11-13 10:22:30 +08:00 committed by Craftsman
parent a8e718a961
commit 30ddada8f7
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@
]" ]"
bordered bordered
:row-class="rowClass" :row-class="rowClass"
:filter="filterData"
v-on="propsEvent" v-on="propsEvent"
@drag-change="tableChange" @drag-change="tableChange"
@init-end="validateAndUpdateErrorMessageList" @init-end="validateAndUpdateErrorMessageList"
@ -355,7 +356,7 @@
const expandedKeys = defineModel<string[]>('expandedKeys', { default: [] }); const expandedKeys = defineModel<string[]>('expandedKeys', { default: [] });
const originalSelectedKeys = defineModel<(string | number)[]>('originalSelectedKeys', { default: [] }); const originalSelectedKeys = defineModel<(string | number)[]>('originalSelectedKeys', { default: [] });
const filterData = ref({}); const filterData = ref<Record<string, any>>({});
async function initColumns() { async function initColumns() {
if (props.showSetting && props.tableKey) { if (props.showSetting && props.tableKey) {
@ -407,6 +408,7 @@
dataIndex: string, dataIndex: string,
isCustomParam: boolean isCustomParam: boolean
) => { ) => {
filterData.value[dataIndex] = value;
emit('filterChange', dataIndex, value, isCustomParam); emit('filterChange', dataIndex, value, isCustomParam);
}; };