#
Junjie
2024-09-10 83e34f69b7b5edf713d25bbec164e47f924edb31
zy-asrs-admin/src/views/IndexView.vue
@@ -14,6 +14,8 @@
  UserOutlined,
  TranslationOutlined,
  ApartmentOutlined,
  CaretLeftOutlined,
  CaretRightOutlined,
} from "@ant-design/icons-vue";
import { formatMessage, loadData } from '@/utils/localeUtils.js';
import AiView from '@/components/ai/index.vue'
@@ -29,6 +31,7 @@
let isRouterAlive = ref(true);
const menuCache = ref([]);
const hostList = ref([]);
const tabsContent = ref(null);
const components = {
  ...Icons,
@@ -210,6 +213,16 @@
  window.location.reload();
}
const handleScroll = (data) => {
  let position = tabsContent.value.scrollLeft;
  let offset = position * 0.1 + 30;
  if (data == 'left') {
    tabsContent.value.scrollLeft = position - offset;
  } else {
    tabsContent.value.scrollLeft = position + offset;
  }
}
</script>
<template>
@@ -303,6 +316,12 @@
      </a-layout-header>
      <a-layout-content class="content-view">
        <div class="tabs-fixed">
          <div class="tabs-arrow-left" @click="handleScroll('left')">
            <CaretLeftOutlined />
          </div>
          <div class="tabs-content" ref="tabsContent">
            <div class="tabs-content-item">
          <div v-for="(item, index) in routerCacheList" :key="index" @click="switchTabs(item)" class="tabs-item"
            :class="currentCache == item.name ? 'tabs-item-active' : ''">
            <div :class="currentCache == item.name ? '' : 'tabs-item-reload-none'" @click="reloadTabs" @click.stop>
@@ -314,6 +333,13 @@
            </div>
          </div>
        </div>
          </div>
          <div class="tabs-arrow-right" @click="handleScroll('right')">
            <CaretRightOutlined />
          </div>
        </div>
        <router-view v-slot="{ Component, route }" v-if="isRouterAlive">
          <keep-alive :include="routerCache">
            <component :is="Component" @pageReload="reloadTabs" />