|
|
@ -1008,8 +1008,10 @@ const onChange = (field, cur) => { |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param e |
|
|
|
*/ |
|
|
|
|
|
|
|
const isOnBlur = ref(true) |
|
|
|
const onBlur = async (field, e) => { |
|
|
|
// isOnBlur是false的时候证明先走了回车事件,可以不走失去焦点方法,true的时候直接走失去焦点事件 |
|
|
|
if (isOnBlur.value) {//同时走失去焦点方法bug |
|
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps |
|
|
|
if (formSchemaObj?.enterSearch) { |
|
|
|
await FormBlur( |
|
|
@ -1035,6 +1037,8 @@ const onBlur = async (field, e) => { |
|
|
|
} else { |
|
|
|
emit('onBlur', field, e) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 批量增加 |
|
|
@ -1138,6 +1142,7 @@ const inputStringFcous= (headerItem) => { |
|
|
|
const onEnter = async (field, value, e) => { |
|
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps |
|
|
|
if (formSchemaObj?.enterSearch && formSchemaObj?.isEnter) { |
|
|
|
isOnBlur.value = false//解决回车事件和失去焦点同时调用bug |
|
|
|
await FormBlur( |
|
|
|
field, |
|
|
|
value, |
|
|
@ -1146,8 +1151,11 @@ const onEnter = async (field, value, e) => { |
|
|
|
props.detailData, |
|
|
|
formSchemaObj, |
|
|
|
(list) => { |
|
|
|
isOnBlur.value = true |
|
|
|
if (list.length != 0) { |
|
|
|
emit('onEnter', field, value, e) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} else { |
|
|
|
emit('onEnter', field, value, e) |
|
|
|