lsc 2 年之前
父节点
当前提交
89b6accd5f

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       height: 100%;
       width: 100%;
       width: 100%;
       background: #e6eaf0;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.adce7620836109fee280b30345cc493d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.f1661c5ebfd33221b88f.js></script><script type=text/javascript src=./static/js/app.6fbfd1f9eaeb5f12802b.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.d8724ef663c2d50ca0ec3b1e0de02b08.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.f1661c5ebfd33221b88f.js></script><script type=text/javascript src=./static/js/app.2f3360444db7df1cd2d7.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {
     document.documentElement.addEventListener("touchstart", function (event) {

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.adce7620836109fee280b30345cc493d.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.adce7620836109fee280b30345cc493d.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.d8724ef663c2d50ca0ec3b1e0de02b08.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.d8724ef663c2d50ca0ec3b1e0de02b08.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.2f3360444db7df1cd2d7.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.2f3360444db7df1cd2d7.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.6fbfd1f9eaeb5f12802b.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 0 - 0
src/components/json.json


文件差异内容过多而无法显示
+ 169 - 165
src/components/json2.json


+ 28 - 4
src/components/pages/addCourse.vue

@@ -160,6 +160,7 @@
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                     (dialogVisibleClass = true),
                     (dialogVisibleClass = true),
                     (classSearch = ''),
                     (classSearch = ''),
+                    (gradeId = ''),
                     getClass()
                     getClass()
                     ">添加班级</button>
                     ">添加班级</button>
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
@@ -2151,6 +2152,10 @@
         <div class="people_top">
         <div class="people_top">
           <div class="people_top_right">
           <div class="people_top_right">
             <div class="people_search">
             <div class="people_search">
+              <el-select v-model="gradeId" placeholder="请选择年级" class="student_input" clearable @change="getClass()">
+                <el-option label="全部" value=""></el-option>
+                <el-option v-for="(item, index) in gradeList" :key="index" :label="item.name" :value="item.id"></el-option>
+              </el-select>
               <el-input placeholder="搜索班级名称" v-model="classSearch" @input="getClass()"></el-input>
               <el-input placeholder="搜索班级名称" v-model="classSearch" @input="getClass()"></el-input>
               <!-- @click="getClass()" 
               <!-- @click="getClass()" 
                 @keyup.enter.native="getClass()"
                 @keyup.enter.native="getClass()"
@@ -2162,7 +2167,7 @@
           </div>
           </div>
           <div class="people_nav">选择班级</div>
           <div class="people_nav">选择班级</div>
         </div>
         </div>
-        <el-checkbox-group v-model="checkboxList2" class="people_name people_name2" @change="InviteChange">
+        <el-checkbox-group v-model="checkboxList2" class="people_name people_name2" @change="InviteChange" v-if="grade2.length" >
           <div v-for="item in grade2" :key="item.id" class="p_box">
           <div v-for="item in grade2" :key="item.id" class="p_box">
             <el-checkbox :label="item.id">
             <el-checkbox :label="item.id">
               {{ item.name }}
               {{ item.name }}
@@ -2174,6 +2179,7 @@
             <img src="../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
             <img src="../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
           </div>
           </div>
         </el-checkbox-group>
         </el-checkbox-group>
+        <div v-if="!grade2.length" style="padding:20px 10px">暂无数据</div>
       </div>
       </div>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
@@ -3092,6 +3098,7 @@ export default {
       dialogVisiblePreTime: false,
       dialogVisiblePreTime: false,
       uploadJson: [],
       uploadJson: [],
       classJuri: [],
       classJuri: [],
+      gradeList: [],
       cover: [], //课程封面
       cover: [], //课程封面
       myWord: [],
       myWord: [],
       evaJuri: [],
       evaJuri: [],
@@ -3172,6 +3179,7 @@ export default {
       checkboxList2: [],
       checkboxList2: [],
       checkboxList3: [],
       checkboxList3: [],
       classSearch: "",
       classSearch: "",
+      gradeId:"",
       number: "",
       number: "",
       tTitle: "",
       tTitle: "",
       tdetail: "",
       tdetail: "",
@@ -4789,14 +4797,29 @@ export default {
     searchStudent() {
     searchStudent() {
       this.getStudent();
       this.getStudent();
     },
     },
+    selectGrage() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectGrageBySchool", params)
+        .then((res) => {
+          this.gradeList = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     //获取班级列表
     //获取班级列表
     getClass() {
     getClass() {
       let params = {
       let params = {
         oid: this.oid,
         oid: this.oid,
+        gid: this.gradeId,
         cn: this.classSearch,
         cn: this.classSearch,
       };
       };
       this.ajax
       this.ajax
-        .get(this.$store.state.api + "selectClassBySchoolSearch", params)
+        .get(this.$store.state.api + "selectClassBySchoolSearch2", params)
         .then((res) => {
         .then((res) => {
           if (!this.grade.length) {
           if (!this.grade.length) {
             this.grade = res.data[0];
             this.grade = res.data[0];
@@ -7655,6 +7678,7 @@ export default {
     this.getStudent();
     this.getStudent();
     this.getTeacher();
     this.getTeacher();
     this.getClass();
     this.getClass();
+    this.selectGrage();
     this.getTemplate();
     this.getTemplate();
     // this.selectType();
     // this.selectType();
     this.selectEva();
     this.selectEva();
@@ -8369,7 +8393,7 @@ export default {
   /* justify-content: space-between; */
   /* justify-content: space-between; */
   /* align-items: center; */
   /* align-items: center; */
   flex-direction: column;
   flex-direction: column;
-  padding: 10px 25px 0;
+  padding: 10px 10px 0;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 
 
@@ -8410,7 +8434,7 @@ export default {
 .people_name {
 .people_name {
   display: flex;
   display: flex;
   justify-content: flex-start;
   justify-content: flex-start;
-  padding: 20px 0 0 25px;
+  padding: 20px 10px;
   flex-direction: column;
   flex-direction: column;
   flex-wrap: wrap;
   flex-wrap: wrap;
 }
 }

+ 87 - 6
src/components/pages/class.vue

@@ -27,13 +27,19 @@
         <el-table v-if="ctype == 1" ref="table" :key="1" :data="tableData" border :height="tableHeight" :fit="true"
         <el-table v-if="ctype == 1" ref="table" :key="1" :data="tableData" border :height="tableHeight" :fit="true"
           v-loading="isLoading" style="width: 100%; height: 60%" :header-cell-style="{ background: '#f1f1f1' }"
           v-loading="isLoading" style="width: 100%; height: 60%" :header-cell-style="{ background: '#f1f1f1' }"
           :row-class-name="tableRowClassName">
           :row-class-name="tableRowClassName">
-          <el-table-column prop="name" label="班级名称" min-width="40%" align="center">
+          <el-table-column prop="name" label="班级名称" align="center">
           </el-table-column>
           </el-table-column>
-          <el-table-column prop="pnum" label="人数" min-width="40%" align="center">
+          <el-table-column label="所属年级" align="center">
+            <template slot-scope="{row}">
+              {{ getGrade(row.pid) }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="pnum" label="人数" align="center">
           </el-table-column>
           </el-table-column>
-          <el-table-column label="操作" min-width="20%">
+          <el-table-column label="操作" width="400px">
             <template slot-scope="scope">
             <template slot-scope="scope">
               <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看学生</el-button>
               <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看学生</el-button>
+              <el-button type="primary" size="small" @click="updateG(scope.row.pid, scope.row.id)">修改年级</el-button>
               <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
               <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
               <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
               <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
             </template>
             </template>
@@ -82,11 +88,10 @@
             <template slot-scope="scope">
             <template slot-scope="scope">
               <div class="userImg">
               <div class="userImg">
                 <div class="tx">
                 <div class="tx">
-                  <img :src="
-                    scope.row.headportrait != null
+                  <img :src="scope.row.headportrait != null
                       ? scope.row.headportrait
                       ? scope.row.headportrait
                       : tx
                       : tx
-                  " alt />
+                    " alt />
                 </div>
                 </div>
                 <div style="
                 <div style="
                           width: 150px;
                           width: 150px;
@@ -230,6 +235,20 @@
         <el-button type="primary" @click="insertClass">确 定</el-button>
         <el-button type="primary" @click="insertClass">确 定</el-button>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
+    <el-dialog title="修改年级" :visible.sync="dialogVisibleGrade" :append-to-body="true" width="25%"
+      :before-close="handleClose" class="dialog_diy">
+      <el-form>
+        <el-form-item label="选择年级" :label-width="formLabelWidth">
+          <el-select v-model="gid" placeholder="请选择班级" class="student_input" style="margin:0 10px" clearable>
+            <el-option v-for="(item, index) in grade" :key="index" :label="item.name" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleGrade = false">取 消</el-button>
+        <el-button type="primary" @click="updateGrade">确 定</el-button>
+      </span>
+    </el-dialog>
     <el-dialog title="修改班级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
     <el-dialog title="修改班级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
       class="dialog_diy">
       class="dialog_diy">
       <el-form>
       <el-form>
@@ -337,14 +356,31 @@ export default {
       page3: 1,
       page3: 1,
       isLoading2: false,
       isLoading2: false,
       searchTN: "",
       searchTN: "",
+      grade: [],
+      gid: "",
+      dialogVisibleGrade: false
     };
     };
   },
   },
   created() {
   created() {
     this.page = 1;
     this.page = 1;
     this.getClass();
     this.getClass();
     this.getClass2();
     this.getClass2();
+    this.selectGrage()
     this.getSchoolName();
     this.getSchoolName();
   },
   },
+  computed: {
+    getGrade() {
+      return function (gid) {
+        let name = ''
+        this.grade.forEach(element => {
+          if (element.id == gid) {
+            name = element.name
+          }
+        });
+        return name ? name : '暂无'
+      }
+    }
+  },
   mounted() {
   mounted() {
     this.$nextTick(function () {
     this.$nextTick(function () {
       this.tableHeight =
       this.tableHeight =
@@ -364,6 +400,21 @@ export default {
     });
     });
   },
   },
   methods: {
   methods: {
+    //获取班级列表
+    selectGrage() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectGrageBySchool", params)
+        .then((res) => {
+          this.grade = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     tableRowClassName({ row, rowIndex }) {
     tableRowClassName({ row, rowIndex }) {
       if ((rowIndex + 1) % 2 === 0) {
       if ((rowIndex + 1) % 2 === 0) {
         return "even_row";
         return "even_row";
@@ -396,6 +447,36 @@ export default {
       this.page = 1;
       this.page = 1;
       this.getClass();
       this.getClass();
     },
     },
+    updateG(gid, id) {
+      this.gid = gid;
+      this.classid = id;
+      this.dialogVisibleGrade = true;
+    },
+    updateGrade() {
+      this.$confirm("确定修改吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let params = [{
+            cid: this.gid,
+            student: JSON.stringify([this.classid])
+          }];
+          this.ajax
+            .post(this.$store.state.api + "addGradeClass", params)
+            .then((res) => {
+              this.gid = '';
+              this.classid = '';
+              this.dialogVisibleGrade = false
+              this.getClass();
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => { });
+    },
     openUpdate(id, n) {
     openUpdate(id, n) {
       this.classid = id;
       this.classid = id;
       this.className1 = n;
       this.className1 = n;

+ 29 - 5
src/components/pages/easy/addCourse.vue

@@ -103,6 +103,7 @@
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                     (dialogVisibleClass = true),
                     (dialogVisibleClass = true),
                     (classSearch = ''),
                     (classSearch = ''),
+                    (gradeId = ''),
                     getClass()
                     getClass()
                     ">添加班级</button>
                     ">添加班级</button>
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
@@ -3224,6 +3225,10 @@
         <div class="people_top">
         <div class="people_top">
           <div class="people_top_right">
           <div class="people_top_right">
             <div class="people_search">
             <div class="people_search">
+              <el-select v-model="gradeId" placeholder="请选择年级" class="student_input" clearable @change="getClass()">
+                <el-option label="全部" value=""></el-option>
+                <el-option v-for="(item, index) in gradeList" :key="index" :label="item.name" :value="item.id"></el-option>
+              </el-select>
               <el-input placeholder="搜索班级名称" v-model="classSearch" @input="getClass()"></el-input>
               <el-input placeholder="搜索班级名称" v-model="classSearch" @input="getClass()"></el-input>
               <!-- @click="getClass()" 
               <!-- @click="getClass()" 
                 @keyup.enter.native="getClass()"
                 @keyup.enter.native="getClass()"
@@ -3235,7 +3240,7 @@
           </div>
           </div>
           <div class="people_nav">选择班级</div>
           <div class="people_nav">选择班级</div>
         </div>
         </div>
-        <el-checkbox-group v-model="checkboxList2" class="people_name people_name2" @change="InviteChange">
+        <el-checkbox-group v-model="checkboxList2" class="people_name people_name2" @change="InviteChange" v-if="grade2.length" >
           <div v-for="item in grade2" :key="item.id" class="p_box">
           <div v-for="item in grade2" :key="item.id" class="p_box">
             <el-checkbox :label="item.id">
             <el-checkbox :label="item.id">
               {{ item.name }}
               {{ item.name }}
@@ -3244,9 +3249,10 @@
               邀请码:{{ getInviteCodeC(item.id) }}</div> -->
               邀请码:{{ getInviteCodeC(item.id) }}</div> -->
             <!-- <div class="inviteCode" :class="{ noneInvite: !isInvite(item.id) }" v-if="checkboxList2.indexOf(item.id) != -1"
             <!-- <div class="inviteCode" :class="{ noneInvite: !isInvite(item.id) }" v-if="checkboxList2.indexOf(item.id) != -1"
               @click="OpenInviteD(item.id)">随机码设置</div>
               @click="OpenInviteD(item.id)">随机码设置</div>
-            <img src="../../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
+            <img src="../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
           </div>
           </div>
         </el-checkbox-group>
         </el-checkbox-group>
+        <div v-if="!grade2.length" style="padding:20px 10px">暂无数据</div>
       </div>
       </div>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
@@ -4165,6 +4171,7 @@ export default {
       dialogVisiblePreTime: false,
       dialogVisiblePreTime: false,
       uploadJson: [],
       uploadJson: [],
       classJuri: [],
       classJuri: [],
+      gradeList: [],
       cover: [], //课程封面
       cover: [], //课程封面
       myWord: [],
       myWord: [],
       evaJuri: [],
       evaJuri: [],
@@ -4245,6 +4252,7 @@ export default {
       checkboxList2: [],
       checkboxList2: [],
       checkboxList3: [],
       checkboxList3: [],
       classSearch: "",
       classSearch: "",
+      gradeId:"",
       number: "",
       number: "",
       tTitle: "",
       tTitle: "",
       tdetail: "",
       tdetail: "",
@@ -5743,14 +5751,29 @@ export default {
     searchStudent() {
     searchStudent() {
       this.getStudent();
       this.getStudent();
     },
     },
+    selectGrage() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectGrageBySchool", params)
+        .then((res) => {
+          this.gradeList = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     //获取班级列表
     //获取班级列表
     getClass() {
     getClass() {
       let params = {
       let params = {
         oid: this.oid,
         oid: this.oid,
+        gid: this.gradeId,
         cn: this.classSearch,
         cn: this.classSearch,
       };
       };
       this.ajax
       this.ajax
-        .get(this.$store.state.api + "selectClassBySchoolSearch", params)
+        .get(this.$store.state.api + "selectClassBySchoolSearch2", params)
         .then((res) => {
         .then((res) => {
           if (!this.grade.length) {
           if (!this.grade.length) {
             this.grade = res.data[0];
             this.grade = res.data[0];
@@ -8629,6 +8652,7 @@ export default {
     this.getStudent();
     this.getStudent();
     this.getTeacher();
     this.getTeacher();
     this.getClass();
     this.getClass();
+    this.selectGrage();
     this.getTemplate();
     this.getTemplate();
     // this.selectType();
     // this.selectType();
     this.selectEva();
     this.selectEva();
@@ -9348,7 +9372,7 @@ export default {
   /* justify-content: space-between; */
   /* justify-content: space-between; */
   /* align-items: center; */
   /* align-items: center; */
   flex-direction: column;
   flex-direction: column;
-  padding: 10px 25px 0;
+  padding: 10px 10px 0;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 
 
@@ -9389,7 +9413,7 @@ export default {
 .people_name {
 .people_name {
   display: flex;
   display: flex;
   justify-content: flex-start;
   justify-content: flex-start;
-  padding: 20px 0 0 25px;
+  padding: 20px 10px;
   flex-direction: column;
   flex-direction: column;
   flex-wrap: wrap;
   flex-wrap: wrap;
 }
 }

+ 47 - 77
src/components/pages/grade/index.vue

@@ -15,7 +15,7 @@
         <div class="student_head">
         <div class="student_head">
           <div class="student_search">
           <div class="student_search">
             <span>
             <span>
-              <el-input placeholder="请输入级名称" v-model="sClassName" clearable>
+              <el-input placeholder="请输入级名称" v-model="sClassName" clearable>
               </el-input>
               </el-input>
             </span>
             </span>
             <el-button type="primary" @click="searchClass">查询</el-button>
             <el-button type="primary" @click="searchClass">查询</el-button>
@@ -35,7 +35,7 @@
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看班级</el-button>
                 <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看班级</el-button>
                 <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
                 <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
-                <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
+                <el-button type="primary" size="small" @click="deleteGrade(scope.row.id)">删除</el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
           </el-table>
           </el-table>
@@ -60,16 +60,16 @@
         </div>
         </div>
         <div class="student_head">
         <div class="student_head">
           <div class="head_left">
           <div class="head_left">
-            <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入用户名"></el-input>
+            <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入班级"></el-input>
             <el-select disabled v-model="cid" placeholder="请选择班级" class="student_input" @change="searchStudent"
             <el-select disabled v-model="cid" placeholder="请选择班级" class="student_input" @change="searchStudent"
               style="margin:0 10px">
               style="margin:0 10px">
-              <el-option label="所有人" value=""></el-option>
+              <el-option label="全部年级" value=""></el-option>
               <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
               <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
             </el-select>
             </el-select>
             <el-button class="student_button" @click="searchStudent">查询</el-button>
             <el-button class="student_button" @click="searchStudent">查询</el-button>
           </div>
           </div>
           <div class="head_right">
           <div class="head_right">
-            <el-button @click="addStudent">添加学生</el-button>
+            <el-button @click="addStudent">添加班级</el-button>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
@@ -78,43 +78,20 @@
           <el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
           <el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
             v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
             v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
             :row-class-name="tableRowClassName">
             :row-class-name="tableRowClassName">
-            <el-table-column label="姓名" min-width="10" align="center">
+            <el-table-column label="班级" min-width="10" align="center">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <div class="userImg">
-                  <div class="tx">
-                    <img :src="
-                      scope.row.headportrait != null
-                        ? scope.row.headportrait
-                        : tx
-                    " alt />
-                  </div>
-                  <div style="
-                            width: 150px;
-                            text-align: left;
-                            white-space: nowrap;
-                            overflow: hidden;
-                            text-overflow: ellipsis;
-                          ">
+                <div>
                     {{ scope.row.name }}
                     {{ scope.row.name }}
-                  </div>
                 </div>
                 </div>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column label="学生账号" min-width="15" align="center">
-              <template slot-scope="scope">
-                <div>{{ scope.row.un ? scope.row.un : "" }}</div>
-              </template>
-            </el-table-column>
-            <el-table-column prop="classname2" label="班级" min-width="15" align="center">
+            <el-table-column prop="pnum" label="学生数" min-width="15" align="center">
             </el-table-column>
             </el-table-column>
             <el-table-column label="操作" width="250px">
             <el-table-column label="操作" width="250px">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <div class="btnBox">
                 <div class="btnBox">
                   <el-button class="de_button" type="primary" size="small"
                   <el-button class="de_button" type="primary" size="small"
-                    @click="iniPassword(scope.row.userid)">初始化密码</el-button>
-                  <el-button class="de_button" type="primary" size="small" @click="updateStudentA(scope.row)">修改</el-button>
-                  <el-button class="de_button" type="primary" size="small"
-                    @click="deleteClassStudent(scope.row.userid)">移除</el-button>
+                    @click="deleteClassStudent(scope.row.id)">移除</el-button>
                   <!-- <div class="delete">
                   <!-- <div class="delete">
                     <img src="../../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
                     <img src="../../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
                   </div> -->
                   </div> -->
@@ -218,61 +195,55 @@
           <el-button class="right" @click="updateStudent">修改</el-button>
           <el-button class="right" @click="updateStudent">修改</el-button>
         </span>
         </span>
       </el-dialog>
       </el-dialog>
-      <el-dialog title="添加班级" :visible.sync="dialogVisible" :append-to-body="true" width="25%" :before-close="handleClose"
+      <el-dialog title="添加年级" :visible.sync="dialogVisible" :append-to-body="true" width="400px" :before-close="handleClose"
         class="dialog_diy">
         class="dialog_diy">
         <el-form>
         <el-form>
-          <el-form-item label="班级名称" :label-width="formLabelWidth">
-            <el-input v-model="className" auto-complete="off" placeholder="请输入级..."></el-input>
+          <el-form-item label="添加年级" :label-width="formLabelWidth">
+            <el-input v-model="className" auto-complete="off" placeholder="请输入级..."></el-input>
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
         <span slot="footer" class="dialog-footer">
         <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</el-button>
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="insertClass">确 定</el-button>
+          <el-button type="primary" @click="insertGrade">确 定</el-button>
         </span>
         </span>
       </el-dialog>
       </el-dialog>
-      <el-dialog title="修改级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
+      <el-dialog title="修改级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
         class="dialog_diy">
         class="dialog_diy">
         <el-form>
         <el-form>
-          <el-form-item label="级名称" :label-width="formLabelWidth">
-            <el-input v-model="className1" auto-complete="off" placeholder="请输入级..."></el-input>
+          <el-form-item label="级名称" :label-width="formLabelWidth">
+            <el-input v-model="className1" auto-complete="off" placeholder="请输入级..."></el-input>
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
         <span slot="footer" class="dialog-footer">
         <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible1 = false">取 消</el-button>
           <el-button @click="dialogVisible1 = false">取 消</el-button>
-          <el-button type="primary" @click="updateClass">确 定</el-button>
+          <el-button type="primary" @click="updateGrade">确 定</el-button>
         </span>
         </span>
       </el-dialog>
       </el-dialog>
-      <el-dialog title="添加学生" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
+      <el-dialog title="选择班级" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
         :before-close="handleClose" class="addNewPP">
         :before-close="handleClose" class="addNewPP">
         <div class="people">
         <div class="people">
           <div class="people_top">
           <div class="people_top">
             <div class="people_top_right">
             <div class="people_top_right">
               <div class="people_search">
               <div class="people_search">
-                <el-input placeholder="搜索学生姓名" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
+                <el-input placeholder="搜索班级名称" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
                 <div class="search_img" @click="getClassStudent">
                 <div class="search_img" @click="getClassStudent">
                   <img src="../../../assets/icon/search.png" alt />
                   <img src="../../../assets/icon/search.png" alt />
                 </div>
                 </div>
               </div>
               </div>
             </div>
             </div>
-            <div class="people_nav">选择成员</div>
+            <div class="people_nav">选择班级</div>
           </div>
           </div>
           <div class="t_j_box" style="
           <div class="t_j_box" style="
                     padding: 20px 0 0 25px;
                     padding: 20px 0 0 25px;
                     width: calc(100% - 55px);
                     width: calc(100% - 55px);
                     margin-left: 25px;
                     margin-left: 25px;
                   ">
                   ">
-            <span>姓名</span>
-            <span>账号</span>
+            <span>班级</span>
           </div>
           </div>
           <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
           <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
-            <el-checkbox v-for="item in teacherJuri" :key="item.userid" :label="item.userid">
+            <el-checkbox v-for="item in teacherJuri" :key="item.id" :label="item.id">
               <div class="t_j_box">
               <div class="t_j_box">
-                <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
-                  <span>{{ item.name ? item.name : "暂无姓名" }}</span>
-                </el-tooltip>
-                <el-tooltip placement="top" :content="item.username">
-                  <span>{{ item.username }}</span>
-                </el-tooltip>
+                  <span>{{ item.name  }}</span>
               </div>
               </div>
             </el-checkbox>
             </el-checkbox>
           </el-checkbox-group>
           </el-checkbox-group>
@@ -401,19 +372,19 @@
         this.className1 = n;
         this.className1 = n;
         this.dialogVisible1 = true;
         this.dialogVisible1 = true;
       },
       },
-      //新增
-      insertClass() {
+      //新增
+      insertGrade() {
         let params = {
         let params = {
           name: this.className,
           name: this.className,
           oid: this.oid,
           oid: this.oid,
           uid: this.userid,
           uid: this.userid,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "insertClass", params)
+          .get(this.$store.state.api + "insertGrade", params)
           .then((res) => {
           .then((res) => {
             if (res.data[0] && res.data[0][0].classname == 1) {
             if (res.data[0] && res.data[0][0].classname == 1) {
               this.$message({
               this.$message({
-                message: "不能与其他级名称相同!",
+                message: "不能与其他级名称相同!",
                 type: "error",
                 type: "error",
               });
               });
             } else {
             } else {
@@ -435,19 +406,19 @@
             console.error(err);
             console.error(err);
           });
           });
       },
       },
-      //修改
-      updateClass() {
+      //修改
+      updateGrade() {
         let params = {
         let params = {
           id: this.classid,
           id: this.classid,
           n: this.className1,
           n: this.className1,
           oid: this.oid,
           oid: this.oid,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "updateClass", params)
+          .get(this.$store.state.api + "updateGrade", params)
           .then((res) => {
           .then((res) => {
             if (res.data[0] && res.data[0][0].classname == 1) {
             if (res.data[0] && res.data[0][0].classname == 1) {
               this.$message({
               this.$message({
-                message: "不能与其他级名称相同!",
+                message: "不能与其他级名称相同!",
                 type: "error",
                 type: "error",
               });
               });
             } else {
             } else {
@@ -469,7 +440,7 @@
             console.error(err);
             console.error(err);
           });
           });
       },
       },
-      //获取级列表
+      //获取级列表
       getClass() {
       getClass() {
         this.isLoading = true;
         this.isLoading = true;
         let params = {
         let params = {
@@ -480,7 +451,7 @@
           page: this.page,
           page: this.page,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "selectClass", params)
+          .get(this.$store.state.api + "selectGrade", params)
           .then((res) => {
           .then((res) => {
             this.isLoading = false;
             this.isLoading = false;
             this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
             this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
@@ -491,20 +462,20 @@
             console.error(err);
             console.error(err);
           });
           });
       },
       },
-      //删除
-      deleteClass(id) {
+      //删除
+      deleteGrade(id) {
         let params = {
         let params = {
           id: id,
           id: id,
         };
         };
         if (this.time()) {
         if (this.time()) {
-          this.$confirm("确定删除此级吗?", "提示", {
+          this.$confirm("确定删除此级吗?", "提示", {
             confirmButtonText: "确定",
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             cancelButtonText: "取消",
             type: "warning",
             type: "warning",
           })
           })
             .then(() => {
             .then(() => {
               this.ajax
               this.ajax
-                .get(this.$store.state.api + "deleteClass", params)
+                .get(this.$store.state.api + "deleteGrade", params)
                 .then((res) => {
                 .then((res) => {
                   this.$message({
                   this.$message({
                     message: "删除成功",
                     message: "删除成功",
@@ -633,7 +604,7 @@
           this.$message.error("学生姓名不能为空");
           this.$message.error("学生姓名不能为空");
           return;
           return;
         } else if (!this.userinfo.classid) {
         } else if (!this.userinfo.classid) {
-          this.$message.error("请为学生选择级");
+          this.$message.error("请为学生选择级");
           return;
           return;
         } else if (
         } else if (
           this.userinfo.phonenumber &&
           this.userinfo.phonenumber &&
@@ -702,14 +673,14 @@
       },
       },
       deleteClassStudent(id) {
       deleteClassStudent(id) {
         let params = [{ uid: id, cid: this.cid }];
         let params = [{ uid: id, cid: this.cid }];
-        this.$confirm("确定移除此学生在本班级吗?", "提示", {
+        this.$confirm("确定移除此班级在本年级吗?", "提示", {
           confirmButtonText: "确定",
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           cancelButtonText: "取消",
           type: "warning",
           type: "warning",
         })
         })
           .then(() => {
           .then(() => {
             this.ajax
             this.ajax
-              .post(this.$store.state.api + "deleteClassStudent", params)
+              .post(this.$store.state.api + "deleteGradeClass", params)
               .then((res) => {
               .then((res) => {
                 this.$message({
                 this.$message({
                   message: "操作成功",
                   message: "操作成功",
@@ -731,7 +702,7 @@
           oid: this.oid,
           oid: this.oid,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "selectClassBySchool", params)
+          .get(this.$store.state.api + "selectGrageBySchool", params)
           .then((res) => {
           .then((res) => {
             this.isLoading = false;
             this.isLoading = false;
             this.classJuri = res.data[0];
             this.classJuri = res.data[0];
@@ -771,14 +742,13 @@
         this.ctype = 2
         this.ctype = 2
         this.isLoading = true;
         this.isLoading = true;
         let params = {
         let params = {
-          oid: this.oid,
           cid: this.cid,
           cid: this.cid,
-          cu: "",
+          oid: this.oid,
           cn: this.sPhoneUser,
           cn: this.sPhoneUser,
           page: this.page2,
           page: this.page2,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "selectStudent2", params)
+          .get(this.$store.state.api + "selectClass2", params)
           .then((res) => {
           .then((res) => {
             this.isLoading = false;
             this.isLoading = false;
             this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
             this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
@@ -800,7 +770,7 @@
           num: this.pageSize3,
           num: this.pageSize3,
         };
         };
         this.ajax
         this.ajax
-          .get(this.$store.state.api + "getClassStudent", params)
+          .get(this.$store.state.api + "getGradeClass", params)
           .then((res) => {
           .then((res) => {
             this.isLoading2 = false;
             this.isLoading2 = false;
             this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
             this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
@@ -813,7 +783,7 @@
       },
       },
       addClassStudent() {
       addClassStudent() {
         if (!this.checkboxList3.length) {
         if (!this.checkboxList3.length) {
-          this.$message.error('请选择要添加班级的学生');
+          this.$message.error('请选择要添加班级');
           return;
           return;
         }
         }
         let params = [{
         let params = [{
@@ -821,7 +791,7 @@
           student: JSON.stringify(this.checkboxList3)
           student: JSON.stringify(this.checkboxList3)
         }];
         }];
         this.ajax
         this.ajax
-          .post(this.$store.state.api + "addClassStudent", params)
+          .post(this.$store.state.api + "addGradeClass", params)
           .then((res) => {
           .then((res) => {
             this.checkboxList3 = []
             this.checkboxList3 = []
             this.dialogVisibleMember = false
             this.dialogVisibleMember = false
@@ -1198,7 +1168,7 @@
   }
   }
   
   
   .t_j_box span:nth-child(1) {
   .t_j_box span:nth-child(1) {
-    width: 50%;
+    width: 100%;
     overflow: hidden;
     overflow: hidden;
     margin-right: 10px;
     margin-right: 10px;
     text-overflow: ellipsis;
     text-overflow: ellipsis;

+ 32 - 23
src/components/pages/task/addCourse.vue

@@ -117,6 +117,7 @@
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                   <button class="c_pub_button_add pub_btn_add_img" @click="
                     (dialogVisibleClass = true),
                     (dialogVisibleClass = true),
                     (classSearch = ''),
                     (classSearch = ''),
+                    (gradeId = ''),
                     getClass()
                     getClass()
                     ">添加班级</button>
                     ">添加班级</button>
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
                   <div v-if="checkboxList2.length" class="wb_j_box_p_box">
@@ -5249,24 +5250,17 @@
         <el-button type="primary" @click="isAddPP">确定</el-button>
         <el-button type="primary" @click="isAddPP">确定</el-button>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
-    <el-dialog
-      title="添加班级"
-      :visible.sync="dialogVisibleClass"
-      :append-to-body="true"
-      width="400px"
-      height="80%"
-      :before-close="handleClose"
-      class="addNewPP"
-    >
+    <el-dialog title="添加班级" :visible.sync="dialogVisibleClass" :append-to-body="true" width="400px" height="80%"
+      :before-close="handleClose" class="addNewPP">
       <div class="people" style="height: 300px">
       <div class="people" style="height: 300px">
         <div class="people_top">
         <div class="people_top">
           <div class="people_top_right">
           <div class="people_top_right">
             <div class="people_search">
             <div class="people_search">
-              <el-input
-                placeholder="搜索班级名称"
-                v-model="classSearch"
-                @input="getClass()"
-              ></el-input>
+              <el-select v-model="gradeId" placeholder="请选择年级" class="student_input" clearable @change="getClass()">
+                <el-option label="全部" value=""></el-option>
+                <el-option v-for="(item, index) in gradeList" :key="index" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+              <el-input placeholder="搜索班级名称" v-model="classSearch" @input="getClass()"></el-input>
               <!-- @click="getClass()" 
               <!-- @click="getClass()" 
                 @keyup.enter.native="getClass()"
                 @keyup.enter.native="getClass()"
                -->
                -->
@@ -5277,11 +5271,7 @@
           </div>
           </div>
           <div class="people_nav">选择班级</div>
           <div class="people_nav">选择班级</div>
         </div>
         </div>
-        <el-checkbox-group
-          v-model="checkboxList2"
-          class="people_name people_name2"
-          @change="InviteChange"
-        >
+        <el-checkbox-group v-model="checkboxList2" class="people_name people_name2" @change="InviteChange" v-if="grade2.length" >
           <div v-for="item in grade2" :key="item.id" class="p_box">
           <div v-for="item in grade2" :key="item.id" class="p_box">
             <el-checkbox :label="item.id">
             <el-checkbox :label="item.id">
               {{ item.name }}
               {{ item.name }}
@@ -5290,9 +5280,10 @@
               邀请码:{{ getInviteCodeC(item.id) }}</div> -->
               邀请码:{{ getInviteCodeC(item.id) }}</div> -->
             <!-- <div class="inviteCode" :class="{ noneInvite: !isInvite(item.id) }" v-if="checkboxList2.indexOf(item.id) != -1"
             <!-- <div class="inviteCode" :class="{ noneInvite: !isInvite(item.id) }" v-if="checkboxList2.indexOf(item.id) != -1"
               @click="OpenInviteD(item.id)">随机码设置</div>
               @click="OpenInviteD(item.id)">随机码设置</div>
-            <img src="../../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
+            <img src="../../assets/icon/rightInvite.png" class="inviteImg" v-if="isInvite(item.id)" /> -->
           </div>
           </div>
         </el-checkbox-group>
         </el-checkbox-group>
+        <div v-if="!grade2.length" style="padding:20px 10px">暂无数据</div>
       </div>
       </div>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
         <el-button @click="dialogVisibleClass = false">取 消</el-button>
@@ -6778,6 +6769,7 @@ export default {
       dialogVisiblePreTime: false,
       dialogVisiblePreTime: false,
       uploadJson: [],
       uploadJson: [],
       classJuri: [],
       classJuri: [],
+      gradeList: [],
       cover: [], //课程封面
       cover: [], //课程封面
       myWord: [],
       myWord: [],
       evaJuri: [],
       evaJuri: [],
@@ -6858,6 +6850,7 @@ export default {
       checkboxList2: [],
       checkboxList2: [],
       checkboxList3: [],
       checkboxList3: [],
       classSearch: "",
       classSearch: "",
+      gradeId:"",
       number: "",
       number: "",
       tTitle: "",
       tTitle: "",
       tdetail: "",
       tdetail: "",
@@ -8343,14 +8336,29 @@ export default {
     searchStudent() {
     searchStudent() {
       this.getStudent();
       this.getStudent();
     },
     },
+    selectGrage() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectGrageBySchool", params)
+        .then((res) => {
+          this.gradeList = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     //获取班级列表
     //获取班级列表
     getClass() {
     getClass() {
       let params = {
       let params = {
         oid: this.oid,
         oid: this.oid,
+        gid: this.gradeId,
         cn: this.classSearch,
         cn: this.classSearch,
       };
       };
       this.ajax
       this.ajax
-        .get(this.$store.state.api + "selectClassBySchoolSearch", params)
+        .get(this.$store.state.api + "selectClassBySchoolSearch2", params)
         .then((res) => {
         .then((res) => {
           if (!this.grade.length) {
           if (!this.grade.length) {
             this.grade = res.data[0];
             this.grade = res.data[0];
@@ -11201,6 +11209,7 @@ export default {
     this.getStudent();
     this.getStudent();
     this.getTeacher();
     this.getTeacher();
     this.getClass();
     this.getClass();
+    this.selectGrage();
     this.getTemplate();
     this.getTemplate();
     // this.selectType();
     // this.selectType();
     this.selectEva();
     this.selectEva();
@@ -11919,7 +11928,7 @@ export default {
   /* justify-content: space-between; */
   /* justify-content: space-between; */
   /* align-items: center; */
   /* align-items: center; */
   flex-direction: column;
   flex-direction: column;
-  padding: 10px 25px 0;
+  padding: 10px 10px 0;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 
 
@@ -11960,7 +11969,7 @@ export default {
 .people_name {
 .people_name {
   display: flex;
   display: flex;
   justify-content: flex-start;
   justify-content: flex-start;
-  padding: 20px 0 0 25px;
+  padding: 20px 10px;
   flex-direction: column;
   flex-direction: column;
   flex-wrap: wrap;
   flex-wrap: wrap;
 }
 }

部分文件因为文件数量过多而无法显示