版本更新
This commit is contained in:
parent
5eee3346cd
commit
af83fdc491
@ -33,6 +33,10 @@ export const FILE_FOLDER_TYPE_ENUM = {
|
|||||||
value: 6,
|
value: 6,
|
||||||
desc: '党建新闻',
|
desc: '党建新闻',
|
||||||
},
|
},
|
||||||
|
VILLAGE_EMAIL: {
|
||||||
|
value: 7,
|
||||||
|
desc: '内部邮件',
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
<Upload
|
<Upload
|
||||||
:defaultFileList="defaultFileList"
|
:defaultFileList="defaultFileList"
|
||||||
:maxUploadSize="10"
|
:maxUploadSize="10"
|
||||||
:folder="FILE_FOLDER_TYPE_ENUM.HELP_DOC.value"
|
:folder="FILE_FOLDER_TYPE_ENUM.VILLAGE_EMAIL.value"
|
||||||
buttonText="上传附件"
|
buttonText="上传附件"
|
||||||
listType="text"
|
listType="text"
|
||||||
extraMsg="最多上传10个附件"
|
extraMsg="最多上传10个附件"
|
||||||
@ -77,15 +77,15 @@
|
|||||||
defaultFileList.value = [];
|
defaultFileList.value = [];
|
||||||
visibleRangeList.value = [];
|
visibleRangeList.value = [];
|
||||||
if (data) {
|
if (data) {
|
||||||
const attachment = data.attachment;
|
const fileUrl = data.fileUrl;
|
||||||
let ids = data.recipient.split(',');
|
let ids = data.recipient.split(',');
|
||||||
let names = data.recipientName.split(',');
|
let names = data.recipientName.split(',');
|
||||||
visibleRangeList.value = ids.map((id, index) => ({
|
visibleRangeList.value = ids.map((id, index) => ({
|
||||||
dataId: id,
|
dataId: id,
|
||||||
dataName: names[index],
|
dataName: names[index],
|
||||||
}));
|
}));
|
||||||
if (!_.isEmpty(attachment)) {
|
if (!_.isEmpty(fileUrl)) {
|
||||||
defaultFileList.value = attachment;
|
defaultFileList.value = fileUrl;
|
||||||
} else {
|
} else {
|
||||||
defaultFileList.value = [];
|
defaultFileList.value = [];
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@
|
|||||||
title: undefined, // 标题
|
title: undefined, // 标题
|
||||||
content: undefined, // 内容
|
content: undefined, // 内容
|
||||||
contentText: undefined, // 内容文本
|
contentText: undefined, // 内容文本
|
||||||
attachment: [], // 附件
|
fileUrl: [], // 附件
|
||||||
};
|
};
|
||||||
|
|
||||||
const formData = reactive({ ...defaultFormData });
|
const formData = reactive({ ...defaultFormData });
|
||||||
@ -125,31 +125,6 @@
|
|||||||
recipient: [{ required: true, message: '请选择收件人' }],
|
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() {
|
async function onSubmit() {
|
||||||
try {
|
try {
|
||||||
@ -157,6 +132,8 @@
|
|||||||
formData.contentText = contentRef.value.getText();
|
formData.contentText = contentRef.value.getText();
|
||||||
formData.recipient = visibleRangeList.value.map((item) => item.dataId).join(',') || '';
|
formData.recipient = visibleRangeList.value.map((item) => item.dataId).join(',') || '';
|
||||||
formData.recipientName = visibleRangeList.value.map((item) => item.dataName).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 formRef.value.validateFields();
|
||||||
await save();
|
await save();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -210,7 +187,7 @@
|
|||||||
const defaultFileList = ref([]);
|
const defaultFileList = ref([]);
|
||||||
function changeAttachment(fileList) {
|
function changeAttachment(fileList) {
|
||||||
defaultFileList.value = fileList;
|
defaultFileList.value = fileList;
|
||||||
formData.attachment = _.isEmpty(fileList) ? [] : fileList;
|
formData.fileUrl = _.isEmpty(fileList) ? [] : fileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------- 以下是暴露的方法内容 ------------------------
|
// ----------------------- 以下是暴露的方法内容 ------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user