|
|
|
@ -31,7 +31,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="tool mul"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li v-if="active !== 2"> |
|
|
|
|
<li v-if="!active"> |
|
|
|
|
<label>课程:</label> |
|
|
|
|
<el-select v-if="!active" v-model="form.cid" filterable clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in courses" :key="i" :label="item.curriculumName" :value="item.cid"></el-option> |
|
|
|
@ -47,12 +47,12 @@ |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.name"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<!-- <li> |
|
|
|
|
<label>编辑人:</label> |
|
|
|
|
<el-select v-model="form.editor" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
</li> --> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-if="active === 2" type="primary" @click="uploadFile">上传文件</el-button> |
|
|
|
@ -98,21 +98,6 @@ |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="修改资源名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false"> |
|
|
|
|
<el-form @submit.native.prevent> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入资源名称" v-model="sectionForm.sectionName" maxlength="50" |
|
|
|
|
@keyup.enter.native="sectionNameSubmit()"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="sectionNameVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="sectionNameSubmit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{ active: previewImg }" style="z-index: 2000"> |
|
|
|
|
<div class="el-image-viewer__mask"></div> |
|
|
|
|
<span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i class="el-icon-circle-close" |
|
|
|
@ -158,7 +143,7 @@ |
|
|
|
|
<Pdf :visible.sync="pdfVisible" :src.sync="pdfSrc" /> |
|
|
|
|
<div class="player-download" id="playerDownload"></div> |
|
|
|
|
|
|
|
|
|
<Upload :visible.sync="uploadVisible" /> |
|
|
|
|
<Upload :visible.sync="uploadVisible" :row.sync="curRow" /> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -225,14 +210,11 @@ export default { |
|
|
|
|
pageSize: 10, |
|
|
|
|
total: 0, |
|
|
|
|
modifyVisible: false, |
|
|
|
|
curRow: { |
|
|
|
|
playingStages: [] |
|
|
|
|
}, |
|
|
|
|
curRow: null, |
|
|
|
|
loading: false, |
|
|
|
|
now: '', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sectionNameVisible: false, |
|
|
|
|
sectionForm: { |
|
|
|
|
sectionName: '' |
|
|
|
|
}, |
|
|
|
@ -243,8 +225,6 @@ export default { |
|
|
|
|
player: null, |
|
|
|
|
previewImg: "", |
|
|
|
|
iframeSrc: "", |
|
|
|
|
curFile: {}, |
|
|
|
|
isAddSection: false, |
|
|
|
|
isWord: false, |
|
|
|
|
isPPT: false, |
|
|
|
|
isExcel: false, |
|
|
|
@ -321,15 +301,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 精品课程 |
|
|
|
|
if (!this.theoreticalCourses.length) { |
|
|
|
|
const { page } = await this.$post(this.api.listTheoreticalCourse, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
createPlatform: 1, |
|
|
|
|
platformSource: Setting.platformSource, |
|
|
|
|
}) |
|
|
|
|
this.theoreticalCourses = page.records |
|
|
|
|
} |
|
|
|
|
// if (!this.theoreticalCourses.length) { |
|
|
|
|
// const { page } = await this.$post(this.api.listTheoreticalCourse, { |
|
|
|
|
// pageNum: 1, |
|
|
|
|
// pageSize: 1000, |
|
|
|
|
// createPlatform: 1, |
|
|
|
|
// platformSource: Setting.platformSource, |
|
|
|
|
// }) |
|
|
|
|
// this.theoreticalCourses = page.records |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
tabChange (id) { |
|
|
|
|
this.active = id |
|
|
|
@ -346,7 +326,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
changeType () { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.initData(); |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
@ -362,6 +342,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
uploadFile () { |
|
|
|
|
this.curRow = null |
|
|
|
|
this.uploadVisible = true |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
@ -370,23 +351,33 @@ export default { |
|
|
|
|
if (list.length) { |
|
|
|
|
this.$confirm('删除后用户将无法再查看和使用这些资源,确定删除?', '提示', { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.resourceDel, list.map(e => e.id)).then(res => { |
|
|
|
|
this.getData() |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}).then(async () => { |
|
|
|
|
const ids = list.map(e => e.id) |
|
|
|
|
const tab = this.active |
|
|
|
|
if (!tab) { |
|
|
|
|
// 教学课程 |
|
|
|
|
await this.$post(this.api.deleteSubsectionBatch, { |
|
|
|
|
subsectionIds: ids |
|
|
|
|
}) |
|
|
|
|
} else if (tab === 1) { |
|
|
|
|
// 精品课程 |
|
|
|
|
await this.$post(this.api.batchDeletionTheoretical, ids) |
|
|
|
|
} else { |
|
|
|
|
// 文件素材 |
|
|
|
|
await this.$post(this.api.resourceDel, ids) |
|
|
|
|
} |
|
|
|
|
this.getData() |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning("请先选择数据 !") |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
edit (row, chapterId) { |
|
|
|
|
this.chapterId = chapterId |
|
|
|
|
this.sectionId = row.id |
|
|
|
|
this.sectionForm.sectionName = row.name |
|
|
|
|
this.sectionNameVisible = true |
|
|
|
|
edit (row) { |
|
|
|
|
this.curRow = row |
|
|
|
|
this.uploadVisible = true |
|
|
|
|
}, |
|
|
|
|
// 下载资源 |
|
|
|
|
download (row) { |
|
|
|
@ -507,11 +498,23 @@ export default { |
|
|
|
|
del (row) { |
|
|
|
|
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.resourceDel, [row.id]).then(res => { |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).then(async () => { |
|
|
|
|
const tab = this.active |
|
|
|
|
if (!tab) { |
|
|
|
|
// 教学课程 |
|
|
|
|
await this.$post(this.api.deleteSubsectionBatch, { |
|
|
|
|
chapterId: row.chapterId, |
|
|
|
|
subsectionIds: [row.id] |
|
|
|
|
}) |
|
|
|
|
} else if (tab === 1) { |
|
|
|
|
// 精品课程 |
|
|
|
|
await this.$post(this.api.batchDeletionTheoretical, [row.id]) |
|
|
|
|
} else { |
|
|
|
|
// 文件素材 |
|
|
|
|
await this.$post(this.api.resourceDel, [row.id]) |
|
|
|
|
} |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
sectionNameSubmit () { |
|
|
|
|