|
@@ -0,0 +1,142 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="admin-Registration-management">
|
|
|
|
+ <!-- 搜索 -->
|
|
|
|
+ <SearchArea
|
|
|
|
+ @search="handleSearch"
|
|
|
|
+ ></SearchArea>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <MtaTable
|
|
|
|
+ class="mta-Table"
|
|
|
|
+ @audit="handleAudit"
|
|
|
|
+ ></MtaTable>
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
+ <MtaPagination class="my-Pagination"
|
|
|
|
+ :pageSizes="defaultPageSizes"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-page="handleCurrentPage"></MtaPagination>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import SearchArea from './components/SearchArea';
|
|
|
|
+ import MtaTable from './components/Table';
|
|
|
|
+ import MtaPagination from './components/Pagination';
|
|
|
|
+ import * as commonTools from '@/utils/admin/tools';
|
|
|
|
+ import Vue from 'vue';
|
|
|
|
+ import * as zhuceyonghu from '@/api/zhuceyonghu';
|
|
|
|
+
|
|
|
|
+ const pagination = {
|
|
|
|
+ page: 1,
|
|
|
|
+ size: 10,
|
|
|
|
+ total: 0,
|
|
|
|
+ };
|
|
|
|
+ const tableData = {
|
|
|
|
+ myData: [],
|
|
|
|
+ };
|
|
|
|
+ const defaultPageSizes = [10, 20, 30, 40];
|
|
|
|
+ const paginationServiceData = Vue.observable(pagination);
|
|
|
|
+ const tableServiceData = Vue.observable(tableData);
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ name: 'index',
|
|
|
|
+ components: {
|
|
|
|
+ SearchArea,
|
|
|
|
+ MtaTable,
|
|
|
|
+ MtaPagination,
|
|
|
|
+ },
|
|
|
|
+ provide: {
|
|
|
|
+ tableServiceData,
|
|
|
|
+ paginationServiceData,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ defaultPageSizes: defaultPageSizes,
|
|
|
|
+ searchOpt: {},
|
|
|
|
+ userId: null,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async handleAudit(data) {
|
|
|
|
+ const opt = {
|
|
|
|
+ id: data.id,
|
|
|
|
+ };
|
|
|
|
+ const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ const res = await zhuceyonghu.getZhuceUpdate(opt);
|
|
|
|
+ if (res.code === 0 && res.data) {
|
|
|
|
+ // 更新table
|
|
|
|
+ this.getZhuceyonghuListData();
|
|
|
|
+ }
|
|
|
|
+ loading.close();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleSearch(data) {
|
|
|
|
+ paginationServiceData.page = 1;
|
|
|
|
+ this.searchOpt = data;
|
|
|
|
+ this.getZhuceyonghuListData(data);
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ paginationServiceData.size = val;
|
|
|
|
+ this.getZhuceyonghuListData();
|
|
|
|
+ },
|
|
|
|
+ handleCurrentPage(val) {
|
|
|
|
+ paginationServiceData.page = val;
|
|
|
|
+ this.getZhuceyonghuListData();
|
|
|
|
+ },
|
|
|
|
+ async getZhuceyonghuListData() {
|
|
|
|
+ const opt = Object.assign({}, this.searchOpt, paginationServiceData);
|
|
|
|
+ delete opt.total;
|
|
|
|
+
|
|
|
|
+ const loading = this.$loading({ background: 'rgba(0, 0, 0, 0.7)' });
|
|
|
|
+ try {
|
|
|
|
+ const res = await zhuceyonghu.getZhuceList(opt);
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.updateTable(res.data);
|
|
|
|
+ }
|
|
|
|
+ loading.close();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log('请求异常接口:getZhuceyonghuListData');
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ updateTable(data) {
|
|
|
|
+ console.log(data);
|
|
|
|
+ tableServiceData.myData = data.data;
|
|
|
|
+ paginationServiceData.total = data.total;
|
|
|
|
+ },
|
|
|
|
+ clearData() {
|
|
|
|
+ paginationServiceData.page = 1;
|
|
|
|
+ paginationServiceData.size = 10;
|
|
|
|
+ paginationServiceData.total = 0;
|
|
|
|
+ tableServiceData.myData = [];
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ const userAuth = commonTools.getUserAuth();
|
|
|
|
+ this.userId = userAuth && userAuth.userId;
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ this.clearData();
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .admin-Registration-management {
|
|
|
|
+ padding: 20px;
|
|
|
|
+
|
|
|
|
+ .mta-Table {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ height: calc(100vh - 274px) !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .my-Pagination {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+</style>
|