Browse Source

feat: 添加框架

TwoKe945 1 year ago
parent
commit
165eb27cc2
3 changed files with 29 additions and 5 deletions
  1. 10 5
      app/src/components/Headers.vue
  2. 6 0
      app/src/router/index.js
  3. 13 0
      app/src/views/BasicInfo/index.vue

+ 10 - 5
app/src/components/Headers.vue

@@ -2,19 +2,20 @@
   <div>
     <div class="header">
       <div class="title-card">
-        <li class="bg-img" @click="ConfirmBtn(1)" :class="getClass(1)">
+        <li class="bg-img" @click="ConfirmBtn({ id: 1, url: '/home' })" :class="getClass(1)">
           <img src="../assets/images/Vector.png" alt="" />
           <linear-text
             text="总览"
             startColor="#95CCFF"
             endColor="#fff"
             fontSize="20px"
+            
           />
         </li>
         <ul v-for="(item, index) in titleList" :key="index">
           <li
             class="bg-img"
-            @click="ConfirmBtn(item.id)"
+            @click="ConfirmBtn(item)"
             :class="getClass(item.id)"
           >
             <linear-text
@@ -30,7 +31,7 @@
         <ul v-for="(item, index) in titleList1" :key="index">
           <li
             class="bg-img"
-            @click="ConfirmBtn(item.id)"
+            @click="ConfirmBtn(item)"
             :class="getClass(item.id)"
           >
             <linear-text
@@ -69,6 +70,7 @@ export default {
         {
           name: "基础信息",
           id: 2,
+          url: '/basic'
         },
         {
           name: "消防管理",
@@ -101,8 +103,11 @@ export default {
     console.log(this.test);
   },
   methods: {
-    ConfirmBtn(num) {
-      this.flag = num;
+    ConfirmBtn(item) {
+      this.flag = item.id;
+      if (this.$route.path !== item.url) {
+        this.$router.push(item.url)
+      }
     },
     getClass(v) {
       return this.flag == v ? "bg-img active" : "bg-img";

+ 6 - 0
app/src/router/index.js

@@ -2,6 +2,7 @@ import Vue from "vue";
 import VueRouter from "vue-router";
 import BasicLayout from '@/layouts/BasicLayout.vue'
 import HomePage from "../views/Home/index.vue";
+import BasicInfo from "../views/BasicInfo/index.vue";
 
 Vue.use(VueRouter);
 
@@ -19,6 +20,11 @@ const router = new VueRouter({
           path: '/home',
           name: 'home-page',
           component: HomePage
+        },
+        {
+          path: '/basic',
+          name: 'basic-page',
+          component: BasicInfo
         }
       ]
     }

+ 13 - 0
app/src/views/BasicInfo/index.vue

@@ -0,0 +1,13 @@
+
+<template >
+  <div></div>
+</template>
+<script>
+
+export default {
+  name: 'BasicInfoPage'
+}
+</script>
+
+<style scoped lang='less'>
+</style>