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
fe94bebb
Commit
fe94bebb
authored
Sep 04, 2018
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编写
parent
03b9ce17
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
16 deletions
+81
-16
dialog.vue
src/components/class/dialog.vue
+5
-5
index.vue
src/components/class/index.vue
+33
-11
userList.vue
src/components/class/userList.vue
+18
-0
noLesson.vue
src/components/noLesson/noLesson.vue
+13
-0
index.js
src/router/index.js
+5
-0
api.js
src/service/api.js
+7
-0
No files found.
src/components/class/dialog.vue
View file @
fe94bebb
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
<el-option
<el-option
v-for=
"(data,index) in teacherList"
v-for=
"(data,index) in teacherList"
:key=
"index"
:key=
"index"
:label=
"data.
teacher_
name"
:label=
"data.name"
:value=
"data.
teacher_
id"
>
:value=
"data.id"
>
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
get
PeriodsTeacher
Api
,
getClassDetailApi
,
editClassApi
,
addClassApi
}
from
"../../service/api"
;
import
{
get
TeacherList
Api
,
getClassDetailApi
,
editClassApi
,
addClassApi
}
from
"../../service/api"
;
export
default
{
export
default
{
props
:[
props
:[
'dialogObj'
'dialogObj'
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
},
},
methods
:{
methods
:{
initPage
(){
initPage
(){
get
PeriodsTeacherApi
(
this
.
dialogObj
.
periodsId
).
then
(
res
=>
{
get
TeacherListApi
(
).
then
(
res
=>
{
this
.
teacherList
=
res
this
.
teacherList
=
res
.
list
});
});
switch
(
this
.
dialogObj
.
type
)
{
switch
(
this
.
dialogObj
.
type
)
{
case
0
:
case
0
:
...
...
src/components/class/index.vue
View file @
fe94bebb
...
@@ -22,12 +22,12 @@
...
@@ -22,12 +22,12 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
""
>
<el-form-item
label=
""
>
<el-button
size=
"
"
@
click=
"getClassList"
>
<el-button
type=
"primary
"
@
click=
"getClassList"
>
搜索
搜索
</el-button>
</el-button>
</el-form-item>
</el-form-item>
<el-form-item
style=
"float: right"
>
<el-form-item
style=
"float: right"
>
<el-button
@
click=
"onAdd"
>
+添加班级
</el-button>
<el-button
@
click=
"onAdd"
type=
"success"
>
+添加班级
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -40,6 +40,11 @@
...
@@ -40,6 +40,11 @@
<el-form-item
label=
"已看课包数"
>
{{
title
.
has_watch_num
}}
</el-form-item>
<el-form-item
label=
"已看课包数"
>
{{
title
.
has_watch_num
}}
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<div
v-if=
"!classList || classList.length === 0"
>
<el-form
label-width=
"300px"
inline
>
<el-form-item
label=
"暂无期数信息,请先选择期数"
></el-form-item>
</el-form>
</div>
<div>
<div>
<el-table
<el-table
:data=
"classList"
:data=
"classList"
...
@@ -61,24 +66,24 @@
...
@@ -61,24 +66,24 @@
label=
"现有人数"
>
label=
"现有人数"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
width=
"2
0
0"
width=
"2
5
0"
label=
"操作"
>
label=
"操作"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"editClass(scope.row)"
>
编辑
</el-button>
<el-button
@
click=
"showUser(scope.row)"
size=
"mini"
type=
"primary"
>
班级成员
</el-button>
<el-button
@
click=
"delClass(scope.row)"
>
删除
</el-button>
<el-button
@
click=
"editClass(scope.row)"
size=
"mini"
type=
"warning"
>
编辑
</el-button>
<el-button
@
click=
"delClass(scope.row)"
size=
"mini"
type=
"danger"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
<class-dialog
:dialogObj=
"dialogObj"
@
reflash=
"getClassList"
></class-dialog>
<class-dialog
:dialogObj=
"dialogObj"
@
reflash=
"getClassList"
></class-dialog>
<user-list
:userObj=
"userObj"
@
reflash=
"getClassList"
/>
<!--<page :total="total" v-model="nowPage"/>-->
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
getGoodsListApi
,
getPeriodsApi
,
getClassListApi
,
getPeriodsTeacherApi
,
delClassApi
}
from
"../../service/api"
;
import
{
getGoodsListApi
,
getPeriodsApi
,
getClassListApi
,
getPeriodsTeacherApi
,
delClassApi
}
from
"../../service/api"
;
import
classDialog
from
'./dialog'
import
classDialog
from
'./dialog'
import
UserList
from
'./userList'
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
...
@@ -88,6 +93,11 @@
...
@@ -88,6 +93,11 @@
classList
:[],
classList
:[],
title
:
''
,
title
:
''
,
teacherList
:[],
teacherList
:[],
userObj
:{
classId
:
''
,
title
:
''
,
show
:
false
,
},
dialogObj
:{
dialogObj
:{
show
:
false
,
show
:
false
,
title
:
'添加班级'
,
title
:
'添加班级'
,
...
@@ -98,6 +108,7 @@
...
@@ -98,6 +108,7 @@
}
}
},
},
components
:{
components
:{
UserList
,
classDialog
classDialog
},
},
mounted
(){
mounted
(){
...
@@ -122,16 +133,27 @@
...
@@ -122,16 +133,27 @@
}
}
});
});
},
},
showUser
(
data
){
this
.
userObj
=
{
classId
:
data
.
id
,
show
:
true
,
title
:
`
${
data
.
teacher_name
}
班级用户列表`
}
},
getTeacher
(){
getPeriodsTeacherApi
(
this
.
periods
.
id
).
then
(
res
=>
{
this
.
teacherList
=
res
})
},
changePeriods
(
data
){
changePeriods
(
data
){
if
(
data
.
length
>
1
){
if
(
data
.
length
>
1
){
let
nowGoods
=
this
.
goodsList
.
find
(
i
=>
{
return
i
.
id
===
data
[
0
]});
let
nowGoods
=
this
.
goodsList
.
find
(
i
=>
{
return
i
.
id
===
data
[
0
]});
this
.
periods
=
nowGoods
.
children
.
find
(
i
=>
{
return
i
.
id
===
data
[
1
]});
this
.
periods
=
nowGoods
.
children
.
find
(
i
=>
{
return
i
.
id
===
data
[
1
]});
getPeriodsTeacherApi
(
this
.
periods
.
id
).
then
(
res
=>
{
this
.
getTeacher
()
this
.
teacherList
=
res
})
}
}
},
},
getClassList
(){
getClassList
(){
this
.
getTeacher
();
getClassListApi
(
this
.
periods
.
id
,{
teacher_id
:
this
.
teacher_id
}).
then
(
res
=>
{
getClassListApi
(
this
.
periods
.
id
,{
teacher_id
:
this
.
teacher_id
}).
then
(
res
=>
{
this
.
title
=
res
.
periods
;
this
.
title
=
res
.
periods
;
this
.
classList
=
res
.
list
;
this
.
classList
=
res
.
list
;
...
...
src/components/class/userList.vue
0 → 100644
View file @
fe94bebb
<
template
>
<el-dialog
:title=
"userObj.title"
:visible
.
sync=
"userObj.show"
>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"userList"
,
props
:[
'userObj'
],
}
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
src/components/noLesson/noLesson.vue
0 → 100644
View file @
fe94bebb
<
template
>
</
template
>
<
script
>
export
default
{
name
:
"noLesson"
}
</
script
>
<
style
scoped
>
</
style
>
src/router/index.js
View file @
fe94bebb
...
@@ -27,6 +27,7 @@ import sysConfig from '@/components/system/sysConfig'
...
@@ -27,6 +27,7 @@ import sysConfig from '@/components/system/sysConfig'
import
autoReply
from
'@/components/weChat/autoReply'
import
autoReply
from
'@/components/weChat/autoReply'
import
weChatResource
from
'@/components/weChat/weChatResource'
import
weChatResource
from
'@/components/weChat/weChatResource'
import
banner
from
'@/components/system/banner'
import
banner
from
'@/components/system/banner'
import
noLesson
from
'@/components/noLesson'
Vue
.
use
(
Router
);
Vue
.
use
(
Router
);
...
@@ -54,6 +55,10 @@ const router =new Router({
...
@@ -54,6 +55,10 @@ const router =new Router({
path
:
'/help'
,
path
:
'/help'
,
name
:
'help'
,
name
:
'help'
,
component
:
help
component
:
help
},{
path
:
'/noLesson'
,
name
:
'noLesson'
,
component
:
noLesson
},{
},{
path
:
'/banner'
,
path
:
'/banner'
,
name
:
'banner'
,
name
:
'banner'
,
...
...
src/service/api.js
View file @
fe94bebb
...
@@ -392,6 +392,13 @@ const getClassDetailUrl = `${_baseUrl}api/admin/periods/class/info/`;
...
@@ -392,6 +392,13 @@ const getClassDetailUrl = `${_baseUrl}api/admin/periods/class/info/`;
export
const
getClassDetailApi
=
function
(
id
,
json
)
{
export
const
getClassDetailApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getClassDetailUrl
}${
id
}
`
,
json
)
return
Vue
.
prototype
.
$fetch
(
`
${
getClassDetailUrl
}${
id
}
`
,
json
)
};
};
// 获取班级用户列表
const
getClassUserUrl
=
`
${
_baseUrl
}
api/admin/class/user/list/`
;
export
const
getClassUserApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getClassUserUrl
}${
id
}
`
)
};
// 添加班级用户
const
addClassUserUrl
=
`
${
_baseUrl
}
`
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