mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
从系统选择封面
This commit is contained in:
@@ -58,7 +58,10 @@
|
||||
<el-form-item label="名称" required><el-input maxlength="100" v-model="courseInfo.name" placeholder="课程名称(限100字以内)"></el-input></el-form-item>
|
||||
<el-form-item label="封面图片" required >
|
||||
<el-col :span="8">
|
||||
<imageUpload :value="courseCoverurl" width="160px" height="90px" @success="uploadCoverImgSuccess" @remove="removeCoverImgSuccess"></imageUpload>
|
||||
<div @click.stop="chooseFile">
|
||||
<imageUpload :disabled="true" :value="courseCoverurl" width="160px" height="90px" @success="uploadCoverImgSuccess" @subimage="acceptimage" @remove="removeCoverImgSuccess"></imageUpload>
|
||||
|
||||
</div>
|
||||
<div>上传为16:9(如:800*450)的png或jpg图片</div>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
@@ -212,6 +215,8 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -237,6 +242,7 @@ import apiTag from "../../api/modules/tag.js";
|
||||
import videoPlayer from "@/components/VideoPlayer/index.vue";
|
||||
import audioPlayer from "@/components/AudioPlayer/index.vue";
|
||||
import apiCourseFile from '@/api/modules/courseFile.js';
|
||||
import filecloud from '@/components/FileCloud/index.vue';
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
// import hyperLink from '@/components/Course/hyperLink.vue';
|
||||
export default {
|
||||
@@ -246,6 +252,7 @@ export default {
|
||||
catalogCourseware,
|
||||
imageUpload,
|
||||
exam,
|
||||
filecloud,
|
||||
homework,
|
||||
assess,
|
||||
WxEditor,
|
||||
@@ -279,6 +286,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dlgFileChoose:{
|
||||
show:false
|
||||
},
|
||||
converStatus:4,
|
||||
courseType: courseType,
|
||||
isEdit: true,
|
||||
@@ -350,6 +360,26 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
chooseFile(){
|
||||
this.dlgFileChoose.show=true;
|
||||
},
|
||||
choseChoose(){
|
||||
this.dlgFileChoose.show=false;
|
||||
},
|
||||
changeCourseImage(img){
|
||||
if(!img.path){
|
||||
return;
|
||||
}
|
||||
//console.log(img);
|
||||
this.dlgFileChoose.show=false;
|
||||
this.courseInfo.coverImg = img.path;
|
||||
this.courseCoverurl = this.fileUrl+img.path;
|
||||
},
|
||||
acceptimage(value){
|
||||
this.courseInfo.coverImg = value.path;
|
||||
this.courseCoverurl = value.path;
|
||||
},
|
||||
...mapActions({
|
||||
getResOwnerTree: "resOwner/getResOwnerTree",
|
||||
loadResOwners: "resOwner/loadResOwners",
|
||||
|
||||
@@ -73,7 +73,10 @@
|
||||
<!--不显示,因为标题已经代表了 <el-form-item label="授课方式">{{courseTypeMap(params.type)}}</el-form-item>-->
|
||||
<el-form-item label="封面图片" required >
|
||||
<el-col :span="8">
|
||||
<imageUpload :value="courseCoverurl" width="160px" height="90px" @success="uploadCoverImgSuccess" @remove="removeCoverImgSuccess"></imageUpload>
|
||||
<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>
|
||||
<el-col :span="16">
|
||||
@@ -250,6 +253,8 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -277,6 +282,7 @@ import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||
import { mapGetters,mapActions} from 'vuex';
|
||||
import hyperLink from '@/components/Course/hyperLink.vue';
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
import filecloud from '@/components/FileCloud/index.vue';
|
||||
export default {
|
||||
name:"auditCourse2",
|
||||
components: {
|
||||
@@ -284,6 +290,7 @@ export default {
|
||||
catalogCourseware,
|
||||
imageUpload,
|
||||
exam,
|
||||
filecloud,
|
||||
homework,
|
||||
assess,
|
||||
WxEditor,
|
||||
@@ -315,6 +322,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dlgFileChoose:{
|
||||
show:false
|
||||
},
|
||||
converStatus:4,
|
||||
curriculumData:{
|
||||
url:'',
|
||||
@@ -391,6 +401,26 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
chooseFile(){
|
||||
this.dlgFileChoose.show=true;
|
||||
},
|
||||
choseChoose(){
|
||||
this.dlgFileChoose.show=false;
|
||||
},
|
||||
changeCourseImage(img){
|
||||
if(!img.path){
|
||||
return;
|
||||
}
|
||||
//console.log(img);
|
||||
this.dlgFileChoose.show=false;
|
||||
this.courseInfo.coverImg = img.path;
|
||||
this.courseCoverurl = this.fileUrl+img.path;
|
||||
},
|
||||
acceptimage(value){
|
||||
this.courseInfo.coverImg = value.path;
|
||||
this.courseCoverurl = value.path;
|
||||
},
|
||||
...mapActions({
|
||||
getResOwnerTree:'resOwner/getResOwnerTree',
|
||||
loadResOwners:'resOwner/loadResOwners',
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<el-form-item label="名称" required><el-input maxlength="90" v-model="courseInfo.name" show-word-limit placeholder="课程名称(限90字以内)"></el-input></el-form-item>
|
||||
<el-form-item label="封面图片" v-show="!weike.onlyRequired">
|
||||
<!-- 上传封面图 -->
|
||||
<!-- 上传封面图-->
|
||||
<div style="display:flex">
|
||||
<div @click.stop="chooseFile">
|
||||
<!-- <image :src="courseCoverurl" style="width:160px;height:90px" width="160px" height="90px"></image> -->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="min-width: 700px;">
|
||||
<el-dialog title="选择图片" :close-on-click-modal="false" :visible.sync="show" width="60%" @close="chose" :modal="false" custom-class="g-dialog">
|
||||
<el-dialog title="选择图片" :close-on-click-modal="false" :visible.sync="show" width="60%" :show-close="false" :modal="false" custom-class="g-dialog">
|
||||
<div style="margin: -10px;">
|
||||
<div style="display: flex;justify-content: space-between;padding: 5px;border-bottom: 1px solid #e0e0e0;">
|
||||
<div style="padding-top: 10px;">
|
||||
@@ -36,6 +36,8 @@
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :disabled="btnDisabled" type="primary" @click="saveChoose()">确认</el-button>
|
||||
<el-button @click="chose()">取消</el-button>
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user