|
@@ -23,7 +23,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="r_pub_button_retrun" @click="retrunCourse">返回</div>
|
|
<div class="r_pub_button_retrun" @click="retrunCourse">返回</div>
|
|
</div>
|
|
</div>
|
|
- <div class="step_box" ref="stepBox">
|
|
|
|
|
|
+ <div class="step_box" ref="stepBox" v-loading="pdfLoading">
|
|
<div class="test_title">
|
|
<div class="test_title">
|
|
<div class="left">
|
|
<div class="left">
|
|
<div class="title">{{ testJson.title }}</div>
|
|
<div class="title">{{ testJson.title }}</div>
|
|
@@ -72,6 +72,7 @@
|
|
<el-input v-model="courseName" class="student_input" placeholder="请输入需要搜索的姓名"></el-input>
|
|
<el-input v-model="courseName" class="student_input" placeholder="请输入需要搜索的姓名"></el-input>
|
|
<span class="serach_icon" @click="searchCourse"></span>
|
|
<span class="serach_icon" @click="searchCourse"></span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="btnA" v-if="stype == 1 && !pdfLoading" @click="exportPDF">导出PDF</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="title_content" v-if="stype == 1">
|
|
<div class="title_content" v-if="stype == 1">
|
|
@@ -167,9 +168,8 @@
|
|
<el-table-column prop="time" label="提交时间" width="170px" align="left">
|
|
<el-table-column prop="time" label="提交时间" width="170px" align="left">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" min-width="150"
|
|
<el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" min-width="150"
|
|
- align="left"
|
|
|
|
- :filters="item.type == 1 ? item.nameFilters : null"
|
|
|
|
- :filter-method="item.type == 1 ? (value,row)=>{return filterName(value,row,index)} : null"
|
|
|
|
|
|
+ align="left" :filters="item.type == 1 ? item.nameFilters : null"
|
|
|
|
+ :filter-method="item.type == 1 ? (value, row) => { return filterName(value, row, index) } : null"
|
|
:filter-placement="item.type == 1 ? filterPlacement : null">
|
|
:filter-placement="item.type == 1 ? filterPlacement : null">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
|
|
<div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
|
|
@@ -208,62 +208,29 @@
|
|
</div>
|
|
</div>
|
|
<div class="table_content" v-if="stype == 3">
|
|
<div class="table_content" v-if="stype == 3">
|
|
<div class="student_table">
|
|
<div class="student_table">
|
|
- <el-table
|
|
|
|
- ref="table"
|
|
|
|
- :data="tableData"
|
|
|
|
- border
|
|
|
|
- :height="tableHeight"
|
|
|
|
- :fit="true"
|
|
|
|
- v-loading="isLoading"
|
|
|
|
- style="width: 100%"
|
|
|
|
- :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
|
|
- :row-class-name="tableRowClassName"
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- prop="username"
|
|
|
|
- label="提交人"
|
|
|
|
- min-width="15"
|
|
|
|
- align="center"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-table ref="table" :data="tableData" border :height="tableHeight" :fit="true" v-loading="isLoading"
|
|
|
|
+ style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
|
|
+ :row-class-name="tableRowClassName">
|
|
|
|
+ <el-table-column prop="username" label="提交人" min-width="15" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="time"
|
|
|
|
- label="提交时间"
|
|
|
|
- min-width="15"
|
|
|
|
- align="center"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-table-column prop="time" label="提交时间" min-width="15" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="time"
|
|
|
|
- label="是否批改"
|
|
|
|
- min-width="15"
|
|
|
|
- align="center"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-table-column prop="time" label="是否批改" min-width="15" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div>{{ scope.row.type == 3 ? '是' : '否' }}</div>
|
|
<div>{{ scope.row.type == 3 ? '是' : '否' }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="200px">
|
|
<el-table-column label="操作" width="200px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button
|
|
|
|
- @click="getTest(scope.row)"
|
|
|
|
- type="primary"
|
|
|
|
- size="small"
|
|
|
|
- >查看</el-button
|
|
|
|
- >
|
|
|
|
- <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
|
|
|
|
|
|
+ <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
|
|
|
|
+ <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
<div class="student_page">
|
|
<div class="student_page">
|
|
- <el-pagination
|
|
|
|
- background
|
|
|
|
- layout="prev, pager, next"
|
|
|
|
- :page-size="pageSize"
|
|
|
|
- :total="total"
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
|
|
|
|
+ @current-change="handleCurrentChange">
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -289,6 +256,8 @@ import wOffice from "../file/wOffice.vue";
|
|
|
|
|
|
import wordcloud from 'vue-wordcloud';
|
|
import wordcloud from 'vue-wordcloud';
|
|
import checkPie from '../data/checkPie.vue';
|
|
import checkPie from '../data/checkPie.vue';
|
|
|
|
+
|
|
|
|
+import { downloadPDF } from '../../../tools/pdf'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
shareBox,
|
|
shareBox,
|
|
@@ -342,6 +311,7 @@ export default {
|
|
wurl: "",
|
|
wurl: "",
|
|
chapters: [],
|
|
chapters: [],
|
|
filterPlacement: 'bottom-end',
|
|
filterPlacement: 'bottom-end',
|
|
|
|
+ pdfLoading: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
@@ -378,9 +348,9 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- filterName(value, row,index) {
|
|
|
|
|
|
+ filterName(value, row, index) {
|
|
let name = []
|
|
let name = []
|
|
- for(var i=0;i<row.array[index].json.answer2.length;i++){
|
|
|
|
|
|
+ for (var i = 0; i < row.array[index].json.answer2.length; i++) {
|
|
name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
|
|
name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
|
|
}
|
|
}
|
|
console.log(name.indexOf(value) != -1);
|
|
console.log(name.indexOf(value) != -1);
|
|
@@ -462,18 +432,18 @@ export default {
|
|
if (this.stype != type) {
|
|
if (this.stype != type) {
|
|
this.stype = type
|
|
this.stype = type
|
|
this.courseName = ''
|
|
this.courseName = ''
|
|
- if(type == 3){
|
|
|
|
|
|
+ if (type == 3) {
|
|
this.getData2();
|
|
this.getData2();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.getData();
|
|
this.getData();
|
|
}
|
|
}
|
|
this.changeHeight();
|
|
this.changeHeight();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
searchCourse() {
|
|
searchCourse() {
|
|
- if(this.stype == 3){
|
|
|
|
|
|
+ if (this.stype == 3) {
|
|
this.getData2()
|
|
this.getData2()
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.getData()
|
|
this.getData()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -687,17 +657,17 @@ export default {
|
|
console.log(array);
|
|
console.log(array);
|
|
return array;
|
|
return array;
|
|
},
|
|
},
|
|
- setFilter(json){
|
|
|
|
|
|
+ setFilter(json) {
|
|
let _json = json
|
|
let _json = json
|
|
let array = []
|
|
let array = []
|
|
_json.filter((item) => {
|
|
_json.filter((item) => {
|
|
item.nameFilters = [],
|
|
item.nameFilters = [],
|
|
- item.filterParams = {
|
|
|
|
- name: [],
|
|
|
|
- }
|
|
|
|
- if(item.type == 1){
|
|
|
|
- for(var i = 0; i < item.json.array.length; i++){
|
|
|
|
- item.nameFilters.push({text: item.json.array[i].option, value: item.json.array[i].option})
|
|
|
|
|
|
+ item.filterParams = {
|
|
|
|
+ name: [],
|
|
|
|
+ }
|
|
|
|
+ if (item.type == 1) {
|
|
|
|
+ for (var i = 0; i < item.json.array.length; i++) {
|
|
|
|
+ item.nameFilters.push({ text: item.json.array[i].option, value: item.json.array[i].option })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
array.push(item)
|
|
array.push(item)
|
|
@@ -779,9 +749,9 @@ export default {
|
|
.post(_this.$store.state.api + "deleteTestCourseWorks", params)
|
|
.post(_this.$store.state.api + "deleteTestCourseWorks", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
_this.$message.success("删除成功");
|
|
_this.$message.success("删除成功");
|
|
- if(_this.stype == 3){
|
|
|
|
|
|
+ if (_this.stype == 3) {
|
|
_this.getData2();
|
|
_this.getData2();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
_this.getData();
|
|
_this.getData();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -793,6 +763,21 @@ export default {
|
|
return;
|
|
return;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ exportPDF() {
|
|
|
|
+ this.pdfLoading = true
|
|
|
|
+ var a = document.getElementsByTagName("img")
|
|
|
|
+ for (var i = 0; i < a.length; i++) { a[i].crossOrigin = "*" }
|
|
|
|
+ downloadPDF(this.$refs.stepBox, this.testJson.title, () => {
|
|
|
|
+ var _a = document.getElementsByTagName("img")
|
|
|
|
+ for (var i = 0; i < _a.length; i++) {
|
|
|
|
+ _a[i].removeAttribute("crossorigin")
|
|
|
|
+ }
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.pdfLoading = false
|
|
|
|
+
|
|
|
|
+ }, 2000);
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
@@ -1339,5 +1324,23 @@ export default {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+.btnA {
|
|
|
|
+ color: #fff;
|
|
|
|
+ background-color: #0061FF;
|
|
|
|
+ padding: 0 24px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ min-width: 64px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border: none;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ transition: all 0.2s ease-in-out;
|
|
|
|
+ height: 36px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ line-height: 1;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|