Browse Source

HL-5395WMS,SCP,QMS在所有列表页上面的查询框中输入信息后按【回车】,可以直接查询,相当于点击了【查询按钮】

hella_online_20240823
wangyufei 3 months ago
parent
commit
0cd3efa642
  1. 7
      src/components/Form/src/Form.vue
  2. 7
      src/components/Search/src/Search.vue

7
src/components/Form/src/Form.vue

@ -55,7 +55,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'),
},
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onFocus','onEnter','hiddenFilterButton','changeDialogWidth','onInput'],
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onSubmit', 'onBlur','onFocus','onEnter','hiddenFilterButton','changeDialogWidth','onInput'],
setup(props, { slots, expose, emit }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -196,6 +196,10 @@ export default defineComponent({
const onChange = (field, cur) => {
emit('onChange', field, cur)
}
const onSubmit = (event) => {
emit('onSubmit', event)
}
/**
* 监听失去焦点
* @param field 当前操作字段
@ -461,6 +465,7 @@ export default defineComponent({
class={prefixCls}
v-loading={props.vLoading}
label-position={props.labelPosition}
onSubmit={(e)=>{onSubmit(e)}}
>
{{
//

7
src/components/Search/src/Search.vue

@ -122,7 +122,12 @@ const onInput = (field,value) => {
const onChange = (field, value)=>{
emit('onChange', field,value)
}
const onSubmit = (e) => {
e.preventDefault();
}
const onEnter = async (field, value, e) => {
if(props.enterSearch){
search()
}else{
@ -183,6 +188,7 @@ const opensearchTable = (
return
}
}
}else if(searchCondition[i].isTableRowValue){
if(searchCondition[i].required){
if (row[searchCondition[i].value] == '' ||row[searchCondition[i].value] == undefined) {
@ -305,6 +311,7 @@ defineExpose({setFormValues,search}) // 提供 open 方法,用于打开弹窗
@opensearchTable="opensearchTable"
@onChange="onChange"
@onEnter="onEnter"
@onSubmit="onSubmit"
>
<template #action>
<div v-if="layout === 'inline'">

Loading…
Cancel
Save