赛事相关

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`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/'
host = 'http://192.168.31.51:9000/'
} else if (isPro) {
jumpPath = 'https://judgment.huorantech.cn/'
}

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

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

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

@ -1,76 +1,111 @@
<template>
<!-- 课程预览 -->
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="'课程预览'"></el-page-header>
<!-- 课程预览 -->
<div>
<el-card shadow="hover"
class="m-b-20">
<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>
</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 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 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>
</el-card>
</div>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
@ -82,177 +117,178 @@ import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
export default {
name: "coursePreview",
data() {
return {
id: this.$route.query.id,
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4",
videoSrc: "",
videoList: [],
courseName: "",
description: "",
coverUrl: "",
playAuth: "",
player: null,
previewImg: "",
iframeSrc: "",
isWord: false,
isPPT: false,
isExcel: false,
showMask: false,
showMask1: false,
showMask2: false,
closePosi: {
top: "80px"
},
pdfVisible: false,
pdfSrc: "",
currentPage: 0, // pdf
pageCount: 0, // pdf
fileType: "pdf", //
desShrink: false,
curLink: "", //
};
name: "coursePreview",
data () {
return {
id: this.$route.query.id,
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4",
videoSrc: "",
videoList: [],
courseName: "",
description: "",
coverUrl: "",
playAuth: "",
player: null,
previewImg: "",
iframeSrc: "",
isWord: false,
isPPT: false,
isExcel: false,
showMask: false,
showMask1: false,
showMask2: false,
closePosi: {
top: "80px"
},
pdfVisible: false,
pdfSrc: "",
currentPage: 0, // pdf
pageCount: 0, // pdf
fileType: "pdf", //
desShrink: false,
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 },
mounted() {
this.insertScript();
this.getData();
this.getChapter();
async getChapter () {
let res = await this.$get(`${this.api.queryChaptersTheoretical}?courseId=${this.id}`);
this.videoList = res.chapterList;
},
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;
},
async getChapter() {
let res = await this.$get(`${this.api.queryChapters}?courseId=${this.id}`);
this.videoList = res.chapterList;
},
insertScript() {
const linkTag = document.createElement("link");
linkTag.rel = "stylesheet";
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
document.body.appendChild(linkTag);
const scriptTag = document.createElement("script");
scriptTag.type = "text/javascript";
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
document.body.appendChild(scriptTag);
},
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, 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;
insertScript () {
const linkTag = document.createElement("link");
linkTag.rel = "stylesheet";
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
document.body.appendChild(linkTag);
const scriptTag = document.createElement("script");
scriptTag.type = "text/javascript";
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
document.body.appendChild(scriptTag);
},
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, 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.$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;
}
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 => {
});
this.player = new Aliplayer({
id: "player",
width: "100%",
autoplay: false,
vid: row.fileId,
playauth: this.playAuth,
encryptType: 1 //
});
}
},
closePlayer() {
this.playAuth = "";
this.player.pause();
},
closeIframe() {
this.iframeSrc = "";
});
}).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 {
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;
}
if (this.isWord) {
this.showMask1 = true;
} else {
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;
}
}
if (this.isExcel) {
this.showMask2 = true;
} else {
this.showMask2 = false;
}
this.iframeSrc = res.previewUrl;
})
.catch(err => {
});
}
},
closePlayer () {
this.playAuth = "";
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>
<style lang="scss" scoped>
$height: 700px;
.video_wid, .cover {
.video_wid,
.cover {
position: relative;
width: 76%;
max-width: 1400px;
@ -274,7 +310,8 @@ $height: 700px;
height: $height !important;
}
.video_wid, .inner {
.video_wid,
.inner {
width: 100%;
height: 100% !important;
border: 0;
@ -378,8 +415,8 @@ $height: 700px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
cursor: pointer;
&.active{
color: #9278FF;
&.active {
color: #9278ff;
}
}
}
@ -388,10 +425,10 @@ $height: 700px;
.el-image-viewer__wrapper {
transform: translateY(-10px);
transition: transform .5s;
transition: transform 0.5s;
&.active {
transform: translateY(0)
transform: translateY(0);
}
}

Loading…
Cancel
Save