|
|
|
@ -91,7 +91,9 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.show"> |
|
|
|
|
<span>{{ status[scope.row.status] }}</span> |
|
|
|
|
<span> |
|
|
|
|
{{ status[scope.row.status] }} |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="170"> |
|
|
|
@ -126,12 +128,10 @@ export default { |
|
|
|
|
{ |
|
|
|
|
value: "", |
|
|
|
|
name: "不限" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}, { |
|
|
|
|
value: 1, |
|
|
|
|
name: "手动发布" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}, { |
|
|
|
|
value: 2, |
|
|
|
|
name: "定时发布" |
|
|
|
|
} |
|
|
|
@ -141,17 +141,14 @@ export default { |
|
|
|
|
{ |
|
|
|
|
value: "", |
|
|
|
|
name: "不限" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
value: 1, |
|
|
|
|
}, { |
|
|
|
|
value: 0, |
|
|
|
|
name: "待开始" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
value: 2, |
|
|
|
|
}, { |
|
|
|
|
value: 1, |
|
|
|
|
name: "进行中" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
value: 3, |
|
|
|
|
}, { |
|
|
|
|
value: 2, |
|
|
|
|
name: "已结束" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
@ -160,16 +157,13 @@ export default { |
|
|
|
|
{ |
|
|
|
|
id: "", |
|
|
|
|
name: "不限" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}, { |
|
|
|
|
id: 1, |
|
|
|
|
name: "近一个月" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}, { |
|
|
|
|
id: 3, |
|
|
|
|
name: "近三个月" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}, { |
|
|
|
|
id: 6, |
|
|
|
|
name: "近六个月" |
|
|
|
|
} |
|
|
|
@ -250,11 +244,12 @@ export default { |
|
|
|
|
if (item.countDown > 0) { |
|
|
|
|
item.countDown--; |
|
|
|
|
} else { |
|
|
|
|
if (item.status === 0 && item.type === 2) { // 待开始-定时发布 |
|
|
|
|
if (item.status == 0 && item.type == 2) { // 待开始-定时发布 |
|
|
|
|
item.status = 1; |
|
|
|
|
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} else if (item.status === 1) { |
|
|
|
|
item.status = 2; |
|
|
|
|
// } |
|
|
|
|
} else if (item.status == 1) { |
|
|
|
|
// item.status = 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.show = true; |
|
|
|
@ -277,25 +272,26 @@ export default { |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
|
this.listData = res.list; |
|
|
|
|
console.log(this.listData) |
|
|
|
|
this.total = res.total; |
|
|
|
|
this.listData.forEach(i => { |
|
|
|
|
i.show = false; |
|
|
|
|
if (i.status === 2) { // 已结束 |
|
|
|
|
if (i.status == 2) { // 已结束 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else { |
|
|
|
|
if (i.type === 2) { // 定时发布 |
|
|
|
|
if (i.status === 0) { |
|
|
|
|
if (i.type == 2) { // 定时发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
} else if (i.status === 1) { |
|
|
|
|
} else if (i.status == 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
|
} else if (i.type === 1) { // 手动发布 |
|
|
|
|
if (i.status === 0) { |
|
|
|
|
} else if (i.type == 1) { // 手动发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else if (i.status === 1) { |
|
|
|
|
} else if (i.status == 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
@ -331,10 +327,7 @@ export default { |
|
|
|
|
this.$router.push(`/achievement/ass?id=${row.id}&classId=${row.classId}&projectId=${row.projectId}&classInfo=${JSON.stringify(row.classInfo)}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); |
|
|
|
|
}, |
|
|
|
|
start(row) { |
|
|
|
|
let data = { |
|
|
|
|
id: row.id, |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.enableAssessment, data).then(res => { |
|
|
|
|
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => { |
|
|
|
|
util.successMsg("启动成功!"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(err => { |
|
|
|
@ -344,36 +337,32 @@ export default { |
|
|
|
|
finish(row) { |
|
|
|
|
this.$confirm("确定要提前结束吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
let data = { |
|
|
|
|
id: row.id, |
|
|
|
|
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()), |
|
|
|
|
status: 2 |
|
|
|
|
}; |
|
|
|
|
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { |
|
|
|
|
util.successMsg("提前结束成功!"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
let data = { |
|
|
|
|
id: row.id, |
|
|
|
|
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()), |
|
|
|
|
status: 2 |
|
|
|
|
}; |
|
|
|
|
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { |
|
|
|
|
util.successMsg("提前结束成功!"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
delData(row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$post(this.api.deleteAssessment, [row.id]).then(res => { |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.deleteAssessment, [row.id]).then(res => { |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
delAllData() { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
@ -382,18 +371,16 @@ export default { |
|
|
|
|
}); |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$post(this.api.deleteAssessment, ids).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.deleteAssessment, ids).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
} |
|
|
|
|