|
|
@ -63,9 +63,15 @@ const props = defineProps({ |
|
|
|
required: false, |
|
|
|
default: [] |
|
|
|
}, |
|
|
|
//回车触发搜索。默认true |
|
|
|
enterSearch:{ |
|
|
|
type: Boolean, |
|
|
|
required: false, |
|
|
|
default: true |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
const emit = defineEmits(['search', 'reset','onInput','onChange','searchTableSuccess']) |
|
|
|
const emit = defineEmits(['search', 'reset','onInput','onChange','onEnter','searchTableSuccess']) |
|
|
|
|
|
|
|
const visible = ref(true) |
|
|
|
|
|
|
@ -116,6 +122,13 @@ const onInput = (field,value) => { |
|
|
|
const onChange = (field, value)=>{ |
|
|
|
emit('onChange', field,value) |
|
|
|
} |
|
|
|
const onEnter = async (field, value, e) => { |
|
|
|
if(props.enterSearch){ |
|
|
|
search() |
|
|
|
}else{ |
|
|
|
emit('onEnter', field, value, e) |
|
|
|
} |
|
|
|
} |
|
|
|
const searchTableRef = ref() |
|
|
|
const opensearchTable = ( |
|
|
|
formField, |
|
|
@ -291,6 +304,7 @@ defineExpose({setFormValues,search}) // 提供 open 方法,用于打开弹窗 |
|
|
|
@onInput="onInput" |
|
|
|
@opensearchTable="opensearchTable" |
|
|
|
@onChange="onChange" |
|
|
|
@onEnter="onEnter" |
|
|
|
> |
|
|
|
<template #action> |
|
|
|
<div v-if="layout === 'inline'"> |
|
|
|