mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
课件上传的样式修改
This commit is contained in:
@@ -130,34 +130,43 @@
|
|||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-dialog title="上传课件" :close-on-click-modal="false" width="800px" :visible.sync="upload.show" custom-class="g-dialog">
|
<el-dialog title="上传课件" :close-on-click-modal="false" :close-on-press-escape="false" top="10vh" width="800px" :visible.sync="upload.show" :before-close="handleCloseCheck" custom-class="g-dialog">
|
||||||
<div>
|
<div>
|
||||||
<div style="line-height: 30px;">
|
<div style="line-height: 30px;">
|
||||||
<div>请在当前面板选择需要上传的课件</div>
|
<div>请在当前面板选择需要上传的课件</div>
|
||||||
<div style="">提示:课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。</div>
|
<div style="">提示:课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="display: flex;line-height: 30px;">
|
<div style="display: flex;line-height: 30px;padding: 5px 0px;">
|
||||||
<span style="font-weight: 600;">资源归属:</span>
|
<el-input :readonly="true" placeholder="请选择资源归属" v-model="upload.orgName" style="width: 300px;">
|
||||||
<el-input placeholder="请选择" v-model="upload.orgName" style="width: 300px;">
|
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" size="small" slot="append" icon="el-icon-search">选择</el-button>
|
||||||
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" size="small" slot="append" icon="el-icon-search">选择</el-button>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
<!-- <el-cascader clearable v-model="projectOwnership" :options="resOwnerListMap" :props="defaultProps" @change="handleChange"></el-cascader> -->
|
<!-- <el-cascader clearable v-model="projectOwnership" :options="resOwnerListMap" :props="defaultProps" @change="handleChange"></el-cascader> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px;margin-bottom: 10px;">
|
||||||
|
<div style="float: right;">
|
||||||
|
<el-checkbox v-model="deviceMobile" @change="isVisible(1)" label="移动端可见" border></el-checkbox>
|
||||||
|
<el-checkbox v-model="devicePc" @change="isVisible(2)" label="pc端可见" border></el-checkbox>
|
||||||
|
</div>
|
||||||
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<el-table border stripe :data="fileList" style="width: 100%" @selection-change="handleSelectionChange">
|
<el-table border stripe :data="fileList" style="width: 100%" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="40"></el-table-column>
|
<!-- <el-table-column type="selection" width="40"></el-table-column> -->
|
||||||
<el-table-column prop="fileName" label="文件名称"></el-table-column>
|
<el-table-column prop="fileName" label="文件名称"></el-table-column>
|
||||||
<el-table-column prop="name" label="课件名称">
|
<el-table-column prop="name" label="课件名称">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input type="text" v-model="scope.row.name"></el-input>
|
<el-input type="text" v-model="scope.row.name"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="resType" label="类型" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ getType(scope.row.resType) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="duration" label="时长(分)" width="100">
|
<el-table-column prop="duration" label="时长(分)" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input type="number" size="small" v-model="scope.row.minute"></el-input>
|
<el-input type="number" size="small" v-model="scope.row.minute"></el-input>
|
||||||
@@ -183,8 +192,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span slot="footer">
|
<span slot="footer">
|
||||||
<el-button type="infor" @click="isVisible(1)">移动端可见</el-button>
|
<!-- <el-button type="infor" @click="isVisible(1)">移动端可见</el-button>
|
||||||
<el-button type="infor" @click="isVisible(2)">pc端可见</el-button>
|
<el-button type="infor" @click="isVisible(2)">pc端可见</el-button> -->
|
||||||
<el-button type="primary" @click="saveUpload()">保存</el-button>
|
<el-button type="primary" @click="saveUpload()">保存</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -334,9 +343,11 @@ export default {
|
|||||||
orgId:'',
|
orgId:'',
|
||||||
orgName:''
|
orgName:''
|
||||||
},
|
},
|
||||||
needOrg:'请先选择资源归属',
|
needOrg:'',//如果有值,上传前会提示
|
||||||
fileList: [],
|
fileList: [],
|
||||||
courseShow: false,
|
courseShow: false,
|
||||||
|
devicePc:true,
|
||||||
|
deviceMobile:true,
|
||||||
scormUrl:'',//scorm的播放地址
|
scormUrl:'',//scorm的播放地址
|
||||||
multipleSelection: []
|
multipleSelection: []
|
||||||
};
|
};
|
||||||
@@ -490,25 +501,37 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isVisible(num) {
|
isVisible(num) {
|
||||||
let ids = [];
|
var mflag=this.deviceMobile;
|
||||||
this.multipleSelection.forEach(item => {
|
var pflag=this.devicePc;
|
||||||
ids.push(item.id);
|
this.fileList.forEach((item, i) => {
|
||||||
});
|
if (num === 1) {
|
||||||
//待完善
|
item.device1 = mflag;
|
||||||
for (let index = 0; index < ids.length; index++) {
|
this.$set(this.fileList, i, item);
|
||||||
this.fileList.forEach((item, i) => {
|
} else {
|
||||||
if (item.id === ids[index]) {
|
item.device2 = pflag;
|
||||||
if (num === 1) {
|
this.$set(this.fileList, i, item);
|
||||||
item.device1 = true;
|
|
||||||
this.$set(this.fileList, i, item);
|
|
||||||
} else {
|
|
||||||
item.device2 = true;
|
|
||||||
this.$set(this.fileList, i, item);
|
|
||||||
}
|
|
||||||
this.$forceUpdate();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
this.$forceUpdate();
|
||||||
|
// let ids = [];
|
||||||
|
// this.multipleSelection.forEach(item => {
|
||||||
|
// ids.push(item.id);
|
||||||
|
// });
|
||||||
|
// //待完善
|
||||||
|
// for (let index = 0; index < ids.length; index++) {
|
||||||
|
// this.fileList.forEach((item, i) => {
|
||||||
|
// if (item.id === ids[index]) {
|
||||||
|
// if (num === 1) {
|
||||||
|
// item.device1 = true;
|
||||||
|
// this.$set(this.fileList, i, item);
|
||||||
|
// } else {
|
||||||
|
// item.device2 = true;
|
||||||
|
// this.$set(this.fileList, i, item);
|
||||||
|
// }
|
||||||
|
// this.$forceUpdate();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
handleUploadSuccess(rs) {
|
handleUploadSuccess(rs) {
|
||||||
if (rs.status === 200) {
|
if (rs.status === 200) {
|
||||||
@@ -570,9 +593,25 @@ export default {
|
|||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleRemoveSuccess(res) {},
|
handleRemoveSuccess(res) {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleCloseCheck(done){
|
||||||
|
//console.log('关闭的处理aaaaa');
|
||||||
|
if(this.fileList.length>0){
|
||||||
|
this.$message.error('有待保存的上传文件,请执行保存操作');
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return done(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
// 文件上传保存
|
// 文件上传保存
|
||||||
saveUpload() {
|
saveUpload() {
|
||||||
|
if(!this.upload.orgName){
|
||||||
|
this.$message.success('请选择资源归属');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.fileList.forEach(item => {
|
this.fileList.forEach(item => {
|
||||||
if (item.device1 === true && item.device2 === true) {
|
if (item.device1 === true && item.device2 === true) {
|
||||||
item.device = 3;
|
item.device = 3;
|
||||||
@@ -591,6 +630,7 @@ export default {
|
|||||||
coueseFile.batchUpdate(this.fileList).then(rs => {
|
coueseFile.batchUpdate(this.fileList).then(rs => {
|
||||||
if (rs.status === 200) {
|
if (rs.status === 200) {
|
||||||
this.$message.success('保存成功');
|
this.$message.success('保存成功');
|
||||||
|
this.fileList=[];
|
||||||
this.getSearch();
|
this.getSearch();
|
||||||
this.upload.show = false;
|
this.upload.show = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -719,9 +759,6 @@ export default {
|
|||||||
this.coursewareShow = true;
|
this.coursewareShow = true;
|
||||||
this.videoPathUrl = row.pathUrl;
|
this.videoPathUrl = row.pathUrl;
|
||||||
},
|
},
|
||||||
handleNodeClick(data) {
|
|
||||||
console.log(data);
|
|
||||||
},
|
|
||||||
viewTopic(row) {
|
viewTopic(row) {
|
||||||
this.fileInfo = row;//这里的fileInfo 相当于内容对象
|
this.fileInfo = row;//这里的fileInfo 相当于内容对象
|
||||||
if(row.resType==50){
|
if(row.resType==50){
|
||||||
|
|||||||
Reference in New Issue
Block a user