Переглянути джерело

增加仪表盘快捷菜单跳转页

liuyanpeng 1 рік тому
батько
коміт
028024e04e
2 змінених файлів з 126 додано та 0 видалено
  1. 123 0
      src/dashboard/ShortcutMenu.vue
  2. 3 0
      src/routes/main_routes.js

+ 123 - 0
src/dashboard/ShortcutMenu.vue

@@ -0,0 +1,123 @@
+<template>
+  <ul class="nav nav-tabs m-row">
+    <li
+      v-for="(item, index) in menus"
+      :key="index"
+      role="presentation"
+      :class="{ active: currentTabIndex === index }"
+      @click="menuChanged(index, item.infoWindowNo)"
+    >
+      <a>{{ item.menuName }}</a>
+      <span
+        v-show="currentTabIndex !== 0"
+        :class="{
+          jt: true,
+          active: currentTabIndex === index,
+        }"
+      />
+    </li>
+    <li class="help-box">
+      <span>使用帮助</span>
+    </li>
+  </ul>
+  <InfoWindow
+    v-if="infoWindowNo"
+    ref="info"
+    :info-window-no="infoWindowNo"
+    :is-search-widget="true"
+  />
+</template>
+
+<script setup>
+import { useRouter } from 'vue-router';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+
+const menus = [
+  {
+    menuName: '首页',
+    infoWindowNo: null,
+  },
+  {
+    menuName: '所有资产',
+    infoWindowNo: '20240922_095937',
+  },
+  {
+    menuName: '待收货',
+    infoWindowNo: '20241014_105157',
+  },
+  {
+    menuName: '待维修',
+    infoWindowNo: '20240922_095937',
+  },
+  {
+    menuName: '待转移',
+    infoWindowNo: '20240922_095937',
+  },
+  {
+    menuName: '待处置',
+    infoWindowNo: '20240922_095937',
+  },
+];
+
+const router = useRouter();
+
+const infoWindowNo = ref(null);
+const currentTabIndex = ref(0);
+
+onMounted(() => {
+  const { menuIndex, windowNo } = JSON.parse(
+    localStorage.getItem('shortcutMenu'),
+  );
+  menuChanged(menuIndex, windowNo);
+});
+
+const menuChanged = (index, windowNo) => {
+  currentTabIndex.value = index;
+  if (windowNo) {
+    infoWindowNo.value = windowNo;
+  } else {
+    router.push('/desktop/dashboard');
+  }
+};
+</script>
+
+<style scoped>
+.nav-tabs > li {
+  width: 74px;
+  cursor: pointer;
+}
+.m-row {
+  margin-bottom: 0;
+}
+.nav > li > a {
+  padding: 6px 4px;
+  text-align: center;
+}
+.nav-tabs > li > a {
+  color: black;
+}
+.nav-tabs > li.active > a {
+  color: #fff;
+  border: 1px solid #ddd;
+  background-color: #2681cf;
+  border-radius: 4px;
+  border-bottom: none;
+}
+.help-box {
+  float: right;
+  display: flex;
+  align-items: center;
+  width: 90px;
+  color: #277fd0;
+  margin-top: 5px;
+}
+.jt {
+  position: absolute;
+  top: 33px;
+  left: 27px;
+  border: 8px solid transparent;
+}
+.jt.active {
+  border-top-color: #277fd0;
+}
+</style>

+ 3 - 0
src/routes/main_routes.js

@@ -68,6 +68,7 @@ const CreateIdentity = () => import('../identity/CreateIdentity.vue');
 const SamlLogin = () => import('../client/SamlLogin.vue');
 const CasLogin = () => import('../client/CasLogin.vue');
 const PrinterConfiguration = () => import('../printer/PrinterConfiguration.vue');
+const ShortcutMenu = () => import('../dashboard/ShortcutMenu.vue');
 
 import { ProcessReport } from 'pc-component-v3';
 
@@ -120,6 +121,8 @@ export default [
       // Web电子表格 窗口
       { path: 'sheetWindow/:windowNo', component: SheetWindow },
 
+      // 快捷菜单
+      { path: 'shortcutMenu',name:'ShortcutMenu', component: ShortcutMenu },
 
       // CRUD编辑窗口
       // eslint-disable-next-line