|
|
@@ -122,7 +122,7 @@
|
|
|
import { useRoute, onBeforeRouteLeave } from 'vue-router';
|
|
|
import { ElForm, ElMessage } from 'element-plus';
|
|
|
import { Delete, Plus } from '@element-plus/icons-vue';
|
|
|
- import UploadImages from '@/views/disaster/disaster-control/src/components/UploadImages.vue';
|
|
|
+ import UploadImages from '@/components/UploadImages/UploadImages.vue';
|
|
|
import { useUserInfoHook } from '@/views/disaster/hooks';
|
|
|
import { ImageItem } from '@/types/disaster-control';
|
|
|
import { UPLOAD_BIZ_TYPE, uploadFileApi } from '@/api/minio';
|
|
|
@@ -267,8 +267,14 @@
|
|
|
// 格式化事故图片
|
|
|
const formatImageList = async (file: File) => {
|
|
|
if (!file) return file;
|
|
|
- const fileName = file.name;
|
|
|
- const res = await uploadFileApi({ bizType: UPLOAD_BIZ_TYPE.ATTACHMENT, fileName, file });
|
|
|
+ const uuid = Math.random().toString(36).substring(2, 9);
|
|
|
+ const timestamp = Date.now().toString();
|
|
|
+ const random = Math.random().toString(36).substring(2, 4);
|
|
|
+ const res = await uploadFileApi({
|
|
|
+ bizType: UPLOAD_BIZ_TYPE.ATTACHMENT,
|
|
|
+ fileName: `${uuid}-${timestamp}-${random}`,
|
|
|
+ file,
|
|
|
+ });
|
|
|
return '"' + res.url + '"';
|
|
|
};
|
|
|
|