ソースを参照

Merge remote-tracking branch 'origin/dev' into dev

Hwf 8 ヶ月 前
コミット
7600bcf7fa

+ 2 - 2
.env.development

@@ -9,7 +9,7 @@ VITE_APP_BASE_API = 'http://10.181.7.236:9988'
 VITE_APP_BASE_API2 = 'http://10.181.7.235/'
 
 # 应用访问路径 例如使用前缀 /admin/
-VITE_APP_CONTEXT_PATH = '/'
+VITE_APP_CONTEXT_PATH = '/yjdp/'
 
 # 监控地址
 VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
@@ -17,7 +17,7 @@ VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
 # SnailJob 控制台地址
 VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'
 
-VITE_APP_PORT = 80
+VITE_APP_PORT = 8086
 
 # 接口加密功能开关(如需关闭 后端也必须对应关闭)
 VITE_APP_ENCRYPT = false

+ 4 - 0
src/types/auto-imports.d.ts

@@ -78,6 +78,7 @@ declare global {
   const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
   const onUnmounted: typeof import('vue')['onUnmounted']
   const onUpdated: typeof import('vue')['onUpdated']
+  const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
   const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
   const provide: typeof import('vue')['provide']
   const provideLocal: typeof import('@vueuse/core')['provideLocal']
@@ -189,6 +190,7 @@ declare global {
   const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
   const useGamepad: typeof import('@vueuse/core')['useGamepad']
   const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
+  const useId: typeof import('vue')['useId']
   const useIdle: typeof import('@vueuse/core')['useIdle']
   const useImage: typeof import('@vueuse/core')['useImage']
   const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
@@ -205,6 +207,7 @@ declare global {
   const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
   const useMemoize: typeof import('@vueuse/core')['useMemoize']
   const useMemory: typeof import('@vueuse/core')['useMemory']
+  const useModel: typeof import('vue')['useModel']
   const useMounted: typeof import('@vueuse/core')['useMounted']
   const useMouse: typeof import('@vueuse/core')['useMouse']
   const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
@@ -252,6 +255,7 @@ declare global {
   const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
   const useSupported: typeof import('@vueuse/core')['useSupported']
   const useSwipe: typeof import('@vueuse/core')['useSwipe']
+  const useTemplateRef: typeof import('vue')['useTemplateRef']
   const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
   const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
   const useTextSelection: typeof import('@vueuse/core')['useTextSelection']

+ 2 - 2
src/views/emergencyCommandMap/RightSection/RenWuGenZong.vue

@@ -96,7 +96,7 @@ const toggleScroll = () => {
 };
 
 // 设置定时器
-const fetchInterval = 1000; // 每1秒刷新一次
+const fetchInterval = process.env.NODE_ENV === 'development' ? 60000 : 3000; // 每60秒刷新一次(刷新太频繁影响调试)
 let intervalId: number | null = null;
 
 const startFetchingData = () => {
@@ -231,7 +231,7 @@ watch(
 }
 .more {
   position: absolute;
-  bottom: 10px; /* 根据需要调整位置 */
+  bottom: 20px; /* 根据需要调整位置 */
   right: 50%; /* 根据需要调整位置 */
   transform: translateX(50%);
   color: #1890ff;

+ 6 - 3
src/views/emergencyCommandMap/RightSection/RightTop.vue

@@ -67,6 +67,9 @@ const activeTab = ref('任务跟踪');
 
 const setActiveTab = (id) => {
   activeTab.value = id;
+  if(id === '预案通知' && notifications.value.length === 0) {
+    fetchData();
+  }
 };
 
 // 定义 notifications
@@ -153,7 +156,7 @@ watch(
   width: 100%;
 
   .table-content {
-    height: 600px;
+    height: 550px;
     overflow-y: auto;
 
     .box1 {
@@ -243,7 +246,7 @@ watch(
 
         .box-content {
           color: #fff;
-          width: 80%;
+          width: 100%;
           font-size: 38px;
           line-height: 1.5;
           margin-top: 10px;
@@ -264,7 +267,7 @@ watch(
   .card-content {
     display: flex;
     flex-wrap: wrap;
-    padding: 0 80px;
+    padding: 0 0 0 80px;
     width: 100%;
   }
 }

+ 15 - 6
src/views/emergencyCommandMap/RightSection/StartPlan.vue

@@ -149,7 +149,7 @@ const onStartPlan = async () => {
     } else if (error.response && error.response.status) {
       ElMessage.error(`启动预案时发生错误,HTTP 状态码:${error.response.status}`);
     } else {
-      ElMessage.error('启动预案时发生未知错误,请稍后再试。');
+      // ElMessage.error('启动预案时发生未知错误,请稍后再试。');
     }
   }
 };
@@ -339,10 +339,12 @@ h2 {
   display: flex;
   margin-top: 30px;
   .tabs2 {
-    height: 620px;
+    height: 560px;
+    
     overflow-y: auto;
     .tab {
-      width: 399px;
+      /*width: 399px;*/
+      width: 600px;
       height: 70px;
       background: url('@/assets/images/plan/tab2.png') no-repeat;
       display: flex;
@@ -354,6 +356,9 @@ h2 {
       margin-top: 60px;
       position: relative;
       cursor: pointer;
+      .text {
+        white-space:nowrap;
+      }
       &::before {
         content: '';
         width: 2px;
@@ -370,7 +375,8 @@ h2 {
         }
       }
       &:hover {
-        width: 439px;
+        /*width: 439px;*/
+        width: 600px;
         background: url('@/assets/images/plan/tab2Active.png') no-repeat;
         .text {
           /* 设置字体透明 */
@@ -387,7 +393,8 @@ h2 {
       }
     }
     .tab-active2 {
-      width: 439px;
+      /*width: 439px;*/
+      width: 600px;
       background: url('@/assets/images/plan/tab2Active.png') no-repeat;
       .text {
         /* 设置字体透明 */
@@ -404,7 +411,9 @@ h2 {
     }
   }
   .tab-content2 {
-    height: 620px;
+    padding-left:20px;
+    height: 560px;
+    width: 90%;
     overflow-y: auto;
   }
 }

+ 4 - 3
src/views/emergencyCommandMap/RightSection/TaskDelivery.vue

@@ -69,7 +69,7 @@ const fetchDataWithLoading = async () => {
       ElMessage.error('未能从服务器获取有效任务数据');
     }
   } catch (error) {
-    ElMessage.error('获取任务数据失败');
+    // ElMessage.error('获取任务数据失败');
   } finally {
     loading.value = false;
   }
@@ -80,14 +80,15 @@ const sendTasks = () => {
     ElMessage.error('事件ID未定义,无法发送任务!');
     return;
   }
+  
   sendTask({ eventId: props.eventId })
     .then(() => {
       ElMessage.success('任务已成功发送!');
       closeDialog(); // 使用关闭方法
     })
     .catch(() => {
-      ElMessage.error('发送任务失败,请稍后再试!');
-    });
+      //ElMessage.error('发送任务失败,请稍后再试!');
+    })
 };
 </script>
 

+ 5 - 0
src/views/emergencyCommandMap/RightSection/index.vue

@@ -92,6 +92,11 @@ const getEventIdFromUrl = () => {
 const startPlan = async() => {
   const response = await getEventDetail({ event_id: eventId.value })
   const event_data = (response.data);
+  if(event_data.emergency_notify_count > 0) {
+    ElMessage.warning('预案已启动');
+    return;
+  }
+
   if (event_data.del_flag === '0') {
     // 正式事件
     startPlanState.title = '启动预案';