版本更新

This commit is contained in:
jiayu 2025-08-16 16:24:54 +08:00
parent 5eee3346cd
commit af83fdc491
2 changed files with 12 additions and 31 deletions

View File

@ -33,6 +33,10 @@ export const FILE_FOLDER_TYPE_ENUM = {
value: 6,
desc: '党建新闻',
},
VILLAGE_EMAIL: {
value: 7,
desc: '内部邮件',
},
};
export default {

View File

@ -33,7 +33,7 @@
<Upload
:defaultFileList="defaultFileList"
:maxUploadSize="10"
:folder="FILE_FOLDER_TYPE_ENUM.HELP_DOC.value"
:folder="FILE_FOLDER_TYPE_ENUM.VILLAGE_EMAIL.value"
buttonText="上传附件"
listType="text"
extraMsg="最多上传10个附件"
@ -77,15 +77,15 @@
defaultFileList.value = [];
visibleRangeList.value = [];
if (data) {
const attachment = data.attachment;
const fileUrl = data.fileUrl;
let ids = data.recipient.split(',');
let names = data.recipientName.split(',');
visibleRangeList.value = ids.map((id, index) => ({
dataId: id,
dataName: names[index],
}));
if (!_.isEmpty(attachment)) {
defaultFileList.value = attachment;
if (!_.isEmpty(fileUrl)) {
defaultFileList.value = fileUrl;
} else {
defaultFileList.value = [];
}
@ -115,7 +115,7 @@
title: undefined, //
content: undefined, //
contentText: undefined, //
attachment: [], //
fileUrl: [], //
};
const formData = reactive({ ...defaultFormData });
@ -125,31 +125,6 @@
recipient: [{ required: true, message: '请选择收件人' }],
};
//
async function getDetail(id) {
try {
SmartLoading.show();
const result = await villageMailApi.detail(id);
const attachment = result.data.attachment;
let ids = result.data.recipient.split(',');
let names = result.data.recipientName.split(',');
visibleRangeList.value = ids.map((id, index) => ({
dataId: id,
dataName: names[index],
}));
if (!_.isEmpty(attachment)) {
defaultFileList.value = attachment;
} else {
defaultFileList.value = [];
}
Object.assign(formData, result.data);
} catch (err) {
smartSentry.captureError(err);
} finally {
SmartLoading.hide();
}
}
//
async function onSubmit() {
try {
@ -157,6 +132,8 @@
formData.contentText = contentRef.value.getText();
formData.recipient = visibleRangeList.value.map((item) => item.dataId).join(',') || '';
formData.recipientName = visibleRangeList.value.map((item) => item.dataName).join(',') || '';
formData.fileUrl = _.isEmpty(defaultFileList.value) ? [] : defaultFileList.value.map(item => item.fileKey).join(',');
await formRef.value.validateFields();
await save();
} catch (err) {
@ -210,7 +187,7 @@
const defaultFileList = ref([]);
function changeAttachment(fileList) {
defaultFileList.value = fileList;
formData.attachment = _.isEmpty(fileList) ? [] : fileList;
formData.fileUrl = _.isEmpty(fileList) ? [] : fileList;
}
// ----------------------- ------------------------