Просмотр исходного кода

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

hlp 1 год назад
Родитель
Сommit
83eeecd418

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue

@@ -55,7 +55,7 @@ body,
   width: 100%;
   height: 100%;
   /* overflow: hidden; */
-  min-width: 600px;
+  min-width: 650px;
 }
 * {
   font-family: '微软雅黑';

+ 16 - 7
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/header/header.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class=" flex flex-row justify-start items-center text-white flex-1 parentBox" ref="parentDiv">
-    <div class="trademark mr-8 flex items-center">
-      <img :src="loginLogin" class="w-10 h-10 mr-4" />
-      <div>客户管家</div>
-    </div>
+  <div class="trademark mr-8 flex items-center text-white">
+    <img :src="loginLogin" class="w-10 h-10 mr-4" />
+    <div class="text-nowrap">客户管家</div>
+  </div>
+  <div class=" flex flex-row justify-start items-center text-white flex-1 parentDiv" ref="parentDiv">
     <div v-for="(routerItem, routerItemIdex) in routerList"
       :class="`border-b-2 border-transparent hover:border-white p-2 mr-4 cursor-pointer multipleyHeader ${activeRouter?.path === routerItem.path ? 'border-white' : ''}`"
       :key="routerItem.path" ref="childDivs" v-show="visibleItems.includes(routerItemIdex)">
@@ -29,7 +29,7 @@
       </div>
     </div>
   </div>
-  <div class="flex flex-row justify-start items-center text-white">
+  <div class="flex flex-row justify-start items-center text-white header-right">
     <el-icon :size="26" class="ml-4 cursor-pointer">
       <Bell />
     </el-icon>
@@ -123,13 +123,22 @@ watchEffect(() => {
   height: 96%;
   display: flex;
   align-items: center;
+  text-wrap: nowrap;
 
   .headerText {
     font-size: 16px;
   }
 }
 .parentBox {
-  max-width: 80%;
+  // max-width: 80%;
+  // min-width: 300px;
+  flex: 1;
   overflow: hidden;
 }
+.header-right {
+  width: 135px;
+}
+.parentDiv {
+  width: 50%;
+}
 </style>

+ 3 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts

@@ -48,9 +48,10 @@ router.beforeEach((to, _from, next) => {
   const routerList = useStore().routers;
   const routers = router.getRoutes();
   console.log(routerList, routers);
-  const { setAsyncRoutesMark, asyncRoutesMark } = useStore();
-  const token = true;
+  const { setAsyncRoutesMark, asyncRoutesMark, getToken } = useStore();
+  const token = getToken;
   const skipPath = ["/login", "/register", "/test", "/testEcharts"];
+  console.log(token, '<==== token')
   if (skipPath.includes(to.path)) {
     next();
   } else {

+ 8 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts

@@ -1,17 +1,19 @@
 import { defineStore, acceptHMRUpdate } from "pinia";
 import { RouteRecordRaw } from "vue-router";
 export const useStore = defineStore({
-  id: "index",
+  id: "storeInfo",
   state: () => ({
-    userInfo: {}, // 当前的用户信息
+    userInfo: { id: '' }, // 当前的用户信息
     routers: [], // 返回的所有路由
     asyncRoutesMark: false, // 是否添加过路由
   }),
   getters: {
-    // 取值
-    getRoutersList(): RouteRecordRaw[] {
+    getRoutersList(): RouteRecordRaw[] { // 取值
       return this.routers;
-    } 
+    },
+    getToken(): string {
+      return  this.userInfo?.id || ''
+    }
   },
   actions: {
     // 方法
@@ -27,7 +29,7 @@ export const useStore = defineStore({
     clearStore() {
       localStorage.clear();
       sessionStorage.clear();
-      this.userInfo = {};
+      this.userInfo = { id: '' };
       this.routers = [];
       this.asyncRoutesMark = false;
     }