Преглед изворни кода

Merge branch 'master' of http://192.168.2.21:11666/chenlong/xx_sw_dp

chc пре 1 година
родитељ
комит
5cd37ddf51

+ 5 - 0
.env.development

@@ -85,3 +85,8 @@ VITE_GLOB_LIGONG_ADMIN = http://182.139.38.101:20010/wlw/monitor/chart
 
 #设置图片地址
 VITE_GLOB_BASE_IMG = http://192.168.2.111:8001
+
+#自动更新数据时间update
+VITE_GLOB_UPDATE_TIME = 5000
+#自动更新数据时间map
+VITE_GLOB_UPDATE_TIME_MP = 1200000

+ 3 - 1
.env.production

@@ -76,4 +76,6 @@ VITE_GLOB_ADMIN_LOGIN = http://localhost:8084/#/login
 VITE_GLOB_LIGONG_ADMIN = http://182.139.38.101:20010/wlw/monitor/chart
 
 #设置图片地址
-VITE_GLOB_BASE_IMG = http://183.222.190.95:8002
+VITE_GLOB_BASE_IMG = http://183.222.190.95:8002
+#自动更新数据时间update
+VITE_GLOB_UPDATE_TIME = 10000

+ 3 - 1
.env.test

@@ -49,4 +49,6 @@ VITE_GLOB_BASE_ADMIN = http://localhost:8083
 VITE_GLOB_LIGONG_ADMIN = http://182.139.38.101:20010/wlw/monitor/chart
 
 #设置图片地址
-VITE_GLOB_BASE_IMG = http://183.222.190.95:8001
+VITE_GLOB_BASE_IMG = http://183.222.190.95:8001
+#自动更新数据时间update
+VITE_GLOB_UPDATE_TIME = 5000

+ 4 - 0
src/hooks/setting/index.ts

@@ -28,6 +28,8 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     VITE_GLOB_ADMIN_LOGIN,
     VITE_GLOB_BASE_IMG,
     VITE_GLOB_IS_IDC,
+    VITE_GLOB_UPDATE_TIME,
+    VITE_GLOB_UPDATE_TIME_MP,
   } = getAppEnvConfig();
 
   if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) {
@@ -54,6 +56,8 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME,
     baseImgUrl: VITE_GLOB_BASE_IMG,
     isIdc: VITE_GLOB_IS_IDC,
+    updateTime: VITE_GLOB_UPDATE_TIME,
+    updateTimeMp: VITE_GLOB_UPDATE_TIME_MP,
   };
   return glob as Readonly<GlobConfig>;
 };

+ 6 - 2
src/utils/env.ts

@@ -44,7 +44,9 @@ export function getAppEnvConfig() {
     VITE_GLOB_LIGONG_API,
     VITE_GLOB_DEBUGGER_API,
     VITE_GLOB_BASE_IMG,
-    VITE_GLOB_IS_IDC
+    VITE_GLOB_IS_IDC,
+    VITE_GLOB_UPDATE_TIME,
+    VITE_GLOB_UPDATE_TIME_MP
   } = ENV;
 
   if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
@@ -69,7 +71,9 @@ export function getAppEnvConfig() {
     VITE_GLOB_LIGONG_API,
     VITE_GLOB_DEBUGGER_API,
     VITE_GLOB_BASE_IMG,
-    VITE_GLOB_IS_IDC
+    VITE_GLOB_IS_IDC,
+    VITE_GLOB_UPDATE_TIME,
+    VITE_GLOB_UPDATE_TIME_MP
   };
 }
 

+ 4 - 1
src/views/header/Popup.vue

@@ -50,6 +50,8 @@ import { ref, reactive } from 'vue';
 import { defHttpFun } from '/@/utils/http/axios';
 import { message } from 'ant-design-vue';
 import { RightCircleOutlined, PlusCircleOutlined, CloseOutlined, CaretRightOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import { getAppEnvConfig } from '/@/utils/env';
+
 export default {
   name: 'Popup', //漫游
   components: {
@@ -63,6 +65,7 @@ export default {
     let dataList = reactive([]); //临时保存所有的数据
     const formState = reactive({ viewName: '' });
     let viewNameDom = ref(null);
+    const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
     let viewer = null;
     let showPop = ref(false);
     let currentIndex = ref(-1);
@@ -216,7 +219,7 @@ export default {
                   tempData.splice(0, 1);
                   currentIndex.value = currentIndex.value + 1;
                   fly(JSON.parse(tempData[0].flightParameter));
-                }, 5000); // 暂停五秒钟后播放下一个tempData
+                }, VITE_GLOB_UPDATE_TIME); // 暂停五秒钟后播放下一个tempData
               }
             }
           },

+ 3 - 2
src/views/header/Weather.vue

@@ -196,8 +196,9 @@ export default defineComponent({
 
       // 清除缓存
       const timestamp = new Date().getTime();
-      const url = window.location.href.replace(/(\?|&)t=\d+/, '');
-      window.location.href = `${url}${url.includes('?') ? '&' : '?'}t=${timestamp}`;
+      window.location.reload();
+      // const url = window.location.href.replace(/(\?|&)t=\d+/, '');
+      // window.location.href = `${url}${url.includes('?') ? '&' : '?'}t=${timestamp}`;
 
       // 刷新页面
       window.location.reload();

+ 3 - 2
src/views/hydrology/components/regimen.vue

@@ -96,7 +96,8 @@ import { getNowTime } from '/@/utils/fnUtils.ts';
 import { useMapStore } from '/@/store/modules/map';
 // 滚动插件
 import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
-
+import { getAppEnvConfig } from '/@/utils/env';
+const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
 const mapStore2 = useMapStore();
 const openModal = (item) => {
   mapStore2.setstInfo({ stcd: item });
@@ -517,7 +518,7 @@ function circulateData() {
     } else {
       circulateNum += 1;
     }
-  }, 5000);
+  }, VITE_GLOB_UPDATE_TIME);
 }
 // 这里是获取数据
 async function setActiveEcharts(item) {

+ 4 - 2
src/views/map/Map.vue

@@ -66,7 +66,8 @@ import { rainMap, rainMapfq, wdMap, gcSite, getStDetailInfo, changeHeight,getImp
 import fenquData from './fenqu.json';
 import { useMessage } from '/@/hooks/web/useMessage';
 import  './range.js'
-
+import { getAppEnvConfig } from '/@/utils/env';
+const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
 let dzdxInfoList = null;
 let gcInfoList = null;
 let monitorSensorsList = null;
@@ -619,6 +620,7 @@ export default defineComponent({
 
       this.getGCSite();
       // 二十分钟更新一次测站点信息
+      
       setInterval(()=>{ 
         // 移除重新加载
         map.removeOverlay('shuiwenzhan*');
@@ -628,7 +630,7 @@ export default defineComponent({
           map.removeOverlay('biaozhunqixiangzhan*');
           map.removeOverlay('tanshuitongliangzhan*');
           this.getStDetailInfoAxios();
-      },20*60*1000)
+      },VITE_GLOB_UPDATE_TIME)
       // rainMap({"start_time":"2023-07-05 10:00:00","end_time":"2023-07-05 01:00:00"})
       // //地灾点
       // this.getDzdxInfo(geologicalStore);

+ 2 - 0
src/views/map/wander.vue

@@ -48,6 +48,7 @@ import { ref, reactive } from 'vue';
 import { defHttpFun } from '/@/utils/http/axios';
 import { message } from 'ant-design-vue';
 import { RightCircleOutlined, PlusCircleOutlined, CloseOutlined, CaretRightOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import { getAppEnvConfig } from '/@/utils/env';
 export default {
   name: 'wander', //漫游
   components: {
@@ -58,6 +59,7 @@ export default {
     PlusOutlined,
   },
   setup(props, ctx) {
+    const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
     let dataList = reactive([]); //临时保存所有的数据
     const formState = reactive({ viewName: '' });
     let viewNameDom = ref(null);

+ 3 - 1
src/views/meteorological/components/monitor.vue

@@ -63,6 +63,8 @@ import { getWeathMonitoring, getMonitorInfo } from '/@/api/swHome/index';
 import { useBasicStore } from '/@/store/modules/basicData';
 import { obtainingStations, getNowTime, getSensor } from '/@/utils/fnUtils.ts';
 // 滚动插件
+import { getAppEnvConfig } from '/@/utils/env';
+const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
 import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
 import eventBus from '/@/utils/eventBus';
 eventBus.on('monitorRefreshName', () => {
@@ -120,7 +122,7 @@ function circulateData() {
     } else {
       circulateNum += 1;
     }
-  }, 5000);
+  }, VITE_GLOB_UPDATE_TIME);
 }
 // 处理风向
 function setWd(wds) {

+ 3 - 2
src/views/weatherHome/components/qxWater.vue

@@ -46,7 +46,8 @@ import { useBasicStore } from '/@/store/modules/basicData';
 const basicStore = useBasicStore();
 import eventBus from '/@/utils/eventBus';
 import { useMapStore } from '/@/store/modules/map';
-
+import { getAppEnvConfig } from '/@/utils/env';
+const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
 const mapStore = useMapStore();
 const openModal = (item) => {
   mapStore.setstInfo({ stcd: item });
@@ -371,7 +372,7 @@ function circulateData() {
     } else {
       circulateNum += 1;
     }
-  }, 5000);
+  }, VITE_GLOB_UPDATE_TIME);
 }
 // // 数据获取
 let chartData = reactive({

+ 3 - 1
src/views/weatherHome/components/stationStatistics.vue

@@ -94,6 +94,8 @@ import { getStStats, getRealDataNum } from '/@/api/swHome/index';
 import { fontSize } from '../../../utils/util';
 import eventBus from '/@/utils/eventBus';
 import { useMapStore } from '/@/store/modules/map';
+import { getAppEnvConfig } from '/@/utils/env';
+const { VITE_GLOB_UPDATE_TIME } = getAppEnvConfig();
 
 const mapStore = useBasicStore();
 const mapStore2 = useMapStore()
@@ -133,7 +135,7 @@ eventBus.on('statisRefreshName', () => {
       realDataNum.month_num = res.data[1];
       realDataNum.rt_num = res.data[0];
     });
-  }, 1200000)
+  }, VITE_GLOB_UPDATE_TIME)
 
 });
 // 列表数据获取结束

+ 2 - 0
types/config.d.ts

@@ -198,4 +198,6 @@ export interface GlobEnvConfig {
   //图片地址
   VITE_GLOB_BASE_IMG: string;
   VITE_GLOB_IS_IDC:string;
+  VITE_GLOB_UPDATE_TIME:number;
+  VITE_GLOB_UPDATE_TIME_MP:number;
 }