File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 "normalize.css" : " 7.0.0" ,
2020 "nprogress" : " 0.2.0" ,
2121 "vue" : " 2.5.2" ,
22+ "vue-multiselect" : " ^2.0.8" ,
2223 "vue-router" : " 2.7.0" ,
2324 "vuex" : " 2.3.1"
2425 },
Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import ElementUI from 'element-ui'
33import 'element-ui/lib/theme-chalk/index.css'
4+ import 'vue-multiselect/dist/vue-multiselect.min.css'
45import locale from 'element-ui/lib/locale/lang/en'
56import App from './App'
67import router from './router'
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const getters = {
66 name : state => state . user . name ,
77 roles : state => state . user . roles ,
88 permission_routers : state => state . permission . routers ,
9- addRouters : state => state . permission . addRouters
9+ addRouters : state => state . permission . addRouters ,
10+ AllRouters :state => state . permission . AllRouters
1011}
1112export default getters
Original file line number Diff line number Diff line change @@ -34,12 +34,17 @@ function filterAsyncRouter(asyncRouterMap, roles) {
3434const permission = {
3535 state : {
3636 routers : constantRouterMap ,
37- addRouters : [ ]
37+ addRouters : [ ] ,
38+ AllRouters :[ ]
3839 } ,
3940 mutations : {
4041 SET_ROUTERS : ( state , routers ) => {
4142 state . addRouters = routers
4243 state . routers = constantRouterMap . concat ( routers )
44+ } ,
45+
46+ SET_ALLROUTERS : ( state ) => {
47+ state . AllRouters = constantRouterMap . concat ( asyncRouterMap )
4348 }
4449 } ,
4550 actions : {
@@ -53,6 +58,9 @@ const permission = {
5358 accessedRouters = filterAsyncRouter ( asyncRouterMap , roles )
5459 }
5560 commit ( 'SET_ROUTERS' , accessedRouters )
61+
62+ commit ( 'SET_ALLROUTERS' )
63+
5664 resolve ( )
5765 } )
5866 }
Original file line number Diff line number Diff line change 11<template >
22 <div class =" dashboard-container" >
33 <el-row >
4- <el-col :span =" 8 " >
4+ <el-col :span =" 6 " >
55 <el-card :body-style =" { padding: '15px 0px',height:'250px'}" >
66 <i class =" el-icon-edit" style =" font-size :30px " ></i >
77
1616
1717 </el-card >
1818 </el-col >
19- <el-col :span =" 8 " :offset =" 2" >
19+ <el-col :span =" 6 " :offset =" 2" >
2020 <el-card :body-style =" { padding: '15px 0px',height:'250px'}" >
2121 <i class =" el-icon-location" style =" font-size :30px " ></i >
2222
2323 <div class =" dashboard-text" style =" padding-top :0px " >{{weather.city}}天气</div >
24- <div class =" dashboard-text" >空气质量:{{weather.data.quality}},气温:{{weather.data.wendu}}℃,湿度:{{weather.data.shidu}}</div >
24+ <div class =" dashboard-text" >空气质量:{{weather.data.quality}}。</div >
25+ <div class =" dashboard-text" >气温:{{weather.data.wendu}}℃,湿度:{{weather.data.shidu}}。</div >
2526
2627 </el-card >
2728 </el-col >
Original file line number Diff line number Diff line change @@ -46,4 +46,11 @@ export default {
4646 cursor : text ;
4747 }
4848}
49+ .app-levelbar.el-breadcrumb :focus {
50+ outline :none ;
51+ }
52+
53+
54+
55+
4956 </style >
Original file line number Diff line number Diff line change @@ -11,8 +11,13 @@ export default {
1111 components: { SidebarItem },
1212 computed: {
1313 ... mapGetters ([
14- ' permission_routers'
14+ ' permission_routers' ,
15+ ' AllRouters'
1516 ])
17+ },
18+ created (){
19+ console .log (this .AllRouters )
20+
1621 }
1722}
1823 </script >
Original file line number Diff line number Diff line change 22 <div class =" login-container" >
33 <el-form autoComplete =" on" :model =" loginForm" ref =" loginForm" label-position =" left" label-width =" 0px"
44 class =" card-box login-form" >
5- <h3 class =" title" > <img style =" width :7% " src =' /favicon .ico' > Anshare</h3 >
5+ <h3 class =" title" > <img style =" width :7% " src =' /logo .ico' > Anshare</h3 >
66
77
88 <el-form-item prop =" username" >
Original file line number Diff line number Diff line change 8181 </el-form-item >
8282
8383 <el-form-item label =" 角色" >
84- <el-select v-model =" RoleID" placeholder =" 请选择" >
84+ <!-- < el-select v-model="RoleID" placeholder="请选择">
8585 <el-option v-for="item in options" :key="item.ID" :label="item.RoleName" :value="item.ID">
8686 </el-option>
87- </el-select >
87+ </el-select> -->
88+ <multiselect :value =" RoleID" :options =" options" :searchable =" false" :close-on-select =" true" :allow-empty =" false" label =" RoleName"
89+ placeholder =" 请选择角色" track-by =" RoleName" >
90+ </multiselect >
8891 </el-form-item >
8992 </el-form >
9093 <div slot =" footer" class =" dialog-footer" >
111114 import {
112115 GetRoles
113116 } from " @/api/system/role" ;
117+ import Multiselect from ' vue-multiselect'
114118
115119 export default {
116120 data () {
117121 return {
122+ RoleID: " " ,
118123 depttree: [],
119124 textMap: {
120125 update: " 编辑" ,
139144 defaultProps: {
140145 children: " children" ,
141146 label: " text"
142- }
147+ },
148+ selected: null
149+
143150 };
144151 },
152+ components: {
153+ Multiselect
154+ },
145155
146156 created () {
147157 this .fetchData ();
199209
200210 GetUsersDetail (ID ).then (response => {
201211
202- this .dialogStatus = " update" ;
203212 this .temp = response .data ;
204213 this .$refs .tree .setCheckedKeys ([this .temp .DeptID ]);
205214 this .RoleID = this .temp .RoleID ;
206- this .fetchData ();
207215 });
208216 },
209217
You can’t perform that action at this time.
0 commit comments