Przeglądaj źródła

扫描任务管理

zhangjie 2 lat temu
rodzic
commit
f0bca15786

+ 20 - 2
src/constants/menus-data.js

@@ -732,6 +732,24 @@ export default [
         parentId: "510",
         sequence: 1,
         enable: true
+      },
+      {
+        id: "511",
+        name: "学期管理-批量删除",
+        url: "batchDelete",
+        type: "BUTTON",
+        parentId: "510",
+        sequence: 1,
+        enable: true
+      },
+      {
+        id: "511",
+        name: "学期管理-导入",
+        url: "export",
+        type: "BUTTON",
+        parentId: "510",
+        sequence: 1,
+        enable: true
       }
     ],
     links: [
@@ -746,8 +764,8 @@ export default [
       },
       {
         id: "559",
-        name: "学期管理-设置当前使用学期",
-        url: "Edit",
+        name: "学期管理-详情",
+        url: "detail",
         type: "LINK",
         parentId: "510",
         sequence: 1,

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

@@ -68,6 +68,9 @@ export const userBoundRoles = userId => {
 export const roleBoundDataPriviledge = datas => {
   return $postParam("/api/admin/sys/role/bind_range", datas);
 };
+export const roleUserListQuery = datas => {
+  return $postParam("/api/admin/sys/role/query", datas);
+};
 // role-user-manage
 export const roleGroupList = datas => {
   return $postParam("/api/admin/sys/role/group/list", datas);

+ 0 - 178
src/modules/base/components/ModifyCourse.vue

@@ -1,178 +0,0 @@
-<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-item prop="teachingRoomId" label="开课部门:">
-        <org-select
-          v-model="modalForm.teachingRoomId"
-          style="width:100%;"
-          placeholder="开课部门"
-        ></org-select>
-      </el-form-item>
-      <el-form-item label="授课班级:">
-        <clazz-select
-          v-model="modalForm.clazzIdSet"
-          placeholder="请选择授课班级"
-          multiple
-          clearable
-          style="width:100%;"
-        ></clazz-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 { updateCourse, getCode } from "../api";
-
-const initModalForm = {
-  id: null,
-  courseName: "",
-  courseCode: "",
-  teachingRoomId: "",
-  clazzIdSet: ""
-};
-
-export default {
-  name: "modify-course",
-  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"
-          }
-        ],
-        teachingRoomId: [
-          {
-            required: true,
-            message: "请选择开课部门",
-            trigger: "change"
-          }
-        ],
-        clazzIdSet: [
-          {
-            required: true,
-            validator: (rule, value, callback) => {
-              if (!value || !value.length) {
-                return callback(new Error("请选择授课班级"));
-              }
-
-              callback();
-            },
-            trigger: "change"
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-    initData(val) {
-      if (val.id) {
-        this.modalForm = this.$objAssign(initModalForm, val);
-        this.modalForm.clazzIdSet = val.clazzList.map(item => item.id);
-      } 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 updateCourse(datas).catch(() => {
-        this.isSubmit = false;
-      });
-
-      if (!data) return;
-
-      this.isSubmit = false;
-      this.$message.success(this.title + "成功!");
-      this.$emit("modified");
-      this.cancel();
-    }
-  }
-};
-</script>

+ 0 - 136
src/modules/base/components/ModifyMajor.vue

@@ -1,136 +0,0 @@
-<template>
-  <el-dialog
-    class="modify-major"
-    :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="majorName" label="专业名称:">
-        <el-input
-          v-model.trim="modalForm.majorName"
-          placeholder="请输入专业名称"
-          clearable
-        ></el-input>
-      </el-form-item>
-      <el-form-item prop="collegeId" label="所属机构:">
-        <college-select
-          v-model="modalForm.collegeId"
-          style="width:100%;"
-          placeholder="所属机构"
-        ></college-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 { updateMajor } from "../api";
-
-const initModalForm = {
-  id: null,
-  majorName: "",
-  collegeId: ""
-};
-
-export default {
-  name: "modify-major",
-  props: {
-    instance: {
-      type: Object,
-      default() {
-        return {};
-      }
-    }
-  },
-  computed: {
-    isEdit() {
-      return !!this.instance.id;
-    },
-    title() {
-      return (this.isEdit ? "编辑" : "新增") + "专业";
-    }
-  },
-  data() {
-    return {
-      modalIsShow: false,
-      isSubmit: false,
-      classList: [],
-      modalForm: { ...initModalForm },
-      rules: {
-        majorName: [
-          {
-            required: true,
-            message: "请输入专业名称",
-            trigger: "change"
-          },
-          {
-            message: "专业名称不能超过50个字",
-            max: 50,
-            trigger: "change"
-          }
-        ],
-        collegeId: [
-          {
-            required: true,
-            message: "请选择所属机构",
-            trigger: "change"
-          }
-        ]
-      }
-    };
-  },
-  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 updateMajor(this.modalForm).catch(() => {
-        this.isSubmit = false;
-      });
-
-      if (!data) return;
-
-      this.isSubmit = false;
-      this.$message.success(this.title + "成功!");
-      this.$emit("modified");
-      this.cancel();
-    }
-  }
-};
-</script>

+ 0 - 154
src/modules/base/components/ModifyOrgAdmin.vue

@@ -1,154 +0,0 @@
-<template>
-  <el-dialog
-    class="modify-organization"
-    :visible.sync="modalIsShow"
-    title="机构管理人员"
-    top="10px"
-    width="1000px"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-  >
-    <div class="part-box part-box-pad part-box-border">
-      <div class="part-title">
-        <h2>部门主管</h2>
-      </div>
-      <el-table>
-        <el-table-column prop="realName" label="姓名"></el-table-column>
-        <el-table-column prop="realName" label="手机号"></el-table-column>
-        <el-table-column prop="realName" label="工号"></el-table-column>
-        <el-table-column prop="realName" label="角色"></el-table-column>
-        <el-table-column prop="realName" label="部门"></el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="120px">
-          <template slot-scope="scope">
-            <el-button
-              class="btn-primary"
-              type="text"
-              @click="setAdmin(scope.row)"
-            >
-              {{ scope.row.isAdmin ? "取消部门主管" : "设为部分主管" }}
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-    </div>
-    <div class="part-box part-box-pad part-box-border">
-      <div class="flex-between">
-        <el-form ref="modalFormComp" :model="filter" label-width="100px">
-          <el-form-item prop="name" label="部分成员:">
-            <el-input
-              style="width:282px;"
-              v-model.trim="filter.name"
-              placeholder="姓名/工号/手机号"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button @click="search">查询</el-button>
-          </el-form-item>
-        </el-form>
-        <div>
-          <el-button
-            type="primary"
-            icon="el-icon-circle-plus-outline"
-            @click="toAdd"
-            >添加成员</el-button
-          >
-        </div>
-      </div>
-      <table>
-        <el-table-column prop="realName" label="姓名"></el-table-column>
-        <el-table-column prop="realName" label="手机号"></el-table-column>
-        <el-table-column prop="realName" label="工号"></el-table-column>
-        <el-table-column prop="realName" label="角色"></el-table-column>
-        <el-table-column prop="realName" label="部门"></el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="120px">
-          <template slot-scope="scope">
-            <el-button
-              class="btn-primary"
-              type="text"
-              @click="setAdmin(scope.row)"
-            >
-              {{ scope.row.isAdmin ? "取消部门主管" : "设为部分主管" }}
-            </el-button>
-          </template>
-        </el-table-column>
-      </table>
-    </div>
-    <div slot="footer"></div>
-  </el-dialog>
-</template>
-
-<script>
-import { updateOrganization } from "../api";
-
-export default {
-  name: "modify-organization",
-  props: {
-    orgId: {
-      type: String,
-      default: ""
-    }
-  },
-  data() {
-    return {
-      modalIsShow: false,
-      filter: { name: "" },
-      admins: [],
-      users: [],
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0
-    };
-  },
-  watch: {
-    orgId(val, oldval) {
-      if (val !== oldval) this.initData();
-    }
-  },
-  methods: {
-    initData() {
-      this.filter.name = "";
-      this.admins = [];
-      this.users = [];
-      this.getAdmins();
-      this.toPage(1);
-    },
-    cancel() {
-      this.modalIsShow = false;
-    },
-    open() {
-      this.modalIsShow = true;
-    },
-    async getAdmins() {
-      if (!this.orgId) return;
-      const data = await updateOrganization({ orgId: this.orgId });
-      this.admins = data || [];
-    },
-    async getList() {
-      if (!this.orgId) return;
-      const datas = {
-        ...this.filter,
-        orgId: this.orgId,
-        pageNumber: this.current,
-        pageSize: this.size
-      };
-
-      const data = await updateOrganization(datas);
-      this.users = data.records;
-      this.total = data.total;
-    },
-    toPage(page) {
-      this.current = page;
-      this.getList();
-    },
-    search() {
-      this.toPage(1);
-    },
-    setAdmin(user) {
-      console.log(user);
-    },
-    toAdd() {}
-  }
-};
-</script>

+ 0 - 185
src/modules/base/views/CollegeManage.vue

@@ -1,185 +0,0 @@
-<template>
-  <div class="college-manage">
-    <div class="part-box part-box-filter part-box-flex">
-      <el-form ref="FilterForm" label-position="left" label-width="90px" inline>
-        <template v-if="checkPrivilege('condition', 'condition')">
-          <el-form-item label="学院名称:">
-            <el-input
-              v-model.trim="filter.collegeName"
-              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', 'delete')"
-          type="danger"
-          icon="el-icon-delete"
-          @click="toBatchDelete"
-          >批量删除</el-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="dataList"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          type="index"
-          label="序号"
-          width="70"
-          :index="indexMethod"
-        ></el-table-column>
-        <el-table-column prop="collegeName" label="学院名称"></el-table-column>
-        <el-table-column prop="createTime" label="创建时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="120px">
-          <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', '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>
-
-    <modify-college
-      :instance="curRow"
-      @modified="getList"
-      ref="ModifyCollege"
-    ></modify-college>
-  </div>
-</template>
-
-<script>
-import { collegeListQuery, deleteCollege } from "../api";
-import ModifyCollege from "../components/ModifyCollege";
-
-export default {
-  name: "college-manage",
-  components: { ModifyCollege },
-  data() {
-    return {
-      filter: {
-        collegeName: ""
-      },
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0,
-      dataList: [],
-      multipleSelection: [],
-      curRow: {}
-    };
-  },
-  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 collegeListQuery(datas);
-      this.dataList = data.records;
-      this.total = data.total;
-    },
-    toPage(page) {
-      this.multipleSelection = [];
-      this.current = page;
-      this.getList();
-    },
-    toAdd() {
-      this.curRow = {};
-      this.$refs.ModifyCollege.open();
-    },
-    toEdit(row) {
-      this.curRow = row;
-      this.$refs.ModifyCollege.open();
-    },
-    handleSelectionChange(val) {
-      this.multipleSelection = val.map(item => item.id);
-    },
-    toBatchDelete() {
-      if (!this.multipleSelection.length) {
-        this.$message.error("请选择要删除的数据");
-        return;
-      }
-
-      this.$confirm(`确定要删除选中的这些数据吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await deleteCollege(this.multipleSelection);
-          this.$message.success("删除成功!");
-          this.deletePageLastItem(this.multipleSelection.length);
-          this.multipleSelection = [];
-        })
-        .catch(() => {});
-    },
-    toDelete(row) {
-      this.$confirm(`确定要删除学院【${row.collegeName}】吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await deleteCollege([row.id]);
-          this.$message.success("删除成功!");
-          this.deletePageLastItem();
-        })
-        .catch(() => {});
-    }
-  }
-};
-</script>

+ 0 - 270
src/modules/base/views/CourseManage.vue

@@ -1,270 +0,0 @@
-<template>
-  <div class="course-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="开课部门:">
-            <org-select
-              v-model="filter.belongOrgId"
-              placeholder="开课部门"
-            ></org-select>
-          </el-form-item>
-          <el-form-item label="课程名称:">
-            <el-input
-              style="width: 142px;"
-              v-model.trim="filter.courseName"
-              placeholder="课程名称"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="创建时间:">
-            <el-date-picker
-              v-model="createTime"
-              type="datetimerange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="创建开始时间"
-              end-placeholder="创建结束时间"
-              value-format="timestamp"
-              align="right"
-              unlink-panels
-            >
-            </el-date-picker>
-          </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', 'Delete')"
-          type="danger"
-          :disabled="!filterHasQuery"
-          @click="toBatchDelete"
-          >批量删除</el-button
-        >
-        <el-button
-          type="success"
-          icon="el-icon-download"
-          v-if="checkPrivilege('button', 'TempleteDownload')"
-          ><a :href="downloadUrl" :download="dfilename">模板下载</a></el-button
-        >
-        <upload-button
-          v-if="checkPrivilege('button', 'Import')"
-          btn-icon="el-icon-circle-plus-outline"
-          btn-content="批量导入"
-          btn-type="success"
-          :upload-url="uploadUrl"
-          :format="['xls', 'xlsx']"
-          accept=".xls,.xlsx"
-          @valid-error="validError"
-          @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="courses">
-        <el-table-column
-          type="index"
-          label="序号"
-          width="70"
-          :index="indexMethod"
-        ></el-table-column>
-        <el-table-column
-          prop="courseName"
-          label="课程名称"
-          min-width="120"
-        ></el-table-column>
-        <el-table-column
-          prop="courseCode"
-          label="课程编码"
-          min-width="120"
-        ></el-table-column>
-        <el-table-column
-          prop="teachingRoomName"
-          label="开课部门"
-          min-width="120"
-        ></el-table-column>
-        <el-table-column prop="clazzList" label="授课班级" min-width="120">
-          <span slot-scope="scope">
-            <more-text :data="scope.row.clazzNames" :show-count="3"></more-text>
-          </span>
-        </el-table-column>
-        <el-table-column prop="createTime" label="创建时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column
-          class-name="action-column"
-          label="操作"
-          width="120"
-          fixed="right"
-        >
-          <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', '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>
-
-    <modify-course
-      :instance="curCourse"
-      @modified="getList"
-      ref="ModifyCourse"
-    ></modify-course>
-  </div>
-</template>
-
-<script>
-import { courseListPage, deleteCourse, batchDeleteCourse } from "../api";
-import pickerOptions from "@/constants/datePickerOptions";
-import ModifyCourse from "../components/ModifyCourse";
-import UploadButton from "../../../components/UploadButton";
-import { ABLE_TYPE } from "@/constants/enumerate";
-
-export default {
-  name: "course-manage",
-  components: { ModifyCourse, UploadButton },
-  data() {
-    return {
-      filter: {
-        belongOrgId: "",
-        courseName: "",
-        startCreateTime: "",
-        endCreateTime: "",
-        enable: ""
-      },
-      queriedFilter: {},
-      ABLE_TYPE,
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0,
-      courses: [],
-      curCourse: {},
-      // import
-      uploadUrl: "/api/admin/basic/course/data_import",
-      downloadUrl: "/temps/courseTemplate.xlsx",
-      dfilename: "课程导入模板.xlsx",
-      // date-picker
-      createTime: [],
-      pickerOptions
-    };
-  },
-  computed: {
-    filterHasQuery() {
-      return !Object.keys(this.filter).some(
-        k => this.filter[k] !== this.queriedFilter[k]
-      );
-    }
-  },
-  mounted() {
-    this.getList();
-  },
-  methods: {
-    async getList() {
-      if (!this.checkPrivilege("list", "list")) return;
-
-      const datas = {
-        ...this.filter,
-        pageNumber: this.current,
-        pageSize: this.size
-      };
-      if (this.createTime) {
-        datas.startCreateTime = this.createTime[0];
-        datas.endCreateTime = this.createTime[1];
-      }
-      if (datas.enable !== null && datas.enable !== "")
-        datas.enable = !!datas.enable;
-
-      const data = await courseListPage(datas);
-      this.courses = data.records.map(item => {
-        item.clazzNames = item.clazzList.map(org => org.name);
-        return item;
-      });
-      this.total = data.total;
-      this.queriedFilter = { ...this.filter };
-    },
-    toPage(page) {
-      this.current = page;
-      this.getList();
-    },
-    toAdd() {
-      this.curCourse = {};
-      this.$refs.ModifyCourse.open();
-    },
-    toEdit(row) {
-      this.curCourse = row;
-      this.$refs.ModifyCourse.open();
-    },
-    toDelete(row) {
-      this.$confirm(`确定要删除课程【${row.courseName}】吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await deleteCourse([row.id]);
-          this.$message.success("删除成功!");
-          this.deletePageLastItem();
-        })
-        .catch(() => {});
-    },
-    toBatchDelete() {
-      this.$confirm(`确定要删除当前查询的所有课程吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await batchDeleteCourse({ ...this.filter });
-          this.$message.success("操作成功!");
-          this.toPage(1);
-        })
-        .catch(() => {});
-    },
-    // import
-    validError(errorData) {
-      this.$message.error(errorData.message);
-    },
-    uploadSuccess() {
-      this.$message.success("文件上传成功,后台正在导入!");
-      this.getList();
-    }
-  }
-};
-</script>

+ 0 - 186
src/modules/base/views/MajorManage.vue

@@ -1,186 +0,0 @@
-<template>
-  <div class="major-manage">
-    <div class="part-box part-box-filter part-box-flex">
-      <el-form ref="FilterForm" label-position="left" label-width="90px" inline>
-        <template v-if="checkPrivilege('condition', 'condition')">
-          <el-form-item label="专业名称:">
-            <el-input
-              v-model.trim="filter.majorName"
-              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', 'delete')"
-          type="danger"
-          icon="el-icon-delete"
-          @click="toBatchDelete"
-          >批量删除</el-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="dataList"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          type="index"
-          label="序号"
-          width="70"
-          :index="indexMethod"
-        ></el-table-column>
-        <el-table-column prop="majorName" label="专业名称"></el-table-column>
-        <el-table-column prop="collegeName" label="所属机构"></el-table-column>
-        <el-table-column prop="createTime" label="创建时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="120px">
-          <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', '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>
-
-    <modify-major
-      :instance="curRow"
-      @modified="getList"
-      ref="ModifyMajor"
-    ></modify-major>
-  </div>
-</template>
-
-<script>
-import { majorListQuery, deleteMajor } from "../api";
-import ModifyMajor from "../components/ModifyMajor";
-
-export default {
-  name: "major-manage",
-  components: { ModifyMajor },
-  data() {
-    return {
-      filter: {
-        majorName: ""
-      },
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0,
-      dataList: [],
-      multipleSelection: [],
-      curRow: {}
-    };
-  },
-  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 majorListQuery(datas);
-      this.dataList = data.records;
-      this.total = data.total;
-    },
-    toPage(page) {
-      this.multipleSelection = [];
-      this.current = page;
-      this.getList();
-    },
-    toAdd() {
-      this.curRow = {};
-      this.$refs.ModifyMajor.open();
-    },
-    toEdit(row) {
-      this.curRow = row;
-      this.$refs.ModifyMajor.open();
-    },
-    handleSelectionChange(val) {
-      this.multipleSelection = val.map(item => item.id);
-    },
-    toBatchDelete() {
-      if (!this.multipleSelection.length) {
-        this.$message.error("请选择要删除的数据");
-        return;
-      }
-
-      this.$confirm(`确定要删除选中的这些数据吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await deleteMajor(this.multipleSelection);
-          this.$message.success("删除成功!");
-          this.deletePageLastItem(this.multipleSelection.length);
-          this.multipleSelection = [];
-        })
-        .catch(() => {});
-    },
-    toDelete(row) {
-      this.$confirm(`确定要删除专业【${row.majorName}】吗?`, "提示", {
-        type: "warning"
-      })
-        .then(async () => {
-          await deleteMajor([row.id]);
-          this.$message.success("删除成功!");
-          this.deletePageLastItem();
-        })
-        .catch(() => {});
-    }
-  }
-};
-</script>

+ 3 - 7
src/modules/base/views/UserManage.vue

@@ -272,13 +272,9 @@ export default {
         this.$message.error("请选择要删除的数据");
         return;
       }
-      const res = await this.$confirm(
-        `确定要删除用户选中的这些用户吗?`,
-        "提示",
-        {
-          type: "warning"
-        }
-      ).catch(() => {});
+      const res = await this.$confirm(`确定要删除选中的这些用户吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
       if (res !== "confirm") return;
 
       await deleteUser(this.multipleSelection);

+ 15 - 0
src/modules/record/api.js

@@ -0,0 +1,15 @@
+import { $postParam, $post } from "@/plugins/axios";
+
+// scan-task-manage
+export const scanTaskListPage = datas => {
+  return $postParam("/api/admin/sys/role/list", datas);
+};
+export const ableScanTask = ({ id, enable }) => {
+  return $post("/api/admin/sys/role/enable", { id, enable });
+};
+export const deleteScanTask = ids => {
+  return $postParam("/api/admin/sys/role/remove", { ids });
+};
+export const scanTaskBindUser = datas => {
+  return $postParam("/api/admin/sys/role/bind_range", datas);
+};

+ 111 - 121
src/modules/base/components/ModifyCollege.vue → src/modules/record/components/ScanTaskBindUserDialog.vue

@@ -1,121 +1,111 @@
-<template>
-  <el-dialog
-    class="modify-college"
-    :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="collegeName" label="学院名称:">
-        <el-input
-          v-model.trim="modalForm.collegeName"
-          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 { updateCollege } from "../api";
-
-const initModalForm = {
-  id: null,
-  collegeName: ""
-};
-
-export default {
-  name: "modify-college",
-  props: {
-    instance: {
-      type: Object,
-      default() {
-        return {};
-      }
-    }
-  },
-  computed: {
-    isEdit() {
-      return !!this.instance.id;
-    },
-    title() {
-      return (this.isEdit ? "编辑" : "新增") + "学院";
-    }
-  },
-  data() {
-    return {
-      modalIsShow: false,
-      isSubmit: false,
-      classList: [],
-      modalForm: { ...initModalForm },
-      rules: {
-        collegeName: [
-          {
-            required: true,
-            message: "请输入学院名称",
-            trigger: "change"
-          },
-          {
-            message: "学院名称不能超过50个字",
-            max: 50,
-            trigger: "change"
-          }
-        ]
-      }
-    };
-  },
-  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 updateCollege(this.modalForm).catch(() => {
-        this.isSubmit = false;
-      });
-
-      if (!data) return;
-
-      this.isSubmit = false;
-      this.$message.success(this.title + "成功!");
-      this.$emit("modified");
-      this.cancel();
-    }
-  }
-};
-</script>
+<template>
+  <el-dialog
+    class="scan-task-bind-user-dialog"
+    :visible.sync="modalIsShow"
+    title="绑定扫描员"
+    top="10vh"
+    width="460px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      label-width="100px"
+    >
+      <el-form-item prop="scanUserId" label="扫描员:">
+        <el-select v-model="modalForm.scanUserId" placeholder="请选择扫描员">
+          <el-option
+            v-for="item in scanUserList"
+            :key="item.id"
+            :value="item.id"
+            :label="item.name"
+          >
+          </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 { scanTaskBindUser } from "../api";
+import { roleUserListQuery } from "../../base/api";
+
+const initModalForm = {
+  id: null,
+  scanUserId: ""
+};
+
+export default {
+  name: "scan-task-bind-user-dialog",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: { ...initModalForm },
+      scanUserList: [],
+      rules: {
+        scanUserId: [
+          {
+            required: true,
+            message: "请选择扫描员",
+            trigger: "change"
+          }
+        ]
+      }
+    };
+  },
+  mounted() {
+    // this.getScanUsers();
+  },
+  methods: {
+    visibleChange() {
+      this.modalForm = this.$objAssign(initModalForm, this.instance);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async getScanUsers() {
+      const res = await roleUserListQuery({ roleType: "Scan" });
+      this.scanUserList = res || [];
+    },
+    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 scanTaskBindUser(datas).catch(() => {});
+      this.isSubmit = false;
+
+      if (!data) return;
+
+      this.$message.success("绑定成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 9 - 0
src/modules/record/router.js

@@ -0,0 +1,9 @@
+import ScanTaskManage from "./views/ScanTaskManage";
+
+export default [
+  {
+    path: "/record/scan-manage",
+    name: "ScanTaskManage",
+    component: ScanTaskManage
+  }
+];

+ 238 - 0
src/modules/record/views/ScanTaskManage.vue

@@ -0,0 +1,238 @@
+<template>
+  <div class="scan-task-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="关键词:" label-width="75px">
+            <el-input
+              style="width: 180px;"
+              v-model.trim="filter.userInfo"
+              placeholder="扫描员/课程"
+              clearable
+            ></el-input>
+          </el-form-item> -->
+        </template>
+
+        <el-form-item label-width="0px">
+          <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', 'batchDelete')"
+          type="danger"
+          icon="el-icon-delete"
+          :loading="loading"
+          @click="batchDelete"
+          >批量删除</el-button
+        >
+        <el-button
+          type="success"
+          icon="el-icon-download"
+          v-if="checkPrivilege('button', 'export')"
+          ><a :href="downloadUrl" :download="dfilename">模板下载</a></el-button
+        >
+        <upload-button
+          v-if="checkPrivilege('button', 'export')"
+          btn-icon="el-icon-circle-plus-outline"
+          btn-content="批量导入"
+          btn-type="success"
+          :upload-url="uploadUrl"
+          :format="['xls', 'xlsx']"
+          accept=".xls,.xlsx"
+          @valid-error="validError"
+          @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="taskList"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        ></el-table-column>
+        <el-table-column prop="name" label="任务名称"></el-table-column>
+        <el-table-column prop="id" label="任务ID" width="120"></el-table-column>
+        <el-table-column
+          prop="recordType"
+          label="档案名称"
+          width="120"
+        ></el-table-column>
+        <el-table-column prop="recordNumber" label="档案编号"></el-table-column>
+        <el-table-column prop="courseName" label="课程"> </el-table-column>
+        <el-table-column prop="teacherName" label="任课老师"> </el-table-column>
+        <el-table-column prop="teachingRoomName" label="教学班">
+        </el-table-column>
+        <el-table-column prop="scanCount" label="扫描量(份)">
+        </el-table-column>
+        <el-table-column prop="scanUser" label="扫描员"> </el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="200px"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <el-button
+              v-if="checkPrivilege('link', 'edit')"
+              class="btn-primary"
+              type="text"
+              @click="toBindScanUser(scope.row)"
+              >绑定扫描员</el-button
+            >
+            <el-button
+              v-if="checkPrivilege('link', 'detail')"
+              class="btn-primary"
+              type="text"
+              @click="toEdit(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>
+
+    <!-- ScanTaskBindUserDialog -->
+    <scan-task-bind-user-dialog
+      ref="ScanTaskBindUserDialog"
+      :instance="curRow"
+      @modified="getList"
+    ></scan-task-bind-user-dialog>
+  </div>
+</template>
+
+<script>
+import { scanTaskListPage, deleteScanTask } from "../api";
+import UploadButton from "../../../components/UploadButton";
+import ScanTaskBindUserDialog from "../components/ScanTaskBindUserDialog.vue";
+
+export default {
+  name: "user-manage",
+  components: { ScanTaskBindUserDialog, UploadButton },
+  data() {
+    return {
+      filter: {},
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      multipleSelection: [],
+      taskList: [],
+      curRow: {},
+      loading: false,
+      userId: this.$ls.get("user", { id: "" }).id,
+      // import
+      uploadUrl: "/api/admin/sys/user/import",
+      downloadUrl: "/temps/userTemplate.xlsx",
+      dfilename: "用户导入模板.xlsx"
+    };
+  },
+  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 scanTaskListPage(datas);
+      this.taskList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val.map(item => item.id);
+    },
+    toBindScanUser(row) {
+      this.curRow = row;
+      this.$refs.ScanTaskBindUserDialog.open();
+    },
+    toEdit(row) {
+      this.curRow = row;
+      this.$refs.ScanTaskBindUserDialog.open();
+    },
+    toAdd() {
+      this.curRow = {};
+      this.$refs.ScanTaskBindUserDialog.open();
+    },
+    async batchDelete() {
+      if (!this.multipleSelection.length) {
+        this.$message.error("请选择要删除的数据");
+        return;
+      }
+      const res = await this.$confirm(`确定要删除选中的这些任务吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (res !== "confirm") return;
+
+      await deleteScanTask(this.multipleSelection);
+      this.$message.success("操作成功!");
+      this.deletePageLastItem(this.multipleSelection.length);
+      this.multipleSelection = [];
+    },
+    async toDelete(row) {
+      const res = await this.$confirm(
+        `确定要删除任务【${row.name}】吗??`,
+        "提示",
+        {
+          type: "warning"
+        }
+      ).catch(() => {});
+      if (res !== "confirm") return;
+
+      await deleteScanTask([row.id]);
+      this.$message.success("操作成功!");
+      this.deletePageLastItem();
+    },
+    // import
+    validError(errorData) {
+      this.$message.error(errorData.message);
+    },
+    uploadSuccess() {
+      this.getList();
+    }
+  }
+};
+</script>

+ 2 - 1
src/router.js

@@ -7,6 +7,7 @@ import NotFound from "./views/404.vue";
 import login from "./modules/login/router";
 // module-example
 import base from "./modules/base/router";
+import record from "./modules/record/router";
 // admin
 import admin from "./modules/admin/router";
 
@@ -36,7 +37,7 @@ let router = new Router({
       path: "/home/:nextRouter?",
       name: "Home",
       component: Home,
-      children: [...base]
+      children: [...base, ...record]
     },
     { ...login },
     { ...admin },