| | |
| | | <template> |
| | | <div class="groupCommunication"> |
| | | <div class="group-left"> |
| | | <el-input v-model="filterText" suffix-icon="el-icon-search" class="inputleft" placeholder="请输入"> |
| | | <el-input v-model="filterText" class="inputleft" placeholder="请输入" suffix-icon="el-icon-search"> |
| | | <!-- <el-button slot="append" icon="el-icon-search" style="width:10px;" @click="pick"></el-button> --> |
| | | </el-input> |
| | | <el-tree ref="tree" :data="treeData" :filter-node-method="filterNode" :props="treeProps" |
| | |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="margin-left: 5px" v-model="queryInfo.select" placeholder="请输入成员或内容"></el-input> |
| | | <el-input v-model="queryInfo.select" placeholder="请输入成员或内容" style="margin-left: 5px"></el-input> |
| | | <el-button style="margin-left: 5px" type="primary" @click="search">搜索</el-button> |
| | | </div> |
| | | <div class="group-right-left-seach-body-box"> |
| | | <ul style="overflow:auto;height: 558px" class="group-right-left-seach-body-box-ul"> |
| | | <ul id="container" class="group-right-left-seach-body-box-ul" style="overflow:auto;height: 558px"> |
| | | <li v-for="messageOne in messageList" class="group-right-left-seach-body-box-li" > |
| | | <div class="group-right-left-seach-body-box-imgmessage"> |
| | | <img class="group-img" v-if="messageOne.pic != null && messageOne.pic != ''" :src="messageOne.pic" |
| | | <img v-if="messageOne.pic != null && messageOne.pic != ''" :src="messageOne.pic" class="group-img" |
| | | > |
| | | <img class="group-img" v-if="messageOne.pic == null || messageOne.pic == ''" |
| | | <img v-if="messageOne.pic == null || messageOne.pic == ''" class="group-img" |
| | | src="../../icons/7bedbaa41b1744fbfe0c55b507fd9e28.png"> |
| | | <div style="margin-left: 10px" >{{ messageOne.userName }} {{ messageOne.ctime }}</div> |
| | | </div> |
| | | <div :class="messageOne.remark!==null?'activemess':'group-right-left-seach-body-box-text' " >{{ messageOne.text }}</div> |
| | | <div |
| | | :class="messageOne.remark!==null&&messageOne.remark!==undefined?'activemess':'group-right-left-seach-body-box-text' "> |
| | | {{ messageOne.text }} |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | |
| | | |
| | | </el-input> |
| | | <div style="text-align: right"> |
| | | <el-button :disabled="sendBtn" style="text-align: right" size="mini" type="primary" @click="seedMessage">发送</el-button> |
| | | <el-button :disabled="sendBtn" size="mini" style="text-align: right" type="primary" @click="seedMessage"> |
| | | 发送 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="group-right-box-ul"> |
| | | <ul class="group-right-box-ul-title" style="margin: 0"> |
| | | <div style="display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #ccc;padding: 0 10px"> |
| | | <div |
| | | style="display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #ccc;padding: 0 10px"> |
| | | <span>群成员</span> |
| | | <el-button style="color: #0086b3;margin-right: 10px" icon="el-icon-turn-off-microphone" type="text" @click="allBanSpeech">全体禁言</el-button> |
| | | <el-button icon="el-icon-turn-off-microphone" style="color: #0086b3;margin-right: 10px" type="text" |
| | | @click="allBanSpeech">全体禁言 |
| | | </el-button> |
| | | </div> |
| | | <li v-for="(item,index) in tableData" :key="index" style="padding: 0 10px"> |
| | | {{item.userName}} |
| | | <el-button v-if="item.banSpeech==0" style="color: red" type="text" @click="speech(item.userId, item.banSpeech, item.groupId)" >禁言</el-button> |
| | | <el-button v-if="item.banSpeech==1" style="color: green" type="text" @click="speech(item.userId, item.banSpeech, item.groupId)">允许发言</el-button> |
| | | <el-button v-if="item.banSpeech==0" style="color: red" type="text" |
| | | @click="speech(item.userId, item.banSpeech, item.groupId)">禁言 |
| | | </el-button> |
| | | <el-button v-if="item.banSpeech==1" style="color: green" type="text" |
| | | @click="speech(item.userId, item.banSpeech, item.groupId)">允许发言 |
| | | </el-button> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | groupIdlist: null, |
| | | timer: '', |
| | | userIdAll: 1, |
| | | count: 0, |
| | | sendBtn:true, |
| | | options: [ |
| | |
| | | created() { |
| | | this.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(this.timer); |
| | | }, |
| | | mounted() { |
| | | this.timer = setInterval(this.setHand, 5000) |
| | | }, |
| | | methods: { |
| | | load() { |
| | | |
| | |
| | | // pick(){ |
| | | // this.filterNode(this.filterVal,this.data); |
| | | // }, |
| | | async handleNodeClick(data) { |
| | | if (data.id != null) { |
| | | this.groupName = data.groupName; |
| | | var _this = this; |
| | | setHand() { |
| | | if (this.groupIdlist) { |
| | | this.handleNodeClick(this.groupIdlist) |
| | | } else { |
| | | return |
| | | } |
| | | }, |
| | | async getListGro(data) { |
| | | console.log(data) |
| | | await getAllMessage(data.id).then((res) => { |
| | | |
| | | for (let item of res) { |
| | |
| | | await getAllUser(data.id).then(res => { |
| | | console.log(this.messageList) |
| | | console.log(res) |
| | | |
| | | for (let i = 0; i < this.messageList.length; i++) { |
| | | for (let j = 0; j < res.length; j++) { |
| | | if (this.messageList[i].userName == res[j].userName) { |
| | | this.messageList[i].remark = res[j].remark |
| | | } |
| | | } |
| | | } |
| | | this.tableData = res |
| | | |
| | | }) |
| | | this.scrollHeight() |
| | | }, |
| | | async handleNodeClick(data) { |
| | | console.log(data) |
| | | this.groupIdlist = data |
| | | this.groupId = data.id; |
| | | if (data.id != null) { |
| | | this.groupName = data.groupName; |
| | | var _this = this; |
| | | this.userIdAll = data.id |
| | | |
| | | await getAllMessage(data.id).then((res) => { |
| | | |
| | | for (let item of res) { |
| | | if (item.pic === '' || item.pic === null) { |
| | | } else { |
| | | getImgUrl(item.pic).then(res => { |
| | | item.pic = res |
| | | }) |
| | | } |
| | | } |
| | | res.map(item => { |
| | | item.remark = null |
| | | }) |
| | | this.messageList = res |
| | | |
| | | this.sendBtn = false |
| | | }) |
| | | await getAllNotice(data.id).then(res => this.groupAnList = res) |
| | | await getAllUser(data.id).then(res => { |
| | | console.log(this.messageList) |
| | | console.log(res) |
| | | |
| | | for (let i=0; i<this.messageList.length;i++){ |
| | | for (let j = 0; j < res.length; j++) { |
| | | if (this.messageList[i].userName == res[j].userName){ |
| | |
| | | |
| | | }) |
| | | console.log(this.messageList) |
| | | this.groupId = data.id; |
| | | this.scrollHeight() |
| | | } |
| | | |
| | | }, |
| | | async getAlluserList(id) { |
| | | await getAllUser(this.userIdAll).then(res => { |
| | | |
| | | console.log(res) |
| | | for (let i = 0; i < this.messageList.length; i++) { |
| | | for (let j = 0; j < res.length; j++) { |
| | | if (this.messageList[i].userName == res[j].userName) { |
| | | this.messageList[i].remark = res[j].remark |
| | | } |
| | | } |
| | | } |
| | | this.tableData = res |
| | | console.log(this.messageList) |
| | | }) |
| | | }, |
| | | scrollHeight(){ |
| | | let message = document.getElementById('container'); |
| | | message.scrollTop = message.scrollHeight; |
| | | }, |
| | | search() { |
| | | if (this.queryInfo.status == 0) { |
| | |
| | | } |
| | | }, |
| | | seedMessage() { |
| | | |
| | | seed(this.field103, this.groupId).then(async res => { |
| | | this.$message({ |
| | | message: '回复成功', |
| | |
| | | }) |
| | | this.messageList = res |
| | | // console.log(res) |
| | | }) |
| | | |
| | | }) |
| | | this.getAlluserList() |
| | | this.scrollHeight() |
| | | // for (let item of this.messageList) { |
| | | // if (item.pic === '' || item.pic === null) { |
| | | // } else { |
| | |
| | | // } |
| | | |
| | | this.field103 = ''; |
| | | |
| | | } |
| | | ) |
| | | }, |
| | |
| | | * { |
| | | list-style: none; |
| | | } |
| | | |
| | | .groupCommunication{ |
| | | display: flex; |
| | | height: 100%; |
| | | background-color: #fff; |
| | | |
| | | .group-left{ |
| | | width: 300px; |
| | | |
| | | .inputleft{ |
| | | margin-top: 10px; |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | |
| | | .group-right{ |
| | | margin-left: 10px; |
| | | border-left: 1px solid #ccc; |
| | |
| | | font-weight: 900; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .group-right-box{ |
| | | display: flex; |
| | | |
| | | .group-right-left-seach{ |
| | | width: 420px; |
| | | |
| | | .group-right-left-seach-body{ |
| | | display: flex; |
| | | |
| | | } |
| | | |
| | | .group-right-left-seach-body-box{ |
| | | .group-right-left-seach-body-box-ul{ |
| | | .group-right-left-seach-body-box-li{ |
| | | margin-top: 15px; |
| | | |
| | | .group-right-left-seach-body-box-imgmessage{ |
| | | display: flex; |
| | | color: #ccc; |
| | | |
| | | .group-img{ |
| | | width: 25px; |
| | | height: 25px; |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | .group-right-left-seach-body-box-text{ |
| | | margin-left: 35px; |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | .group-right-left-seach-body-box-reply{ |
| | | padding: 10px; |
| | | border: 1px solid #ccc; |
| | | |
| | | ::v-deep .el-textarea__inner{ |
| | | border: none; |
| | | resize: none; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | .group-right-box-ul{ |
| | | border: 1px solid #ccc; |
| | | margin-left: 15px; |
| | | width: 420px; |
| | | overflow: auto; |
| | | |
| | | .group-right-box-ul-title{ |
| | | padding: 0; |
| | | } |
| | | |
| | | .group-right-box-ul-title>li{ |
| | | margin-top: 10px; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .container { |
| | | width: 34%; |
| | | } |
| | |
| | | ::v-deep(.el-table thead) { |
| | | color: #000000; |
| | | } |
| | | |
| | | .activemess{ |
| | | margin-left: 35px; |
| | | color: red; |