Ver Fonte

fix compayn

scorpio há 2 anos atrás
pai
commit
abab1affb6
2 ficheiros alterados com 66 adições e 43 exclusões
  1. 44 28
      src/layout/left.vue
  2. 22 15
      vite.config.js

+ 44 - 28
src/layout/left.vue

@@ -1,23 +1,40 @@
 <template>
-  <div class='box-shadow-blue full-height' style="background-color: #F4F3EE">
-    <div class='padding mt-20'>
-      <div class='flex flex-center mt-10' style="margin-bottom: 60px">
-        <img src='@/assets/svg/logo.svg'/>
+  <div class="box-shadow-blue full-height" style="background-color: #f4f3ee">
+    <div class="padding mt-20">
+      <div class="flex flex-center mt-10" style="margin-bottom: 60px">
+        <img src="@/assets/svg/logo.svg" />
       </div>
     </div>
     <div>
-      <div class="flex flex-center flex-col bold font-18 item-bg  padding-bottom full-width ">
-        <div v-for="(item,index) in data" :key="item.name" class="full-width  flex flex-col flex-center pointer ">
-          <div class='full-width flex flex-center padding' style='z-index: 2'
-               :class="active === index ? 'item-s' : 'item'" @click="navClick(item,index)">
-            <img :src=item.img>
+      <div
+        class="flex flex-center flex-col bold font-18 item-bg padding-bottom full-width"
+      >
+        <div
+          v-for="(item, index) in data"
+          :key="item.name"
+          class="full-width flex flex-col flex-center pointer"
+        >
+          <div
+            class="full-width flex flex-center padding"
+            style="z-index: 2"
+            :class="active === index ? 'item-s' : 'item'"
+            @click="navClick(item, index)"
+          >
+            <img :src="item.img" />
             <span class="flex-child-average">{{ item.name }}</span>
           </div>
-          <div v-if='item.children && item.children.length > 0 && active === index'
-               class=' flex flex-col flex-center item-sub padding'>
-            <div v-for='(sub,subIndex) in item.children' :key='item' class='padding full-width flex flex-center'
-                 :class='subIndex === subActive ?  "item-sub-active":"" ' @click='subClick(sub,subIndex)'>
-              <div class='mr-10 main-color'>·</div>
+          <div
+            v-if="item.children && item.children.length > 0 && active === index"
+            class="flex flex-col flex-center item-sub padding"
+          >
+            <div
+              v-for="(sub, subIndex) in item.children"
+              :key="item"
+              class="padding full-width flex flex-center"
+              :class="subIndex === subActive ? 'item-sub-active' : ''"
+              @click="subClick(sub, subIndex)"
+            >
+              <div class="mr-10 main-color">·</div>
               <span>{{ sub.name }}</span>
             </div>
           </div>
@@ -29,7 +46,7 @@
 
 <script>
 export default {
-  data () {
+  data() {
     return {
       active: 0,
       subActive: 0,
@@ -61,7 +78,7 @@ export default {
             {
               name: '公司资料',
               img: new URL('../assets/svg/icon2.svg', import.meta.url).href,
-              path: '/components'
+              path: '/company'
             }
           ]
         },
@@ -74,16 +91,16 @@ export default {
       currentPage: ''
     }
   },
-  created () {
+  created() {
     this.currentPage = window.location.href
     this.init()
   },
   methods: {
-    init () {
+    init() {
       if (this.currentPage.indexOf('/invest') > -1) {
         this.active = 1
-      // } else if (this.currentPage.indexOf('/task') > -1) {
-      //   this.active = 2
+        // } else if (this.currentPage.indexOf('/task') > -1) {
+        //   this.active = 2
       } else if (this.currentPage.indexOf('/database') > -1) {
         this.active = 2
       } else if (this.currentPage.indexOf('/recycle') > -1) {
@@ -92,7 +109,7 @@ export default {
         this.active = 0
       }
     },
-    navClick (item, index) {
+    navClick(item, index) {
       this.active = index
       if (item.children && item.children.length > 0) {
         this.subActive = 0
@@ -101,7 +118,7 @@ export default {
         this.$router.push(item.path)
       }
     },
-    subClick (item, index) {
+    subClick(item, index) {
       this.subActive = index
       this.$router.push(item.path)
     }
@@ -120,8 +137,8 @@ export default {
 }
 
 .item-bg {
-  border-top: 1px solid #D1D1D1;
-  border-bottom: 1px solid #D1D1D1;
+  border-top: 1px solid #d1d1d1;
+  border-bottom: 1px solid #d1d1d1;
 }
 
 .item-s {
@@ -129,7 +146,7 @@ export default {
   border-radius: 14px;
   margin-top: 30px;
   color: white;
-  background-color: #AB7630;
+  background-color: #ab7630;
   box-shadow: 2px 2px 10px 2px rgba(242, 162, 58, 0.49);
 }
 
@@ -147,11 +164,10 @@ export default {
   margin-top: -10px;
   padding-top: 20px;
   color: #939393;
-  background-color: #E4E4E4;
+  background-color: #e4e4e4;
 }
 
 .item-sub-active {
-  background-color: #D3D3D3;
+  background-color: #d3d3d3;
 }
-
 </style>

+ 22 - 15
vite.config.js

@@ -1,6 +1,4 @@
-import {
-  defineConfig
-} from 'vite'
+import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import Pages from 'vite-plugin-pages'
 import Layouts from 'vite-plugin-vue-layouts'
@@ -11,16 +9,21 @@ export default defineConfig({
   plugins: [
     vue(),
     Pages({
-      dirs: [{
-        dir: 'src/page',
-        baseRoute: ''
-      },
-      {
-        dir: 'src/views',
-        baseRoute: ''
-      }
+      dirs: [
+        {
+          dir: 'src/page',
+          baseRoute: ''
+        },
+        {
+          dir: 'src/views',
+          baseRoute: ''
+        }
       ],
-      exclude: ['**/component/*.vue'] // 排除组件
+      exclude: [
+        '**/components/*.vue',
+        '**/component/*.vue',
+        '**/component/**/*'
+      ]
     }),
     Layouts({
       layoutsDirs: 'src/layout',
@@ -37,9 +40,13 @@ export default defineConfig({
     chunkSizeWarningLimit: 1500,
     rollupOptions: {
       output: {
-        manualChunks (id) {
+        manualChunks(id) {
           if (id.includes('node_modules')) {
-            return id.toString().split('node_modules/')[1].split('/')[0].toString()
+            return id
+              .toString()
+              .split('node_modules/')[1]
+              .split('/')[0]
+              .toString()
           }
         }
       }
@@ -54,7 +61,7 @@ export default defineConfig({
         // target: 'https://prod.wutongshucloud.com/api',
         // target: 'http://192.168.31.181:8110',
         changeOrigin: true,
-        rewrite: (path) => path.replace(/^\/api/, '')
+        rewrite: path => path.replace(/^\/api/, '')
       }
     }
   }