|
@@ -25,17 +25,20 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="试卷名称">
|
|
|
- <el-input v-model="formSearch.name" placeholder="试卷名称"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="formSearch.paperName"
|
|
|
+ placeholder="试卷名称"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="录入人">
|
|
|
<el-input
|
|
|
- v-model="formSearch.creator"
|
|
|
+ v-model="formSearch.creationBy"
|
|
|
placeholder="录入人"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="修改人">
|
|
|
<el-input
|
|
|
- v-model="formSearch.lastModifyName"
|
|
|
+ v-model="formSearch.updateBy"
|
|
|
placeholder="修改人"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
@@ -85,12 +88,12 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column label="业务课名称" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.course.name }}</span>
|
|
|
+ <span>{{ scope.row.courseName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="业务课代码" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.course.code }}</span>
|
|
|
+ <span>{{ scope.row.courseCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="试卷名称" width="180">
|
|
@@ -128,7 +131,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="修改人" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.lastModifyName }}</span>
|
|
|
+ <span>{{ scope.row.updateBy }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -138,21 +141,31 @@
|
|
|
prop="updateTime"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="150" fixed="right">
|
|
|
+ <el-table-column label="操作" width="220" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="operate_left">
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button size="mini" type="primary" plain>编辑</el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown" class="action-dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ v-for="paper in scope.row.papers"
|
|
|
+ :key="paper.paperId"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="toEditPaper(paper)"
|
|
|
+ >{{ paper.paperName }}</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="editPaper(scope.row)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- @click="viewPaper(scope.row)"
|
|
|
+ @click="toViewPaper(scope.row)"
|
|
|
>预览</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -184,23 +197,23 @@
|
|
|
<el-dialog
|
|
|
title="下载试卷"
|
|
|
:visible.sync="exportDialog"
|
|
|
- width="600px"
|
|
|
+ width="700px"
|
|
|
:modal="false"
|
|
|
append-to-body
|
|
|
custom-class="side-dialog"
|
|
|
>
|
|
|
- <el-form :model="exportModel" label-position="right" label-width="80px">
|
|
|
- <el-form-item v-if="exportModel.courseName" label="课程名称">
|
|
|
+ <el-form :model="exportModel" label-position="right" label-width="100px">
|
|
|
+ <el-form-item v-if="exportModel.courseName" label="业务课名称">
|
|
|
{{ exportModel.courseName }}
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="exportModel.courseCode" label="课程代码">
|
|
|
+ <el-form-item v-if="exportModel.courseCode" label="业务课代码">
|
|
|
{{ exportModel.courseCode }}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="导出内容">
|
|
|
<el-checkbox-group v-model="exportModel.exportContentList">
|
|
|
<el-checkbox label="PAPER">试卷</el-checkbox>
|
|
|
<el-checkbox label="ANSWER">答案</el-checkbox>
|
|
|
- <el-checkbox label="THEMIS_PACKAGE">数据包</el-checkbox>
|
|
|
+ <!-- <el-checkbox label="THEMIS_PACKAGE">数据包</el-checkbox> -->
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="showSeqMode" label="小题序号">
|
|
@@ -220,9 +233,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { QUESTION_API } from "@/constants/constants";
|
|
|
import { mapState } from "vuex";
|
|
|
-import { courseQueryApi } from "../api";
|
|
|
+import {
|
|
|
+ courseQueryApi,
|
|
|
+ synthesizePaperPageListApi,
|
|
|
+ synthesizePaperDeleteApi,
|
|
|
+ synthesizePaperDownloadApi,
|
|
|
+} from "../api";
|
|
|
+import { downloadByApi } from "@/plugins/download";
|
|
|
+import { QUESTION_API } from "@/constants/constants";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -231,9 +250,9 @@ export default {
|
|
|
formSearch: {
|
|
|
courseId: "",
|
|
|
courseName: "",
|
|
|
- creator: "",
|
|
|
- lastModifyName: "",
|
|
|
- name: "",
|
|
|
+ creationBy: "",
|
|
|
+ updateBy: "",
|
|
|
+ paperName: "",
|
|
|
},
|
|
|
tableData: [],
|
|
|
currentPage: 1,
|
|
@@ -258,7 +277,7 @@ export default {
|
|
|
for (let course of this.courseList) {
|
|
|
var courseInfo = course.name + "(" + course.code + ")";
|
|
|
var courseId = course.id;
|
|
|
- var courseName = course.name;
|
|
|
+ var courseName = courseName;
|
|
|
courseList.push({
|
|
|
courseId: courseId,
|
|
|
courseInfo: courseInfo,
|
|
@@ -301,8 +320,8 @@ export default {
|
|
|
this.formSearch = {
|
|
|
courseId: "",
|
|
|
courseName: "",
|
|
|
- creator: "",
|
|
|
- lastModifyName: "",
|
|
|
+ creationBy: "",
|
|
|
+ updateBy: "",
|
|
|
name: "",
|
|
|
};
|
|
|
},
|
|
@@ -311,14 +330,19 @@ export default {
|
|
|
this.currentPage = 1;
|
|
|
this.searchGenPaper();
|
|
|
},
|
|
|
- searchGenPaper() {
|
|
|
+ async searchGenPaper() {
|
|
|
this.loading = true;
|
|
|
- const url = `${QUESTION_API}/paper_storage/findPage/${this.currentPage}/${this.pageSize}`;
|
|
|
- this.$http.get(url, { params: this.formSearch }).then((response) => {
|
|
|
- this.tableData = response.data.content;
|
|
|
- this.total = response.data.totalElements;
|
|
|
- });
|
|
|
+ const datas = {
|
|
|
+ ...this.formSearch,
|
|
|
+ pageNumber: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ };
|
|
|
+ const res = await synthesizePaperPageListApi(datas).catch(() => {});
|
|
|
this.loading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.tableData = res.data.content;
|
|
|
+ this.total = res.data.totalElements;
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
this.currentPage = val;
|
|
@@ -332,17 +356,30 @@ export default {
|
|
|
selectChange(row) {
|
|
|
this.selectedPaperIds = row.map((item) => item.id);
|
|
|
},
|
|
|
- viewPaper(row) {
|
|
|
- console.log(row);
|
|
|
+ toViewPaper(row) {
|
|
|
+ var key = this.user.key;
|
|
|
+ var token = this.user.token;
|
|
|
+ window.open(
|
|
|
+ "http://192.168.10.39:7000" +
|
|
|
+ QUESTION_API +
|
|
|
+ "/synthesize/paper/preview?synthesizePaperId=" +
|
|
|
+ row.id +
|
|
|
+ "&$key=" +
|
|
|
+ key +
|
|
|
+ "&$token=" +
|
|
|
+ token
|
|
|
+ );
|
|
|
},
|
|
|
- editPaper(row) {
|
|
|
+ toEditPaper(paper) {
|
|
|
this.cacheSearchInfo();
|
|
|
- console.log(row);
|
|
|
+ this.$router.push({
|
|
|
+ path: "/edit_paper/" + paper.paperId + "/synthesis_paper_storage",
|
|
|
+ });
|
|
|
},
|
|
|
openExportDialog(row) {
|
|
|
this.exportModel.id = row.id;
|
|
|
- this.exportModel.courseCode = row.course.code;
|
|
|
- this.exportModel.courseName = row.course.name;
|
|
|
+ this.exportModel.courseCode = row.courseCode;
|
|
|
+ this.exportModel.courseName = row.courseName;
|
|
|
this.exportModel.exportContentList = [];
|
|
|
|
|
|
this.exportDialog = true;
|
|
@@ -366,14 +403,14 @@ export default {
|
|
|
}).catch(() => {});
|
|
|
if (confirm !== "confirm") return;
|
|
|
|
|
|
- const res = await this.$http
|
|
|
- .delete(QUESTION_API + "/paper/" + this.selectedPaperIds.join())
|
|
|
- .catch((error) => {
|
|
|
+ const res = await synthesizePaperDeleteApi(this.selectedPaperIds).catch(
|
|
|
+ (error) => {
|
|
|
this.$notify({
|
|
|
message: error.response.data.desc,
|
|
|
type: "error",
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
if (!res) return;
|
|
|
this.$notify({
|
|
@@ -403,7 +440,7 @@ export default {
|
|
|
this.exportDialog = true;
|
|
|
},
|
|
|
//导出试卷,答案,机考数据包
|
|
|
- exportPaperInfo() {
|
|
|
+ async exportPaperInfo() {
|
|
|
if (!this.exportModel.exportContentList.length) {
|
|
|
this.$notify({
|
|
|
message: "请选择导出内容",
|
|
@@ -412,15 +449,24 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- const { key, token } = this.user;
|
|
|
- const paperIds = this.selectedPaperIds.join();
|
|
|
- const contents = this.exportModel.exportContentList.join();
|
|
|
+ let synthesizePaperIds =
|
|
|
+ this.selectedPaperIds.join() || this.exportModel.id;
|
|
|
+ const exportContentList = this.exportModel.exportContentList.join();
|
|
|
this.exportDialog = false;
|
|
|
- if (paperIds) {
|
|
|
- window.location.href = `${QUESTION_API}/paper/batch_export/${paperIds}/${contents}/onLine/?psw=&$key=${key}&$token=${token}&seqMode=${this.exportModel.seqMode}`;
|
|
|
- } else {
|
|
|
- window.location.href = `${QUESTION_API}/paper/export/${this.exportModel.id}/${contents}/onLine/?psw=&$key=${key}&$token=${token}&seqMode=${this.exportModel.seqMode}`;
|
|
|
- }
|
|
|
+
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
+ return synthesizePaperDownloadApi({
|
|
|
+ exportContentList,
|
|
|
+ synthesizePaperIds,
|
|
|
+ seqMode: this.exportModel.seqMode,
|
|
|
+ });
|
|
|
+ }).catch((e) => {
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
+ });
|
|
|
+ this.downloading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success("下载成功!");
|
|
|
},
|
|
|
// init
|
|
|
initData() {
|