Commit f14ad7ff authored by lixin's avatar lixin

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

parent 533b0b3c
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
name="courseType" name="courseType"
default-value="SINGLE" default-value="SINGLE"
v-model="step1FormModel.type" v-model="step1FormModel.type"
:disabled="isReadOnly"
> >
<a-radio value="SINGLE"> <a-radio value="SINGLE">
单集 单集
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
:not-found-content="null" :not-found-content="null"
@search="handleSeriesSearch" @search="handleSeriesSearch"
@change="handleSeriesChange" @change="handleSeriesChange"
:disabled="isReadOnly"
> >
<a-select-option <a-select-option
v-for="d in this.seriesData" v-for="d in this.seriesData"
...@@ -61,7 +63,7 @@ ...@@ -61,7 +63,7 @@
label="课程名称" label="课程名称"
prop="name" prop="name"
> >
<a-input v-model="step1FormModel.name" /> <a-input v-model="step1FormModel.name" :disabled="isReadOnly" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
...@@ -76,6 +78,7 @@ ...@@ -76,6 +78,7 @@
:customRequest="uploadLogo" :customRequest="uploadLogo"
:before-upload="beforeUpload" :before-upload="beforeUpload"
@change="handleChange" @change="handleChange"
:disabled="isReadOnly"
> >
<img <img
v-if="step1FormModel.logoUrl" v-if="step1FormModel.logoUrl"
...@@ -137,7 +140,7 @@ ...@@ -137,7 +140,7 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<a-button @click="showVideoUploadModal">上传视频</a-button> <a-button @click="showVideoUploadModal" :disabled="isReadOnly">上传视频</a-button>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
...@@ -147,6 +150,7 @@ ...@@ -147,6 +150,7 @@
<a-textarea <a-textarea
row="2" row="2"
v-model="step1FormModel.introduce" v-model="step1FormModel.introduce"
:disabled="isReadOnly"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
...@@ -167,6 +171,7 @@ ...@@ -167,6 +171,7 @@
:before-upload="beforUploadDetailPic" :before-upload="beforUploadDetailPic"
@change="uploadDetailPicChange" @change="uploadDetailPicChange"
:remove="uploadDetailRemove" :remove="uploadDetailRemove"
:disabled="isReadOnly"
> >
<div v-if="detailPicList.length < 8"> <div v-if="detailPicList.length < 8">
<a-icon type="plus" /> <a-icon type="plus" />
...@@ -198,7 +203,7 @@ ...@@ -198,7 +203,7 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<a-button @click="showAttachmentUploadModal">上传附件</a-button> <a-button @click="showAttachmentUploadModal" :disabled="isReadOnly">上传附件</a-button>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
...@@ -209,6 +214,7 @@ ...@@ -209,6 +214,7 @@
name="chargeModel" name="chargeModel"
default-value="FREE" default-value="FREE"
v-model="step1FormModel.chargeModel" v-model="step1FormModel.chargeModel"
:disabled="isReadOnly"
> >
<a-radio value="FREE"> <a-radio value="FREE">
免费 免费
...@@ -257,6 +263,7 @@ ...@@ -257,6 +263,7 @@
placeholder="选择讲师" placeholder="选择讲师"
v-model="step1FormModel.teacherId" v-model="step1FormModel.teacherId"
@change="handleTeacherChange" @change="handleTeacherChange"
:disabled="isReadOnly"
> >
<a-select-opt-group <a-select-opt-group
...@@ -283,6 +290,7 @@ ...@@ -283,6 +290,7 @@
placeholder="选择课程标签" placeholder="选择课程标签"
v-model="selectedTags" v-model="selectedTags"
@change="handleTagChange" @change="handleTagChange"
:disabled="isReadOnly"
> >
<a-select-option <a-select-option
v-for="(t) in this.tags" v-for="(t) in this.tags"
...@@ -301,6 +309,7 @@ ...@@ -301,6 +309,7 @@
name="allow" name="allow"
default-value="ALL" default-value="ALL"
v-model="step1FormModel.allow" v-model="step1FormModel.allow"
:disabled="isReadOnly"
> >
<a-radio value="ALL"> <a-radio value="ALL">
全部 全部
...@@ -336,6 +345,7 @@ ...@@ -336,6 +345,7 @@
<a-button <a-button
type="primary" type="primary"
@click="onSave" @click="onSave"
:disabled="isReadOnly"
> >
保存 保存
</a-button> </a-button>
...@@ -602,6 +612,7 @@ export default { ...@@ -602,6 +612,7 @@ export default {
} }
}; };
return { return {
isReadOnly:this.$route.query.isReadOnly=='true',
attachment: { attachment: {
title: "", title: "",
}, },
......
...@@ -75,12 +75,17 @@ ...@@ -75,12 +75,17 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text, record"> <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" icon="edit"
type="link" type="link"
@click="navigateDetailPage(record)" @click="navigateDetailPage(record)"
>编辑</a-button> >编辑</a-button>
<a-button <a-button v-if="isReadOnly==false"
icon="edit" icon="edit"
type="link" type="link"
@click="changeStatus(record)" @click="changeStatus(record)"
...@@ -147,6 +152,7 @@ export default { ...@@ -147,6 +152,7 @@ export default {
return { return {
columns: columns, columns: columns,
data: [], data: [],
UserInfo: {},
searchPage: { searchPage: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
...@@ -155,6 +161,7 @@ export default { ...@@ -155,6 +161,7 @@ export default {
chargeModel: null, chargeModel: null,
status: null status: null
}, },
isReadOnly:true,
pagination: { pagination: {
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true showSizeChanger: true
...@@ -188,6 +195,14 @@ export default { ...@@ -188,6 +195,14 @@ export default {
}, },
// 创建完毕 // 创建完毕
created() { 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); this.getList(this.searchPage);
}, },
// 即将更新渲染 // 即将更新渲染
...@@ -228,7 +243,7 @@ export default { ...@@ -228,7 +243,7 @@ export default {
if(row){ if(row){
id = row.id 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){ changeStatus(row){
console.log(row.id) 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