|
|
@ -41,10 +41,10 @@ const open = async (type: string, id?: number) => { |
|
|
|
try { |
|
|
|
const data = await MailTemplateApi.getMailTemplate(id) |
|
|
|
formRef.value.setValues(data) |
|
|
|
showReceiver(data) |
|
|
|
} finally { |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
showReceiver(formRef.value) |
|
|
|
} |
|
|
|
} |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
@ -136,8 +136,8 @@ const resetReceiverType = () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const showReceiver = (formValue) => { |
|
|
|
if(formValue){ |
|
|
|
const showReceiver = (data) => { |
|
|
|
if(data){ |
|
|
|
// 根据当前receiverType启用相应字段 |
|
|
|
const fieldMap = { |
|
|
|
1: 'roleIdList', |
|
|
@ -145,7 +145,7 @@ const showReceiver = (formValue) => { |
|
|
|
3: 'postIdList', |
|
|
|
4: 'userIdList' |
|
|
|
}; |
|
|
|
const enableField = fieldMap[formValue.receiverType]; |
|
|
|
const enableField = fieldMap[data.receiverType]; |
|
|
|
if (enableField) { |
|
|
|
const itemToEnable = allSchemas.formSchema.find(item => item.field === enableField); |
|
|
|
if (itemToEnable) { |
|
|
|