Commit f14ad7ff authored by lixin's avatar lixin

讲师账号查看课程详情设置为只读

parent 533b0b3c
......@@ -19,6 +19,7 @@
name="courseType"
default-value="SINGLE"
v-model="step1FormModel.type"
:disabled="isReadOnly"
>
<a-radio value="SINGLE">
单集
......@@ -35,7 +36,7 @@
prop="seriesId"
v-if="step1FormModel.type == 'SERIES'"
>
<a-select
<a-select
:value="currentSeries"
label-in-value
show-search
......@@ -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: "",
},
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment