Commit 8589439e by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !29
parents 1cd3cd59 c45f0a7d
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8" /> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script> <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.umd.min.js"></script> <script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.umd.min.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.min.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.min.js"></script>
<link <script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.min.js"></script>
rel="stylesheet" <script src="<%= VUE_APP_LIB_MANAGER %>/operateManage/lib/operateManage.umd.min.js"></script>
href="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.css"
/> <link rel="stylesheet" href="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.css" />
<title>系统管理</title> <title>系统管理</title>
</head> </head>
<body>
<noscript> <body>
<strong <noscript>
>We're sorry but hello-world doesn't work properly without JavaScript <strong>We're sorry but hello-world doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong enabled. Please enable it to continue.</strong>
> </noscript>
</noscript> <div id="app"></div>
<div id="app"></div> <!-- built files will be auto injected -->
<!-- built files will be auto injected --> </body>
</body>
</html> </html>
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
selectedRoute: [], selectedRoute: [],
routerDone: false, routerDone: false,
isInnerPage: true, isInnerPage: true,
showFastLink: false, showFastLink: true,
showSelected: false, showSelected: false,
}; };
}, },
......
...@@ -14,6 +14,12 @@ export const fetchAccessAreaList = req => ...@@ -14,6 +14,12 @@ export const fetchAccessAreaList = req =>
method: 'get', method: 'get',
...req, ...req,
}); });
export const fetchDashboardAreaList = req =>
fetch({
url: path + '/dcxy/baseArea/findAccessArea',
method: 'POST',
...req,
});
//获取下拉列表 //获取下拉列表
export const fetchSelectList = req => export const fetchSelectList = req =>
fetch({ fetch({
......
<template>
<el-select
clearable
filterable
:value="value"
@change="changeHandle"
:multiple="multiple"
>
<el-option
v-for="(item, index) in dashboardArea"
:key="index"
:value="item.id"
:label="item.areaName"
></el-option>
</el-select>
</template>
<script>
import areaMixin from './mixin.js';
export default {
name: 'dashboard-area-select',
props: {
size: String,
value: {
required: true,
},
multiple: {
type: Boolean,
default: false,
},
},
mixins: [areaMixin],
methods: {
changeHandle(val) {
if (val) {
this.$emit('input', val);
} else {
if (this.multiple) {
this.$emit('input', dashboardArea.map(item => item.id));
} else {
this.$emit('input', null);
}
}
},
},
};
</script>
import { fetchDashboardAreaList } from '@/api/base/index';
const GET_AREA_LIST = 'GET_AREA_LIST';
const FETCH_STATE = 'FETCH_STATE';
const FETCH_END = 'FETCH_END';
const state = () => ({
fetching: false,
list: [],
});
const initGetters = () => ({
dashboardArea: state => state.list,
});
const getters = initGetters();
const initAction = () => ({
fetchDashboardAreaList({ commit }, entity) {
return fetchDashboardAreaList({
data: entity,
}).then(res => {
console.log(res);
const list = res.data;
commit(GET_AREA_LIST, list);
});
},
});
const actions = initAction();
const mutations = {
[GET_AREA_LIST](state, list) {
state.list = list;
},
[FETCH_STATE](state) {
state.fetching = true;
},
[FETCH_END](state) {
state.fetching = false;
},
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};
import AreaSelect from './AreaSelect';
import areaMixin from './mixin';
export { areaMixin };
export default AreaSelect;
import { mapGetters, mapActions } from 'vuex';
import store from './store';
export default {
props: {
operateId: {
type: Number,
},
},
created() {
store.install(this.$store);
},
mounted() {
if (this.dashboardArea && !this.dashboardArea.length) {
this.fetchDashboardAreaList({
operateId: null,
});
}
},
watch: {
operateId(val) {
this.fetchDashboardAreaList({
operateId: val,
});
},
},
computed: {
...mapGetters('dashboardArea', ['dashboardArea']),
},
methods: {
...mapActions('dashboardArea', ['fetchDashboardAreaList']),
getAreaName(id) {
let item = this.dashboardArea.find(area => area.id === id);
if (item) {
return item.areaName;
} else {
return '';
}
},
getAreaOperatorInfo(id) {
let item = this.dashboardArea.find(area => area.id === id);
if (item) {
return {
rechargeOperateId: item.rechargeOperateId,
rechargeOperateName: item.rechargeOperateName,
};
} else {
return null;
}
},
},
};
import areaStroe from './areaStore';
export default {
install(store) {
if (!store.state.base) {
store.registerModule(['base'], {
state: {},
});
}
if (!store.state.base.dashboardArea) {
store.registerModule(['base', 'dashboardArea'], areaStroe);
}
},
uninstall(store) {
store.unregisterModule(['base', 'dashboardArea']);
},
};
<template> <template>
<div <div
class="Dashboard-DataCard" class="Dashboard-DataCard CampusRank-wrap"
v-loading="loading.area" v-loading="loading.area"
> >
<div class="Dashboard-SearchBar"> <div class="Dashboard-SearchBar">
...@@ -8,7 +8,15 @@ ...@@ -8,7 +8,15 @@
<operator-select <operator-select
:accessType="1" :accessType="1"
:value="filters.operateId" :value="filters.operateId"
@input="val => changeFilterHandle({ operateId: val })" @input="val => changeOperatorHandle({ operateId: val })"
/>
</search-item>
<search-item label="区域">
<dashboard-area-select
:operateId="filters.operateId"
:value="filters.choiceareaIds"
multiple
@input="val => updateFilters({choiceareaIds: val})"
/> />
</search-item> </search-item>
<el-radio-group <el-radio-group
...@@ -29,6 +37,10 @@ ...@@ -29,6 +37,10 @@
:label="2" :label="2"
>本年</el-radio> >本年</el-radio>
</el-radio-group> </el-radio-group>
<el-button
type="primary"
@click="fetchConsumeList"
>搜索</el-button>
</div> </div>
<CampusRankChart <CampusRankChart
:data="campusRankList" :data="campusRankList"
...@@ -77,9 +89,33 @@ export default { ...@@ -77,9 +89,33 @@ export default {
this.showOther = false; this.showOther = false;
}); });
}, },
changeOperatorHandle(data) {
this.updateFilters({ ...data, choiceareaIds: [] });
// this.fetchConsumeList();
},
showOtherNameHandle() { showOtherNameHandle() {
this.showOther = true; this.showOther = true;
}, },
}, },
}; };
</script> </script>
<style lang="scss">
.CampusRank-wrap {
.el-select {
.el-select__tags {
height: 90%;
overflow: hidden;
input {
display: none;
}
}
.el-input {
overflow: hidden;
}
.el-input__inner {
height: 100% !important;
}
}
}
</style>
<template> <template>
<div <div
class="Dashboard-DataCard CustomerConsumption" class="CustomerConsumption"
v-loading="loading" v-loading="loading"
> >
<div class="Dashboard-SearchBar"> <!-- <div class="Dashboard-SearchBar">
<search-item label="运营商"> <search-item label="运营商">
<operator-select <operator-select
:accessType="1" :accessType="1"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
:label="2" :label="2"
>本年</el-radio> >本年</el-radio>
</el-radio-group> </el-radio-group>
</div> </div> -->
<div class="Dashboard-title">消费视图 <div class="Dashboard-title">消费视图
<div <div
class="CustomerConsumptionChart-tip" class="CustomerConsumptionChart-tip"
......
...@@ -31,6 +31,9 @@ const actions = { ...@@ -31,6 +31,9 @@ const actions = {
getConsumeOrderList({ commit, getters, dispatch }, data) { getConsumeOrderList({ commit, getters, dispatch }, data) {
commit(FETCH_DATA, true); commit(FETCH_DATA, true);
if (data) { if (data) {
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data); dispatch('updateFilters', data);
} }
let entity = getFilters(getters.filters); let entity = getFilters(getters.filters);
......
<template>
<div class="Dashboard-CustomerMoneyData">
<div class="Dashboard-SearchBar bothSearch">
<search-item label="运营商">
<operator-select
:accessType="1"
:value="filters.operateId"
@input="val => fetchAllData({operateId: val})"
/>
</search-item>
<search-item label="区域">
<dashboard-area-select
:operateId="filters.operateId"
:value="filters.areaId"
@input="val => fetchAllData({areaId: val})"
/>
</search-item>
<el-radio-group
class="Dashboard-Radio"
:value="filters.timeType"
@input="val => fetchAllData({timeType: val})"
>
<el-radio
class="Dashboard-Radio-item"
:label="0"
>本日</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="1"
>本月</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="2"
>本年</el-radio>
</el-radio-group>
<el-button
type="primary"
@click="fetchAllData"
>搜索</el-button>
</div>
<div class="Dashboard-CustomerMoneyData-chart">
<CustomerRecharge />
<CustomerConsumption />
</div>
</div>
</template>
<script>
import CustomerRecharge from '../CustomerRecharge/CustomerRecharge';
import CustomerConsumption from '../CustomerConsumption/CustomerConsumption';
import { mapGetters, mapActions } from 'vuex';
export default {
name: 'CustomerMoneyData',
components: {
CustomerRecharge,
CustomerConsumption,
},
computed: {
...mapGetters('Dashboard/customerConsumption', ['filters']),
},
methods: {
...mapActions('Dashboard/customerConsumption', ['getConsumeOrderList']),
...mapActions('Dashboard/customerRecharge', ['getRechargeOrderList']),
fetchAllData(entity) {
this.getConsumeOrderList(entity);
this.getRechargeOrderList(entity);
},
},
};
</script>
<style lang="scss">
.Dashboard-CustomerMoneyData {
.Dashboard & .Dashboard-SearchBar.bothSearch {
justify-content: flex-start;
align-items: center;
.Dashboard-Radio {
margin-left: 20px;
}
}
.Dashboard-CustomerMoneyData-chart {
display: flex;
width: 100%;
.CustomerRecharge {
flex: 1;
position: relative;
margin-right: 30px;
}
.CustomerRecharge::after {
content: '';
position: absolute;
height: 80%;
top: 10%;
right: -25px;
border-right: 1px dotted #eee;
}
.CustomerConsumption {
flex: 1;
}
}
}
</style>
<template> <template>
<div <div
class="Dashboard-DataCard CustomerRecharge" class="CustomerRecharge"
v-loading="loading" v-loading="loading"
> >
<div class="Dashboard-SearchBar"> <!-- <div class="Dashboard-SearchBar">
<search-item label="运营商"> <search-item label="运营商">
<operator-select <operator-select
:accessType="1" :accessType="1"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
:label="2" :label="2"
>本年</el-radio> >本年</el-radio>
</el-radio-group> </el-radio-group>
</div> </div> -->
<div class="Dashboard-title">储值视图 <div class="Dashboard-title">储值视图
<div class="CustomerRechargeChart-tip"> <div class="CustomerRechargeChart-tip">
<span <span
...@@ -61,7 +61,6 @@ export default { ...@@ -61,7 +61,6 @@ export default {
...mapGetters('Dashboard/customerRecharge', [ ...mapGetters('Dashboard/customerRecharge', [
'rechargeList', 'rechargeList',
'rechargeCount', 'rechargeCount',
'filters',
'loading', 'loading',
]), ]),
}, },
......
...@@ -6,6 +6,7 @@ const FETCH_DATA = 'FETCH_DATA'; ...@@ -6,6 +6,7 @@ const FETCH_DATA = 'FETCH_DATA';
const initFilters = () => ({ const initFilters = () => ({
operateId: undefined, operateId: undefined,
areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年 timeType: 0, // 0 本日,1 本月, 2 本年
}); });
const filtersStore = initFiltersStore(initFilters); const filtersStore = initFiltersStore(initFilters);
...@@ -30,6 +31,9 @@ const actions = { ...@@ -30,6 +31,9 @@ const actions = {
getRechargeOrderList({ commit, getters, dispatch }, data) { getRechargeOrderList({ commit, getters, dispatch }, data) {
commit(FETCH_DATA, true); commit(FETCH_DATA, true);
if (data) { if (data) {
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data); dispatch('updateFilters', data);
} }
let entity = getFilters(getters.filters); let entity = getFilters(getters.filters);
......
...@@ -22,6 +22,7 @@ const LOADING_REGIST = 'LOADING_REGIST'; ...@@ -22,6 +22,7 @@ const LOADING_REGIST = 'LOADING_REGIST';
const initFilters = () => ({ const initFilters = () => ({
operateId: undefined, operateId: undefined,
choiceareaIds: [],
timeType: 0, // 0 本日,1 本月, 2 本年 timeType: 0, // 0 本日,1 本月, 2 本年
}); });
const filtersStore = initFiltersStore(initFilters); const filtersStore = initFiltersStore(initFilters);
...@@ -68,13 +69,17 @@ const getters = { ...@@ -68,13 +69,17 @@ const getters = {
areaInfo: state => state.consume.areaInfo, areaInfo: state => state.consume.areaInfo,
consumeAfterVos: state => state.consume.consumeAfterVos, consumeAfterVos: state => state.consume.consumeAfterVos,
consumeHardVos: state => state.consume.consumeHardVos, consumeHardVos: state => state.consume.consumeHardVos,
campusRankList: state => state.consume.list, campusRankList: state => {
return state.consume.list.filter(item => {
return state.filtersStore.filters.choiceareaIds.indexOf(item.areaId) > -1;
});
},
seviceRatioList: state => state.consume.percentList, seviceRatioList: state => state.consume.percentList,
loading: state => state.loading, loading: state => state.loading,
}; };
const actions = { const actions = {
fetchConsumeList({ commit, getters }, data) { fetchConsumeList({ commit, getters, dispatch }, data) {
let entity = getFilters(getters.filters); let entity = getFilters(getters.filters);
switch (entity.timeType) { switch (entity.timeType) {
case 1: case 1:
...@@ -114,6 +119,19 @@ const actions = { ...@@ -114,6 +119,19 @@ const actions = {
commit(GET_EUIPMENT_DATA, list); commit(GET_EUIPMENT_DATA, list);
commit(LOADING_EQUIPMENT, false); commit(LOADING_EQUIPMENT, false);
} else { } else {
console.log(list.list);
if (list.list && list.list.length > 5) {
let areaList = list.list.slice(0, 5);
dispatch('updateFilters', {
choiceareaIds: areaList.map(item => item.areaId),
});
} else if (list.list) {
dispatch('updateFilters', {
choiceareaIds: list.list.map(item => item.areaId),
});
}
commit(GET_CONSUME_DATA, list); commit(GET_CONSUME_DATA, list);
commit(LOADING_AREA, false); commit(LOADING_AREA, false);
} }
...@@ -166,22 +184,7 @@ const mutations = { ...@@ -166,22 +184,7 @@ const mutations = {
state.consume.consumeAfterVos = data.consumeAfterVos state.consume.consumeAfterVos = data.consumeAfterVos
? data.consumeAfterVos ? data.consumeAfterVos
: []; : [];
let campusList = data.list ? data.list : []; state.consume.list = data.list ? data.list : [];
if (campusList.length > 10) {
let arrStart = campusList.slice(0, 9);
let arrEnd = campusList.slice(9).reduce(
(item, curentVal) => ({
...item,
count: item.count + curentVal.count,
}),
{
areaName: '其他校区',
count: 0,
}
);
campusList = [...arrStart, arrEnd];
}
state.consume.list = campusList;
state.consume.percentList = data.percentList ? data.percentList : []; state.consume.percentList = data.percentList ? data.percentList : [];
}, },
[GET_PERCENT_DATA]: (state, data) => { [GET_PERCENT_DATA]: (state, data) => {
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
<div> <div>
<div class="Dashboard"> <div class="Dashboard">
<div class="Dashboard-Row Dashboard-CustomerData"> <div class="Dashboard-Row Dashboard-CustomerData">
<CustomerRecharge class="Dashboard-DataCard" /> <CustomerData class="Dashboard-DataCard" />
<CustomerConsumption class="Dashboard-DataCard" />
<CustomerFeedback class="Dashboard-DataCard" /> <CustomerFeedback class="Dashboard-DataCard" />
</div> </div>
<div class="Dashboard-Row Dashboard-OperatorData"> <div class="Dashboard-Row Dashboard-OperatorData">
...@@ -18,20 +17,18 @@ ...@@ -18,20 +17,18 @@
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import CustomerRegister from './CustomerRegister/CustomerRegister'; // import CustomerRegister from './CustomerRegister/CustomerRegister';
import SeviceRatio from './SeviceRatio/SeviceRatio'; import SeviceRatio from './SeviceRatio/SeviceRatio';
import CampusRank from './CampusRank/CampusRank'; import CampusRank from './CampusRank/CampusRank';
import EquipmentList from './EquipmentList/EquipmentList'; import EquipmentList from './EquipmentList/EquipmentList';
import CustomerRecharge from './CustomerRecharge/CustomerRecharge';
import CustomerConsumption from './CustomerConsumption/CustomerConsumption';
import CustomerFeedback from './CustomerFeedback/CustomerFeedback'; import CustomerFeedback from './CustomerFeedback/CustomerFeedback';
import CustomerData from './CustomerData/CustomerData';
export default { export default {
name: 'Dashboard', name: 'Dashboard',
components: { components: {
CustomerRegister, // CustomerRegister,
CustomerRecharge, CustomerData,
CustomerConsumption,
CustomerFeedback, CustomerFeedback,
SeviceRatio, SeviceRatio,
CampusRank, CampusRank,
...@@ -104,7 +101,7 @@ export default { ...@@ -104,7 +101,7 @@ export default {
justify-self: flex-end; justify-self: flex-end;
.Dashboard-Radio-item { .Dashboard-Radio-item {
font-size: 12px; font-size: 12px;
margin: 0 5px 0 0; margin: 0 10px 0 0;
.el-radio__label { .el-radio__label {
padding-left: 2px; padding-left: 2px;
} }
...@@ -125,10 +122,7 @@ export default { ...@@ -125,10 +122,7 @@ export default {
} }
.Dashboard-DataCard { .Dashboard-DataCard {
&:first-child { &:first-child {
flex: 2; flex: 4;
}
&:nth-child(2) {
flex: 2;
} }
&:last-child { &:last-child {
flex: 1; flex: 1;
......
...@@ -22,10 +22,21 @@ export default { ...@@ -22,10 +22,21 @@ export default {
}, },
computed: { computed: {
routeList() { routeList() {
return this.collectList.map(item => { if (
let name = item.menuId.toString(); this.collectList &&
return getCollectMenu(this.routers, name); this.collectList.length &&
}); this.routers &&
this.routers.length
) {
let list = this.collectList.map(item => {
let name = item.menuId.toString();
return getCollectMenu(this.routers, name);
});
list = list.filter(item => !!item);
return list;
} else {
return [];
}
}, },
}, },
}; };
......
...@@ -71,6 +71,8 @@ ...@@ -71,6 +71,8 @@
<MenuItem <MenuItem
:class="`fastLink ${dashboardVisiable?'marleft':''}`" :class="`fastLink ${dashboardVisiable?'marleft':''}`"
menuName="快速访问" menuName="快速访问"
:menuList="collectRouteList"
:noTitle="true"
> >
<img <img
slot="icon" slot="icon"
...@@ -98,7 +100,7 @@ ...@@ -98,7 +100,7 @@
<script> <script>
import MenuItem from './components/MenuItem'; import MenuItem from './components/MenuItem';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { formatRouteLink } from '@/utils/route'; import { formatRouteLink, getFilterMenu } from '@/utils/route';
export default { export default {
name: 'IconMenus', name: 'IconMenus',
...@@ -148,6 +150,7 @@ export default { ...@@ -148,6 +150,7 @@ export default {
}, },
computed: { computed: {
...mapGetters('Dashboard', ['titleData']), ...mapGetters('Dashboard', ['titleData']),
...mapGetters(['collectList']),
customerManage() { customerManage() {
let item = this.routers.find( let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_CUSTOMER_MENU_CODE menu => menu.menuCode === process.env.VUE_APP_CUSTOMER_MENU_CODE
...@@ -172,6 +175,22 @@ export default { ...@@ -172,6 +175,22 @@ export default {
); );
return item ? true : false; return item ? true : false;
}, },
collectRouteList() {
if (
this.routers &&
this.routers.length &&
this.collectList &&
this.collectList.length
) {
let item = this.collectList.map(item => {
let id = item.menuId;
return getFilterMenu(this.routers, id);
});
return item ? formatRouteLink(item) : null;
} else {
return null;
}
},
}, },
methods: { methods: {
clickHandle() { clickHandle() {
......
...@@ -21,36 +21,56 @@ ...@@ -21,36 +21,56 @@
:style="style" :style="style"
v-if="menuList && menuList.length" v-if="menuList && menuList.length"
> >
<template v-if="noTitle">
<div <div class="Submenu">
class="Submenu" <div class="Submenu-list">
v-for="(item, index) in menuList" <div
:key="index" class="Submenu-link"
> v-for="(item, index) in menuList"
<div class="Submenu-title"> :key="index"
<span>{{item.meta.title}}</span> >
<LikeIcon <LikeIcon :name="item.name" />
v-if="!item.children" <router-link
:name="item.name" class="Submenu-link-text"
/> :to="item.path"
>{{item.meta.title}}</router-link>
</div>
</div>
</div> </div>
</template>
<template v-else>
<div <div
class="Submenu-list" class="Submenu"
v-if="item.children && item.children.length" v-for="(item, index) in menuList"
:key="index"
> >
<div class="Submenu-title">
<span>{{item.meta.title}}</span>
<LikeIcon
v-if="!item.children"
:name="item.name"
/>
</div>
<div <div
class="Submenu-link" class="Submenu-list"
v-for="(item, index) in item.children" v-if="item.children && item.children.length"
:key="index"
> >
<LikeIcon :name="item.name" /> <div
<router-link class="Submenu-link"
class="Submenu-link-text" v-for="(item, index) in item.children"
:to="item.path" :key="index"
>{{item.meta.title}}</router-link> >
<LikeIcon :name="item.name" />
<router-link
class="Submenu-link-text"
:to="item.path"
>{{item.meta.title}}</router-link>
</div>
</div> </div>
</div> </div>
</div> </template>
</div> </div>
</div> </div>
</template> </template>
...@@ -73,6 +93,10 @@ export default { ...@@ -73,6 +93,10 @@ export default {
selectRouteMenu: { selectRouteMenu: {
type: Function, type: Function,
}, },
noTitle: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -148,6 +172,7 @@ export default { ...@@ -148,6 +172,7 @@ export default {
height: auto; height: auto;
} }
.Submenu-title { .Submenu-title {
width: 560px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
font-size: 14px; font-size: 14px;
......
...@@ -143,10 +143,18 @@ export default { ...@@ -143,10 +143,18 @@ export default {
varifyCode: this.loginForm.vcode, varifyCode: this.loginForm.vcode,
remenberAccount: this.remenberAccount, remenberAccount: this.remenberAccount,
}) })
.then(() => { .then(userRoles => {
console.log('login done'); console.log('login done');
this.loading = false; this.loading = false;
this.$router.push({ path: '/' }); if (
userRoles.find(
item => item.menuCode === process.env.VUE_APP_DASHBOARD_CODE
)
) {
this.$router.push({ name: 'dashboard' });
} else {
this.$router.push({ path: '/' });
}
}) })
.catch(err => { .catch(err => {
console.error(err); console.error(err);
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8" /> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script> <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://unpkg.com/vuex@3.1.0/dist/vuex.js"></script>
<title>系统管理</title> <script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script>
</head> <title>系统管理</title>
<body> </head>
<noscript>
<strong <body>
>We're sorry but hello-world doesn't work properly without JavaScript <noscript>
enabled. Please enable it to continue.</strong <strong>We're sorry but hello-world doesn't work properly without JavaScript
> enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.min.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.min.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.min.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.min.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/operateManage/lib/operateManage.umd.min.js"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> <script src="https://webapi.amap.com/maps?v=1.4.12&key=dd6103c90f2f17310a8711f2d330a0a6"></script>
<script src="https://unpkg.com/@antv/data-set"></script> <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="https://unpkg.com/@antv/data-set"></script>
</html> </html>
...@@ -7,6 +7,7 @@ setTimeout(() => { ...@@ -7,6 +7,7 @@ setTimeout(() => {
...customerManage.default, ...customerManage.default,
...baseManage.default, ...baseManage.default,
...systemManage.default, ...systemManage.default,
...operateManage.default,
]; ];
System.createSystem({ System.createSystem({
......
...@@ -49,7 +49,6 @@ class SystemShell { ...@@ -49,7 +49,6 @@ class SystemShell {
...whiteList.split(','), ...whiteList.split(','),
] ]
: process.env.VUE_APP_WHITE_LIST.split(','); // 不重定向白名单 : process.env.VUE_APP_WHITE_LIST.split(','); // 不重定向白名单
console.log(allWhiteList);
store.dispatch('getWhiteList', allWhiteList); store.dispatch('getWhiteList', allWhiteList);
configRoutePermission(router, store, routers, allWhiteList); configRoutePermission(router, store, routers, allWhiteList);
......
...@@ -2,6 +2,7 @@ let allAasyncRouterMap = [ ...@@ -2,6 +2,7 @@ let allAasyncRouterMap = [
...customerManage.default, ...customerManage.default,
...baseManage.default, ...baseManage.default,
...systemManage.default, ...systemManage.default,
...operateManage.default,
]; ];
const System = manageShell.default; const System = manageShell.default;
......
...@@ -40,6 +40,7 @@ const actions = { ...@@ -40,6 +40,7 @@ const actions = {
commit(SET_TOKEN, token); commit(SET_TOKEN, token);
commit(UPDATE_USERINFO, userInfo); commit(UPDATE_USERINFO, userInfo);
dispatch('getAsyncRoute', userRoles); dispatch('getAsyncRoute', userRoles);
return userRoles;
}); });
}, },
// token登录 // token登录
......
...@@ -15,6 +15,7 @@ import UserCard from '../components/UserCard/UserCard.vue'; ...@@ -15,6 +15,7 @@ import UserCard from '../components/UserCard/UserCard.vue';
import UserInfo from '../components/UserCard/UserInfo.vue'; import UserInfo from '../components/UserCard/UserInfo.vue';
import UserDialog from '../components/Dialog/UserDialogWrap'; import UserDialog from '../components/Dialog/UserDialogWrap';
import DashboardArea from '../components/input/AreaDashboard/index';
import AreaSelect from '../components/input/AreaSelect/index'; import AreaSelect from '../components/input/AreaSelect/index';
import ServiceTypeSelect from '../components/input/ServiceTypeSelect/index'; import ServiceTypeSelect from '../components/input/ServiceTypeSelect/index';
import BaseDataSelect from '../components/input/BaseDataSelect/index'; import BaseDataSelect from '../components/input/BaseDataSelect/index';
...@@ -38,6 +39,7 @@ const extendVue = Vue => { ...@@ -38,6 +39,7 @@ const extendVue = Vue => {
Vue.component(HeaderImg.name, HeaderImg); Vue.component(HeaderImg.name, HeaderImg);
// input // input
Vue.component(DashboardArea.name, DashboardArea);
Vue.component(AreaSelect.name, AreaSelect); Vue.component(AreaSelect.name, AreaSelect);
Vue.component(BaseDataSelect.name, BaseDataSelect); Vue.component(BaseDataSelect.name, BaseDataSelect);
Vue.component(ServiceTypeSelect.name, ServiceTypeSelect); Vue.component(ServiceTypeSelect.name, ServiceTypeSelect);
......
...@@ -82,3 +82,18 @@ export const getCollectMenu = (routeList, name) => { ...@@ -82,3 +82,18 @@ export const getCollectMenu = (routeList, name) => {
} }
return menuData; return menuData;
}; };
export const getFilterMenu = (allRouterMap, id) => {
let menuData = null;
for (let index = 0; index < allRouterMap.length; index++) {
const element = allRouterMap[index];
if (element.childs && element.childs.length) {
menuData = getFilterMenu(element.childs, id);
if (menuData) break;
} else if (element.id === id) {
menuData = element;
break;
}
}
return menuData;
};
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