From 1e07cfd8ac6c3e31e94c0ea98dcff61db51e49d1 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期一, 09 一月 2023 16:54:39 +0800
Subject: [PATCH] fix: 单选框展示

---
 src/views/layout/components/Header/index.vue |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 101 insertions(+), 15 deletions(-)

diff --git a/src/views/layout/components/Header/index.vue b/src/views/layout/components/Header/index.vue
index 015a5b4..8426f6d 100644
--- a/src/views/layout/components/Header/index.vue
+++ b/src/views/layout/components/Header/index.vue
@@ -4,15 +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' : ''">{{ item.label }}</span>
+        <span :class="item.checked ? 'my-active' : ''" @click="menuChange(item)">{{ item.label }}</span>
       </div>
     </div>
     <!-- 鍙充晶鑿滃崟 -->
     <div class="header-right">
-      <!-- 鎼滅储妗� -->
-      <div class="menu-right__item search">
-        <el-input suffix-icon="el-icon-search" v-model="keyword" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�"></el-input>
-      </div>
+      <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>
@@ -40,7 +37,7 @@
           <el-card class="box-card">
             <div class="card-header">
               <span>娑堟伅涓績</span>
-              <el-button type="text">鎺ユ敹璁剧疆</el-button>
+              <el-button type="text" @click="channelSetting">鎺ユ敹璁剧疆</el-button>
             </div>
             <div v-for="item in menuMessageList" :key="item.id" class="message-card__item">
               <router-link to='/home/operate/message/messageIndex'>
@@ -57,12 +54,42 @@
           <i class="el-icon-switch-button"></i>
         </el-tooltip>
       </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 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-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"
-        :before-close="handleClose">
+      <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>
@@ -92,6 +119,7 @@
 <script>
 import updatePassword from "./updatePassword";
 import users from "@/api/users";
+import { Message } from "element-ui";
 
 export default {
   components: {
@@ -101,6 +129,8 @@
     return {
       baseInformationVisible: false,
       updatePasswordDialog: false,
+      channelSettingVisible: false,
+      checked3: true,
       menuLeftList: [
         {
           label: '椹鹃┒鑸�',
@@ -110,15 +140,15 @@
         },
         {
           label: '瑙嗛宸℃煡',
-          checked: false,
+          checked: true,
           url: '',
           id: '2f'
         },
         {
           label: '鎵ф硶绠$悊',
-          checked: false,
+          checked: true,
           url: '',
-          if: '3f',
+          id: '3f',
         },
       ],
       flag: {
@@ -127,16 +157,43 @@
       },
       user: '',
       menuMessageList: [],
+      channelData: [],
       messageCounts: 0,
       keyword: '',
       info: null,
-      show: false
+      show: false,
+      messageColumnSet: {
+      }
     };
   },
   created() {
     this.setLoginInfo();
   },
   methods: {
+    cancelChannel(){
+      this.channelSettingVisible=false
+    },
+    handleSelectionChange(val) {
+      const userInfo = JSON.parse(sessionStorage.getItem('user'));
+      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 => {
+        this.$message.success("璁㈤槄鎴愬姛")
+      })
+    },
     baseInfo() {
       this.baseInformationVisible = true;
       const name = sessionStorage.getItem('name');
@@ -149,10 +206,30 @@
           this.info = res.data.user;
         })
     },
-    handleClose(done) {
+    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
+      })
+        .then(res => {
+          this.channelData = res.data
+          // this.channelData.forEach(item=>{this.$refs.multipleTable.toggleRowSelection(item,true);console.log(this.$refs.multipleTable.toggleRowSelection(item,true))})
+        })
+    },
+    handleChannelClose(done) {
       this.$confirm("纭鍏抽棴锛�")
         .then((_) => {
           this.dialogUpload = false;
+          done();
+        })
+        .catch((_) => { });
+    },
+    handleClose(done) {
+      this.$confirm("纭鍏抽棴锛�")
+        .then((_) => {
+          this.channelSettingVisible = false;
           done();
         })
         .catch((_) => { });
@@ -210,6 +287,17 @@
           })
         })
         .catch(err => this.$message.error(`${err}`))
+    },
+    menuChange(data) {
+      if (data.id === '1f') {
+        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" })
+      }
+      if (data.id === '3f') {
+        this.$router.push({ path: "/home/operate/casepool/pool" })
+      }
     }
   }
 };
@@ -226,14 +314,12 @@
 
 .el-header {
   background-color: #071a38;
-  color: #333;
   text-align: center;
   line-height: 60px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 0 20px;
-  // width: 100%;
   color: #4b9bb7;
 
   .header-left {

--
Gitblit v1.8.0