wangfumin hace 1 semana
padre
commit
c8cab4ddb1

+ 0 - 1
src/assets/style/public.scss

@@ -1,6 +1,5 @@
 @import "../icon/fire/iconfont.css";
 @import "../icon/fuse/iconfont.css";
-
 * {
   margin : 0;
   padding: 0;

+ 40 - 2
src/router/index.ts

@@ -1,6 +1,18 @@
 import { createRouter, createWebHashHistory } from "vue-router";
 import { Routes, routes, system, Route } from "./config";
 import { RouteName } from "./routeName";
+import {
+  caseFileTypes,
+  caseFiles,
+  insertCaseFile,
+  deleteCaseFile,
+  updateCaseFile,
+  axios,
+  caseFileInfo,
+  saveCaseFileInfo,
+  getSysSetting,
+  updateSysSetting,
+} from "@/request";
 
 export * from "./config";
 export * from "./routeName";
@@ -8,13 +20,39 @@ export const router = createRouter({
   history: createWebHashHistory(),
   routes: routes as any,
 });
-
+const appId = import.meta.env.VITE_APP_APP
+const modules = import.meta.glob("@/assets/style/theme/*.scss", {
+  query: "?inline",
+});
+const $style = document.createElement("style");
+$style.setAttribute("type", "text/css");
+document.body.appendChild($style);
 router.beforeEach((to, from, next) => {
   if (!to.name || to.name === RouteName.viewLayout) {
     router.replace({ name: RouteName.scene });
     return;
   }
-  next();
+  try {
+    axios.get(getSysSetting, {
+      params: {
+        platformKey: appId
+      }
+    }).then(async(data) => {
+      // console.log('路由获取后台当前色', data.data.themeColour)
+      localStorage.setItem('f-themeColour', data.data.themeColour)
+      const key = Object.keys(modules).find((key) =>
+        key.includes(data.data.themeColour)
+      );
+      if (key) {
+        const res1: any = await modules[key]();
+        const res2: any = await import("@/assets/style/public.scss?inline");
+        $style.innerHTML = res1.default + res2.default;
+      }
+      next();
+    });
+  } catch (error) {
+    next();
+  }
 });
 
 const getConfig = (routes: Routes) => {

+ 3 - 3
src/view/case/drawMap/creatMap.vue

@@ -459,7 +459,7 @@ const getCanvasImage = async (): Promise<{url: string, fileName: string} | null>
       return null
     }
 
-    ElMessage.info('正在生成地图截图...')
+    // ElMessage.info('正在生成地图截图...')
     
     // 配置html2canvas选项
     const canvas = await html2canvas(mapElement, {
@@ -525,7 +525,7 @@ const handleConfirm = async () => {
       return
     }
 
-    ElMessage.info('正在保存方位图信息...')
+    // ElMessage.info('正在保存方位图信息...')
 
     // 调用案件制表接口
     const response = await axios({
@@ -558,7 +558,7 @@ const handleConfirm = async () => {
     handleClose()
   } catch (error) {
     console.error('保存方位图失败:', error)
-    ElMessage.error('保存方位图失败,请重试')
+    // ElMessage.error('保存方位图失败,请重试')
   }
 }
 

+ 4 - 4
src/view/mediaLibrary/index.vue

@@ -255,7 +255,7 @@ const handleDownload = async (row: Media, type: 'media' | 'hash') => {
         // 通过接口获取URL
         url = await downloadMedia(row.id);
         if (!url) {
-          ElMessage.error('获取下载链接失败');
+          //  ElMessage.error('获取下载链接失败');
           return;
         }
         // 从URL中获取文件后缀
@@ -288,7 +288,7 @@ const handleDownload = async (row: Media, type: 'media' | 'hash') => {
           window.URL.revokeObjectURL(blobUrl);
         } catch (error) {
           console.error('媒体文件下载失败:', error);
-          ElMessage.error('媒体文件下载失败');
+          // ElMessage.error('媒体文件下载失败');
         }
       // } else {
       //   // 对于其他类型文件,直接打开链接下载
@@ -329,14 +329,14 @@ const handleDownload = async (row: Media, type: 'media' | 'hash') => {
         window.URL.revokeObjectURL(blobUrl);
       } catch (error) {
         console.error('Hash文件下载失败:', error);
-        ElMessage.error('Hash文件下载失败');
+        // ElMessage.error('Hash文件下载失败');
       }
     }
     
     ElMessage.success(type === 'media' ? '下载成功' : 'Hash下载成功');
   } catch (error) {
     console.error(type === 'media' ? '下载失败:' : 'Hash下载失败:', error);
-    ElMessage.error(type === 'media' ? '下载失败' : 'Hash下载失败');
+    // ElMessage.error(type === 'media' ? '下载失败' : 'Hash下载失败');
   }
 };