|
@@ -0,0 +1,55 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <list-frame :title="pageTitle" :needFilter="false" :needPag="false" :needAdd="false">
|
|
|
+ <data-table :fields="fields" :data="list" :opera="opera" @query="search" :total="total"></data-table>
|
|
|
+ </list-frame>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import _ from 'lodash';
|
|
|
+import listFrame from '@frame/layout/admin/list-frame';
|
|
|
+import dataTable from '@frame/components/filter-page-table';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: teacher } = createNamespacedHelpers('teacher');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: { listFrame, dataTable },
|
|
|
+ data: () => {
|
|
|
+ return {
|
|
|
+ opera: [],
|
|
|
+ fields: [
|
|
|
+ { label: '姓名', prop: 'name', filter: true },
|
|
|
+ { label: '手机号', prop: 'phone', filter: true },
|
|
|
+ ],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...teacher(['query']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ const res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|