调整业务模块
This commit is contained in:
@@ -1403,6 +1403,14 @@ export default {
|
||||
attachmentFileName(file) {
|
||||
return String(file?.originalName || file?.name || file?.fileName || '').trim();
|
||||
},
|
||||
normalizedAttachmentFileName(file) {
|
||||
let fileName = this.attachmentFileName(file) || this.attachmentFileUrl(file);
|
||||
fileName = String(fileName || '').split(/[?#]/)[0];
|
||||
try {
|
||||
fileName = decodeURIComponent(fileName);
|
||||
} catch {}
|
||||
return fileName.toLocaleLowerCase();
|
||||
},
|
||||
attachmentFileUrl(file) {
|
||||
return (
|
||||
file?.url ||
|
||||
@@ -1469,7 +1477,7 @@ export default {
|
||||
this.$message.error('附件预览失败');
|
||||
},
|
||||
attachmentMatchesMaterial(file, material) {
|
||||
const fileName = this.attachmentFileName(file).toLocaleLowerCase();
|
||||
const fileName = this.normalizedAttachmentFileName(file);
|
||||
return (
|
||||
Boolean(this.attachmentFileUrl(file)) &&
|
||||
(file.attachmentType === MATERIAL_TYPE_MAP[material.key] ||
|
||||
@@ -1477,11 +1485,7 @@ export default {
|
||||
);
|
||||
},
|
||||
resolveAttachmentTypeByFileName(file) {
|
||||
let fileName = this.attachmentFileName(file) || this.attachmentFileUrl(file);
|
||||
fileName = String(fileName || '').split(/[?#]/)[0].toLocaleLowerCase();
|
||||
try {
|
||||
fileName = decodeURIComponent(fileName);
|
||||
} catch {}
|
||||
const fileName = this.normalizedAttachmentFileName(file);
|
||||
const material = [...Object.values(ATTACHMENT_MATERIALS)]
|
||||
.sort(
|
||||
(a, b) =>
|
||||
|
||||
Reference in New Issue
Block a user