From b79c78fedb367570ca2f17a87fbc244a8dadb793 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 27 三月 2024 17:29:04 +0800
Subject: [PATCH] 替换保存在数据库的模型中的图片的url前缀和token值,页面回显模型时,再替换回去。(因为url前缀和token是随环境变换的值,不能存在数据库中)
---
web/src/views/modules/basicInfo/SelectPicture.vue | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/web/src/views/modules/basicInfo/SelectPicture.vue b/web/src/views/modules/basicInfo/SelectPicture.vue
index c608b6b..2b66296 100644
--- a/web/src/views/modules/basicInfo/SelectPicture.vue
+++ b/web/src/views/modules/basicInfo/SelectPicture.vue
@@ -2,7 +2,8 @@
<zt-dialog ref="dialog" column="2" title="閫夋嫨鍥剧墖" append-to-body :editAble="false" :hasConfirm="false">
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sysPictureBase-sysPictureBase}">
- <zt-table-wraper query-url="/sysPictureBase/SysPictureBase/page"
+ <zt-table-wraper query-url="/sysPictureBase/page"
+ :paging='false'
v-slot="{ table }">
<el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
border
@@ -11,7 +12,7 @@
<el-table-column prop="name" label="鍥剧墖鍚嶇О"/>
<el-table-column label="鍥剧墖" align="center">
<template v-slot="{ row }">
- <el-image v-if="row.accessoryMap" :src="getPath(row)" style="height: 50px;width: 50px"></el-image>
+ <el-image v-if="row.id" :src="url+row.id" style="height: 50px;width: 50px"></el-image>
</template>
</el-table-column>
</el-table>
@@ -22,13 +23,16 @@
</template>
<script>
+ import Cookies from 'js-cookie'
export default {
data() {
return {
+ url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`,
name: 'SelectPicture',
type: '',
dataForm: {
+ id:'',
contentType: '',
systemMark: '',
sortNo: ''
@@ -40,17 +44,10 @@
init(type) {
this.type = type
},
- getPath(row) {
- if (row.accessoryMap) {
- for (let key in row.accessoryMap) {
- return key
- }
- }
- },
async selectedPicture(row) {
await this.$tip.success()
this.$refs.dialog.close()
- this.$emit('setPicture', row, this.type)
+ this.$emit('setPicture', row)
}
}
}
--
Gitblit v1.9.1