Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea_resources_pc
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
张伯涛
tea_resources_pc
Commits
f9097d1e
Commit
f9097d1e
authored
Apr 15, 2024
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat 提交单位管理员对接接口
parent
3dfa1872
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
880 additions
and
273 deletions
+880
-273
others.js
src/api/learncenter/others.js
+120
-32
xuexi_guoqi.png
src/assets/icons/xuexi_guoqi.png
+0
-0
learnCenter.scss
src/assets/style/learnCenter.scss
+7
-1
index.vue
src/components/classesItem/index.vue
+290
-47
page.js
src/mixins/page.js
+6
-3
USER_level.js
src/router/USER_level.js
+50
-4
getters.js
src/store/getters.js
+1
-1
props.js
src/store/modules/props.js
+3
-1
user.js
src/store/modules/user.js
+2
-0
ModelDataSource.js
src/utils/ModelDataSource.js
+12
-0
group.vue
src/views/learningCenter/children/group.vue
+2
-3
participants.vue
src/views/learningCenter/children/participants.vue
+182
-41
purchased.vue
src/views/learningCenter/children/purchased.vue
+65
-71
statistics.vue
src/views/learningCenter/children/statistics.vue
+25
-25
index.vue
src/views/learningCenter/components/Sidebar/index.vue
+38
-9
userCard.vue
src/views/learningCenter/components/Sidebar/userCard.vue
+58
-30
groupDialog.vue
src/views/learningCenter/components/groupDialog.vue
+17
-4
vue.config.js
vue.config.js
+2
-1
No files found.
src/api/learncenter/others.js
View file @
f9097d1e
...
...
@@ -10,60 +10,148 @@ export function listAll() {
}
// 查询开课课程
export
function
queryTeaTrialCourses
(
data
)
{
return
request
({
url
:
'teatrialcourse/queryTeaTrialCourses'
,
method
:
'get'
,
params
:
data
})
}
return
request
({
url
:
'teatrialcourse/queryTeaTrialCourses'
,
method
:
'get'
,
params
:
data
})
}
/**
* 查询学员
* @param {*} data
* @returns
* @param {*} data
* @returns
*/
export
function
userlistAll
(
data
)
{
return
request
({
url
:
'pc/sysuser/listAll'
,
method
:
'get'
,
data
})
}
export
function
userlistAll
(
data
)
{
return
request
({
url
:
'pc/sysuser/listAll'
,
method
:
'get'
,
data
})
}
/**
/**
* 查询角色
* @param {*} data
* @returns
* @param {*} data
* @returns
*/
export
function
rolelistAll
(
data
)
{
return
request
({
url
:
'pcrole/listAll'
,
method
:
'get'
,
data
})
}
export
function
rolelistAll
(
data
)
{
return
request
({
url
:
'pcrole/listAll'
,
method
:
'get'
,
data
})
}
/**
* 查询小组
* @param {*} data
* @returns
* @param {*} data
* @returns
*/
export
function
grouplistAll
(
data
)
{
return
request
({
url
:
'pc
role
/listAll'
,
url
:
'pc
group
/listAll'
,
method
:
'get'
,
data
})
}
/**
* 修改状态
* @param {} data
* @returns
* @param {} data
* @returns
*/
export
function
changeRoleStatus
(
data
)
{
return
request
({
url
:
'pc/sysuser/update/'
+
data
.
businessId
,
url
:
'pc/sysuser/update/'
+
data
.
businessId
,
headers
:
{
'Content-Type'
:
'application/json'
},
method
:
'put'
,
data
})
}
/**
* 查询单位管理员信息
* @param {*} data
* @returns
*/
export
function
queryUnitAdmin
(
data
)
{
return
request
({
url
:
'pc/sysuser/queryUnitAdmin'
,
method
:
'get'
,
data
})
}
/**
* 查询单位组长信息
* @param {*} data
* @returns
*/
export
function
queryUnitLeader
(
data
)
{
return
request
({
url
:
'pc/sysuser/queryUnitLeader'
,
method
:
'get'
,
data
})
}
/**
* 修改学员角色
* @param {*} data
* @returns
*/
export
function
updateRole
(
data
)
{
return
request
({
url
:
'pc/sysuser/updateRole/'
+
data
.
businessId
,
method
:
'put'
,
headers
:
{
'Content-Type'
:
'application/json'
},
data
})
}
/**
* 修改学员小组
* @param {*} data
* @returns
*/
export
function
updateGroup
(
data
)
{
return
request
({
url
:
'pc/sysuser/updateGroup/'
+
data
.
businessId
,
headers
:
{
'Content-Type'
:
'application/json'
},
method
:
'put'
,
data
})
}
/**
* 获取字典
* @param {*} data
* @returns
*/
export
function
getDict
(
dictType
)
{
return
request
({
url
:
`system/dict/data/type/
${
dictType
}
`
,
method
:
'get'
})
}
/**
* 获取课程下学员
* @param {*} data
* @returns
*/
export
function
getUserBClassId
(
dictType
)
{
return
request
({
url
:
`system/dict/data/type/
${
dictType
}
`
,
method
:
'get'
})
}
src/assets/icons/xuexi_guoqi.png
View replaced file @
3dfa1872
View file @
f9097d1e
1.29 KB
|
W:
|
H:
1.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/style/learnCenter.scss
View file @
f9097d1e
...
...
@@ -36,7 +36,7 @@
padding
:
0
10px
;
margin-bottom
:
20px
;
.item-label
{
min-width
:
7
0px
;
min-width
:
12
0px
;
text-align
:
right
;
}
.item-content
{
...
...
@@ -118,3 +118,9 @@
margin-top
:
15px
;
}
}
.ellipsis
{
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
\ No newline at end of file
src/components/classesItem/index.vue
View file @
f9097d1e
This diff is collapsed.
Click to expand it.
src/mixins/page.js
View file @
f9097d1e
...
...
@@ -5,8 +5,7 @@ export default {
listUrl
:
''
,
queryParams
:
{
page
:
1
,
rows
:
10
,
unit
:
1
rows
:
10
},
tableId
:
false
,
loading
:
false
,
...
...
@@ -48,7 +47,11 @@ export default {
request
({
url
:
this
.
listUrl
,
method
:
'get'
,
params
:
this
.
queryParams
params
:
this
.
queryParams
,
headers
:
{
// 'Content-Type': 'application/json'
'Content-Type'
:
'application/x-www-form-urlencode'
}
})
.
then
(
res
=>
{
this
.
tableData
=
res
.
rows
...
...
src/router/USER_level.js
View file @
f9097d1e
import
{
getToken
}
from
'@/utils/auth.js'
import
{
MessageBox
}
from
'element-ui'
import
store
from
'../store'
// 查询用户信息、token、提示登录状态与认证状态工具类
export
class
userAuth
{
constructor
(
to
,
from
,
next
)
{
...
...
@@ -18,7 +19,6 @@ export class userAuth {
})
}
MessageTipsForLogin
=
()
=>
{
MessageBox
({
title
:
'无法访问'
,
message
:
`您需要<span style="color: red;cursor:default;">登录</span>以访问此服务`
,
...
...
@@ -29,9 +29,12 @@ export class userAuth {
showCancelButton
:
true
,
confirmButtonText
:
'前往登录'
,
cancelButtonText
:
'暂不登录'
,
callback
:
(
action
)
=>
{
callback
:
action
=>
{
if
(
action
===
'confirm'
)
{
this
.
router
.
next
({
path
:
'/login/index'
,
query
:
{
redirect
:
this
.
router
.
to
.
fullPath
}})
this
.
router
.
next
({
path
:
'/login/index'
,
query
:
{
redirect
:
this
.
router
.
to
.
fullPath
}
})
}
else
{
this
.
router
.
next
({
path
:
this
.
$route
.
path
})
}
...
...
@@ -44,13 +47,56 @@ export class PageIntercept extends userAuth {
// eslint-disable-next-line no-useless-constructor
constructor
(
to
,
from
,
next
)
{
super
(
to
,
from
,
next
)
checkAuthAndNavigate
(
to
,
from
,
next
)
}
USER_VISITOR
()
{
this
.
router
.
next
()
}
USER_LOGIN
()
{
this
.
getInfo
().
then
(()
=>
{
// 登录菜单判断是否登录
this
.
getInfo
().
then
(({
data
})
=>
{
// 登录菜单判断是否登录
let
key
=
data
.
roles
[
0
].
roleKey
console
.
log
(
'key'
,
key
)
// switch()
this
.
router
.
next
()
})
}
}
// 检查权限后动态导航的函数
function
checkAuthAndNavigate
(
to
,
from
,
next
)
{
const
hasAccess
=
false
// 假设这是一个检查权限的逻辑
if
(
store
.
getters
.
roles
&&
store
.
getters
.
roles
.
length
)
{
let
role
=
store
.
getters
.
roles
[
0
].
roleKey
if
(
to
.
name
==
'learningCenter'
)
{
switch
(
role
)
{
//单位管理员
case
'unit_admin'
:
next
(
'/learningCenter/purchased'
)
break
//个人用户
case
'individual'
:
next
(
'/learningCenter/my'
)
break
//单位组长
case
'unit_leader'
:
next
(
'/learningCenter/my'
)
break
case
'unit_user'
:
next
(
'/teamMembers/index'
)
break
case
'ip_user'
:
next
(
'/IPUser/index'
)
break
case
'tourist'
:
next
(
'/learningCenter/my'
)
break
default
:
this
.
USER_VISITOR
()
}
}
}
else
{
next
()
}
}
src/store/getters.js
View file @
f9097d1e
...
...
@@ -13,7 +13,7 @@ const getters = {
searchParams
:
state
=>
state
.
searchSave
.
searchParams
,
course
:
state
=>
state
.
props
.
course
,
users
:
state
=>
state
.
props
.
users
,
// r
oles: state => state.props.roles,
userR
oles
:
state
=>
state
.
props
.
roles
,
groups
:
state
=>
state
.
props
.
groups
,
}
export
default
getters
src/store/modules/props.js
View file @
f9097d1e
...
...
@@ -17,7 +17,7 @@ const mutations = {
let
course
=
data
.
map
(
i
=>
{
return
{
key
:
i
.
lessonId
,
label
:
i
.
lessonName
+
'(讲师:'
+
i
.
teacherName
+
')'
label
:
i
.
lessonName
+
'(讲师:'
+
i
.
lecturer
+
')'
}
})
state
.
course
=
course
...
...
@@ -55,6 +55,7 @@ const mutations = {
value
:
i
.
businessId
}
})
console
.
log
(
roles
);
state
.
roles
=
roles
}
}
...
...
@@ -72,6 +73,7 @@ const actions = {
},
setRoles
({
commit
},
data
)
{
rolelistAll
(
data
).
then
(
res
=>
{
console
.
log
(
res
.
data
);
commit
(
'ROLES_SET'
,
res
.
data
)
})
},
...
...
src/store/modules/user.js
View file @
f9097d1e
...
...
@@ -74,6 +74,8 @@ const user = {
commit
(
'SET_PHONE'
,
user
.
phone
)
commit
(
'SET_SPECIALTAG'
,
user
.
specialTag
)
commit
(
'SET_AVATAR'
,
avatar
)
// user.roles[0].roleKey
resolve
(
res
)
}).
catch
(
error
=>
{
reject
(
error
)
...
...
src/utils/ModelDataSource.js
View file @
f9097d1e
...
...
@@ -86,9 +86,21 @@ ModelDataSource.prototype = {
}
else
{
url
=
`
${
learnCenter
[
self
.
settings
.
url
].
update
}
/
${
self
.
uuid
}
`
}
let
headers
=
{}
if
(
self
.
settings
.
url
==
'role'
)
{
headers
=
{
'Content-Type'
:
'application/json'
}
}
else
{
headers
=
{
'Content-Type'
:
'application/json'
// 'Content-Type': 'application/x-www-form-urlencode'
}
}
request
({
url
,
method
:
self
.
uuid
==
0
?
'post'
:
'put'
,
headers
,
data
:
_
.
omit
(
self
,
[
'vm'
,
'settings'
,
'errors'
,
'debug'
,
'uuid'
])
})
.
then
(
function
(
response
)
{
...
...
src/views/learningCenter/children/group.vue
View file @
f9097d1e
...
...
@@ -119,8 +119,8 @@
:total=
"total"
:background=
"false"
layout=
"prev, pager, next"
:page
.
sync=
"queryParams.page
Num
"
:limit
.
sync=
"queryParams.
pageSize
"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.
rows
"
@
pagination=
"loadData"
/>
</div>
...
...
@@ -160,7 +160,6 @@ export default {
methods
:
{
handleUpdate
(
id
)
{
this
.
$store
.
dispatch
(
'props/setUsers'
,
{
applicantUnit
:
'1'
,
applicantType
:
2
})
this
.
dialogManger
.
dialogVisible
=
true
...
...
src/views/learningCenter/children/participants.vue
View file @
f9097d1e
...
...
@@ -6,7 +6,6 @@
:model=
"queryParams"
class=
"search-form"
:inline=
"true"
label-width=
"120px"
>
<el-row>
<el-col
:span=
"12"
>
...
...
@@ -50,16 +49,8 @@
class=
"w-100"
placeholder=
"请选择"
>
<el-option
label=
"启用"
value=
"1"
>
</el-option>
<el-option
label=
"停用"
value=
"0"
>
</el-option>
<el-option
label=
"启用"
value=
"1"
>
</el-option>
<el-option
label=
"停用"
value=
"0"
>
</el-option>
</el-select>
</div>
</div>
...
...
@@ -77,7 +68,7 @@
placeholder=
"请选择"
>
<el-option
v-for=
"item in
r
oles"
v-for=
"item in
userR
oles"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
...
...
@@ -149,25 +140,70 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"姓名"
min-width=
"120"
align=
"center"
>
<el-table-column
prop=
"name"
label=
"姓名"
min-width=
"120"
align=
"center"
>
</el-table-column>
<el-table-column
F
label=
"性别"
min-width=
"120"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
sex
==
0
?
'男'
:
'女'
}}
</
template
>
{{
scope
.
row
.
sex
==
0
?
'男'
:
'女'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"phone"
label=
"手机号"
min-width=
"120"
align=
"center"
>
<el-table-column
prop=
"phone"
label=
"手机号"
min-width=
"120"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"position"
label=
"职位/专业"
min-width=
"120"
align=
"center"
>
<el-table-column
prop=
"position"
label=
"职位/专业"
min-width=
"120"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"roleNames"
label=
"角色"
min-width=
"120"
align=
"center"
>
<el-table-column
prop=
"roleNames"
label=
"角色"
min-width=
"220"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"ellipsis"
>
{{
scope
.
row
.
roleNames
}}
</div>
<el-button
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleRoleChange(scope.row)"
></el-button>
</
template
>
</el-table-column>
<el-table-column
prop=
"groupNames"
label=
"小组"
min-width=
"120"
align=
"center"
>
<el-table-column
prop=
"groupNames"
label=
"小组"
min-width=
"220"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
class=
"ellipsis"
>
{{
scope
.
row
.
groupNames
}}
</div>
<el-button
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleGroupChange(scope.row)"
></el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
min-width=
"120"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
flag
==
1
?
'启用'
:
'停用'
}}
</
template
>
{{
scope
.
row
.
flag
==
1
?
'启用'
:
'停用'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
...
...
@@ -176,8 +212,8 @@
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleStatusChange(scope.row)"
>
停用
</el-button
<el-button
type=
"text"
@
click=
"handleStatusChange(scope.row)"
>
{{
scope
.
row
.
flag
==
1
?
'停用'
:
'启用'
}}
</el-button
>
<el-button
type=
"text"
...
...
@@ -199,19 +235,73 @@
/>
</div>
</div>
<el-dialog
title=
"设置小组"
:visible
.
sync=
"groupManager.dialogVisible"
width=
"30%"
:before-close=
"
() => {
groupManager.dialogVisible = false
}
"
>
<el-checkbox-group
v-model=
"groupManager.groupIdsList"
>
<el-checkbox
:label=
"item.value"
:key=
"key"
v-for=
"(item, key) in groups"
>
{{ item.label }}
</el-checkbox
>
</el-checkbox-group>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"groupManager.dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('groups')"
>
确 定
</el-button
>
</span>
</el-dialog>
<el-dialog
title=
"设置角色"
:visible
.
sync=
"roleManager.dialogVisible"
width=
"30%"
:before-close=
"
() => {
roleManager.dialogVisible = false
}
"
>
<el-checkbox-group
v-model=
"roleManager.roleIdsList"
>
<el-checkbox
:label=
"item.value"
:key=
"key"
v-for=
"(item, key) in userRoles"
>
{{ item.label }}
</el-checkbox
>
</el-checkbox-group>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"roleManager.dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('roles')"
>
确 定
</el-button>
</span>
</el-dialog>
</page-layout>
</template>
<
script
>
import
{
mapGetters
}
from
'vuex'
import
page
from
'@/mixins/page'
import
{
getToken
}
from
'@/utils/auth'
import
{
changeRoleStatus
}
from
'@/api/learncenter/others'
import
{
changeRoleStatus
,
updateGroup
,
updateRole
}
from
'@/api/learncenter/others'
export
default
{
name
:
'Index'
,
mixins
:
[
page
],
components
:
{},
computed
:
{
...
mapGetters
([
'
r
oles'
,
'groups'
])
...
mapGetters
([
'
userR
oles'
,
'groups'
])
},
data
()
{
return
{
...
...
@@ -220,6 +310,16 @@ export default {
headers
:
{
Authorization
:
'Bearer '
+
getToken
()
},
groupManager
:
{
dialogVisible
:
false
,
groupIdsList
:
[],
businessId
:
''
},
roleManager
:
{
dialogVisible
:
false
,
roleIdsList
:
[],
businessId
:
''
},
model
:
this
.
$modelDataSource
({
url
:
'sysuser'
,
dataKey
:
'model'
,
...
...
@@ -229,17 +329,56 @@ export default {
})
}
},
created
()
{
this
.
$store
.
dispatch
(
'props/setRoles'
,
{
unit
:
'1'
})
this
.
$store
.
dispatch
(
'props/setGroups'
,
{
unit
:
'1'
})
async
created
()
{
await
this
.
$store
.
dispatch
(
'props/setRoles'
)
await
this
.
$store
.
dispatch
(
'props/setGroups'
)
console
.
log
(
this
.
useRoles
)
this
.
queryParams
.
deptId
=
1
delete
this
.
queryParams
.
unit
},
methods
:
{
submitForm
(
type
)
{
if
(
type
==
'roles'
)
{
// this.roleManager.roleIdsList = this.roleManager.roleIdsList.join(',')
updateRole
(
this
.
roleManager
)
.
then
(
res
=>
{
this
.
roleManager
.
dialogVisible
=
false
this
.
$message
.
success
(
'设置角色成功!'
)
this
.
loadData
()
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
'设置角色失败!'
)
})
}
else
{
// this.groupManager.groupIdsList = this.groupManager.groupIdsList.join(
// ','
// )
updateGroup
(
this
.
groupManager
)
.
then
(
res
=>
{
this
.
groupManager
.
dialogVisible
=
false
this
.
$message
.
success
(
'设置小组成功!'
)
this
.
loadData
()
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
'设置小组失败!'
)
})
}
},
handleRoleChange
(
item
)
{
this
.
roleManager
.
dialogVisible
=
true
this
.
roleManager
.
businessId
=
item
.
businessId
this
.
roleManager
.
roleIdsList
=
item
.
roleIds
.
split
(
','
)
this
.
roleManager
.
roleIdsList
=
this
.
roleManager
.
roleIdsList
.
map
(
item
=>
Number
(
item
)
)
},
handleGroupChange
(
item
)
{
this
.
groupManager
.
dialogVisible
=
true
this
.
groupManager
.
businessId
=
item
.
businessId
this
.
groupManager
.
groupIdsList
=
item
.
groupIds
.
split
(
','
)
this
.
groupManager
.
groupIdsList
=
this
.
groupManager
.
groupIdsList
.
map
(
item
=>
Number
(
item
)
)
},
handleQuery
()
{
this
.
queryParams
.
page
=
1
let
{
roleIds
,
groupIds
}
=
this
.
queryParams
...
...
@@ -262,20 +401,22 @@ export default {
},
// 角色状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
status
===
'0'
?
'启用'
:
'停用'
const
text
=
row
.
flag
===
'0'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
name
+
'"学员吗?'
,
{
type
:
'warning'
,
title
:
text
,
closeOnClickModal
:
false
})
type
:
'warning'
,
title
:
text
,
closeOnClickModal
:
false
})
.
then
(
function
()
{
row
.
flag
=
1
?
0
:
1
row
.
flag
=
row
.
flag
==
1
?
0
:
1
return
changeRoleStatus
({
businessId
:
row
.
businessId
,
flag
:
row
.
flag
businessId
:
row
.
businessId
,
flag
:
row
.
flag
})
})
.
then
(()
=>
{
this
.
$modal
.
msgSuccess
(
text
+
'成功'
)
this
.
$message
.
success
(
text
+
'成功'
)
this
.
loadData
()
})
.
catch
(
function
()
{
row
.
status
=
row
.
status
===
'0'
?
'1'
:
'0'
...
...
src/views/learningCenter/children/purchased.vue
View file @
f9097d1e
...
...
@@ -3,33 +3,36 @@
<div
class=
""
>
<screen
title=
"技术分类"
v-model=
"queryParams.tec
hnolog
y"
v-model=
"queryParams.tec
Classif
y"
:items=
"technologyOptions"
></screen>
<screen
title=
"难度等级"
v-model=
"queryParams.difficulty"
v-model=
"queryParams.difficulty
Classify
"
:items=
"difficultyOptions"
></screen>
<el-checkbox
v-model=
"queryParams.model"
size=
"medium"
>
只看付费
</el-checkbox
>
<el-checkbox
v-model=
"queryParams.checked"
size=
"medium"
>
只看试用
</el-checkbox
>
<el-checkbox
v-model=
"queryParams.checked"
size=
"medium"
<el-checkbox
v-model=
"pay"
size=
"medium"
>
只看付费
</el-checkbox>
<el-checkbox
v-model=
"tryIt"
size=
"medium"
>
只看试用
</el-checkbox>
<el-checkbox
v-model=
"queryParams.remaining"
size=
"medium"
>
只看过期
</el-checkbox
>
<classesItem
v-for=
"i in 10"
:key=
"i"
>
</classesItem>
<classesItem
:type=
"i.remainingDate == 0 ? '3' : '1'"
v-for=
"(i, key) in tableData"
:difficultyOptions=
"difficultyOptions"
:item=
"i"
:key=
"key"
>
</classesItem>
<div
style=
"display: flex;justify-content: center;"
>
<pagination
:total=
"
100
"
:total=
"
total
"
:background=
"false"
layout=
"prev, pager, next"
:page
.
sync=
"queryParams.page
Num
"
:limit
.
sync=
"queryParams.
pageSize
"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.
rows
"
@
pagination=
"loadData"
/>
</div>
...
...
@@ -38,69 +41,60 @@
</
template
>
<
script
>
import
page
from
'@/mixins/page'
import
{
getDict
}
from
'@/api/learncenter/others'
export
default
{
name
:
'Index'
,
mixins
:
[
page
],
data
()
{
return
{
technologyOptions
:
[
{
label
:
'环境感知技术'
,
value
:
'1'
},
{
label
:
'智能决策技术'
,
value
:
'2'
},
{
label
:
'控制执行技术'
,
value
:
'3'
},
{
label
:
'系统设计技术'
,
value
:
'4'
},
{
label
:
'大数据云控基础平台技术'
,
value
:
'5'
},
{
label
:
'车路协同技术'
,
value
:
'6'
},
{
label
:
'安全技术'
,
value
:
'7'
},
{
label
:
'智能决策技术'
,
value
:
'8'
},
{
label
:
'专用通信与网络技术'
,
value
:
'9'
},
{
label
:
'测试评价技术'
,
value
:
'10'
}
],
difficultyOptions
:
[
{
label
:
'初级'
,
value
:
'1'
},
{
label
:
'中级'
,
value
:
'2'
},
{
label
:
'高级'
,
value
:
'3'
}
]
listUrl
:
'blesson/queryPcBLessonByPagination'
,
technologyOptions
:
[],
difficultyOptions
:
[],
pay
:
''
,
tryIt
:
''
,
queryParams
:
{
page
:
1
,
rows
:
10
}
}
},
computed
:
{}
computed
:
{},
async
created
()
{
await
this
.
$store
.
dispatch
(
'props/setRoles'
)
getDict
(
'tec_classify'
).
then
(
res
=>
{
this
.
technologyOptions
=
res
.
data
})
getDict
(
'difficulty_grade'
).
then
(
res
=>
{
this
.
difficultyOptions
=
res
.
data
})
},
watch
:
{
queryParams
:
{
deep
:
true
,
handler
(
val
)
{
this
.
queryParams
.
page
=
1
if
(
val
.
remaining
)
{
this
.
queryParams
.
remainingDate
=
0
}
this
.
loadData
()
}
},
tryIt
(
val
)
{
if
(
val
)
{
this
.
queryParams
.
page
=
1
this
.
queryParams
.
isPay
=
0
this
.
pay
=
''
}
this
.
loadData
()
},
pay
(
val
)
{
if
(
val
)
{
this
.
queryParams
.
page
=
1
this
.
queryParams
.
isPay
=
1
this
.
tryIt
=
''
}
this
.
loadData
()
}
}
}
</
script
>
src/views/learningCenter/children/statistics.vue
View file @
f9097d1e
...
...
@@ -82,8 +82,8 @@
:total=
"100"
:background=
"false"
layout=
"prev, pager, next"
:page
.
sync=
"tableClassesData.page
Num
"
:limit
.
sync=
"tableClassesData.
pageSize
"
:page
.
sync=
"tableClassesData.page"
:limit
.
sync=
"tableClassesData.
rows
"
@
pagination=
"loadClassesData"
/>
</div>
...
...
@@ -165,8 +165,8 @@
:total=
"100"
:background=
"false"
layout=
"prev, pager, next"
:page
.
sync=
"queryGroupParams.page
Num
"
:limit
.
sync=
"queryGroupParams.
pageSize
"
:page
.
sync=
"queryGroupParams.page"
:limit
.
sync=
"queryGroupParams.
rows
"
@
pagination=
"loadGroupData"
/>
</div>
...
...
@@ -246,8 +246,8 @@
:total=
"100"
:background=
"false"
layout=
"prev, pager, next"
:page
.
sync=
"queryUserParams.page
Num
"
:limit
.
sync=
"queryUserParams.
pageSize
"
:page
.
sync=
"queryUserParams.page"
:limit
.
sync=
"queryUserParams.
rows
"
@
pagination=
"loadUserData"
/>
</div>
...
...
@@ -271,16 +271,16 @@ export default {
return
{
activeName
:
'first'
,
queryClassesParams
:
{
page
Num
:
1
,
pageSize
:
10
page
:
1
,
rows
:
10
},
queryGroupParams
:
{
page
Num
:
1
,
pageSize
:
10
page
:
1
,
rows
:
10
},
queryUserParams
:
{
page
Num
:
1
,
pageSize
:
10
page
:
1
,
rows
:
10
},
tableUserData
:
[],
tableGroupData
:
[],
...
...
@@ -292,15 +292,15 @@ export default {
handleQuery
(
type
)
{
switch
(
type
)
{
case
'classes'
:
this
.
queryClassesParams
.
page
Num
=
1
this
.
queryClassesParams
.
page
=
1
this
.
loadClassesData
()
break
case
'group'
:
this
.
queryGroupParams
.
page
Num
=
1
this
.
queryGroupParams
.
page
=
1
this
.
loadGroupData
()
break
case
'user'
:
this
.
queryUserParams
.
page
Num
=
1
this
.
queryUserParams
.
page
=
1
this
.
loadUserData
()
break
}
...
...
@@ -309,22 +309,22 @@ export default {
switch
(
type
)
{
case
'classes'
:
this
.
queryClassesParams
=
{
page
Num
:
this
.
queryClassesParams
.
pageNum
,
pageSize
:
this
.
queryClassesParams
.
pageSize
page
:
this
.
queryClassesParams
.
page
,
rows
:
this
.
queryClassesParams
.
rows
}
this
.
loadClassesData
()
break
case
'group'
:
this
.
queryGroupParams
=
{
page
Num
:
this
.
queryGroupParams
.
pageNum
,
pageSize
:
this
.
queryGroupParams
.
pageSize
page
:
this
.
queryGroupParams
.
page
,
rows
:
this
.
queryGroupParams
.
rows
}
this
.
loadGroupData
()
break
case
'user'
:
this
.
queryUserParams
=
{
page
Num
:
this
.
queryUserParams
.
pageNum
,
pageSize
:
this
.
queryUserParams
.
pageSize
page
:
this
.
queryUserParams
.
page
,
rows
:
this
.
queryUserParams
.
rows
}
this
.
loadUserData
()
break
...
...
@@ -333,15 +333,15 @@ export default {
handleClick
()
{
switch
(
this
.
activeName
)
{
case
'first'
:
this
.
queryClassesParams
.
page
Num
=
1
this
.
queryClassesParams
.
page
=
1
this
.
loadClassesData
()
break
case
'second'
:
this
.
queryGroupParams
.
page
Num
=
1
this
.
queryGroupParams
.
page
=
1
this
.
loadGroupData
()
break
case
'third'
:
this
.
queryUserParams
.
page
Num
=
1
this
.
queryUserParams
.
page
=
1
this
.
loadUserData
()
break
}
...
...
@@ -352,7 +352,7 @@ export default {
},
created
()
{
this
.
activeName
=
'first'
this
.
queryClassesParams
.
page
Num
=
1
this
.
queryClassesParams
.
page
=
1
this
.
loadClassesData
()
}
}
...
...
src/views/learningCenter/components/Sidebar/index.vue
View file @
f9097d1e
...
...
@@ -12,25 +12,53 @@
mode=
"vertical"
class=
"user-menu"
>
<el-menu-item
index=
"purchased"
@
click
.
native=
"goPage('purchased')"
>
<el-menu-item
index=
"purchased"
v-if=
"roles[0].roleKey === 'unit_admin'"
@
click
.
native=
"goPage('purchased')"
>
<span
slot=
"title"
>
已购课程
</span>
</el-menu-item>
<el-menu-item
index=
"role"
@
click
.
native=
"goPage('role')"
>
<el-menu-item
index=
"role"
v-if=
"roles[0].roleKey === 'unit_admin'"
@
click
.
native=
"goPage('role')"
>
<span
slot=
"title"
>
角色管理
</span>
</el-menu-item>
<el-menu-item
index=
"group"
@
click
.
native=
"goPage('group')"
>
<el-menu-item
index=
"group"
v-if=
"roles[0].roleKey === 'unit_admin'"
@
click
.
native=
"goPage('group')"
>
<span
slot=
"title"
>
小组管理
</span>
</el-menu-item>
<el-menu-item
index=
"participants"
@
click
.
native=
"goPage('participants')"
>
<el-menu-item
index=
"participants"
v-if=
"roles[0].roleKey === 'unit_admin'"
@
click
.
native=
"goPage('participants')"
>
<span
slot=
"title"
>
学员管理
</span>
</el-menu-item>
<el-menu-item
index=
"statistics"
@
click
.
native=
"goPage('statistics')"
>
<el-menu-item
index=
"statistics"
v-if=
"roles[0].roleKey === 'unit_admin'"
@
click
.
native=
"goPage('statistics')"
>
<span
slot=
"title"
>
数据统计
</span>
</el-menu-item>
<el-menu-item
index=
"my"
@
click
.
native=
"goPage('my')"
>
<el-menu-item
index=
"my"
v-if=
"roles[0].roleKey === 'unit_leader'"
@
click
.
native=
"goPage('my')"
>
<span
slot=
"title"
>
我的课程
</span>
</el-menu-item>
<el-menu-item
index=
"myGroup"
@
click
.
native=
"goPage('myGroup')"
>
<el-menu-item
index=
"myGroup"
v-if=
"roles[0].roleKey === 'unit_leader'"
@
click
.
native=
"goPage('myGroup')"
>
<span
slot=
"title"
>
我的小组
</span>
</el-menu-item>
</el-menu>
...
...
@@ -43,6 +71,7 @@ import userCard from './userCard.vue'
export
default
{
components
:
{
userCard
},
computed
:
{
...
mapGetters
([
'roles'
]),
activeMenu
()
{
const
route
=
this
.
$route
const
{
meta
,
path
}
=
route
...
...
@@ -75,12 +104,12 @@ export default {
.el-menu-item.is-active
{
background
:
#f6f9ff
!
important
;
span
{
border-bottom
:
1px
solid
#3685FC
;
border-bottom
:
1px
solid
#3685fc
;
line-height
:
18px
;
}
}
.el-menu-item
:hover
{
background
:
#f6f9ff
!
important
;
background
:
#f6f9ff
!
important
;
}
}
</
style
>
src/views/learningCenter/components/Sidebar/userCard.vue
View file @
f9097d1e
...
...
@@ -2,18 +2,46 @@
<div
class=
"user-card"
>
<div
class=
"card-box"
>
<div
class=
"user-info"
>
<el-avatar
:size=
"164"
:src=
"avatar"
class=
"user-avatar"
></el-avatar>
<div
class=
"user-name"
>
某大学管理
</div>
<div
class=
"user-dept"
>
天津南开大学
</div>
<el-avatar
:size=
"164"
:src=
"user.avatar || avatar"
class=
"user-avatar"
></el-avatar>
<div
class=
"user-name"
>
{{
user
.
nickName
}}
</div>
<div
class=
"user-dept"
>
{{
user
.
unitName
}}
</div>
<div
class=
"user-tag"
>
<el-tag>
单位
</el-tag>
</div>
</div>
<div
class=
"item-list"
>
<div
class=
"item"
v-for=
"(i,k) in items"
:key=
"k"
>
<div
class=
"item-num"
>
{{
i
.
number
}}
</div>
<div
class=
"item-name"
>
{{
i
.
value
}}
</div>
<div
class=
"item-list"
v-if=
"roles[0].roleKey === 'unit_admin'"
>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
lessonCount
}}
</div>
<div
class=
"item-name"
>
课程
</div>
</div>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
roleCount
}}
</div>
<div
class=
"item-name"
>
角色
</div>
</div>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
groupCount
}}
</div>
<div
class=
"item-name"
>
小组
</div>
</div>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
studentCount
}}
</div>
<div
class=
"item-name"
>
学员
</div>
</div>
</div>
<div
class=
"item-list"
v-if=
"roles[0].roleKey === 'unit_leader'"
>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
groupCount
}}
</div>
<div
class=
"item-name"
>
小组
</div>
</div>
<div
class=
"item"
>
<div
class=
"item-num"
>
{{
user
.
studentCount
}}
</div>
<div
class=
"item-name"
>
组员
</div>
</div>
</div>
</div>
...
...
@@ -21,34 +49,34 @@
</
template
>
<
script
>
import
{
mapGetters
}
from
'vuex'
import
{
queryUnitAdmin
,
queryUnitLeader
}
from
'@/api/learncenter/others'
export
default
{
name
:
'user-card'
,
data
()
{
return
{
items
:[
{
number
:
12
,
value
:
'课程'
},
{
number
:
12
,
value
:
'角色'
},
{
number
:
12
,
value
:
'小组'
},
{
number
:
12
,
value
:
'学员'
}
]
user
:
{
lessonCount
:
0
,
roleCount
:
0
,
groupCount
:
0
,
lessonCount
:
0
,
}
}
},
computed
:
{
...
mapGetters
([
'name'
,
'avatar'
])
...
mapGetters
([
'name'
,
'avatar'
,
'roles'
])
},
methods
:
{}
methods
:
{},
created
()
{
if
(
this
.
roles
[
0
].
roleKey
==
'unit_admin'
)
{
queryUnitAdmin
().
then
(
res
=>
{
this
.
user
=
res
.
data
})
}
else
{
queryUnitLeader
().
then
(
res
=>
{
this
.
user
=
res
.
data
})
}
}
}
</
script
>
<
style
lang=
"scss"
>
...
...
@@ -74,7 +102,7 @@ export default {
color
:
#6f6f6f
;
font-size
:
16px
;
}
.user-tag
{
.user-tag
{
margin-top
:
10px
;
}
}
...
...
@@ -84,8 +112,8 @@ export default {
flex-wrap
:
wrap
;
border-top
:
1px
solid
#dfdfdf
;
border-bottom
:
1px
solid
#dfdfdf
;
margin-top
:
24px
;
margin-bottom
:
32px
;
margin-top
:
24px
;
margin-bottom
:
32px
;
.item
{
width
:
50%
;
padding
:
23px
;
...
...
src/views/learningCenter/components/groupDialog.vue
View file @
f9097d1e
...
...
@@ -45,7 +45,6 @@
<div
class=
"sub-form-content"
>
<el-transfer
filterable
:filter-method=
"filterMethod"
filter-placeholder=
"请输入"
:titles=
"['待选学员', '已选学员']"
v-model=
"model.groupIdList"
...
...
@@ -91,7 +90,8 @@ export default {
}
}),
filterMethod
(
query
,
item
)
{
return
item
.
label
.
indexOf
(
query
)
>
-
1
// return item.label.indexOf(query) > -1
return
true
},
rules
:
{
enterpriseName
:
[
...
...
@@ -119,6 +119,17 @@ export default {
newValue
,
{},
()
=>
{
console
.
log
(
this
.
model
);
if
(
this
.
model
.
groupIds
){
this
.
model
.
groupIdList
=
this
.
model
.
groupIds
.
split
(
","
)
this
.
model
.
groupIdList
=
this
.
model
.
groupIdList
.
map
(
item
=>
Number
(
item
));
}
if
(
this
.
model
.
groupLeaderIds
){
this
.
model
.
groupLeaderIdList
=
this
.
model
.
groupLeaderIds
.
split
(
","
)
console
.
log
(
this
.
model
.
groupLeaderIdList
);
this
.
model
.
groupLeaderIdList
=
this
.
model
.
groupLeaderIdList
.
map
(
item
=>
Number
(
item
));
}
this
.
dialogManger
.
dialogVisible
=
true
},
()
=>
{
...
...
@@ -128,6 +139,8 @@ export default {
}
},
methods
:
{
//数组子项类型变更为数字
handleClose
()
{
this
.
model
.
reset
()
this
.
dialogManger
.
dialogEditId
=
null
...
...
@@ -137,8 +150,8 @@ export default {
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
console
.
log
(
'表单验证通过'
)
this
.
model
.
groupIdList
=
this
.
model
.
groupIdList
.
join
(
","
)
this
.
model
.
groupLeaderIdList
=
this
.
model
.
groupLeaderIdList
.
join
(
","
)
//
this.model.groupIdList = this.model.groupIdList.join(",")
//
this.model.groupLeaderIdList = this.model.groupLeaderIdList.join(",")
this
.
model
.
save
(
()
=>
{
this
.
$message
.
success
(
'保存成功'
)
...
...
vue.config.js
View file @
f9097d1e
...
...
@@ -70,7 +70,8 @@ module.exports = {
// target: `http://192.168.1.17:10010/internal`,
// target: `http://10.5.87.231:10010/internal`,
// target: `http://192.168.1.46:8090/`,
target
:
`http://49.232.167.247:20024/`
,
target
:
`http://192.168.10.108:8090/`
,
// target: `http://49.232.167.247:20024/`,
changeOrigin
:
true
,
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
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