Ver Fonte

瓦斯故障诊断管道-修改

lxh há 4 semanas atrás
pai
commit
42cbedbdeb

+ 31 - 16
src/views/vent/monitorManager/alarmMonitor/common.data.ts

@@ -4,25 +4,25 @@ import { useGlobSetting } from '/@/hooks/setting';
 
 
 export const getMaxY = function (param) {
-  console.log(param,'999999')
-  let maxval=0
+  console.log(param, '999999')
+  let maxval = 0
   if (param.length == 1) {
-     maxval = Math.max(...param[0]);
+    maxval = Math.max(...param[0]);
   } else if (param.length == 2) {
     const max1 = Math.max(...param[0]);
     const max2 = Math.max(...param[1]);
-    maxval = Math.max(max1,max2)
+    maxval = Math.max(max1, max2)
   } else if (param.length == 3) {
     const max1 = Math.max(...param[0]);
     const max2 = Math.max(...param[1]);
     const max3 = Math.max(...param[2]);
-    maxval=Math.max(max1,max2,max3)
+    maxval = Math.max(max1, max2, max3)
   }
- let yMax = (maxval * 1.6).toFixed(0);
-// const digitCount = yMax.toFixed(0).length;
-// console.log(digitCount,'digitCount')
-// let digFirst=yMax.toString().substring(0,1)
-// console.log(digFirst,'digFirst')
+  let yMax = (maxval * 1.6).toFixed(0);
+  // const digitCount = yMax.toFixed(0).length;
+  // console.log(digitCount,'digitCount')
+  // let digFirst=yMax.toString().substring(0,1)
+  // console.log(digFirst,'digFirst')
 
 
   // const digitCount = maxval.toFixed(0).length;
@@ -71,20 +71,20 @@ export const getMaxY = function (param) {
 }
 
 export const getMinY = function (param) {
-  let minval=0
+  let minval = 0
   if (param.length == 1) {
     minval = Math.min(...param[0]);
   } else if (param.length == 2) {
     const min1 = Math.min(...param[0]);
     const min2 = Math.min(...param[1]);
-    minval=Math.min(min1,min2)
+    minval = Math.min(min1, min2)
   } else if (param.length == 3) {
     const min1 = Math.min(...param[0]);
     const min2 = Math.min(...param[1]);
     const min3 = Math.min(...param[2]);
-    minval=Math.min(min1,min2,min3)
+    minval = Math.min(min1, min2, min3)
   }
-  let yMin = (minval*0.7).toFixed(0);
+  let yMin = (minval * 0.7).toFixed(0);
   // const minDigitCount = minval.toFixed(0).length;
   // let yMin = 0;
   // if (minDigitCount < 2) {
@@ -158,8 +158,7 @@ export const typeMenuList = [{ name: '内因火灾' }, { name: '外因火灾' },
 export const typeMenuListTf = [{ name: '通风监测' }, { name: '巷道阻力分析' }];
 //瓦斯监测菜单列表
 export function getMonitorComponent() {
-  // const { sysOrgCode } = useGlobSetting();
-  const sysOrgCode = 'sdmtjtbdmk';
+  const { sysOrgCode } = useGlobSetting();
   let typeMenuListGas;
   switch (sysOrgCode) {
     case 'sdmtjtbetmk': //布尔台
@@ -174,6 +173,22 @@ export function getMonitorComponent() {
       return typeMenuListGas;
   }
 }
+//瓦斯监测菜单列表
+export function getMonitorFlag() {
+  const { sysOrgCode } = useGlobSetting();
+  let typeFlag = '';
+  switch (sysOrgCode) {
+    case 'sdmtjtbdmk': //宝德
+      typeFlag = '1';
+      return typeFlag;
+      case 'sdmtjtbetmk': //布尔台
+      typeFlag = '2';
+      return typeFlag;
+    default:
+      typeFlag = ''
+      return typeFlag;
+  }
+}
 
 //当前加载组件
 export const componentName = {

+ 6 - 9
src/views/vent/monitorManager/alarmMonitor/warn/gasWarn.vue

@@ -91,13 +91,13 @@ import warnTargetGas from '../common/warnTargetGas.vue';
 import PipeWarn from '../common/PipeWarn.vue';
 import gasParamter from '../common/gasParamter.vue';
 import faultDiagnose from '../common/faultDiagnose.vue'
-import { getMonitorComponent } from '../common.data';
+import { getMonitorComponent,getMonitorFlag } from '../common.data';
 import { usePermission } from '/@/hooks/web/usePermission';
-import { useGlobSetting } from '/@/hooks/setting';
 import MeasurePoint from '../common/measurePoint.vue';
 import dayjs from 'dayjs';
 
 let typeMenuListGas = getMonitorComponent();
+let isflag=getMonitorFlag()
 const { hasPermission } = usePermission();
 const { options, optionValue, getSelectRow, getSysDataSource } = useSystemSelect('sys_surface_caimei'); // 参数为场景类型(设备类型管理中可以查询到)
 //当前左侧激活菜单的索引
@@ -144,8 +144,7 @@ let timer: null | NodeJS.Timeout = null;
 function getMonitor(flag?) {
   timer = setTimeout(
     async () => {
-      const { sysOrgCode } = useGlobSetting();
-      if (sysOrgCode == 'sdmtjtbdmk') {
+      if (isflag=='1') {
         await getBjlist()
       } else {
         await getMenuList()
@@ -383,11 +382,10 @@ function btnClick(ind) {
       isShow.value = 'yjjc';
       break;
     case 1:
-      const { sysOrgCode } = useGlobSetting();
-      if (sysOrgCode == 'sdmtjtbetmk') {
+      if (isflag == '2') {
         activeIndex1.value = 0;
         isShow.value = 'yjzb';
-      } else if (sysOrgCode == 'sdmtjtbdmk') {
+      } else if (isflag == '1') {
         activeIndex1.value = 0;
         isShow.value = 'gzzd';
         getMonitor(true);
@@ -413,8 +411,7 @@ function cardClick(ind, item) {
 }
 
 onMounted(() => {
-  const { sysOrgCode } = useGlobSetting();
-  if (sysOrgCode == 'sdmtjtbdmk') {
+  if (isflag== '1') {
     getBjlist()
     getMonitor(true);
   } else {