|
@@ -157,7 +157,7 @@
|
|
|
<span>{{ scope.row.lastModifyName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="180">
|
|
|
+ <el-table-column label="操作" width="180" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="operate_left">
|
|
|
<el-button
|
|
@@ -216,24 +216,30 @@
|
|
|
title="克隆试卷"
|
|
|
:visible.sync="copyPaperDialog"
|
|
|
v-loading.body="cloneLoading"
|
|
|
+ width="500px"
|
|
|
>
|
|
|
- <el-form :model="copyPaperForm">
|
|
|
+ <el-form
|
|
|
+ :model="copyPaperForm"
|
|
|
+ ref="copyPaperForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ inline-message
|
|
|
+ >
|
|
|
<el-row>
|
|
|
- <el-form-item label="试卷名称">
|
|
|
+ <el-form-item label="试卷名称" prop="paperName">
|
|
|
<el-input
|
|
|
+ class="dialog_input_width"
|
|
|
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-form-item label="课程名称" prop="courseNo">
|
|
|
<el-select
|
|
|
+ class="dialog_input_width"
|
|
|
v-model="copyPaperForm.courseNo"
|
|
|
- @change="showTitle()"
|
|
|
:remote-method="getCourses"
|
|
|
remote
|
|
|
filterable
|
|
@@ -248,22 +254,32 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <span style="color: red;" v-show="showCourseNo"
|
|
|
- >请选择课程名称</span
|
|
|
- >
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
+ <el-row class="margin_top_10 margin_left_120">
|
|
|
+ <el-button type="primary" @click="submitCopy('copyPaperForm')"
|
|
|
+ >保 存</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="resetForm2('copyPaperForm')">重 置</el-button>
|
|
|
+ <el-button @click="back2('copyPaperForm')" type="success"
|
|
|
+ ><i class="el-icon-caret-left"></i> 返 回</el-button
|
|
|
+ >
|
|
|
+ </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-dialog
|
|
|
+ title="属性修改"
|
|
|
+ :visible.sync="quesPropertyDialog"
|
|
|
+ width="500px"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :loading="quesLoading"
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-form-item label="难 度">
|
|
|
- <el-select v-model="difficultyDegree">
|
|
|
+ <el-select v-model="difficultyDegree" class="dialog_input_width">
|
|
|
<el-option
|
|
|
v-for="item in difficultyDegreeList"
|
|
|
:label="item.label"
|
|
@@ -275,7 +291,7 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-form-item label="公开度">
|
|
|
- <el-select v-model="publicity">
|
|
|
+ <el-select v-model="publicity" class="dialog_input_width">
|
|
|
<el-option
|
|
|
v-for="item in publicityList"
|
|
|
:label="item.label"
|
|
@@ -285,16 +301,19 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
+ <el-row class="margin_top_10 margin_left_120">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitUpdate()"
|
|
|
+ v-loading.fullscreen.lock="quesLoading"
|
|
|
+ >保 存</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="resetForm">重 置</el-button>
|
|
|
+ <el-button @click="closePropertyDialog" type="success"
|
|
|
+ ><i class="el-icon-caret-left"></i> 返 回</el-button
|
|
|
+ >
|
|
|
+ </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>
|
|
|
</section>
|
|
|
</template>
|
|
@@ -332,8 +351,6 @@ export default {
|
|
|
},
|
|
|
copyPaperId: "",
|
|
|
quesPropertyDialog: false,
|
|
|
- showName: false,
|
|
|
- showCourseNo: false,
|
|
|
difficultyDegree: 0.1,
|
|
|
publicity: true,
|
|
|
updateType: "",
|
|
@@ -349,7 +366,15 @@ export default {
|
|
|
{ label: 0.9, value: 0.9 },
|
|
|
{ label: 1.0, value: 1.0 }
|
|
|
],
|
|
|
- publicityList: PUBLICITY_LIST
|
|
|
+ publicityList: PUBLICITY_LIST,
|
|
|
+ rules: {
|
|
|
+ paperName: [
|
|
|
+ { required: true, message: "请输试卷名称", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ courseNo: [
|
|
|
+ { required: true, message: "请选择课程名称", trigger: "change" }
|
|
|
+ ]
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -507,73 +532,46 @@ export default {
|
|
|
},
|
|
|
//克隆试卷
|
|
|
copyImportPaper(row) {
|
|
|
- this.showName = false;
|
|
|
- this.showCourseNo = false;
|
|
|
this.copyPaperForm.paperName = "";
|
|
|
- this.copyPaperForm.courseNo = null;
|
|
|
+ this.copyPaperForm.courseNo = "";
|
|
|
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(
|
|
|
- QUESTION_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;
|
|
|
- }
|
|
|
+ //保存
|
|
|
+ submitCopy(formData) {
|
|
|
+ this.$refs[formData].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.cloneLoading = true;
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ QUESTION_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;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
removeItem() {
|
|
|
sessionStorage.removeItem("import_paper_courseNo");
|
|
@@ -620,7 +618,21 @@ export default {
|
|
|
this.publicity = true;
|
|
|
this.quesPropertyDialog = true;
|
|
|
},
|
|
|
- //试卷修改属性 openQuesPro,openQuesProC
|
|
|
+ //重置
|
|
|
+ resetForm() {
|
|
|
+ this.difficultyDegree = 0.1;
|
|
|
+ this.publicity = true;
|
|
|
+ },
|
|
|
+ resetForm2(formData) {
|
|
|
+ this.copyPaperForm.paperName = "";
|
|
|
+ this.copyPaperForm.courseNo = "";
|
|
|
+ this.$refs[formData].clearValidate();
|
|
|
+ },
|
|
|
+ back2(formData) {
|
|
|
+ this.resetForm2(formData);
|
|
|
+ this.copyPaperDialog = false;
|
|
|
+ },
|
|
|
+ //试卷修改属性 openQuesPro
|
|
|
openQuesPro() {
|
|
|
if (!this.selectedPaperIds || this.selectedPaperIds.length < 1) {
|
|
|
this.$notify({
|
|
@@ -632,7 +644,7 @@ export default {
|
|
|
this.updateType = "paper";
|
|
|
this.openInit();
|
|
|
},
|
|
|
- //课程修改属性
|
|
|
+ //课程修改属性 openQuesProC
|
|
|
openQuesProC() {
|
|
|
if (!this.formSearch.courseNo) {
|
|
|
this.$notify({
|