|
@@ -103,9 +103,6 @@
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
-const { mapActions: location } = createNamespacedHelpers('location');
|
|
|
-const { mapActions: teacher } = createNamespacedHelpers('teacher');
|
|
|
-const { mapActions: director } = createNamespacedHelpers('director');
|
|
|
export default {
|
|
|
name: 'classInfo',
|
|
|
props: {},
|
|
@@ -121,30 +118,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...classes(['fetch']),
|
|
|
- ...location({ locationFetch: 'fetch' }),
|
|
|
- ...teacher({ teaFetch: 'fetch' }),
|
|
|
- ...director({ dirFetch: 'fetch' }),
|
|
|
async search() {
|
|
|
const classinfo = (await this.fetch(this.classid)).data;
|
|
|
- if (classinfo.yclocationid) {
|
|
|
- classinfo.yclocation = (await this.locationFetch(classinfo.yclocationid)).data.name;
|
|
|
- }
|
|
|
- if (classinfo.kzjhlocationid) {
|
|
|
- classinfo.kzjhlocation = (await this.locationFetch(classinfo.kzjhlocationid)).data.name;
|
|
|
- }
|
|
|
- if (classinfo.kbyslocationid) {
|
|
|
- classinfo.kbyslocation = (await this.locationFetch(classinfo.kbyslocationid)).data.name;
|
|
|
- }
|
|
|
- if (classinfo.jslocationid) {
|
|
|
- classinfo.jslocation = (await this.locationFetch(classinfo.jslocationid)).data.name;
|
|
|
- }
|
|
|
- if (classinfo.lyteacherid) {
|
|
|
- let res = await this.teaFetch(classinfo.lyteacherid);
|
|
|
- if (!res.data) {
|
|
|
- res = await this.dirFetch(classinfo.lyteacherid);
|
|
|
- }
|
|
|
- classinfo.lyteacher = res.data.name;
|
|
|
- }
|
|
|
this.$set(this, `classinfo`, classinfo);
|
|
|
},
|
|
|
},
|