修改导出与修改考核倒计时结束bug

dev_2022-05-11
e 3 years ago
parent bd93eb4dd7
commit 121e24498e
  1. 34
      src/pages/achievement/ass/index.vue
  2. 2
      src/pages/achievement/teach/index.vue
  3. 12
      src/pages/assessment/list/index.vue
  4. 3
      src/pages/match/manage/matchDetail.vue

@ -80,8 +80,10 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
import axios from 'axios';
export default { export default {
data() { data() {
@ -89,6 +91,7 @@ export default {
id: this.$route.query.id, id: this.$route.query.id,
classId: this.$route.query.classId, classId: this.$route.query.classId,
projectId: this.$route.query.projectId, projectId: this.$route.query.projectId,
assessmentId:'',
classInfo: [], classInfo: [],
experimentalName: this.$route.query.experimentalName, experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class, className: this.$route.query.class,
@ -100,6 +103,7 @@ export default {
total: 0, total: 0,
avg: 0, avg: 0,
activeName:'', activeName:'',
token: util.local.get(Setting.tokenKey),
}; };
}, },
mounted() { mounted() {
@ -109,6 +113,7 @@ export default {
this.classInfo[i].id = id.toString() this.classInfo[i].id = id.toString()
} }
this.activeName= this.classInfo[0].id this.activeName= this.classInfo[0].id
this.id = this.$route.query.id
this.getData(); this.getData();
}, },
methods: { methods: {
@ -121,6 +126,7 @@ export default {
this.avg = res.avgScore this.avg = res.avgScore
this.total = res.peopleNum this.total = res.peopleNum
let list = res.page.records; let list = res.page.records;
this.assessmentId = res.page.records[0].assessmentId;
let score = 0; let score = 0;
list.map(n => { list.map(n => {
n.class = this.className; n.class = this.className;
@ -154,18 +160,28 @@ export default {
}, },
exportData() { exportData() {
if (!this.listData.length) return false; if (!this.listData.length) return false;
let selected = this.multipleSelection; if (this.multipleSelection.length) {
let exportList = []; let ids = this.multipleSelection.map(item => {
if (selected.length) { return item.reportId;
exportList = selected.map(item => {
return item.recordId;
}); });
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} else { } else {
exportList = this.listData.map(item => { axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=`,{
return item.recordId; headers: {
}); token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} }
window.open(`${this.api.exportAchievement}?ids=${exportList.join(",")}&projectId=${this.projectId}&source=2`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {

@ -157,7 +157,6 @@ export default {
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data])) util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {}) }).catch(res => {})
// location.href = `${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&token=${this.token}&ids=${ids.toString()}`;
} else { } else {
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=`,{ axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=`,{
headers: { headers: {
@ -167,7 +166,6 @@ export default {
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data])) util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {}) }).catch(res => {})
// location.href = `${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&token=${this.token}&ids=`;
} }
}, },
handleDelete(row) { // handleDelete(row) { //

@ -86,7 +86,7 @@
</el-table-column> </el-table-column>
<el-table-column label="倒计时" align="center"> <el-table-column label="倒计时" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ timeFilter(scope.row.countDown) }}</span> <span>{{ timeFilter(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="实验状态" align="center"> <el-table-column label="实验状态" align="center">
@ -204,6 +204,7 @@ export default {
if (val) { if (val) {
this.form.startTime = val[0]; this.form.startTime = val[0];
this.form.endTime = val[1]; this.form.endTime = val[1];
// this.form.month = ''
} else { } else {
this.form.startTime = ""; this.form.startTime = "";
this.form.endTime = ""; this.form.endTime = "";
@ -254,12 +255,13 @@ export default {
}, 1000); }, 1000);
}, },
timeFilter(countDown) { timeFilter(countDown) {
if (countDown > 0) { if (countDown.countDown > 0) {
let h = Math.floor(countDown / (60 * 60)); let h = Math.floor(countDown.countDown / (60 * 60));
let m = Math.floor(countDown % (60 * 60) / 60); let m = Math.floor(countDown.countDown % (60 * 60) / 60);
let s = Math.floor(countDown % (60 * 60) % 60); let s = Math.floor(countDown.countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`; return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else { } else {
countDown.status = 2
return "00:00:00"; return "00:00:00";
} }
}, },

@ -141,7 +141,6 @@ export default {
}, },
watch: { watch: {
signupTime: function(val) { signupTime: function(val) {
this.touchTime = this.touchTime+1
if (val) { if (val) {
this.signUpStartTime = val[0]; this.signUpStartTime = val[0];
this.signUpEndTime = val[1]; this.signUpEndTime = val[1];
@ -151,7 +150,6 @@ export default {
} }
}, },
playTime: function(val) { playTime: function(val) {
this.touchTime = this.touchTime+1
if (val) { if (val) {
this.playStartTime = val[0]; this.playStartTime = val[0];
this.playEndTime = val[1]; this.playEndTime = val[1];
@ -237,7 +235,6 @@ export default {
}); });
}, },
commitId() { commitId() {
this.touchTime = this.touchTime+1
this.setMatchId(this.id); this.setMatchId(this.id);
// this.$store.commit("setMatchId", { matchId: this.id }); // this.$store.commit("setMatchId", { matchId: this.id });
}, },

Loading…
Cancel
Save