lxh 2 months ago
parent
commit
191e7d2399
2 changed files with 17 additions and 11 deletions
  1. 7 5
      src/hooks/setting/index.ts
  2. 10 6
      src/views/vent/monitorManager/alarmMonitor/index.vue

+ 7 - 5
src/hooks/setting/index.ts

@@ -23,6 +23,7 @@ const getUrl = () => {
         .then((response) => response.json())
         .then((data) => {
           if (data.result) {
+            console.log(data.result,'88888888')
             if (data.result['systemTitle']) title = data.result['systemTitle'];
             if (data.result['logoIcon']) logoUrl = data.result['logoIcon'];
             if (data.result['sysOrgCode']) sysOrgCode = data.result['sysOrgCode'];
@@ -55,11 +56,12 @@ export async function getRemoteSetting() {
 }
 
 export const useGlobSetting = (): Readonly<GlobConfig> => {
-  if (!title) {
-    try {
-      getUrl();
-    } catch (error) {}
-  }
+  getUrl();
+  // if (!title) {
+  //   // try {
+  //   //   getUrl();
+  //   // } catch (error) {}
+  // }
   const {
     VITE_GLOB_APP_TITLE,
     VITE_GLOB_API_URL,

+ 10 - 6
src/views/vent/monitorManager/alarmMonitor/index.vue

@@ -404,10 +404,8 @@ import warnGradeInfo from './common/warnGradeInfo.vue';
 
 let monitor=ref(true)
 let toggleData=reactive({})
-let useGlobSettings=useGlobSetting()
-let showToggle=ref(useGlobSettings.sysDataType)
 let router = useRouter();
-let warnLevels = ref(useGlobSettings.sysOrgCode);
+let warnLevels = ref('');
 let Levels = reactive({});
 const warnNumMap = new Map([
   ['fire', 0],
@@ -415,6 +413,7 @@ const warnNumMap = new Map([
   ['vent', 0],
   ['gas', 0],
 ]);
+
 const resetScroll = (e: Event) => {
   if (e.target && e.target) (e.target as Element).scrollTop = 0;
 };
@@ -446,7 +445,7 @@ let gasData = {
 let fireMonitor1 = reactive<any[]>([]);
 let visibleGrade = ref(false); //控制风险等级弹窗显示与隐藏
 let titleGrade = ref(''); //风险等级弹窗标题
-
+let showToggle=ref('')
 
 //点击切换实时\报表数据
 let handlerToggle=()=>{
@@ -598,16 +597,21 @@ function getLevelNum() {
 }
 
 onMounted(async () => {
+  console.log(111111111111111111111111111111)
+  const { sysOrgCode, sysDataType } = useGlobSetting();
+  console.log(sysDataType)
+  warnLevels.value = sysOrgCode;
+  showToggle.value=sysDataType
+  console.log(showToggle,'showToggle------')
   await getLevelNum();
   await getMonitor(true);
   rainBg('rain', 'animation-box');
 });
 
 onUnmounted(() => {
-  if (timer) {
     clearTimeout(timer);
     timer = undefined;
-  }
+  
 });
 </script>
 <style lang="less" scoped>