Commit 20c94e29 authored by 张伯涛's avatar 张伯涛

修改

parent 4cc1f325
...@@ -126,7 +126,7 @@ export function updateDownChapter(data) { ...@@ -126,7 +126,7 @@ export function updateDownChapter(data) {
// 6.导入 // 6.导入
export function uploadVideo(data) { export function uploadVideo(data) {
return request({ return request({
url: '/bvideo/uploadVideo', url: '/bfile/uploadVideo',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
......
...@@ -15,21 +15,3 @@ ...@@ -15,21 +15,3 @@
left: 576px!important; left: 576px!important;
padding: 12px 10px; padding: 12px 10px;
} }
.el-table th .cell{
justify-content: center!important;
}
.el-table td .cell{
margin: 10px;
text-align: center!important;
}
//.el-table .cell{
// padding: 18px;
// white-space: normal;
// word-break: break-all;
// line-height: 24px;
//}
//.el-table td .cell{
// height: 100px;
// display: flex;
// align-items: center;
//}
...@@ -51,22 +51,22 @@ ...@@ -51,22 +51,22 @@
</el-form-item> </el-form-item>
<el-form-item label="教学手段" :label-width="formLabelWidth" prop="stuMeans"> <el-form-item label="教学手段" :label-width="formLabelWidth" prop="stuMeans">
<el-checkbox-group v-model="sectionForm.stuMeans"> <el-checkbox-group v-model="sectionForm.stuMeans">
<!-- <el-checkbox ref="expFileSwitch" label="实验" name="stuMeans" @change="stuMeansCheck" />--> <!-- <el-checkbox ref="expFileSwitch" label="实验" name="stuMeans" @change="stuMeansCheck" />-->
<el-checkbox label="视频" name="stuMeans" /> <el-checkbox label="视频" name="stuMeans" />
<!-- <el-checkbox label="PPT" name="stuMeans" />--> <!-- <el-checkbox label="PPT" name="stuMeans" />-->
<el-checkbox label="PDF" name="stuMeans" /> <el-checkbox label="PDF" name="stuMeans" />
<!-- <el-checkbox label="资料" name="stuMeans" />--> <!-- <el-checkbox label="资料" name="stuMeans" />-->
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- <el-form-item v-show="sectionForm.stuMeansOpt" label="实验环境" :label-width="formLabelWidth" prop="stuMeansFile">--> <!-- <el-form-item v-show="sectionForm.stuMeansOpt" label="实验环境" :label-width="formLabelWidth" prop="stuMeansFile">-->
<!-- <el-radio-group v-show="stuMeansFile=='001'" v-model="sectionForm.stuMeansFile">--> <!-- <el-radio-group v-show="stuMeansFile=='001'" v-model="sectionForm.stuMeansFile">-->
<!-- <el-radio :label="3" value="3" name="stuMeansFile">HTML文件</el-radio>--> <!-- <el-radio :label="3" value="3" name="stuMeansFile">HTML文件</el-radio>-->
<!-- <el-radio :label="4" value="4" name="stuMeansFile">HTML工程</el-radio>--> <!-- <el-radio :label="4" value="4" name="stuMeansFile">HTML工程</el-radio>-->
<!-- </el-radio-group>--> <!-- </el-radio-group>-->
<!-- <el-radio-group v-show="stuMeansFile=='002'" v-model="sectionForm.stuMeansFile">--> <!-- <el-radio-group v-show="stuMeansFile=='002'" v-model="sectionForm.stuMeansFile">-->
<!-- <el-radio :label="2" name="stuMeansFile">Java工程</el-radio>--> <!-- <el-radio :label="2" name="stuMeansFile">Java工程</el-radio>-->
<!-- </el-radio-group>--> <!-- </el-radio-group>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="warning" :plain="true" @click="viewSwitch.sectionForm = false">取 消</el-button> <el-button type="warning" :plain="true" @click="viewSwitch.sectionForm = false">取 消</el-button>
...@@ -84,23 +84,23 @@ ...@@ -84,23 +84,23 @@
<el-form ref="teaMeans" :model="teaMeans"> <el-form ref="teaMeans" :model="teaMeans">
<el-form-item label="教学手段" :label-width="formLabelWidth" prop="stuMeans"> <el-form-item label="教学手段" :label-width="formLabelWidth" prop="stuMeans">
<el-checkbox-group v-model="teaMeans.stuMeans"> <el-checkbox-group v-model="teaMeans.stuMeans">
<!-- <el-checkbox ref="teaExpWH" label="1" name="stuMeans" @change="teaMeansEditExp">实验</el-checkbox>--> <!-- <el-checkbox ref="teaExpWH" label="1" name="stuMeans" @change="teaMeansEditExp">实验</el-checkbox>-->
<el-checkbox label="2" name="stuMeans">视频</el-checkbox> <el-checkbox label="2" name="stuMeans">视频</el-checkbox>
<!-- <el-checkbox label="3" name="stuMeans">PPT</el-checkbox>--> <!-- <el-checkbox label="3" name="stuMeans">PPT</el-checkbox>-->
<el-checkbox label="4" name="stuMeans">PDF</el-checkbox> <el-checkbox label="4" name="stuMeans">PDF</el-checkbox>
<!-- <el-checkbox label="5" name="stuMeans">资料</el-checkbox>--> <!-- <el-checkbox label="5" name="stuMeans">资料</el-checkbox>-->
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- <el-form-item v-show="teaMeans.stuMeansOpt" label="实验环境" :label-width="formLabelWidth" prop="stuMeansFile">--> <!-- <el-form-item v-show="teaMeans.stuMeansOpt" label="实验环境" :label-width="formLabelWidth" prop="stuMeansFile">-->
<!-- <el-radio-group v-show="stuMeansFile=='001'" v-model="teaMeans.expType">--> <!-- <el-radio-group v-show="stuMeansFile=='001'" v-model="teaMeans.expType">-->
<!-- <el-radio label="3" name="stuMeansFile">HTML文件</el-radio>--> <!-- <el-radio label="3" name="stuMeansFile">HTML文件</el-radio>-->
<!-- <el-radio label="4" name="stuMeansFile">HTML工程</el-radio>--> <!-- <el-radio label="4" name="stuMeansFile">HTML工程</el-radio>-->
<!-- </el-radio-group>--> <!-- </el-radio-group>-->
<!-- <el-radio-group v-show="stuMeansFile=='002'" v-model="teaMeans.expType">--> <!-- <el-radio-group v-show="stuMeansFile=='002'" v-model="teaMeans.expType">-->
<!-- <el-radio label="2" name="stuMeansFile">Java工程</el-radio>--> <!-- <el-radio label="2" name="stuMeansFile">Java工程</el-radio>-->
<!-- </el-radio-group>--> <!-- </el-radio-group>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="teaMeans.isShow=false">取 消</el-button> <el-button @click="teaMeans.isShow=false">取 消</el-button>
...@@ -120,8 +120,9 @@ ...@@ -120,8 +120,9 @@
class="upload-demo" class="upload-demo"
:file-list="resForm.filelist" :file-list="resForm.filelist"
:action="resForm.resUrl" :action="resForm.resUrl"
:before-upload="beforeUpload" :on-change="handleChange"
:progress="progress" :progress="progress"
:auto-upload="false"
drag drag
multiple multiple
> >
...@@ -131,7 +132,7 @@ ...@@ -131,7 +132,7 @@
</el-upload> </el-upload>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="resForm.resView=false">取 消</el-button> <el-button @click="resForm.resView=false">取 消</el-button>
<el-button type="primary" @click="confirmUpload">保 存</el-button> <el-button type="primary" @click="confirmUpload">保 存啊啊啊</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -165,10 +166,20 @@ ...@@ -165,10 +166,20 @@
<span>{{ index+1 }}</span> <span>{{ index+1 }}</span>
<div class="input-group"> <div class="input-group">
<input type="hidden" :value="item.chapterName" maxlength="50"> <input type="hidden" :value="item.chapterName" maxlength="50">
<input type="text" disabled :value="item.chapterName" :title="item.chapterName" class="chapter_input" :data-bid="item.businessId" maxlength="50"> <input
:ref="'inputToFocus' + item.businessId"
type="text"
:value="item.chapterName"
:title="item.chapterName"
:disabled="item.inputDisabled"
class="chapter_input"
:data-bid="item.businessId"
maxlength="50"
@blur="handleInputBlur(item)"
>
<span class="chapter_input_warning">章标题不允许为空!</span> <span class="chapter_input_warning">章标题不允许为空!</span>
</div> </div>
<i class="edit" title="编辑" /> <i class="edit" title="编辑" @click="handleUpdate(item)" />
<i v-show="index!==0" class="btnUp" title="上移一章" @click="chapterUp(item.businessId,-1,item.sort)" /> <i v-show="index!==0" class="btnUp" title="上移一章" @click="chapterUp(item.businessId,-1,item.sort)" />
<i v-show="index!==chapterList.length-1" class="btnDown" title="下移一章" @click="chapterDown(item.businessId,-1,item.sort)" /> <i v-show="index!==chapterList.length-1" class="btnDown" title="下移一章" @click="chapterDown(item.businessId,-1,item.sort)" />
<i class="close" title="删除该章" @click="delCha(index)" /> <i class="close" title="删除该章" @click="delCha(index)" />
...@@ -177,7 +188,17 @@ ...@@ -177,7 +188,17 @@
<span>{{ indexChild+1 }}</span> <span>{{ indexChild+1 }}</span>
<div class="input-group"> <div class="input-group">
<input type="hidden" :value="itemChild.chapterName" maxlength="50"> <input type="hidden" :value="itemChild.chapterName" maxlength="50">
<input type="text" disabled :value="itemChild.chapterName" :title="itemChild.chapterName" class="chapter_input" :data-bid="itemChild.businessId" :data-pid="item.businessId" maxlength="50"> <input
:ref="item.businessId + 'inputToFocus'"
type="text"
:value="itemChild.chapterName"
:title="itemChild.chapterName"
:disabled="itemChild.inputDisabled"
class="chapter_input"
:data-bid="itemChild.businessId"
:data-pid="item.businessId"
maxlength="50"
>
<span class="chapter_input_warning">节标题不允许为空!</span> <span class="chapter_input_warning">节标题不允许为空!</span>
</div> </div>
...@@ -186,7 +207,7 @@ ...@@ -186,7 +207,7 @@
<el-radio label="0">0学时</el-radio> <el-radio label="0">0学时</el-radio>
</el-radio-group> </el-radio-group>
<i class="edit" title="编辑" /> <i class="edit" title="编辑" @click="handleUpdate(itemChild)" />
<i class="teaMeans" title="教学手段" @click="teaMeansEdit(index,indexChild)" /> <i class="teaMeans" title="教学手段" @click="teaMeansEdit(index,indexChild)" />
<i v-show="false" class="upload" title="上传资料" @click="resourceFn(index,indexChild)" /> <i v-show="false" class="upload" title="上传资料" @click="resourceFn(index,indexChild)" />
<i v-show="indexChild!==0" class="btnUp" title="上移一节" @click="chapterUp(itemChild.businessId,item.businessId,itemChild.sort)" /> <i v-show="indexChild!==0" class="btnUp" title="上移一节" @click="chapterUp(itemChild.businessId,item.businessId,itemChild.sort)" />
...@@ -195,26 +216,26 @@ ...@@ -195,26 +216,26 @@
<!-- 资源按钮组 --> <!-- 资源按钮组 -->
<div style="display:inline-block;float:right"> <div style="display:inline-block;float:right">
<!-- <span v-show="processRes(1,itemChild.isTest)">--> <!-- <span v-show="processRes(1,itemChild.isTest)">-->
<!-- <router-link v-show="itemChild.mdFile!==''" :to="{name:'ProAssPaper',params:{bid:itemChild.businessId,courseInfo:lessonName,chapterName:item.chapterName,sectionName:itemChild.chapterName}}" target="_blank"><i class="chapter-icon assPaperBtn" title="实验文档" /></router-link> &lt;!&ndash; 实验文档 &ndash;&gt;--> <!-- <router-link v-show="itemChild.mdFile!==''" :to="{name:'ProAssPaper',params:{bid:itemChild.businessId,courseInfo:lessonName,chapterName:item.chapterName,sectionName:itemChild.chapterName}}" target="_blank"><i class="chapter-icon assPaperBtn" title="实验文档" /></router-link> &lt;!&ndash; 实验文档 &ndash;&gt;-->
<!-- <router-link v-show="itemChild.mdFile===''" :to="{name:'ProAssPaper',params:{bid:itemChild.businessId,courseInfo:lessonName,chapterName:item.chapterName,sectionName:itemChild.chapterName}}" target="_blank"><i class="chapter-icon assPaperBtnNo" title="未添加实验文档" /></router-link> &lt;!&ndash; 实验文档未添加 &ndash;&gt;--> <!-- <router-link v-show="itemChild.mdFile===''" :to="{name:'ProAssPaper',params:{bid:itemChild.businessId,courseInfo:lessonName,chapterName:item.chapterName,sectionName:itemChild.chapterName}}" target="_blank"><i class="chapter-icon assPaperBtnNo" title="未添加实验文档" /></router-link> &lt;!&ndash; 实验文档未添加 &ndash;&gt;-->
<!-- </span>--> <!-- </span>-->
<span v-show="processRes(2,itemChild.isTest)"> <span v-show="processRes(2,itemChild.isTest)">
<i v-show="itemChild.videoUrl!==''" class="chapter-icon videoBtn" title="视频" @click="openUploadDialog('视频维护',itemChild,0,'只能上传以.mp4格式/.rmvb格式/.avi结尾的文件')" /> <!-- 视频 --> <i v-show="itemChild.videoUrl!==''" class="chapter-icon videoBtn" title="视频" @click="openUploadDialog('视频维护',itemChild,0,'只能上传以.mp4格式/.rmvb格式/.avi结尾的文件')" /> <!-- 视频 -->
<i v-show="itemChild.videoUrl===''" class="chapter-icon videoBtnNo" title="视频未上传" @click="openUploadDialog('视频上传',itemChild,0,'只能上传以.mp4格式/.rmvb格式/.avi结尾的文件')" /> <!-- 视频未添加 --> <i v-show="itemChild.videoUrl===''" class="chapter-icon videoBtnNo" title="视频未上传" @click="openUploadDialog('视频上传',itemChild,0,'只能上传以.mp4格式/.rmvb格式/.avi结尾的文件')" /> <!-- 视频未添加 -->
</span> </span>
<!-- <span v-show="processRes(3,itemChild.isTest)">--> <!-- <span v-show="processRes(3,itemChild.isTest)">-->
<!-- <i v-show="itemChild.pptUrl!==''" class="chapter-icon pptBtn" title="PPT" @click="openUploadDialog('PPT维护',itemChild,2,'只能上传以.ppt/.pptx结尾的文件')" /> &lt;!&ndash; PPT &ndash;&gt;--> <!-- <i v-show="itemChild.pptUrl!==''" class="chapter-icon pptBtn" title="PPT" @click="openUploadDialog('PPT维护',itemChild,2,'只能上传以.ppt/.pptx结尾的文件')" /> &lt;!&ndash; PPT &ndash;&gt;-->
<!-- <i v-show="itemChild.pptUrl===''" class="chapter-icon pptBtnNo" title="PPT未上传" @click="openUploadDialog('PPT上传',itemChild,2,'只能上传以.ppt/.pptx结尾的文件')" /> &lt;!&ndash; PPT未添加 &ndash;&gt;--> <!-- <i v-show="itemChild.pptUrl===''" class="chapter-icon pptBtnNo" title="PPT未上传" @click="openUploadDialog('PPT上传',itemChild,2,'只能上传以.ppt/.pptx结尾的文件')" /> &lt;!&ndash; PPT未添加 &ndash;&gt;-->
<!-- </span>--> <!-- </span>-->
<span v-show="processRes(4,itemChild.isTest)"> <span v-show="processRes(4,itemChild.isTest)">
<i v-show="itemChild.pdfUrl!==''" class="chapter-icon pdfBtn" title="PDF" @click="openUploadDialog('PDF维护',itemChild,3,'只能上传以.pdf结尾的文件')" /> <!-- PDF --> <i v-show="itemChild.pdfUrl!==''" class="chapter-icon pdfBtn" title="PDF" @click="openUploadDialog('PDF维护',itemChild,3,'只能上传以.pdf结尾的文件')" /> <!-- PDF -->
<i v-show="itemChild.pdfUrl===''" class="chapter-icon pdfBtnNo" title="PDF未上传" @click="openUploadDialog('PDF上传',itemChild,3,'只能上传以.pdf结尾的文件')" /> <!-- PDF未添加 --> <i v-show="itemChild.pdfUrl===''" class="chapter-icon pdfBtnNo" title="PDF未上传" @click="openUploadDialog('PDF上传',itemChild,3,'只能上传以.pdf结尾的文件')" /> <!-- PDF未添加 -->
</span> </span>
<!-- <span v-show="processRes(5,itemChild.isTest)">--> <!-- <span v-show="processRes(5,itemChild.isTest)">-->
<!-- <i v-show="itemChild.fileUrl!==''" class="chapter-icon dataBtn" title="资料" @click="openUploadDialog('资料维护',itemChild,1,'只能上传以.rar/.zip结尾的文件')" /> &lt;!&ndash; 资料 &ndash;&gt;--> <!-- <i v-show="itemChild.fileUrl!==''" class="chapter-icon dataBtn" title="资料" @click="openUploadDialog('资料维护',itemChild,1,'只能上传以.rar/.zip结尾的文件')" /> &lt;!&ndash; 资料 &ndash;&gt;-->
<!-- <i v-show="itemChild.fileUrl===''" class="chapter-icon dataBtnNo" title="资料未上传" @click="openUploadDialog('资料上传',itemChild,1,'只能上传以.rar/.zip结尾的文件')" /> &lt;!&ndash; 资料未添加 &ndash;&gt;--> <!-- <i v-show="itemChild.fileUrl===''" class="chapter-icon dataBtnNo" title="资料未上传" @click="openUploadDialog('资料上传',itemChild,1,'只能上传以.rar/.zip结尾的文件')" /> &lt;!&ndash; 资料未添加 &ndash;&gt;-->
<!-- </span>--> <!-- </span>-->
</div> </div>
</dd> </dd>
</dl> </dl>
...@@ -320,6 +341,7 @@ export default { ...@@ -320,6 +341,7 @@ export default {
// 任务书 // 任务书
resEditorValue: '', resEditorValue: '',
currentResNeedBid: '', currentResNeedBid: '',
filelist: [],
// 上传资源用的表单 // 上传资源用的表单
resForm: { resForm: {
exp: false, exp: false,
...@@ -419,113 +441,126 @@ export default { ...@@ -419,113 +441,126 @@ export default {
} }
}, },
mounted() { mounted() {
const _this = this // const _this = this
// 尝试查询数据 // 尝试查询数据
this.loadCatalog() this.loadCatalog()
// 目录修改 // 目录修改
$('.cur-content-detail').on('click', '.edit', function() { // $('.cur-content-detail').on('click', '.edit', function() {
$(this).siblings('div').find('input[type=text]').prop('disabled', false).focus() // $(this).siblings('div').find('input[type=text]').prop('disabled', false).focus()
// $(this).css('background-image','url(../src/static/images/icon/editIng.png)'); // // $(this).css('background-image','url(../src/static/images/icon/editIng.png)');
}).on('blur', 'dl dt div input[type=text]', function() { // }).on('blur', 'dl dt div input[type=text]', function() {
const $this = $(this) // const $this = $(this)
if ($(this).val() !== $(this).prev().val()) { // if ($(this).val() !== $(this).prev().val()) {
if ($(this).val() === '') { // if ($(this).val() === '') {
$(this).siblings('span').slideDown() // $(this).siblings('span').slideDown()
$(this).focus() // $(this).focus()
$(this).one('keyup', function() { // $(this).one('keyup', function() {
$(this).siblings('span').hide() // $(this).siblings('span').hide()
}) // })
} else { // } else {
console.log('修改目录标题') // console.log('修改目录标题')
const bid = $this.attr('data-bid') // const bid = $this.attr('data-bid')
const chapterName = $this.val() // const chapterName = $this.val()
const params = { // const params = {
businessId: bid, // businessId: bid,
pid: -1, // pid: -1,
lessonOrSl: '1', // lessonOrSl: '1',
lessonId: _this.lessonId, // lessonId: _this.lessonId,
chapterName: chapterName // chapterName: chapterName
} // }
bchapterAdd(params).then(res => { // bchapterAdd(params).then(res => {
if (res.code === 200) { // if (res.code === 200) {
_this.$notify({ // _this.$notify({
title: '成功', // title: '成功',
message: res.message, // message: res.message,
type: 'success' // type: 'success'
}) // })
$this.prev('input[type=hidden]').val($this.val()) // $this.prev('input[type=hidden]').val($this.val())
_this.$emit('refreshData') // _this.$emit('refreshData')
} else { // } else {
_this.$notify({ // _this.$notify({
title: '提示', // title: '提示',
message: res.message, // message: res.message,
type: 'warning' // type: 'warning'
}) // })
$this.val($this.prev('input[type=hidden]').val()) // $this.val($this.prev('input[type=hidden]').val())
} // }
$this.prop('disabled', true) // $this.prop('disabled', true)
}).catch((err) => { // }).catch((err) => {
_this.$notify({ // _this.$notify({
title: '失败', // title: '失败',
message: '网络错误1', // message: '网络错误1',
type: 'error' // type: 'error'
}) // })
}) // })
} // }
} else { // } else {
$this.prop('disabled', true) // $this.prop('disabled', true)
} // }
}).on('blur', 'dl dd div input[type=text]', function() { // }).on('blur', 'dl dd div input[type=text]', function() {
const $this = $(this) // const $this = $(this)
if ($(this).val() !== $(this).prev().val()) { // if ($(this).val() !== $(this).prev().val()) {
if ($(this).val() === '') { // if ($(this).val() === '') {
$(this).siblings('span').slideDown() // $(this).siblings('span').slideDown()
$(this).focus() // $(this).focus()
$(this).one('keyup', function() { // $(this).one('keyup', function() {
$(this).siblings('span').hide() // $(this).siblings('span').hide()
}) // })
} else { // } else {
const bid = $this.attr('data-bid') // const bid = $this.attr('data-bid')
const pid = $this.attr('data-pid') // const pid = $this.attr('data-pid')
const chapterName = $this.val() // const chapterName = $this.val()
const params = { // const params = {
businessId: bid, // businessId: bid,
pid: pid, // pid: pid,
lessonOrSl: '1', // lessonOrSl: '1',
lessonId: _this.lessonId, // lessonId: _this.lessonId,
chapterName: chapterName // chapterName: chapterName
} // }
bchapterAdd(params).then(res => { // bchapterAdd(params).then(res => {
if (res.code === 200) { // if (res.code === 200) {
_this.$notify({ // _this.$notify({
title: '成功', // title: '成功',
message: res.message, // message: res.message,
type: 'success' // type: 'success'
}) // })
$this.prev('input[type=hidden]').val($this.val()) // $this.prev('input[type=hidden]').val($this.val())
} else { // } else {
_this.$notify({ // _this.$notify({
title: '提示', // title: '提示',
message: res.message, // message: res.message,
type: 'warning' // type: 'warning'
}) // })
$this.val($this.prev('input[type=hidden]').val()) // $this.val($this.prev('input[type=hidden]').val())
} // }
$this.prop('disabled', true) // $this.prop('disabled', true)
}).catch((err) => { // }).catch((err) => {
_this.$notify({ // _this.$notify({
title: '失败', // title: '失败',
message: '网络错误2', // message: '网络错误2',
type: 'error' // type: 'error'
}) // })
}) // })
} // }
} else { // } else {
$this.prop('disabled', true) // $this.prop('disabled', true)
} // }
}) // })
}, },
methods: { methods: {
/** 编辑按钮*/
handleUpdate(item) {
item.inputDisabled = false
const inputRef = 'inputToFocus' + item.businessId
console.log('inputRef', inputRef)
this.$nextTick(() => {
this.$refs['inputToFocus' + item.businessId].focus()
})
},
/** 章/节input框blur事件*/
handleInputBlur(item) {
item.inputDisabled = true
},
// 查询课程目录 // 查询课程目录
loadCatalog(lessonId, classHours, lessonName, code, dirId, stuMeansFile) { loadCatalog(lessonId, classHours, lessonName, code, dirId, stuMeansFile) {
// 清空原课时信息 // 清空原课时信息
...@@ -560,12 +595,14 @@ export default { ...@@ -560,12 +595,14 @@ export default {
if (_this.stuMeansFile === '') { _this.stuMeansFile = stuMeansFile } if (_this.stuMeansFile === '') { _this.stuMeansFile = stuMeansFile }
_this.chapterList = res.data.chapterList _this.chapterList = res.data.chapterList
// 赋文件上传路径 // 赋文件上传路径
_this.resForm.resUrl = _this.HTTPApi + 'BVideo/uploadVideo' _this.resForm.resUrl = _this.HTTPApi + 'bfile/uploadVideo'
// 统计当前课时 // 统计当前课时
let classCurrent = 0 let classCurrent = 0
for (let i = 0; i < res.data.chapterList.length; i++) { for (let i = 0; i < _this.chapterList.length; i++) {
for (let j = 0; j < res.data.chapterList[i].childList.length; j++) { this.$set(_this.chapterList[i], 'inputDisabled', true)
classCurrent += parseInt(res.data.chapterList[i].childList[j].classHour) for (let j = 0; j < _this.chapterList[i].childList.length; j++) {
this.$set(_this.chapterList[i].childList[j], 'inputDisabled', true)
classCurrent += parseInt(_this.chapterList[i].childList[j].classHour)
} }
} }
_this.classCurrent = classCurrent _this.classCurrent = classCurrent
...@@ -964,9 +1001,9 @@ export default { ...@@ -964,9 +1001,9 @@ export default {
} }
}, },
// 上传资源 // 上传资源
beforeUpload(file) { handleChange(file, fileList) {
this.resForm.filelist = [] console.log('11111', fileList)
this.resForm.filelist.push(file) this.resForm.filelist = fileList
}, },
// 上传 // 上传
openUploadDialog(title, item, type, tips) { openUploadDialog(title, item, type, tips) {
...@@ -1127,8 +1164,9 @@ export default { ...@@ -1127,8 +1164,9 @@ export default {
}, },
confirmUpload() { confirmUpload() {
const type = this.resForm.type const type = this.resForm.type
const file = this.resForm.filelist[0] const file = this.resForm.filelist[0].raw
console.log('this.resForm', this.resForm)
console.log('file', file)
// let fileType =file.name.substring(file.name.lastIndexOf('.')+1); // let fileType =file.name.substring(file.name.lastIndexOf('.')+1);
const _this = this const _this = this
if (file === undefined || file == null) { if (file === undefined || file == null) {
...@@ -1204,6 +1242,7 @@ export default { ...@@ -1204,6 +1242,7 @@ export default {
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
customClass: 'myLoading' customClass: 'myLoading'
}) })
console.log('file', file)
var formData = new FormData() // 当前为空 var formData = new FormData() // 当前为空
formData.append('type', type) formData.append('type', type)
formData.append('chapterId', _this.resForm.businessId) formData.append('chapterId', _this.resForm.businessId)
...@@ -1211,7 +1250,7 @@ export default { ...@@ -1211,7 +1250,7 @@ export default {
formData.append('lessonId', _this.lessonId) formData.append('lessonId', _this.lessonId)
uploadVideo(formData).then(res => { uploadVideo(formData).then(res => {
loading.close() loading.close()
if (res.code === 200 && _this.progress === 100) { if (res.code === 200) {
_this.success(res) _this.success(res)
_this.resForm.resView = false _this.resForm.resView = false
_this.resForm.filelist = [] _this.resForm.filelist = []
......
...@@ -1023,10 +1023,17 @@ export default { ...@@ -1023,10 +1023,17 @@ export default {
} }
</script> </script>
<style> <style lang="scss" scoped>
#courseManage{ #courseManage{
/*width:calc(100% - 30px);*/ /*width:calc(100% - 30px);*/
/*height:calc(100% - 60px);*/ /*height:calc(100% - 60px);*/
::v-deep .el-table th .cell{
justify-content: center!important;
}
::v-deep .el-table td .cell{
margin: 10px;
text-align: center!important;
}
} }
#courseManage .el-select{ #courseManage .el-select{
width: 100%; width: 100%;
......
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