|
@@ -0,0 +1,113 @@
|
|
|
+<template>
|
|
|
+ <div id="joinGroup">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-col :span="15" class="title">
|
|
|
+ {{ groupName }}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="9" class="btn">
|
|
|
+ <el-button type="primary" @click="joinGroup()">进组</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <groupStuList :groupStuList="groupStuList" @clickLeader="clickLeader" @clickOut="clickOut"></groupStuList>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="foot">
|
|
|
+ <footInfo></footInfo>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import footInfo from '@/layout/index/footInfo.vue';
|
|
|
+import groupStuList from '@/layout/class/groupStuList.vue';
|
|
|
+
|
|
|
+import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+const { mapActions: mapGroup } = createNamespacedHelpers('group');
|
|
|
+export default {
|
|
|
+ name: 'joinGroup',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ footInfo, //底部信息
|
|
|
+ groupStuList, //组学生列表
|
|
|
+ },
|
|
|
+ data: () => ({
|
|
|
+ groupName: '',
|
|
|
+ groupStuList: [
|
|
|
+ {
|
|
|
+ name: '流域',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }),
|
|
|
+ created() {
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ keyWord() {
|
|
|
+ let meta = this.$route.meta;
|
|
|
+ let main = meta.title || '';
|
|
|
+ return main;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapGroup(['query', 'create', 'delete', 'fetch', 'update', 'insert', 'exit']),
|
|
|
+ async searchInfo() {
|
|
|
+ if (this.$route.query.id) {
|
|
|
+ const res = await this.fetch(this.id);
|
|
|
+ this.$set(this, `groupName`, res.data.name);
|
|
|
+ // this.$set(this, `groupStuList`, res.data.studentid);
|
|
|
+ for (const val of res.data.studentid) {
|
|
|
+ console.log(val);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async joinGroup() {
|
|
|
+ const res = await this.insert({ groupid: this.id, studentid: '20200220' });
|
|
|
+ const msg = `${this.keyWord}进组成功`;
|
|
|
+ if (this.$checkRes(res, msg));
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ async clickOut() {
|
|
|
+ const res = await this.exit({ groupid: this.id, studentid: '20200220' });
|
|
|
+ const msg = `${this.keyWord}退组成功`;
|
|
|
+ if (this.$checkRes(res, msg));
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ clickLeader() {
|
|
|
+ console.log('指派组长');
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.info {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 667px;
|
|
|
+ position: relative;
|
|
|
+ background-color: #edeae8;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+.top .title {
|
|
|
+ padding: 0 15px;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+.top .btn {
|
|
|
+ text-align: right;
|
|
|
+ padding: 0 30px;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ margin: 0 0 50px 0;
|
|
|
+}
|
|
|
+</style>
|