Browse Source

首页大屏开发-修改2超级管理员-bug修复

周玉佂 6 months ago
parent
commit
109b6f4589

+ 2 - 2
src/components/echarts/IndexSmallPieS.vue

@@ -60,7 +60,7 @@ export default {
                 // percentage = dataCake[i].percentage
               }
             }
-            let arr = [name + ' ', " " + target + "%",]
+            let arr = [name + ' ', " " + target + "",]
             return arr.join(" ")
 
           },
@@ -81,7 +81,7 @@ export default {
                 // {a}指series.name  {b}指series.data的name
                 // {c}指series.data的value  {d}%指这一部分占总数的百分比
                 // formatter: '{b}'
-                formatter: ''
+                formatter: '{d}%'
               }
             },
             emphasis: {

+ 2 - 0
src/components/manage/main/AdminHome.vue

@@ -349,6 +349,8 @@ export default {
     riskChangeChart() {
       return new Promise((resolve, reject) => {
         this.$http.get(`/index/riskChangeChart?institutionNo=${this.institutionNo}`, {}, (res) => {
+          console.log(res,'=====================================res教育局');
+          
           resolve(res.data)
         })
       })

+ 43 - 33
src/components/manage/main/AdminHomeS.vue

@@ -26,10 +26,10 @@
       </div>
       <div class="EvaluationR">
         <div class="EvaluationR1">
+          <div style="position: absolute;left: 530px;top: 75px;">
+            <IndexSmallTitle title="综合数据" />
+          </div>
           <div class="EvaluationR11">
-            <div style="margin-top: -20px;margin-left: -10px;">
-              <IndexSmallTitle title="综合数据" />
-            </div>
             <p class="a">总测评次数</p>
             <p class="b">{{ allTestNum }}</p>
           </div>
@@ -71,8 +71,6 @@
               <el-table :data="scaleListasks" size="small" style="width: 100%" :height="tableHeight">
                 <el-table-column align="center" prop="name" label="测试名称">
                 </el-table-column>
-                <!-- <el-table-column align="center" prop="name" label="测试时间">
-                </el-table-column> -->
                 <el-table-column align="center" prop="count" label="测试人数">
                 </el-table-column>
               </el-table>
@@ -170,7 +168,7 @@ export default {
         xData: ['高风险', '无风险'],
         yData: [100, 10]
       },
-      riskLevelDataS: 65,
+      riskLevelDataS: 0,
       scaleList: [], // 量表
       scaleListasks: [], // 量表和认知任务
       cognitiveTaskList: [], // 认知任务
@@ -186,7 +184,7 @@ export default {
   async mounted() {
     let tempDom = document.querySelector('#bottomTableOutline')
     this.$nextTick(() => {
-      this.tableHeight = tempDom.offsetHeight - 82
+      this.tableHeight = tempDom.offsetHeight - 170
       this.$forceUpdate()
     })
 
@@ -206,7 +204,7 @@ export default {
     }
     let riskLevelDataSList = await this.finishInstitutionNum()
     console.log(riskLevelDataSList, '========================>riskLevelDataSList');
-    this.riskLevelDataS = riskLevelDataSList[0].value
+    this.riskLevelDataS = riskLevelDataSList[0].value * 100
     // this.riskLevelDataS = 66
     console.log(this.riskLevelDataS, '============>this.riskLevelDataS');
 
@@ -229,8 +227,8 @@ export default {
     }
     this.dynamicData = {
       xData: xData,
-      yData: [userCount,testCount],
-      names: ['参与人数','测评次数']
+      yData: [userCount, testCount],
+      names: ['参与人数', '测评次数']
     }
     this.scaleListasks = await this.Scalesandtasks()
 
@@ -265,7 +263,7 @@ export default {
     getAllTestNum() {
       return new Promise((resolve, reject) => {
         this.$http.get(`/index/allTestNum?institutionNo=${this.institutionNo}`, {}, (res) => {
-          console.log(res,'==================>allTestNum');
+          console.log(res, '==================>allTestNum');
           resolve(res.data.allTestNum)
         })
       })
@@ -275,8 +273,8 @@ export default {
     getAllUserNum() {
       return new Promise((resolve, reject) => {
         this.$http.get(`/index/allUserNum?institutionNo=${this.institutionNo}`, {}, (res) => {
-          console.log(res,'==================>allUserNum');
-          
+          console.log(res, '==================>allUserNum');
+
           resolve(res.data.allUserNum)
         })
       })
@@ -304,7 +302,7 @@ export default {
     finishInstitutionNum() {
       return new Promise((resolve, reject) => {
         this.$http.get(`/index/finishInstitutionNum?institutionNo=${this.institutionNo}`, {}, (res) => {
-          console.log(res,'=====================>resklk');
+          console.log(res, '=====================>resklk');
           resolve(res.data.map((item) => {
             return {
               name: item.institution_name,
@@ -462,7 +460,7 @@ export default {
     // @media screen and (min-width:1920px){
     .Evaluation {
       width: 500px;
-      height: calc(100% - 56px);
+      height: calc(100% - 20px);
       flex-direction: column;
       // padding: 10px 1px 30px 25px;
       // margin-top: 10px;
@@ -470,11 +468,12 @@ export default {
 
       .Evaluation1 {
         margin-top: 10px;
-        width: 100%;
-        height: calc(49% + 20px);
+        min-width: 100%;
+        height: calc(49%);
         // padding: 10px 0 0 10px;
         background: #FFFFFF;
         border-radius: 8px;
+        overflow: hidden;
 
         .IndexBarSty {
           margin-top: 20px;
@@ -484,29 +483,31 @@ export default {
 
       .Evaluation2 {
         margin-top: 12px;
-        width: 100%;
+        min-width: 100%;
         // padding: 10px 0 0 10px;
-        height: calc(49% + 17px);
+        height: calc(49%);
         background: #FFFFFF;
         border-radius: 8px;
-
       }
     }
 
     .EvaluationR {
+      overflow: hidden;
       // width: calc(66%);
-      height: calc(100% - 56px);
+      height: calc(100% - 14px);
       flex: 1;
       display: flex;
       flex-direction: column;
+      padding-bottom: 10px;
       // padding: 10px 21px 30px 40px;
       // margin-top: 10px;
       // margin-left: 10px;
 
       .EvaluationR1 {
+        overflow: hidden;
         margin-top: 10px;
         margin-left: 10px;
-        width: calc(100% - 21px);
+        min-width: calc(100% - 21px);
         height: 25%;
         // padding: 10px 0 0 10px;
         background: #FFFFFF;
@@ -516,7 +517,8 @@ export default {
         justify-content: space-around;
 
         .EvaluationR11 {
-          width: 30%;
+          overflow: hidden;
+          min-width: 30%;
           height: calc(100% - 21px);
           // margin-left: -135px;
           margin-top: 27px;
@@ -526,7 +528,7 @@ export default {
           background-position: center;
 
           .a {
-            margin-top: 20px;
+            margin-top: 35px;
             margin-left: 21px;
             font-size: 20px;
           }
@@ -542,7 +544,8 @@ export default {
         }
 
         .EvaluationR12 {
-          width: 30%;
+          overflow: hidden;
+          min-width: 30%;
           height: calc(100% - 21px);
           margin-top: 27px;
           background-image: url('/static/assets/index/bg-cp2.png');
@@ -551,7 +554,7 @@ export default {
           background-position: center;
 
           .a {
-            margin-top: 30px;
+            margin-top: 35px;
             margin-left: 21px;
             font-size: 20px;
           }
@@ -567,7 +570,8 @@ export default {
         }
 
         .EvaluationR13 {
-          width: 30%;
+          overflow: hidden;
+          min-width: 30%;
           margin-top: 27px;
           height: calc(100% - 21px);
           background-image: url('/static/assets/index/bg-cp3.png');
@@ -576,7 +580,7 @@ export default {
           background-position: center;
 
           .a {
-            margin-top: 30px;
+            margin-top: 35px;
             margin-left: 21px;
             font-size: 20px;
           }
@@ -593,6 +597,7 @@ export default {
       }
 
       .EvaluationR2 {
+        overflow: hidden;
         width: calc(100% - 10px);
         margin-top: 10px;
         margin-left: 5px;
@@ -602,7 +607,8 @@ export default {
         justify-content: space-around;
 
         .EvaluationR21 {
-          width: calc(48% + 10px);
+          overflow: hidden;
+          width: calc(48% + 15px);
           height: calc(100%);
           // padding: 10px 0 0 10px;
           background: #FFFFFF;
@@ -615,7 +621,8 @@ export default {
         }
 
         .EvaluationR22 {
-          width: calc(48% + 10px);
+          overflow: hidden;
+          width: calc(48% + 15px);
           height: calc(100%);
           // padding: 10px 0 0 10px;
           background: #FFFFFF;
@@ -632,23 +639,26 @@ export default {
       }
 
       .EvaluationR3 {
-        width: calc(100% - 20px);
+        overflow: hidden;
+        width: calc(100% - 10px);
         height: calc(35%);
         margin-top: 10px;
-        margin-left: 10px;
+        margin-left: 5px;
         display: flex;
         flex-direction: row;
         justify-content: space-around;
 
         .EvaluationR31 {
+          overflow: hidden;
           width: calc(48% + 15px);
-          height: calc(100% + 44px);
+          height: calc(100% + 84px);
           // padding: 10px 0 0 10px;
           background: #FFFFFF;
           border-radius: 8px;
         }
 
         .EvaluationR32 {
+          overflow: hidden;
           width: calc(48% + 15px);
           height: calc(100% + 44px);
           // padding: 10px 0 0 10px;

+ 5 - 3
src/components/manage/main/CognitiveTaskUserList.vue

@@ -156,7 +156,9 @@ export default {
         "&endTime=" +
         this.endTime +
         "&groupId=" +
-        this.groupValue,
+        this.groupValue +
+        "&userId=" +
+        this.userId,
         {},
 
         (response) => {
@@ -269,7 +271,7 @@ export default {
     // 全部下载
     downloadAll() {
       window.open(
-        `${this.baseUrl}result/download/allUserReds?institutionNo=${this.institutionNo}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`,
+        `${this.baseUrl}result/download/allUserReds?institutionNo=${this.institutionNo}&name=${this.name}&userId=${this.userId}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`,
         "_blank"
       );
     },
@@ -284,7 +286,7 @@ export default {
           this.baseUrl +
           `result/download/planResultBatch?institutionNo=${this.institutionNo}&ids=${str.substring(0, str.length - 1)}&name=${this.name}`;
       } else {
-        window.location.href = `${this.baseUrl}result/download/planResultAll?institutionNo=${this.institutionNo}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
+        window.location.href = `${this.baseUrl}result/download/planResultAll?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
       }
     },
   },

+ 6 - 4
src/components/manage/main/SacleUserList.vue

@@ -256,7 +256,9 @@ export default {
           "&endTime=" +
           this.endTime +
           "&groupId=" +
-          this.groupValue,
+          this.groupValue + 
+          "&userId=" +
+          this.userId,
         {},
         (response) => {
           this.total = response.data.allNum;
@@ -332,7 +334,7 @@ export default {
 
     // 全部下载
     downloadAll() {
-      window.location.href = `${this.baseUrl}result/download/allUserReds?institutionNo=${this.institutionNo}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
+      window.location.href = `${this.baseUrl}result/download/allUserReds?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
       // this.multipleSelection = val;
     },
 
@@ -348,7 +350,7 @@ export default {
             this.institutionNo
           }&ids=${str.substring(0, str.length - 1)}&name=${this.name}`;
       } else {
-        window.location.href = `${this.baseUrl}result/download/planResultAll?institutionNo=${this.institutionNo}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
+        window.location.href = `${this.baseUrl}result/download/planResultAll?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
       }
     },
     downloadPDF(i) {
@@ -363,7 +365,7 @@ export default {
                 this.institutionNo
             }&ids=${str.substring(0, str.length - 1)}`;
       } else {
-        window.location.href = `${this.baseUrl}result/download/allUserPDFReds?institutionNo=${this.institutionNo}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}`;
+        window.location.href = `${this.baseUrl}result/download/allUserPDFReds?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}`;
       }
     }
   },

+ 52 - 117
src/components/manage/main/SignatureManage.vue

@@ -1,30 +1,18 @@
 <template>
   <div>
     <el-breadcrumb separator="/">
-      <el-breadcrumb-item :to="{ path: '#' }" class="top-crumbs"
-        >用户管理</el-breadcrumb-item
-      >
+      <el-breadcrumb-item :to="{ path: '#' }" class="top-crumbs">用户管理</el-breadcrumb-item>
     </el-breadcrumb>
     <!-- <el-divider content-position="right"></el-divider> -->
     <!-- <el-divider content-position="left">用户管理</el-divider> -->
     <el-row>
       <el-col :span="24">
-        <el-form
-          :inline="true"
-          :model="formInline"
-          class="demo-form-inline search-center"
-        >
+        <el-form :inline="true" :model="formInline" class="demo-form-inline search-center">
           <el-form-item label="请输入名称">
-            <el-input
-              v-model="searchKey"
-              placeholder="输入名字搜索"
-              @keyup.enter.native="onSubmit"
-            ></el-input>
+            <el-input v-model="searchKey" placeholder="输入名字搜索" @keyup.enter.native="onSubmit"></el-input>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" icon="el-icon-search" @click="onSubmit"
-              >搜索</el-button
-            >
+            <el-button type="primary" icon="el-icon-search" @click="onSubmit">搜索</el-button>
           </el-form-item>
           <!-- <el-form-item style="float: right;">
 											<el-button type="primary" @click="addSingleUser()" >添加用户<i class="el-icon-upload el-icon--right"></i></el-button>
@@ -32,50 +20,18 @@
         </el-form>
       </el-col>
     </el-row>
-    <el-table
-      :data="tableData"
-      border
-      style="width: 100%"
-      class="table-padding"
-    >
-      <el-table-column
-        prop="petName"
-        label="用户名称"
-        width="auto"
-        align="center"
-      >
+    <el-table :data="tableData" border style="width: 100%" class="table-padding">
+      <el-table-column prop="petName" label="用户名称" width="auto" align="center">
       </el-table-column>
       <el-table-column prop="phone" label="手机号" width="auto" align="center">
       </el-table-column>
-      <el-table-column
-        prop="gender"
-        label="性别"
-        width="auto"
-        align="center"
-        :formatter="sexFormat"
-      >
+      <el-table-column prop="gender" label="性别" width="auto" align="center" :formatter="sexFormat">
       </el-table-column>
-      <el-table-column
-        prop="institutionName"
-        label="所属学校"
-        width="auto"
-        align="center"
-      >
+      <el-table-column prop="institutionName" label="所属学校" width="auto" align="center">
       </el-table-column>
-      <el-table-column
-        prop="profession"
-        label="职业"
-        width="auto"
-        align="center"
-      >
+      <el-table-column prop="profession" label="职业" width="auto" align="center">
       </el-table-column>
-      <el-table-column
-        prop="userStatus"
-        label="用户状态"
-        width="auto"
-        align="center"
-        :formatter="statusFormat"
-      >
+      <el-table-column prop="userStatus" label="用户状态" width="auto" align="center" :formatter="statusFormat">
       </el-table-column>
       <el-table-column label="操作" width="auto" align="center">
         <template slot-scope="scope">
@@ -88,52 +44,26 @@
 					>
 						<el-button slot="reference" type="text" @click="deleteUser(scope.$index,scope.row)"  class="button-table-font">删除</el-button>
 					</el-popconfirm> -->
-          <el-button
-            type="text"
-            v-if="scope.row.userStatus == '1'"
-            size="small"
-            @click="editUser(scope.row)"
-            >审核通过</el-button
-          >
+          <el-button type="text" v-if="scope.row.userStatus == '1'" size="small"
+            @click="editUser(scope.row)">审核通过</el-button>
         </template>
       </el-table-column>
     </el-table>
     <div class="block">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-      >
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
       </el-pagination>
     </div>
-    <el-dialog
-      :title="addUserEditFlag"
-      :visible.sync="addUser"
-      width="40%"
-      center
-      :close-on-click-modal="false"
-    >
+    <el-dialog :title="addUserEditFlag" :visible.sync="addUser" width="40%" center :close-on-click-modal="false">
       <el-row :gutter="24">
         <el-col :span="24">
-          <el-form
-            :inline="true"
-            :model="ruleForm"
-            label-position="left"
-            :rules="rules"
-            ref="ruleForm"
-            class="demo-form-inline demo-ruleForm"
-          >
+          <el-form :inline="true" :model="ruleForm" label-position="left" :rules="rules" ref="ruleForm"
+            class="demo-form-inline demo-ruleForm">
             <el-row :gutter="24">
               <el-col :span="12">
                 <el-form-item label="签字" prop="signature">
-                  <el-input
-                    v-model="ruleForm.signature"
-                    placeholder="签字"
-                  ></el-input>
+                  <el-input v-model="ruleForm.signature" placeholder="签字"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -148,13 +78,8 @@
             <!-- <el-row :gutter="24">
 							<el-col :span="12"> -->
             <el-form-item label="请选择签名照" prop="signature">
-              <el-upload
-                class="avatar-uploader"
-                action="https://jsonplaceholder.typicode.com/posts/"
-                :show-file-list="false"
-                :on-success="handleAvatarSuccess"
-                :before-upload="beforeAvatarUpload"
-              >
+              <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
+                :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
                 <img v-if="imageUrl" :src="imageUrl" class="avatar" />
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
@@ -166,21 +91,25 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
         <el-row :gutter="20">
-          <el-col :span="2"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="6"
-            ><div class="grid-content bg-purple">
-              <el-button type="primary" @click="addUser = false"
-                >确 定</el-button
-              >
-            </div></el-col
-          >
-          <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="6"
-            ><div class="grid-content bg-purple">
+          <el-col :span="2">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="6">
+            <div class="grid-content bg-purple">
+              <el-button type="primary" @click="addUser = false">确 定</el-button>
+            </div>
+          </el-col>
+          <el-col :span="4">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="4">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="6">
+            <div class="grid-content bg-purple">
               <el-button @click="addUser = false">取 消</el-button>
-            </div></el-col
-          >
+            </div>
+          </el-col>
         </el-row>
       </span>
     </el-dialog>
@@ -201,6 +130,7 @@ export default {
         user: "",
         region: "",
       },
+      createUserId: '',
       ruleForm: {
         signature: "", //签字
         type: "", //签名类型
@@ -220,6 +150,9 @@ export default {
   },
   created() {
     this.getData();
+    this.createUserId = sessionStorage.getItem(
+      "b80bb7740288fda1f201890375a60c8f"
+    );
   },
   methods: {
     sexFormat(row) {
@@ -273,7 +206,7 @@ export default {
     // 	this.ruleForm=[];
     // },
     //删除用户
-    deleteUser() {},
+    deleteUser() { },
     handleAvatarSuccess(res, file) {
       this.imageUrl = URL.createObjectURL(file.raw);
     },
@@ -292,12 +225,14 @@ export default {
     getData() {
       this.$http.get(
         "/user/getUserListByInstitutionNo?institutionNo=ZZU&searchKey=" +
-          this.searchKey +
-          "&pageNum=" +
-          this.currentPage +
-          "&pageSize=" +
-          this.pageSize +
-          "",
+        this.searchKey +
+        "&pageNum=" +
+        this.currentPage +
+        "&pageSize=" +
+        this.pageSize +
+        "&userId=" +
+        this.createUserId +
+        "",
         {},
         (response) => {
           console.log(response);

+ 186 - 55
src/components/manage/main/UserGroupManagement.vue

@@ -23,7 +23,7 @@
                 </div>-->
       </div>
       <div>
-        <el-button type="primary" icon="el-icon-plus" @click="dialogVisibleopen">
+        <el-button type="primary" icon="el-icon-plus" @click="dialogVisibleopen('add')">
           添加年级
         </el-button>
       </div>
@@ -39,7 +39,8 @@
           </el-button>
           <!-- <el-button type="text" @click="open">点击打开 Message Box</el-button>-->
           <el-button v-if="scope.row.groupName != '默认年级'" type="primary" size="small"
-            @click="updateGroupName(scope.row)">
+            @click="dialogVisibleopen('update', scope.row)">
+            <!-- dialogVisibleopen('add') -->
             更新组名
           </el-button>
           <el-button type="primary" size="small" @click="getGroupUserList(scope.row)">
@@ -53,27 +54,51 @@
     </el-table>
     <!--记录展示end-->
 
-    <el-dialog title="添加年级" :visible.sync="dialogVisible" width="680px" :before-close="handleClose">
-      <!-- <el-row>
-        <span style="margin-left: 15px;">请选择角色:</span>
-        <el-select v-model="groupUser" multiple placeholder="请选择">
-          <el-option v-for="item in optionsgroupUserList" :key="item.id" :label="item.petName" :value="item.id">
-          </el-option>
-        </el-select>
-      </el-row> -->
-      <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
-      <div style="margin: 15px 0;"></div>
-      <el-checkbox-group v-model="checkedGrades" @change="handleCheckedCitiesChange">
-        <el-checkbox v-for="grade in gradeOptions" :label="grade" :key="grade">
-          {{ grade }}
-        </el-checkbox>
-      </el-checkbox-group>
-
+    <el-dialog :title="title" :visible.sync="dialogVisible" width="680px" :before-close="handleClose">
+      <div v-if="fals === 'add'">
+        <el-row>
+          <span style="margin-left: 15px;">请选择角色:</span>
+          <el-select v-model="groupUser" multiple placeholder="请选择">
+            <el-option v-for="item in optionsgroupUserList" :key="item.id" :label="item.petName" :value="item.id">
+            </el-option>
+          </el-select>
+        </el-row>
+        <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
+        <div style="margin: 15px 0;"></div>
+        <el-checkbox-group v-model="checkedGrades" @change="handleCheckedCitiesChange">
+          <el-checkbox v-for="grade in gradeOptions" :label="grade" :key="grade">
+            {{ grade }}
+          </el-checkbox>
+        </el-checkbox-group>
+      </div>
+      <div v-else>
+        <el-form ref="formName" :rules="rules" :model="form" label-width="220px">
+          <el-form-item label="请选择角色:" prop="groupUser">
+            <el-select style="width: 260px;" v-model="form.groupUser" multiple placeholder="请选择">
+              <el-option v-for="item in optionsgroupUserList" :key="item.id" :label="item.petName" :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="新的组名:">
+            <el-select style="width: 260px;" v-model="form.name" placeholder="请选择">
+              <el-option v-for="item in gradeOptions" :key="item.id" :label="item" :value="item">
+              </el-option>
+            </el-select>
+            <!-- <el-input style="width: 260px;" v-model="form.name"></el-input> -->
+          </el-form-item>
+        </el-form>
+      </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="handleClose">取 消</el-button>
-        <el-button v-loading="loading" :disabled="loading" type="primary" @click="creatGroupBatch">
+
+        <el-button v-if="fals === 'add'" v-loading="loading" :disabled="loading" type="primary"
+          @click="creatGroupBatch">
+          确 定
+        </el-button>
+        <el-button v-else v-loading="loading" :disabled="loading" type="primary" @click="updateGroupName">
           确 定
         </el-button>
+        <!--  -->
       </span>
     </el-dialog>
   </div>
@@ -92,8 +117,19 @@ export default {
       checkAll: false,
       gradeOptions: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '七年级', '八年级', '九年级', '高一年级', '高二年级', '高三年级'],
       checkedGrades: [],
+      title: '添加年级',
       vser: '',
-      createUserId:'',
+      fals: '',
+      form: {
+        groupUser: [],
+        name: ''
+      },
+      rules: {
+        groupUser: [{ required: true, message: '请选择', trigger: 'change' }]
+      },
+      dialogVisibleData: {},
+      dialogVisibleDatas: {},
+      createUserId: '',
       optionsgroupUserList: [],
       dialogVisible: false,
       loading: false
@@ -114,11 +150,46 @@ export default {
   },
   methods: {
     // 打开添加年级模态框
-    dialogVisibleopen() {
+    dialogVisibleopen(fal, data) {
+      this.fals = fal
+      this.dialogVisibleDatas = data;
+      // this.dialogVisibleData = data
+      // console.log(this.dialogVisibleData, 'this.dialogVisibleData');
       this.dialogVisible = true
-      console.log(this.vser, '========================>this.vser');
-      // this.groupUser = [this.vser]
-      this.groupUser = []
+      if (fal === 'add') {
+        this.groupUser = []
+      } else {
+        // this.optionsgroupUserList
+        console.log(data, '==========>data');
+        // this.form = {
+        //   groupUser: ["402881459192b5ec019192bc97dd0002"],
+        //   name: data.groupName
+        // }
+        // userId
+        this.getDatas()
+        this.title = '更新组名'
+        this.$http.get(
+          // "/group/find?institutionNo=" + this.institutionNo,
+          `/group/findGroupUser?groupId=${data.id}&userId=${this.createUserId}`,
+          {},
+          (response) => {
+            // this.tableData = response.data;
+            this.dialogVisibleData = response.data;
+            console.log(response);
+            let groupUser = response.data.map(item => {
+              return item.userId
+            })
+            console.log(groupUser, '=================>groupUser');
+
+            this.form = {
+              groupUser: groupUser,
+              name: data.groupName
+            }
+            // console.log(response.data)
+          }
+        )
+      }
+
     },
     getData() {
       this.$http.get(
@@ -160,6 +231,10 @@ export default {
       this.isIndeterminate = false
       this.checkAll = false
       this.dialogVisible = false
+      this.form = {
+        groupUser: [],
+        name: ''
+      }
     },
 
     handleCheckAllChange(val) {
@@ -189,25 +264,30 @@ export default {
         this.getData()
       }).catch((err) => {
         this.loading = false
-        console.log('发生错误: ', err)
+        console.log('发生错误:年级已存在 ', err)
+        this.$message({
+          type: "info",
+          message: "年级已存在!",
+        });
+
       })
     },
 
     creatGroup(gradeName) {
-      console.log(this.groupUser,'===================jjjjjjjjjjjjj=========>this.groupUser');
-      
-      let groupUserList = this.groupUser.map(item=>{
-        return {userId:item}
+      console.log(this.groupUser, '===================jjjjjjjjjjjjj=========>this.groupUser');
+
+      let groupUserList = this.groupUser.map(item => {
+        return { userId: item }
       })
-      console.log(groupUserList,'=============================>groupUserListgroupUserListgroupUserList');
-      
+      console.log(groupUserList, '=============================>groupUserListgroupUserListgroupUserList');
+
       return new Promise((resolve, reject) => {
         this.$http.post(
           "/group/add",
           {
             groupName: gradeName.trim(),
             institutionNo: this.institutionNo,
-            // groupUserList:groupUserList
+            groupUserList: groupUserList
           },
           (response) => {
             //console.log("结果", response);
@@ -268,32 +348,83 @@ export default {
     },
     //更新组名
     updateGroupName(row) {
-      this.$prompt("请输入新组名", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      console.log(this.form, this.dialogVisibleData, this.dialogVisibleDatas, '=========================>row');
+      let groupUserList = this.form.groupUser.map(item => {
+        return { userId: item }
       })
-        .then(({ value }) => {
-          this.$http.post(
-            "/group/updateName",
-            {
-              id: row.id,
-              groupName: value,
-            },
-            (msg) => {
-              this.getData();
-              this.$message({
-                type: "success",
-                message: "更改新组: " + value + "  成功",
-              });
-            }
-          );
-        })
-        .catch(() => {
+      console.log(this.form.groupUser, 'this.form.groupUser================>this.form.groupUser');
+      this.$http.post(
+        "/group/updateName",
+        {
+          id: this.dialogVisibleDatas.id,
+          groupName: this.form.name,
+          groupUserList: groupUserList
+        },
+        (response) => {
+          console.log(response, 'response==========>response==========>response==========>response==========>');
+          this.handleClose()
+          this.getData();
           this.$message({
-            type: "info",
-            message: "取消输入",
+            type: "success",
+            message: "更改新组: " + this.form.name + "  成功",
           });
-        });
+        }
+      )
+      // this.$refs['formName'].validate((valid) => {
+      //   if (valid) {
+      //     this.$http.post(
+      //       "/group/updateName",
+      //       {
+      //         id: this.dialogVisibleData[0].id,
+      //         userId: this.dialogVisibleData[0].userId,
+      //         groupId: this.dialogVisibleData[0].groupId,
+      //         groupName: this.form.name,
+      //         groupUserList: groupUserList
+      //       },
+      //       (msg) => {
+      //         console.log(msg);
+      //         this.getData();
+      //         this.$message({
+      //           type: "success",
+      //           message: "更改新组: " + value + "  成功",
+      //         });
+      //       }
+      //     ).catch(error => {
+      //       console.log(error);
+
+      //     })
+      //   } else {
+      //     console.log('error submit!!');
+      //     return false;
+      //   }
+      // })
+
+      // this.$prompt("请输入新组名", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      // })
+      //   .then(({ value }) => {
+      //     this.$http.post(
+      //       "/group/updateName",
+      //       {
+      //         id: row.id,
+      //         groupName: value,
+      //       },
+      //       (msg) => {
+      //         this.getData();
+      //         this.$message({
+      //           type: "success",
+      //           message: "更改新组: " + value + "  成功",
+      //         });
+      //       }
+      //     );
+      //   })
+      //   .catch(() => {
+      //     this.$message({
+      //       type: "info",
+      //       message: "取消输入",
+      //     });
+      //   });
     },
     //查看组内成员
     getGroupUserList(row) {

+ 78 - 198
src/components/manage/main/UserManage.vue

@@ -2,109 +2,41 @@
   <div>
     <div class="headerRow headerRowLeftRight">
       <div class="headerRow">
-        <el-input
-          placeholder="请输入用户名或账号搜索"
-          v-model="searchKeyLin"
-          @keyup.enter.native="onSubmit"
-          style="width: 260px"
-        >
-          <el-button
-            slot="append"
-            icon="el-icon-search"
-            @click="onSubmit"
-          ></el-button>
+        <el-input placeholder="请输入用户名或账号搜索" v-model="searchKeyLin" @keyup.enter.native="onSubmit" style="width: 260px">
+          <el-button slot="append" icon="el-icon-search" @click="onSubmit"></el-button>
         </el-input>
 
-        <el-select
-          v-model="value"
-          @change="onSubmit"
-          placeholder="用户状态"
-          style="width: 120px"
-          class="mrl"
-        >
-          <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
+        <el-select v-model="value" @change="onSubmit" placeholder="用户状态" style="width: 120px" class="mrl">
+          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
           </el-option>
         </el-select>
 
-        <el-select
-          v-model="groupValue"
-          @change="onSubmit"
-          placeholder="年级选择"
-          style="width: 120px"
-          class="mrl"
-        >
-          <el-option
-            v-for="item in groupOptions"
-            :key="item.id"
-            :label="item.groupName"
-            :value="item.id"
-          >
+        <el-select v-model="groupValue" @change="onSubmit" placeholder="年级选择" style="width: 120px" class="mrl">
+          <el-option v-for="item in groupOptions" :key="item.id" :label="item.groupName" :value="item.id">
           </el-option>
         </el-select>
 
-        <el-button
-          class="ml10"
-          icon="el-icon-refresh"
-          @click="reset"
-        ></el-button>
-        <el-button
-          class="ml10"
-          type="primary"
-          icon="el-icon-plus"
-          @click="exportUser"
-          >批量导入</el-button
-        >
-        <el-button
-            v-if="systemVersion != 'lan'"
-            class="ml10"
-            type="primary"
-            icon="el-icon-s-check"
-            @click="allUserCheck"
-        >一键审核</el-button>
+        <el-button class="ml10" icon="el-icon-refresh" @click="reset"></el-button>
+        <el-button class="ml10" type="primary" icon="el-icon-plus" @click="exportUser">批量导入</el-button>
+        <el-button v-if="systemVersion != 'lan'" class="ml10" type="primary" icon="el-icon-s-check"
+          @click="allUserCheck">一键审核</el-button>
       </div>
     </div>
     <el-table :data="tableData" border style="width: 100%; margin-top: 20px">
-      <el-table-column
-        prop="petName"
-        label="用户名称"
-        align="center"
-      >
+      <el-table-column prop="petName" label="用户名称" align="center">
       </el-table-column>
       <el-table-column prop="phone" label="账号" width="auto" align="center">
       </el-table-column>
-      <el-table-column
-        prop="gender"
-        label="性别"
-        align="center"
-        :formatter="sexFormat"
-      ></el-table-column>
+      <el-table-column prop="gender" label="性别" align="center" :formatter="sexFormat"></el-table-column>
       <el-table-column prop="birthday" label="生日" width="auto" align="center">
       </el-table-column>
       <!-- <el-table-column prop="institutionName" label="所属学校" width="auto" align="center">
       </el-table-column> -->
-      <el-table-column
-        prop="profession"
-        label="职业"
-        align="center"
-      >
+      <el-table-column prop="profession" label="职业" align="center">
       </el-table-column>
-         <el-table-column
-        prop="gid"
-        label="年级名称"
-        align="center"
-      >
+      <el-table-column prop="gid" label="年级名称" align="center">
       </el-table-column>
-      <el-table-column
-        prop="userStatus"
-        label="用户状态"
-        align="center"
-        :formatter="statusFormat"
-      >
+      <el-table-column prop="userStatus" label="用户状态" align="center" :formatter="statusFormat">
       </el-table-column>
       <el-table-column label="操作" width="300px" align="center">
         <!--        <template slot-scope="scope">-->
@@ -119,11 +51,7 @@
             style="margin-top: 10px"
             >查看详情
           </el-button> -->
-          <el-button
-            type="primary"
-            size="small"
-            @click="handleResetPwd(scope.$index, scope.row)"
-            >重置密码
+          <el-button type="primary" size="small" @click="handleResetPwd(scope.$index, scope.row)">重置密码
           </el-button>
           <!--          <el-dialog title="重置密码" :visible.sync="personalSecurityDialog" width="40%">-->
           <!--            <el-form :model="updatePersonalSecurity" status-icon :rules="personalSecurityRules" ref="ruleFormSecurity">-->
@@ -141,18 +69,10 @@
           <!--              </el-form-item>-->
           <!--            </el-form>-->
           <!--          </el-dialog>-->
-          <el-button
-            size="small"
-            type="danger"
-            @click="handleDelete(scope.$index, scope.row)"
-            >删除
+          <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
           </el-button>
-          <el-button
-            type="primary"
-            v-if="scope.row.userStatus != '2' && scope.row.userStatus != '4'"
-            size="small"
-            @click="editUser(scope.row)"
-            >审核通过
+          <el-button type="primary" v-if="scope.row.userStatus != '2' && scope.row.userStatus != '4'" size="small"
+            @click="editUser(scope.row)">审核通过
           </el-button>
         </template>
         <!--        &lt;!&ndash;<template slot-scope="scope">-->
@@ -171,41 +91,20 @@
       </el-table-column>
     </el-table>
     <div class="txt-center" style="margin-top: 20px">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-      >
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
       </el-pagination>
     </div>
-    <el-dialog
-      :title="addUserEditFlag"
-      :visible.sync="addUser"
-      width="40%"
-      center
-      :close-on-click-modal="false"
-    >
+    <el-dialog :title="addUserEditFlag" :visible.sync="addUser" width="40%" center :close-on-click-modal="false">
       <el-row :gutter="24">
         <el-col :span="24">
-          <el-form
-            :inline="true"
-            :model="ruleForm"
-            label-position="left"
-            :rules="rules"
-            ref="ruleForm"
-            class="demo-form-inline demo-ruleForm"
-          >
+          <el-form :inline="true" :model="ruleForm" label-position="left" :rules="rules" ref="ruleForm"
+            class="demo-form-inline demo-ruleForm">
             <el-row :gutter="24">
               <el-col :span="12">
                 <el-form-item label="签字" prop="signature">
-                  <el-input
-                    v-model="ruleForm.signature"
-                    placeholder="签字"
-                  ></el-input>
+                  <el-input v-model="ruleForm.signature" placeholder="签字"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -220,13 +119,8 @@
             <!-- <el-row :gutter="24">
               <el-col :span="12"> -->
             <el-form-item label="请选择签名照" prop="signature">
-              <el-upload
-                class="avatar-uploader"
-                action="https://jsonplaceholder.typicode.com/posts/"
-                :show-file-list="false"
-                :on-success="handleAvatarSuccess"
-                :before-upload="beforeAvatarUpload"
-              >
+              <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
+                :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
                 <img v-if="imageUrl" :src="imageUrl" class="avatar" />
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
@@ -238,44 +132,35 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
         <el-row :gutter="20">
-          <el-col :span="2"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="6"
-            ><div class="grid-content bg-purple">
-              <el-button type="primary" @click="addUser = false"
-                >确 定</el-button
-              >
-            </div></el-col
-          >
-          <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="6"
-            ><div class="grid-content bg-purple">
+          <el-col :span="2">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="6">
+            <div class="grid-content bg-purple">
+              <el-button type="primary" @click="addUser = false">确 定</el-button>
+            </div>
+          </el-col>
+          <el-col :span="4">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="4">
+            <div class="grid-content bg-purple"></div>
+          </el-col>
+          <el-col :span="6">
+            <div class="grid-content bg-purple">
               <el-button @click="addUser = false">取 消</el-button>
-            </div></el-col
-          >
+            </div>
+          </el-col>
         </el-row>
       </span>
     </el-dialog>
     <!-- 批量导入 -->
-    <el-dialog
-      :close-on-click-modal="false"
-      title="批量导入"
-      :visible.sync="dialogTableVisible"
-    >
-      <el-upload
-        class="txt-center"
-        :action="uploadUrl"
-        multiple
-        :before-upload="uploadVa"
-        :limit="3"
-        :show-file-list="false"
-        :on-success="uploadSuccess"
-        :on-error="uploadFail"
-        :file-list="fileList"
-        :data="{
+    <el-dialog :close-on-click-modal="false" title="批量导入" :visible.sync="dialogTableVisible">
+      <el-upload class="txt-center" :action="uploadUrl" multiple :before-upload="uploadVa" :limit="3"
+        :show-file-list="false" :on-success="uploadSuccess" :on-error="uploadFail" :file-list="fileList" :data="{
           institutionNo: institutionNo,
-        }"
-      >
+          userId:createUserId,
+        }">
         <el-button size="small" type="primary">点击上传</el-button>
         <div slot="tip" class="el-upload__tip">请上传.xls,.xlsx类型的文件</div>
       </el-upload>
@@ -283,16 +168,8 @@
         <el-link type="primary">点击下载模板</el-link>
       </div>
       <el-table v-if="userList.length > 0" :data="userList">
-        <el-table-column
-          property="date"
-          label="日期"
-          width="150"
-        ></el-table-column>
-        <el-table-column
-          property="name"
-          label="姓名"
-          width="200"
-        ></el-table-column>
+        <el-table-column property="date" label="日期" width="150"></el-table-column>
+        <el-table-column property="name" label="姓名" width="200"></el-table-column>
         <el-table-column property="address" label="地址"></el-table-column>
       </el-table>
     </el-dialog>
@@ -366,7 +243,7 @@ export default {
       currentPage: 1,
       total: 0,
       pageSize: 10,
-      createUserId:'',
+      createUserId: '',
       updatePersonalSecurity: {},
       rules: {
         signature: [
@@ -551,7 +428,7 @@ export default {
       this.getData();
 
       //部分未成功也会在此提示
-      this.$alert(`${ res.msg }`, '提示', {
+      this.$alert(`${res.msg}`, '提示', {
         confirmButtonText: '确定',
         type: 'warning',
         center: true,
@@ -567,7 +444,7 @@ export default {
     // 批量导入失败
     uploadFail(res) {
       // this.$message.error(res.msg);
-      this.$alert(`${ res.msg }`, '提示', {
+      this.$alert(`${res.msg}`, '提示', {
         confirmButtonText: '确定',
         type: 'error',
         center: true,
@@ -587,14 +464,14 @@ export default {
     statusFormat(row) {
       if (row.userStatus == 2) {
         return "已审核";
-      } else if(row.userStatus == 1){
+      } else if (row.userStatus == 1) {
         return "未审核";
-      } else if(row.userStatus == 3){
+      } else if (row.userStatus == 3) {
         return "待登录";
-      } else if(row.userStatus == 4){
+      } else if (row.userStatus == 4) {
         return "待补充";
-      }else {
-          return "--";
+      } else {
+        return "--";
       }
     },
     handleCurrentChange(val) {
@@ -645,13 +522,13 @@ export default {
       }).then(() => {
         this.$http.get("/user/updateStatusAll?institutionNo=" + this.institutionNo, {}, (res) => {
 
-          if(res && res.code == '200'){
+          if (res && res.code == '200') {
             this.getData();
             this.$message({
               type: "success",
               message: "一键审核成功!",
             });
-          }else {
+          } else {
             this.$message({
               type: "error",
               message: "一键审核失败!",
@@ -680,7 +557,7 @@ export default {
     // 	this.ruleForm=[];
     // },
     //删除用户
-    deleteUser() {},
+    deleteUser() { },
     handleAvatarSuccess(res, file) {
       this.imageUrl = URL.createObjectURL(file.raw);
     },
@@ -700,17 +577,19 @@ export default {
       this.searchKeyLin = this.searchKey;
       this.$http.get(
         "/user/getUserListByInstitutionNo?institutionNo=" +
-          this.institutionNo +
-          "&searchKey=" +
-          this.searchKey +
-          "&pageNum=" +
-          this.currentPage +
-          "&pageSize=" +
-          this.pageSize +
-          "&status=" +
-          this.value +
-          "&groupId=" +
-          this.groupValue,
+        this.institutionNo +
+        "&searchKey=" +
+        this.searchKey +
+        "&pageNum=" +
+        this.currentPage +
+        "&pageSize=" +
+        this.pageSize +
+        "&status=" +
+        this.value +
+        "&groupId=" +
+        this.groupValue +
+        "&userId=" +
+        this.createUserId,
         {},
         (response) => {
           this.total = response.data.allNum;
@@ -733,6 +612,7 @@ export default {
 .bg-purple-dark {
   background: white;
 }
+
 .grid-content {
   border-radius: 4px;
   min-height: 36px;

+ 6 - 2
src/components/manage/main/UserRecords.vue

@@ -297,8 +297,12 @@ export default {
           "&beginTime=" +
           this.time[0] +
           "&endTime=" +
-          this.time[1]+"&groupId=" +
-          this.groupValue,
+          this.time[1]+
+          "&groupId=" +
+          this.groupValue +
+        "&userId=" +
+        this.createUserId,
+          // &userId=${this.createUserId}
         {},
         (response) => {
           this.total = response.data.allNum;