|
|
@ -1008,33 +1008,37 @@ const onChange = (field, cur) => { |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param e |
|
|
|
*/ |
|
|
|
|
|
|
|
const isOnBlur = ref(true) |
|
|
|
const onBlur = async (field, e) => { |
|
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps |
|
|
|
if (formSchemaObj?.enterSearch) { |
|
|
|
await FormBlur( |
|
|
|
field, |
|
|
|
e, |
|
|
|
routeName.value, |
|
|
|
formRef.value, |
|
|
|
props.detailData, |
|
|
|
formSchemaObj, |
|
|
|
(list) => { |
|
|
|
emit('searchTableSuccess', field, formSchemaObj.searchField, list, formRef.value, 'form') |
|
|
|
} |
|
|
|
) |
|
|
|
// isOnBlur是false的时候证明先走了回车事件,可以不走失去焦点方法,true的时候直接走失去焦点事件 |
|
|
|
if (isOnBlur.value) {//同时走失去焦点方法bug |
|
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps |
|
|
|
if (formSchemaObj?.enterSearch) { |
|
|
|
await FormBlur( |
|
|
|
field, |
|
|
|
e, |
|
|
|
routeName.value, |
|
|
|
formRef.value, |
|
|
|
props.detailData, |
|
|
|
formSchemaObj, |
|
|
|
(list) => { |
|
|
|
emit('searchTableSuccess', field, formSchemaObj.searchField, list, formRef.value, 'form') |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
if (props.isShowFooterButtton && !props.footButttondata) { |
|
|
|
Butttondata = [ |
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
] |
|
|
|
count.value++ |
|
|
|
if (props.isShowFooterButtton && !props.footButttondata) { |
|
|
|
Butttondata = [ |
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
] |
|
|
|
count.value++ |
|
|
|
} |
|
|
|
sureDisabled.value= false |
|
|
|
} else { |
|
|
|
emit('onBlur', field, e) |
|
|
|
} |
|
|
|
sureDisabled.value= false |
|
|
|
} 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,7 +1151,10 @@ const onEnter = async (field, value, e) => { |
|
|
|
props.detailData, |
|
|
|
formSchemaObj, |
|
|
|
(list) => { |
|
|
|
emit('onEnter', field, value, e) |
|
|
|
isOnBlur.value = true |
|
|
|
if (list.length != 0) { |
|
|
|
emit('onEnter', field, value, e) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} else { |
|
|
|