Browse Source

投诉提交附件

dev
wangmingyong@163.com 2 weeks ago
parent
commit
1b93c94aa9
  1. 26
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue

26
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue

@ -425,7 +425,7 @@ const onAfterReadImage = (file) => {
uploadFile(f, (res) => {
// data
const data = res && res.data ? res.data : res;
const filePath = typeof data === 'string' ? data : (data && (data.url || data.fileUrl || data.path)) || '';
const filePath = data.data || '';
if (filePath) {
// url
f.url = filePath;
@ -434,16 +434,24 @@ const onAfterReadImage = (file) => {
});
});
};
// form.images fileList
//
const getFileUploadPath = (img) => {
if (!img) return '';
const url = img.uploadPath || img.url || img.content || '';
if (typeof url === 'string') return url;
if (typeof url === 'object' && url) {
return url.uploadPath || url.url || url.fileUrl || url.path ||
(typeof url.data === 'string' ? url.data : url.data?.uploadPath) || '';
}
return '';
};
// form.images fileList
// [{ uploadPath: "/profile/..." }, ...]
const buildFileList = () => {
return (form.value.images || [])
.filter(img => img && (img.url || img.content))
.map(img => {
//
return img.url || '';
})
const paths = (form.value.images || [])
.map(getFileUploadPath)
.filter(Boolean);
return paths.map(uploadPath => (uploadPath));
};
// ========== ==========

Loading…
Cancel
Save