|
@@ -6,7 +6,12 @@
|
|
|
<nav-bar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </nav-bar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <questionnaire-info :questionnaireList="questionnaireList"></questionnaire-info>
|
|
|
+ <span v-if="this.user.type === '1'">
|
|
|
+ <teaClass :classList="classList"></teaClass>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <questionnaire-info :questionnaireList="questionnaireList"></questionnaire-info>
|
|
|
+ </span>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="foot">
|
|
|
<footInfo></footInfo>
|
|
@@ -19,10 +24,13 @@
|
|
|
<script>
|
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
|
import footInfo from '@/layout/common/footInfo.vue';
|
|
|
+import teaClass from '@/layout/question/teaClass.vue';
|
|
|
import questionnaireInfo from '@question/src/views/index.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: termquest } = createNamespacedHelpers('termquest');
|
|
|
const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
|
|
|
+const { mapActions: mapClass } = createNamespacedHelpers('classes');
|
|
|
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -30,16 +38,18 @@ export default {
|
|
|
NavBar, //头部导航
|
|
|
footInfo, //底部导航
|
|
|
questionnaireInfo, //问卷调查
|
|
|
+ teaClass, //班主任班级名单
|
|
|
},
|
|
|
data: () => ({
|
|
|
questionnaireList: [],
|
|
|
+ classList: [],
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
- transitionName: 'fade',
|
|
|
navShow: true,
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
|
+ this.searchInfo();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -57,6 +67,8 @@ export default {
|
|
|
methods: {
|
|
|
...termquest(['query']),
|
|
|
...questionnaire({ getQuestList: 'query', getQuestMerge: 'mergeRequest' }),
|
|
|
+ ...mapClass({ classinfo: 'query' }),
|
|
|
+ ...mapStudent({ stuQuery: 'query', stuFetch: 'fetch' }),
|
|
|
// 查询问卷调查列表
|
|
|
async search() {
|
|
|
let res = await this.query({ termid: this.user.termid });
|
|
@@ -66,6 +78,12 @@ export default {
|
|
|
this.$set(this, `questionnaireList`, quest);
|
|
|
}
|
|
|
},
|
|
|
+ // 班主任查询管理班级列表
|
|
|
+ async searchInfo({ ...info } = {}) {
|
|
|
+ const res = await this.classinfo({ ...info });
|
|
|
+ var result = res.data.filter(item => item.headteacherid === this.user.userid);
|
|
|
+ this.$set(this, `classList`, result);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|