添加websocket(赛事、创业)

alioss
yujialong 2 years ago
parent 48ec1e6c3b
commit 9fcff50232
  1. 1
      src/api/index.js
  2. 53
      src/layouts/header/index.vue
  3. 27
      src/pages/activity/list/index.vue
  4. 37
      src/pages/activity/manage/list/index.vue
  5. 172
      src/pages/ass/list/index.vue
  6. 5
      src/pages/match/details/index.vue
  7. 219
      src/pages/match/list/index.vue
  8. 2
      src/pages/station/preview/index.vue

@ -17,6 +17,7 @@ export default {
deleteProfile : `users/users/userInfo/deleteProfile`,
getUserRolesPermissionMenu: `${host}users/users/user-role/getUserRolesPermissionMenu`,
fileUploadNakadai: `${host}nakadai/nakadai/oss/fileUpload`,
refreshPageNotification : `nakadai/message/refreshPageNotification`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,

@ -71,6 +71,7 @@ import Setting from "@/setting";
import util from "@/libs/util";
import navbar from "../navbar";
import axios from 'axios'
import Bus from '@/libs/bus'
export default {
data () {
return {
@ -97,7 +98,6 @@ export default {
this.getUserInfo();
this.getNotice()
}
this.$once('hook:beforeDestroy', function () {
clearInterval(this.noticeTimer)
})
@ -118,25 +118,66 @@ export default {
}
}).catch(res => { });
},
// socket
open () {
console.log("socket连接成功");
},
// socket
error () {
console.log("连接错误");
},
//
getMessage (msg) {
console.log("==websocket接收数据==");
console.log(JSON.parse(msg.data));
const { content } = JSON.parse(msg.data)
// 1234-id
if (content == 1) {
Bus.$emit('matchSocket')
} else if (content == 2) {
Bus.$emit('activitySocket')
} else if (content == 4) {
Bus.$emit('modelSocket')
} else {
this.getNotice()
}
},
// socket
close () {
console.log("socket已经关闭");
},
initSocket ({ id, account }) {
// socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket
this.socket.onopen = this.open;
// socket
this.socket.onerror = this.error;
// socket
this.socket.onmessage = this.getMessage;
},
//
getNotice () {
if (!Setting.isDev) {
this.noticeTimer = setInterval(() => {
this.$get(this.api.messageNotificationList, {
type: 2
}).then(res => {
this.notices = res.notificationList
}).catch(res => { });
}, 5000)
}
},
//
toComment (item) {
async toComment (item) {
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${item.notifyId}`) //
this.$router.push(`/station/preview?courseId=${item.cid}&commentId=${item.commentId}&notifyId=${item.notifyId}`)
},
//
getUserInfo () {
this.$get(this.api.queryUserInfoDetails).then(res => {
this.initSocket(res.result.userAccount)
const { userAvatars, userName, userId } = res.result.hrUserInfo || {}
userAvatars && this.setAvatar(userAvatars);
this.setUserId(userId)

@ -141,11 +141,11 @@ import { mapState, mapMutations } from "vuex";
import { Loading } from "element-ui";
import Setting from "@/setting"
import util from "@/libs/util"
import Bus from '@/libs/bus'
export default {
data () {
return {
timer: null,
redisTimer: null,
token: util.local.get(Setting.tokenKey),
statusList: ["待报名", "取消报名", "马上报名", "报名截止", "已结束"],
endList: ["报名开始", "报名截止", "报名截止", "项目开始", "项目结束"],
@ -200,17 +200,21 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('activitySocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
this.clearTimer()
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('match', [
'SET_TYPE'
]),
getList () {
getData () {
this.clearTimer()
const { form } = this
const data = {
@ -281,27 +285,10 @@ export default {
})
this.timerList = []
},
getData () {
// this.loadIns = Loading.service()
this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
initData () {
this.page = 1
this.getData()
},
// redis
getRedis () {
this.$post(this.api.getRedisCacheActivity).then(({ data }) => {
if (data) {
localStorage.getItem('activityTimestampClient') !== data && this.getList() // redis
localStorage.setItem('activityTimestampClient', data)
}
}).catch(res => { })
},
changeType (type) {
const { form } = this
form.competitionScope = 3

@ -155,6 +155,7 @@ import Setting from "@/setting";
import { mapMutations } from "vuex";
import { Loading } from 'element-ui'
import breadcrumb from '@/components/breadcrumb'
import Bus from '@/libs/bus'
export default {
components: { breadcrumb },
data () {
@ -211,7 +212,6 @@ export default {
playingStages: []
},
timer: null,
redisTimer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
@ -249,18 +249,21 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('activitySocket', () => {
this.getData()
})
this.getData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('activity', [
'setPage'
]),
getList () {
// const load = Loading.service()
getData () {
const { form } = this
this.$post(this.api.myActivities, {
pageNum: this.page,
@ -308,33 +311,12 @@ export default {
this.getData()
}
}
}).catch(res => {
// load.close()
})
},
getData () {
this.getList()
}).catch(res => { })
},
initData () {
this.page = 1;
this.getData();
},
// redis
getRedis () {
this.$post(this.api.getRedisCacheActivity).then(({ data }) => {
if (data) {
localStorage.getItem('activityTimestampClient') !== data && this.getList() // redis
localStorage.setItem('activityTimestampClient', data)
}
}).catch(res => { })
},
getData () {
this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
add () {
this.$router.push("add");
},
@ -392,7 +374,7 @@ export default {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
switchOff (val, row) {
async switchOff (val, row) {
this.$post(this.api.disabledEventsActivity, {
activityId: row.id,
isOpen: val,
@ -400,6 +382,7 @@ export default {
}).then(res => { }).catch(err => {
row.isOpen = val ? 0 : 1
})
await this.$post(`${this.api.refreshPageNotification}?content=2`)
},
}
};

@ -1,95 +1,139 @@
<template>
<!-- 考核列表 -->
<div class="wrap">
<div class="page" style="padding-bottom: 0;margin-bottom: 12px">
<div class="page"
style="padding-bottom: 0;margin-bottom: 12px">
<h6 class="l-title">
<img src="@/assets/img/ass1.png" alt="">
<img src="@/assets/img/ass1.png"
alt="">
考核筛选
</h6>
<ul class="filter">
<li>
<label>考核时间</label>
<el-radio-group size="small" v-model="form.month">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>
<el-radio-group size="small"
v-model="form.month">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>
{{ item.name }}
</el-radio>
</el-radio-group>
<el-date-picker
size="small"
<el-date-picker size="small"
v-model="date"
align="right"
unlink-panels type="daterange"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
style="width: 300px"
></el-date-picker>
style="width: 300px"></el-date-picker>
</li>
</ul>
<ul class="filter">
<li>
<label>课程名称</label>
<el-select size="small" v-model="form.curriculumId" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="(item,index) in courseList"
<el-select size="small"
v-model="form.curriculumId"
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item,index) in courseList"
:key="index"
:label="item.sysName"
:value="item.sysId"
></el-option>
:value="item.sysId"></el-option>
</el-select>
</li>
<li>
<label>实验班级</label>
<el-select size="small" v-model="form.classId" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="(item,index) in classList"
<el-select size="small"
v-model="form.classId"
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item,index) in classList"
:key="index"
:label="item.className"
:value="item.id"
></el-option>
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select size="small" v-model="form.status" @change="initData">
<el-option
v-for="(item,index) in statusList"
:key="index" :label="item.name"
:value="item.value"
></el-option>
<el-select size="small"
v-model="form.status"
@change="initData">
<el-option v-for="(item,index) in statusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入考核名称" v-model="form.keyWord" clearable></el-input>
<el-input placeholder="请输入考核名称"
v-model="form.keyWord"
clearable></el-input>
</li>
</ul>
</div>
<div class="page">
<el-table v-loading="listLoading" :data="listData" class="table" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center">
<el-table v-loading="listLoading"
:data="listData"
class="table"
stripe
header-align="center">
<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="sysName" label="课程名称" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="className" label="实验班级" align="center"></el-table-column>
<el-table-column prop="experimentalNum" width="90" label="实验人数" align="center"></el-table-column>
<el-table-column prop="experimentDuration" width="90" label="考试时长" align="center"></el-table-column>
<el-table-column prop="createTime" width="160" label="创建时间" align="center"></el-table-column>
<el-table-column prop="startTime" width="160" label="起始时间" align="center"></el-table-column>
<el-table-column prop="stopTime" width="160" label="结束时间" align="center"></el-table-column>
<el-table-column label="倒计时" width="90" align="center">
<el-table-column prop="sysName"
label="课程名称"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName"
label="考核名称"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="className"
label="实验班级"
align="center"></el-table-column>
<el-table-column prop="experimentalNum"
width="90"
label="实验人数"
align="center"></el-table-column>
<el-table-column prop="experimentDuration"
width="90"
label="考试时长"
align="center"></el-table-column>
<el-table-column prop="createTime"
width="160"
label="创建时间"
align="center"></el-table-column>
<el-table-column prop="startTime"
width="160"
label="起始时间"
align="center"></el-table-column>
<el-table-column prop="stopTime"
width="160"
label="结束时间"
align="center"></el-table-column>
<el-table-column label="倒计时"
width="90"
align="center">
<template slot-scope="scope">
<span>{{ timeFilter(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="考核状态" width="90" align="center">
<el-table-column label="考核状态"
width="90"
align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ status[scope.row.status] }}</span>
</template>
@ -99,39 +143,56 @@
<!-- <span class="ellipsis">{{ stuState[scope.row.stuState] }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column width="100" label="操作" align="center">
<el-table-column width="100"
label="操作"
align="center">
<template slot-scope="scope">
<!--status:考核状态(0待开始 1进行中 2已结束); stuState:学生考试状态(0未考 1在考 2已考)-->
<el-button v-if="scope.row.status == 2 && scope.row.stuState == 0" type="text" disabled>未参加</el-button>
<el-button v-if="(scope.row.status == 2 && scope.row.stuState == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId == null)" type="text" disabled>
<el-button v-if="scope.row.status == 2 && scope.row.stuState == 0"
type="text"
disabled>未参加</el-button>
<el-button v-if="(scope.row.status == 2 && scope.row.stuState == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId == null)"
type="text"
disabled>
未提交
</el-button>
<el-button v-if="scope.row.status != 2 && (scope.row.stuState == 0 || scope.row.stuState == 1)" type="text"
@click="entry(scope.row)" :disabled="scope.row.status !== 1">进入
<el-button v-if="scope.row.status != 2 && (scope.row.stuState == 0 || scope.row.stuState == 1)"
type="text"
@click="entry(scope.row)"
:disabled="scope.row.status !== 1">进入
</el-button>
<el-button v-if="scope.row.status == 1 && scope.row.stuState == 2" type="text" disabled>已提交</el-button>
<el-button v-if="scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId" type="text"
<el-button v-if="scope.row.status == 1 && scope.row.stuState == 2"
type="text"
disabled>已提交</el-button>
<el-button v-if="scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId"
type="text"
@click="show(scope.row)">查看成绩
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
<el-pagination background
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="page"
></el-pagination>
:current-page="page"></el-pagination>
</div>
</div>
<el-dialog title="请输入邀请码" :visible.sync="icVisible" width="30%" @close="closeIc" center
<el-dialog title="请输入邀请码"
:visible.sync="icVisible"
width="30%"
@close="closeIc"
center
:close-on-click-modal="false">
<el-input v-model="invitationCode" placeholder="邀请码" maxlength="6"></el-input>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveIc"> </el-button>
<el-input v-model="invitationCode"
placeholder="邀请码"
maxlength="6"></el-input>
<div slot="footer"
class="dialog-footer">
<el-button type="primary"
@click="saveIc"> </el-button>
</div>
</el-dialog>
</div>
@ -445,6 +506,7 @@ export default {
util.cookies.set("systemId", this.systemId);
util.cookies.set('fromManager', '', -1)
util.cookies.set('competitionId', '', -1)
util.cookies.set('isSubmit', '', -1)
let href = ''
if (curriculumId == 11) {
href = `${Setting.systemPath}/#/index/list?token=${token}&cid=${this.cid}&systemId=${this.systemId}&projectId=${this.projectId}&assessmentId=${this.assessmentId}&classId=${this.classId}&stopTime=${this.stopTime}`;

@ -1425,6 +1425,7 @@ export default {
util.cookies.set('courseId', form.cid)
util.cookies.set('curriculumName', escape(form.systemName))
util.cookies.set('systemId', form.systemId)
util.cookies.set('isSubmit', '', -1)
util.cookies.set('competitionId', this.form.id)
util.cookies.set('stageId', form.stageId)
util.cookies.set('teamId', this.form.competitionRegistration.teamId)
@ -1442,7 +1443,7 @@ export default {
//
toSub () {
const { form } = this
const { systemId, projectId, cid, stageId } = this.curStage
const { systemId, projectId, cid, stageId, endTime } = this.curStage
const competitionId = form.id
const teamId = form.competitionRegistration.teamId
let token = util.local.get(Setting.tokenKey);
@ -1451,7 +1452,7 @@ export default {
location.href = `${Setting.systemPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${cid}&systemId=${systemId}&projectId=${projectId}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&assessmentId=&classId=&stopTime=&test=true`
} else if (systemId == 12) {
//
window.open(`http://120.78.139.126:8879?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}`);
window.open(`http://120.78.139.126:8879?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&endTime=${endTime}`);
} else {
// python
this.toPython(this.curProject)

@ -3,15 +3,22 @@
<div class="search">
<h6>赛事竞技精彩纷呈</h6>
<div class="input">
<img src="@/assets/img/search.png" alt="">
<input type="text" placeholder="请输入关键词" v-model="keyword">
<img src="@/assets/img/search.png"
alt="">
<input type="text"
placeholder="请输入关键词"
v-model="keyword">
</div>
</div>
<div class="main">
<div class="center-wrap list-inner">
<ul v-if="token" class="nav">
<li :class="{ active: form.eventType === item.id }" v-for="(item, index) in typeList" :key="index" @click="changeType(item.id)">{{ item.name }}
<ul v-if="token"
class="nav">
<li :class="{ active: form.eventType === item.id }"
v-for="(item, index) in typeList"
:key="index"
@click="changeType(item.id)">{{ item.name }}
</li>
</ul>
<div class="list-wrap">
@ -21,41 +28,54 @@
<dl v-if="form.eventType !== 1">
<dt>比赛范围</dt>
<template v-if="form.eventType === 2">
<dd v-for="(item, i) in squareScopes" :key="i" :class="{active: form.competitionScope == item.id}" @click="changeScope(item.id)">{{ item.name }}</dd>
<dd v-for="(item, i) in squareScopes"
:key="i"
:class="{active: form.competitionScope == item.id}"
@click="changeScope(item.id)">{{ item.name }}</dd>
</template>
<template v-if="form.eventType === 3">
<dd v-for="(item, i) in scopes" :key="i" :class="{active: form.competitionScope == item.id}" @click="changeScope(item.id)">{{ item.name }}</dd>
<dd v-for="(item, i) in scopes"
:key="i"
:class="{active: form.competitionScope == item.id}"
@click="changeScope(item.id)">{{ item.name }}</dd>
</template>
<template v-if="form.eventType !== 1 && form.competitionScope === 2">
<div class="select-wrap">
<span class="label">省份</span>
<el-select size="small" v-model="form.provinceId" clearable @change="getCity">
<el-option label="不限" value=""></el-option>
<el-option
v-for="(item,index) in provinces"
<el-select size="small"
v-model="form.provinceId"
clearable
@change="getCity">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item,index) in provinces"
:key="index"
:label="item.provinceName"
:value="item.provinceId"
></el-option>
:value="item.provinceId"></el-option>
</el-select>
</div>
<div class="select-wrap">
<span class="label">城市</span>
<el-select size="small" v-model="form.cityId" clearable @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="(item,index) in cities"
<el-select size="small"
v-model="form.cityId"
clearable
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item,index) in cities"
:key="index"
:label="item.cityName"
:value="item.cityId"
></el-option>
:value="item.cityId"></el-option>
</el-select>
</div>
</template>
</dl>
<dl>
<dt>筛选排序</dt>
<dd v-for="(item, i) in sorts" :key="i" :class="{active: form.sequence == item.id}" @click="changeSort(item.id)">{{ item.name }}</dd>
<dd v-for="(item, i) in sorts"
:key="i"
:class="{active: form.sequence == item.id}"
@click="changeSort(item.id)">{{ item.name }}</dd>
</dl>
</div>
</div>
@ -63,11 +83,16 @@
<div class="list">
<template v-if="listData.length">
<ul>
<li v-for="(item,index) in listData" :key="index" @click="toDetail(item)">
<li v-for="(item,index) in listData"
:key="index"
@click="toDetail(item)">
<div class="left">
<el-button v-if="item.status === 1 || item.status === 2 || item.curStage" :class="['stage-label', {playing: item.curStage}]" type="primary">{{ item.status === 1 || item.status === 2 ? '报名中' : item.curStage ? '竞赛中' : '' }}</el-button>
<el-button v-if="item.status === 1 || item.status === 2 || item.curStage"
:class="['stage-label', {playing: item.curStage}]"
type="primary">{{ item.status === 1 || item.status === 2 ? '报名中' : item.curStage ? '竞赛中' : '' }}</el-button>
<div class="cover">
<img :src="item.coverUrl || 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220623/png/1539857403162943488.png'" alt="">
<img :src="item.coverUrl || 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220623/png/1539857403162943488.png'"
alt="">
</div>
<div class="info">
<div class="title">{{ item.competitionName }}</div>
@ -97,19 +122,27 @@
</div>
</div>
<div class="right">
<el-dropdown v-if="item.playingStages && item.playingStages.length > 1" class="m-l-10" @click.stop="stageClick" @command="e => chooseStage(e, item)">
<el-button type="primary" style="background-color: #f96d6d;border: 0;">
<el-dropdown v-if="item.playingStages && item.playingStages.length > 1"
class="m-l-10"
@click.stop="stageClick"
@command="e => chooseStage(e, item)">
<el-button type="primary"
style="background-color: #f96d6d;border: 0;">
选择竞赛<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(stage, i) in item.playingStages" :key="i" :command="stage">进入{{ stage.stageName }}</el-dropdown-item>
<el-dropdown-item v-for="(stage, i) in item.playingStages"
:key="i"
:command="stage">进入{{ stage.stageName }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<p class="status"
v-else-if="item.status != 4 || (item.status == 4 && item.curStage)"
:class="{wait: item.status == 0,signing: item.status == 2,signed: item.status == 1,playing: item.status == 4 && item.curStage,finish: item.status == 3 || item.status == 5}" :title="item.status == 4 ? item.stageName : statusList[item.status]"
:class="{wait: item.status == 0,signing: item.status == 2,signed: item.status == 1,playing: item.status == 4 && item.curStage,finish: item.status == 3 || item.status == 5}"
:title="item.status == 4 ? item.stageName : statusList[item.status]"
@click.stop="signup(item)">{{ item.status == 4 ? item.stageName : statusList[item.status] }}</p>
<p class="end-text" v-if="item.end">
<p class="end-text"
v-if="item.end">
距离{{ item.status == 4 ? item.endText : endList[item.status] }}还有
<em>{{ item.end }}</em>
</p>
@ -117,7 +150,9 @@
</li>
</ul>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals"
<el-pagination background
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
@ -126,7 +161,8 @@
<template v-else>
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
<img src="@/assets/img/none.png"
alt="">
<p>暂无赛事</p>
</div>
</div>
@ -136,56 +172,95 @@
</div>
</div>
<el-dialog title="报名" :visible.sync="peopleSignupVisible" :close-on-click-modal="false" width="300px">
<el-dialog title="报名"
:visible.sync="peopleSignupVisible"
:close-on-click-modal="false"
width="300px">
<el-form class="dia-form">
<el-form-item>
<el-input placeholder="请输入4位数大赛邀请码" maxlength="4" v-model="peopleSignupForm.registrationInvitationCode"></el-input>
<el-input placeholder="请输入4位数大赛邀请码"
maxlength="4"
v-model="peopleSignupForm.registrationInvitationCode"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="peopleSignupSubmit">报名</el-button>
<el-button size="small" @click="peopleSignupVisible = false">取消</el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="peopleSignupSubmit">报名</el-button>
<el-button size="small"
@click="peopleSignupVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="报名" :visible.sync="enterVisible" :close-on-click-modal="false" width="300px">
<el-dialog title="报名"
:visible.sync="enterVisible"
:close-on-click-modal="false"
width="300px">
<el-form class="dia-form">
<p style="margin-bottom: 5px">请选择要加入的团队</p>
<el-form-item>
<el-select class="w-100" v-model="enterForm.teamId" filterable>
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
<el-select class="w-100"
v-model="enterForm.teamId"
filterable>
<el-option v-for="(item, i) in teams"
:key="i"
:label="item.teamName"
:value="item.teamId"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入6位数团队邀请码" maxlength="6" v-model="enterForm.invitationCode"></el-input>
<el-input placeholder="请输入6位数团队邀请码"
maxlength="6"
v-model="enterForm.invitationCode"></el-input>
</el-form-item>
<el-form-item v-if="curItem.setup.isNeedCode">
<el-input placeholder="请输入4位数大赛邀请码" maxlength="4" v-model="enterForm.registrationInvitationCode"></el-input>
<el-input placeholder="请输入4位数大赛邀请码"
maxlength="4"
v-model="enterForm.registrationInvitationCode"></el-input>
</el-form-item>
<p class="tips">
查找不到团队点击 <el-link :underline="false" type="primary" @click="toTeam">创建团队</el-link>
查找不到团队点击 <el-link :underline="false"
type="primary"
@click="toTeam">创建团队</el-link>
</p>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="enterSubmit">报名</el-button>
<el-button size="small" @click="enterVisible = false">取消</el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="enterSubmit">报名</el-button>
<el-button size="small"
@click="enterVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="创建团队" :visible.sync="teamVisible" :close-on-click-modal="false" width="300px">
<el-dialog title="创建团队"
:visible.sync="teamVisible"
:close-on-click-modal="false"
width="300px">
<el-form class="dia-form">
<el-form-item>
<el-input placeholder="请输入团队名称" maxlength="10" v-model="teamForm.teamName"></el-input>
<el-input placeholder="请输入团队名称"
maxlength="10"
v-model="teamForm.teamName"></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入6位数团队邀请码" maxlength="6" v-model="teamForm.invitationCode"></el-input>
<el-input placeholder="请输入6位数团队邀请码"
maxlength="6"
v-model="teamForm.invitationCode"></el-input>
</el-form-item>
<el-form-item v-if="curItem.setup.isNeedCode">
<el-input placeholder="请输入4位数大赛邀请码" maxlength="4" v-model="teamForm.registrationInvitationCode"></el-input>
<el-input placeholder="请输入4位数大赛邀请码"
maxlength="4"
v-model="teamForm.registrationInvitationCode"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">创建并报名</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="teamSubmit">创建并报名</el-button>
<el-button size="small"
@click="teamVisible = false">取消</el-button>
</span>
</el-dialog>
</div>
@ -196,13 +271,12 @@ import { mapState, mapMutations } from "vuex";
import { Loading } from "element-ui";
import Setting from "@/setting"
import util from "@/libs/util"
import Bus from '@/libs/bus'
export default {
name: "match",
data () {
return {
timer: null,
redisTimer: null,
token: util.local.get(Setting.tokenKey),
statusList: ["待报名", "取消报名", "马上报名", "报名截止", "进入初赛", "已结束"],
endList: ["报名开始", "报名截止", "报名截止", "竞赛开始", "竞赛结束", ""],
@ -327,20 +401,24 @@ export default {
}
},
mounted () {
// websocket
Bus.$on('matchSocket', () => {
this.getData()
})
this.form.eventType = this.eventType
this.SET_TYPE(2)
this.getProvince()
this.getData()
this.$once('hook:beforeDestroy', function () {
this.clearTimer()
clearInterval(this.redisTimer)
})
},
methods: {
...mapMutations('match', [
'SET_TYPE'
]),
getList() {
getData () {
this.clearTimer()
const { form } = this
const { eventType, competitionScope } = form
@ -479,14 +557,6 @@ export default {
})
this.timerList = []
},
getData() {
// this.loadIns = Loading.service()
this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
},
initData () {
this.page = 1
this.getData()
@ -712,6 +782,7 @@ export default {
util.cookies.set('resultsDetails', form.resultsDetails)
util.cookies.set('resultAnnouncementTime', form.resultAnnouncementTime)
util.cookies.set('fromManager', '', -1)
util.cookies.set('isSubmit', '', -1)
// 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8085/#/` :
@ -722,7 +793,7 @@ export default {
//
toSub () {
const form = this.curItem
const { systemId, projectId, cid, stageId } = form.curStage
const { systemId, projectId, cid, stageId, endTime } = form.curStage
const competitionId = form.id
const teamId = form.teamId
let token = util.local.get(Setting.tokenKey);
@ -731,7 +802,7 @@ export default {
location.href = `${Setting.systemPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${cid}&systemId=${systemId}&projectId=${projectId}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&assessmentId=&classId=&stopTime=&test=true`
} else if (systemId == 12) {
//
window.open(`http://120.78.139.126:8879?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}`);
window.open(`http://120.78.139.126:8879?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&endTime=${endTime}`);
} else {
// python
this.toPython()
@ -747,8 +818,7 @@ export default {
padding: 100px 0 130px;
text-align: center;
background: url(../../../assets/img/match-bg4.png) (27px 10px) / auto no-repeat,
url(../../../assets/img/match-bg5.png) (98% 20px)/auto no-repeat,
url(../../../assets/img/match-bg3.png) 0 0/100% 100% no-repeat;
url(../../../assets/img/match-bg5.png) (98% 20px) / auto no-repeat, url(../../../assets/img/match-bg3.png) 0 0/100% 100% no-repeat;
h6 {
margin-bottom: 25px;
font-size: 26px;
@ -888,11 +958,11 @@ export default {
font-size: 14px;
color: #fff;
white-space: nowrap;
background-color: #52C41A;
background-color: #52c41a;
border-radius: 4px;
@include ellipsis();
&.wait {
background-color: #FAAD14;
background-color: #faad14;
}
&.signing {
@ -900,7 +970,7 @@ export default {
}
&.signed {
background-color: #52C41A;
background-color: #52c41a;
}
&.playing {
background-color: #f96d6d;
@ -919,7 +989,7 @@ export default {
cursor: pointer;
&:hover {
opacity: .9;
opacity: 0.9;
}
&.disabled {
@ -930,7 +1000,7 @@ export default {
.end-text {
margin-top: 10px;
color: rgba(0, 0, 0, .65);
color: rgba(0, 0, 0, 0.65);
font-size: 12px;
white-space: nowrap;
@ -978,7 +1048,7 @@ export default {
margin-bottom: 10px;
font-size: 20px;
font-weight: 500;
color: #0B1D30;
color: #0b1d30;
line-height: 1;
}
.metas {
@ -994,7 +1064,8 @@ export default {
}
}
.label, .val {
.label,
.val {
font-size: 14px;
color: #666;
white-space: nowrap;

@ -684,7 +684,6 @@ export default {
this.active = 4
const el = document.getElementById('comment' + this.commentId)
el && el.scrollIntoView(false)
await this.$post(`${this.api.noticeRead}?isRead=1&notifyId=${this.notifyId}`) //
this.commentId = ''
}
})
@ -951,6 +950,7 @@ export default {
util.cookies.set('curriculumName', escape(this.curriculumName))
util.cookies.set('systemId', id)
util.cookies.set('mallId', this.mallId)
util.cookies.set('isSubmit', '', -1)
util.cookies.set('fromManager', '', -1)
util.cookies.set('competitionId', '', -1)
// 8pythoncookiesystemId

Loading…
Cancel
Save