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

修改

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