فهرست منبع

[Feat 0000]导航栏跳转功能优化

bobo04052021@163.com 18 ساعت پیش
والد
کامیت
5a4795229e

+ 7 - 1
src/views/vent/home/configurable/belt/belt-new.vue

@@ -1,7 +1,13 @@
 <!-- belt-new.vue -->
 <template>
   <div class="company-home">
-    <customHeader :fieldNames="{ label: 'systemname', value: 'sys_id' }" :options="options" :optionValue="optionValue" @change="changeSelectRow">
+    <customHeader
+      :fieldNames="{ label: 'systemname', value: 'sys_id' }"
+      :options="options"
+      :optionValue="optionValue"
+      @change="changeSelectRow"
+      :sysId="optionValue"
+    >
       矿井全域皮带巷三级防灭火系统
     </customHeader>
     <div class="modal-box" id="modalBox" v-if="pageType !== 'history' && isInitModal">

+ 6 - 4
src/views/vent/home/configurable/belt/belt.vue

@@ -2,7 +2,7 @@
 <template>
   <div class="company-home">
     <div class="border">
-      <customHeader>矿井全域皮带巷三级防灭火系统</customHeader>
+      <customHeader :sysId="currentSelectedId">矿井全域皮带巷三级防灭火系统</customHeader>
       <SubApp />
       <div class="box-container">
         <ModuleCommon
@@ -23,7 +23,7 @@
   </div>
 </template>
 <script setup lang="ts">
-import { onMounted, onUnmounted, ref } from 'vue';
+import { onMounted, onUnmounted, ref, nextTick } from 'vue';
 import customHeader from './components/customHeader-belt.vue';
 import { useInitConfigs, useInitPage } from '../hooks/useInit';
 import { testBeltLaneFire } from './configurable.data';
@@ -34,15 +34,17 @@ import { getDataHome } from './configurable.api';
 const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
 const { updateEnhancedConfigs, updateData, data } = useInitPage('矿井全域皮带巷三级防灭火系统');
 
-const currentSelectedId = ref<string | number>('');
+const currentSelectedId = ref<string>('');
 
 let timer = null;
 const showHistory = ref(false);
 // 接收子组件上报的点击事件,更新全局选中状态
-const handleItemClick = (item) => {
+const handleItemClick = async (item) => {
   const clickId = item.id;
   if (!clickId) return;
   currentSelectedId.value = clickId;
+  await nextTick();
+  console.log(currentSelectedId.value, '11111');
   refreshData();
 };
 

+ 7 - 3
src/views/vent/home/configurable/belt/components/customHeader-belt.vue

@@ -60,6 +60,10 @@ const props = defineProps({
     type: String,
     default: '',
   },
+  sysId: {
+    type: String,
+    default: '',
+  },
 });
 
 // 自定义事件
@@ -74,7 +78,7 @@ const visible = ref(false);
 const selectRef = ref(); // 选择器实例
 
 // 导航菜单配置
-const menuList: MenuItem[] = [
+const menuList = computed<MenuItem[]>(() => [
   {
     name: '首页',
     path: '/micro-vent-3dModal/configurable/belt/fireS/home',
@@ -85,13 +89,13 @@ const menuList: MenuItem[] = [
   },
   {
     name: '灾变模拟分析',
-    path: '/micro-vent-3dModal/dashboard/analysis?type=sysMonitor&deviceType=sysfireTunnel&sysID=2028657172566073346&sysType=leather',
+    path: `/micro-vent-3dModal/dashboard/analysis?type=sysMonitor&deviceType=sysfireTunnel&sysID=${props.sysId}&sysType=leather`,
   },
   {
     name: '历史数据',
     path: '/belt/history/home',
   },
-];
+]);
 // 下拉框样式
 const dropdownStyle = {
   background: 'transparent',