lsc vor 2 Jahren
Ursprung
Commit
128df39d83
1 geänderte Dateien mit 89 neuen und 111 gelöschten Zeilen
  1. 89 111
      src/components/pages/GM/school.vue

+ 89 - 111
src/components/pages/GM/school.vue

@@ -1,76 +1,45 @@
 <template>
-  <div
-    class="pb_content"
-    style="
+  <div class="pb_content" style="
       overflow: auto;
       margin: 0px;
       box-sizing: border-box;
       width: 100%;
       height: 100%;
-    "
-  >
+    ">
     <div>
-      <div
-        class="pb_content_body"
-        style="
+      <div class="pb_content_body" style="
           background: #fff;
           padding: 0px 25px;
           box-sizing: border-box;
           margin: 10px auto 0;
-        "
-      >
+        ">
         <div class="pb_head">
           <span>学校管理</span>
           <!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
         </div>
         <div class="student_head">
           <div class="student_search">
-            <el-button
-                class="btnClassGM"
-              size="small"
-              type="primary"
-              @click="dialogVisible = true"
-              v-if="step == 0"
-              >添加学校</el-button
-            >
+            <el-button class="btnClassGM" size="small" type="primary" @click="dialogVisible = true" v-if="step == 0">
+              添加学校</el-button>
           </div>
         </div>
       </div>
       <div class="pb_content_body" style="margin: 0 auto 10px;">
         <div class="student_table">
-          <el-table
-            ref="table"
-            :data="tableData"
-            stripe
-            border
-            :header-cell-style="{
-              background: '#f1f1f1',
-              'text-align': 'center',
-            }"
-            :cell-style="{ 'text-align': 'center' }"
-            style="width: 100%"
-            :height="tableHeight"
-            v-loading="isLoading"
-          >
+          <el-table ref="table" :data="tableData" stripe border :header-cell-style="{
+            background: '#f1f1f1',
+            'text-align': 'center',
+          }" :cell-style="{ 'text-align': 'center' }" style="width: 100%" :height="tableHeight"
+            v-loading="isLoading">
             <el-table-column prop="name" label="学校名称" min-width="70">
             </el-table-column>
             <el-table-column prop="date" label="操作" min-width="30">
               <template slot-scope="scope">
                 <div class="pb_buttonBox">
-                  <el-button
-                  class="btnClassGM"
-                    size="mini"
-                    type="primary"
-                    @click="updateS(scope.row.id, scope.row.name)"
-                    >修改</el-button
-                  >
-                  <el-button
-                  class="btnClassGM"
-                    size="mini"
-                    type="primary"
-                    @click="deleteSchool(scope.row.id)"
-                    >删除</el-button
-                  >
+                  <el-button class="btnClassGM" size="mini" type="primary"
+                    @click="updateS(scope.row.id, scope.row.name)">修改</el-button>
+                  <el-button class="btnClassGM" size="mini" type="primary" @click="deleteSchool(scope.row.id)">删除
+                  </el-button>
                 </div>
               </template>
             </el-table-column>
@@ -78,52 +47,26 @@
         </div>
       </div>
       <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          v-if="page"
-          @current-change="handleCurrentChange"
-        ></el-pagination>
+        <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
+          @current-change="handleCurrentChange"></el-pagination>
       </div>
     </div>
-    <el-dialog
-      title="添加学校"
-      :visible.sync="dialogVisible"
-      width="500px"
-      :before-close="handleClose"
-      class="dialog_diy"
-      center
-    >
+    <el-dialog title="添加学校" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" class="dialog_diy"
+      center>
       <div class="addBox">
         <span class="tian1">学校名称</span>
-        <el-input
-          v-model="schoolName"
-          style="width: 250px; margin: 15px 0px"
-          placeholder="请输入学校名称"
-        ></el-input>
+        <el-input v-model="schoolName" style="width: 250px; margin: 15px 0px" placeholder="请输入学校名称"></el-input>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button class="btnClassGM" type="primary" @click="addSchool">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog
-      title="修改学校"
-      :visible.sync="dialogVisible1"
-      width="500px"
-      :before-close="handleClose"
-      class="dialog_diy"
-      center
-    >
+    <el-dialog title="修改学校" :visible.sync="dialogVisible1" width="500px" :before-close="handleClose" class="dialog_diy"
+      center>
       <div class="addBox">
         <span class="tian1">学校名称</span>
-        <el-input
-          v-model="schoolName"
-          style="width: 250px; margin: 15px 0px"
-          placeholder="请输入学校名称"
-        ></el-input>
+        <el-input v-model="schoolName" style="width: 250px; margin: 15px 0px" placeholder="请输入学校名称"></el-input>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible1 = false">取 消</el-button>
@@ -133,7 +76,7 @@
   </div>
 </template>
   
-  <script>
+<script>
 export default {
   data() {
     return {
@@ -354,7 +297,7 @@ export default {
                 });
             }
           })
-          .catch(() => {});
+          .catch(() => { });
       } else {
         var list = this.fileList;
         if (list.length == 0) {
@@ -480,21 +423,34 @@ export default {
           id: id,
         },
       ];
-      this.ajax
-        .post(this.$store.state.api + "deleteSchoolAdmin", params)
-        .then((res) => {
-          this.$message({
-            message: "删除成功",
-            type: "success",
-          });
-          this.updateId = "";
-          this.schoolName = "";
-          this.selectSchool();
+      let _this = this
+      _this
+        .$confirm("确定删除此学校吗?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
         })
-        .catch((err) => {
-          this.$message.error("删除成功");
-          console.error(err);
+        .then(() => {
+          _this.ajax
+            .post(this.$store.state.api + "deleteSchoolAdmin", params)
+            .then((res) => {
+              _this.$message({
+                message: "删除成功",
+                type: "success",
+              });
+              _this.updateId = "";
+              _this.schoolName = "";
+              _this.selectSchool();
+            })
+            .catch((err) => {
+              _this.$message.error("删除成功");
+              console.error(err);
+            });
+        })
+        .catch(() => {
+          return;
         });
+
     },
     selectType(id) {
       this.tableData1 = [];
@@ -718,45 +674,55 @@ export default {
 };
 </script>
   
-  <style scoped>
-.pb_head > span:nth-child(2) {
+<style scoped>
+.pb_head>span:nth-child(2) {
   font-size: 16px;
   margin-left: 80px;
   color: #ab582f;
 }
+
 .addBox {
   display: flex;
   align-items: center;
   justify-content: center;
 }
+
 .tian1 {
   /* font-size: 16px; */
   margin-right: 10px;
 }
+
 .pb_head {
   margin: 0 !important;
   width: 100% !important;
 }
+
 .student_page {
   margin: 10px 0 0 45px;
 }
-.disUoloadSty >>> .el-upload--picture-card {
-  display: none; /* 上传按钮隐藏 */
+
+.disUoloadSty>>>.el-upload--picture-card {
+  display: none;
+  /* 上传按钮隐藏 */
 }
+
 .dialogBox {
   display: flex;
   align-items: center;
   justify-content: center;
 }
+
 .dialogBox span {
   margin: 0 20px;
 }
+
 .student_head {
   margin-top: 10px;
   padding-bottom: 15px;
   display: flex;
   justify-content: space-between;
 }
+
 .student_search,
 .student_search1 {
   display: flex;
@@ -772,43 +738,50 @@ export default {
   justify-content: space-between;
 }
 
-.student_table >>> .el-table--border td {
+.student_table>>>.el-table--border td {
   border-right: 0px !important;
 }
 
-.student_table >>> .el-table,
-.student_table >>> .el-table__body-wrapper {
+.student_table>>>.el-table,
+.student_table>>>.el-table__body-wrapper {
   height: auto !important;
 }
 
-.el-table >>> .even_row {
+.el-table>>>.even_row {
   background-color: #f1f1f1 !important;
 }
 
-.dialog_diy >>> .el-dialog__header {
+.dialog_diy>>>.el-dialog__header {
   padding: 9px 20px 10px;
   background: #32455b !important;
 }
-.dialog_diy >>> .el-dialog__title {
+
+.dialog_diy>>>.el-dialog__title {
   color: #fff;
   font-size: 15px;
 }
-.dialog_diy >>> .el-dialog__headerbtn {
+
+.dialog_diy>>>.el-dialog__headerbtn {
   top: 14px;
 }
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
   color: #fff;
 }
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
   color: #fff;
 }
-.dialog_diy >>> .el-dialog__body,
-.dialog_diy >>> .el-dialog__footer {
+
+.dialog_diy>>>.el-dialog__body,
+.dialog_diy>>>.el-dialog__footer {
   background: #fafafa;
 }
-.r_diy >>> .el-dialog__footer {
+
+.r_diy>>>.el-dialog__footer {
   padding: 0;
 }
+
 .a_addBox {
   height: 570px;
   overflow: auto;
@@ -827,6 +800,7 @@ export default {
   padding: 20px;
   box-sizing: border-box;
 }
+
 .cancelbox {
   position: absolute;
   z-index: 2;
@@ -838,17 +812,21 @@ export default {
   padding: 0 90px 0px 0px;
   box-sizing: border-box;
 }
+
 .cardList {
   font-size: 14px;
   height: 360px;
   overflow: auto;
 }
+
 .cardList div {
   margin-bottom: 18px;
 }
+
 .cardList div:last-child {
   margin-bottom: 0;
 }
+
 .cardHead {
   display: flex;
 }