|
|
|
@ -24,7 +24,7 @@ |
|
|
|
|
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="请输入资源名称、章节" suffix-icon="el-icon-search" v-model="form.keyword" clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
@ -32,13 +32,13 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>资源类型:</label> |
|
|
|
|
<el-select v-model="form.platformSource" clearable @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<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> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>编辑人:</label> |
|
|
|
|
<el-select v-model="form.releaseType" clearable @change="initData"> |
|
|
|
|
<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-select> |
|
|
|
|
</li> |
|
|
|
@ -49,18 +49,26 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table ref="table" :data="matchData" class="table" header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id"> |
|
|
|
|
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<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 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 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"> |
|
|
|
|
<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> |
|
|
|
|
</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 label="操作" align="center" width="180"> |
|
|
|
@ -143,7 +151,9 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import SourceConst from '@/const/source' |
|
|
|
|
import Pdf from '@/components/pdf' |
|
|
|
|
import Upload from './upload' |
|
|
|
|
export default { |
|
|
|
@ -157,20 +167,7 @@ export default { |
|
|
|
|
tab3: '文件素材', |
|
|
|
|
}, |
|
|
|
|
timer: null, |
|
|
|
|
sourceList: [ |
|
|
|
|
{ |
|
|
|
|
id: null, |
|
|
|
|
name: "不限" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: "平台创建" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: "院校创建" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
types: SourceConst.types, |
|
|
|
|
releaseTypes: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
@ -231,17 +228,14 @@ export default { |
|
|
|
|
name: '已发布' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
matchData: [], |
|
|
|
|
list: [], |
|
|
|
|
form: { |
|
|
|
|
keyWord: null, |
|
|
|
|
month: '', |
|
|
|
|
startTime: null, |
|
|
|
|
endTime: null, |
|
|
|
|
releaseType: '', |
|
|
|
|
publishStatus: '', |
|
|
|
|
competitionType: '', |
|
|
|
|
platformSource: 0, // 大赛来源(0中台,1职站) |
|
|
|
|
competitionScope: null, // 大赛范围(0:本校内 1:全平台 2.指定区域、院校) |
|
|
|
|
keyword: '', |
|
|
|
|
startTime: '', |
|
|
|
|
endTime: '', |
|
|
|
|
resourceType: '', |
|
|
|
|
editor: '', |
|
|
|
|
}, |
|
|
|
|
multipleSelection: [], |
|
|
|
|
dateList: [ |
|
|
|
@ -320,31 +314,14 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
'form.keyWord': function (val) { |
|
|
|
|
'form.keyword': function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
}, 500); |
|
|
|
|
this.initData() |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
const { query } = this.$route |
|
|
|
|
if (query.page) { |
|
|
|
|
const { keyWord, month, startTime, endTime, platformSource, competitionScope, competitionType, publishStatus, releaseType } = query |
|
|
|
|
this.form = { |
|
|
|
|
keyWord: keyWord || null, |
|
|
|
|
month: +month || '', |
|
|
|
|
startTime: startTime || null, |
|
|
|
|
endTime: endTime || null, |
|
|
|
|
competitionType: competitionType || '', |
|
|
|
|
publishStatus: publishStatus || '', |
|
|
|
|
releaseType: releaseType || '', |
|
|
|
|
platformSource: platformSource === 'null' ? null : (+platformSource || 0), // 大赛来源(0中台,1职站) |
|
|
|
|
competitionScope: competitionScope ? +competitionScope : null, // 大赛范围(0:本校内 1:全平台 2.指定区域、院校) |
|
|
|
|
} |
|
|
|
|
this.$router.push('/match').catch(() => { }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -352,21 +329,15 @@ export default { |
|
|
|
|
this.loading = true |
|
|
|
|
try { |
|
|
|
|
const { form } = this |
|
|
|
|
const { data } = await this.$post(this.api.CompetitionPageConditionQueryByNakadai, { |
|
|
|
|
const { page } = await this.$post(this.api.paginatedFootagesList, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
platformId: Setting.platformId, |
|
|
|
|
...form |
|
|
|
|
}) |
|
|
|
|
this.matchData = data.records |
|
|
|
|
|
|
|
|
|
this.total = data.total |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.loading = false |
|
|
|
|
if (!this.matchData.length && this.total) { |
|
|
|
|
this.page-- |
|
|
|
|
this.getData() |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
this.list = page.records |
|
|
|
|
this.total = page.total |
|
|
|
|
} finally { |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -402,21 +373,19 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
|
delAllSelection () { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
if (list.length) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id); |
|
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => { |
|
|
|
|
this.getData(); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.$post(this.api.resourceDel, list.map(e => e.id)).then(res => { |
|
|
|
|
this.getData() |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning("请先选择赛事 !"); |
|
|
|
|
this.$message.warning("请先选择赛事 !") |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -447,9 +416,14 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else { |
|
|
|
|
this.downloadFile(row.name + '.' + row.fileType, row.fileUrl) |
|
|
|
|
this.downloadFile(row.originalFileName, row.fileUrl) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
transferType (ext) { |
|
|
|
|
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; |
|
|
|
|
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; |
|
|
|
|
return ext; |
|
|
|
|
}, |
|
|
|
|
preview (row) { |
|
|
|
|
if (this.transferType(row.fileType) == "视频") { |
|
|
|
|
// 阿里云视频点播 |
|
|
|
@ -503,17 +477,14 @@ export default { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.iframeOnload(); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
}); |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
del (row) { |
|
|
|
|
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { |
|
|
|
|
row.fileUrl && Oss.del(row.fileUrl) |
|
|
|
|
this.$post(this.api.resourceDel, [row.id]).then(res => { |
|
|
|
|
this.$message.success("删除成功") |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|