From 855deb4dfb6458a1eed217363625b13d58143f58 Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期三, 30 四月 2025 15:33:32 +0800
Subject: [PATCH] fix:修改图片地址,路由懒加载

---
 src/views/facility/monitorList/index.vue |   10 ++++++++--
 src/views/screen/flow/home/index.vue     |    5 ++++-
 src/router/index.js                      |   13 ++++---------
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/router/index.js b/src/router/index.js
index 7beeee5..88ad225 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -7,11 +7,6 @@
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
 import { createWebHashHistory, createRouter } from 'vue-router'
-/* Layout */
-import Layout from '@/layout'
-import Screen from '@/screen'
-import Flow from '@/screen/flow.vue'
-import Temp from '@/screen/temp.vue'
 
 /**
  * Note: 路由配置项
@@ -56,13 +51,13 @@
   },
   {
     path: '/screen',
-    component: Screen,
+    component: () => import('@/screen/index.vue'),
     hidden: true
   },
   {
     path: '',  //单独添加得后台路由,需要一层layout
     hidden: true,
-    component: Layout,
+    component: () => import('@/layout/index.vue'),
     children: [
       {
         path: '/userCenter',
@@ -78,7 +73,7 @@
 const FlowScreenRouter = [
   {
     path: '/flow',
-    component: Flow,
+    component: () => import('@/screen/flow.vue'),
     redirect: '/flow/home',
     children: [
       {
@@ -113,7 +108,7 @@
 const TempScreenRouter = [
   {
     path: '/temp',
-    component: Temp,
+    component: () => import('@/screen/temp.vue'),
     redirect: '/temp/home',
     children: [
       {
diff --git a/src/views/facility/monitorList/index.vue b/src/views/facility/monitorList/index.vue
index 5363288..45c5957 100644
--- a/src/views/facility/monitorList/index.vue
+++ b/src/views/facility/monitorList/index.vue
@@ -238,7 +238,7 @@
             </el-col>
         </el-row>
         <!--表格及分页-->
-        <el-table v-loading="loading" :data="tableData">
+        <el-table v-loading="loading" :data="tableData" class="table">
             <el-table-column
                 v-for="(item, key, index) of tableHeader"
                 :prop="key.toString()"
@@ -248,7 +248,7 @@
             >
                 <template #default="scope">
                     <div v-if="key === 'imageUrl'">
-                        <img :src="imgBaseUrl + scope.row.headImg" class="table-headImg" alt="" />
+                        <img :src="imgBaseUrl + scope.row.imageUrl" class="table-headImg" alt="" />
                     </div>
                     <div v-else-if="key === 'pointType'">
                         {{ scope.row.pointType === 1 ? '水温监测点' : '生态流量监测点' }}
@@ -327,4 +327,10 @@
         flex-grow: 1;
     }
 }
+.table{
+    .table-headImg{
+        height: 50px;
+        margin: 0 auto;
+    }
+}
 </style>
\ No newline at end of file
diff --git a/src/views/screen/flow/home/index.vue b/src/views/screen/flow/home/index.vue
index 79da287..5b38f63 100644
--- a/src/views/screen/flow/home/index.vue
+++ b/src/views/screen/flow/home/index.vue
@@ -6,7 +6,7 @@
                 <div class="point-address" @click="handleShow(index)"></div>
                 <div class="point-message" v-show="item.showMsg">
                     <div class="msg-box">
-                        <div class="video-box" :style="{backgroundImage: `url(${item.imageRul})`}" @click="jumpMonitor(item.id)">
+                        <div class="video-box" :style="{backgroundImage: `url(${imgBaseUrl + item.imageRul})`}" @click="jumpMonitor(item.id)">
                             <el-icon><VideoPlay /></el-icon>
                         </div>
                         <div class="info-box">
@@ -46,6 +46,7 @@
 import {getHomePonit} from '@/api/screen/home/index.js'
 import {useRouter} from "vue-router";
 const router = useRouter();
+const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL;
 
 // 标点配置
 const config = [
@@ -143,6 +144,8 @@
                     line-height: 138px;
                     text-align: center;
                     font-size: 38px;
+                    background-repeat: no-repeat;
+                    background-size: cover;
                 }
                 .info-box{
                     height: 100%;

--
Gitblit v1.9.3