课程审核部分的修改,替换到新开发的分支上来

This commit is contained in:
daihh
2022-09-25 10:58:16 +08:00
parent ba5ed90fc6
commit c31f9fdf62
7 changed files with 446 additions and 70 deletions

View File

@@ -41,6 +41,7 @@
<!-- <el-form-item label="系统标签">
{{courseInfo.tags}}
</el-form-item> -->
<el-form-item label="资源归属" >{{orgName}}</el-form-item>
<el-form-item label="目标人群" >
{{courseInfo.forUsers}}
</el-form-item>
@@ -75,7 +76,7 @@
<el-col :span="8">
<div @click.stop="chooseFile">
<imageUpload :disabled="true" :value="courseCoverurl" width="160px" height="90px" @subimage="acceptimage" @success="uploadCoverImgSuccess" @remove="removeCoverImgSuccess"></imageUpload>
</div>
<div>上传为16:9(:800*450)的png或jpg图片</div>
</el-col>
@@ -108,6 +109,11 @@
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="目标人群" >
<el-input maxlength="50" show-word-limit v-model="courseInfo.forUsers" placeholder="目标人群(限50字以内)"></el-input>
</el-form-item>
@@ -254,17 +260,20 @@
</el-col>
</el-row>
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
<chooseOrg ref="refChooseOrg" @confirm="confirmChooseOrg"></chooseOrg>
</div>
</template>
<script>
import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiOrg from '../../api/system/organiza.js';
import apiUser from '@/api/system/user.js';
import exam from "@/components/Course/exam";
import homework from "@/components/Course/homework";
import pdfPreview from "@/components/PdfPreview/index.vue";
import assess from "@/components/Course/assess";
import apiTag from "../../api/modules/tag.js";
import chooseOrg from '@/components/System/chooseOrg.vue';
import {
formatDate,
courseType,
@@ -297,7 +306,8 @@ export default {
pdfPreview,
videoPlayer,
audioPlayer,
hyperLink
hyperLink,
chooseOrg
},
props: {
id: {
@@ -318,7 +328,7 @@ export default {
}
},
computed: {
...mapGetters(['resOwnerMap','sysTypeMap']),
...mapGetters(['resOwnerMap','sysTypeMap','identity']),
},
data() {
return {
@@ -358,6 +368,8 @@ export default {
typeList: [], // 资源归属
showTags: [], //用于显示标签
teacherList: [],
orgName:'',
orgKid:'',
courseInfo: {},
courseCoverurl: "",
sysTypeListMap:[],
@@ -401,8 +413,17 @@ export default {
})
},
methods: {
chooseFile(){
showChooseOrg(){
this.$refs.refChooseOrg.dlgShow = true;
},
confirmChooseOrg(orgInfo){
//console.log(orgInfo,'orgInfo');
this.orgName=orgInfo.name;
this.orgKid=orgInfo.kid;
this.courseInfo.orgId=orgInfo.id;
this.$refs.refChooseOrg.dlgShow = false;
},
chooseFile(){
this.dlgFileChoose.show=true;
},
choseChoose(){
@@ -610,6 +631,31 @@ export default {
apiCoursePortal.detail(this.id,true).then(rs => {
if (rs.status == 200) {
this.courseInfo = rs.result.course;
//加载所属机构名称
this.orgKid='';
if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid;
}
})
}else{
//根据课程创建者获取机构id
apiUser.getOrgSimpleByUserId(this.courseInfo.sysCreateAid).then(ors=>{
if(ors.status==200){
$this.courseInfo.orgId=ors.result.id;
apiOrg.getSimple(ors.result.id).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
}
})
}else{
//
}
})
}
if(rs.result.course.coverImg !== '') {
this.courseCoverurl = this.fileBaseUrl + rs.result.course.coverImg;
}