邮件模板 添加 自定义文件类型

szh-new
张同海 2 months ago
parent e587717855
commit bdf49cae43

@ -79,21 +79,48 @@
if (DiyFieldIdS.value.length) { if (DiyFieldIdS.value.length) {
DiyFieldIdS.value.forEach((item) => { DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value) removeSchemaByField(item.value)
removeSchemaByField(`${item.value}-fileType`)
}) })
} }
DiyFieldIdS.value.splice(0) DiyFieldIdS.value.splice(0)
data.forEach((item) => { data.forEach((item) => {
appendSchemaByField( appendSchemaByField(
{ [
field: item.value, {
label: item.label, field: item.value,
component: 'Input', label: item.label,
colProps: { span: 6 }, component: 'Input',
componentProps: { colProps: { span: 6 },
placeholder: '自定义文件名称', componentProps: {
placeholder: '自定义文件名称',
},
}, },
}, {
field: `${item.value}-fileType`,
label: `${item.label}-文件类型`,
component: 'Select',
colProps: { span: 6 },
componentProps: {
placeholder: '自定义文件类型',
allowClear: true,
options: [
{
label: 'PDF',
value: 1,
},
{
label: 'Excel',
value: 2,
},
{
label: 'Word',
value: 3,
},
],
},
},
],
'attachments', 'attachments',
) )
DiyFieldIdS.value.push(item) DiyFieldIdS.value.push(item)
@ -140,6 +167,7 @@
isUpdate.value = !!data?.isUpdate isUpdate.value = !!data?.isUpdate
DiyFieldIdS.value.forEach((item) => { DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value) removeSchemaByField(item.value)
removeSchemaByField(`${item.value}-fileType`)
}) })
DiyFieldIdS.value.splice(0) DiyFieldIdS.value.splice(0)
if (unref(isUpdate)) { if (unref(isUpdate)) {
@ -167,6 +195,7 @@
label: element.templateName, label: element.templateName,
}) })
DiyFieldIdSObj[e.templateId] = e.fileName DiyFieldIdSObj[e.templateId] = e.fileName
DiyFieldIdSObj[`${e.templateId}-fileType`] = e.fileType
} }
}) })
}) })
@ -205,6 +234,7 @@
function handlecloseModal() { function handlecloseModal() {
DiyFieldIdS.value.forEach((item) => { DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value) removeSchemaByField(item.value)
removeSchemaByField(`${item.value}-fileType`)
}) })
closeModal() closeModal()
} }
@ -232,6 +262,7 @@
taskMailId: values.id, taskMailId: values.id,
templateId: item.id, templateId: item.id,
fileName: values[item.id] ? values[item.id] : item.templateName, fileName: values[item.id] ? values[item.id] : item.templateName,
fileType: values[`${item.id}-fileType`],
}) })
} }
}) })
@ -272,6 +303,7 @@
async function refresh() { async function refresh() {
DiyFieldIdS.value.forEach((item) => { DiyFieldIdS.value.forEach((item) => {
removeSchemaByField(item.value) removeSchemaByField(item.value)
removeSchemaByField(`${item.value}-fileType`)
}) })
DiyFieldIdS.value.splice(0) DiyFieldIdS.value.splice(0)
const res: API.DataResult = await ApiInfo({ id: unref(rowId) }) const res: API.DataResult = await ApiInfo({ id: unref(rowId) })

Loading…
Cancel
Save