From 475958b9c193fc364b6bf25af05a50e59375d643 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期五, 23 十二月 2022 14:52:40 +0800
Subject: [PATCH] feat: 内容提交

---
 src/views/cause/Group.vue |  357 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 355 insertions(+), 2 deletions(-)

diff --git a/src/views/cause/Group.vue b/src/views/cause/Group.vue
index 9e95289..557457b 100644
--- a/src/views/cause/Group.vue
+++ b/src/views/cause/Group.vue
@@ -1,15 +1,368 @@
 <template>
   <div>
-    缇ょ粍浜ゆ祦
+    <el-container style="height: 600px; border: 1px solid #eee">
+      <el-aside width="20%" style="background-color: rgb(238, 241, 246)">
+        <el-input placeholder="璇疯緭鍏�" v-model="filterText" class="inputleft">
+          <!-- <el-button slot="append" icon="el-icon-search" style="width:10px;"  @click="pick"></el-button> -->
+        </el-input>
+
+        <el-tree :data="treeData" :props="treeProps" @node-click="handleNodeClick" :filter-node-method="filterNode"
+          ref="tree"></el-tree>
+      </el-aside>
+
+      <el-container class="container">
+        <el-header style="text-align: left; font-size: 20px;margin-top: 15px">
+          <span>{{ this.groupName }}</span>
+          <el-form :inline="true" :model="queryInfo" class="demo-form-inline">
+            <el-form-item class="select">
+              <el-select v-model="queryInfo.status" placeholder="璇烽�夋嫨">
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item class="input">
+              <el-input placeholder="璇疯緭鍏ユ垚鍛樻垨鍐呭" v-model="queryInfo.select"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="search">鏌ヨ</el-button>
+            </el-form-item>
+          </el-form>
+        </el-header>
+
+        <el-main class="mian1">
+          <ul v-infinite-scroll="load" style="overflow:auto">
+            <li v-for="messageOne in messageList" class="infinite-list-item">
+              <div class="msglist">
+                <img v-if="messageOne.pic!=null&&messageOne.pic!=''" class="face" :src="'http://172.35.1.173:19001/img/'+messageOne.pic">
+                <img v-if="messageOne.pic==null||messageOne.pic==''" class="face" src="../../icons/7bedbaa41b1744fbfe0c55b507fd9e28.png">
+                <div class="name">{{messageOne.userName}} {{messageOne.ctime}}</div>
+                <div class="message">{{messageOne.text}}</div>
+              </div>
+            </li>
+          </ul>
+          <!-- <div class="table">
+            <el-table :data="messageList" :show-header="false">
+              <el-table-column prop="userName">
+              </el-table-column>
+              <el-table-column prop="ctime">
+              </el-table-column>
+              <el-table-column prop="text">
+              </el-table-column>
+            </el-table>
+          </div> -->
+        </el-main>
+      </el-container>
+
+
+      <el-container>
+        <el-header style="height: 0px; margin-top: 0px;">
+        </el-header>
+
+
+
+        <el-container class="container1" direction="horizontal">
+
+
+
+          <el-table class="table1" max-height="360" size:medium :data="groupAnList"
+            style="width: 30%;border: 1px solid #eee;">
+            <el-table-column prop="text" label="缇ゅ叕鍛�" style="color:#000000;">
+            </el-table-column>
+          </el-table>
+          <el-table class="table2" max-height="360" :data="tableData" style="width: 20%;border: 1px solid #eee;">
+            <el-table-column prop="userName" label="缇ゆ垚鍛�">
+
+            </el-table-column>
+            <el-table-column>
+              <template slot="header" slot-scope="scope">
+                <el-button size="small" icon="el-icon-turn-off-microphone" type="primary" @click="allBanSpeech">鍏ㄤ綋绂佽█
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button @click="speech(scope.row.userId, scope.row.banSpeech, scope.row.groupId)" type="text"
+                  size="medium">
+                  <span v-if="scope.row.banSpeech === 1" style="color:#ff0000">宸茬瑷�</span>
+                  <span v-else style="color:#ff0000">绂佽█</span>
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+
+
+        </el-container>
+
+        <el-container class="container2" style="border: 1px solid #eee">
+          <el-header style="text-align:left ; font-size: 15px; height: 10px; width: 100%; margin-top: 10px;">
+            <span>娑堟伅鍥炲</span>
+          </el-header>
+          <el-main class="main5">
+            <el-form ref="elForm" size="medium" label-width="100px">
+              <el-form-item style="margin-bottom: 5px;">
+                <el-input v-model="field103" type="textarea" placeholder="璇疯緭鍏ュ琛屾枃鏈�"
+                  :autosize="{ minRows: 4, maxRows: 8 }" :style="{ width: '100%' }">
+                </el-input>
+              </el-form-item>
+            </el-form>
+            <el-button style="margin-left: 90%;" size="small" type="primary" @click="seedMessage">鎻愪氦</el-button>
+          </el-main>
+        </el-container>
+
+      </el-container>
+    </el-container>
   </div>
 </template>
 
 <script>
+import {
+  getName,
+  getAllMessage,
+  getAllNotice,
+  getAllUser,
+  setBanSpeech,
+  setAllowSpeech,
+  setBanSpeechAll,
+  getGroupMessage,
+  getGroupMessageContext,
+  seed,
+  //saveSubject
+} from '@/api/group'
+import { Message } from 'element-ui';
+
 export default {
-  name: "Group"
+  name: "Group",
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  data() {
+    return {
+      options: [
+        {
+          value: '0',
+          label: '鎴愬憳'
+        },
+        {
+          value: '1',
+          label: '璁板綍'
+        }
+      ],
+      groupName: '缇ょ粍',
+      filterText: '',
+      //缇d
+      groupId: null,
+      //娑堟伅鍒楄〃
+      messageList: [],
+      //缇ゅ叕鍛婂垪琛�
+      groupAnList: [],
+      treeData: [{
+        groupName: '闈掔緤鍖哄叕瀹夊垎灞�缁忎睛澶ч槦',
+        children: [
+        ]
+      }],
+      treeProps: {
+        children: 'children',
+        label: 'groupName'
+      },
+      field103: '',
+      queryInfo: {
+      },
+      input: '',
+      //缇ゆ垚鍛樺垪琛�
+      tableData: [],
+    }
+  },
+  created() {
+    this.init();
+  },
+  methods:
+  {
+    //缇ょ粍鍚嶇О
+    init() {
+      getName().then(
+        res => {
+          this.treeData[0].children = res;
+        }
+      )
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.groupName.indexOf(value) !== -1;
+    },
+    //     pick(){
+    // this.filterNode(this.filterVal,this.data);
+    //     },
+    handleNodeClick(data) {
+      if (data.id != null) {
+        this.groupName = data.groupName;
+        getAllMessage(data.id).then(res => this.messageList = res)
+        getAllNotice(data.id).then(res => this.groupAnList = res)
+        getAllUser(data.id).then(res => this.tableData = res)
+        this.groupId = data.id;
+      }
+    },
+    search() {
+      if (this.queryInfo.status == 0) {
+        getGroupMessage(this.queryInfo, this.groupId).then(res => this.messageList = res)
+      }
+      if (this.queryInfo.status == 1) {
+        getGroupMessageContext(this.queryInfo, this.groupId).then(res => this.messageList = res)
+      }
+    },
+    allBanSpeech() {
+      setBanSpeechAll(this.groupId).then(
+        res => {
+          this.$message({
+            message: '绂佽█鎴愬姛',
+            type: 'success'
+          });
+          getAllUser(this.groupId).then(res => this.tableData = res)
+        }
+      )
+    },
+    speech(val, val2, val3) {
+      if (val2 == 0) {
+        setBanSpeech(val, val3).then(
+          res => {
+            this.$message({
+              message: '绂佽█鎴愬姛',
+              type: 'success'
+            });
+            getAllUser(val3).then(res => this.tableData = res)
+          }
+        )
+
+      }
+      if (val2 == 1) {
+        setAllowSpeech(val, val3).then(
+          res => {
+            this.$message({
+              message: '鍏佽鍙戣█',
+              type: 'success'
+            });
+            getAllUser(val3).then(res => this.tableData = res)
+          }
+        )
+      }
+    },
+    seedMessage() {
+      seed(this.field103, this.groupId).then(res => {
+        this.$message({
+          message: '鍥炲鎴愬姛',
+          type: 'success'
+        });
+        getAllMessage(this.groupId).then(res => this.messageList = res)
+        this.field103 = '';
+      }
+      )
+    },
+  },
+
 }
 </script>
 
 <style scoped>
+* {
+  list-style: none;
+}
 
+.container {
+  width: 34%;
+}
+
+.container1 {
+  width: 98%;
+  height: 60%;
+  margin-top: 8%;
+  margin-left: 2%;
+}
+
+.container2 {
+  width: 100%;
+  height: 30%;
+  margin-top: 2%;
+  margin-left: 2%;
+}
+
+.msglist{
+margin-bottom: 3%;
+}
+.face {
+  float: left;
+  width: 25px;
+  height: 25px;
+  border-radius: 50%;
+}
+
+.name {
+  float: right;
+  margin-right: 43%;
+  color: #7F7F7F;
+  font-size: 14px;
+}
+.message{
+  margin-top: 2%;
+}
+.mian1 {
+  margin-top: 20px;
+}
+
+.mian4 {
+  margin-top: 0px;
+  width: 24%;
+}
+
+.mian2 {
+  width: 38%;
+  margin-top: 0px;
+  margin-right: 2%;
+}
+
+.table1 {
+  width: 360px;
+  margin-top: 0px;
+  margin-right: 2%;
+}
+
+.table2 {
+  margin-top: 0px;
+}
+
+.select {
+  width: 25%;
+}
+
+.table>>>.el-table__row>td {
+  /* 鍘婚櫎琛ㄦ牸绾� */
+  border: none;
+}
+
+.table1>>>.el-table__row>td {
+  /* 鍘婚櫎琛ㄦ牸绾� */
+  border: none;
+}
+
+.table2>>>.el-table__row>td {
+  /* 鍘婚櫎琛ㄦ牸绾� */
+  border: none;
+}
+
+.mian5 {
+  margin-top: 0px;
+  width: 100%;
+  height: 30%;
+}
+
+.input {
+  width: 49%;
+}
+
+.button {
+  margin-right: 50px;
+  size: small;
+}
+
+::v-deep(.el-table thead) {
+  color: #000000;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0