Browse Source

no message

linwenxin 1 month ago
parent
commit
14ab41600b
1 changed files with 52 additions and 4 deletions
  1. 52 4
      src/layout/components/Navbar.vue

+ 52 - 4
src/layout/components/Navbar.vue

@@ -27,13 +27,13 @@
 
       <!-- 右侧 -->
       <div class="right-menu">
-        <div class="right-menu-item" v-if="bigViewsBool" @click="goBigViews">
+        <div class="right-menu-item" v-if="bigViewsBool && sjdpkg" @click="goBigViews">
           <el-button size="mini">数据大屏</el-button>
         </div>
-        <div class="right-menu-item" v-if="bigViews2Bool" @click="goBigViews2">
+        <div class="right-menu-item" v-if="bigViews2Bool && newsjdpkg" @click="goBigViews2">
           <el-button size="mini">NEW 数据大屏</el-button>
         </div>
-        <div class="right-menu-item">
+        <div class="right-menu-item" v-if="cdsskg">
           <el-autocomplete
             v-model="pathurl"
             :fetch-suggestions="querySearchAsync"
@@ -41,7 +41,7 @@
             @select="handleSelect"
           ></el-autocomplete>
         </div>
-        <div class="right-menu-item">
+        <div class="right-menu-item" v-if="qhnxkg">
           <el-date-picker
             v-model="orderYear"
             @change="orderYearChange"
@@ -107,6 +107,19 @@
             <el-dropdown-item divided @click.native="logout">
               <span style="display: block">退出登录</span>
             </el-dropdown-item>
+
+            <el-dropdown-item v-if="isMobile()">
+              <el-switch v-model="sjdpkg" active-text="数据大屏" inactive-text=""> </el-switch>
+            </el-dropdown-item>
+            <el-dropdown-item v-if="isMobile()">
+              <el-switch v-model="newsjdpkg" active-text="new 数据大屏" inactive-text=""> </el-switch>
+            </el-dropdown-item>
+            <el-dropdown-item v-if="isMobile()">
+              <el-switch v-model="cdsskg" active-text="菜单搜索" inactive-text=""> </el-switch>
+            </el-dropdown-item>
+            <el-dropdown-item v-if="isMobile()">
+              <el-switch v-model="qhnxkg" active-text="切换年限" inactive-text=""> </el-switch>
+            </el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
       </div>
@@ -342,6 +355,10 @@ export default {
   },
   data() {
     return {
+      sjdpkg: !this.isMobile(),
+      newsjdpkg: !this.isMobile(),
+      cdsskg: !this.isMobile(),
+      qhnxkg: !this.isMobile(),
       orderYear: localStorage.getItem('orderYearVal') || `${new Date().getFullYear()}`,
       Vue_Translation_Of_Text_Type: window?.Vue_Translation_Of_Text_Type || 'zh',
       pathurl: '',
@@ -451,6 +468,34 @@ export default {
     }
   },
   watch: {
+    sjdpkg() {
+      if (this.sjdpkg) {
+        this.newsjdpkg = false
+        this.cdsskg = false
+        this.qhnxkg = false
+      }
+    },
+    newsjdpkg() {
+      if (this.newsjdpkg) {
+        this.sjdpkg = false
+        this.cdsskg = false
+        this.qhnxkg = false
+      }
+    },
+    cdsskg() {
+      if (this.cdsskg) {
+        this.sjdpkg = false
+        this.newsjdpkg = false
+        this.qhnxkg = false
+      }
+    },
+    qhnxkg() {
+      if (this.qhnxkg) {
+        this.sjdpkg = false
+        this.newsjdpkg = false
+        this.cdsskg = false
+      }
+    },
     $route() {
       this.path = `/${this.$route.path.split('/')[1] || ''}`
     },
@@ -479,6 +524,9 @@ export default {
     this.$store.commit('app/SET_L1_PATH', this.path)
   },
   methods: {
+    isMobile() {
+      return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
+    },
     orderYearChange(v) {
       localStorage.setItem('orderYearVal', v)
       setTimeout(() => {