|
@@ -7,10 +7,12 @@
|
|
|
</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: school } = createNamespacedHelpers('school');
|
|
|
+const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -32,23 +34,37 @@ export default {
|
|
|
],
|
|
|
fields: [
|
|
|
{ label: '学校名称', prop: 'name', filter: true },
|
|
|
+ { label: '学校负责人', prop: 'userName' },
|
|
|
+ { label: '学校负责人电话', prop: 'userMobile' },
|
|
|
{ label: '学校代码', prop: 'code', filter: true },
|
|
|
{ label: '学校地点', prop: 'address' },
|
|
|
{ label: '学校简称', prop: 'shortname' },
|
|
|
],
|
|
|
list: [],
|
|
|
+ userList: [],
|
|
|
total: 0,
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
+ await this.getOtherList();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...login({ getUserList: 'userList' }),
|
|
|
...school(['query', 'delete']),
|
|
|
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);
|
|
|
+ let { data } = res;
|
|
|
+ data = data.map(i => {
|
|
|
+ const r = this.userList.find(f => f.uid == i.id);
|
|
|
+ if (r) {
|
|
|
+ i.userName = r.name;
|
|
|
+ i.userMobile = r.mobile;
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+ this.$set(this, `list`, data);
|
|
|
this.$set(this, `total`, res.total);
|
|
|
}
|
|
|
},
|
|
@@ -62,6 +78,12 @@ export default {
|
|
|
this.$checkRes(res, '删除成功', '删除失败');
|
|
|
this.search();
|
|
|
},
|
|
|
+ async getOtherList() {
|
|
|
+ const res = await this.getUserList({ type: '2' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `userList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|