baoshiwei
2025-05-24 3ad537052477fe31f45bd2e16045d58b35713bdc
zhitan-vue/src/layout/index.vue
@@ -33,10 +33,10 @@
            </div>
            
            <!-- 大模型按钮 -->
            <div class="right-menu-item ai-btn" @click="openAIModel">
              <svg-icon icon-class="ai" class="right-menu-icon" />
              <span class="right-menu-text">智能助手</span>
            </div>
<!--            <div class="right-menu-item ai-btn" @click="openAIModel">-->
<!--              <svg-icon icon-class="ai" class="right-menu-icon" />-->
<!--              <span class="right-menu-text">智能助手</span>-->
<!--            </div>-->
          </div>
        </div>
      </div>
@@ -86,7 +86,7 @@
// 跳转到报警页面
function goToAlarm() {
  router.push('/alarmmanage/measuremen?modelCode=BJGL')
  router.push('/alarmmanage/measuremen?modelCode=LBJT')
}
// 打开AI大模型对话框
@@ -134,10 +134,11 @@
// 组件挂载时,确保首页侧边栏状态正确
onMounted(() => {
  // 如果当前是首页,确保侧边栏可见
  // 如果当前是首页子页面,只确保侧边栏不被隐藏,但保持折叠/展开状态不变
  if (route.path === '/index/index') {
    // 只设置不隐藏侧边栏,但不改变其展开/折叠状态
    appStore.toggleSideBarHide(false)
    appStore.sidebar.opened = true
    // 不再强制设置opened为true,保持用户之前的设置
  }
})
@@ -310,13 +311,19 @@
  top: 60px;
  right: 0;
  z-index: 9;
  width: 100%;
  width: calc(100% - #{$base-sidebar-width});
  transition: width 0.28s;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 0;
}
.hideSidebar .fixed-header {
  width: calc(100% - 54px);
}
.sidebarHide .fixed-header {
  width: 100%;
}