11wqe1 2 days ago
parent
commit
54c387c2e4

+ 4 - 2
src/components/pages/studentManageNew/component/addstu.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="addstudia_box">
     <el-dialog class="addstudia" :visible.sync="addStuVisible" width="800px">
       <template #title>
         <div class="title_box">
@@ -243,7 +243,7 @@ export default {
         if (newVal == 1) {
           this.stuListTypeList = [];
           this.addStuType = 3;
-          this.$refs.allClaAddSturef.clearData();
+          // this.$refs.allClaAddSturef.clearData();
         } else if (newVal == 0) {
           this.stuListTypeList = this.tab1;
           this.addStuType = 1;
@@ -336,8 +336,10 @@ export default {
       this.addStuVisible = true;
       this.searchStuName= "";
       console.log('666');
+
       // this.addStuType=1
       if (this.boxType == 1) {
+        this.$refs.allClaAddSturef.clearData();
         this.stuListTypeList = [];
         this.addStuType = 3;
       } else if (this.boxType == 0) {

+ 17 - 16
src/components/pages/studentManageNew/component/table.vue

@@ -40,10 +40,7 @@
           <template v-if="interestType == 1">
             <span
               style="cursor: pointer;min-width: 35px;"
-              @click="
-                interestType = 0;
-                refresh();
-              "
+              @click="backInterestCla()"
               >{{ activeinfo.name }}</span
             >
             <i class="el-icon-arrow-right"></i>
@@ -260,8 +257,7 @@
                       删除
                     </div>
                   </template>
-                  <template v-if="boxType == 1">
-                    <!-- <div @click="viewStudent(scope.row)">查看</div> -->
+                  <template v-if="boxType == 1 && interestType == 0">
                     <div @click="editInterestCla(scope.row)">编辑</div>
                     <div @click="deleteCla(scope.row.id,0,scope.row.createuserid)">删除</div>
                   </template>
@@ -817,9 +813,6 @@ export default {
       ];
       XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
       XLSX.writeFile(workbook, this.activeinfo.name + "学生列表.xlsx");
-      // const wopts = { bookType: "xlsx", bookSST: false, type: "array" };//写入的样式bookType:输出的文件类型,type:输出的数据类型,bookSST: 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
-      // const wbout = XLSX.write(workbook, wopts);// 浏览器端和node共有的API,实际上node可以直接使用xlsx.writeFile来写入文件,但是浏览器没有该API
-      // FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
       this.$message({
         message: "导出成功",
         type: "success",
@@ -1119,6 +1112,7 @@ export default {
         this.update_Student(this.EditStubox);
       }
     },
+    // 删除学生
     onedelstu(){
       let params = [{ uid: this.delStuinfo.userid, state: 0 }];
           this.ajax
@@ -1226,20 +1220,23 @@ export default {
       }
       this.$refs.editInterstcla.InterestClaEditvisible = true;
       this.InterestClaEditInfo = JSON.parse(JSON.stringify(row));
-      // this.$refs.editInterstcla.getdata();
+    },
+    // 兴趣班级返回到兴趣班列表
+    backInterestCla(){
+      this.interestType = 0;
+      this.tableColumns = this.tableInterestClaColumns;
+      this.getInterestClass();
     },
     // 查看兴趣班学生
-    viewStudent(row, column, event) {
+    viewStudent(row) {
       // console.log('111');
-      console.log(row, column, event);
-
-      // if (row.createuserid != this.userid) return
-      
+      // console.log(row, column, event);
       if (this.boxType == 1 && this.interestType == 0) {
         this.interestType = 1;
         this.tableColumns = this.studentColumns;
         this.activeId = row.id;
-        this.refresh();
+        this.tableData = [];
+        this.getStudent();
         this.activeinfo = row;
       }
       
@@ -1431,11 +1428,15 @@ export default {
 
     // 刷新
     refresh() {
+      // 将tab表格页数重置
       this.page = 1;
       this.pageSize = 10;
       this.total = 0;
+      // 清除表格数据
       this.tableData = [];
+      // 清除选中数据
       this.selectedData = [];
+
       if (this.boxType == 0) {
         // 清除选中数据
         if (this.selectedData.length > 0) {

+ 12 - 1
src/components/pages/studentManageNew/index.vue

@@ -38,7 +38,7 @@
               :title="k.name"
             >
               <el-menu-item :index="k.id" style="font-weight: normal;" @click="handleClick(k.id, 0,k)">
-                <span>{{ k.name }}</span>
+                <div class="tabcla_box">{{ k.name }}</div>
                 <span>({{ k.pnum }}人)</span>
               </el-menu-item>
             </el-menu-item-group>
@@ -75,6 +75,7 @@
     <!-- 右侧table区域 -->
     <div class="leftbox">
       <tableL
+        ref="tableLref"
         :activeIdL="activeId"
         :boxType="boxType"
         :GrapTableData="cascaderData"
@@ -328,6 +329,10 @@ export default {
       this.boxType = index;
       this.activeId = id;
       this.activeinfo = item;
+      if (index == 1 && this.$refs.tableLref.interestType == 1) {
+        this.$refs.tableLref.interestType = 0;
+        this.$refs.tableLref.refresh();
+      }
     },
   },
   mounted() {
@@ -347,6 +352,12 @@ export default {
   height: 100%;
   font-family: PingFang SC, PingFang SC;
 }
+.tabcla_box{
+  /* max-width: 80px; */
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
 .rigbox {
   background: #fff;
   height: 100%;