|
@@ -0,0 +1,769 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <section class="content">
|
|
|
+ <div class="box box-info">
|
|
|
+ <div class="box-header with-border">
|
|
|
+ <h3 class="box-title">导入试卷管理</h3>
|
|
|
+ <div class="box-tools pull-right">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="warning"
|
|
|
+ @click="exportQuesType"
|
|
|
+ :disabled="isDisabled"
|
|
|
+ >试题分布</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="warning"
|
|
|
+ @click="openQuesPropertyByPaper"
|
|
|
+ :disabled="isDisabled2"
|
|
|
+ >试卷属性</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="warning"
|
|
|
+ @click="openQuesPropertyByCourse"
|
|
|
+ :disabled="isDisabled"
|
|
|
+ >课程属性</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="box-body">
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ :model="formSearch"
|
|
|
+ label-position="right"
|
|
|
+ label-width="110px"
|
|
|
+ >
|
|
|
+ <el-form-item label="课程名称" class="pull-left">
|
|
|
+ <el-select
|
|
|
+ v-model="formSearch.courseNo"
|
|
|
+ :remote-method="getCourses"
|
|
|
+ :loading="courseLoading"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="全部"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in courseInfoSelect"
|
|
|
+ :label="item.courseInfo"
|
|
|
+ :value="item.courseNo"
|
|
|
+ :key="item.courseNo"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="试卷名称" class="pull-left">
|
|
|
+ <el-input
|
|
|
+ v-model="formSearch.name"
|
|
|
+ placeholder="试卷名称"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="层次" class="pull-left">
|
|
|
+ <el-select v-model="formSearch.level">
|
|
|
+ <el-option label="请选择" value=""></el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in levelList"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="pull-right">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="search"
|
|
|
+ @click="searchImportPaper"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="share"
|
|
|
+ @click="useBasePaper"
|
|
|
+ >使用原卷</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="upload2"
|
|
|
+ @click="impPaper"
|
|
|
+ >导入试卷</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="danger"
|
|
|
+ icon="delete"
|
|
|
+ @click="batchDeleteImportPaper"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="拼命加载中"
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ @selection-change="selectChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column label="课程名称" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.course.name }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="课程代码" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.course.code }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="试卷名称" width="140">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.name }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="试卷总分" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.totalScore }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="试卷难度" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.difficultyDegree }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="大题数量" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.paperDetailCount }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="录入员" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.creator }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建时间" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.createTime }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="最后修改人" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.lastModifyName }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="220">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ @click="copyImportPaper(scope.row);"
|
|
|
+ type="warning"
|
|
|
+ size="mini"
|
|
|
+ >复制</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="editImportPaper(scope.row);"
|
|
|
+ type="info"
|
|
|
+ size="mini"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="deleteImportPaper(scope.row);"
|
|
|
+ type="danger"
|
|
|
+ size="mini"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="exportOriginalPaper(scope.row);"
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="page pull-right">
|
|
|
+ <el-pagination
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ title="克隆试卷"
|
|
|
+ :visible.sync="copyPaperDialog"
|
|
|
+ v-loading.body="cloneLoading"
|
|
|
+ >
|
|
|
+ <el-form :model="copyPaperForm">
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="试卷名称">
|
|
|
+ <el-input
|
|
|
+ v-model="copyPaperForm.paperName"
|
|
|
+ style="width: 220px;"
|
|
|
+ placeholder="请输试卷名称"
|
|
|
+ @change="showTitle();"
|
|
|
+ ></el-input>
|
|
|
+ <span style="color: red;" v-show="showName">请输试卷名称</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="课程名称">
|
|
|
+ <el-select
|
|
|
+ v-model="copyPaperForm.courseNo"
|
|
|
+ @change="showTitle();"
|
|
|
+ :remote-method="getCourses"
|
|
|
+ :loading="courseLoading"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="全部"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in courseInfoSelect"
|
|
|
+ :label="item.courseInfo"
|
|
|
+ :value="item.courseNo"
|
|
|
+ :key="item.courseNo"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span style="color: red;" v-show="showCourseNo"
|
|
|
+ >请选择课程名称</span
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closeCopy();">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitCopy();">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="属性修改" :visible.sync="quesPropertyDialog">
|
|
|
+ <el-form :loading="quesLoading">
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="难 度">
|
|
|
+ <el-select v-model="difficultyDegree">
|
|
|
+ <el-option
|
|
|
+ v-for="item in difficultyDegreeList"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="公开度">
|
|
|
+ <el-select v-model="publicity">
|
|
|
+ <el-option
|
|
|
+ v-for="item in publicityList"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closePropertyDialog();">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitUpdate();"
|
|
|
+ v-loading.fullscreen.lock="quesLoading"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ CORE_API,
|
|
|
+ Q_API,
|
|
|
+ LEVEL_TYPE,
|
|
|
+ PUBLICITY_LIST
|
|
|
+} from "../constants/constants";
|
|
|
+import { mapState } from "vuex";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ courseLoading: false,
|
|
|
+ quesLoading: false,
|
|
|
+ formSearch: {
|
|
|
+ courseNo: null,
|
|
|
+ specialtyNo: null,
|
|
|
+ level: "",
|
|
|
+ name: ""
|
|
|
+ },
|
|
|
+ tableData: [],
|
|
|
+ levelList: LEVEL_TYPE,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ isClear: 0,
|
|
|
+ total: 0,
|
|
|
+ loading: false,
|
|
|
+ courseList: [],
|
|
|
+ options: [],
|
|
|
+ selectedPaperIds: [],
|
|
|
+ cloneLoading: false,
|
|
|
+ copyPaperDialog: false,
|
|
|
+ copyPaperForm: {
|
|
|
+ paperName: "",
|
|
|
+ courseNo: null
|
|
|
+ },
|
|
|
+ copyPaperId: "",
|
|
|
+ quesPropertyDialog: false,
|
|
|
+ showName: false,
|
|
|
+ showCourseNo: false,
|
|
|
+ difficultyDegree: 0.1,
|
|
|
+ publicity: true,
|
|
|
+ updateType: "",
|
|
|
+ difficultyDegreeList: [
|
|
|
+ { label: 0.1, value: 0.1 },
|
|
|
+ { label: 0.2, value: 0.2 },
|
|
|
+ { label: 0.3, value: 0.3 },
|
|
|
+ { label: 0.4, value: 0.4 },
|
|
|
+ { label: 0.5, value: 0.5 },
|
|
|
+ { label: 0.6, value: 0.6 },
|
|
|
+ { label: 0.7, value: 0.7 },
|
|
|
+ { label: 0.8, value: 0.8 },
|
|
|
+ { label: 0.9, value: 0.9 },
|
|
|
+ { label: 1.0, value: 1.0 }
|
|
|
+ ],
|
|
|
+ publicityList: PUBLICITY_LIST
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ searchImportPaper() {
|
|
|
+ this.loading = true;
|
|
|
+ var url =
|
|
|
+ Q_API + "/importPaper/" + this.currentPage + "/" + this.pageSize;
|
|
|
+ this.$http.get(url, { params: this.formSearch }).then(response => {
|
|
|
+ this.tableData = response.data.content;
|
|
|
+ this.total = response.data.totalElements;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.currentPage = val;
|
|
|
+ this.searchImportPaper();
|
|
|
+ },
|
|
|
+ editImportPaper(row) {
|
|
|
+ sessionStorage.setItem("import_paper_courseNo", this.formSearch.courseNo);
|
|
|
+ sessionStorage.setItem(
|
|
|
+ "import_paper_specialtyNo",
|
|
|
+ this.formSearch.specialtyNo
|
|
|
+ );
|
|
|
+ sessionStorage.setItem("import_paper_currentPage", this.currentPage);
|
|
|
+ this.$router.push({ path: "/edit_paper/" + row.id + "/import_paper" });
|
|
|
+ },
|
|
|
+ deleteImportPaper(row) {
|
|
|
+ this.$confirm("确认删除试卷吗?", "提示", {
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true;
|
|
|
+ this.$http.delete(Q_API + "/paper/" + row.id).then(
|
|
|
+ () => {
|
|
|
+ this.$notify({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.searchImportPaper();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$notify({
|
|
|
+ message: error.data.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectChange(row) {
|
|
|
+ this.selectedPaperIds = [];
|
|
|
+ row.forEach(element => {
|
|
|
+ this.selectedPaperIds.push(element.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ batchDeleteImportPaper() {
|
|
|
+ var paperIds = this.paperIds;
|
|
|
+ if (this.selectedPaperIds.length != 0) {
|
|
|
+ this.$confirm("确认删除试卷吗?", "提示", {
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true;
|
|
|
+ this.$http.delete(Q_API + "/paper/" + paperIds).then(
|
|
|
+ () => {
|
|
|
+ this.$notify({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.searchImportPaper();
|
|
|
+ this.selectedPaperIds = [];
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$notify({
|
|
|
+ message: error.data.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$notify({
|
|
|
+ message: "请勾选删除的数据",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //导入试卷
|
|
|
+ impPaper() {
|
|
|
+ console.log("导入试卷新页面!");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/index/imp_paper"
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //查询所有课程
|
|
|
+ getCourses(query) {
|
|
|
+ console.log("查询课程!");
|
|
|
+ if (query) {
|
|
|
+ this.courseLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get(CORE_API + "/course/query?name=" + query + "&enable=true")
|
|
|
+ .then(response => {
|
|
|
+ this.courseList = response.data;
|
|
|
+ this.courseLoading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.courseList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ useBasePaper() {
|
|
|
+ if (this.selectedPaperIds.length == 0) {
|
|
|
+ this.$notify({
|
|
|
+ message: "请勾选使用的试卷",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.loading = true;
|
|
|
+ this.$http.put(Q_API + "/useBasePaper/" + this.selectedPaperIds).then(
|
|
|
+ response => {
|
|
|
+ console.log("come in response:", response);
|
|
|
+ if (!response.data.desc) {
|
|
|
+ this.$notify({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$notify({
|
|
|
+ message: response.data.desc,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ console.log("com in error:", error.body);
|
|
|
+ var message = error.body.desc;
|
|
|
+ var err = message
|
|
|
+ .replace("[", "")
|
|
|
+ .replace("]", "")
|
|
|
+ .substring(message.indexOf("desc") + 4);
|
|
|
+ this.$notify({
|
|
|
+ message: err,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //克隆试卷
|
|
|
+ copyImportPaper(row) {
|
|
|
+ this.showName = false;
|
|
|
+ this.showCourseNo = false;
|
|
|
+ this.copyPaperForm.paperName = "";
|
|
|
+ this.copyPaperForm.courseNo = null;
|
|
|
+ this.copyPaperId = row.id;
|
|
|
+ this.copyPaperDialog = true;
|
|
|
+ },
|
|
|
+ //取消
|
|
|
+ closeCopy() {
|
|
|
+ this.copyPaperDialog = false;
|
|
|
+ },
|
|
|
+ //确定
|
|
|
+ submitCopy() {
|
|
|
+ if (!this.copyPaperForm.paperName && !this.copyPaperForm.courseNo) {
|
|
|
+ this.showName = true;
|
|
|
+ this.showCourseNo = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.copyPaperForm.paperName) {
|
|
|
+ this.showName = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.copyPaperForm.courseNo) {
|
|
|
+ this.showCourseNo = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.cloneLoading = true;
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ Q_API +
|
|
|
+ "/clonePaper/" +
|
|
|
+ this.copyPaperId +
|
|
|
+ "/" +
|
|
|
+ this.copyPaperForm.paperName +
|
|
|
+ "/" +
|
|
|
+ this.copyPaperForm.courseNo
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.$notify({
|
|
|
+ message: "复制成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.cloneLoading = false;
|
|
|
+ this.copyPaperDialog = false;
|
|
|
+ this.searchImportPaper();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$notify({
|
|
|
+ type: "error",
|
|
|
+ message: "试卷名称重复,请重新命名"
|
|
|
+ });
|
|
|
+ this.cloneLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showTitle() {
|
|
|
+ if (!this.copyPaperForm.paperName) {
|
|
|
+ this.showName = true;
|
|
|
+ }
|
|
|
+ if (this.copyPaperForm.paperName) {
|
|
|
+ this.showName = false;
|
|
|
+ }
|
|
|
+ if (!this.copyPaperForm.courseNo) {
|
|
|
+ this.showCourseNo = true;
|
|
|
+ }
|
|
|
+ if (this.copyPaperForm.courseNo) {
|
|
|
+ this.showCourseNo = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeItem() {
|
|
|
+ sessionStorage.removeItem("import_paper_courseNo");
|
|
|
+ sessionStorage.removeItem("import_paper_specialtyNo");
|
|
|
+ sessionStorage.removeItem("import_paper_currentPage");
|
|
|
+ },
|
|
|
+ exportQuesType() {
|
|
|
+ var key = this.user.key;
|
|
|
+ var token = this.user.token;
|
|
|
+ window.location.href =
|
|
|
+ Q_API +
|
|
|
+ "/paper/export/course/question/" +
|
|
|
+ this.formSearch.courseNo +
|
|
|
+ "?$key=" +
|
|
|
+ key +
|
|
|
+ "&$token=" +
|
|
|
+ token;
|
|
|
+ },
|
|
|
+ exportOriginalPaper(row) {
|
|
|
+ var key = this.user.key;
|
|
|
+ var token = this.user.token;
|
|
|
+ //window.location.href = Q_API+"/originalPaper/export/"+row.id+"/"+ this.user.displayName;
|
|
|
+ window.open(
|
|
|
+ Q_API +
|
|
|
+ "/originalPaper/export/" +
|
|
|
+ row.id +
|
|
|
+ "/" +
|
|
|
+ this.user.displayName +
|
|
|
+ "?$key=" +
|
|
|
+ key +
|
|
|
+ "&$token=" +
|
|
|
+ token
|
|
|
+ );
|
|
|
+ },
|
|
|
+ openInit() {
|
|
|
+ this.difficultyDegree = 0.1;
|
|
|
+ this.publicity = true;
|
|
|
+ this.quesPropertyDialog = true;
|
|
|
+ },
|
|
|
+ //试卷修改属性 openQuesPropertyByPaper,openQuesPropertyByCourse
|
|
|
+ openQuesPropertyByPaper() {
|
|
|
+ this.updateType = "paper";
|
|
|
+ this.openInit();
|
|
|
+ },
|
|
|
+ //课程修改属性
|
|
|
+ openQuesPropertyByCourse() {
|
|
|
+ this.updateType = "course";
|
|
|
+ this.openInit();
|
|
|
+ },
|
|
|
+ closePropertyDialog() {
|
|
|
+ this.quesPropertyDialog = false;
|
|
|
+ },
|
|
|
+ submitUpdate() {
|
|
|
+ console.log("aaa");
|
|
|
+ if (this.updateType == "paper") {
|
|
|
+ console.log("paper");
|
|
|
+ this.updateQuesPropertyByPaper();
|
|
|
+ }
|
|
|
+ if (this.updateType == "course") {
|
|
|
+ console.log("course");
|
|
|
+ this.updateQuesPropertyByCourse();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateQuesPropertyByPaper() {
|
|
|
+ this.quesLoading = true;
|
|
|
+ this.$http
|
|
|
+ .put(
|
|
|
+ Q_API +
|
|
|
+ "/question/updatePro/paperIds/" +
|
|
|
+ this.selectedPaperIds +
|
|
|
+ "/" +
|
|
|
+ this.difficultyDegree +
|
|
|
+ "/" +
|
|
|
+ this.publicity
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.$notify({
|
|
|
+ message: "更新成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.searchImportPaper();
|
|
|
+ this.quesLoading = false;
|
|
|
+ this.closePropertyDialog();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$notify({
|
|
|
+ type: "error",
|
|
|
+ message: "更新失败"
|
|
|
+ });
|
|
|
+ this.quesLoading = false;
|
|
|
+ this.closePropertyDialog();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ updateQuesPropertyByCourse() {
|
|
|
+ this.quesLoading = true;
|
|
|
+ var orgId = this.user.rootOrgId;
|
|
|
+ this.$http
|
|
|
+ .put(
|
|
|
+ Q_API +
|
|
|
+ "/question/updatePro/courseCode/" +
|
|
|
+ this.formSearch.courseNo +
|
|
|
+ "/" +
|
|
|
+ this.difficultyDegree +
|
|
|
+ "/" +
|
|
|
+ this.publicity +
|
|
|
+ "/" +
|
|
|
+ orgId
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.$notify({
|
|
|
+ message: "更新成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.quesLoading = false;
|
|
|
+ this.closePropertyDialog();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$notify({
|
|
|
+ type: "error",
|
|
|
+ message: "更新失败"
|
|
|
+ });
|
|
|
+ this.quesLoading = false;
|
|
|
+ this.closePropertyDialog();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ paperIds() {
|
|
|
+ var paperIds = "";
|
|
|
+ for (let paperId of this.selectedPaperIds) {
|
|
|
+ if (!paperIds) {
|
|
|
+ paperIds += paperId;
|
|
|
+ } else {
|
|
|
+ paperIds += "," + paperId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return paperIds;
|
|
|
+ },
|
|
|
+ courseInfoSelect() {
|
|
|
+ var courseList = [];
|
|
|
+ for (let course of this.courseList) {
|
|
|
+ var courseInfo = course.name + "(" + course.code + ")";
|
|
|
+ var courseNo = course.code;
|
|
|
+ courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
|
|
|
+ }
|
|
|
+ return courseList;
|
|
|
+ },
|
|
|
+ isDisabled() {
|
|
|
+ if (this.formSearch.courseNo) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ isDisabled2() {
|
|
|
+ if (this.selectedPaperIds && this.selectedPaperIds.length > 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ ...mapState({ user: state => state.user })
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.isClear = this.$route.params.isClear;
|
|
|
+ if (this.isClear == 0 || !this.isClear) {
|
|
|
+ this.removeItem();
|
|
|
+ } else {
|
|
|
+ console.log(
|
|
|
+ "sessionStorage.getItem('import_paper_specialtyNo'):",
|
|
|
+ sessionStorage.getItem("import_paper_specialtyNo")
|
|
|
+ );
|
|
|
+ this.formSearch.courseNo =
|
|
|
+ sessionStorage.getItem("import_paper_courseNo") == "null"
|
|
|
+ ? ""
|
|
|
+ : sessionStorage.getItem("import_paper_courseNo");
|
|
|
+ this.formSearch.specialtyNo =
|
|
|
+ sessionStorage.getItem("import_paper_specialtyNo") == "null"
|
|
|
+ ? ""
|
|
|
+ : sessionStorage.getItem("import_paper_specialtyNo");
|
|
|
+ this.currentPage =
|
|
|
+ sessionStorage.getItem("import_paper_currentPage") == null
|
|
|
+ ? 1
|
|
|
+ : parseInt(sessionStorage.getItem("import_paper_currentPage"));
|
|
|
+ }
|
|
|
+ this.searchImportPaper();
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|