Commit eb48e21a by 姜雷

在目前的首页添加注册数据展示

parent f1e666ef
...@@ -5,9 +5,10 @@ VUE_APP_SYSTEM_MENU_CODE=0003 ...@@ -5,9 +5,10 @@ VUE_APP_SYSTEM_MENU_CODE=0003
VUE_APP_FEEDBACK_MENU_CODE=0018 VUE_APP_FEEDBACK_MENU_CODE=0018
VUE_APP_STATISTICS_MENU_CODE=0044 VUE_APP_STATISTICS_MENU_CODE=0044
VUE_APP_DEVICE_MENU_CODE=0048 VUE_APP_DEVICE_MENU_CODE=0048
VUE_APP_DASHBOARD_CODE=0079
VUE_APP_CUSTOMER_OPERATE_CODE=0077 VUE_APP_CUSTOMER_OPERATE_CODE=0077
VUE_APP_SMAPRO_CODE=0069 VUE_APP_SMAPRO_CODE=0069
VUE_APP_DASHBOARD_CODE=0079
VUE_APP_REGISTER_DASHBOARD_CODE=0083
VUE_APP_WHITE_LIST=/login,/404,/401 VUE_APP_WHITE_LIST=/login,/404,/401
VUE_APP_SUBSYSTEM=http://ex-dev-dcxy-static.168cad.top VUE_APP_SUBSYSTEM=http://ex-dev-dcxy-static.168cad.top
VUE_APP_SYSTEM_SERVER_URL=http://ex-dev-dcxy-system-manage.168cad.top VUE_APP_SYSTEM_SERVER_URL=http://ex-dev-dcxy-system-manage.168cad.top
......
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
fetchTitleList, fetchTitleList,
} from '@/api/dashboard/dashboard'; } from '@/api/dashboard/dashboard';
import customerData from './CustomerData/CustomerDataStore'; import customerData from './CustomerData/CustomerDataStore';
// import customerRecharge from './CustomerRecharge/CustomerRechargeStore'; import customerRecharge from './CustomerRecharge/CustomerRechargeStore';
// import customerConsumption from './CustomerConsumption/CustomerConsumptionStore'; // import customerConsumption from './CustomerConsumption/CustomerConsumptionStore';
import customerFeedback from './CustomerFeedback/CustomerFeedbackStore'; import customerFeedback from './CustomerFeedback/CustomerFeedbackStore';
import initFiltersStore from '@/store/modules/filters'; import initFiltersStore from '@/store/modules/filters';
...@@ -253,7 +253,7 @@ export default { ...@@ -253,7 +253,7 @@ export default {
modules: { modules: {
filtersStore, filtersStore,
customerData, customerData,
// customerRecharge, customerRecharge,
// customerConsumption, // customerConsumption,
customerFeedback, customerFeedback,
}, },
......
<template>
<div class="Dashboard Home-Dashboard">
<CustomerRegister
v-if="show"
class="Dashboard-Row Dashboard-DataCard"
/>
</div>
</template>
<script>
import CustomerRegister from '../Dashboard/CustomerRegister/CustomerRegister';
import { mapGetters, mapActions } from 'vuex';
export default {
name: 'Home-Dashboard',
components: {
CustomerRegister,
},
data() {
return {
show: false,
};
},
computed: {
...mapGetters(['asyncRoutes']),
},
mounted() {
let item = this.asyncRoutes.find(
item => item.menuCode === process.env.VUE_APP_REGISTER_DASHBOARD_CODE
);
if (item) {
this.fetchReportList();
this.show = true;
}
},
methods: {
...mapActions('Dashboard', ['fetchReportList']),
},
};
</script>
<style lang="scss">
.Home-Dashboard.Dashboard {
padding-top: 22px;
overflow-y: hidden;
}
</style>
import pagination from '@/store/modules/pagination';
const GET_LIST = 'GET_LIST';
const state = () => ({
list: [],
});
const getters = {
listData: state => state.list,
};
const actions = {
fetchAboutList({ state, commit, dispatch }, entity) {
return new Promise(resolve => {
const list = [
{ id: 1, name: '123' },
{ id: 2, name: '223' },
{ id: 3, name: '323' },
];
const pagination = {
pageNum: state.pagination.pageNum,
pageSize: state.pagination.pageSize,
...entity,
total: 500,
};
dispatch('updatePagination', pagination);
commit(GET_LIST, list);
resolve();
});
return fetchAboutList({
data: {
pageNum: state.pagination.pageNum,
pageSize: state.pagination.pageSize,
...entity,
},
}).then(res => {
const { list, ...pagination } = res.data;
dispatch('updatePagination', pagination);
commit(GET_LIST, list);
});
},
};
const mutations = {
[GET_LIST]: (state, list) => {
state.list = list;
},
};
export default {
namespaced: true,
modules: {
pagination,
},
state,
getters,
actions,
mutations,
};
<template>
<list-layout>
<template slot="filterItem">
<search-item label="姓名">
<el-input
v-model.trim="filters.name"
clearable
/>
</search-item>
</template>
<template slot="filterBtn">
<el-button
type="primary"
@click="searchList"
>查询</el-button>
</template>
<Table
:listData="listData"
:showEditDialog="showEditDialog"
:showDetail="showDetail"
/>
<template slot="footer">
<md-pagination
:pagination="pagination"
:changePage="changePage"
:changeSizeHandle="changeSizeHandle"
/>
</template>
<EditDialog
:visible.sync="dialogEditVisible"
:resetDialog="resetEditDialog"
:type="editType"
:selected="selected"
:submitUpdateHandle="updateSelected"
:cancelHandle="resetEditDialog"
/>
<DetailDialog
:visible.sync="dialogDetailVisible"
:resetDialog="resetDetailDialog"
:selected="selected"
/>
</list-layout>
</template>
<script>
import ListMixin from '@/mixins/listPage.js';
import { mapGetters, mapActions } from 'vuex';
import Table from './components/Table';
import EditDialog from './components/EditDialog';
import DetailDialog from './components/DetailDialog';
export default {
name: 'about',
mixins: [ListMixin],
components: { Table, EditDialog, DetailDialog },
data() {
return {};
},
computed: {
...mapGetters('system/about', ['listData', 'pagination']),
},
methods: {
...mapActions('system/about', ['fetchAboutList', 'updatePagination']),
fetchList(entity) {
this.fetchAboutList(entity);
},
showEditDialog(type, data) {
this.editType = type;
this.selected = {
...data,
};
this.dialogEditVisible = true;
},
updateSelected() {
const type = this.editType;
this.dialogEditVisible = false;
},
showDetail(data) {
this.selected = {
...data,
};
this.dialogDetailVisible = true;
},
},
};
</script>
<template>
<normal-dialog
:visible="visible"
:before-close="resetDialog"
@update:visible="updateVisibleHandle"
class="SystemUserDetail"
>
<template slot="title">详情</template>
<form-area title="详情">
<form-line>
<form-item label="登录账号">{{selected.loginAccount}}</form-item>
<form-item label="姓名">{{selected.name}}</form-item>
</form-line>
</form-area>
<form-area title="操作记录">
<div
class="record-List"
v-for="(item, index) in selected.adminRecordVoList"
:key="index"
>
<span class="record-Item">{{getOperClassifyName(item.operClassify)}}</span>
<span class="record-Item">{{item.handler}}</span>
<span class="record-Item">{{$formatDate(item.createAt)}}</span>
</div>
</form-area>
</normal-dialog>
</template>
<script>
import dialogMixin from '@/mixins/dialog.js';
export default {
mixins: [dialogMixin],
};
</script>
<style lang="scss">
.SystemUserDetail {
.record-List {
.record-Item {
display: inline-block;
width: 30%;
}
}
.login-List {
display: flex;
justify-content: space-between;
padding-right: 40px;
}
}
</style>
<template>
<normal-dialog
:visible="visible"
:before-close="resetDialog"
@update:visible="updateVisibleHandle"
class="CreditMarginEdit"
>
<template
v-if="type == 0"
slot="title"
>
<img src="@/assets/images/dialog/add_icon.png" />
新增
</template>
<template
v-else
slot="title"
>
<img src="@/assets/images/dialog/edit_icon.png" />
编辑
</template>
<el-form label-width="180px">
<el-form-item label="姓名">
<el-input
v-model="selected.name"
:maxlength="20"
clearable
/>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="submitUpdateHandle"
:disabled="loading"
>确定</el-button>
<el-button @click="cancelHandle">取消</el-button>
</div>
</normal-dialog>
</template>
<script>
import dialogMixin from '@/mixins/dialog.js';
export default {
mixins: [dialogMixin],
methods: {
changeHandle(val) {
if (val.length > 11) {
this.selected.cellphone = val.slice(0, 11);
} else {
this.selected.cellphone = val;
}
},
},
};
</script>
<style lang="scss">
.CreditMarginEdit {
.el-input-number {
width: 100%;
.el-input__inner {
text-align: left;
}
}
}
</style>
<template>
<md-table
:data="listData"
v-loading="loading"
>
<md-table-column
type="index"
label="序号"
align="center"
min-width="55"
width="55"
/>
<md-table-column
label="姓名"
min-width="100"
prop="name"
align="center"
>
<template slot-scope="scope">
<span
class="pointer"
@click="showDetail(scope.row)"
>{{scope.row.name}}</span>
</template>
</md-table-column>
<md-table-column
label="操作"
min-width="200"
fixed="right"
>
<template slot-scope="scope">
<el-button
type="primary"
@click="showEditDialog(1, scope.row)"
>修改</el-button>
</template>
</md-table-column>
</md-table>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
props: {
listData: { type: Array },
showEditDialog: { type: Function },
showDetail: { type: Function },
},
computed: {
...mapGetters(['loading']),
},
};
</script>
import about from './about';
export default {
install(store) {
if (!store.state.system) {
store.registerModule(['system'], {
namespaced: true,
});
}
if (!store.state.system.about) {
store.registerModule(['system', 'about'], about);
}
},
uninstall(store) {
store.unregisterModule(['system', 'about']);
},
};
...@@ -98,7 +98,9 @@ export default { ...@@ -98,7 +98,9 @@ export default {
...mapGetters(['collectList', 'dashboardBackPage']), ...mapGetters(['collectList', 'dashboardBackPage']),
formatRoute() { formatRoute() {
let routeList = this.routers.filter( let routeList = this.routers.filter(
menu => menu.menuCode !== process.env.VUE_APP_DASHBOARD_CODE menu =>
menu.menuCode !== process.env.VUE_APP_DASHBOARD_CODE &&
menu.menuCode !== process.env.VUE_APP_REGISTER_DASHBOARD_CODE
); );
return formatRouteLink(routeList); return formatRouteLink(routeList);
}, },
......
...@@ -14,9 +14,12 @@ const constantRouterMap = [ ...@@ -14,9 +14,12 @@ const constantRouterMap = [
{ {
path: '/', path: '/',
name: 'home', name: 'home',
meta: { title: '首页', icon: HomeIcon }, meta: {
// component: _import('Home'), title: '首页',
component: { render: h => <router-view /> }, icon: HomeIcon,
store: require('@/containers/Dashboard/store').default,
},
component: _import('Home/Home'),
}, },
{ {
path: '/dashboard', path: '/dashboard',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment