From d35533b1b42df7e1808a19a8ea72613e605cd6ef Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期四, 09 十一月 2023 16:49:35 +0800 Subject: [PATCH] 添加、编辑上传图片接口联调及编辑和查看和列表图片回显 --- src/views/productManage/product/index.vue | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue index c5855a4..cf639f7 100644 --- a/src/views/productManage/product/index.vue +++ b/src/views/productManage/product/index.vue @@ -33,8 +33,12 @@ <div v-if="isIconIndex === '1'" class="product-view"> <div class="product-box" v-for="item in tableList.tableInfomation" :key="item.id" @click="showDetail(item)"> <div class="left"> - <!-- <el-image style="width: 60px; height: 80px" :src="url"></el-image> --> - <div class="img-view"> + <el-image + v-if="item.attachmentList?.length > 0" + style="width: 60px; height: 80px" + :src="item.attachmentList[0].FileUrl" + ></el-image> + <div v-else class="img-view"> <i class="el-icon-picture-outline"></i> </div> </div> @@ -269,14 +273,16 @@ console.log(row) this.editConfig.autoEdit = false this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row } + let imageSrc = row.attachmentList?.length > 0 ? row.attachmentList[0].FileUrl : "" + this.editConfig.infomation = { ...row, imageSrc: imageSrc } this.editConfig.visible = true }, // 缂栬緫 editRow(row) { this.editConfig.autoEdit = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row } + let imageSrc = row.attachmentList?.length > 0 ? row.attachmentList[0].FileUrl : "" + this.editConfig.infomation = { ...row, imageSrc: imageSrc } this.editConfig.visible = true }, // 鍒囨崲鍒楄〃灞曠幇褰㈠紡 -- Gitblit v1.8.0