From 085fa2fb257e9f11f8f6d34bf12e2dc281c36b4d Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 09 二月 2023 11:28:21 +0800
Subject: [PATCH] 2023/2/9 肖辉 修改部门管理

---
 src/views/layout/components/Header/index.vue |  179 +++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 106 insertions(+), 73 deletions(-)

diff --git a/src/views/layout/components/Header/index.vue b/src/views/layout/components/Header/index.vue
index 14a4ef7..7e8c740 100644
--- a/src/views/layout/components/Header/index.vue
+++ b/src/views/layout/components/Header/index.vue
@@ -4,27 +4,12 @@
     <!-- 宸︿晶鑿滃崟 -->
     <div class="header-left">
       <div class="menu-left__item" v-for="(item, index) in menuLeftList" :key="item.id" @click="changeActive(index)">
-        <span :class="item.checked ? 'my-active' : ''" @click="menuChange(item)">{{ item.label }}</span>
+        <span :class="item.checked ? 'my-active' : 'my-activeno'" @click="menuChange(item)">{{ item.label }}</span>
       </div>
     </div>
     <!-- 鍙充晶鑿滃崟 -->
     <div class="header-right">
       <div class="menu-right__item search"></div>
-      <!-- 鐧诲綍鐢ㄦ埛 -->
-      <div class="menu-right__item user" @mousemove="flag.user = true" @mouseleave="flag.user = false">
-        <el-avatar :size="20" :src="user.user.icon" v-if="user.user.icon"></el-avatar>
-        <el-avatar :size="20" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" v-else>
-        </el-avatar>
-        <span style="padding: 0 5px;">{{ user.user.username }}</span>
-        <i class="el-icon-arrow-down"></i>
-        <!-- 鐢ㄦ埛鎿嶄綔 -->
-        <div class="user-card" v-if="flag.user" @mouseleave="flag.user = false">
-          <el-card class="box-card">
-            <div class="user-card__item" @click="updatePassword()">淇敼瀵嗙爜</div>
-            <div style="margin-top: 10px;" class="user-card__item" @click="baseInfo()">鍩烘湰淇℃伅</div>
-          </el-card>
-        </div>
-      </div>
       <!-- 娑堟伅 -->
       <div class="menu-right__item btn" @mousemove="flag.message = true" @mouseleave="flag.message = false">
         <el-tooltip effect="dark" content="娑堟伅涓績" placement="bottom-end" :hide-after="600">
@@ -48,6 +33,24 @@
           </el-card>
         </div>
       </div>
+      <!-- 鐧诲綍鐢ㄦ埛 -->
+      <div class="menu-right__item user" @mousemove="flag.user = true" @mouseleave="flag.user = false">
+        <span class="user-span">|</span>
+        <el-avatar :size="20" :src="user.user.icon" v-if="user.user.icon"></el-avatar>
+        <el-avatar :size="20" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" v-else>
+        </el-avatar>
+
+        <span style="padding: 0 5px;">{{ user.user.username }}</span>
+        <i class="el-icon-arrow-down"></i>
+        <!-- 鐢ㄦ埛鎿嶄綔 -->
+        <div class="user-card" v-if="flag.user" @mouseleave="flag.user = false">
+          <el-card class="box-card">
+            <div class="user-card__item" @click="updatePassword()">淇敼瀵嗙爜</div>
+            <div style="margin-top: 10px;" class="user-card__item" @click="baseInfo()">鍩烘湰淇℃伅</div>
+          </el-card>
+        </div>
+      </div>
+
       <!-- 閫�鍑虹櫥褰� -->
       <div class="menu-right__item btn" @click="loginout">
         <el-tooltip effect="dark" content="閫�鍑虹櫥褰�" placement="bottom-end" :hide-after="1000">
@@ -56,35 +59,40 @@
       </div>
       <el-dialog :visible.sync="channelSettingVisible" width="25%" title="娑堟伅鏍忕洰璁剧疆" v-if="channelSettingVisible"
         :before-close="handleChannelClose">
-        <el-table
-        ref="multipleTable"
-            :header-cell-style="{
-            'font-size': '14px',
-            'font-weight': '650',
-            'line-height': '45px',
-          }"
-            :data="channelData"
-            style="width: 100%"
-            @selection-change="handleSelectionChange"
-        >  <el-table-column
-      type="selection"
-      width="55"
-      
-      >
-    </el-table-column>
-          <el-table-column prop="columnName" label="鍏ㄩ儴" min-width="5"  align="center">
+        <el-table ref="multipleTable" :header-cell-style="{
+                                        'font-size': '14px',
+                                        'font-weight': '650',
+                                        'line-height': '45px',
+                                      }" :data="channelData" style="width: 100%" @selection-change="handleSelectionChange">
+          <el-table-column width="55">
+          </el-table-column>
+          <el-table-column prop="columnName" label="鍏ㄩ儴" min-width="5" align="center">
             <!-- <template slot-scope="scope">{{ scope.row.id }}</template> -->
           </el-table-column>
-          </el-table>
-     
-          <el-button type="button" @click="channelSetting">鍙栨秷</el-button>
+          <el-table-column label="鍚敤" min-width="5">
+            <template slot-scope="scope">
+              <!-- @change="handleChangeStatus(scope.row)" -->
+              <el-switch class="switchStyle"
+              v-model="scope.row.isReceive"
+              active-color="#3fef9a"
+              inactive-color="#000212"
+              :active-value="1"
+              :inactive-value="0"
+              @change="handleSelectionChange(scope.row)">
+
+              </el-switch>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-button type="button" @click="cancelChannel">鍙栨秷</el-button>
       </el-dialog>
+
       <el-dialog :visible.sync="updatePasswordDialog" width="40%" title="淇敼瀵嗙爜" v-if="updatePasswordDialog"
         :before-close="handleClose">
         <updatePassword />
       </el-dialog>
-      <el-dialog :visible.sync="baseInformationVisible" width="35%" title="鍩烘湰淇℃伅" v-if="baseInformationVisible"
-        >
+      <el-dialog :visible.sync="baseInformationVisible" width="35%" title="鍩烘湰淇℃伅" v-if="baseInformationVisible">
         <el-form :model="info" class="info" label-width="6vw">
           <el-form-item label="鐢ㄦ埛ID" min-width="6">
             <el-input v-model="info.id"></el-input>
@@ -124,24 +132,24 @@
     return {
       baseInformationVisible: false,
       updatePasswordDialog: false,
-      channelSettingVisible:false,
-      checked3:true,
+      channelSettingVisible: false,
+      checked3: true,
       menuLeftList: [
         {
           label: '椹鹃┒鑸�',
-          checked: true,
+          checked: false,
           url: '',
           id: '1f'
         },
         {
           label: '瑙嗛宸℃煡',
-          checked: true,
+          checked: false,
           url: '',
           id: '2f'
         },
         {
           label: '鎵ф硶绠$悊',
-          checked: true,
+          checked: false,
           url: '',
           id: '3f',
         },
@@ -157,33 +165,42 @@
       keyword: '',
       info: null,
       show: false,
-      messageColumnSet:{
+      messageColumnSet: {
       }
     };
   },
   created() {
     this.setLoginInfo();
   },
+  watch:{
+    $route() {
+      this.menuLeftList.map(item=>{
+        item.checked = false
+      })
+    },
+  },
   methods: {
-    handleSelectionChange(val){
+    cancelChannel(){
+      this.channelSettingVisible=false
+    },
+    handleSelectionChange(val) {
       const userInfo = JSON.parse(sessionStorage.getItem('user'));
-    console.log(val[0])
-      this.messageColumnSet.userId=userInfo.user.id
-      this.messageColumnSet.messageColumnId=val[0].id
-    if(val[0].isReceive==null){
-      this.messageColumnSet.isReceive=1
-    }
-    if(val[0].isReceive==1){
-      this.messageColumnSet.isReceive=0
-    }
-    if(val[0].isReceive==0){
-      this.messageColumnSet.isReceive=1
-    }
+      this.messageColumnSet.userId = userInfo.user.id
+      this.messageColumnSet.messageColumnId = val.id
+      if (val.isReceive == null) {
+        this.messageColumnSet.isReceive = 1
+      }
+      if (val.isReceive == 1) {
+        this.messageColumnSet.isReceive = 1
+      }
+      else if (val.isReceive == 0) {
+        this.messageColumnSet.isReceive = 0
+      }
       this.$axios({
         method: 'post',
         url: 'sccg/message_column_set/update',
         data: this.messageColumnSet
-      }).then(res=>{
+      }).then(res => {
         this.$message.success("璁㈤槄鎴愬姛")
       })
     },
@@ -199,15 +216,15 @@
           this.info = res.data.user;
         })
     },
-    channelSetting(row){
-      this.channelSettingVisible=true;
+    channelSetting(row) {
+      this.channelSettingVisible = true;
       const userInfo = JSON.parse(sessionStorage.getItem('user'));
       this.$axios({
         method: 'get',
-        url: 'sccg/message_column/getShowColumn?'+'id='+userInfo.user.id
+        url: 'sccg/message_column/getShowColumn?' + 'id=' + userInfo.user.id
       })
         .then(res => {
-          this.channelData=res.data
+          this.channelData = res.data
           // this.channelData.forEach(item=>{this.$refs.multipleTable.toggleRowSelection(item,true);console.log(this.$refs.multipleTable.toggleRowSelection(item,true))})
         })
     },
@@ -286,10 +303,10 @@
         window.open('http://cockpit.patstech.net:28081/cockpit/dist/board.html#/share-board/zfu0LsJ9', '_blank');
       }
       if (data.id === '2f') {
-        this.$router.push({path: "/home/video"})
+        this.$router.push({ path: "/home/video" })
       }
       if (data.id === '3f') {
-        this.$router.push({path: "/home/operate/casepool/pool"})
+        this.$router.push({ path: "/home/operate/casepool/pool" })
       }
     }
   }
@@ -306,14 +323,14 @@
 }
 
 .el-header {
-  background-color: #071a38;
+  background-color: #313350;
   text-align: center;
   line-height: 60px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 0 20px;
-  color: #4b9bb7;
+  color: #fff;
 
   .header-left {
     display: flex;
@@ -329,15 +346,28 @@
 
         &:hover {
           cursor: pointer;
-          color: #fff;
+          //color: #fff;
         }
       }
     }
 
     .my-active {
       border-radius: 20px;
+      color: #2f54eb;
+      background-color: #313350;
+    }
+    .my-activeno{
+      border-radius: 20px;
       color: #fff;
-      background-color: #092c4a;
+      background-color: #313350;
+    }
+    .my-active:hover {
+      color: #2f54eb;
+      background-color: #313350;
+    }
+    .my-activeno:hover{
+      color: #2f54eb;
+      background-color: #313350;
     }
   }
 
@@ -366,13 +396,15 @@
     }
 
     .user {
-      margin-left: 20px;
-      flex: 2;
+      //margin-left: 20px;
+      flex: 1;
       display: flex;
       align-items: center;
       justify-content: center;
       position: relative;
-
+.user-span{
+  padding: 0 10px;
+}
       .user-card {
         position: absolute;
         top: 60px;
@@ -449,9 +481,10 @@
 
     .user:hover,
     .btn:hover {
-      background-color: #092c4a;
+      //background-color: #092c4a;
       cursor: pointer;
+      color: #2f54eb;
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0