|
@@ -5,7 +5,7 @@
|
|
|
<template #header>
|
|
|
<span>{{ quest.name }}</span>
|
|
|
[<span>完成度:</span><span>{{ questionAnswer.percentage }}%</span> <span>已答:</span><span>{{ questionAnswer.yesAnswer }}</span> <span>未答:</span
|
|
|
- ><span>{{ questionAnswer.noAnswer }}</span
|
|
|
+ ><span @click="nostuBtn()" class="nostu">{{ questionAnswer.noAnswer }}</span
|
|
|
>]
|
|
|
</template>
|
|
|
<el-tabs v-model="tabs" :stretch="true" type="card">
|
|
@@ -81,9 +81,12 @@ export default {
|
|
|
...setting({ getSetting: 'fetch' }),
|
|
|
...student({ findList: 'findList', studentQuery: 'query' }),
|
|
|
async search() {
|
|
|
+ console.log(this.querys.questionnaireid);
|
|
|
let res = await this.fetch(this.querys.questionnaireid);
|
|
|
if (!this.$checkRes(res)) return;
|
|
|
+ console.log(this.querys);
|
|
|
let ansres = await this.query(this.querys); //{ questionnaireid: this.id, termid: this.termid, batchid: this.batchid, classid: this.classid }
|
|
|
+ console.log(ansres);
|
|
|
if (this.$checkRes(ansres)) {
|
|
|
if (_.get(ansres.data, 'length', 0) <= 0) {
|
|
|
this.$set(this, `nodata`, true);
|
|
@@ -104,16 +107,19 @@ export default {
|
|
|
this.$set(this, `quest`, sta);
|
|
|
//具体数据
|
|
|
let concreteData = this.getConcreteData(quests, allAnswer);
|
|
|
+ console.log(concreteData);
|
|
|
this.$set(this, `cdata`, concreteData);
|
|
|
// 查学生,算已答未答
|
|
|
const { questionnaireid, ...stuquery } = this.querys;
|
|
|
+ console.log(stuquery);
|
|
|
let studentList = await this.studentQuery(stuquery);
|
|
|
+ console.log(studentList);
|
|
|
+ console.log(allAnswer);
|
|
|
let answerDta = {
|
|
|
yesAnswer: allAnswer.length,
|
|
|
noAnswer: studentList.total - allAnswer.length,
|
|
|
percentage: _.ceil(allAnswer.length / studentList.total, 4) * 100,
|
|
|
};
|
|
|
- console.log(answerDta);
|
|
|
this.$set(this, `questionAnswer`, answerDta);
|
|
|
}
|
|
|
},
|
|
@@ -231,6 +237,13 @@ export default {
|
|
|
this.$message.error('导出失败');
|
|
|
}
|
|
|
},
|
|
|
+ // 未答
|
|
|
+ nostuBtn() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/statistics/nostu',
|
|
|
+ query: { termid: this.querys.termid, questionnaireid: this.querys.questionnaireid, classid: this.querys.classid },
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -250,4 +263,12 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.nostu {
|
|
|
+ color: #ff0000;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+.nostu:hover {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+</style>
|