Browse Source
Merge pull request #722 from colinin/enhance-table
the query field is searchable
pull/731/head
yx lin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
apps/vue/src/components/Table/src/components/AdvancedSearch.vue
|
|
@ -22,8 +22,10 @@ |
|
|
<template v-if="column.dataIndex==='field'"> |
|
|
<template v-if="column.dataIndex==='field'"> |
|
|
<Select |
|
|
<Select |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
|
|
|
show-search |
|
|
v-model:value="record.field" |
|
|
v-model:value="record.field" |
|
|
:options="getAvailableParams" |
|
|
:options="getAvailableParams" |
|
|
|
|
|
:filter-option="filterOption" |
|
|
:field-names="{ label: 'description', value: 'name' }" |
|
|
:field-names="{ label: 'description', value: 'name' }" |
|
|
@change="(field) => handleFieldChange(field, record)" |
|
|
@change="(field) => handleFieldChange(field, record)" |
|
|
/> |
|
|
/> |
|
|
@ -121,6 +123,7 @@ |
|
|
dataIndex: 'field', |
|
|
dataIndex: 'field', |
|
|
key: 'field', |
|
|
key: 'field', |
|
|
title: t('component.table.advancedSearch.field'), |
|
|
title: t('component.table.advancedSearch.field'), |
|
|
|
|
|
width: 240, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
dataIndex: 'comparison', |
|
|
dataIndex: 'comparison', |
|
|
@ -220,6 +223,10 @@ |
|
|
return defineParams.filter(dp => !formMdel.paramters.some(fp => fp.field === dp.name)); |
|
|
return defineParams.filter(dp => !formMdel.paramters.some(fp => fp.field === dp.name)); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const filterOption = (input: string, option: any) => { |
|
|
|
|
|
return option.description.toLowerCase().indexOf(input.toLowerCase()) >= 0; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
onMounted(fetch); |
|
|
onMounted(fetch); |
|
|
|
|
|
|
|
|
const [registerModal, { closeModal }] = useModalInner(); |
|
|
const [registerModal, { closeModal }] = useModalInner(); |
|
|
|