|
@@ -0,0 +1,54 @@
|
|
|
+<template>
|
|
|
+ <div id="bedroom">
|
|
|
+ <detail-frame title="寝室安排" returns="/classes/index">
|
|
|
+ <data-table :fields="fields" :data="list">
|
|
|
+ <template #custom="{item, row}">
|
|
|
+ <template v-if="item.prop === 'studentList'">
|
|
|
+ <el-row type="flex" justify="left">
|
|
|
+ <el-col :span="6" v-for="(stud, index) in row.studentList" :key="index">{{ stud }}</el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </data-table>
|
|
|
+ </detail-frame>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+import dataTable from '@frame/components/data-table';
|
|
|
+import detailFrame from '@frame/layout/admin/detail-frame';
|
|
|
+const { mapActions: student } = createNamespacedHelpers('student'); //班级
|
|
|
+export default {
|
|
|
+ metaInfo: { title: '寝室安排' },
|
|
|
+ name: 'bedroom',
|
|
|
+ props: {},
|
|
|
+ components: { detailFrame, dataTable },
|
|
|
+ data: () => ({
|
|
|
+ fields: [
|
|
|
+ { label: '寝室号', prop: 'bedroom', options: { width: `150px` } },
|
|
|
+ { label: '寝室人员', prop: 'studentList', custom: true },
|
|
|
+ ],
|
|
|
+ list: [],
|
|
|
+ }),
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...student(['bedRoom']),
|
|
|
+ async search() {
|
|
|
+ let res = await this.bedRoom({ classid: this.id });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|