- 本页可选值
+ 可选值
全选
()
const visible = ref(false)
+ const draftText = ref('')
const draftKeyword = ref('')
const draftSelected = ref([])
const draftOp = ref('between')
@@ -199,7 +215,7 @@
let holdPopoverTimer: ReturnType | undefined
const typeHint = computed(() => {
- if (props.type === 'text') return '文本:搜索并勾选本页出现的值'
+ if (props.type === 'text') return '文本:输入关键字模糊匹配(整库)'
if (props.type === 'enum') return '枚举:勾选固定选项'
if (props.type === 'number') return '数字:运算符 + 单值或区间'
return '时间:按日期闭区间过滤'
@@ -216,7 +232,12 @@
function resetDraftFromModel() {
const m = props.modelValue
- if (props.type === 'text' || props.type === 'enum') {
+ if (props.type === 'text') {
+ const s = (m || { text: '' }) as TextColumnFilterState
+ draftText.value = s.text || ''
+ return
+ }
+ if (props.type === 'enum') {
const s = (m || { text: '', selected: [], keyword: '' }) as TextColumnFilterState
draftSelected.value = [...(s.selected || [])]
draftKeyword.value = s.keyword || ''
@@ -289,7 +310,10 @@
}
function buildState(): ColumnFilterState {
- if (props.type === 'text' || props.type === 'enum') {
+ if (props.type === 'text') {
+ return { text: draftText.value.trim() }
+ }
+ if (props.type === 'enum') {
return {
text: '',
selected: [...draftSelected.value],