From 128a2f55ef26f7e1505955fa56aa61e34f39a772 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期五, 30 十二月 2022 14:12:49 +0800
Subject: [PATCH] feat: 接收设置

---
 src/views/layout/components/Header/index.vue |   79 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/src/views/layout/components/Header/index.vue b/src/views/layout/components/Header/index.vue
index 08c899e..14a4ef7 100644
--- a/src/views/layout/components/Header/index.vue
+++ b/src/views/layout/components/Header/index.vue
@@ -37,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'>
@@ -54,6 +54,31 @@
           <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
+      type="selection"
+      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-dialog>
       <el-dialog :visible.sync="updatePasswordDialog" width="40%" title="淇敼瀵嗙爜" v-if="updatePasswordDialog"
         :before-close="handleClose">
         <updatePassword />
@@ -89,6 +114,7 @@
 <script>
 import updatePassword from "./updatePassword";
 import users from "@/api/users";
+import { Message } from "element-ui";
 
 export default {
   components: {
@@ -98,6 +124,8 @@
     return {
       baseInformationVisible: false,
       updatePasswordDialog: false,
+      channelSettingVisible:false,
+      checked3:true,
       menuLeftList: [
         {
           label: '椹鹃┒鑸�',
@@ -124,16 +152,41 @@
       },
       user: '',
       menuMessageList: [],
+      channelData: [],
       messageCounts: 0,
       keyword: '',
       info: null,
-      show: false
+      show: false,
+      messageColumnSet:{
+      }
     };
   },
   created() {
     this.setLoginInfo();
   },
   methods: {
+    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.$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');
@@ -146,7 +199,19 @@
           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;
@@ -154,6 +219,14 @@
         })
         .catch((_) => { });
     },
+    handleClose(done) {
+      this.$confirm("纭鍏抽棴锛�")
+        .then((_) => {
+          this.channelSettingVisible = false;
+          done();
+        })
+        .catch((_) => { });
+    },
     //淇敼瀵嗙爜
     updatePassword() {
       this.updatePasswordDialog = true;

--
Gitblit v1.8.0