zhangjie пре 1 година
родитељ
комит
a1fee430f0

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

@@ -5538,4 +5538,77 @@ export default [
       },
     ],
   },
+  {
+    id: "48702",
+    name: "文档管理",
+    url: "CourseDocumentManage",
+    type: "MENU",
+    parentId: "561",
+    sequence: 3,
+    enable: true,
+    urls: [
+      {
+        id: "542",
+        name: "查询接口",
+        url: "/api/admin/mark/archive/score/list",
+        type: "URL",
+        parentId: "487",
+        sequence: 1,
+        enable: true,
+      },
+    ],
+    buttons: [
+      {
+        id: "500",
+        name: "查询",
+        url: "Select",
+        type: "BUTTON",
+        parentId: "487",
+        sequence: 1,
+        enable: true,
+      },
+    ],
+    links: [
+      {
+        id: "488",
+        name: "班级详情",
+        url: "ClassScoreDetail",
+        type: "LINK",
+        parentId: "487",
+        sequence: 1,
+        enable: true,
+      },
+      {
+        id: "489",
+        name: "成绩报告",
+        url: "ScoreReport",
+        type: "LINK",
+        parentId: "487",
+        sequence: 2,
+        enable: true,
+      },
+    ],
+    lists: [
+      {
+        id: "498",
+        name: "列表",
+        url: "List",
+        type: "LIST",
+        parentId: "487",
+        sequence: 1,
+        enable: true,
+      },
+    ],
+    conditions: [
+      {
+        id: "499",
+        name: "查询条件",
+        url: "Condition",
+        type: "CONDITION",
+        parentId: "487",
+        sequence: 1,
+        enable: true,
+      },
+    ],
+  },
 ];

+ 23 - 4
src/modules/course/api.js

@@ -75,21 +75,40 @@ export const endScorePaperPositiveSave = (datas) => {
   );
 };
 
-// 报告管理列表 ------------------->
+// 报告管理 ------------------->
 export const targetReportListPage = (datas) => {
   return $postParam("/api/admin/course/degree/report/list", datas);
 };
-// 报告管理列表-查看报告
+// 报告管理-查看报告
 export const targetReportDetail = (datas) => {
   return $postParam("/api/admin/course/degree/report/view", datas);
 };
-// 报告管理列表-保存报告
+// 报告管理-保存报告
 export const targetReportSave = (datas) => {
   return $post("/api/admin/course/degree/report/save", datas);
 };
-// 报告管理列表-导出报告
+// 报告管理-导出报告
 export const exportTargetReport = (datas) => {
   return $postParam("/api/admin/course/degree/report/export", datas, {
     responseType: "blob",
   });
 };
+
+// 文档管理 ------------------->
+export const courseDocumentListPage = (datas) => {
+  return $postParam("/api/admin/course/degree/report/list", datas);
+};
+// 文档管理-文档列表
+export const documentListPage = (datas) => {
+  return $postParam("/api/admin/course/degree/report/list", datas);
+};
+// 文档管理-文档下载
+export const documentDownload = (id) => {
+  return $postParam(
+    "/api/admin/course/degree/report/export",
+    { id },
+    {
+      responseType: "blob",
+    }
+  );
+};

+ 116 - 0
src/modules/course/components/CourseDocumentDetail.vue

@@ -0,0 +1,116 @@
+<template>
+  <div class="course-document-detail">
+    <el-dialog
+      class="page-dialog"
+      :visible.sync="modalIsShow"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      width="900px"
+    >
+      <div slot="title">
+        文档<span class="color-gray ml-2"
+          >{{ course.courseName }}({{ course.courseCode }})</span
+        >
+      </div>
+      <div class="part-box part-box-pad">
+        <el-table :data="dataList">
+          <el-table-column
+            type="index"
+            label="序号"
+            width="70"
+          ></el-table-column>
+          <el-table-column
+            prop="paperNumber"
+            label="材料名称"
+          ></el-table-column>
+          <el-table-column
+            prop="paperNumber"
+            label="数量"
+            width="100"
+          ></el-table-column>
+          <el-table-column
+            class-name="action-column"
+            label="操作"
+            width="140px"
+            fixed="right"
+          >
+            <template slot-scope="scope">
+              <el-button
+                class="btn-primary"
+                type="text"
+                @click="toView(scope.row)"
+                >查看</el-button
+              >
+              <el-button
+                class="btn-primary"
+                type="text"
+                @click="toDownload(scope.row)"
+                >下载</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div slot="footer"></div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { downloadByApi } from "@/plugins/download";
+import { documentListPage, documentDownload } from "../api";
+
+export default {
+  name: "course-document-detail",
+  props: {
+    course: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      dataList: [],
+      curRow: {},
+      downloading: false,
+    };
+  },
+  methods: {
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async getList() {
+      const datas = {
+        courseCode: this.course.courseCode,
+      };
+      const res = await documentListPage(datas);
+      this.dataList = res || [];
+    },
+    toView(row) {
+      this.curRow = row;
+    },
+    async toDownload(row) {
+      if (this.downloading) return;
+      this.downloading = true;
+
+      const res = await downloadByApi(() => {
+        return documentDownload(row.id);
+      }).catch((e) => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
+      this.downloading = false;
+
+      if (!res) return;
+      this.$message.success("下载成功!");
+    },
+  },
+};
+</script>

+ 6 - 0
src/modules/course/router.js

@@ -1,5 +1,6 @@
 import TargetScoreManage from "./views/TargetScoreManage.vue";
 import TargetReportManage from "./views/TargetReportManage.vue";
+import CourseDocumentManage from "./views/CourseDocumentManage.vue";
 
 export default [
   {
@@ -12,4 +13,9 @@ export default [
     name: "TargetReportManage",
     component: TargetReportManage,
   },
+  {
+    path: "/course/course-document-manage",
+    name: "CourseDocumentManage",
+    component: CourseDocumentManage,
+  },
 ];

+ 125 - 0
src/modules/course/views/CourseDocumentManage.vue

@@ -0,0 +1,125 @@
+<template>
+  <div class="target-report-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')">
+          <secp-select
+            v-model="filter"
+            defaultSelectExam
+            @exam-default="search"
+          ></secp-select>
+        </template>
+        <el-form-item label-width="0px">
+          <el-button
+            v-if="checkPrivilege('button', 'select')"
+            type="primary"
+            @click="search"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </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 label="课程(代码)">
+          <template slot-scope="scope">
+            {{ scope.row.courseName | defaultFieldFilter }}({{
+              scope.row.courseCode | defaultFieldFilter
+            }})
+          </template>
+        </el-table-column>
+        <el-table-column prop="paperNumber" label="试卷编码"></el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="140"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <el-button
+              v-if="checkPrivilege('link', 'preview')"
+              class="btn-primary"
+              type="text"
+              @click="toDetail(scope.row)"
+              >查看详情</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :pager-count="5"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+          @size-change="pageSizeChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <!-- CourseDocumentDetail -->
+    <course-document-detail
+      ref="CourseDocumentDetail"
+      :course="curRow"
+    ></course-document-detail>
+  </div>
+</template>
+
+<script>
+import { courseDocumentListPage } from "../api";
+import CourseDocumentDetail from "../components/CourseDocumentDetail.vue";
+
+export default {
+  name: "course-document-manage",
+  components: { CourseDocumentDetail },
+  data() {
+    return {
+      filter: {
+        semesterId: "",
+        examId: "",
+        courseCode: "",
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      dataList: [],
+      curRow: {},
+    };
+  },
+  methods: {
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size,
+      };
+      const data = await courseDocumentListPage(datas);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    search() {
+      // this.toPage(1);
+    },
+    toDetail(row) {
+      this.curRow = row;
+      this.$refs.CourseDocumentDetail.open();
+    },
+  },
+};
+</script>

+ 1 - 0
src/modules/course/views/TargetReportManage.vue

@@ -119,6 +119,7 @@ export default {
     },
     toDetail(row) {
       this.curRow = row;
+      this.$refs.TargetReportDetail.open();
     },
   },
 };