赛事相关

dev_review
yujialong 8 months ago
parent 6ba5f44a33
commit 2419a97063
  1. 2
      src/setting.js
  2. 5
      src/views/match/add/step1.vue
  3. 3
      src/views/match/add/step2.vue
  4. 66
      src/views/match/manage/matchSignup.vue
  5. 501
      src/views/theoreticalCourse/preview/index.vue

@ -14,7 +14,7 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520` sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/' host = 'http://192.168.31.51:9000/'
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://judgment.huorantech.cn/' jumpPath = 'https://judgment.huorantech.cn/'
} }

@ -677,8 +677,9 @@ export default {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1 if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1
} }
this.$parent.showLoad() this.$parent.showLoad()
delete form.publishStatus // delete form.publishStatus
if (status === 1) form.publishStatus = 1 // if (status === 1) form.publishStatus = 1
form.publishStatus = status
form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) // form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id form.id = this.$route.query.id

@ -464,9 +464,6 @@ export default {
} else { // 稿 } else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
} }
for (const e of form.competitionStageList) {
if (!e.teamNumLimit) e.customNumber = 0
}
this.$parent.showLoad() this.$parent.showLoad()
if (form.ruleId) { if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {

@ -30,7 +30,11 @@
@click="autoAllocation">自动分配阶段成员</el-button> @click="autoAllocation">自动分配阶段成员</el-button>
<el-button type="primary" <el-button type="primary"
round round
@click="batchImport">导入</el-button> @click="batchImport">
<i v-if="uploading"
class="el-icon-loading"></i>
{{ uploading ? '正在' : '' }}导入
</el-button>
<el-button type="primary" <el-button type="primary"
round round
@click="add" @click="add"
@ -174,6 +178,7 @@
<el-select v-model="form.schoolId" <el-select v-model="form.schoolId"
filterable filterable
:disabled="!isAdd" :disabled="!isAdd"
@change="schoolChange"
style="width: 100%"> style="width: 100%">
<el-option v-for="(item, i) in clients" <el-option v-for="(item, i) in clients"
:key="i" :key="i"
@ -282,6 +287,7 @@
:visible.sync="importVisible" :visible.sync="importVisible"
width="24%" width="24%"
:close-on-click-modal="false" :close-on-click-modal="false"
:modal-append-to-body="false"
@close="cancelUpload"> @close="cancelUpload">
<div style="text-align: center"> <div style="text-align: center">
<template v-if="!uploadFaild"> <template v-if="!uploadFaild">
@ -292,6 +298,8 @@
<el-upload name="file" <el-upload name="file"
accept=".xls,.xlsx" accept=".xls,.xlsx"
ref="upload" ref="upload"
class="import-file"
:before-upload="beforeUpload"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
:on-success="uploadSuccess" :on-success="uploadSuccess"
@ -301,21 +309,32 @@
competitionId: id, competitionId: id,
platformId: 2 platformId: 2
}" }"
:disabled="uploading"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData" :action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
:file-list="uploadList" :file-list="uploadList"
:headers="headers"> :headers="headers">
<el-button type="primary" <el-button type="primary"
:loading="uploading"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
</template> </template>
<template v-else> <template v-else>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ uploadTips }}</p> <p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ uploadTips }}</p>
<a type="primary" <p type="primary"
style="font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;" style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</a> @click="showFaild">部分数据导入失败查看失败原因</p>
<el-button type="primary"
@click="uploadFaild = false">重新上传</el-button>
</template> </template>
</div> </div>
<span v-if="uploading"
slot="footer"
class="dialog-footer">
<el-button @click="cancelUpload">取消上传</el-button>
<el-button type="primary"
@click="backstageUpload">后台上传</el-button>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -412,6 +431,8 @@ export default {
headers: { headers: {
token: sessionStorage.getItem("token") token: sessionStorage.getItem("token")
}, },
uploading: false,
isBackstage: 0,
}; };
}, },
watch: { watch: {
@ -496,9 +517,8 @@ export default {
// //
batchImport () { batchImport () {
this.isBackstage = 0
this.importVisible = true this.importVisible = true
this.uploadList = []
this.uploadFaild = false
}, },
// //
download () { download () {
@ -521,6 +541,7 @@ export default {
}).catch(res => { }) }).catch(res => { })
}, },
uploadSuccess ({ data, status }) { uploadSuccess ({ data, status }) {
this.uploading = false
this.uploadFaild = false this.uploadFaild = false
this.uploadTips = '' this.uploadTips = ''
if (status === 200) { if (status === 200) {
@ -539,12 +560,17 @@ export default {
} }
}, },
uploadError (err, file, fileList) { uploadError (err, file, fileList) {
console.log("🚀 ~ uploadError ~ err:", err)
this.uploading = false
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}) })
}, },
beforeUpload (file) {
this.uploading = true
},
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
}, },
@ -553,14 +579,19 @@ export default {
this.uploadFaild = false this.uploadFaild = false
}, },
cancelUpload () { cancelUpload () {
this.$refs.upload.abort() if (!this.isBackstage) {
this.init() this.uploadList = []
this.importVisible = false this.$refs.upload.abort()
this.keyWord = '' this.uploading = false
this.init()
this.importVisible = false
this.keyWord = ''
}
}, },
uploadSure () { //
backstageUpload () {
this.isBackstage = 1
this.importVisible = false this.importVisible = false
this.keyWord = ''
}, },
// //
add () { add () {
@ -589,6 +620,10 @@ export default {
}).catch(res => { }); }).catch(res => { });
}).catch(() => { }); }).catch(() => { });
}, },
//
schoolChange () {
if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId
},
// //
workNumberChange () { workNumberChange () {
const { form } = this const { form } = this
@ -833,4 +868,11 @@ export default {
font-size: 12px; font-size: 12px;
color: #e90000; color: #e90000;
} }
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style> </style>

@ -1,76 +1,111 @@
<template> <template>
<!-- 课程预览 --> <!-- 课程预览 -->
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover"
<div class="flex-between"> class="m-b-20">
<el-page-header @back="goBack" :content="'课程预览'"></el-page-header> <div class="flex-between">
<el-page-header @back="goBack"
:content="'课程预览'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20"
style="background: none;">
<div class="flex">
<div class="cover"
:class="{'is-word': showMask1}">
<img v-if="coverUrl"
:src="coverUrl"
alt=""
width="100%"
height="100%">
<template v-else-if="iframeSrc">
<iframe class="inner fileIframe"
id="fileIframe"
:src="iframeSrc"
frameborder="0"></iframe>
<template v-if="showMask">
<div class="mask"
style="width: 500px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask"
style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
</template>
<template v-if="showMask1">
<div class="word-mask"
style="height: 40px;"></div>
<div class="word-mask2"
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template>
<template v-if="showMask2">
<div class="excel-mask1"
style="height: 48px;"></div>
</template>
</template>
<div class="pdf inner"
v-else-if="pdfSrc">
<p class="arrow">
<span @click="changePdfPage(0)"
class="turn el-icon-arrow-left"
:class="{grey: currentPage==1}"></span>
{{ currentPage }} / {{ pageCount }}
<span @click="changePdfPage(1)"
class="turn el-icon-arrow-right"
:class="{grey: currentPage==pageCount}"></span>
</p>
<pdf class="pdf-wrap"
:src="pdfSrc"
:page="currentPage"
@num-pages="pageCount=$event"
@page-loaded="currentPage=$event"
@loaded="loadPdfHandler">
</pdf>
</div>
<div class="inner"
v-else-if="playAuth">
<div class="video_wid"
id="player"></div>
</div>
</div>
<div class="catalog flex-1">
<div class="list">
<h4 class="title">{{ courseName }}</h4>
<div class="desc-wrap">
<div class="desc"
:class="{active: desShrink}"
v-html="description"></div>
<i class="arrow"
:class="{active: desShrink}"
v-if="description.length > 40">
<span>...</span>
<img src="@/assets/img/arrow-down.png"
alt=""
@click="desShrink = !desShrink">
</i>
</div> </div>
</el-card> <div class="chapters">
<template v-if="videoList.length">
<el-card shadow="hover" class="m-b-20" style="background: none;"> <div class="chapter"
<div class="flex"> v-for="(item,index) in videoList"
<div class="cover" :class="{'is-word': showMask1}"> :key="index">
<img v-if="coverUrl" :src="coverUrl" alt="" width="100%" height="100%"> <div class="chapterName">{{ item.name }}</div>
<template v-else-if="iframeSrc"> <div class="section"
<iframe class="inner fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> v-if="item.subsectionList.length">
<template v-if="showMask"> <div v-for="(section,i) in item.subsectionList"
<div class="mask" style="width: 500px;height: 30px;top: 53px;right: 320px"></div> :key="i"
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> @click="preview(section, item.name)">
</template> <p class="sectionName"
<template v-if="showMask1"> :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p>
<div class="word-mask" style="height: 40px;"></div>
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template>
<template v-if="showMask2">
<div class="excel-mask1" style="height: 48px;"></div>
</template>
</template>
<div class="pdf inner" v-else-if="pdfSrc">
<p class="arrow">
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span>
{{ currentPage }} / {{ pageCount }}
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span>
</p>
<pdf
class="pdf-wrap"
:src="pdfSrc"
:page="currentPage"
@num-pages="pageCount=$event"
@page-loaded="currentPage=$event"
@loaded="loadPdfHandler">
</pdf>
</div>
<div class="inner" v-else-if="playAuth">
<div class="video_wid" id="player"></div>
</div>
</div>
<div class="catalog flex-1">
<div class="list">
<h4 class="title">{{ courseName }}</h4>
<div class="desc-wrap">
<div class="desc" :class="{active: desShrink}" v-html="description"></div>
<i class="arrow" :class="{active: desShrink}" v-if="description.length > 40">
<span>...</span>
<img src="@/assets/img/arrow-down.png" alt="" @click="desShrink = !desShrink">
</i>
</div>
<div class="chapters">
<template v-if="videoList.length">
<div class="chapter" v-for="(item,index) in videoList" :key="index">
<div class="chapterName">{{ item.name }}</div>
<div class="section" v-if="item.subsectionList.length">
<div v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)">
<p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p>
</div>
</div>
</div>
</template>
</div>
</div> </div>
</div>
</div> </div>
</template>
</div> </div>
</el-card> </div>
</div> </div>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
@ -82,177 +117,178 @@ import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css"; import "quill/dist/quill.bubble.css";
export default { export default {
name: "coursePreview", name: "coursePreview",
data() { data () {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4",
videoSrc: "", videoSrc: "",
videoList: [], videoList: [],
courseName: "", courseName: "",
description: "", description: "",
coverUrl: "", coverUrl: "",
playAuth: "", playAuth: "",
player: null, player: null,
previewImg: "", previewImg: "",
iframeSrc: "", iframeSrc: "",
isWord: false, isWord: false,
isPPT: false, isPPT: false,
isExcel: false, isExcel: false,
showMask: false, showMask: false,
showMask1: false, showMask1: false,
showMask2: false, showMask2: false,
closePosi: { closePosi: {
top: "80px" top: "80px"
}, },
pdfVisible: false, pdfVisible: false,
pdfSrc: "", pdfSrc: "",
currentPage: 0, // pdf currentPage: 0, // pdf
pageCount: 0, // pdf pageCount: 0, // pdf
fileType: "pdf", // fileType: "pdf", //
desShrink: false, desShrink: false,
curLink: "", // curLink: "", //
}; };
},
components: { pdf },
mounted () {
this.insertScript();
this.getData();
this.getChapter();
},
methods: {
goBack () {
this.$router.back();
},
async getData () {
let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`);
this.courseName = res.data.courseName;
this.description = res.data.courseIntroduction;
this.coverUrl = res.data.coverUrl;
}, },
components: { pdf }, async getChapter () {
mounted() { let res = await this.$get(`${this.api.queryChaptersTheoretical}?courseId=${this.id}`);
this.insertScript(); this.videoList = res.chapterList;
this.getData();
this.getChapter();
}, },
methods: { insertScript () {
goBack() { const linkTag = document.createElement("link");
this.$router.back(); linkTag.rel = "stylesheet";
}, linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
async getData() { document.body.appendChild(linkTag);
let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`);
this.courseName = res.data.courseName; const scriptTag = document.createElement("script");
this.description = res.data.courseIntroduction; scriptTag.type = "text/javascript";
this.coverUrl = res.data.coverUrl; scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
}, document.body.appendChild(scriptTag);
async getChapter() { },
let res = await this.$get(`${this.api.queryChapters}?courseId=${this.id}`); transferType (ext) {
this.videoList = res.chapterList; 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 "视频";
insertScript() { return ext;
const linkTag = document.createElement("link"); },
linkTag.rel = "stylesheet"; preview (row, chapterName) {
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; this.curLink = `${chapterName}${row.name}`;
document.body.appendChild(linkTag); this.player = null;
this.playauth = "";
const scriptTag = document.createElement("script"); this.coverUrl = "";
scriptTag.type = "text/javascript"; this.pdfSrc = "";
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; this.iframeSrc = "";
document.body.appendChild(scriptTag); if (this.transferType(row.fileType) == "视频") {
}, this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
transferType(ext) { this.playAuth = res.data.playAuth;
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; this.$nextTick(() => {
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; if (this.player) {
return ext; this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
},
preview(row, chapterName) {
this.curLink = `${chapterName}${row.name}`;
this.player = null;
this.playauth = "";
this.coverUrl = "";
this.pdfSrc = "";
this.iframeSrc = "";
if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
this.$nextTick(() => {
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {
this.player = new Aliplayer({
id: "player",
width: "100%",
autoplay: false,
vid: row.fileId,
playauth: this.playAuth,
encryptType: 1 //
});
}
});
}).catch(res => {
});
} else if (this.transferType(row.fileType) == "图片") {
this.coverUrl = row.fileUrl;
} else if (row.fileType == "pdf") {
this.pdfSrc = row.fileUrl;
this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.getSubsection}?subsectionId=${row.id}`).then(res => { this.player = new Aliplayer({
if (row.fileType == "pptx") { id: "player",
this.isPPT = true; width: "100%",
this.isWord = false; autoplay: false,
this.isExcel = false; vid: row.fileId,
} else if (row.fileType == "doc" || row.fileType == "docx") { playauth: this.playAuth,
this.isPPT = false; encryptType: 1 //
this.isWord = true; });
this.isExcel = false;
} else if (row.fileType == "xls" || row.fileType == "xlsx") {
this.isExcel = true;
this.isPPT = false;
this.isWord = false;
} else {
this.isPPT = false;
this.isWord = false;
this.isExcel = false;
}
if (this.isPPT) {
this.showMask = true;
} else {
this.showMask = false;
}
if (this.isWord) {
this.showMask1 = true;
} else {
this.showMask1 = false;
}
if (this.isExcel) {
this.showMask2 = true;
} else {
this.showMask2 = false;
}
this.iframeSrc = res.previewUrl;
})
.catch(err => {
});
} }
}, });
closePlayer() {
this.playAuth = ""; }).catch(res => {
this.player.pause(); });
}, } else if (this.transferType(row.fileType) == "图片") {
closeIframe() { this.coverUrl = row.fileUrl;
this.iframeSrc = ""; } else if (row.fileType == "pdf") {
this.pdfSrc = row.fileUrl;
this.pdfVisible = true;
} else {
this.$get(`${this.api.getSubsection}?subsectionId=${row.id}`).then(res => {
if (row.fileType == "pptx") {
this.isPPT = true;
this.isWord = false;
this.isExcel = false;
} else if (row.fileType == "doc" || row.fileType == "docx") {
this.isPPT = false;
this.isWord = true;
this.isExcel = false;
} else if (row.fileType == "xls" || row.fileType == "xlsx") {
this.isExcel = true;
this.isPPT = false;
this.isWord = false;
} else {
this.isPPT = false;
this.isWord = false;
this.isExcel = false;
}
if (this.isPPT) {
this.showMask = true;
} else {
this.showMask = false; this.showMask = false;
}
if (this.isWord) {
this.showMask1 = true;
} else {
this.showMask1 = false; this.showMask1 = false;
}, }
closePdf() { if (this.isExcel) {
this.pdfSrc = ""; this.showMask2 = true;
this.currentPage = 1; } else {
}, this.showMask2 = false;
changePdfPage(val) { }
if (val === 0 && this.currentPage > 1) { this.iframeSrc = res.previewUrl;
this.currentPage--; })
} .catch(err => {
if (val === 1 && this.currentPage < this.pageCount) { });
this.currentPage++; }
} },
}, closePlayer () {
loadPdfHandler(e) { this.playAuth = "";
this.currentPage = 1; this.player.pause();
} },
closeIframe () {
this.iframeSrc = "";
this.showMask = false;
this.showMask1 = false;
},
closePdf () {
this.pdfSrc = "";
this.currentPage = 1;
},
changePdfPage (val) {
if (val === 0 && this.currentPage > 1) {
this.currentPage--;
}
if (val === 1 && this.currentPage < this.pageCount) {
this.currentPage++;
}
},
loadPdfHandler (e) {
this.currentPage = 1;
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 700px; $height: 700px;
.video_wid, .cover { .video_wid,
.cover {
position: relative; position: relative;
width: 76%; width: 76%;
max-width: 1400px; max-width: 1400px;
@ -274,7 +310,8 @@ $height: 700px;
height: $height !important; height: $height !important;
} }
.video_wid, .inner { .video_wid,
.inner {
width: 100%; width: 100%;
height: 100% !important; height: 100% !important;
border: 0; border: 0;
@ -378,8 +415,8 @@ $height: 700px;
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
cursor: pointer; cursor: pointer;
&.active{ &.active {
color: #9278FF; color: #9278ff;
} }
} }
} }
@ -388,10 +425,10 @@ $height: 700px;
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform 0.5s;
&.active { &.active {
transform: translateY(0) transform: translateY(0);
} }
} }

Loading…
Cancel
Save