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
55e28f98
Commit
55e28f98
authored
Sep 19, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
cf78cd85
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
227 additions
and
39 deletions
+227
-39
index.js
config/index.js
+2
-2
index.vue
src/components/class/index.vue
+18
-1
userList.vue
src/components/class/userList.vue
+155
-21
index.vue
src/components/order/index.vue
+1
-1
newDialog.vue
src/components/periods/newDialog.vue
+29
-7
index.vue
src/components/teacher/index.vue
+1
-1
index.vue
src/components/user/index.vue
+10
-1
index.vue
src/components/userDetail/index.vue
+3
-3
api.js
src/service/api.js
+8
-2
No files found.
config/index.js
View file @
55e28f98
...
...
@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
proxyTable
:
{
'/api'
:
{
//
target: 'http://local.base-api.sing.com', // 接口的域名
target
:
'http://wechat.test.singsingenglish.com/'
,
target
:
'http://local.base-api.sing.com'
,
// 接口的域名
//
target: 'http://wechat.test.singsingenglish.com/',
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
}
},
...
...
src/components/class/index.vue
View file @
55e28f98
...
...
@@ -77,6 +77,12 @@
prop=
"teacher_name"
label=
"班主任"
>
</el-table-column>
<el-table-column
label=
"班级类型"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
type
|
classTypeFilter
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"max_join_num"
label=
"最大人数"
>
...
...
@@ -143,9 +149,20 @@
classDialog
,
page
},
filters
:
{
classTypeFilter
(
val
){
let
_val
=
parseInt
(
val
);
if
(
_val
===
1
)
{
return
'带班班级'
}
else
if
(
_val
===
2
)
{
return
'观摩班级'
}
else
{
return
''
}
}
},
mounted
(){
this
.
initPage
();
},
methods
:{
initQuery
(){
...
...
src/components/class/userList.vue
View file @
55e28f98
...
...
@@ -3,34 +3,36 @@
<div>
<el-form
label-width=
"90px"
inline
>
<el-form-item
style=
"float: right"
>
<el-button
type=
"success"
@
click=
"
addShow = true
"
v-if=
"!$store.state.readonly"
>
+添加用户
</el-button>
<el-button
type=
"success"
@
click=
"
onAddUser
"
v-if=
"!$store.state.readonly"
>
+添加用户
</el-button>
</el-form-item>
</el-form>
<el-table
:data=
"userTable"
style=
"width: 100%"
>
<el-table-column
label=
"
头像
"
>
<el-table-column
label=
"
用户"
className=
"f-c
"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.avatar"
style=
"
width: 50px;height: 50px;border-radius: 50px"
>
<img
:src=
"scope.row.avatar"
style=
"
margin-right:5px;width: 50px;height: 50px;border-radius: 50px"
>
{{
scope
.
row
.
nickname
}}
(ID:
{{
scope
.
row
.
user_id
}}
)
</
template
>
</el-table-column>
<el-table-column
prop=
"user_id"
label=
"用户ID"
>
</el-table-column>
<el-table-column
prop=
"nickname"
label=
"用户名"
>
label=
"是否购买"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
is_buy
===
0
?
'否'
:
'是'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"看课权限"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
is_view_course
|
isOrNot
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
v-if=
"!$store.state.readonly"
>
<el-table-column
prop=
"desc"
label=
"备注"
>
</el-table-column>
<el-table-column
label=
"操作"
v-if=
"!$store.state.readonly"
width=
"300"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"warning"
size=
"mini"
@
click=
"editComment(scope.row.user_id, scope.row.desc)"
>
编辑备注
</el-button>
<el-button
type=
"warning"
size=
"mini"
@
click=
"changeUser(scope.row)"
>
更改看课权限
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"onDel(scope.row)"
>
删除
</el-button>
</
template
>
...
...
@@ -40,10 +42,56 @@
</div>
<el-dialog
:modal=
"false"
:visible
.
sync=
"addShow"
>
<el-form
label-width=
"90px"
>
<el-form-item
label=
"用户id"
>
<el-input
v-model=
"addId"
></el-input>
</el-form-item>
<!--<el-form-item label="用户id">-->
<!--<el-input v-model="addId"></el-input>-->
<!--</el-form-item>-->
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"ID"
>
<el-input
v-model=
"searchFrom.userId"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"昵称"
>
<el-input
v-model=
"searchFrom.nickName"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"电话"
>
<el-input
v-model=
"searchFrom.mobile"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
:offset=
"16"
>
<el-form-item>
<el-button
style=
"float: right"
type=
"primary"
plain
@
click=
"getUser"
>
搜索
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:data=
"userList"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
style=
"width: 100%"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<el-table-column
className=
"f-c"
label=
"用户"
>
<
template
slot-scope=
"scope"
>
<img
style=
"margin-right:5px;width: 50px;height: 50px;border-radius: 50px"
:src=
"scope.row.avatar"
>
{{
scope
.
row
.
nickname
}}
(ID:
{{
scope
.
row
.
user_id
}}
)
</
template
>
</el-table-column>
<el-table-column
prop=
"mobile"
label=
"手机号"
>
</el-table-column>
</el-table>
<page
:total=
"total"
:limit=
"limit"
@
pageChange=
"onPageChange"
/>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"addShow = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"onAdd"
>
确 定
</el-button>
...
...
@@ -53,7 +101,8 @@
</template>
<
script
>
import
{
addClassUesrApi
,
getClassUserApi
,
changeUserApi
,
delClassUserApi
}
from
"../../service/api"
;
import
{
addClassUesrApi
,
getClassUserApi
,
changeUserApi
,
delClassUserApi
,
getUserListApi
,
addPeriodsClassUserDescApi
}
from
"../../service/api"
;
import
page
from
'../framework/page'
import
{
ISORNOT
}
from
"../../util/wordbook"
;
export
default
{
...
...
@@ -65,9 +114,23 @@
return
{
userTable
:[],
addId
:
''
,
addShow
:
false
addShow
:
false
,
searchFrom
:
{},
userList
:
[],
nowPage
:
1
,
limit
:
1
,
total
:
0
,
searchFrom
:
{
userId
:
''
,
nickName
:
''
,
mobile
:
''
},
multipleSelection
:
[]
}
},
components
:{
page
},
filters
:{
isOrNot
(
value
){
return
ISORNOT
[
value
]
...
...
@@ -105,19 +168,85 @@
type
:
'success'
,
message
:
'删除成功!'
});
this
.
initPage
()
});
this
.
initPage
()
});
},
onAdd
(){
addClassUesrApi
(
this
.
userObj
.
classId
,
this
.
addId
).
then
(
res
=>
{
let
json
=
{
is_buy
:
0
}
if
(
this
.
multipleSelection
.
length
===
0
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请选择用户!'
});
return
}
else
if
(
this
.
multipleSelection
.
length
!==
1
){
this
.
$message
({
type
:
'error'
,
message
:
'只能选择一个用户!'
});
return
}
this
.
addId
=
this
.
multipleSelection
[
0
].
user_id
;
if
(
!
this
.
addId
)
{
return
}
addClassUesrApi
(
this
.
userObj
.
classId
,
this
.
addId
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'添加成功!'
});
this
.
addShow
=
false
;
this
.
initPage
()
})
}
},
onAddUser
(){
this
.
addShow
=
true
;
this
.
getUser
();
},
getUser
(){
let
json
=
{
page
:
this
.
nowPage
,
limit
:
this
.
limit
}
if
(
this
.
searchFrom
.
userId
)
{
json
.
user_id
=
this
.
searchFrom
.
userId
}
if
(
this
.
searchFrom
.
nickName
)
{
json
.
nickname
=
this
.
searchFrom
.
nickName
}
if
(
this
.
searchFrom
.
mobile
)
{
json
.
mobile
=
this
.
searchFrom
.
mobile
}
getUserListApi
(
json
).
then
(
res
=>
{
this
.
userList
=
res
.
list
;
this
.
total
=
res
.
total
;
})
},
onPageChange
(
val
){
this
.
nowPage
=
val
this
.
getUser
()
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
},
editComment
(
id
,
desc
)
{
this
.
$prompt
(
''
,
'编辑备注'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
inputValue
:
desc
}).
then
(({
value
})
=>
{
addPeriodsClassUserDescApi
(
id
,{
desc
:
value
}).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'编辑备注成功'
})
this
.
initPage
();
});
})
},
},
watch
:{
...
...
@@ -128,6 +257,11 @@
}
</
script
>
<
style
scoped
lang=
"less"
>
<
style
>
.f-c
>
div
{
display
:
flex
;
flex-flow
:
row
nowrap
;
justify-content
:
flex-start
;
align-items
:
center
;
}
</
style
>
src/components/order/index.vue
View file @
55e28f98
...
...
@@ -264,7 +264,7 @@
}
},
editComment
(
id
,
desc
)
{
this
.
$prompt
(
'
编辑备注'
,
'提示
'
,
{
this
.
$prompt
(
'
'
,
'编辑备注
'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
inputValue
:
desc
...
...
src/components/periods/newDialog.vue
View file @
55e28f98
...
...
@@ -45,8 +45,18 @@
placeholder=
"选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"相关老师"
>
<el-select
v-model=
"teacherList"
multiple
placeholder=
"请选择"
>
<el-form-item
label=
"带班老师"
prop=
"teacherList"
>
<el-select
v-model=
"form.teacherList"
multiple
placeholder=
"请选择"
>
<el-option
v-for=
"item in teacherOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"观摩老师"
prop=
"viewTeacher"
>
<el-select
v-model=
"form.viewTeacher"
placeholder=
"请选择"
>
<el-option
v-for=
"item in teacherOptions"
:key=
"item.id"
...
...
@@ -88,6 +98,7 @@
loading
:
false
,
form
:
{},
teacherList
:
[],
viewTeacher
:
''
,
pickerOptions1
:
{
disabledDate
(
time
)
{
return
!
(
time
.
getTime
()
>
Date
.
now
());
...
...
@@ -144,6 +155,12 @@
],
goods_id
:
[
{
required
:
true
,
message
:
'商品ID不能为空'
,
trigger
:
'change'
}
],
teacherList
:
[
{
required
:
true
,
message
:
'带班老师不能为空'
,
trigger
:
'change'
}
],
viewTeacher
:
[
{
required
:
true
,
message
:
'观摩老师不能为空'
,
trigger
:
'change'
}
]
}
}
...
...
@@ -170,10 +187,14 @@
},
methods
:{
sub
(){
if
(
!
this
.
teacherList
)
{
this
.
$message
.
error
(
'请选择老师ID'
);
return
;
}
// if (!this.teacherList) {
// this.$message.error('请选择老师ID');
// return;
// }
// if (!this.viewTeacher) {
// this.$message.error('请选择观摩老师');
// return;
// }
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
let
_id
=
this
.
form
.
goods_id
;
...
...
@@ -182,7 +203,8 @@
start_num
:
this
.
form
.
start_num
,
start_at
:
this
.
form
.
start_at
,
rest_week_day
:
this
.
form
.
rest_week_day
?
this
.
form
.
rest_week_day
.
join
(
','
)
:
''
,
teacher_ids
:
this
.
teacherList
.
join
(
','
)
teacher_ids
:
this
.
form
.
teacherList
.
join
(
','
),
view_teacher_id
:
parseInt
(
this
.
form
.
viewTeacher
)
}
if
(
this
.
form
.
id
)
{
getEditPeriodsApi
(
this
.
form
.
id
,
json
).
then
(
res
=>
{
...
...
src/components/teacher/index.vue
View file @
55e28f98
...
...
@@ -151,7 +151,7 @@
limit
:
this
.
limit
,
page
:
this
.
nowPage
}
if
(
this
.
searchFrom
.
type
)
{
if
(
this
.
searchFrom
.
type
||
this
.
searchFrom
.
type
===
0
)
{
json
.
type
=
this
.
searchFrom
.
type
}
if
(
this
.
searchFrom
.
name
)
{
...
...
src/components/user/index.vue
View file @
55e28f98
...
...
@@ -2,6 +2,11 @@
<div
class=
"user"
>
<el-form
ref=
"searchFrom"
:model=
"searchFrom"
label-width=
"80px"
>
<el-row>
<el-col
:span=
"4"
>
<el-form-item
label=
"ID"
>
<el-input
v-model=
"searchFrom.userId"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item
label=
"昵称"
>
<el-input
v-model=
"searchFrom.nickName"
></el-input>
...
...
@@ -77,7 +82,8 @@
searchFrom
:{
nickName
:
''
,
mobile
:
''
,
level
:
''
level
:
''
,
userId
:
''
},
userList
:[],
total
:
0
,
...
...
@@ -115,6 +121,9 @@
page
:
this
.
nowPage
,
limit
:
this
.
limit
}
if
(
this
.
searchFrom
.
userId
)
{
json
.
user_id
=
this
.
searchFrom
.
userId
}
if
(
this
.
searchFrom
.
nickName
)
{
json
.
nickname
=
this
.
searchFrom
.
nickName
}
...
...
src/components/userDetail/index.vue
View file @
55e28f98
...
...
@@ -25,15 +25,15 @@
</el-col>
</el-row>
<el-row>
<el-col
:span=
"6"
>
<label>
老师ID:
</label>
{{
detail
.
teacher_id
?
detail
.
teacher_id
:
''
}}
</el-col>
<el-col
:span=
"6"
>
<label>
邀请类型:
</label>
{{
detail
.
invite_type
|
inviteType
}}
</el-col>
<el-col
:span=
"6"
>
<label>
邀请人ID:
</label>
{{
detail
.
invite_user_id
?
detail
.
invite_user_id
:
''
}}
</el-col>
<el-col
:span=
"6"
>
<label>
已绑定老师:
</label>
{{
detail
.
teacher_name
}}
</el-col>
<el-col
:span=
"6"
>
<label>
注册时间:
</label>
{{
detail
.
created_at
}}
</el-col>
...
...
src/service/api.js
View file @
55e28f98
...
...
@@ -415,8 +415,8 @@ export const getClassUserApi = function (id) {
};
// 添加班级用户
const
addClassUserUrl
=
`
${
_baseUrl
}
api/admin/class/user/add/`
;
export
const
addClassUesrApi
=
function
(
classId
,
userId
)
{
return
Vue
.
prototype
.
$post
(
`
${
addClassUserUrl
}${
classId
}
/
${
userId
}
`
)
export
const
addClassUesrApi
=
function
(
classId
,
userId
,
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
addClassUserUrl
}${
classId
}
/
${
userId
}
`
,
json
)
};
// 更改看课权限
const
changeUserUrl
=
`
${
_baseUrl
}
api/admin/class/user/`
;
...
...
@@ -498,3 +498,9 @@ const conflictUrl = `${_baseUrl}api/admin/goods/conflict/`;
export
const
conflictApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$patch
(
`
${
conflictUrl
}${
id
}
`
,
json
)
};
// 班级用户添加备注
const
addPeriodsClassUserDescUrl
=
`/api/admin/class/user/desc`
;
export
const
addPeriodsClassUserDescApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
addPeriodsClassUserDescUrl
}
/
${
id
}
`
,
json
)
};
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