update: 类型改变清空字段

This commit is contained in:
JiangQiming 2023-02-22 17:55:08 +08:00
parent 5cd3065b39
commit ea98e6c788
1 changed files with 14 additions and 5 deletions

View File

@ -13,6 +13,7 @@
v-model:value="formData.type"
placeholder="请选择通知方式"
:disabled="!!formData.id"
@change="resetPublicFiles"
>
<a-select-option
v-for="(item, index) in NOTICE_METHOD"
@ -40,7 +41,7 @@
<RadioCard
:options="msgType"
v-model="formData.provider"
@change="getConfigList"
@change="handleProviderChange"
/>
</a-form-item>
<a-form-item
@ -227,7 +228,8 @@
}"
:showUploadList="false"
@change="
(e) => handleChange(e)
(e) =>
handleLinkChange(e)
"
>
<AIcon
@ -827,7 +829,7 @@ watch(
if (val !== 'email') getConfigList();
clearValid();
resetPublicFiles();
// console.log('formData.value: ', formData.value);
if (val === 'sms') {
getTemplateList();
@ -842,7 +844,6 @@ watch(
formData.value.template = TEMPLATE_FIELD_MAP[formData.value.type][val];
clearValid();
resetPublicFiles();
},
);
@ -940,10 +941,18 @@ const getConfigList = async () => {
configList.value = result;
};
/**
* 通知类型改变
*/
const handleProviderChange = () => {
getConfigList();
resetPublicFiles();
};
/**
* link消息类型 图片链接
*/
const handleChange = (info: UploadChangeParam) => {
const handleLinkChange = (info: UploadChangeParam) => {
if (info.file.status === 'done') {
formData.value.template.link.picUrl = info.file.response?.result;
}