From b187465a306d069f952c8ea9817b2d0f1c461059 Mon Sep 17 00:00:00 2001 From: wl <173@qq.com> Date: 星期二, 10 一月 2023 16:42:24 +0800 Subject: [PATCH] fix: 消息栏目查询 --- src/views/layout/components/Header/index.vue | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/views/layout/components/Header/index.vue b/src/views/layout/components/Header/index.vue index 53c8a62..8426f6d 100644 --- a/src/views/layout/components/Header/index.vue +++ b/src/views/layout/components/Header/index.vue @@ -66,23 +66,23 @@ <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 prop="isReceive" label="鍚敤" min-width="5"> + <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"> - </el-switch> - {{ scope.row.isReceive}} + :active-value="1" + :inactive-value="0" + @change="handleSelectionChange(scope.row)"> + </el-switch> </template> </el-table-column> </el-table> - <el-button type="button" @click="channelSetting">鍙栨秷</el-button> + <el-button type="button" @click="cancelChannel">鍙栨秷</el-button> </el-dialog> <el-dialog :visible.sync="updatePasswordDialog" width="40%" title="淇敼瀵嗙爜" v-if="updatePasswordDialog" @@ -170,19 +170,21 @@ this.setLoginInfo(); }, methods: { + 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.messageColumnId = val.id + if (val.isReceive == null) { this.messageColumnSet.isReceive = 1 } - if (val[0].isReceive == 1) { + if (val.isReceive == 1) { + this.messageColumnSet.isReceive = 1 + } + else if (val.isReceive == 0) { this.messageColumnSet.isReceive = 0 - } - if (val[0].isReceive == 0) { - this.messageColumnSet.isReceive = 1 } this.$axios({ method: 'post', -- Gitblit v1.8.0