调整报名流程,竞赛管理页面

This commit is contained in:
zyy 2020-05-22 15:41:35 +08:00
parent 87ddea085b
commit eaeea84c8d
5 changed files with 121 additions and 73 deletions

View File

@ -225,8 +225,6 @@ export const constantRoutes = [
{ // 竞赛系统报名
path: '/jsxtApply',
component: JsxtApply,
meta: {
},
hidden: true
},
{
@ -969,40 +967,31 @@ export const JSXT = [
redirect: '/jsxt/home',
component: Layout,
meta: {
i18n: 'router.competitionManage',
roles: [user, admin, userTrainingPlatform]
},
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'),
hidden: true,
children: [
{
path: '',
redirect: '/jsxt/home',
component: CompetitionManage,
meta: {
i18n: 'router.competitionManage',
icon: 'design'
},
children: [
{
path: 'home',
component: CompetitionHome,
meta: {
hidden: true
}
hidden: true
},
// {
// path: 'theory/:id',
// component: theoryManage,
// meta: {
// hidden: true
// }
// hidden: true
// },
{
path: 'examDetail',
component: CompetitionDetail,
meta: {
hidden: true
}
hidden: true
},
{ // 考试结果
path: 'result',
@ -1016,9 +1005,7 @@ export const JSXT = [
{
path: '/jsxt/theory/detail/:id',
component: Refereedetail,
meta: {
hidden: true
}
hidden: true
},
{
path: '/refereeJsxt',

View File

@ -88,7 +88,7 @@ const permission = {
if (roles.includes(admin) && !roles.includes(user)) { // 只拥有管理员 不拥有普通用户权限 则增加用户权限
roles.push(user);
}
const routeList = resetAsyncRouter(PermissionParam[getSessionStorage('project')]);
const routeList = resetAsyncRouter(PermissionParam[getSessionStorage('project') || 'login']);
const accessedRouters = filterAsyncRouter(routeList, roles);
accessedRouters.forEach(route => {

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag title="创建竞赛" :visible.sync="dialogVisible" width="500px" center>
<el-dialog v-dialogDrag title="创建竞赛" :visible.sync="dialogVisible" width="500px" center :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="form" :model="formModel" :rules="rules" label-width="90px">
<el-form-item label="竞赛名称:" prop="name">
<el-input v-model="formModel.name" style="width: 220px;" />

View File

@ -79,6 +79,10 @@ export default {
{
name: '参赛地址',
handleClick: this.showJoinUrl
},
{
name: '裁判地址',
handleClick: this.showRefereeUrl
}
]
}
@ -117,10 +121,26 @@ export default {
this.$refs.createRace.doShow(row);
},
showJoinUrl(index, row) {
this.$messageBox(`${row.name}参赛路径:${window.location.protocol}//${window.location.host}/jsxt/login?raceId=${row.id}`);
this.$messageBox();
this.$alert(`${row.name}参赛地址:${window.location.protocol}//${window.location.host}/jsxt/login?raceId=${row.id}`, '', {
confirmButtonText: '确定',
showClose: false,
callback: action => {}
});
},
showApplyUrl(index, row) {
this.$messageBox(`${row.name}报名路径:${window.location.protocol}//${window.location.host}/jsxtApply?raceId=${row.id}`);
this.$alert(`${row.name}报名地址:${window.location.protocol}//${window.location.host}/jsxtApply?raceId=${row.id}`, '', {
confirmButtonText: '确定',
showClose: false,
callback: action => {}
});
},
showRefereeUrl(index, row) {
this.$alert(`${row.name}裁判地址:${window.location.protocol}//${window.location.host}/refereeJsxt/login?raceId=${row.id}`, '', {
confirmButtonText: '确定',
showClose: false,
callback: action => {}
});
}
}
};

View File

@ -1,56 +1,68 @@
<template>
<div class="dictionary_box">
<h2 style="text-align: center;">报名系统</h2>
<div class="joylink-card">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span class="dialog-footer" style="margin: 0 auto; display: table;">
<el-button type="primary" @click="handleApply">报名</el-button>
</span>
<el-dialog title="请先登陆" custom-class="dialog-apply" :visible.sync="dialogVisible" width="740px" :close-on-press-escape="false" :show-close="false" :close-on-click-modal="false" :modal="true">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
:element-loading-text="this.$t('login.clickRefresh')"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
<template v-if="applyFlag">
<h2 style="text-align: center;">报名系统</h2>
<div class="joylink-card">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span class="dialog-footer" style="margin: 0 auto; display: table;">
<el-button type="primary" @click="handleApply">报名</el-button>
</span>
<el-dialog title="请先登陆" custom-class="dialog-apply" :visible.sync="dialogVisible" width="740px" :close-on-press-escape="false" :show-close="false" :close-on-click-modal="false" :modal="true">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
:element-loading-text="this.$t('login.clickRefresh')"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
</div>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login"><svg-icon icon-class="user" /></span>
<el-input v-model="loginForm.username" name="username" type="text" :placeholder="this.$t('login.mobilePhoneNumberOrEmail')" @keyup.enter.native="goToNext" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"><svg-icon icon-class="password" /></span>
<el-input
ref="password"
v-model="loginForm.password"
name="password"
:type="pwdType"
:placeholder="this.$t('login.password')"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon v-if="pwdDisplay" icon-class="eye" />
<svg-icon v-else icon-class="eye-open" />
</span>
</el-form-item>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">登陆</el-button>
</el-form-item>
</el-form>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login"><svg-icon icon-class="user" /></span>
<el-input v-model="loginForm.username" name="username" type="text" :placeholder="this.$t('login.mobilePhoneNumberOrEmail')" @keyup.enter.native="goToNext" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"><svg-icon icon-class="password" /></span>
<el-input
ref="password"
v-model="loginForm.password"
name="password"
:type="pwdType"
:placeholder="this.$t('login.password')"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon v-if="pwdDisplay" icon-class="eye" />
<svg-icon v-else icon-class="eye-open" />
</span>
</el-form-item>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">登陆</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</el-dialog>
</div>
</template>
<template v-else>
<div v-if="flag" class="apply_box">
<i class="el-icon-success" style="color: green; font-size: 40px;" />
<span class="title">报名成功!</span>
</div>
<div v-if="!flag" class="apply_box">
<i class="el-icon-info" style="color: green; font-size: 40px;" />
<span class="title">您已报过名了!</span>
</div>
</template>
</div>
</template>
@ -63,6 +75,7 @@ import Cookies from 'js-cookie';
import QrcodeVue from 'qrcode.vue';
import { getUserinfoMobileCode } from '@/api/management/user';
import { postSignUp } from '@/api/competition';
import { getIsSignUp } from '@/api/competition';
export default {
name: '',
@ -84,6 +97,8 @@ export default {
};
return {
dialogVisible: false,
applyFlag: true,
flag: true,
loginClient: 'Design',
checkLogin: null,
sessionId: '',
@ -166,9 +181,21 @@ export default {
if (getToken()) {
this.$store.dispatch('GetInfo', getToken()).then(res => {
this.userId = res.id;
if (this.checkLogin) {
this.clearTimer(this.checkLogin);
}
getIsSignUp(this.$route.query.raceId).then(res => {
if (res.data) {
//
this.applyFlag = false;
this.flag = false;
}
});
this.dialogVisible = false;
});
} else {
this.dialogVisible = true;
this.applyFlag = true;
this.loginRefresh();
}
},
@ -210,7 +237,6 @@ export default {
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
this.dialogVisible = false;
} else {
console.log('error submit!!');
return false;
@ -302,7 +328,9 @@ export default {
};
if (this.$route.query.raceId) {
postSignUp(this.$route.query.raceId, param).then(res => {
this.$messageBox('报名成功!');
// this.$messageBox('');
this.applyFlag = false;
this.flag = true;
}).catch(error => {
console.log(error);
});
@ -363,6 +391,19 @@ export default {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
}
.apply_box{
display: flex;
justify-content: center;
align-items: center;
margin-top: 50px;
font-size: 25px;
.title{
margin-left: 7px;
text-align: left;
font-size: 25px;
width: auto;
}
}
/deep/{
.dialog-apply{
.el-form-item{