Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-admin
Commits
f14ad7ff
Commit
f14ad7ff
authored
Jul 06, 2021
by
lixin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
讲师账号查看课程详情设置为只读
parent
533b0b3c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
detail.vue
src/views/biz/course/detail.vue
+14
-3
index.vue
src/views/biz/course/index.vue
+18
-3
No files found.
src/views/biz/course/detail.vue
View file @
f14ad7ff
...
...
@@ -19,6 +19,7 @@
name=
"courseType"
default-value=
"SINGLE"
v-model=
"step1FormModel.type"
:disabled=
"isReadOnly"
>
<a-radio
value=
"SINGLE"
>
单集
...
...
@@ -46,6 +47,7 @@
:not-found-content=
"null"
@
search=
"handleSeriesSearch"
@
change=
"handleSeriesChange"
:disabled=
"isReadOnly"
>
<a-select-option
v-for=
"d in this.seriesData"
...
...
@@ -61,7 +63,7 @@
label=
"课程名称"
prop=
"name"
>
<a-input
v-model=
"step1FormModel.name"
/>
<a-input
v-model=
"step1FormModel.name"
:disabled=
"isReadOnly"
/>
</a-form-model-item>
<a-form-model-item
...
...
@@ -76,6 +78,7 @@
:customRequest=
"uploadLogo"
:before-upload=
"beforeUpload"
@
change=
"handleChange"
:disabled=
"isReadOnly"
>
<img
v-if=
"step1FormModel.logoUrl"
...
...
@@ -137,7 +140,7 @@
</a-col>
</a-row>
</div>
<a-button
@
click=
"showVideoUploadModal"
>
上传视频
</a-button>
<a-button
@
click=
"showVideoUploadModal"
:disabled=
"isReadOnly"
>
上传视频
</a-button>
</a-form-model-item>
<a-form-model-item
...
...
@@ -147,6 +150,7 @@
<a-textarea
row=
"2"
v-model=
"step1FormModel.introduce"
:disabled=
"isReadOnly"
/>
</a-form-model-item>
<a-form-model-item
...
...
@@ -167,6 +171,7 @@
:before-upload=
"beforUploadDetailPic"
@
change=
"uploadDetailPicChange"
:remove=
"uploadDetailRemove"
:disabled=
"isReadOnly"
>
<div
v-if=
"detailPicList.length
<
8
"
>
<a-icon
type=
"plus"
/>
...
...
@@ -198,7 +203,7 @@
</a-col>
</a-row>
</div>
<a-button
@
click=
"showAttachmentUploadModal"
>
上传附件
</a-button>
<a-button
@
click=
"showAttachmentUploadModal"
:disabled=
"isReadOnly"
>
上传附件
</a-button>
</a-form-model-item>
<a-form-model-item
...
...
@@ -209,6 +214,7 @@
name=
"chargeModel"
default-value=
"FREE"
v-model=
"step1FormModel.chargeModel"
:disabled=
"isReadOnly"
>
<a-radio
value=
"FREE"
>
免费
...
...
@@ -257,6 +263,7 @@
placeholder=
"选择讲师"
v-model=
"step1FormModel.teacherId"
@
change=
"handleTeacherChange"
:disabled=
"isReadOnly"
>
<a-select-opt-group
...
...
@@ -283,6 +290,7 @@
placeholder=
"选择课程标签"
v-model=
"selectedTags"
@
change=
"handleTagChange"
:disabled=
"isReadOnly"
>
<a-select-option
v-for=
"(t) in this.tags"
...
...
@@ -301,6 +309,7 @@
name=
"allow"
default-value=
"ALL"
v-model=
"step1FormModel.allow"
:disabled=
"isReadOnly"
>
<a-radio
value=
"ALL"
>
全部
...
...
@@ -336,6 +345,7 @@
<a-button
type=
"primary"
@
click=
"onSave"
:disabled=
"isReadOnly"
>
保存
</a-button>
...
...
@@ -602,6 +612,7 @@ export default {
}
};
return
{
isReadOnly
:
this
.
$route
.
query
.
isReadOnly
==
'true'
,
attachment
:
{
title
:
""
,
},
...
...
src/views/biz/course/index.vue
View file @
f14ad7ff
...
...
@@ -75,12 +75,17 @@
<!-- 操作 -->
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
v-if=
"isReadOnly==true"
icon=
"edit"
type=
"link"
@
click=
"navigateDetailPage(record)"
>
查看
</a-button>
<a-button
v-if=
"isReadOnly==false"
icon=
"edit"
type=
"link"
@
click=
"navigateDetailPage(record)"
>
编辑
</a-button>
<a-button
<a-button
v-if=
"isReadOnly==false"
icon=
"edit"
type=
"link"
@
click=
"changeStatus(record)"
...
...
@@ -147,6 +152,7 @@ export default {
return
{
columns
:
columns
,
data
:
[],
UserInfo
:
{},
searchPage
:
{
pageIndex
:
1
,
pageSize
:
10
,
...
...
@@ -155,6 +161,7 @@ export default {
chargeModel
:
null
,
status
:
null
},
isReadOnly
:
true
,
pagination
:
{
showQuickJumper
:
true
,
showSizeChanger
:
true
...
...
@@ -188,6 +195,14 @@ export default {
},
// 创建完毕
created
()
{
this
.
UserInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"UserInfo"
));
let
isReadOnlyRole
=
true
;
this
.
UserInfo
.
roles
.
filter
(
(
item
,
i
)
=>
{
if
(
item
.
code
==
'ADMIN'
||
item
.
code
==
'OPERATOR'
){
isReadOnlyRole
=
false
;
}
}
);
this
.
isReadOnly
=
isReadOnlyRole
;
this
.
getList
(
this
.
searchPage
);
},
// 即将更新渲染
...
...
@@ -228,7 +243,7 @@ export default {
if
(
row
){
id
=
row
.
id
}
this
.
$router
.
push
({
path
:
'/edu/biz/course/detail'
,
query
:{
id
:
id
}})
this
.
$router
.
push
({
path
:
'/edu/biz/course/detail'
,
query
:{
id
:
id
,
isReadOnly
:
this
.
isReadOnly
}})
},
changeStatus
(
row
){
console
.
log
(
row
.
id
)
...
...
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