|
@@ -6,7 +6,12 @@
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
- 個人中心
|
|
|
|
|
|
+ <el-col :span="24" class="message">
|
|
|
|
+ <messageInfo :info="info" :teainfo="teainfo" :jiaoshiinfo="jiaoshiinfo"></messageInfo>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="clickBtn">
|
|
|
|
+ <clickBtn></clickBtn>
|
|
|
|
+ </el-col>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="foot">
|
|
<el-col :span="24" class="foot">
|
|
<footInfo></footInfo>
|
|
<footInfo></footInfo>
|
|
@@ -15,27 +20,62 @@
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
<script>
|
|
<script>
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
import footInfo from '@/layout/common/footInfo.vue';
|
|
import footInfo from '@/layout/common/footInfo.vue';
|
|
-import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
|
|
+import messageInfo from '@/layout/user/messageInfo.vue';
|
|
|
|
+import clickBtn from '@/layout/user/clickBtn.vue';
|
|
|
|
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
|
+const { mapActions: mapDirectors } = createNamespacedHelpers('director');
|
|
|
|
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
|
+const { mapActions: mapTeacher } = createNamespacedHelpers('teacher');
|
|
|
|
+const { mapActions: mapDept } = createNamespacedHelpers('dept');
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
- NavBar,
|
|
|
|
- footInfo,
|
|
|
|
|
|
+ NavBar, //头部导航
|
|
|
|
+ footInfo, //底部导航
|
|
|
|
+ messageInfo, //个人信息
|
|
|
|
+ clickBtn, //功能按钮
|
|
},
|
|
},
|
|
data: function() {
|
|
data: function() {
|
|
return {
|
|
return {
|
|
|
|
+ info: {},
|
|
|
|
+ teainfo: {},
|
|
|
|
+ jiaoshiinfo: {},
|
|
title: '',
|
|
title: '',
|
|
isleftarrow: '',
|
|
isleftarrow: '',
|
|
navShow: true,
|
|
navShow: true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
- methods: {},
|
|
|
|
|
|
+ created() {
|
|
|
|
+ this.searchSite();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
|
|
|
|
+ ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
|
|
|
|
+ ...mapTeacher({ teacherlist: 'query', teacherfetch: 'fetch' }),
|
|
|
|
+ ...mapDept({ deptFetch: 'fetch' }),
|
|
|
|
+ // 查询登录用户信息
|
|
|
|
+ async searchSite() {
|
|
|
|
+ // 1:班主任,4:学生
|
|
|
|
+ console.log(this.user);
|
|
|
|
+ if (this.user.type === '1') {
|
|
|
|
+ const res = await this.directorFetch(this.user.userid);
|
|
|
|
+ const arr = await this.deptFetch(res.data.department);
|
|
|
|
+ res.data.department = arr.data.name;
|
|
|
|
+
|
|
|
|
+ console.log(res.data);
|
|
|
|
+
|
|
|
|
+ this.$set(this, `teainfo`, res.data);
|
|
|
|
+ } else if (this.user.type === '3') {
|
|
|
|
+ const res = await this.teacherfetch(this.user.userid);
|
|
|
|
+ console.log(res.data);
|
|
|
|
+ this.$set(this, `jiaoshiinfo`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
},
|
|
},
|