|
@@ -26,8 +26,10 @@
|
|
|
<script>
|
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
|
import headStuList from './info/headStuList.vue';
|
|
|
+import _ from 'lodash';
|
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
+const { mapActions: mapGroup } = createNamespacedHelpers('group');
|
|
|
export default {
|
|
|
name: 'classStuList',
|
|
|
props: {},
|
|
@@ -103,10 +105,22 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapStudent({ list: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
|
|
|
+ ...mapGroup({ groupQuery: 'query' }),
|
|
|
// 查询学生列表-并带有职务
|
|
|
async searchInfo() {
|
|
|
let classid = this.id;
|
|
|
+ // 班级所有学生
|
|
|
const res = await this.list({ classid });
|
|
|
+ // 班级所有组
|
|
|
+ const groups = await this.groupQuery({ classid });
|
|
|
+ //班级所有进组的学生id
|
|
|
+ let groupstuids = _.map(_.flattenDeep(_.map(groups.data, 'students')), 'stuid');
|
|
|
+ const a = _.differenceBy(res.data, groupstuids, function(x, y) {
|
|
|
+ console.log(x.id != y);
|
|
|
+ return x.id != y;
|
|
|
+ });
|
|
|
+ console.log(a);
|
|
|
+
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `headStuList`, res.data);
|
|
|
}
|
|
@@ -147,6 +161,7 @@ export default {
|
|
|
}
|
|
|
this.assignShow = true;
|
|
|
const res = await this.fet(id);
|
|
|
+ console.log(res.data);
|
|
|
this.$set(this, `assignForm`, res.data);
|
|
|
},
|
|
|
//指派职务
|