|
@@ -45,7 +45,7 @@ import detailFrame from '@frame/layout/admin/detail-frame';
|
|
|
import calendar from '@frame/components/calendar';
|
|
|
import dataTable from '@frame/components/data-table';
|
|
|
import _ from 'lodash';
|
|
|
-import { createNamespacedHelpers } from 'vuex';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions } = createNamespacedHelpers('trainplan');
|
|
|
const { mapActions: dirPlan } = createNamespacedHelpers('dirPlan');
|
|
|
export default {
|
|
@@ -76,7 +76,6 @@ export default {
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
|
- //TODO 正常来说:我是根据计划进来的,我需要查的不仅是计划的信息,还需要根据计划id和用户id查询出我曾经添加过的信息做回显及修改
|
|
|
this.searchDir();
|
|
|
},
|
|
|
mounted() {},
|
|
@@ -88,7 +87,7 @@ export default {
|
|
|
dirUpdatePlan: 'update',
|
|
|
}),
|
|
|
async searchDir() {
|
|
|
- let res = await this.dirQuery({ trainplanid: this.info.id, headteacherid: 'headerTeacherTest 99991' });
|
|
|
+ let res = await this.dirQuery({ trainplanid: this.info.id, headteacherid: this.user.userid });
|
|
|
if (this.$checkRes(res)) {
|
|
|
let data = JSON.parse(JSON.stringify(res.data));
|
|
|
if (res.data.length > 0) {
|
|
@@ -176,7 +175,7 @@ export default {
|
|
|
let object = { trainplanid: _id };
|
|
|
object.nobatchid = arr.map(i => i.id || i._id);
|
|
|
//TODO修改班主任id为登录用户的id
|
|
|
- object.headteacherid = 'headerTeacherTest 99991';
|
|
|
+ object.headteacherid = this.user.userid;
|
|
|
let res;
|
|
|
let msg;
|
|
|
if (!teaplanid) {
|
|
@@ -216,6 +215,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
widths() {
|
|
|
let width = (document.body.clientWidth - 200) * 0.5;
|
|
|
return width > 400 ? width : 400;
|