123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <template>
- <div id="index">
- <el-row>
- <el-col :span="24" class="style">
- <el-col :span="24" class="top">
- <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
- </el-col>
- <el-col :span="24" class="main">
- <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
- <el-col :span="18" class="txt">
- <p>{{ item.name }}</p>
- <p>
- <span>小组人数:{{ item.students.length }}人</span>
- <span>小组状态:{{ item.status == '0' ? '未锁定' : '已锁定' }}</span>
- </p>
- </el-col>
- <el-col :span="6" class="btn">
- <el-button type="primary" size="mini" @click="$router.push({ path: '/user/pingfenGroup/lesson', query: { id: item.id } })">小组打分</el-button>
- </el-col>
- </el-col>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import NavBar from '@/layout/common/topInfo.vue';
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: group } = createNamespacedHelpers('group');
- export default {
- name: 'index',
- props: {},
- components: {
- NavBar,
- },
- data: function() {
- return {
- title: '',
- isleftarrow: '',
- navShow: true,
- list: [],
- };
- },
- created() {
- this.search();
- },
- methods: {
- ...group({ groupQuery: 'query' }),
- async search() {
- let res = await this.groupQuery({ classid: this.user.classid });
- this.$set(this, `list`, res.data);
- },
- },
- computed: {
- ...mapState(['user']),
- },
- mounted() {
- this.title = this.$route.meta.title;
- this.isleftarrow = this.$route.meta.isleftarrow;
- },
- watch: {
- $route(to, from) {
- this.title = to.meta.title;
- this.isleftarrow = to.meta.isleftarrow;
- },
- },
- };
- </script>
- <style lang="less" scoped>
- p {
- padding: 0;
- margin: 0;
- }
- .style {
- width: 100%;
- min-height: 667px;
- position: relative;
- background-color: #f9fafc;
- }
- .top {
- height: 46px;
- overflow: hidden;
- }
- .main {
- min-height: 570px;
- .list {
- border-bottom: 1px dashed #ccc;
- padding: 10px 0;
- margin: 0 10px;
- background: #fff;
- width: 95%;
- .txt {
- padding: 0 0 0 10px;
- p {
- padding: 5px 0;
- }
- p:nth-child(2) {
- span {
- display: inline-block;
- width: 50%;
- }
- }
- }
- .btn {
- text-align: center;
- }
- }
- }
- </style>
|