Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-manage-shell
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
dcxy-manage-shell
Commits
b8e5399d
Commit
b8e5399d
authored
May 09, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整注册页面在首页显示方式以及菜单显示
parent
cb35a6d2
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
135 additions
and
37 deletions
+135
-37
App.vue
src/App.vue
+14
-1
CustomerRegister.vue
...ontainers/Dashboard/CustomerRegister/CustomerRegister.vue
+7
-1
Dashboard.vue
src/containers/Dashboard/Dashboard.vue
+1
-9
Home.vue
src/containers/HomePage/Home.vue
+9
-1
IconMenu.vue
src/containers/layout/IconMenu/IconMenu.vue
+17
-1
develop.js
src/dev-local/develop.js
+6
-1
permission.js
src/lib/permission.js
+6
-0
main.js
src/main.js
+7
-1
asyncRoutes.js
src/router/asyncRoutes.js
+27
-0
index.js
src/router/index.js
+0
-21
route.js
src/utils/route.js
+41
-1
No files found.
src/App.vue
View file @
b8e5399d
...
...
@@ -96,6 +96,19 @@ export default {
dashboardVisiable
()
{
return
this
.
$route
.
name
===
'dashboard'
;
},
// defaultRoute() {
// if (this.route && this.route.length) {
// let item = this.route.find(
// item => item.children && item.children.length
// );
// if (item) {
// return [this.route[0], item];
// } else {
// return [this.route[0]];
// }
// }
// return [];
// },
},
mounted
()
{
if
(
this
.
$route
.
meta
&&
this
.
$route
.
meta
.
store
)
{
...
...
@@ -145,7 +158,7 @@ export default {
this
.
saveRouteState
();
},
selectRouteMenu
(
routes
)
{
this
.
selectedRoute
=
routes
;
this
.
selectedRoute
=
[
this
.
route
[
0
],
...
routes
]
;
this
.
showSelected
=
true
;
this
.
showFastLink
=
false
;
this
.
saveRouteState
();
...
...
src/containers/Dashboard/CustomerRegister/CustomerRegister.vue
View file @
b8e5399d
...
...
@@ -18,7 +18,7 @@
<area-select
v-model
.
trim=
"campusFilters.areaId"
@
input=
"changeReportAreaHandle"
type=
"user
"
:accessType=
"isAdmin?0:1
"
/>
</search-item>
</div>
...
...
@@ -57,6 +57,9 @@ export default {
RegisterByDay
,
ActiveUserByMonth
,
},
props
:
{
isAdmin
:
Boolean
,
},
data
()
{
return
{
campusFilters
:
{
...
...
@@ -81,6 +84,7 @@ export default {
if
(
val
)
{
let
areaId
=
this
.
campusFilters
.
areaId
;
this
.
fetchReportList
({
isAdmin
:
this
.
isAdmin
?
1
:
0
,
year
:
val
,
areaId
:
areaId
?
areaId
:
null
,
});
...
...
@@ -90,6 +94,7 @@ export default {
if
(
val
)
{
let
year
=
this
.
campusFilters
.
year
;
this
.
fetchReportList
({
isAdmin
:
this
.
isAdmin
?
1
:
0
,
year
:
year
?
year
:
null
,
areaId
:
val
,
});
...
...
@@ -100,6 +105,7 @@ export default {
let
year
=
this
.
campusFilters
.
year
;
let
areaId
=
this
.
campusFilters
.
areaId
;
this
.
fetchReportList
({
isAdmin
:
this
.
isAdmin
?
1
:
0
,
year
:
year
?
year
:
null
,
areaId
:
areaId
?
areaId
:
null
,
month
:
month
,
...
...
src/containers/Dashboard/Dashboard.vue
View file @
b8e5399d
...
...
@@ -9,14 +9,12 @@
<CampusCustomerData
class=
"Dashboard-DataCard"
/>
<EquipmentList
class=
"Dashboard-DataCard"
/>
</div>
<!--
<CustomerRegister
class=
"Dashboard-Row Dashboard-DataCard"
/>
-->
</div>
</div>
</
template
>
<
script
>
import
{
mapActions
,
mapGetters
}
from
'vuex'
;
// import CustomerRegister from './CustomerRegister/CustomerRegister';
import
EquipmentList
from
'./EquipmentList/EquipmentList'
;
import
CustomerFeedback
from
'./CustomerFeedback/CustomerFeedback'
;
import
CustomerData
from
'./CustomerData/CustomerData'
;
...
...
@@ -25,7 +23,6 @@ import CampusCustomerData from './CampusCustomerData/CampusCustomerData';
export
default
{
name
:
'Dashboard'
,
components
:
{
// CustomerRegister,
CustomerData
,
CustomerFeedback
,
EquipmentList
,
...
...
@@ -40,14 +37,9 @@ export default {
this
.
initData
();
},
methods
:
{
...
mapActions
(
'Dashboard'
,
[
'fetchReportList'
,
'fetchConsumeList'
,
'fetchTitleList'
,
]),
...
mapActions
(
'Dashboard'
,
[
'fetchConsumeList'
,
'fetchTitleList'
]),
...
mapActions
([
'updateBackPage'
]),
initData
()
{
this
.
fetchReportList
();
this
.
fetchConsumeList
();
this
.
fetchTitleList
();
},
...
...
src/containers/HomePage/Home.vue
View file @
b8e5399d
...
...
@@ -3,6 +3,7 @@
<CustomerRegister
v-if=
"show"
class=
"Dashboard-Row Dashboard-DataCard"
:isAdmin=
"isAdmin"
/>
</div>
</
template
>
...
...
@@ -23,13 +24,20 @@ export default {
},
computed
:
{
...
mapGetters
([
'asyncRoutes'
]),
isAdmin
()
{
return
this
.
$route
.
meta
.
btns
&&
this
.
$route
.
meta
.
btns
[
'0001'
]
?
true
:
false
;
},
},
mounted
()
{
let
item
=
this
.
asyncRoutes
.
find
(
item
=>
item
.
menuCode
===
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
);
if
(
item
)
{
this
.
fetchReportList
();
this
.
fetchReportList
({
isAdmin
:
this
.
isAdmin
?
1
:
0
,
});
this
.
show
=
true
;
}
},
...
...
src/containers/layout/IconMenu/IconMenu.vue
View file @
b8e5399d
...
...
@@ -102,7 +102,12 @@ export default {
menu
.
menuCode
!==
process
.
env
.
VUE_APP_DASHBOARD_CODE
&&
menu
.
menuCode
!==
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
);
return
formatRouteLink
(
routeList
);
let
list
=
formatRouteLink
(
routeList
);
// if (list && list.length) {
// if (list[0].children && list[0].children.length)
// this.selectRouteMenu(list[0].children);
// }
return
list
;
},
dashboardButtonVisiable
()
{
let
item
=
this
.
routers
.
find
(
...
...
@@ -112,14 +117,25 @@ export default {
},
},
watch
:
{
routers
(
val
)
{
this
.
getInitMemu
();
},
collectList
(
val
)
{
this
.
getCollectList
(
val
);
},
},
mounted
()
{
this
.
getInitMemu
();
this
.
getCollectList
(
this
.
collectList
);
},
methods
:
{
getInitMemu
()
{
if
(
this
.
routers
&&
this
.
routers
.
length
)
{
let
list
=
formatRouteLink
([
this
.
routers
[
0
]]);
if
(
list
[
0
].
children
&&
list
[
0
].
children
.
length
)
this
.
selectRouteMenu
(
list
[
0
].
children
);
}
},
getCollectList
(
val
)
{
let
routers
=
formatRouteLink
(
this
.
routers
);
let
list
=
val
.
map
(
item
=>
{
...
...
src/dev-local/develop.js
View file @
b8e5399d
import
System
from
'../lib/main'
;
import
asyncRouterMap
from
'../router/asyncRoutes'
;
window
.
manageShell
=
{
default
:
System
};
setTimeout
(()
=>
{
let
allAasyncRouterMap
=
[];
let
allAasyncRouterMap
=
[
...
asyncRouterMap
];
let
routeNameList
=
[
'customerManage'
,
'baseManage'
,
...
...
@@ -44,6 +45,10 @@ setTimeout(() => {
const
element
=
addRoute
[
index
];
if
(
element
.
children
)
{
routes
=
routes
.
concat
(
element
.
children
);
}
else
if
(
element
.
menuCode
===
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
)
{
routes
.
unshift
(
element
);
}
}
}
...
...
src/lib/permission.js
View file @
b8e5399d
import
{
asyncRouterMap
}
from
'../router'
;
import
asyncRoutes
from
'../router/asyncRoutes'
;
import
NProgress
from
'nprogress'
;
// Progress 进度条
import
'nprogress/nprogress.css'
;
// Progress 进度条样式
import
{
getToken
}
from
'@/utils/auth'
;
// 验权
...
...
@@ -15,6 +16,11 @@ const configRoutePermission = (
const
getRouteAdd
=
()
=>
{
let
allRoute
=
store
.
getters
.
asyncRoutes
;
let
asyncRouters
=
getAuthRoute
(
allAasyncRouterMap
,
allRoute
);
let
indexPage
=
asyncRouters
.
find
(
item
=>
item
.
path
===
'/'
);
if
(
!
indexPage
)
{
router
.
addRoutes
([
asyncRoutes
[
0
]]);
// 添加首页
}
router
.
addRoutes
(
asyncRouters
);
// 动态添加可访问路由表
router
.
addRoutes
(
asyncRouterMap
);
};
...
...
src/main.js
View file @
b8e5399d
let
allAasyncRouterMap
=
[];
import
asyncRouterMap
from
'./router/asyncRoutes'
;
let
allAasyncRouterMap
=
[...
asyncRouterMap
];
let
routeNameList
=
[
'customerManage'
,
'baseManage'
,
...
...
@@ -29,6 +31,10 @@ System.createSystem({
const
element
=
addRoute
[
index
];
if
(
element
.
children
)
{
routes
=
routes
.
concat
(
element
.
children
);
}
else
if
(
element
.
menuCode
===
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
)
{
routes
.
unshift
(
element
);
}
}
}
...
...
src/router/asyncRoutes.js
0 → 100644
View file @
b8e5399d
import
_import
from
'./_import'
;
import
HomeIcon
from
'@/assets/images/menu/home.png'
;
export
default
[
{
path
:
'/'
,
name
:
'home'
,
code
:
'0083'
,
meta
:
{
title
:
'首页'
,
icon
:
HomeIcon
,
store
:
require
(
'@/containers/Dashboard/store'
).
default
,
},
component
:
_import
(
'HomePage/Home'
),
},
{
path
:
'/dashboard'
,
name
:
'dashboard'
,
code
:
'0079'
,
meta
:
{
title
:
'数据首页'
,
store
:
require
(
'@/containers/Dashboard/store'
).
default
,
},
component
:
_import
(
'Dashboard/Dashboard'
),
hidden
:
true
,
},
];
src/router/index.js
View file @
b8e5399d
...
...
@@ -3,7 +3,6 @@ import routeStore from './store';
import
Login
from
'@/containers/login/index'
;
import
errorPage404
from
'@/containers/errorPage/404'
;
import
errorPage401
from
'@/containers/errorPage/401'
;
import
HomeIcon
from
'@/assets/images/menu/home.png'
;
Vue
.
use
(
VueRouter
);
...
...
@@ -11,26 +10,6 @@ const constantRouterMap = [
{
path
:
'/login'
,
component
:
Login
,
hidden
:
true
},
{
path
:
'/404'
,
component
:
errorPage404
,
hidden
:
true
},
{
path
:
'/401'
,
component
:
errorPage401
,
hidden
:
true
},
{
path
:
'/'
,
name
:
'home'
,
meta
:
{
title
:
'首页'
,
icon
:
HomeIcon
,
store
:
require
(
'@/containers/Dashboard/store'
).
default
,
},
component
:
_import
(
'HomePage/Home'
),
},
{
path
:
'/dashboard'
,
component
:
_import
(
'Dashboard/Dashboard'
),
name
:
'dashboard'
,
meta
:
{
title
:
'数据首页'
,
store
:
require
(
'@/containers/Dashboard/store'
).
default
,
},
hidden
:
true
,
},
];
const
asyncRouterMap
=
[{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}];
...
...
src/utils/route.js
View file @
b8e5399d
...
...
@@ -12,6 +12,18 @@ export const formatRouteLink = (addRoute, path = '/') => {
children
:
formatRouteLink
(
route
.
childs
,
path
+
route
.
menuLink
+
'/'
),
};
}
else
{
if
(
route
.
menuCode
==
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
)
{
return
{
path
:
'/'
,
name
:
route
.
id
.
toString
(),
menuCode
:
route
.
menuCode
,
meta
:
{
title
:
'首页'
,
icon
:
route
.
menuPicSmall
,
bicon
:
route
.
menuPicBig
,
},
};
}
return
{
path
:
path
+
route
.
menuLink
,
name
:
route
.
id
.
toString
(),
...
...
@@ -33,7 +45,11 @@ export const getAuthRoute = (asyncRouterMap, addRoute, path = '/') => {
path
:
path
+
route
.
menuLink
,
component
:
{
render
:
h
=>
<
router
-
view
/>
},
name
:
route
.
id
,
meta
:
{
title
:
route
.
menuName
,
icon
:
route
.
menuPicSmall
},
meta
:
{
title
:
route
.
menuName
,
icon
:
route
.
menuPicSmall
,
bicon
:
route
.
menuPicBig
,
},
children
:
getAuthRoute
(
asyncRouterMap
,
route
.
childs
,
...
...
@@ -45,6 +61,29 @@ export const getAuthRoute = (asyncRouterMap, addRoute, path = '/') => {
item
=>
item
.
code
===
route
.
menuCode
);
if
(
localcomponent
)
{
if
(
route
.
menuCode
==
process
.
env
.
VUE_APP_DASHBOARD_CODE
||
route
.
menuCode
==
process
.
env
.
VUE_APP_REGISTER_DASHBOARD_CODE
)
{
return
{
path
:
localcomponent
.
path
,
component
:
localcomponent
.
component
,
name
:
localcomponent
.
name
,
menuCode
:
route
.
menuCode
,
meta
:
{
...
localcomponent
.
meta
,
icon
:
route
.
menuPicSmall
,
bicon
:
route
.
menuPicBig
,
btns
:
route
.
listMenuButtonVo
.
reduce
(
(
btns
,
val
)
=>
val
.
buttonCode
?
{
...
btns
,
[
val
.
buttonCode
]:
val
.
state
===
'1'
}
:
btns
,
{}
),
},
};
}
return
{
path
:
path
+
route
.
menuLink
,
component
:
localcomponent
.
component
,
...
...
@@ -54,6 +93,7 @@ export const getAuthRoute = (asyncRouterMap, addRoute, path = '/') => {
...
localcomponent
.
meta
,
title
:
route
.
menuName
,
icon
:
route
.
menuPicSmall
,
bicon
:
route
.
menuPicBig
,
btns
:
route
.
listMenuButtonVo
.
reduce
(
(
btns
,
val
)
=>
val
.
buttonCode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment