|
|
|
@ -1,8 +1,8 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="page" style="padding-top: 0;" v-loading="loading"> |
|
|
|
|
<div class="tabs mgb20"> |
|
|
|
|
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{ item |
|
|
|
|
}}</a> |
|
|
|
|
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: item.id == active }" |
|
|
|
|
@click="tabChange(item.id)">{{ item.name }}</a> |
|
|
|
|
</div> |
|
|
|
|
<div class="tool mul"> |
|
|
|
|
<ul class="filter"> |
|
|
|
@ -24,27 +24,38 @@ |
|
|
|
|
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<el-input placeholder="请输入资源名称、章节" suffix-icon="el-icon-search" v-model="form.keyword" clearable></el-input> |
|
|
|
|
<el-input :placeholder="`请输入资源名称、${active === 2 ? '描述' : '章节'}`" suffix-icon="el-icon-search" |
|
|
|
|
v-model="form.keyword" clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
<div class="tool mul"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li v-if="active !== 2"> |
|
|
|
|
<label>课程:</label> |
|
|
|
|
<el-select v-if="!active" v-model="form.resourceType" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in courses" :key="i" :label="item.curriculumName" :value="item.cid"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-select v-else v-model="form.resourceType" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in theoreticalCourses" :key="i" :label="item.courseName" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>资源类型:</label> |
|
|
|
|
<el-select v-model="form.resourceType" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.displayFileType" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.name"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>编辑人:</label> |
|
|
|
|
<el-select v-model="form.editor" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in releaseTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="uploadFile">上传文件</el-button> |
|
|
|
|
<el-button v-if="active === 2" type="primary" @click="uploadFile">上传文件</el-button> |
|
|
|
|
<el-button type="primary" @click="delAllSelection">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -58,19 +69,20 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="resourceName" min-width="160" label="资源名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="resourceType" min-width="160" label="资源类型" align="center"></el-table-column> |
|
|
|
|
<template v-if="active === 'tab3'"> |
|
|
|
|
<el-table-column prop="resourceDescription" min-width="160" label="资源描述" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" min-width="160" label="是否被引用" align="center"> |
|
|
|
|
<el-table-column prop="displayFileType" width="90" label="资源类型" align="center"></el-table-column> |
|
|
|
|
<template v-if="active === 2"> |
|
|
|
|
<el-table-column key="1" prop="resourceDescription" min-width="160" label="资源描述" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column key="2" prop="name" width="100" label="是否被引用" align="center"> |
|
|
|
|
<template slot-scope="scope">{{ scope.row.isReferenced ? '是' : '否' }}</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-table-column prop="name" min-width="160" label="课程名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" min-width="160" label="章节" align="center"></el-table-column> |
|
|
|
|
<el-table-column key="3" prop="curriculumName" min-width="160" label="课程名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column key="4" prop="chapterSubsection" min-width="160" label="章节" align="center"></el-table-column> |
|
|
|
|
</template> |
|
|
|
|
<el-table-column prop="createTime" label="入库时间" align="center" width="160"></el-table-column> |
|
|
|
|
<el-table-column prop="founderName" label="编辑人" width="130" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="editor" label="编辑人" width="130" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
@ -114,7 +126,7 @@ |
|
|
|
|
style="z-index: 2000"> |
|
|
|
|
<div class="el-image-viewer__mask"></div> |
|
|
|
|
<span class="el-image-viewer__btn el-image-viewer__close" :class="{ 'doc-close': isWord }" |
|
|
|
|
:style="{ top: isWord ? '50px' : '5px' }" @click="closeIframe"><i class="el-icon-circle-close" |
|
|
|
|
:style="{ top: isWord ? '50px' : '15px' }" @click="closeIframe"><i class="el-icon-circle-close" |
|
|
|
|
style="color: #fff"></i></span> |
|
|
|
|
<div class="el-image-viewer__canvas"> |
|
|
|
|
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> |
|
|
|
@ -160,81 +172,32 @@ export default { |
|
|
|
|
components: { Pdf, Upload }, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
active: this.$route.query.type || 'tab1', |
|
|
|
|
tabs: { |
|
|
|
|
tab1: '教学课程', |
|
|
|
|
tab2: '精品课程', |
|
|
|
|
tab3: '文件素材', |
|
|
|
|
}, |
|
|
|
|
timer: null, |
|
|
|
|
types: SourceConst.types, |
|
|
|
|
releaseTypes: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
name: "不限" |
|
|
|
|
}, |
|
|
|
|
active: +this.$route.query.type || 0, |
|
|
|
|
tabs: [ |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '发布信息' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '完整比赛' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
rangeList: [ |
|
|
|
|
{ |
|
|
|
|
id: null, |
|
|
|
|
name: "不限" |
|
|
|
|
name: '教学课程' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: "全平台" |
|
|
|
|
name: '精品课程' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: "指定区域" |
|
|
|
|
name: '文件素材' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: "校内" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
competitionTypes: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
name: '不限' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '个人赛' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '团队赛' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
publishStatus: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
name: '不限' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '未发布' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '已发布' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
timer: null, |
|
|
|
|
types: SourceConst.types, |
|
|
|
|
courses: [], |
|
|
|
|
theoreticalCourses: [], |
|
|
|
|
list: [], |
|
|
|
|
form: { |
|
|
|
|
month: '', |
|
|
|
|
keyword: '', |
|
|
|
|
startTime: '', |
|
|
|
|
endTime: '', |
|
|
|
|
resourceType: '', |
|
|
|
|
displayFileType: '', |
|
|
|
|
editor: '', |
|
|
|
|
}, |
|
|
|
|
multipleSelection: [], |
|
|
|
@ -323,16 +286,18 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.getData() |
|
|
|
|
this.getCourse() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async getData () { |
|
|
|
|
this.loading = true |
|
|
|
|
try { |
|
|
|
|
const { form } = this |
|
|
|
|
const { page } = await this.$post(this.api.paginatedFootagesList, { |
|
|
|
|
const { page } = await this.$post(this.api.resourceLibrary, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
platformId: Setting.platformId, |
|
|
|
|
type: this.active, |
|
|
|
|
...form |
|
|
|
|
}) |
|
|
|
|
this.list = page.records |
|
|
|
@ -341,13 +306,40 @@ export default { |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
tabChange (index) { |
|
|
|
|
this.active = index |
|
|
|
|
// 查询课程 |
|
|
|
|
async getCourse () { |
|
|
|
|
// 教学课程 |
|
|
|
|
if (!this.courses.length) { |
|
|
|
|
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') |
|
|
|
|
const { page } = await this.$post(this.api.curriculumList, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
supplierId: sid ? sid.supplierId : '', |
|
|
|
|
platformId: Setting.platformId |
|
|
|
|
}) |
|
|
|
|
this.courses = page.records |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 精品课程 |
|
|
|
|
if (!this.theoreticalCourses.length) { |
|
|
|
|
const { page } = await this.$post(this.api.listTheoreticalCourse, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
createPlatform: 0, |
|
|
|
|
platformSource: Setting.platformSource, |
|
|
|
|
}) |
|
|
|
|
this.theoreticalCourses = page.records |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
tabChange (id) { |
|
|
|
|
this.active = id |
|
|
|
|
this.initData() |
|
|
|
|
this.getCourse() |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/resourse', |
|
|
|
|
query: { |
|
|
|
|
...this.$route.query, |
|
|
|
|
type: index |
|
|
|
|
type: id |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -375,7 +367,7 @@ export default { |
|
|
|
|
delAllSelection () { |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
if (list.length) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
this.$confirm('删除后用户将无法再查看和使用这些资源,确定删除?', '提示', { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.resourceDel, list.map(e => e.id)).then(res => { |
|
|
|
@ -385,15 +377,15 @@ export default { |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning("请先选择赛事 !") |
|
|
|
|
this.$message.warning("请先选择数据 !") |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
edit (row, chapterId) { |
|
|
|
|
this.chapterId = chapterId; |
|
|
|
|
this.sectionId = row.id; |
|
|
|
|
this.sectionForm.sectionName = row.name; |
|
|
|
|
this.sectionNameVisible = true; |
|
|
|
|
this.chapterId = chapterId |
|
|
|
|
this.sectionId = row.id |
|
|
|
|
this.sectionForm.sectionName = row.name |
|
|
|
|
this.sectionNameVisible = true |
|
|
|
|
}, |
|
|
|
|
// 下载资源 |
|
|
|
|
download (row) { |
|
|
|
|