From d5f572496c5fb12fec2fe346b847bf58331299c9 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 17 七月 2024 15:56:51 +0800
Subject: [PATCH] 1

---
 src/components/headNav/headNav.vue |  121 +++++++++++++++++++--------------------
 1 files changed, 59 insertions(+), 62 deletions(-)

diff --git a/src/components/headNav/headNav.vue b/src/components/headNav/headNav.vue
index 3a3f61b..37ff5c2 100644
--- a/src/components/headNav/headNav.vue
+++ b/src/components/headNav/headNav.vue
@@ -9,6 +9,7 @@
           margin-right: 3rem;
           cursor: pointer;
         "
+        title="瀵艰埅鑿滃崟"
         @click="menuNav = !menuNav"
         ><img
           style="width: 100%; height: 100%"
@@ -18,13 +19,7 @@
       <view class="flex" style="letter-spacing: 5rpx">
         <view class="logo"></view>
         <view
-          class=""
-          style="
-            margin-left: 0.19rem;
-            font-size: 0.24rem;
-            font-family: cursive;
-            font-weight: 900;
-          "
+          style="margin-left: 0.19rem; font-size: 0.24rem; font-weight: 900"
         >
           {{ text }}
         </view>
@@ -38,9 +33,9 @@
             width: 2.33rem;
             margin-right: 0.3rem;
             justify-content: flex-end;
+            position: relative;
           "
         >
-          <!-- overflow: hidden;  -->
           <input
             :style="{ display: isExpanded == true ? 'block' : 'none' }"
             type="text"
@@ -49,13 +44,41 @@
               flex: 1;
               background-color: #fff;
               font-size: 0.13rem;
+              padding-right: 30px;
+              box-sizing: border-box;
             "
             @blur="InputBlur"
+            @confirm="toggleSearch"
             class="search-input"
             v-model="searchInput"
             placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�"
           />
+          <span
+            class="cleanupBtn"
+            v-if="searchInput"
+            @click="searchInput = ''"
+            style="
+              position: absolute;
+              top: 50%;
+              margin-top: -10px;
+              right: 42px;
+              color: #fff;
+              z-index: 2;
+              display: inline-block;
+              width: 20px;
+              height: 20px;
+              text-align: center;
+              line-height: 20px;
+              background-color: #a5a5a5;
+              font-weight: bold;
+              border-radius: 50%;
+              font-size: 12px;
+              cursor: pointer;
+            "
+            >鉁�</span
+          >
           <view
+            title="鎼滅储"
             class="search-logo"
             @click="toggleSearch"
             :style="{
@@ -64,13 +87,13 @@
             style="
               background-color: #000;
               border-radius: 50%;
-              margin-top: -4rpx;
             "
           ></view>
         </view>
         <el-dropdown trigger="click" @command="handleCommand">
           <!-- <view @click="iconClick(2)" class="s2 ss1 "></view> -->
           <img
+            title="涓汉涓績"
             class="cursor"
             @click="changePassword(1)"
             src="@/static/image/profile.svg"
@@ -82,6 +105,7 @@
           </el-dropdown-menu>
         </el-dropdown>
         <img
+          title="甯姪"
           class="cursor"
           @click="changePassword(2)"
           src="@/static/image/quote.svg"
@@ -102,7 +126,7 @@
     >
       <!-- 鑳屾櫙 -->
       <img class="leftListBgImage" src="@/static/image/leftListBg.png" alt="" />
-      <view class="" style="position: relative; z-index: 999">
+      <view style="position: relative; z-index: 999">
         <view class="flex flex-center LeftLogo">
           <!-- <img src="@/static/image/logo.png" ></img> -->
           <view class="img"></view>
@@ -117,24 +141,27 @@
             <span slot="title">棣栭〉</span>
           </el-menu-item>
           <el-menu-item index="1">
-            <span slot="title">涓尰浜虹墿鏁版嵁搴�</span>
+            <span slot="title">鍘嗕唬浜虹墿</span>
           </el-menu-item>
-          <el-menu-item index="2">
-            <span slot="title">涓栧尰鍖诲鏁版嵁搴�</span>
+          <el-menu-item index="2" class="oActive">
+            <span slot="title">瀹跺浼犳壙</span>
+          </el-menu-item>
+          <el-menu-item index="6">
+            <span slot="title">瀛︽湳娴佹淳</span>
           </el-menu-item>
           <el-menu-item index="3">
-            <span slot="title">涓尰鍖诲娴佹淳</span>
+            <span slot="title">瀛︽湳鍥捐氨</span>
           </el-menu-item>
           <el-menu-item index="4">
-            <span slot="title">涓尰鍦板煙鍥捐氨</span>
+            <span slot="title">鍦板煙鍥捐氨</span>
           </el-menu-item>
-          <el-menu-item index="5">
+          <!-- <el-menu-item index="5">
             <span slot="title">涓尰鍖讳簨鍒跺害</span>
-          </el-menu-item>
+          </el-menu-item> -->
         </el-menu>
       </view>
     </el-dialog>
-    <!-- <view class="" style="position: fixed;right: 0;top: 0;" @click="dialogVisible = !dialogVisible">姘存按姘存按</view> -->
+    <!-- <view  style="position: fixed;right: 0;top: 0;" @click="dialogVisible = !dialogVisible">姘存按姘存按</view> -->
     <!-- <el-card v-if="menuNav"
 			style="position: fixed;left: 0;top: 0; z-index: 999999999; width: 240px;height: 100vh;">
 			
@@ -191,26 +218,21 @@
     // 淇敼瀵嗙爜
     changePassword(index) {
       if (index == 1) {
-        // console.log('sdfdsf');
         // 妫�鏌� localStorage 涓槸鍚﹀瓨鍦� token
         if (localStorage.getItem("access_token")) {
           // token 瀛樺湪
-          console.log("access_token");
           this.isCommand = true;
         } else {
           // token 涓嶅瓨鍦�
-          // console.log('Token does not exist.');
           this.isCommand = false;
           // uni.navigateTo({
           // 	url: '/pages/Login/Login'
           // })
-          console.log("涓嶅瓨鍦�");
           uni.showModal({
             // 璇㈤棶鐢ㄦ埛鏄惁閫�鍑虹櫥褰�
             title: "璇烽噸鏂扮櫥褰�",
             content: "鎮ㄧ‘瀹氳閲嶆柊鐧诲綍鍚�?",
             success: async (res) => {
-              console.log(res, "reresresrer");
               if (res.confirm) {
                 setTimeout(() => {
                   uni.reLaunch({
@@ -219,10 +241,6 @@
                 }, 1500);
               } else if (res.cancel) {
                 // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-                uni.showToast({
-                  title: "鐢ㄦ埛鐐瑰嚮鍙栨秷",
-                  icon: "none"
-                });
               }
             }
           });
@@ -237,52 +255,35 @@
     // 淇敼鑾峰彇閫�鍑烘寜閽�
     handleCommand(int) {
       if (int == 1) {
-        console.log("淇敼瀵嗙爜");
         uni.navigateTo({
           url: "/pages/changePassword/changePassword"
         });
       } else if (int == 2) {
-        // console.log('閫�鍑虹櫥褰�');
         uni.showModal({
           // 璇㈤棶鐢ㄦ埛鏄惁閫�鍑虹櫥褰�
           title: "閫�鍑虹櫥褰�",
           content: "鎮ㄧ‘瀹氳閫�鍑虹櫥褰曞悧?",
-          success: async (res) => {
-            console.log(res, "reresresrer");
-
+          success: (res) => {
             if (res.confirm) {
               // 閫�鍑烘帴鍙�
-              await getlogout().then((res) => {
+              getlogout().then((res) => {
                 //纭畾閫�鍑烘嬁鍒皌oken骞舵竻闄oken
                 let TOKEN = uni.getStorageSync("access_token");
                 uni.clearStorageSync();
                 //閫�鍑烘垚鍔燂紒骞惰烦杞埌鍏朵粬椤甸潰
-                uni.showToast({
-                  title: "閫�鍑烘垚鍔�",
-                  icon: "none"
-                });
-              });
-              setTimeout(() => {
+                this.$message.success("閫�鍑烘垚鍔�");
                 uni.reLaunch({
                   url: "/pages/Login/Login"
                 });
-              }, 1500);
+              });
             } else if (res.cancel) {
               // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-              uni.showToast({
-                title: "鐢ㄦ埛鐐瑰嚮鍙栨秷",
-                icon: "none"
-              });
             }
           }
         });
       }
     },
-    aaa() {
-      console.log("ss");
-    },
     handleSelect(index) {
-      console.log(index);
       if (index === "0") {
         uni.navigateTo({
           url: "/pages/index/index?id=" + 0
@@ -323,10 +324,7 @@
             url:
               "/pages/knowledgeBase/knowledgeBase?keyword=" + this.searchInput
           });
-        } else {
-          console.log("涓嶆悳绱�");
         }
-
         this.searchInput = "";
       });
     }
@@ -349,23 +347,22 @@
   }
 }
 
-@media screen and (min-width: 2560px) and (max-width: 3840px) {
-  ::v-deep .el-menu .is-active {
-    background-color: #244a7b !important;
-    border-radius: 0.5rem;
-  }
+::v-deep .el-menu .is-active {
+  background-color: #244a7b !important;
+  border-radius: 0.5rem;
+}
 
+::v-deep .el-menu .is-active.oActive {
+  background-color: #e27917 !important;
+}
+
+@media screen and (min-width: 2560px) and (max-width: 3840px) {
   .LeftLogo .img {
     background-image: url(@/static/image/logo4.png);
   }
 }
 
 @media screen and (min-width: 1366px) and (max-width: 1920px) {
-  ::v-deep .el-menu .is-active {
-    background-color: #244a7b !important;
-    border-radius: 0.5rem;
-  }
-
   .LeftLogo .img {
     background-image: url(@/static/image/logo.png);
   }
@@ -379,7 +376,7 @@
   /* 绮樻�у畾浣� */
   position: sticky;
   top: 0;
-  z-index: 9;
+  z-index: 99999999;
 }
 
 .NavTop {

--
Gitblit v1.9.1