From 963828e3b5070928470cb8e79ae8c051a53d926d Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 20 十一月 2024 10:05:19 +0800
Subject: [PATCH] VITE_STATIC_DIR

---
 src/views/model/mpk/file/MpkForm.vue |    4 +++-
 src/views/model/mpk/icon/index.vue   |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/views/model/mpk/file/MpkForm.vue b/src/views/model/mpk/file/MpkForm.vue
index 6466eaf..102765c 100644
--- a/src/views/model/mpk/file/MpkForm.vue
+++ b/src/views/model/mpk/file/MpkForm.vue
@@ -116,7 +116,7 @@
                       float: right;
                       color: var(--el-text-color-secondary);
                       font-size: 13px;">
-                    <img :src="'/SimtreeUnitImage/' + item.iconName" style="height: 24px;" :alt=" item.iconDesc" />
+                    <img :src="staticDir + 'SimtreeUnitImage/' + item.iconName" style="height: 24px;" :alt=" item.iconDesc" />
                   </span>
                 </el-option>
               </el-select>
@@ -268,6 +268,8 @@
   const route = useRoute() // 路由
   const router = useRouter();
 
+  const staticDir = ref(import.meta.env.VITE_STATIC_DIR)
+
   const treeData = ref([])
   const iconList = ref([] as MpkIconApi.MpkIconVO)
   const pkgNameList = ref([] as MpkPackApi.MpkPackVO)
diff --git a/src/views/model/mpk/icon/index.vue b/src/views/model/mpk/icon/index.vue
index 8d0f95f..2f97330 100644
--- a/src/views/model/mpk/icon/index.vue
+++ b/src/views/model/mpk/icon/index.vue
@@ -50,7 +50,7 @@
       <el-table-column prop="iconDesc" label="描述"/>
       <el-table-column align="center" label="图标" prop="icon" width="100">
         <template #default="scope">
-          <img :src="'/SimtreeUnitImage/' + scope.row.iconName" class="mpk-icon-list" :alt=" scope.row.iconDesc" />
+          <img :src="staticDir + 'SimtreeUnitImage/' + scope.row.iconName" class="mpk-icon-list" :alt=" scope.row.iconDesc" />
         </template>
       </el-table-column>
       <el-table-column prop="sort" label="排序"/>
@@ -91,6 +91,8 @@
 
 defineOptions({name: 'MpkIcon'})
 
+const staticDir = ref(import.meta.env.VITE_STATIC_DIR)
+
 const message = useMessage() // 消息弹窗
 const {t} = useI18n() // 国际化
 

--
Gitblit v1.9.3