Browse Source

添加社区管理

11wqe1 3 months ago
parent
commit
7f773ff6a3
4 changed files with 1340 additions and 5 deletions
  1. 28 0
      src/api/user.js
  2. BIN
      src/assets/search.png
  3. 657 3
      src/components/organList.vue
  4. 655 2
      src/components/schoolList.vue

+ 28 - 0
src/api/user.js

@@ -23,7 +23,35 @@ export function getUser(data) {
 export function iniPassword(data) {
   return axios.post(`${baseApi}iniPassword`, [data])
 }
+// 添加社区
+export function addCommunity(data) {
+  return axios.post(`${baseApi}addCommunity`, [data])
+}
 
+// 修改社区
+export function updateCommunity(data) {
+  return axios.post(`${baseApi}updateCommunity`, [data])
+}
+// 删除社区
+export function delCommunity(data) {
+  return axios.post(`${baseApi}delCommunity`, [data])
+}
+// 更新社区人员
+export function updateCommunityperson(data) {
+  return axios.post(`${baseApi}updateCommunityperson`, [data])
+}
+// 查询组织高人员
+export function getAddcyPersonlist(data) {
+  return axios.get(`${baseApi}getAddcyPersonlist`, data)
+}
+// 查询社区
+export function getcylist(data) {
+  return axios.get(`${baseApi}getcylist`, data)
+}
+// 查询社区人员
+export function getcypersonlist(data) {
+  return axios.get(`${baseApi}getcypersonlist`, data)
+}
 // 后缀管理 查询学校
 export function getAllSchoolSuffix(data) {
   return axios.get(`${baseApi}getAllSchoolSuffix`, data)

BIN
src/assets/search.png


+ 657 - 3
src/components/organList.vue

@@ -41,7 +41,7 @@
                         <span v-else>{{ scope.row.isLogin }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="操作" width="300px">
+                <el-table-column label="操作" width="380px">
                     <template slot-scope="scope">
                         <div class="operate">
                             <button @click="update(scope.row)">编辑</button>
@@ -53,6 +53,7 @@
                             <button @click="toPage(scope.row)">批量创建</button>
                             <button @click="permissionSetting(scope.row)"
                                 v-show="!unShowJurUser.includes(userid)">权限设置</button>
+                            <button @click="addcommunityL(scope.row)">添加社区</button>
                             <button @click="delete_organ(scope.row)" style="color:red;">删除</button>
 
                         </div>
@@ -241,12 +242,206 @@
                 <el-button type="primary" @click="enable_organ">确认</el-button>
             </div>
         </el-dialog>
+
+        <el-dialog
+            :title="`${cyInfo.name}社区列表`"
+            :visible.sync="dialogcommunity"
+            width="1000px"
+            class="table"
+            :before-close="handleClose">
+            <div class="cyConTit">
+                <div>社区列表</div>
+                <el-button type="primary" size="mini" @click="editCy(0)">添加社区</el-button>
+            </div>
+             <el-table
+                :data="cytableData"
+                style="width: 100%" v-loading="cyloading">
+                <el-table-column
+                    prop="name"
+                    label="名称"
+                    >
+                </el-table-column>
+                 <el-table-column
+                    prop="username"
+                    label="创建人"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="createtime"
+                    label="创建时间"
+                    >
+                </el-table-column>
+                 <el-table-column label="操作" width="200px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button @click="lookCy(scope.row)">添加人员</button>
+                            <button @click="editCy(1,scope.row)">修改</button>
+                            <button @click="delete_Cy(scope.row)" style="color:red;">删除</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
+        <el-dialog
+            title="社区人员"
+            :visible.sync="dialogcyperson"
+            width="1000px"
+            class="table"
+            :before-close="handleClose2">
+            <div class="cyConTit">
+                <div>人员列表</div>
+                <el-button type="primary" size="mini" @click="getTeacher">添加人员</el-button>
+            </div>
+             <el-table
+                :data="cypersontableData"
+                style="width: 100%" v-loading="cypersonloading">
+                <el-table-column
+                    prop="name"
+                    label="名称"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="accountNumber"
+                    label="账号"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="organizationname"
+                    label="学校"
+                    >
+                </el-table-column>
+                <el-table-column label="操作" width="200px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button @click="removeCyperson(scope.row)" style="color:red;">移出</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
+        <el-dialog
+            :title="isedit ?'修改社区':'添加社区'"
+            :visible.sync="dialogcyADD"
+            width="1000px"
+            class="table"
+            :before-close="handleClose2">
+                <form class="el-form">
+                    <!-- 名称 -->
+                    <div class="el-form-item" style="margin-top: 15px">
+                        <label class="el-form-item__label" style="width: 100px">名称</label>
+                        <div class="el-form-item__content" style="margin-left: 5px">
+                            <span>
+                                <div class="add_input el-input el-input--suffix">
+                                    <input v-model="editCyInfo.name" type="text" autocomplete="off" placeholder="社区名称"
+                                        class="el-input__inner" />
+                                </div>
+                            </span>
+                        </div>
+                    </div>
+                    <!-- banner -->
+                    <div class="el-form-item">
+                        <label class="el-form-item__label" style="width: 100px">banner</label>
+                        <div class="el-form-item__content" style="margin-left: 5px">
+                            <el-button type="primary" @click="cyImgAdd">添加</el-button>
+                        </div>
+                    </div>
+                    <div class="el-form-item" v-if="editCyInfo.banner">
+                        <img style="width: 60px;height: 60px;object-fit: cover;" :src="editCyInfo.banner" alt="">                    
+                    </div>
+                   
+                </form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="handleClose2">取 消</el-button>
+                <el-button v-if="isedit == 0" type="primary" @click="AddCy">确定添加</el-button>
+                <el-button v-else type="primary" @click="updateCy">确定修改</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog
+            title="添加社区成员"
+            :visible.sync="dialogaddCyperson"
+            :append-to-body="true"
+            width="25%"
+            height="80%"
+            :close-on-click-modal="false"
+            :before-close="handleClose"
+            class="addNewPP customWidth"
+            >
+            <div class="people">
+            <div class="people_top">
+            <div class="people_top_right">
+                <div class="people_search">
+                <el-input
+                    placeholder="搜索成员名称"
+                    v-model="searchTN"
+                    @keyup.enter.native="getTeacher"
+                ></el-input>
+                <div class="search_img" @click="getTeacher">
+                    <img src="../assets/search.png" alt />
+                </div>
+                </div>
+            </div>
+            <div class="people_nav" style="display: flex; align-items: center">
+                <div class="check_class_left_title">选择成员</div>
+                <div style="display: flex; align-items: center; margin-left: auto">
+                <el-checkbox
+                    v-model="checkAll"
+                    @change="handleCheckAllChange2"
+                    class="all_check"
+                    >全选</el-checkbox
+                >
+                </div>
+            </div>
+            </div>
+            <div class="t_j_box" style="padding: 15px 10px 0;box-sizing: border-box;">
+                <div>姓名</div>
+                <div>账号</div>
+                <div>学校</div>
+            </div>
+            <el-checkbox-group
+                v-model="checkboxList3"
+                class="people_name"
+                @change="handleCheckedCitiesChange"
+                v-if="teacherJuri.length"
+                >
+                <el-checkbox
+                    v-for="item in teacherJuri"
+                    :key="item.userid"
+                    :label="item.userid"
+                >
+                    <div class="t_j_box">
+                        <el-tooltip
+                            placement="top"
+                            :content="item.name ? item.name : '暂无姓名'"
+                        >
+                            <div>{{ item.name ? item.name : "暂无姓名" }}</div>
+                        </el-tooltip>
+                        <el-tooltip placement="top" :content="item.accountNumber.split('@')[0]">
+                            <div>{{ item.accountNumber.split('@')[0] }}</div>
+                        </el-tooltip>
+                        <el-tooltip placement="top" :content="item.organizationname">
+                            <div>{{ item.organizationname }}</div>
+                        </el-tooltip>
+                    </div>
+                </el-checkbox>
+            </el-checkbox-group>
+            <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
+        </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogaddCyperson = false">取 消</el-button>
+                <el-button type="primary" @click="addcyperson">确定</el-button>
+            </span>
+        </el-dialog>
+
         <permissionSettingDialog ref="permissionSettingDialogRef" @getData="getOrgan" />
     </div>
 </template>
 <script>
 import { API_CONFIG } from '@/common/apiConfig';
-import { addOp } from "@/api/user";
+import { addOp,addCommunity,
+    getcylist,updateCommunity,
+    getAddcyPersonlist,updateCommunityperson,
+    getcypersonlist,delCommunity } from "@/api/user";
 import { mapGetters } from 'vuex';
 import permissionSettingDialog from './dialog/permissionSettingDialog'
 export default {
@@ -256,6 +451,44 @@ export default {
     },
     data() {
         return {
+            // 点击组织操作添加社区弹框
+            dialogcommunity:false,
+            // 打开添加信息组织弹框,存储的组织信息
+            cyInfo:[], //组织信息
+            // 社区列表的loading
+            cyloading:false,
+
+            // 社区添加与修改所存储的信息 
+            editCyInfo:{name:'',banner:''},
+            // 添加与修改社区共用一个弹框 0是添加信息 1 修改信息
+            isedit:0,
+            // 添加与修改社区弹框
+            dialogcyADD:false,
+
+
+            //组织社区列表
+            cytableData:[], 
+            // 添加社区人员的组织人员列表
+            teacherJuri:[],
+            //已添加社区人员列表
+            cypersontableData:[],
+            // 添加社区人员列表弹框已选中人员
+            checkboxList3:[], //选中的人员
+            // 添加社区人员列表全选
+            checkAll:false,
+
+
+            // 社区人员列表弹框
+            dialogcyperson:false,
+            // 社区人员列表弹框loading
+            cypersonloading:false,
+
+            // 添加社区成员弹框
+            dialogaddCyperson:false,
+            // 添加社区成员弹框人员搜索框
+            searchTN:'',
+
+
             organizations: [],
             organList: [],
             checkOrg: "",
@@ -687,8 +920,343 @@ export default {
         },
         permissionSetting(data) {
             this.$refs.permissionSettingDialogRef.open(data, "org");
-        }
+        },
+        // 打开添加社区弹框,
+        addcommunityL(val){
+            console.log('val',val);
+            this.cyInfo = val
+            this.getCy()
+            this.dialogcommunity = true
+        },
+        // 打开添加社区获取已添加的社区列表
+        getCy(){
+            this.cyloading = true;
+            let params = {
+				oid: this.cyInfo.id,
+				n: '', //预留搜索框
+				page: 1,
+				num: 10000,
+			};
+			getcylist(params)
+				.then(async (res) => {
+					console.log(res);
+                    this.cytableData = res.data[0]
+                    this.cyloading = false;
+				})
+				.catch((error) => {
+                    this.cyloading = false;
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        // 点击添加社区 0 是添加社区 1是修改社区信息
+        editCy(val,row){
+            console.log('row',row);
+            
+            this.isedit = val
 
+            this.dialogcyADD = true
+            if (val == 1) {
+                this.editCyInfo = row
+            }
+        },
+        // 添加组织社区 
+        AddCy(){
+            if (!this.editCyInfo.name) return this.$message.error('请添加名称')
+            let params = {
+                uid:this.userid,
+                nam: this.editCyInfo.name,
+                oid:this.cyInfo.id,
+                ban: this.editCyInfo.banner,
+            };
+            addCommunity(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `添加了${this.editCyInfo.name}社区`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "添加成功",
+                    });
+                    this.dialogcyADD = false;
+                    this.getCy()
+                    this.editCyInfo = {name:'',banner:''};
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 修改社区信息
+        updateCy(){
+            if (!this.editCyInfo.name) return this.$message.error('请添加名称')
+
+            let params = {
+                idL:this.editCyInfo.id,
+                nam: this.editCyInfo.name,
+                ban: this.editCyInfo.banner,
+            };
+            updateCommunity(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了${this.editCyInfo.name}社区`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "修改成功",
+                    });
+                    this.dialogcyADD = false;
+                    this.getCy()
+                    this.editCyInfo = {name:'',banner:''};
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 删除社区 
+        delete_Cy(val){
+            this.$confirm("确定删除吗?", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+            .then(() => {
+                let params = {
+                    idL:val.id
+                };
+                console.log('params',params);
+                
+                delCommunity(params)
+                .then(async (response) => {
+                        if (response) {
+                        console.log('response',response);
+                        
+                        await addOp({
+                            uid: this.userid,
+                            cid: "",
+                            type: "user_op",
+                            content: `删除了${val.name}社区`,
+                        });
+                        this.$message({
+                            type: "success",
+                            message: "删除成功",
+                        });
+                        this.getCy()
+                    }
+                })
+            })
+            .catch(() => {});
+        },
+        async cyImgAdd(){
+			let _url = await this.uploadFile("image/*");
+            this.editCyInfo.banner = _url
+        },
+
+        // 全选 
+        handleCheckAllChange2(val){
+            this.checkboxList3 = val ? this.teacherJuri.map(e=>e.userid) : [];
+            this.checkAll = val
+            // console.log('this.checkboxList3',this.checkboxList3);
+        },
+        // 单选 
+        handleCheckedCitiesChange(value){
+            let checkedCount = value.length;
+            this.checkAll = checkedCount === this.teacherJuri.length;
+            // console.log('this.checkboxList3',this.checkboxList3);
+
+        },
+        // 添加社区人员 
+        addcyperson(){
+            console.log('ok');
+            let params = {
+                id:this.editCyInfo.id,
+                tea:this.checkboxList3.join(','),
+            };
+            console.log('params',params);
+            
+            updateCommunityperson(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了${this.editCyInfo.name}社区人员`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "修改成功",
+                    });
+                    this.lookCy(this.editCyInfo)
+                    this.dialogaddCyperson = false;
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 移出社区人员 
+        removeCyperson(val){
+            console.log(val);
+            this.$confirm("确定移出吗?", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+            .then(() => {
+
+                let person = this.cypersontableData.filter(e=> e.userid != val.userid).map(e=>e.userid)
+
+                console.log('person',person);
+                
+                let params = {
+                    id:this.editCyInfo.id,
+                    tea: person.join(','),
+                };
+                console.log('params',params);
+                
+                updateCommunityperson(params)
+                .then(async (response) => {
+                        if (response) {
+                        console.log('response',response);
+                        
+                        await addOp({
+                            uid: this.userid,
+                            cid: "",
+                            type: "user_op",
+                            content: `修改了${this.editCyInfo.name}社区${val.userid}人员`,
+                        });
+                        this.$message({
+                            type: "success",
+                            message: "移出成功",
+                        });
+                        this.dialogaddCyperson = false;
+                        this.lookCy(this.editCyInfo)
+                    }
+                })
+            })
+            .catch(() => {});
+        },
+        // 查看社区人员 
+        lookCy(val){
+            this.editCyInfo = val;
+            this.dialogcyperson = true;
+            this.cypersonloading = true;
+            
+            let params = {
+                id: val.id,
+            };
+            
+			getcypersonlist(params)
+				.then(async (res) => {
+					console.log(res);
+                    this.cypersonloading = false;
+                    this.cypersontableData = res.data[0]
+				})
+				.catch((error) => {
+                    this.cypersonloading = false;
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        // 添加社区人员获取人员列表
+        getTeacher() {
+            let params = {
+                oid: this.cyInfo.id,
+                inp: this.searchTN,
+                page: 1,
+                num: 10
+            };
+            
+			getAddcyPersonlist(params)
+				.then(async (res) => {
+					console.log(res);
+
+                    this.teacherJuri = res.data[0];
+                    this.checkboxList3 = this.cypersontableData.map(e=> e.userid)
+                    this.dialogaddCyperson = true
+                  
+				})
+				.catch((error) => {
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        uploadFile(accept = "*") {
+            return new Promise((resolve) => {
+                const input = document.createElement("input");
+                input.type = "file";
+                input.accept = accept;
+                input.onchange = (event) => {
+                    const file = event.target.files[0];
+                    if (file) {
+                        let credentials = {
+                            accessKeyId: "AKIATLPEDU37QV5CHLMH",
+                            secretAccessKey: "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",
+                        }; //秘钥形式的登录上传
+                        window.AWS.config.update(credentials);
+                        window.AWS.config.region = "cn-northwest-1"; //设置区域
+                        let bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+                        // let _name = file.name;
+                        // let size = file.size;
+                        let params = {
+                            Key:
+                                file.name.split(".")[0] +
+                                new Date().getTime() +
+                                "." +
+                                file.name.split(".")[file.name.split(".").length - 1],
+                            ContentType: file.type,
+                            Body: file,
+                            "Access-Control-Allow-Credentials": "*",
+                            ACL: "public-read",
+                        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+                        let options = {
+                            partSize: 2048 * 1024 * 1024,
+                            queueSize: 2,
+                            leavePartsOnError: true,
+                        };
+
+                        bucket
+                            .upload(params, options)
+                            .on("httpUploadProgress", (evt) => {
+                                console.log(evt);
+                            })
+                            .send((err, data) => {
+                                if (err) {
+                                    this.$message.error("上传失败");
+                                    return resolve("");
+                                } else {
+                                    return resolve(data.Location);
+                                }
+                            });
+                    } else {
+                        resolve("");
+                    }
+                };
+                input.click();
+            });
+        },
+        handleClose(done){
+            done();
+        },
+        handleClose2(){
+            this.editCyInfo = ''
+            this.editCyInfo = {name:'',banner:''};
+            this.dialogcyADD=false;
+            this.dialogcyperson = false
+        }
 
     },
     mounted() {
@@ -758,4 +1326,90 @@ export default {
     cursor: pointer;
     color: #308fff;
 }
+.cyConTit{
+    display: flex;
+    justify-content: space-between;
+}
+.addNewPP >>> .el-dialog__body {
+  padding: 5px 20px;
+}
+
+.addNewPP >>> .el-dialog {
+  margin-top: 5vh !important;
+}
+.customWidth >>> .el-dialog {
+  min-width: 500px !important;
+}
+.people {
+  border: 1px solid rgb(229 229 229);
+  /* height: 495px; */
+  height: 350px;
+  border-radius: 5px;
+  width: 100%;
+  overflow: auto;
+}
+.people_top {
+  display: flex;
+  width: 100%;
+  /* justify-content: space-between; */
+  /* align-items: center; */
+  flex-direction: column;
+  padding: 10px 10px 0;
+  box-sizing: border-box;
+}
+.people_top_right {
+  height: 40px;
+  margin-bottom: 10px;
+}
+.people_search {
+  display: flex;
+  position: relative;
+}
+
+.people_search >>> .el-input__inner {
+  /* height: 25px; */
+  width: 100%;
+}
+.search_img {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+  right: 10px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+
+.search_img > img {
+  width: 100%;
+  height: 100%;
+}
+.people_name {
+  display: flex;
+  justify-content: flex-start;
+  padding: 20px 10px;
+  flex-direction: column;
+  flex-wrap: wrap;
+}
+.people_name >>> .el-checkbox {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.people_name >>> .el-checkbox__label {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  width: calc(100%);
+}
+.t_j_box{
+    display: flex;
+    justify-content: space-between;
+}
+.t_j_box div{
+    width: 100px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 </style>

+ 655 - 2
src/components/schoolList.vue

@@ -57,7 +57,7 @@
 						<span v-else>{{ scope.row.isLogin }}</span>
 					</template>
 				</el-table-column>
-				<el-table-column label="操作" width="300px">
+				<el-table-column label="操作" width="380px">
 					<template slot-scope="scope">
 						<div class="operate">
 							<button @click="update(scope.row)">编辑</button>
@@ -69,6 +69,7 @@
 							<button @click="toPage(scope.row)">批量创建</button>
 							<button @click="permissionSetting(scope.row)"
 								v-show="!unShowJurUser.includes(userid)">权限设置</button>
+							<button @click="addcommunityL(scope.row)">添加社区</button>
 							<button @click="delete_school(scope.row)" style="color: red">
 								删除
 							</button>
@@ -316,11 +317,204 @@
 				<el-button type="primary" @click="enable_school">确认</el-button>
 			</div>
 		</el-dialog>
+		
+        <el-dialog
+            :title="`${cyInfo.name}社区列表`"
+            :visible.sync="dialogcommunity"
+            width="1000px"
+            class="table"
+            :before-close="handleClose">
+            <div class="cyConTit">
+                <div>社区列表</div>
+                <el-button type="primary" size="mini" @click="editCy(0)">添加社区</el-button>
+            </div>
+             <el-table
+                :data="cytableData"
+                style="width: 100%" v-loading="cyloading">
+                <el-table-column
+                    prop="name"
+                    label="名称"
+                    >
+                </el-table-column>
+                 <el-table-column
+                    prop="username"
+                    label="创建人"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="createtime"
+                    label="创建时间"
+                    >
+                </el-table-column>
+                 <el-table-column label="操作" width="200px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button @click="lookCy(scope.row)">添加人员</button>
+                            <button @click="editCy(1,scope.row)">修改</button>
+                            <button @click="delete_Cy(scope.row)" style="color:red;">删除</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
+        <el-dialog
+            title="社区人员"
+            :visible.sync="dialogcyperson"
+            width="1000px"
+            class="table"
+            :before-close="handleClose2">
+            <div class="cyConTit">
+                <div>人员列表</div>
+                <el-button type="primary" size="mini" @click="getTeacher">添加人员</el-button>
+            </div>
+             <el-table
+                :data="cypersontableData"
+                style="width: 100%" v-loading="cypersonloading">
+                <el-table-column
+                    prop="name"
+                    label="名称"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="accountNumber"
+                    label="账号"
+                    >
+                </el-table-column>
+                <el-table-column
+                    prop="organizationname"
+                    label="学校"
+                    >
+                </el-table-column>
+                <el-table-column label="操作" width="200px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button @click="removeCyperson(scope.row)" style="color:red;">移出</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
+        <el-dialog
+            :title="isedit ?'修改社区':'添加社区'"
+            :visible.sync="dialogcyADD"
+            width="1000px"
+            class="table"
+            :before-close="handleClose2">
+                <form class="el-form">
+                    <!-- 名称 -->
+                    <div class="el-form-item" style="margin-top: 15px">
+                        <label class="el-form-item__label" style="width: 100px">名称</label>
+                        <div class="el-form-item__content" style="margin-left: 5px">
+                            <span>
+                                <div class="add_input el-input el-input--suffix">
+                                    <input v-model="editCyInfo.name" type="text" autocomplete="off" placeholder="社区名称"
+                                        class="el-input__inner" />
+                                </div>
+                            </span>
+                        </div>
+                    </div>
+                    <!-- banner -->
+                    <div class="el-form-item">
+                        <label class="el-form-item__label" style="width: 100px">banner</label>
+                        <div class="el-form-item__content" style="margin-left: 5px">
+                            <el-button type="primary" @click="cyImgAdd">添加</el-button>
+                        </div>
+                    </div>
+                    <div class="el-form-item" v-if="editCyInfo.banner">
+                        <img style="width: 60px;height: 60px;object-fit: cover;" :src="editCyInfo.banner" alt="">                    
+                    </div>
+                   
+                </form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="handleClose2">取 消</el-button>
+                <el-button v-if="isedit == 0" type="primary" @click="AddCy">确定添加</el-button>
+                <el-button v-else type="primary" @click="updateCy">确定修改</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog
+            title="添加社区成员"
+            :visible.sync="dialogaddCyperson"
+            :append-to-body="true"
+            width="25%"
+            height="80%"
+            :close-on-click-modal="false"
+            :before-close="handleClose"
+            class="addNewPP customWidth"
+            >
+            <div class="people">
+            <div class="people_top">
+            <div class="people_top_right">
+                <div class="people_search">
+                <el-input
+                    placeholder="搜索成员名称"
+                    v-model="searchTN"
+                    @keyup.enter.native="getTeacher"
+                ></el-input>
+                <div class="search_img" @click="getTeacher">
+                    <img src="../assets/search.png" alt />
+                </div>
+                </div>
+            </div>
+            <div class="people_nav" style="display: flex; align-items: center">
+                <div class="check_class_left_title">选择成员</div>
+                <div style="display: flex; align-items: center; margin-left: auto">
+                <el-checkbox
+                    v-model="checkAll"
+                    @change="handleCheckAllChange2"
+                    class="all_check"
+                    >全选</el-checkbox
+                >
+                </div>
+            </div>
+            </div>
+            <div class="t_j_box" style="padding: 15px 10px 0;box-sizing: border-box;">
+                <div>姓名</div>
+                <div>账号</div>
+                <div>学校</div>
+            </div>
+            <el-checkbox-group
+                v-model="checkboxList3"
+                class="people_name"
+                @change="handleCheckedCitiesChange"
+                v-if="teacherJuri.length"
+                >
+                <el-checkbox
+                    v-for="item in teacherJuri"
+                    :key="item.userid"
+                    :label="item.userid"
+                >
+                    <div class="t_j_box">
+                        <el-tooltip
+                            placement="top"
+                            :content="item.name ? item.name : '暂无姓名'"
+                        >
+                            <div>{{ item.name ? item.name : "暂无姓名" }}</div>
+                        </el-tooltip>
+                        <el-tooltip placement="top" :content="item.accountNumber.split('@')[0]">
+                            <div>{{ item.accountNumber.split('@')[0] }}</div>
+                        </el-tooltip>
+                        <el-tooltip placement="top" :content="item.organizationname">
+                            <div>{{ item.organizationname }}</div>
+                        </el-tooltip>
+                    </div>
+                </el-checkbox>
+            </el-checkbox-group>
+            <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
+        </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogaddCyperson = false">取 消</el-button>
+                <el-button type="primary" @click="addcyperson">确定</el-button>
+            </span>
+        </el-dialog>
 		<permissionSettingDialog ref="permissionSettingDialogRef" @getData="getSchool" />
 	</div>
 </template>
 <script>
-import { addOp } from "@/api/user";
+import { addOp,addCommunity,
+    getcylist,updateCommunity,
+    getAddcyPersonlist,updateCommunityperson,
+    getcypersonlist,delCommunity } from "@/api/user";
 import { API_CONFIG } from "@/common/apiConfig";
 import { mapGetters } from "vuex";
 import permissionSettingDialog from "./dialog/permissionSettingDialog";
@@ -331,6 +525,43 @@ export default {
 	},
 	data() {
 		return {
+			// 点击组织操作添加社区弹框
+            dialogcommunity:false,
+            // 打开添加信息组织弹框,存储的组织信息
+            cyInfo:[], //组织信息
+            // 社区列表的loading
+            cyloading:false,
+
+            // 社区添加与修改所存储的信息 
+            editCyInfo:{name:'',banner:''},
+            // 添加与修改社区共用一个弹框 0是添加信息 1 修改信息
+            isedit:0,
+            // 添加与修改社区弹框
+            dialogcyADD:false,
+
+
+            //组织社区列表
+            cytableData:[], 
+            // 添加社区人员的组织人员列表
+            teacherJuri:[],
+            //已添加社区人员列表
+            cypersontableData:[],
+            // 添加社区人员列表弹框已选中人员
+            checkboxList3:[], //选中的人员
+            // 添加社区人员列表全选
+            checkAll:false,
+
+
+            // 社区人员列表弹框
+            dialogcyperson:false,
+            // 社区人员列表弹框loading
+            cypersonloading:false,
+
+            // 添加社区成员弹框
+            dialogaddCyperson:false,
+            // 添加社区成员弹框人员搜索框
+            searchTN:'',
+
 			schoolData: [],
 			schoolList: [],
 			cn_school: [],
@@ -816,6 +1047,342 @@ export default {
 		permissionSetting(data) {
 			this.$refs.permissionSettingDialogRef.open(data, "school");
 		},
+		// 打开添加社区弹框,
+        addcommunityL(val){
+            console.log('val',val);
+            this.cyInfo = val
+            this.getCy()
+            this.dialogcommunity = true
+        },
+        // 打开添加社区获取已添加的社区列表
+        getCy(){
+            this.cyloading = true;
+            let params = {
+				oid: this.cyInfo.id,
+				n: '', //预留搜索框
+				page: 1,
+				num: 10000,
+			};
+			getcylist(params)
+				.then(async (res) => {
+					console.log(res);
+                    this.cytableData = res.data[0]
+                    this.cyloading = false;
+				})
+				.catch((error) => {
+                    this.cyloading = false;
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        // 点击添加社区 0 是添加社区 1是修改社区信息
+        editCy(val,row){
+            console.log('row',row);
+            
+            this.isedit = val
+
+            this.dialogcyADD = true
+            if (val == 1) {
+                this.editCyInfo = row
+            }
+        },
+        // 添加组织社区 
+        AddCy(){
+            if (!this.editCyInfo.name) return this.$message.error('请添加名称')
+            let params = {
+                uid:this.userid,
+                nam: this.editCyInfo.name,
+                oid:this.cyInfo.id,
+                ban: this.editCyInfo.banner,
+            };
+            addCommunity(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `添加了${this.editCyInfo.name}社区`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "添加成功",
+                    });
+                    this.dialogcyADD = false;
+                    this.getCy()
+                    this.editCyInfo = {name:'',banner:''};
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 修改社区信息
+        updateCy(){
+            if (!this.editCyInfo.name) return this.$message.error('请添加名称')
+
+            let params = {
+                idL:this.editCyInfo.id,
+                nam: this.editCyInfo.name,
+                ban: this.editCyInfo.banner,
+            };
+            updateCommunity(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了${this.editCyInfo.name}社区`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "修改成功",
+                    });
+                    this.dialogcyADD = false;
+                    this.getCy()
+                    this.editCyInfo = {name:'',banner:''};
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 删除社区 
+        delete_Cy(val){
+            this.$confirm("确定删除吗?", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+            .then(() => {
+                let params = {
+                    idL:val.id
+                };
+                console.log('params',params);
+                
+                delCommunity(params)
+                .then(async (response) => {
+                        if (response) {
+                        console.log('response',response);
+                        
+                        await addOp({
+                            uid: this.userid,
+                            cid: "",
+                            type: "user_op",
+                            content: `删除了${val.name}社区`,
+                        });
+                        this.$message({
+                            type: "success",
+                            message: "删除成功",
+                        });
+                        this.getCy()
+                    }
+                })
+            })
+            .catch(() => {});
+        },
+        async cyImgAdd(){
+			let _url = await this.uploadFile("image/*");
+            this.editCyInfo.banner = _url
+        },
+
+        // 全选 
+        handleCheckAllChange2(val){
+            this.checkboxList3 = val ? this.teacherJuri.map(e=>e.userid) : [];
+            this.checkAll = val
+            // console.log('this.checkboxList3',this.checkboxList3);
+        },
+        // 单选 
+        handleCheckedCitiesChange(value){
+            let checkedCount = value.length;
+            this.checkAll = checkedCount === this.teacherJuri.length;
+            // console.log('this.checkboxList3',this.checkboxList3);
+
+        },
+        // 添加社区人员 
+        addcyperson(){
+            console.log('ok');
+            let params = {
+                id:this.editCyInfo.id,
+                tea:this.checkboxList3.join(','),
+            };
+            console.log('params',params);
+            
+            updateCommunityperson(params)
+              .then(async (response) => {
+                    if (response) {
+                    console.log('response',response);
+                    
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了${this.editCyInfo.name}社区人员`,
+                    });
+                    this.$message({
+                        type: "success",
+                        message: "修改成功",
+                    });
+                    this.lookCy(this.editCyInfo)
+                    this.dialogaddCyperson = false;
+                }
+              })
+              .catch((error) => {
+                console.error("请求失败,错误信息:", error);
+              });
+        },
+        // 移出社区人员 
+        removeCyperson(val){
+            console.log(val);
+            this.$confirm("确定移出吗?", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+            .then(() => {
+
+                let person = this.cypersontableData.filter(e=> e.userid != val.userid).map(e=>e.userid)
+
+                console.log('person',person);
+                
+                let params = {
+                    id:this.editCyInfo.id,
+                    tea: person.join(','),
+                };
+                console.log('params',params);
+                
+                updateCommunityperson(params)
+                .then(async (response) => {
+                        if (response) {
+                        console.log('response',response);
+                        
+                        await addOp({
+                            uid: this.userid,
+                            cid: "",
+                            type: "user_op",
+                            content: `移出了${this.editCyInfo.name}社区${val.userid}人员`,
+                        });
+                        this.$message({
+                            type: "success",
+                            message: "移出成功",
+                        });
+                        this.dialogaddCyperson = false;
+                        this.lookCy(this.editCyInfo)
+                    }
+                })
+            })
+            .catch(() => {});
+        },
+        // 查看社区人员 
+        lookCy(val){
+            this.editCyInfo = val;
+            this.dialogcyperson = true;
+            this.cypersonloading = true;
+            
+            let params = {
+                id: val.id,
+            };
+            
+			getcypersonlist(params)
+				.then(async (res) => {
+					console.log(res);
+                    this.cypersonloading = false;
+                    this.cypersontableData = res.data[0]
+				})
+				.catch((error) => {
+                    this.cypersonloading = false;
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        // 添加社区人员获取人员列表
+        getTeacher() {
+            let params = {
+                oid: this.cyInfo.org ? this.cyInfo.org : this.cyInfo.id,
+                inp: this.searchTN,
+                page: 1,
+                num: 10
+            };
+            
+			getAddcyPersonlist(params)
+				.then(async (res) => {
+					console.log(res);
+
+                    this.teacherJuri = res.data[0];
+                    this.checkboxList3 = this.cypersontableData.map(e=> e.userid)
+                    this.dialogaddCyperson = true
+                  
+				})
+				.catch((error) => {
+					console.error("请求失败,错误信息:", error);
+				});
+        },
+        uploadFile(accept = "*") {
+            return new Promise((resolve) => {
+                const input = document.createElement("input");
+                input.type = "file";
+                input.accept = accept;
+                input.onchange = (event) => {
+                    const file = event.target.files[0];
+                    if (file) {
+                        let credentials = {
+                            accessKeyId: "AKIATLPEDU37QV5CHLMH",
+                            secretAccessKey: "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",
+                        }; //秘钥形式的登录上传
+                        window.AWS.config.update(credentials);
+                        window.AWS.config.region = "cn-northwest-1"; //设置区域
+                        let bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+                        // let _name = file.name;
+                        // let size = file.size;
+                        let params = {
+                            Key:
+                                file.name.split(".")[0] +
+                                new Date().getTime() +
+                                "." +
+                                file.name.split(".")[file.name.split(".").length - 1],
+                            ContentType: file.type,
+                            Body: file,
+                            "Access-Control-Allow-Credentials": "*",
+                            ACL: "public-read",
+                        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+                        let options = {
+                            partSize: 2048 * 1024 * 1024,
+                            queueSize: 2,
+                            leavePartsOnError: true,
+                        };
+
+                        bucket
+                            .upload(params, options)
+                            .on("httpUploadProgress", (evt) => {
+                                console.log(evt);
+                            })
+                            .send((err, data) => {
+                                if (err) {
+                                    this.$message.error("上传失败");
+                                    return resolve("");
+                                } else {
+                                    return resolve(data.Location);
+                                }
+                            });
+                    } else {
+                        resolve("");
+                    }
+                };
+                input.click();
+            });
+        },
+        handleClose(done){
+            done();
+        },
+        handleClose2(){
+            this.editCyInfo = ''
+            this.editCyInfo = {name:'',banner:''};
+            this.dialogcyADD=false;
+            this.dialogcyperson = false
+        }
 	},
 	mounted() {
 		this.getSchool();
@@ -891,4 +1458,90 @@ export default {
 	cursor: pointer;
 	color: #308fff;
 }
+.cyConTit{
+    display: flex;
+    justify-content: space-between;
+}
+.addNewPP >>> .el-dialog__body {
+  padding: 5px 20px;
+}
+
+.addNewPP >>> .el-dialog {
+  margin-top: 5vh !important;
+}
+.customWidth >>> .el-dialog {
+  min-width: 500px !important;
+}
+.people {
+  border: 1px solid rgb(229 229 229);
+  /* height: 495px; */
+  height: 350px;
+  border-radius: 5px;
+  width: 100%;
+  overflow: auto;
+}
+.people_top {
+  display: flex;
+  width: 100%;
+  /* justify-content: space-between; */
+  /* align-items: center; */
+  flex-direction: column;
+  padding: 10px 10px 0;
+  box-sizing: border-box;
+}
+.people_top_right {
+  height: 40px;
+  margin-bottom: 10px;
+}
+.people_search {
+  display: flex;
+  position: relative;
+}
+
+.people_search >>> .el-input__inner {
+  /* height: 25px; */
+  width: 100%;
+}
+.search_img {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+  right: 10px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+
+.search_img > img {
+  width: 100%;
+  height: 100%;
+}
+.people_name {
+  display: flex;
+  justify-content: flex-start;
+  padding: 20px 10px;
+  flex-direction: column;
+  flex-wrap: wrap;
+}
+.people_name >>> .el-checkbox {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.people_name >>> .el-checkbox__label {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  width: calc(100%);
+}
+.t_j_box{
+    display: flex;
+    justify-content: space-between;
+}
+.t_j_box div{
+    width: 100px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 </style>