Browse Source

clazz-manage 0f

zhangjie 3 năm trước cách đây
mục cha
commit
f94ca7d809

+ 240 - 0
src/constants/menus-data.js

@@ -1455,6 +1455,106 @@ export default [
               }
             ]
           },
+          {
+            id: "1002",
+            name: "课程简单管理",
+            url: "CourseSimpleManage",
+            type: "MENU",
+            parentId: "356",
+            schoolId: "2",
+            sequence: 3,
+            enable: true,
+            urls: [
+              {
+                id: "96",
+                name: "课程简单管理-查询",
+                url: "/api/admin/basic/course/list",
+                type: "URL",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "97",
+                name: "课程简单管理-新增/修改",
+                url: "/api/admin/basic/course/save",
+                type: "URL",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 2,
+                enable: true
+              }
+            ],
+            buttons: [
+              {
+                id: "263",
+                name: "课程简单管理-查询",
+                url: "Select",
+                type: "BUTTON",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "385",
+                name: "课程简单管理-新增",
+                url: "Add",
+                type: "BUTTON",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              }
+            ],
+            links: [
+              {
+                id: "268",
+                name: "课程简单管理-编辑",
+                url: "Edit",
+                type: "LINK",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "269",
+                name: "课程简单管理-启用&禁用",
+                url: "Enable",
+                type: "LINK",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 2,
+                enable: true
+              }
+            ],
+            lists: [
+              {
+                id: "271",
+                name: "课程简单管理-列表",
+                url: "List",
+                type: "LIST",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              }
+            ],
+            conditions: [
+              {
+                id: "270",
+                name: "课程简单管理-查询条件",
+                url: "Condition",
+                type: "CONDITION",
+                parentId: "13",
+                schoolId: "2",
+                sequence: 2,
+                enable: true
+              }
+            ]
+          },
           {
             id: "13",
             name: "课程管理",
@@ -1983,6 +2083,146 @@ export default [
               }
             ]
           },
+          {
+            id: "1003",
+            name: "班级简单管理",
+            url: "ClazzSimpleManage",
+            type: "MENU",
+            parentId: "356",
+            schoolId: "2",
+            sequence: 1,
+            enable: true,
+            urls: [
+              {
+                id: "451",
+                name: "班级基本信息管理-查询",
+                url: "/api/admin/basic/clazz/query",
+                type: "URL",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "452",
+                name: "班级基本信息管理-新增/编辑",
+                url: "/api/admin/basic/clazz/save",
+                type: "URL",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 2,
+                enable: true
+              },
+              {
+                id: "453",
+                name: "班级基本信息管理-批量删除(逻辑)",
+                url: "/api/admin/basic/clazz/delete_batch",
+                type: "URL",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 3,
+                enable: true
+              },
+              {
+                id: "454",
+                name: "班级基本信息管理-批量导入(异步)",
+                url: "/api/admin/basic/clazz/data_import",
+                type: "URL",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 4,
+                enable: true
+              },
+              {
+                id: "462",
+                name: "班级数据源查询",
+                url: "/api/admin/basic/clazz/datasource",
+                type: "URL",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 5,
+                enable: true
+              }
+            ],
+            buttons: [
+              {
+                id: "455",
+                name: "班级管理-查询",
+                url: "Select",
+                type: "BUTTON",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "457",
+                name: "班级管理-新增",
+                url: "Add",
+                type: "BUTTON",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "460",
+                name: "班级管理-批量导入",
+                url: "Import",
+                type: "BUTTON",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 2,
+                enable: true
+              }
+            ],
+            links: [
+              {
+                id: "458",
+                name: "班级管理-编辑",
+                url: "Edit",
+                type: "LINK",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              },
+              {
+                id: "459",
+                name: "班级管理-删除",
+                url: "Delete",
+                type: "LINK",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              }
+            ],
+            lists: [
+              {
+                id: "456",
+                name: "班级管理-列表",
+                url: "List",
+                type: "LIST",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              }
+            ],
+            conditions: [
+              {
+                id: "461",
+                name: "班级管理-查询条件",
+                url: "Condition",
+                type: "CONDITION",
+                parentId: "450",
+                schoolId: "2",
+                sequence: 1,
+                enable: true
+              }
+            ]
+          },
           {
             name: "学期管理",
             url: "SemesterManage",

+ 36 - 0
src/modules/base/api.js

@@ -139,6 +139,22 @@ export const updateCourse = datas => {
 export const ableCourse = ({ idList, enable }) => {
   return $postParam("/api/admin/basic/course/enable", { idList, enable });
 };
+export const batchDeableCourse = datas => {
+  return $postParam("/api/admin/basic/course/enable", datas);
+};
+// course-simple-manage
+export const courseSimpleListPage = datas => {
+  return $postParam("/api/admin/basic/course/list", datas);
+};
+export const courseSimpleQuery = datas => {
+  return $postParam("/api/admin/basic/course/query", datas);
+};
+export const deleteCourseSimple = idList => {
+  return $postParam("/api/admin/basic/course/delete_batch", { idList });
+};
+export const updateCourseSimple = datas => {
+  return $post("/api/admin/basic/course/save", datas);
+};
 // flow-manage
 export const flowListPage = datas => {
   return $postParam("/api/admin/flow/list", datas);
@@ -262,6 +278,15 @@ export const deleteFilterStudent = datas => {
 export const updateStudent = datas => {
   return $post("/api/admin/basic/student/save", datas);
 };
+export const studentSimpleListQuery = datas => {
+  return $postParam("/api/admin/basic/student/query", datas);
+};
+export const deleteStudentSimple = idList => {
+  return $postParam("/api/admin/basic/student/delete_batch", { idList });
+};
+export const updateStudentSimple = datas => {
+  return $post("/api/admin/basic/student/save", datas);
+};
 
 // clazz-manage
 export const clazzListQuery = datas => {
@@ -277,6 +302,17 @@ export const clazzQuery = datas => {
   return $postParam("/api/admin/basic/clazz/datasource", datas);
 };
 
+// clazz-simple-manage
+export const clazzSimpleListPage = datas => {
+  return $postParam("/api/admin/basic/clazz/query", datas);
+};
+export const deleteClazzSimple = idList => {
+  return $postParam("/api/admin/basic/clazz/delete_batch", { idList });
+};
+export const updateClazzSimple = datas => {
+  return $post("/api/admin/basic/clazz/save", datas);
+};
+
 // semester-manage
 export const semesterListQuery = datas => {
   return $postParam("/api/admin/basic/semester/query", datas);

+ 148 - 0
src/modules/base/components/ModifyClazzSimple.vue

@@ -0,0 +1,148 @@
+<template>
+  <el-dialog
+    class="modify-clazz"
+    :visible.sync="modalIsShow"
+    :title="title"
+    top="10vh"
+    width="448px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      :key="modalForm.id"
+      label-position="top"
+    >
+      <el-form-item prop="clazzName" label="班级名称:">
+        <el-input
+          v-model.trim="modalForm.clazzName"
+          placeholder="请输入班级名称"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="courseId" label="课程:">
+        <el-select
+          v-model="modalForm.courseId"
+          placeholder="课程"
+          clearable
+          style="width:100%"
+        >
+          <el-option
+            v-for="item in courses"
+            :key="item.id"
+            :value="item.id"
+            :label="item.name"
+          >
+            <span>{{ `${item.name}(${item.code})` }}</span>
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { updateClazzSimple } from "../api";
+
+const initModalForm = {
+  id: null,
+  clazzName: "",
+  courseId: ""
+};
+
+export default {
+  name: "modify-clazz-simple",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    },
+    courses: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
+  computed: {
+    isEdit() {
+      return !!this.instance.id;
+    },
+    title() {
+      return (this.isEdit ? "编辑" : "新增") + "班级";
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: { ...initModalForm },
+      rules: {
+        clazzName: [
+          {
+            required: true,
+            message: "请输入班级名称",
+            trigger: "change"
+          },
+          {
+            max: 30,
+            message: "班级名称不能超过30个字",
+            trigger: "change"
+          }
+        ],
+        courseId: [
+          {
+            required: true,
+            message: "请选择课程",
+            trigger: "change"
+          }
+        ]
+      }
+    };
+  },
+  methods: {
+    initData(val) {
+      this.modalForm = this.$objAssign(initModalForm, val);
+    },
+    visibleChange() {
+      this.initData(this.instance);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      let datas = { ...this.modalForm };
+      const data = await updateClazzSimple(datas).catch(() => {
+        this.isSubmit = false;
+      });
+
+      if (!data) return;
+
+      this.isSubmit = false;
+      this.$message.success(this.title + "成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 198 - 0
src/modules/base/components/ModifyClazzSimpleStudent.vue

@@ -0,0 +1,198 @@
+<template>
+  <div>
+    <el-dialog
+      class="modify-clazz-simple-student page-dialog"
+      :visible.sync="modalIsShow"
+      :title="title"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      fullscreen
+      destroy-on-close
+      @open="visibleChange"
+    >
+      <div class="part-box part-box-filter part-box-flex">
+        <el-form
+          ref="FilterForm"
+          label-position="left"
+          label-width="85px"
+          inline
+        >
+          <template v-if="checkPrivilege('condition', 'condition')">
+            <el-form-item label="学生:">
+              <el-input
+                v-model="filter.queryParams"
+                placeholder="请输入姓名或者学号"
+              ></el-input>
+            </el-form-item>
+          </template>
+          <el-form-item>
+            <el-button
+              v-if="checkPrivilege('button', 'select')"
+              type="primary"
+              @click="toPage(1)"
+              >查询</el-button
+            >
+          </el-form-item>
+        </el-form>
+        <div class="part-box-action">
+          <upload-button
+            v-if="checkPrivilege('button', 'add')"
+            btn-icon="el-icon-circle-plus-outline"
+            btn-content="批量导入"
+            btn-type="success"
+            :upload-url="uploadUrl"
+            :format="['xls', 'xlsx']"
+            @upload-error="uplaodError"
+            @upload-success="uploadSuccess"
+          >
+          </upload-button>
+          <el-button
+            v-if="checkPrivilege('button', 'add')"
+            type="primary"
+            icon="el-icon-circle-plus-outline"
+            @click="toAdd"
+            >新增学生</el-button
+          >
+        </div>
+      </div>
+
+      <div class="part-box part-box-pad">
+        <el-table ref="TableList" :data="studentList">
+          <el-table-column
+            type="index"
+            label="序号"
+            width="70"
+            :index="indexMethod"
+          ></el-table-column>
+          <el-table-column prop="studentName" label="姓名"> </el-table-column>
+          <el-table-column prop="studentCode" label="学号"> </el-table-column>
+          <el-table-column prop="collegeName" label="院系"> </el-table-column>
+          <el-table-column prop="majorName" label="专业"> </el-table-column>
+          <el-table-column prop="clazz" label="班级"> </el-table-column>
+          <el-table-column class-name="action-column" label="操作" width="80">
+            <template slot-scope="scope">
+              <el-button
+                class="btn-danger"
+                type="text"
+                @click="toDelete(scope.row)"
+                >移除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="part-page">
+          <el-pagination
+            background
+            layout="total,prev, pager, next"
+            :current-page="current"
+            :total="total"
+            :page-size="size"
+            @current-change="toPage"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- ModifyStudentSimple -->
+    <modify-student-simple
+      ref="ModifyStudentSimple"
+      :instance="curStudent"
+      @modified="getList"
+    ></modify-student-simple>
+  </div>
+</template>
+
+<script>
+import { studentSimpleListQuery, deleteStudentSimple } from "../api";
+import ModifyStudentSimple from "./ModifyStudentSimple";
+import UploadButton from "../../../components/UploadButton";
+
+export default {
+  name: "modify-clazz-simple-student",
+  components: { UploadButton, ModifyStudentSimple },
+  props: {
+    clazz: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      filter: {
+        clazzId: "",
+        queryParams: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      studentList: [],
+      curStudent: {},
+      // import
+      uploadUrl: "/api/admin/basic/student/data_import",
+      downloadUrl: "/temps/studentTemplate.xlsx",
+      dfilename: "学生导入模板.xlsx"
+    };
+  },
+  computed: {
+    title() {
+      return `学生管理-${this.clazz.clazzName}`;
+    }
+  },
+  methods: {
+    visibleChange() {
+      this.filter.clazzId = this.clazz.id;
+      this.toPage(1);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      const data = await studentSimpleListQuery(datas);
+      this.studentList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    toAdd() {
+      this.curStudent = {};
+      this.$refs.ModifyStudentSimple.open();
+    },
+    toDelete(row) {
+      this.$confirm(`确定要移除学生【${row.studentName}】吗?`, "提示", {
+        type: "warning"
+      })
+        .then(async () => {
+          await deleteStudentSimple([row.id]);
+          this.$message.success("操作成功!");
+          this.deletePageLastItem();
+        })
+        .catch(() => {});
+    },
+    // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
+    uploadSuccess() {
+      this.$message.success("文件上传成功,后台正在导入!");
+      this.getList();
+    }
+  }
+};
+</script>

+ 1 - 1
src/modules/base/components/ModifyCourse.vue

@@ -38,7 +38,7 @@
           clearable
         ></teaching-room-select>
       </el-form-item>
-      <el-form-item prop="clazzIdSet" label="授课班级:">
+      <el-form-item label="授课班级:">
         <clazz-select
           v-model="modalForm.clazzIdSet"
           placeholder="请选择授课班级"

+ 139 - 0
src/modules/base/components/ModifyCourseSimple.vue

@@ -0,0 +1,139 @@
+<template>
+  <el-dialog
+    class="modify-course"
+    :visible.sync="modalIsShow"
+    :title="title"
+    top="10vh"
+    width="550px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      :key="modalForm.id"
+      label-position="top"
+    >
+      <el-form-item prop="courseName" label="课程名称:">
+        <el-input
+          v-model.trim="modalForm.courseName"
+          placeholder="请输入课程名称"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="courseCode" label="课程编码:">
+        <el-input
+          v-model.trim="modalForm.courseCode"
+          placeholder="请输入课程编码"
+          clearable
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { updateCourseSimple, getCode } from "../api";
+
+const initModalForm = {
+  id: null,
+  courseName: "",
+  courseCode: ""
+};
+
+export default {
+  name: "modify-course-simple",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  computed: {
+    isEdit() {
+      return !!this.instance.id;
+    },
+    title() {
+      return (this.isEdit ? "编辑" : "新增") + "课程";
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: { ...initModalForm },
+      rules: {
+        courseName: [
+          {
+            required: true,
+            // pattern: /^[0-9a-zA-Z\u4E00-\u9FA5]{1,20}$/,
+            // message: "课程名称只能输入汉字、数字和字母,长度不能超过20",
+            message: "课程名称不能超过30个字",
+            max: 30,
+            trigger: "change"
+          }
+        ],
+        courseCode: [
+          {
+            required: true,
+            pattern: /^[0-9a-zA-Z_-]{3,30}$/,
+            message: "课程编码只能由数字字母短横线组成,长度在3-30之间",
+            trigger: "change"
+          }
+        ]
+      }
+    };
+  },
+  methods: {
+    initData(val) {
+      if (val.id) {
+        this.modalForm = this.$objAssign(initModalForm, val);
+      } else {
+        this.modalForm = { ...initModalForm };
+        this.createCode();
+      }
+    },
+    async createCode() {
+      this.modalForm.courseCode = await getCode("COURSE_CODE");
+    },
+    visibleChange() {
+      this.initData(this.instance);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      let datas = { ...this.modalForm };
+      const data = await updateCourseSimple(datas).catch(() => {
+        this.isSubmit = false;
+      });
+
+      if (!data) return;
+
+      this.isSubmit = false;
+      this.$message.success(this.title + "成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 142 - 0
src/modules/base/components/ModifyStudentSimple.vue

@@ -0,0 +1,142 @@
+<template>
+  <el-dialog
+    class="modify-student"
+    :visible.sync="modalIsShow"
+    :title="title"
+    top="10px"
+    width="448px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    destroy-on-close
+    @open="visibleChange"
+  >
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      :key="modalForm.id"
+      label-position="top"
+    >
+      <el-form-item prop="studentName" label="姓名:">
+        <el-input
+          v-model.trim="modalForm.studentName"
+          placeholder="请输入姓名"
+          clearable
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="studentCode" label="学号:">
+        <el-input
+          v-model.trim="modalForm.studentCode"
+          placeholder="请输入学号"
+          clearable
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { updateStudentSimple } from "../api";
+
+const initModalForm = {
+  id: null,
+  studentName: "",
+  studentCode: ""
+};
+
+export default {
+  name: "modify-student-simple",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  computed: {
+    isEdit() {
+      return !!this.instance.id;
+    },
+    title() {
+      return (this.isEdit ? "编辑" : "新增") + "学生";
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: { ...initModalForm },
+      rules: {
+        studentName: [
+          {
+            required: true,
+            message: "请输入姓名",
+            trigger: "change"
+          },
+          {
+            message: "姓名不能超过50个字",
+            max: 50,
+            trigger: "change"
+          }
+        ],
+        studentCode: [
+          {
+            required: true,
+            message: "请输入学号",
+            trigger: "change"
+          },
+          {
+            message: "学号不能超过50个字",
+            max: 50,
+            trigger: "change"
+          }
+        ]
+      },
+      clazzList: []
+    };
+  },
+  methods: {
+    initData(val) {
+      if (val.id) {
+        this.modalForm = this.$objAssign(initModalForm, val);
+      } else {
+        this.modalForm = { ...initModalForm };
+      }
+    },
+    visibleChange() {
+      this.initData(this.instance);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      const data = await updateStudentSimple(this.modalForm).catch(() => {
+        this.isSubmit = false;
+      });
+
+      if (!data) return;
+
+      this.isSubmit = false;
+      this.$message.success(this.title + "成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 12 - 0
src/modules/base/router.js

@@ -20,6 +20,8 @@ import ClazzManage from "./views/ClazzManage.vue";
 import SemesterManage from "./views/SemesterManage.vue";
 import MajorManage from "./views/MajorManage.vue";
 import ExamManage from "./views/ExamManage.vue";
+import CourseSimpleManage from "./views/CourseSimpleManage.vue";
+import ClazzSimpleManage from "./views/ClazzSimpleManage.vue";
 
 export default [
   {
@@ -116,5 +118,15 @@ export default [
     path: "/base/exam-manage",
     name: "ExamManage",
     component: ExamManage
+  },
+  {
+    path: "/base/course-simple-manage",
+    name: "CourseSimpleManage",
+    component: CourseSimpleManage
+  },
+  {
+    path: "/base/clazz-simple-manage/:courseId?",
+    name: "ClazzSimpleManage",
+    component: ClazzSimpleManage
   }
 ];

+ 193 - 0
src/modules/base/views/ClazzSimpleManage.vue

@@ -0,0 +1,193 @@
+<template>
+  <div class="clazz-simple-manage">
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
+        <template v-if="checkPrivilege('condition', 'condition')">
+          <el-form-item label="课程:">
+            <el-select v-model="filter.courseId" placeholder="课程" clearable>
+              <el-option
+                v-for="item in courses"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              >
+                <span>{{ `${item.name}(${item.code})` }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="班级名称:">
+            <el-input
+              style="width: 142px;"
+              v-model.trim="filter.queryParams"
+              placeholder="班级名称"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </template>
+        <el-form-item>
+          <el-button
+            v-if="checkPrivilege('button', 'select')"
+            type="primary"
+            @click="toPage(1)"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <div class="part-box-action">
+        <el-button
+          v-if="checkPrivilege('button', 'add')"
+          type="primary"
+          icon="el-icon-circle-plus-outline"
+          @click="toAdd"
+          >新增班级</el-button
+        >
+      </div>
+    </div>
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="dataList">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="clazzName" label="班级名称"></el-table-column>
+        <el-table-column prop="studentCount" label="学生人数"></el-table-column>
+        <el-table-column prop="createTime" label="创建时间">
+          <span slot-scope="scope">{{
+            scope.row.createTime | timestampFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column class-name="action-column" label="操作" width="170px">
+          <template slot-scope="scope">
+            <el-button
+              v-if="checkPrivilege('link', 'edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEdit(scope.row)"
+              >重命名</el-button
+            >
+            <el-button
+              v-if="checkPrivilege('link', 'edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEditStudent(scope.row)"
+              >人员管理</el-button
+            >
+            <el-button
+              v-if="checkPrivilege('link', 'delete')"
+              class="btn-danger"
+              type="text"
+              @click="toDelete(scope.row)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <!-- ModifyClazzSimple -->
+    <modify-clazz-simple
+      :instance="curRow"
+      :courses="courses"
+      @modified="getList"
+      ref="ModifyClazzSimple"
+    ></modify-clazz-simple>
+    <!-- ModifyClazzSimpleStudent -->
+    <modify-clazz-simple-student
+      ref="ModifyClazzSimpleStudent"
+      :clazz="curRow"
+      @modified="getList"
+    ></modify-clazz-simple-student>
+  </div>
+</template>
+
+<script>
+import {
+  clazzSimpleListPage,
+  courseSimpleQuery,
+  deleteClazzSimple
+} from "../api";
+import ModifyClazzSimple from "../components/ModifyClazzSimple";
+import ModifyClazzSimpleStudent from "../components/ModifyClazzSimpleStudent";
+
+export default {
+  name: "clazz-simple-manage",
+  components: { ModifyClazzSimple, ModifyClazzSimpleStudent },
+  data() {
+    return {
+      filter: {
+        courseId: "",
+        queryParams: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      courses: [],
+      dataList: [],
+      curRow: {}
+    };
+  },
+  mounted() {
+    this.filter.courseId = this.$route.params.courseId;
+    this.getCourseSimple();
+    this.getList();
+  },
+  methods: {
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      const data = await clazzSimpleListPage(datas);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    async getCourseSimple() {
+      const data = await courseSimpleQuery();
+      this.courses = data || [];
+    },
+    toAdd() {
+      this.curRow = { courseId: this.filter.courseId };
+      this.$refs.ModifyClazzSimple.open();
+    },
+    toEdit(row) {
+      this.curRow = row;
+      this.$refs.ModifyClazzSimple.open();
+    },
+    toEditStudent(row) {
+      this.curRow = row;
+      this.$refs.ModifyClazzSimpleStudent.open();
+    },
+    toDelete(row) {
+      this.$confirm(`确定要删除班级【${row.clazzName}】吗?`, "提示", {
+        type: "warning"
+      })
+        .then(async () => {
+          await deleteClazzSimple([row.id]);
+          this.$message.success("删除成功!");
+          this.deletePageLastItem();
+        })
+        .catch(() => {});
+    }
+  }
+};
+</script>

+ 18 - 1
src/modules/base/views/CourseManage.vue

@@ -58,6 +58,7 @@
         </el-form-item>
       </el-form>
       <div class="part-box-action">
+        <el-button type="danger" @click="toBatchDeable">批量禁用</el-button>
         <el-button
           type="success"
           icon="el-icon-download"
@@ -160,7 +161,12 @@
 </template>
 
 <script>
-import { courseListPage, deleteCourse, ableCourse } from "../api";
+import {
+  courseListPage,
+  deleteCourse,
+  ableCourse,
+  batchDeableCourse
+} from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
 import ModifyCourse from "../components/ModifyCourse";
 import UploadButton from "../../../components/UploadButton";
@@ -258,6 +264,17 @@ export default {
         })
         .catch(() => {});
     },
+    toBatchDeable() {
+      this.$confirm(`确定要禁用当前查询的所有课程吗?`, "提示", {
+        type: "warning"
+      })
+        .then(async () => {
+          // TODO:
+          await batchDeableCourse({ ...this.filter });
+          this.$message.success("操作成功!");
+        })
+        .catch(() => {});
+    },
     // import
     uplaodError(errorData) {
       this.$notify.error({ title: "错误提示", message: errorData.message });

+ 166 - 0
src/modules/base/views/CourseSimpleManage.vue

@@ -0,0 +1,166 @@
+<template>
+  <div class="course-simple-manage">
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
+        <template v-if="checkPrivilege('condition', 'condition')">
+          <el-form-item label="课程名称:">
+            <el-input
+              style="width: 142px;"
+              v-model.trim="filter.courseName"
+              placeholder="课程名称"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </template>
+        <el-form-item>
+          <el-button
+            v-if="checkPrivilege('button', 'select')"
+            type="primary"
+            @click="toPage(1)"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <div class="part-box-action">
+        <el-button
+          v-if="checkPrivilege('button', 'add')"
+          type="primary"
+          icon="el-icon-circle-plus-outline"
+          @click="toAdd"
+          >新增课程</el-button
+        >
+      </div>
+    </div>
+
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="courses">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="courseName" label="课程名称"></el-table-column>
+        <el-table-column prop="courseCode" label="课程编码"></el-table-column>
+        <el-table-column prop="createTime" label="创建时间">
+          <span slot-scope="scope">{{
+            scope.row.createTime | timestampFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column class-name="action-column" label="操作" width="160">
+          <template slot-scope="scope">
+            <el-button
+              v-if="checkPrivilege('link', 'edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEdit(scope.row)"
+              >编辑</el-button
+            >
+            <el-button
+              v-if="checkPrivilege('link', 'edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEditClazz(scope.row)"
+              >班级管理</el-button
+            >
+            <el-button
+              class="btn-danger"
+              type="text"
+              @click="toDelete(scope.row)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <!-- ModifyCourseSimple -->
+    <modify-course-simple
+      ref="ModifyCourseSimple"
+      :instance="curCourse"
+      @modified="getList"
+    ></modify-course-simple>
+  </div>
+</template>
+
+<script>
+import { courseSimpleListPage, deleteCourseSimple } from "../api";
+import ModifyCourseSimple from "../components/ModifyCourseSimple";
+
+export default {
+  name: "course-simple-manage",
+  components: { ModifyCourseSimple },
+  data() {
+    return {
+      filter: {
+        courseName: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      courses: [],
+      curCourse: {}
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+
+      const data = await courseSimpleListPage(datas);
+      this.courses = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    toAdd() {
+      this.curCourse = {};
+      this.$refs.ModifyCourseSimple.open();
+    },
+    toEdit(row) {
+      this.curCourse = row;
+      this.$refs.ModifyCourseSimple.open();
+    },
+    toEditClazz(row) {
+      this.$router.push({
+        name: "ClazzSimpleManage",
+        params: {
+          courseId: row.id
+        }
+      });
+    },
+    toDelete(row) {
+      this.$confirm(`确定要删除课程【${row.courseName}】吗?`, "提示", {
+        type: "warning"
+      })
+        .then(async () => {
+          await deleteCourseSimple([row.id]);
+          this.$message.success("删除成功!");
+          this.deletePageLastItem();
+        })
+        .catch(() => {});
+    }
+  }
+};
+</script>