From 55373c6b400d879ba4a4cdae752fe5140c7b11f6 Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期一, 28 四月 2025 17:29:15 +0800
Subject: [PATCH] fix:修改上传图片地址

---
 src/views/facility/facilityType/index.vue |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/views/facility/facilityType/index.vue b/src/views/facility/facilityType/index.vue
index c48047f..c758f1a 100644
--- a/src/views/facility/facilityType/index.vue
+++ b/src/views/facility/facilityType/index.vue
@@ -12,14 +12,14 @@
 
 const route = useRoute();
 const {proxy} = getCurrentInstance();
-
+const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
 
 /**
  * 搜索相关
  */
 /** 搜索按钮操作 */
 function handleQuery() {
-    getList({keywords: searchParams.value.name})
+    getList(searchParams.value)
 }
 
 /** 重置按钮操作 */
@@ -42,7 +42,6 @@
 let tableHeader = ref({
     name: '类型名称',
     code: '类型编号',
-    facilityType: '设备类型',
     createTimeView: '创建时间'
 })
 
@@ -120,7 +119,7 @@
 
 //上传文件,添加图片地址信息
 const uploadData = (data) => {
-    form.value.headImg = data.newFileView
+    form.value.headImg = imgBaseUrl + data.newFileView
 }
 
 /** 提交按钮 */
@@ -172,9 +171,9 @@
 <template>
     <div class="app-container">
         <el-form :model="searchParams" ref="queryRef" :inline="true">
-            <el-form-item label="" prop="">
+            <el-form-item label="" prop="keywords">
                 <el-input
-                    v-model="searchParams.name"
+                    v-model="searchParams.keywords"
                     placeholder="请输入搜索信息"
                     clearable
                     style="width: 200px"
@@ -209,11 +208,11 @@
             >
                 <template #default="scope">
                     <div v-if="key.toString() == 'headImg'">
-                        <img :src="scope.row.headImg" class="table-headImg"/>
+                        <img :src="imgBaseUrl + scope.row.headImg" class="table-headImg" alt="" />
                     </div>
                 </template>
             </el-table-column>
-            <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                 <template #default="scope">
                     <el-button link type="primary" icon="Edit" v-has="['update',route]"
                                @click="handleUpdate(scope.row)">修改

--
Gitblit v1.9.3