|
@@ -0,0 +1,156 @@
|
|
|
+<template>
|
|
|
+ <div id="afterClass">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="style">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="search">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-select v-model="subid" clearable placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option v-for="(i, index) in subjectList" :key="index" :label="i.name" :value="i.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4"><el-button type="primary" size="mini" @click="search()">搜索</el-button></el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-col :span="24" class="sub"> 答疑科目:{{ item.subid }} </el-col>
|
|
|
+ <el-col :span="24" class="teacher"> 答疑教师:{{ item.teacher }} </el-col>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-button type="primary" size="mini">申请答疑</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import NavBar from '@/layout/common/topTitle.vue';
|
|
|
+import leaveList from '@/layout/user/leaveList.vue';
|
|
|
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+const { mapActions: subject } = createNamespacedHelpers('subject');
|
|
|
+const { mapActions: answerapply } = createNamespacedHelpers('answerapply');
|
|
|
+export default {
|
|
|
+ metaInfo: { title: '请假管理' },
|
|
|
+ name: 'afterClass',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ NavBar, //头部导航
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ isleftarrow: '',
|
|
|
+ transitionName: 'fade',
|
|
|
+ navShow: true,
|
|
|
+ // 答疑列表
|
|
|
+ list: [],
|
|
|
+ // 科目列表
|
|
|
+ subjectList: [],
|
|
|
+ // 查询
|
|
|
+ subid: '',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getOtherList();
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...subject({ getSubjectList: 'query' }),
|
|
|
+ ...answerapply(['query', 'delete']),
|
|
|
+ // 查询科目
|
|
|
+ async getOtherList() {
|
|
|
+ let res = await this.getSubjectList();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `subjectList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async search({ skip, limit, ...info } = {}) {
|
|
|
+ if (this.subid) {
|
|
|
+ const res = await this.query({ skip, limit, status: '1', subid: this.subid, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ for (const val of res.data) {
|
|
|
+ const subject = this.subjectList.find(f => f.id == val.subid);
|
|
|
+ if (subject) val.subid = subject.name;
|
|
|
+ }
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const res = await this.query({ skip, limit, status: '1', ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ for (const val of res.data) {
|
|
|
+ const subject = this.subjectList.find(f => f.id == val.subid);
|
|
|
+ if (subject) val.subid = subject.name;
|
|
|
+ }
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: { ...mapState(['user']) },
|
|
|
+ mounted() {
|
|
|
+ this.title = this.$route.meta.title;
|
|
|
+ this.isleftarrow = this.$route.meta.isleftarrow;
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route(to, from) {
|
|
|
+ this.title = to.meta.title;
|
|
|
+ this.isleftarrow = to.meta.isleftarrow;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.style {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 667px;
|
|
|
+ position: relative;
|
|
|
+ background-color: #f9fafc;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ height: 46px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ min-height: 570px;
|
|
|
+ .search {
|
|
|
+ height: 50px;
|
|
|
+ border-bottom: 1px solid red;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ margin: 10px 0 0 0;
|
|
|
+ .list {
|
|
|
+ background-color: #ffffff;
|
|
|
+ margin: 0 10px 10px 10px;
|
|
|
+ width: 95%;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .sub {
|
|
|
+ font-size: 18px;
|
|
|
+ padding: 0 0 5px 0;
|
|
|
+ }
|
|
|
+ .teacher {
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 0 0 5px 0;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.el-input__inner {
|
|
|
+ height: 28px;
|
|
|
+ line-height: 28px;
|
|
|
+}
|
|
|
+/deep/.el-input__icon {
|
|
|
+ line-height: 28px;
|
|
|
+}
|
|
|
+</style>
|