Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
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
new-sing
admin-base
Commits
dd6db7f3
Commit
dd6db7f3
authored
Jul 09, 2019
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liwei
parent
06e3b7e5
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1507 additions
and
1076 deletions
+1507
-1076
App.vue
src/App.vue
+42
-38
index.vue
src/components/channelTransList/index.vue
+354
-0
index.vue
src/components/class/index.vue
+407
-391
leftMenu.vue
src/components/framework/leftMenu.vue
+60
-53
index.vue
src/components/login/index.vue
+111
-104
api.js
src/service/api.js
+242
-237
menuList.js
src/util/menuList.js
+291
-253
No files found.
src/App.vue
View file @
dd6db7f3
<
template
>
<div
id=
"app"
>
<router-view/>
<router-view
/>
</div>
</
template
>
<
script
>
import
menu
from
'./util/menuList'
import
menu
from
"./util/menuList"
;
export
default
{
name
:
'App'
,
data
(){
return
{
}
name
:
"App"
,
data
()
{
return
{};
},
mounted
(){
mounted
()
{
// 权限验证 动态路由
if
(
window
.
location
.
href
.
indexOf
(
'login'
)
<
0
)
{
if
(
window
.
location
.
href
.
indexOf
(
"login"
)
<
0
)
{
let
permission
=
this
.
$store
.
state
.
progressList
;
console
.
log
(
this
.
$store
.
state
)
console
.
log
(
this
.
$store
.
state
)
;
let
menuList
=
[];
this
.
$router
.
options
.
routes
[
0
].
children
=
[];
let
routerUserDetail
=
{
path
:
'/userDetail/:id'
,
name
:
'userDetail'
,
component
:
e
=>
require
([
'@/components/userDetail'
],
e
),
path
:
"/userDetail/:id"
,
name
:
"userDetail"
,
component
:
e
=>
require
([
"@/components/userDetail"
],
e
)
};
let
routerTeacherDetail
=
{
path
:
'/teacher/:id'
,
name
:
'teacherDetail'
,
component
:
e
=>
require
([
'@/components/teacherDetail'
],
e
),
let
routerTeacherDetail
=
{
path
:
"/teacher/:id"
,
name
:
"teacherDetail"
,
component
:
e
=>
require
([
"@/components/teacherDetail"
],
e
)
};
menu
.
forEach
(
i
=>
{
menu
.
forEach
(
i
=>
{
let
p
=
false
;
let
t
=
[];
i
.
list
.
forEach
(
j
=>
{
let
find
=
permission
.
find
(
x
=>
{
return
x
.
cover
===
j
.
cover
});
if
(
find
){
i
.
list
.
forEach
(
j
=>
{
let
find
=
permission
.
find
(
x
=>
{
return
x
.
cover
===
j
.
cover
;
});
if
(
find
)
{
j
.
router
.
meta
=
{};
j
.
router
.
meta
.
readonly
=
!!
find
.
readonly
;
j
.
router
.
meta
.
delete
=
!!
find
.
delete
;
...
...
@@ -47,13 +47,13 @@ export default {
j
.
router
.
meta
.
classTakeUnlimited
=
!!
find
.
classTakeUnlimited
;
j
.
router
.
meta
.
promoter
=
!!
find
.
promoter
;
t
.
push
(
j
);
if
(
find
.
cover
===
'3-1'
)
{
if
(
find
.
cover
===
"3-1"
)
{
routerTeacherDetail
.
meta
=
{};
routerTeacherDetail
.
meta
.
readonly
=
find
.
readonly
;
routerTeacherDetail
.
meta
.
delete
=
!!
find
.
delete
;
this
.
$router
.
options
.
routes
[
0
].
children
.
push
(
routerTeacherDetail
);
}
if
(
find
.
cover
===
'3-2'
)
{
if
(
find
.
cover
===
"3-2"
)
{
routerUserDetail
.
meta
=
{};
routerUserDetail
.
meta
.
readonly
=
find
.
readonly
;
routerUserDetail
.
meta
.
delete
=
!!
find
.
delete
;
...
...
@@ -63,28 +63,32 @@ export default {
p
=
true
;
}
});
if
(
p
)
{
if
(
p
)
{
i
.
list
=
t
;
menuList
.
push
(
i
)
menuList
.
push
(
i
)
;
}
});
this
.
$router
.
addRoutes
([
this
.
$router
.
options
.
routes
[
0
]]);
//调用add;
this
.
$store
.
dispatch
(
'setMenu'
,
menuList
)
this
.
$router
.
addRoutes
([
this
.
$router
.
options
.
routes
[
0
]]);
//调用add;
this
.
$store
.
dispatch
(
"setMenu"
,
menuList
);
}
}
}
}
;
</
script
>
<
style
>
#app
{
height
:
100%
;
}
html
,
body
{
html
,
body
{
height
:
100%
;
margin
:
0
;
padding
:
0
;
}
.el-collapse-item__arrow
{
margin-left
:
0
;}
.fl
{
float
:
left
;}
}
.el-collapse-item__arrow
{
margin-left
:
0
;
}
.fl
{
float
:
left
;
}
</
style
>
src/components/channelTransList/index.vue
0 → 100644
View file @
dd6db7f3
This diff is collapsed.
Click to expand it.
src/components/class/index.vue
View file @
dd6db7f3
This diff is collapsed.
Click to expand it.
src/components/framework/leftMenu.vue
View file @
dd6db7f3
...
...
@@ -6,80 +6,87 @@
background-color=
"#333333"
active-text-color=
"#ffd04b"
:collapse=
"menuType"
class=
"el-menu-vertical-demo"
>
class=
"el-menu-vertical-demo"
>
<div
class=
"menu-btn"
@
click=
"menuType = !menuType"
>
<i
v-if=
"!menuType"
class=
"iconfont icon-shouqi"
></i>
<i
v-if=
"menuType"
class=
"iconfont icon-zhankai"
></i>
<i
v-if=
"menuType"
class=
"iconfont icon-zhankai"
></i>
</div>
<el-submenu
v-for=
"(data,index) in menuList"
:index=
"data.value"
:key=
"index"
>
<template
slot=
"title"
>
<i
:class=
"'iconfont menu-icon '+data.icon"
></i>
<span>
{{
data
.
value
}}
</span>
</
template
>
<el-menu-item
v-for=
"(item,i) in data.list"
:index=
"item.path"
:key=
"i"
class=
"item"
>
{{item.value}}
</el-menu-item>
<el-menu-item
v-for=
"(item,i) in data.list"
:index=
"item.path"
:key=
"i"
class=
"item"
>
{{item.value}}
</el-menu-item>
</el-submenu>
</el-menu>
</template>
<
script
>
export
default
{
export
default
{
name
:
"leftMenu"
,
data
()
{
data
()
{
return
{
menuList
:
this
.
$store
.
state
.
menuList
,
menuType
:
false
}
menuList
:
this
.
$store
.
state
.
menuList
,
menuType
:
false
};
},
mounted
()
{
console
.
log
(
this
.
menuList
);
},
methods
:
{
changeMenuType
:
function
()
{
this
.
$store
.
state
.
menuType
=
!
this
.
$store
.
state
.
menuType
methods
:
{
changeMenuType
:
function
()
{
this
.
$store
.
state
.
menuType
=
!
this
.
$store
.
state
.
menuType
;
},
toPath
:
function
(
data
)
{
this
.
$router
.
push
({
name
:
data
.
routerName
})
if
(
this
.
$store
.
state
.
openedTab
.
indexOf
(
data
)
<
0
)
{
toPath
:
function
(
data
)
{
this
.
$router
.
push
({
name
:
data
.
routerName
});
if
(
this
.
$store
.
state
.
openedTab
.
indexOf
(
data
)
<
0
)
{
this
.
$store
.
state
.
openedTab
.
push
(
data
);
}
}
},
}
};
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
.el-menu-vertical-demo:not(.el-menu--collapse) {
@import "../../util/public";
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
}
.el-menu
{
}
.el-menu
{
background: @bg-b;
color: white;
overflow: auto;
height: 100%;
.menu-btn
{
.menu-btn
{
height: 35px;
background: @bg-b-s;
line-height: 35px;
/*text-align: center;*/
i
{
i
{
font-size: 26px;
float: right;
padding: 0 15px;
}
}
.el-submenu
{
.menu-icon
{
.el-submenu
{
.menu-icon
{
color: white;
font-size: 18px;
position: relative;
right: 5px;
}
.el-menu-item
{
.el-menu-item
{
background: @main-font-color;
}
.template
{
.template
{
color: black;
}
}
}
}
</
style
>
src/components/login/index.vue
View file @
dd6db7f3
...
...
@@ -18,94 +18,101 @@
</
template
>
<
script
>
import
{
loginApi
}
from
"../../service/api"
;
import
md5
from
'js-md5'
;
export
default
{
data
()
{
return
{
login
:
{
username
:
''
,
password
:
''
import
{
loginApi
}
from
"../../service/api"
;
import
md5
from
"js-md5"
;
export
default
{
data
()
{
return
{
login
:
{
username
:
""
,
password
:
""
},
loginRules
:
{
username
:
[
{
required
:
true
,
message
:
'请输入您的用户名'
,
trigger
:
'blur'
}
loginRules
:
{
username
:
[
{
required
:
true
,
message
:
"请输入您的用户名"
,
trigger
:
"blur"
}
],
password
:
[
{
required
:
true
,
message
:
'请输入您的密码'
,
trigger
:
'blur'
}
password
:
[
{
required
:
true
,
message
:
"请输入您的密码"
,
trigger
:
"blur"
}
]
}
}
};
},
mounted
()
{
mounted
()
{
let
that
=
this
;
document
.
onkeydown
=
keyDownSearch
;
document
.
onkeydown
=
keyDownSearch
;
function
keyDownSearch
(
e
)
{
// 兼容FF和IE和Opera
let
theEvent
=
e
||
window
.
event
;
let
code
=
theEvent
.
keyCode
||
theEvent
.
which
||
theEvent
.
charCode
;
if
(
code
===
13
&&
that
.
$route
.
name
===
'login'
)
{
that
.
submitForm
();
//具体处理函数
if
(
code
===
13
&&
that
.
$route
.
name
===
"login"
)
{
that
.
submitForm
();
//具体处理函数
return
false
;
}
return
true
;
}
},
methods
:
{
methods
:
{
// 提交
submitForm
()
{
this
.
$refs
[
"loginForm"
].
validate
((
valid
)
=>
{
submitForm
()
{
this
.
$refs
[
"loginForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
json
=
{
username
:
this
.
login
.
username
,
password
:
md5
(
this
.
login
.
password
)
username
:
this
.
login
.
username
,
password
:
md5
(
this
.
login
.
password
)
};
// debugger
loginApi
(
json
).
then
(
res
=>
{
if
(
res
.
teacher_info
){
let
data
=
JSON
.
stringify
(
res
.
teacher_info
)
localStorage
.
setItem
(
"phoneNum"
,
data
)
}
else
{
localStorage
.
setItem
(
"phoneNum"
,
""
)
loginApi
(
json
).
then
(
res
=>
{
debugger
;
if
(
res
.
teacher_info
)
{
let
data
=
JSON
.
stringify
(
res
.
teacher_info
);
localStorage
.
setItem
(
"phoneNum"
,
data
);
}
else
{
localStorage
.
setItem
(
"phoneNum"
,
""
);
}
this
.
$store
.
dispatch
(
'setToken'
,
res
.
token
);
this
.
$store
.
dispatch
(
'setUserName'
,
res
.
desc
);
this
.
$store
.
dispatch
(
'setPermission'
,
JSON
.
parse
(
res
.
roles
.
menu_ids
));
this
.
$store
.
dispatch
(
"setToken"
,
res
.
token
);
this
.
$store
.
dispatch
(
"setUserName"
,
res
.
desc
);
this
.
$store
.
dispatch
(
"setPermission"
,
JSON
.
parse
(
res
.
roles
.
menu_ids
)
);
// debugger
window
.
location
.
href
=
'/'
;
})
}
})
window
.
location
.
href
=
"/"
;
});
}
});
}
}
};
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
.login
{
@import "../../util/public";
.login
{
height: 100%;
background: linear-gradient(to bottom right, #ecec7c, #787af4); /* 标准的语法(必须放在最后) */
}
.wrap-main{
background: linear-gradient(
to bottom right,
#ecec7c,
#787af4
); /* 标准的语法(必须放在最后) */
}
.wrap-main {
width: 300px;
height: 180px;
padding:
50px 20px;
padding:
50px 20px;
border-radius: 5px;
box-shadow: 8px 8px 15px rgba(49, 49, 49, 0.5);
position: fixed;
line-height: 50px;
background-color: rgba(255,255,255,
0.3);
background-color: rgba(255, 255, 255,
0.3);
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -200px;
.btn
{
.btn
{
display: block;
width: 100%;
}
.title
{
.title
{
position: absolute;
top: -100px;
width: 100%;
...
...
@@ -115,5 +122,5 @@
font-size: 26px;
text-shadow: 6px 6px 3px rgba(49, 49, 49, 0.5);
}
}
}
</
style
>
src/service/api.js
View file @
dd6db7f3
This diff is collapsed.
Click to expand it.
src/util/menuList.js
View file @
dd6db7f3
...
...
@@ -37,7 +37,7 @@ export default [{
name
:
'shop'
,
component
:
e
=>
require
([
'@/components/shop'
],
e
),
},
},
]
},]
},
{
name
:
''
,
value
:
'期数管理'
,
...
...
@@ -63,7 +63,7 @@ export default [{
name
:
'class'
,
component
:
e
=>
require
([
'@/components/class'
],
e
),
}
},
{
},
{
value
:
'市场招生统计'
,
routerName
:
'marketStatistics'
,
path
:
'/marketStatistics'
,
...
...
@@ -111,7 +111,7 @@ export default [{
name
:
'teacher'
,
component
:
e
=>
require
([
'@/components/teacher'
],
e
),
}
},{
},
{
value
:
'月课订单列表'
,
routerName
:
'monthOrder'
,
path
:
'/monthOrder'
,
...
...
@@ -132,7 +132,7 @@ export default [{
name
:
'monthOrderCount'
,
component
:
e
=>
require
([
'@/components/orderCount/monthOrderCount'
],
e
),
}
},
{
},
{
value
:
'退款列表'
,
routerName
:
'refund'
,
path
:
'/refund'
,
...
...
@@ -142,7 +142,7 @@ export default [{
name
:
'refund'
,
component
:
e
=>
require
([
'@/components/refund'
],
e
),
}
},{
},
{
value
:
'业绩排行'
,
routerName
:
'achievement'
,
path
:
'/achievement'
,
...
...
@@ -152,7 +152,7 @@ export default [{
name
:
'achievement'
,
component
:
e
=>
require
([
'@/components/achievement'
],
e
),
}
},{
},
{
value
:
'话术列表'
,
routerName
:
'talkingSkill'
,
path
:
'/talkingSkill'
,
...
...
@@ -164,7 +164,7 @@ export default [{
}
},]
},
{
{
name
:
''
,
value
:
'用户管理'
,
icon
:
'icon-laoshi'
,
...
...
@@ -215,11 +215,12 @@ export default [{
},
]
},
{
{
name
:
''
,
value
:
'订单管理'
,
icon
:
'icon-dingdan'
,
list
:
[{
list
:
[
{
value
:
'日课订单列表'
,
routerName
:
'order'
,
path
:
'/order'
,
...
...
@@ -251,7 +252,8 @@ export default [{
name
:
'consignment'
,
component
:
e
=>
require
([
'@/components/consignment'
],
e
),
}
},
{
},
{
value
:
'订单统计'
,
routerName
:
'orderCount'
,
path
:
'/orderCount'
,
...
...
@@ -261,7 +263,8 @@ export default [{
name
:
'orderCount'
,
component
:
e
=>
require
([
'@/components/orderCount/index'
],
e
),
}
},{
},
{
value
:
'日课订单统计'
,
routerName
:
'dayOrderCount'
,
path
:
'/dayOrderCount'
,
...
...
@@ -305,7 +308,6 @@ export default [{
component
:
e
=>
require
([
'@/components/yunji'
],
e
),
}
},
{
value
:
'兑换码管理'
,
routerName
:
'exchange'
,
...
...
@@ -316,10 +318,10 @@ export default [{
name
:
'exchange'
,
component
:
e
=>
require
([
'@/components/exchange'
],
e
),
}
}
,
}
]
},
{
{
name
:
''
,
value
:
'实物管理'
,
icon
:
'icon-shu'
,
...
...
@@ -462,7 +464,24 @@ export default [{
}
},
]
},
{
},
{
name
:
''
,
value
:
'教研管理'
,
icon
:
'icon-material'
,
list
:
[{
value
:
'教材列表'
,
routerName
:
'resources'
,
path
:
'/resources'
,
cover
:
'1-1'
,
router
:
{
path
:
'/resources'
,
name
:
'resources'
,
component
:
e
=>
require
([
'@/components/resources'
],
e
),
}
}]
},
{
name
:
''
,
value
:
'系统管理'
,
icon
:
'icon-xitongquanxian'
,
...
...
@@ -522,7 +541,25 @@ export default [{
},
]
},
{
name
:
''
,
value
:
'数据管理'
,
icon
:
'icon-shezhi'
,
list
:
[
{
value
:
'渠道转化列表'
,
routerName
:
'channelTransList'
,
path
:
'/channelTransList'
,
cover
:
'9-1'
,
router
:
{
path
:
'/channelTransList'
,
name
:
'channelTransList'
,
component
:
e
=>
require
([
'@/components/channelTransList'
],
e
),
}
}
]
},
{
name
:
''
,
value
:
'后台管理'
,
icon
:
'icon-shezhi'
,
...
...
@@ -568,6 +605,7 @@ export default [{
}
},
{
value
:
'操作日志'
,
routerName
:
'adminLog'
,
...
...
@@ -580,7 +618,7 @@ export default [{
}
}
]
}
}
]
// {
// name: '',
...
...
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