From 6f4d30454c52df980eef0607611ec66a57ec0e5c Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 15 十二月 2023 20:59:51 +0800
Subject: [PATCH] 案件池优化
---
src/components/filePictrue/index.vue | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/components/filePictrue/index.vue b/src/components/filePictrue/index.vue
index 5875503..d2c5c55 100644
--- a/src/components/filePictrue/index.vue
+++ b/src/components/filePictrue/index.vue
@@ -31,7 +31,7 @@
</div>
</template>
<script>
-import { parseTime } from "@/utils/index";
+import { parseTime, FILE_ORIGINAL_URL } from "@/utils/index";
export default {
data() {
return {
@@ -43,10 +43,21 @@
const {
filesPictureVo: { imageResources: imgList },
} = this;
-
+
let pic = this.filesPictureVo.imageResources;
pic.forEach((item) => {
- item.url = item.url.split(",");
+ if (item.url) {
+ if (typeof item.url == "string") {
+ let urls = item.url.split(",");
+ item.url = [];
+ urls.forEach((o) => {
+ o = o.replace("[", "").replace("]", "");
+ item.url.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${o}`);
+ });
+ }
+ } else {
+ item.url = [];
+ }
});
this.imgSource = pic;
// this.getEventInfo(this.mycode);
@@ -74,7 +85,18 @@
this.dialogView = true;
let pic = res.data.filesPictureVo.imageResources;
pic.forEach((item) => {
- item.url = item.url.split(",");
+ if (item.url) {
+ if (typeof item.url == "string") {
+ let urls = item.url.split(",");
+ item.url = [];
+ urls.forEach((o) => {
+ o = o.replace("[", "").replace("]", "");
+ item.url.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${o}`);
+ });
+ }
+ } else {
+ item.url = [];
+ }
});
this.imgSource = pic;
});
--
Gitblit v1.8.0