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

局部通风机评价分析样式修改

bobo04052021@163.com пре 1 месец
родитељ
комит
bc19051c30
1 измењених фајлова са 44 додато и 20 уклоњено
  1. 44 20
      src/views/vent/monitorManager/fanLocalMonitor/index.vue

+ 44 - 20
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -214,7 +214,7 @@
             >
           </div>
           <div class="container-group container-group-l">
-            <div class="warning-group" style="max-height: 200px; overflow-y: auto">
+            <div class="warning-group" :style="computedStyle">
               <template v-if="selectData.deviceType">
                 <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
                   <div class="item-icon">
@@ -237,26 +237,27 @@
               </template>
             </div>
           </div>
-          <div class="container-group">
-            <div class="warning-header">
-              <div class="header-item">
-                <div class="header-title">评价分析</div>
-                <!-- <div class="header-value">{{ selectData['warnLogNotOkCount'] }} </div> -->
+          <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
+            <div class="container-group" v-if="item.permission === 'fanLocal:pjfx' && hasPermission(item.permission)">
+              <div class="warning-header">
+                <div class="header-item">
+                  <div class="header-title">评价分析</div>
+                </div>
               </div>
-            </div>
-            <div class="warning-group" style="max-height: 200px; overflow-y: auto">
-              <template v-if="selectData.deviceType">
-                <div class="container-item" v-for="(data, index) in leftColumns1" :key="index">
-                  <div class="item-icon">
-                    <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
-                    <CaretRightOutlined class="icon-style" />
+              <div class="warning-group" style="max-height: 200px; overflow-y: auto">
+                <template v-if="selectData.deviceType">
+                  <div class="container-item" v-for="(data, index) in leftColumns1" :key="index">
+                    <div class="item-icon">
+                      <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
+                      <CaretRightOutlined class="icon-style" />
+                    </div>
+                    <div class="item-name">{{ data.title }}</div>
+                    <div :class="['item-value', { 'text-red-bold': data.value === '超限' }]">{{ data.value }}</div>
                   </div>
-                  <div class="item-name">{{ data.title }}</div>
-                  <div :class="['item-value', { 'text-red-bold': data.value === '超限' }]">{{ data.value }}</div>
-                </div>
-              </template>
+                </template>
+              </div>
             </div>
-          </div>
+          </template>
         </div>
       </div>
       <div>
@@ -272,7 +273,7 @@
               >
             </div>
             <div class="container-group container-group-l">
-              <div class="warning-group" style="max-height: 200px; overflow-y: auto">
+              <div class="warning-group" style="max-height: 200px">
                 <template v-if="deviceType">
                   <div v-for="(state, index) in rightColumns" :key="index">
                     <template v-if="!state.dataIndex.endsWith('_w')">
@@ -655,7 +656,20 @@
 
 <script setup lang="ts">
 import { ExclamationCircleFilled, ArrowRightOutlined, VideoCameraOutlined } from '@ant-design/icons-vue';
-import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref, shallowReactive } from 'vue';
+import {
+  onBeforeMount,
+  ref,
+  watch,
+  onMounted,
+  nextTick,
+  defineAsyncComponent,
+  reactive,
+  onUnmounted,
+  inject,
+  unref,
+  computed,
+  shallowReactive,
+} from 'vue';
 // import BarSingle from '../../../../components/chart/BarSingle.vue';
 import FanDeviceEcharts from '../comment/FanDeviceEcharts.vue';
 import BarAndLine from '../../../../components/chart/BarAndLine.vue';
@@ -708,6 +722,11 @@ const router = useRouter();
 const { createConfirm } = useMessage();
 const globSetting = useGlobSetting();
 const showPlay = ref(hasPermission('fanlocal:showCamera') ? true : false);
+const computedStyle = computed(() => {
+  const items = modalTypeArr.rightBtnArr;
+  const hasMatchingPermission = items.some((item) => item.permission === 'fanLocal:pjfx' && hasPermission(item.permission));
+  return hasMatchingPermission ? 'max-height: 200px' : '';
+});
 const modalTypeArr = reactive({
   leftBtnArr: [
     {
@@ -844,6 +863,11 @@ const modalTypeArr = reactive({
       value: '按需供风联动',
       permission: 'fanLocal:supplyAir',
     },
+    {
+      key: 'pjfx',
+      value: '评价分析',
+      permission: 'fanLocal:pjfx',
+    },
   ],
 });
 const sensorList = ref<any[]>([