Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/jmapNew/map.js
This commit is contained in:
commit
cc76f4aaa6
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: 'lightgreen', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
@ -107,7 +108,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
speedLimitName: {
|
||||
z: 10,
|
||||
limitValueDistance: -15,
|
||||
limitValueDistance: -15,
|
||||
kilometerFontSize: 8, // 公里标大小
|
||||
kilometerColor: '#fff', // 公里标颜色
|
||||
nameNumberFontSize: 11, // 限速值大小
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
@ -107,8 +108,8 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
speedLimitName: {
|
||||
z: 10,
|
||||
limitValueDistance: -15,
|
||||
kilometerFontSize: 8, // 公里标大小
|
||||
limitValueDistance: -15,
|
||||
kilometerFontSize: 8, // 公里标大小
|
||||
kilometerColor: '#fff', // 公里标颜色
|
||||
nameNumberFontSize: 11, // 限速值大小
|
||||
nameNumberColor: '#C00808', // 限速值颜色
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
@ -430,7 +431,8 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
// 延续保护计时
|
||||
this[deviceType.OverAp] = {
|
||||
show: true
|
||||
show: true,
|
||||
textColor: '#FFF'
|
||||
};
|
||||
|
||||
this[deviceType.Switch] = {
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: 'lightgreen', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
|
@ -20,7 +20,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#0F0' // 接近区段文字颜色
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
@ -104,7 +105,7 @@ class SkinCode extends defaultStyle {
|
||||
communicationOccupiedColor: '#FF0000', // 区段通信车占用颜色
|
||||
unCommunicationOccupiedColor: '#800080', // 区段非通讯车占用颜色
|
||||
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
|
||||
faultLockColor: '#800080', // 区段故障锁定颜色
|
||||
faultLockColor: '#00FF00', // 区段故障锁定颜色
|
||||
undefinedColor: '#0071C1', // 区段未定义颜色
|
||||
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
|
||||
blockColor: '#800080', // 区段封锁颜色
|
||||
@ -288,7 +289,11 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
// 延续保护计时
|
||||
this[deviceType.OverAp] = {
|
||||
show: false
|
||||
show: true,
|
||||
textColor: '#FF0',
|
||||
textPadding: [1, 3],
|
||||
textBorderColor: '#FF0',
|
||||
textBorderWidth: 1
|
||||
};
|
||||
|
||||
// 屏蔽门
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
|
@ -19,7 +19,8 @@ class SkinCode extends defaultStyle {
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF'
|
||||
},
|
||||
logicText: { // 逻辑区段名称
|
||||
z: 10,
|
||||
|
@ -248,15 +248,6 @@ class Jlmap {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
if (type == 'OverAp') {
|
||||
const overlapRoute = store.state.map.overlapData[code];
|
||||
const model = this.mapDevice[overlapRoute.pathList[0].sectionList[0]];
|
||||
if (overlapRoute.pathList[0].right) {
|
||||
elem['points'] = { x: model.points[0].x, y: model.points[0].y };
|
||||
} else {
|
||||
elem['points'] = { x: model.points[model.points.length - 1].x, y: model.points[model.points.length - 1].y };
|
||||
}
|
||||
}
|
||||
// const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
const oDevice = deviceFactory(type, elem, this.showConfig);
|
||||
// const nDevice = deepAssign(oDevice || {}, elem);
|
||||
|
@ -33,9 +33,12 @@ export default class OverAp extends Group {
|
||||
textPosition: style.Section.name.textPosition,
|
||||
fontSize: 12,
|
||||
fontFamily: style.fontFamily,
|
||||
textFill: '#FFF',
|
||||
textFill: style.OverAp.textColor,
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'middle'
|
||||
textVerticalAlign: 'middle',
|
||||
textPadding: style.OverAp.textPadding,
|
||||
textBorderColor: style.OverAp.textBorderColor,
|
||||
textBorderWidth: style.OverAp.textBorderWidth
|
||||
});
|
||||
this.add(this.text);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class ETextName extends Group {
|
||||
fontSize: styleModel.fontSize,
|
||||
fontFamily: styleModel.fontFamily || this.model.style.fontFamily,
|
||||
text: styleName,
|
||||
textFill: styleModel.fontColor,
|
||||
textFill: model.approach ? styleModel.approachColor : styleModel.fontColor,
|
||||
textAlign: styleModel.textAlign,
|
||||
textPosition: styleModel.textPosition || 'inside',
|
||||
textVerticalAlign: styleModel.textVerticalAlign || null
|
||||
|
@ -19,7 +19,10 @@ export default function ETextName(model) {
|
||||
textFill: model.textFill,
|
||||
textAlign: model.textAlign,
|
||||
textPosition: model.textPosition || 'inside',
|
||||
textVerticalAlign: model.textVerticalAlign || null
|
||||
textVerticalAlign: model.textVerticalAlign || null,
|
||||
textBorderColor: model.textBorderColor || null,
|
||||
textBorderWidth: model.textBorderWidth || null,
|
||||
textPadding: model.textPadding || 0
|
||||
}
|
||||
});
|
||||
return TextName;
|
||||
|
@ -39,13 +39,14 @@
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {menuOperate, commitOperate} from '../../utils/menuOperate';
|
||||
export default {
|
||||
name: 'SwitchHookLock',
|
||||
components: {
|
||||
@ -92,7 +93,7 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(selected) {
|
||||
doShow(selected, operate = null) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
@ -110,6 +111,9 @@ export default {
|
||||
} else {
|
||||
this.normal = false;
|
||||
}
|
||||
if (operate) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
@ -123,21 +127,36 @@ export default {
|
||||
},
|
||||
commit() {
|
||||
this.loading = true;
|
||||
const group = this.$route.query.group;
|
||||
const param = {
|
||||
commandType: 'Switch_Hook_Lock',
|
||||
targetMemberId: this.targetMemberId,
|
||||
params: {
|
||||
switchCode: this.selected.code,
|
||||
normal: this.normal
|
||||
}
|
||||
};
|
||||
commitTrainSend(group, param).then(({valid, operate})=>{
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(error.message);
|
||||
this.doClose();
|
||||
});
|
||||
if (this.operation) {
|
||||
commitOperate(menuOperate.Switch.hookLock, {normal: this.normal}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(error.message);
|
||||
});
|
||||
} else {
|
||||
const group = this.$route.query.group;
|
||||
const param = {
|
||||
commandType: 'Switch_Hook_Lock',
|
||||
// Switch_Hook_Lock
|
||||
targetMemberId: this.targetMemberId,
|
||||
params: {
|
||||
switchCode: this.selected.code,
|
||||
normal: this.normal
|
||||
}
|
||||
};
|
||||
commitTrainSend(group, param).then(({valid, operate})=>{
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(error.message);
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -165,7 +165,13 @@ export default {
|
||||
label: '触发故障管理',
|
||||
handler: this.triggerFaultManagement,
|
||||
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
|
||||
},
|
||||
{
|
||||
label: '道岔钩锁',
|
||||
handler: this.hookLock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_HOOK_LOCK
|
||||
}
|
||||
//
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -200,9 +206,10 @@ export default {
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
// if (!this.$store.state.scriptRecord.bgSet) {
|
||||
// Switch_Hook_Lock
|
||||
const menuHook = [{
|
||||
label: '道岔钩锁',
|
||||
handler: this.hookLock
|
||||
label: '语音指令-道岔钩锁',
|
||||
handler: this.voiceCommandHookLock
|
||||
}];
|
||||
this.menu = [...this.menuForce, ...menuHook];
|
||||
// } else {
|
||||
@ -335,9 +342,16 @@ export default {
|
||||
});
|
||||
},
|
||||
// 道岔钩锁
|
||||
hookLock() {
|
||||
voiceCommandHookLock() {
|
||||
this.$refs.switchHookLock.doShow(this.selected);
|
||||
},
|
||||
hookLock() {
|
||||
commitOperate(menuOperate.Switch.hookLock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||
if (valid) {
|
||||
this.$refs.switchHookLock.doShow(this.selected, operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
triggerFaultManagement() {
|
||||
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
|
||||
}
|
||||
|
@ -238,6 +238,17 @@ export function parser(data, skinCode, showConfig) {
|
||||
zrUtil.each(data.directionRodList || [], elem=> {
|
||||
mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
zrUtil.each(data.signalApproachSectionList || [], elem => {
|
||||
zrUtil.each(elem.sectionPathList || [], item => {
|
||||
zrUtil.each(item.sectionList || [], section => {
|
||||
if (mapDevice[section] && mapDevice[section].parentCode) {
|
||||
mapDevice[mapDevice[section].parentCode].approach = true;
|
||||
} else if (mapDevice[section]) {
|
||||
mapDevice[section].approach = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return mapDevice;
|
||||
|
@ -131,10 +131,7 @@ const CompetitionHome = () => import('@/views/jsxt/competition/home');
|
||||
const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index');
|
||||
const RefereeResult = () => import('@/views/jsxt/competition/theory/result');
|
||||
const JsxtExamResult = () => import('@/views/jsxt/competition/result');
|
||||
const JsxtApply = () => import('@/views/jsxt/apply/index');
|
||||
// const theoryManage = () => import('@/views/jsxt/competition/theory/index');
|
||||
const RefereeList = () => import('@/views/jsxt/refereeList/index');
|
||||
const RefereeDisplay = () => import('@/views/jsxt/refereeList/display');
|
||||
const Approval = () => import('@/views/approval/index');
|
||||
const CompanyManage = () => import('@/views/system/companyManage/index');
|
||||
const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/index');
|
||||
@ -265,12 +262,6 @@ export const constantRoutes = [
|
||||
hidden: true
|
||||
|
||||
},
|
||||
|
||||
{ // 竞赛系统报名
|
||||
path: '/jsxtApply',
|
||||
component: JsxtApply,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: Errpr404,
|
||||
@ -323,11 +314,6 @@ export const publicAsyncRoute = [
|
||||
component: BigSplitScreen,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/refereeJsxtDisplay',
|
||||
component: RefereeDisplay,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/jointTrainingNew',
|
||||
component: JointTrainingNew,
|
||||
@ -1149,28 +1135,6 @@ export const JSXT = [
|
||||
path: '/jsxt/theory/result', // 考试结果页面
|
||||
component: RefereeResult,
|
||||
hidden: true
|
||||
},
|
||||
// 裁判系统
|
||||
{
|
||||
path: '/refereeJsxt',
|
||||
redirect: '/refereeJsxt/home',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.homeJsxt',
|
||||
roles: [user, admin]
|
||||
},
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: RefereeList,
|
||||
meta: {
|
||||
i18n: 'router.refereeJManage',
|
||||
icon: 'design',
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
const createRouter = () => new Router({
|
||||
|
@ -61,6 +61,7 @@ export function covertData(resp, type, resolve) {
|
||||
item.code = item.groupNumber;
|
||||
});
|
||||
const mapData = resp.data.graphDataNew;
|
||||
mapData.signalApproachSectionList = resp.data.logicDataNew.signalApproachSectionList;
|
||||
if (type == 'Group') {
|
||||
store.dispatch('map/setMapData', mapData).then(() => {
|
||||
store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
|
@ -1,555 +0,0 @@
|
||||
<template>
|
||||
<div class="dictionary_box">
|
||||
<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-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-if="flag" class="apply_box">
|
||||
<div class="img_box"><img :src="SAFS" alt=""></div>
|
||||
<div style="width: 100%;text-align:center;margin-top:120px;"><i class="el-icon-success" style="color: green; font-size: 100px;" /></div>
|
||||
<div style="width: 100%;margin-top: 25px;">
|
||||
<div class="apply_box_title">报名成功!<br> 您的赛事信息如下:
|
||||
<br>竞赛名称:{{ compition.name }}
|
||||
<br>竞赛时间:{{ compition.startDate }}
|
||||
<br>姓名:{{ formModel.name }}
|
||||
<br>公司:{{ formModel.company }}
|
||||
<br>部门:{{ formModel.department }}
|
||||
<br>职位:{{ formModel.job }}
|
||||
<br>电话:{{ formModel.phone.replace(/^(\d{3})\d{4}(\d+)/,"$1****$2") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!flag" class="applyAready_box">
|
||||
<div class="img_box"><img :src="SAFS" alt=""></div>
|
||||
<div style="width: 100%;text-align:center;margin-top:120px;"><img :src="applyAlready" class="applyAlready"></div>
|
||||
<div style="width: 100%;margin-top: 25px;">
|
||||
<div class="apply_box_title">
|
||||
您的赛事信息如下:
|
||||
<br>竞赛名称:{{ compition.name }}
|
||||
<br>竞赛时间:{{ compition.startDate }}
|
||||
<br>姓名:{{ formModel.name }}
|
||||
<br>公司:{{ formModel.organization }}
|
||||
<br>部门:{{ formModel.department }}
|
||||
<br>职位:{{ formModel.position }}
|
||||
<br>电话:{{ formModel.mobile.replace(/^(\d{3})\d{4}(\d+)/,"$1****$2") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import md5 from 'js-md5';
|
||||
import Cookies from 'js-cookie';
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
import { getUserinfoMobileCode } from '@/api/management/user';
|
||||
import { postSignUp, getRaceUserById, getRaceById } from '@/api/competition';
|
||||
import applyAlready from '@/assets/applyAlready.png';
|
||||
import SAFS from '@/assets/SAFS.png';
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
components: { QrcodeVue },
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (value.length < 5 && !this.project.endsWith('gzb')) {
|
||||
callback(new Error(this.$t('login.enterTheCorrectUserName')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validatePass = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(new Error(this.$t('login.passwordHint')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
SAFS: SAFS,
|
||||
dialogVisible: false,
|
||||
applyAlready:applyAlready,
|
||||
applyFlag: true,
|
||||
flag: true,
|
||||
loginClient: 'Design',
|
||||
checkLogin: null,
|
||||
sessionId: '',
|
||||
userId: '',
|
||||
loading: false,
|
||||
loadingCode: false,
|
||||
pwdDisplay: true,
|
||||
loginUrl: '',
|
||||
pwdType: 'password',
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
cookiesName: 'UserName',
|
||||
cookiesToken: 'UserToken',
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
||||
},
|
||||
mobileCodeTime: 0,
|
||||
formModel: {
|
||||
name: '',
|
||||
numberId: '',
|
||||
company: '', // 公司
|
||||
job: '', // 职位
|
||||
department: '', // 部门
|
||||
phone: '', // 电话
|
||||
phoneCode: '' // 验证码
|
||||
},
|
||||
compition:{
|
||||
name:'',
|
||||
startDate:''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名字', type: 'text' },
|
||||
{ prop: 'numberId', label: '身份证号', type: 'text' },
|
||||
{ prop: 'phone', propCode: 'phoneCode', mobileCodeTime: this.mobileCodeTime, label: '电话', type: 'tel', buttonClick: this.getTelCode, required: true },
|
||||
{ prop: 'company', label: '公司', type: 'text' },
|
||||
{ prop: 'department', label: '部门', type: 'text' },
|
||||
{ prop: 'job', label: '职位', type: 'text' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: '请填写名字', trigger: 'blur' }
|
||||
],
|
||||
numberId: [
|
||||
{ required: true, message: '请填写身份证号', trigger: 'blur' },
|
||||
{ validator: this.validateNumberId, trigger: 'blur' }
|
||||
],
|
||||
phone:[
|
||||
{ required: true, message: '请填写电话', trigger: 'blur' }
|
||||
],
|
||||
phoneCode:[
|
||||
{ required: true, message: '请填写验证码', trigger: 'blur' }
|
||||
],
|
||||
company:[
|
||||
{ required: true, message: '请填写公司名称', trigger: 'blur' }
|
||||
],
|
||||
job:[
|
||||
{ required: true, message: '请填写职位', trigger: 'blur' }
|
||||
],
|
||||
department: [
|
||||
{ required: true, message: '请填写部门', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
if (getToken()) {
|
||||
this.$store.dispatch('GetInfo', getToken()).then(res => {
|
||||
this.userId = res.id;
|
||||
if (this.checkLogin) {
|
||||
this.clearTimer(this.checkLogin);
|
||||
}
|
||||
getRaceUserById(this.$route.query.raceId).then(res => {
|
||||
if (res.data) {
|
||||
// 已经报名过
|
||||
getRaceById(this.$route.query.raceId).then(res=>{
|
||||
this.compition = res.data;
|
||||
});
|
||||
this.formModel = res.data;
|
||||
this.applyFlag = false;
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
});
|
||||
} else {
|
||||
this.dialogVisible = true;
|
||||
this.applyFlag = true;
|
||||
this.loginRefresh();
|
||||
}
|
||||
},
|
||||
goToNext() {
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
} else {
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay = false;
|
||||
this.pwdType = '';
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay = true;
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
model.type = this.modelType;
|
||||
this.loading = true;
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set(this.cookiesName, model.username, { expires: 2});
|
||||
Cookies.set(this.cookiesToken, model.password, { expires: 2});
|
||||
}
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.getUserInfo();
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
loginRefresh() {
|
||||
this.loadingCode = true;
|
||||
getLoginWmurl(LoginParams[this.loginClient]).then(response => {
|
||||
this.sessionId = response.data.sessionId;
|
||||
this.loginUrl = response.data.url;
|
||||
this.loadingCode = false;
|
||||
this.checkLoginStatus();
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
this.loadingCode = false;
|
||||
this.$messageBox(this.$t('login.getLoginQrCode'));
|
||||
});
|
||||
},
|
||||
checkLoginStatus() {
|
||||
// 销毁则不再定时
|
||||
if (this && this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
// 清空已存在的定时器
|
||||
// 设置定时器检测
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.checkLogin = setTimeout(() => {
|
||||
checkLoginStatus(this.sessionId).then(response => {
|
||||
// 设置扫码登录
|
||||
this.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.getUserInfo();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.checkLoginStatus();
|
||||
});
|
||||
}, 3000);
|
||||
},
|
||||
clearTimer(timer) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
},
|
||||
validateNumberId(rule, value, callback) {
|
||||
var regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/; // 如果通过该验证,说明身份证格式正确,但准确性还需计算
|
||||
if (regIdCard.test(value)) {
|
||||
if (value.length == 18) {
|
||||
var idCardWi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; // 将前17位加权因子保存在数组里
|
||||
var idCardY = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2]; // 这是除以11后,可能产生的11位余数、验证码,也保存成数组
|
||||
var idCardWiSum = 0; // 用来保存前17位各自乖以加权因子后的总和
|
||||
for (var i = 0; i < 17; i++) {
|
||||
idCardWiSum += value.substring(i, i + 1) * idCardWi[i];
|
||||
}
|
||||
var idCardMod = idCardWiSum % 11;// 计算出校验码所在数组的位置
|
||||
var idCardLast = value.substring(17);// 得到最后一位身份证号码
|
||||
// 如果等于2,则说明校验码是10,身份证号码最后一位应该是X
|
||||
if (idCardMod == 2) {
|
||||
if (idCardLast == 'X' || idCardLast == 'x') {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error('身份证号码错误'));
|
||||
}
|
||||
} else {
|
||||
// 用计算出的验证码与最后一位身份证号码匹配,如果一致,说明通过,否则是无效的身份证号码
|
||||
if (idCardLast == idCardY[idCardMod]) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error('身份证号码错误'));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
callback(new Error('身份证格式不正确'));
|
||||
}
|
||||
},
|
||||
handleApply() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
const param = {
|
||||
department: this.formModel.department,
|
||||
idNumber: this.formModel.numberId,
|
||||
mobile: this.formModel.phone,
|
||||
name: this.formModel.name,
|
||||
organization: this.formModel.company,
|
||||
position: this.formModel.job,
|
||||
vdCode: this.formModel.phoneCode,
|
||||
type: 'DISPATCHER'
|
||||
};
|
||||
if (this.$route.query.raceId) {
|
||||
postSignUp(this.$route.query.raceId, param).then(res => {
|
||||
// this.$messageBox('报名成功!');
|
||||
getRaceById(this.$route.query.raceId).then(res=>{
|
||||
this.compition = res.data;
|
||||
});
|
||||
this.applyFlag = false;
|
||||
this.flag = true;
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.$messageBox(error.message);
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('报名地址有问题,请检查');
|
||||
}
|
||||
});
|
||||
},
|
||||
async getTelCode() {
|
||||
const random = Math.floor(Math.random() * 10000 + 1);
|
||||
const timeCount = Date.parse(new Date()) / 1000;
|
||||
const pass = `${timeCount}86${this.formModel.phone}${random}`;
|
||||
const param = {
|
||||
mobile: this.formModel.phone,
|
||||
nationCode: '86',
|
||||
rd: random,
|
||||
time: timeCount,
|
||||
token: md5(pass)
|
||||
};
|
||||
try {
|
||||
|
||||
const res = await getUserinfoMobileCode(param);
|
||||
if (res.code == 200) {
|
||||
this.mobileCodeTime = 30;
|
||||
this.mobileTime = setInterval(() => {
|
||||
this.mobileCodeTime--;
|
||||
if (this.mobileCodeTime <= 0) {
|
||||
this.mobileCodeTime = 0;
|
||||
clearInterval(this.mobileTime);
|
||||
this.mobileTime = null;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.info(this.$t('global.codeFaile'));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
$bg:#f0f0f0;
|
||||
$qrbg:#fff;
|
||||
$dark_gray:#889aa4;
|
||||
$light_gray:#eee;
|
||||
$qrcodeSize: 270px;
|
||||
.applyAlready{
|
||||
width:150px;
|
||||
}
|
||||
.applyAready_box{
|
||||
}
|
||||
.dictionary_box{
|
||||
.joylink-card{
|
||||
width: 800px;
|
||||
margin: 0 auto 20px;
|
||||
padding: 24px;
|
||||
border: 1px solid #EBEEF5;
|
||||
background-color: #FFF;
|
||||
color: #303133;
|
||||
transition: .3s;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
.img_box{
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.apply_box{
|
||||
// display: flex;
|
||||
// justify-content: center;
|
||||
// align-items: center;
|
||||
font-size: 25px;
|
||||
}
|
||||
.apply_box_title{
|
||||
font-size: 22px;
|
||||
line-height: 35px;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: inline-block;
|
||||
}
|
||||
/deep/{
|
||||
.dialog-apply{
|
||||
.el-form-item{
|
||||
background: #fff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
.el-input {
|
||||
height: 40px;
|
||||
width: 85%;
|
||||
background: #fff;
|
||||
input {
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0px;
|
||||
padding: 8px 9px 7px 5px;
|
||||
color: #000;
|
||||
height: 100%;
|
||||
|
||||
&:-webkit-autofill {
|
||||
box-shadow: 0 0 0px 1000px #fff inset !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.login-form {
|
||||
width: 440px;
|
||||
padding: 0 50px;
|
||||
}
|
||||
.content-box{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.item_form_box {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
.item_form_password{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.tip-message {
|
||||
color: #F56C61;
|
||||
padding: 5px;
|
||||
font-size: 12px;
|
||||
height: 23px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.popover_box {
|
||||
position: absolute;
|
||||
right: 80px;
|
||||
bottom: 106px;
|
||||
cursor: pointer;
|
||||
color: #225592;
|
||||
font-size: 14px;
|
||||
}
|
||||
.qrcode-main{
|
||||
width: 300px;
|
||||
background-color: $qrbg;
|
||||
text-align: center;
|
||||
border-right: 1px solid #ececec;
|
||||
.tip-info {
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-code-box{
|
||||
width: 150px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.system-type {
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,232 +0,0 @@
|
||||
<template>
|
||||
<div class="main" style="overflow:hidden;width:auto;height:100%;">
|
||||
<div class="map-view" style="width:auto;overflow:hidden;height:100%;">
|
||||
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" />
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
<menu-replay ref="menuReplay" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { loadNewMapDataByMapId } from '@/utils/loaddata';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import MenuReplay from './menuReplay';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||
export default {
|
||||
name:'RefereeDisplay',
|
||||
components: {
|
||||
JlmapVisual,
|
||||
PopMenu,
|
||||
MenuReplay
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkLine: null,
|
||||
menu: [],
|
||||
menuNormal: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'canvasWidth'
|
||||
]),
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'offsetStationCode'
|
||||
]),
|
||||
...mapGetters('config', [
|
||||
'canvasId'
|
||||
]),
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
||||
this.subscribe();
|
||||
// this.mapBoxP = document.getElementById(this.canvasId).children[0];
|
||||
// this.mapBoxP.style.cursor = '';
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length) {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
},
|
||||
// '$store.state.socket.simulationError': function (val) {
|
||||
// if (val) {
|
||||
// this.simulationError(val);
|
||||
// }
|
||||
// },
|
||||
'$store.state.socket.simulationReset': function (val) {
|
||||
if (val) {
|
||||
this.simulationReset(val);
|
||||
}
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.setWindowSize();
|
||||
}
|
||||
},
|
||||
|
||||
async mounted() {
|
||||
window.onbeforeunload = this.clearSubscribe;
|
||||
await this.setWindowSize();
|
||||
await this.initLoadData();
|
||||
},
|
||||
async beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
await this.clearAllTimer();
|
||||
await this.quit();
|
||||
await this.$store.dispatch('training/reset');
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
},
|
||||
methods:{
|
||||
// 仿真错误时,被动退出时调用
|
||||
async back() {
|
||||
// await this.$refs.menuScript.back();
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
||||
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
async statusMessage(list) {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
async simulationReset() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('training/over');
|
||||
await this.$store.dispatch('socket/setSimulationReset');
|
||||
await this.$store.dispatch('socket/setSimulationStart');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
},
|
||||
// async simulationError() {
|
||||
// await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
// await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
// await this.$store.dispatch('socket/setSimulationError');
|
||||
// await this.$store.dispatch('training/setMapDefaultState');
|
||||
// this.clearSubscribe();
|
||||
// this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
// confirmButtonText: this.$t('global.confirm'),
|
||||
// showCancelButton: false,
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// this.$emit('back');
|
||||
// }).catch(() => {
|
||||
// });
|
||||
// },
|
||||
// 加载数据
|
||||
async initLoadData() {
|
||||
this.$store.dispatch('training/reset');
|
||||
try {
|
||||
await this.initLoadRecordData();
|
||||
this.checkLoginLineTimer();
|
||||
} catch (error) {
|
||||
this.$messageBox(`初始化失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
onContextmenu(em) {
|
||||
this.point = {
|
||||
x: em.clientX,
|
||||
y: em.clientY
|
||||
};
|
||||
if (!em.deviceType) {
|
||||
var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
// 清除检查在线定时器
|
||||
clearAllTimer() {
|
||||
if (this.checkLine) {
|
||||
clearTimeout(this.checkLine);
|
||||
this.checkLine = null;
|
||||
}
|
||||
},
|
||||
// 销毁仿真
|
||||
async quit() {
|
||||
await this.$store.dispatch('training/over');
|
||||
},
|
||||
// 设置检查在线定时器
|
||||
checkLoginLineTimer() {
|
||||
if (this.checkLine) {
|
||||
clearTimeout(this.checkLine);
|
||||
}
|
||||
this.checkLine = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
},
|
||||
// 加载地图数据
|
||||
async initLoadRecordData() {
|
||||
this.switchMode('01');
|
||||
if (parseInt(this.mapId)) {
|
||||
await this.loadNewMapDataById(this.mapId);
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 结束加载状态
|
||||
endViewLoading(isSuccess) {
|
||||
if (!isSuccess) {
|
||||
this.$store.dispatch('map/mapClear');
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('viewLoading', false);
|
||||
});
|
||||
},
|
||||
switchMode(prdType) {
|
||||
this.$store.dispatch('training/setPrdType', prdType);
|
||||
},
|
||||
async loadNewMapDataById(mapId) {
|
||||
try {
|
||||
await loadNewMapDataByMapId(mapId);
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
} catch (error) {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
setWindowSize() {
|
||||
this.$nextTick(() => {
|
||||
const width = this.width;
|
||||
const height = this.height;
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.menu-item{
|
||||
background: #f1ecec;
|
||||
.pop-menu {
|
||||
background: #5F9EA0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,127 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="修改分数" :visible.sync="show" top="150px" width="500px" :before-do-close="doClose" :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="info" :rules="rules" label-width="150px" class="demo-ruleForm">
|
||||
<el-form-item :label="'理论分数('+ theoryScore +')'" prop="theoryScore">
|
||||
<el-input v-model="info.theoryScore" style="width: 200px" />
|
||||
<!-- <span style="font-size: 12px;margin-left: 10px;">(总分 {{ theoryScore }})</span> -->
|
||||
</el-form-item>
|
||||
<el-form-item :label="'实操分数('+ practicalScore +')'" prop="practiceScore">
|
||||
<el-input v-model="info.practiceScore" style="width: 200px" />
|
||||
<!-- <span style="font-size: 12px;margin-left: 10px;">(总分 {{ practicalScore }})</span> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="edit_score">
|
||||
<el-button type="primary" size="medium" :loading="loading" @click="editScore">修改</el-button>
|
||||
<el-button size="medium" @click="doClose">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { putRefereeScoring, getTestPaperDatail } from '@/api/competition';
|
||||
|
||||
export default {
|
||||
name:'EditScore',
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
loading:false,
|
||||
info: {
|
||||
raceId: 0,
|
||||
userId: 0,
|
||||
theoryScore: 0,
|
||||
practiceScore: 0
|
||||
},
|
||||
theoryScore: 0,
|
||||
practicalScore: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {
|
||||
theoryScore: [
|
||||
{ required: true, message: '请输入理论分数', trigger: 'blur' },
|
||||
{ validator: this.validatorNumber1 }
|
||||
],
|
||||
practiceScore: [
|
||||
{ required: true, message: '请输入实操分数', trigger: 'blur' },
|
||||
{ validator: this.validatorNumber2 }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.show = true;
|
||||
this.reloadInfo(data);
|
||||
},
|
||||
reloadInfo(data) {
|
||||
getTestPaperDatail(data.raceId).then(res => {
|
||||
this.theoryScore = res.data.theoryScore;
|
||||
this.practicalScore = res.data.practicalScore;
|
||||
console.log(data);
|
||||
this.info = {
|
||||
raceId: data.raceId,
|
||||
userId: data.userId,
|
||||
theoryScore: data.artificialTheoryScore || data.theoryScore,
|
||||
practiceScore: data.artificialPracticeScore || data.practiceScore
|
||||
};
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
editScore() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
const data = {
|
||||
raceId: this.info.raceId,
|
||||
userId: this.info.userId,
|
||||
artificialTheoryScore: Number(this.info.theoryScore),
|
||||
artificialPracticeScore: Number(this.info.practiceScore)
|
||||
};
|
||||
putRefereeScoring(data).then(res => {
|
||||
this.doClose();
|
||||
this.$message.success('修改分数成功');
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$message.error('修改分数失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
validatorNumber1(rule, value, callback) {
|
||||
if (Number(value) < 0) {
|
||||
callback(new Error('输入分数不能小于0'));
|
||||
} else if (Number(value) > 0 && Number(value) <= this.theoryScore) {
|
||||
callback();
|
||||
} else if (Number(value) > this.theoryScore) {
|
||||
callback(new Error('输入分数大于当前试题分值'));
|
||||
} else {
|
||||
callback(new Error('请输入正确的分数'));
|
||||
}
|
||||
},
|
||||
validatorNumber2(rule, value, callback) {
|
||||
if (Number(value) < 0) {
|
||||
callback(new Error('输入分数不能小于0'));
|
||||
} else if (Number(value) > 0 && Number(value) <= this.practicalScore) {
|
||||
callback();
|
||||
} else if (Number(value) > this.practicalScore) {
|
||||
callback(new Error('输入分数大于当前试题分值'));
|
||||
} else {
|
||||
callback(new Error('请输入正确的分数'));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.edit_score{
|
||||
text-align:center;
|
||||
margin-top:20px;
|
||||
}
|
||||
/deep/{
|
||||
.el-dialog__body{
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,276 +0,0 @@
|
||||
<template>
|
||||
<div class="refereeList">
|
||||
<div class="raceName">{{ raceName }}竞赛</div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit-score ref="editScore" />
|
||||
<theory-result ref="theoryResult" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { refereeEnterSimulation, loadingPaper, getRaceUserList, getRaceById, playBackReady } from '@/api/competition';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import editScore from './editScore';
|
||||
import TheoryResult from './theoryResult';
|
||||
|
||||
export default {
|
||||
name: 'RefereeList',
|
||||
components:{
|
||||
editScore,
|
||||
TheoryResult
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名字'
|
||||
},
|
||||
organization: {
|
||||
type: 'text',
|
||||
label: '公司'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
paginationHiden:true,
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名字',
|
||||
prop: 'name',
|
||||
width:200
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
prop: 'mobile',
|
||||
width:140
|
||||
},
|
||||
{
|
||||
title: '公司',
|
||||
prop: 'organization',
|
||||
width:180
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
prop: 'department'
|
||||
},
|
||||
{
|
||||
title: '报名时间',
|
||||
prop: 'time',
|
||||
width:180
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
width:100,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.covertStatus(row.status); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '理论分数',
|
||||
prop: 'theoryScore',
|
||||
width:100,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : this.covert(row.theoryScore); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实操分数',
|
||||
prop: 'practiceScore',
|
||||
width:100,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : this.covert(row.practiceScore); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '总分',
|
||||
prop: 'totalScore',
|
||||
width:100
|
||||
},
|
||||
// {
|
||||
// title: '竞赛名称',
|
||||
// prop: 'raceId',
|
||||
// type: 'tag',
|
||||
// columnValue: (row) => { return this.$convertField(row.raceId, this.raceList, ['value', 'label']); },
|
||||
// tagType: (row) => { return 'success'; }
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
buttons: [
|
||||
{
|
||||
name: '进入',
|
||||
handleClick: this.handleClick,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '3'; }
|
||||
},
|
||||
{
|
||||
name: '理论结果',
|
||||
handleClick: this.handleTheoryResult,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; }
|
||||
},
|
||||
{
|
||||
name: '实操回放',
|
||||
handleClick: this.playBack,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; }
|
||||
},
|
||||
{
|
||||
name: '修改',
|
||||
handleClick: this.gradeScore,
|
||||
type: 'success',
|
||||
showControl: (row) => { return row.status == '4'; }
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '导入试题', handler: this.handleAdd, fileType: 'file' }
|
||||
]
|
||||
},
|
||||
isLeaving:false,
|
||||
inter:null,
|
||||
mapId:'',
|
||||
raceName:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
getRaceById(this.$route.query.raceId).then(res=>{
|
||||
this.mapId = res.data.mapId;
|
||||
this.raceName = res.data.name;
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.isLeaving = true;
|
||||
},
|
||||
methods: {
|
||||
covertStatus(status) {
|
||||
const statusDict = {'0':'尚未参赛', '1':'进入赛场', '2':'理论赛场', '3':'实操赛场', '4':'完成比赛', '5':'完成理论', '6':'完成实操'};
|
||||
return statusDict[status];
|
||||
},
|
||||
getData() {
|
||||
const formModel = this.$refs.queryListPage.getFormModel();
|
||||
const params = {raceId:this.$route.query.raceId, pageSize:999, pageNum:1, name: formModel ? formModel.name : '', organization: formModel ? formModel.organization : ''};
|
||||
getRaceUserList(params).then(response=>{
|
||||
this.queryList.data = response.data.list;
|
||||
this.refresh();
|
||||
clearTimeout(this.inter);
|
||||
this.inter = setTimeout(() => {
|
||||
if (!this.isLeaving) {
|
||||
this.getData();
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
},
|
||||
handleTheoryResult(index, row) {
|
||||
this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId});
|
||||
// this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
|
||||
},
|
||||
covert(data) {
|
||||
if (data != undefined) {
|
||||
if (data > 0) {
|
||||
return data;
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
const obj = document.getElementById('queryFormFilesInput');
|
||||
if (!obj.files) return;
|
||||
const f = obj.files[0];
|
||||
const reader = new FileReader();
|
||||
const that = this;
|
||||
reader.readAsText(f, 'utf-8');
|
||||
reader.onload = function(e) {
|
||||
const data = e.target.result;
|
||||
// console.log(JSON.parse(data));
|
||||
loadingPaper(that.$route.query.raceId, JSON.parse(data)).then(res => {
|
||||
that.$message.success('试题加载成功');
|
||||
loading.close();
|
||||
}).catch(error => {
|
||||
loading.close();
|
||||
that.$message.error('试题加载失败' + error.message);
|
||||
});
|
||||
obj.value = '';
|
||||
};
|
||||
});
|
||||
},
|
||||
// 查询函数
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.raceId) {
|
||||
params['raceId'] = this.$route.query.raceId;
|
||||
params['pageSize'] = 999;
|
||||
}
|
||||
return getRaceUserList(params);
|
||||
},
|
||||
handleClick(index, row) {
|
||||
const group = row.group;
|
||||
getPublishMapInfo(this.mapId).then(resp=>{
|
||||
refereeEnterSimulation(group).then(response=>{
|
||||
const query = { lineCode: resp.data.lineCode, mapId: this.mapId, group: group, raceId: this.$route.query.raceId};
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query});
|
||||
});
|
||||
});
|
||||
},
|
||||
playBack(index, row) {
|
||||
const group = row.group;
|
||||
getPublishMapInfo(this.mapId).then(resp=>{
|
||||
playBackReady({group:group}).then(res=>{
|
||||
if (res.data) {
|
||||
const query = { lineCode: resp.data.lineCode, mapId: this.mapId, group: group, raceId: this.$route.query.raceId, userName:row.name};
|
||||
this.$router.push({ path: `/refereeJsxtDisplay`, query: query});
|
||||
} else {
|
||||
this.$messageBox('回放数据出错!');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
gradeScore(index, row) { // 裁判打分
|
||||
this.$refs.editScore.doShow(row);
|
||||
},
|
||||
refresh() {
|
||||
this.$refs.queryListPage.refresh(false);
|
||||
}
|
||||
// loadQuestions() {
|
||||
// this.$refs.questionList.doShow();
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.raceName{
|
||||
padding: 15px 0px;
|
||||
font-size: 18px;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
color: #409eff;
|
||||
}
|
||||
</style>
|
@ -1,204 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="menuReplay">
|
||||
<div class="replay" @click="startPlaying">
|
||||
<span v-if="isPlaying" class="ToPause" style="padding: 3px 0px">||</span>
|
||||
<span v-else class="el-icon-caret-right" />
|
||||
</div>
|
||||
<div class="playSpeedGroup">
|
||||
<div class="speedAdd" :style="isAddDisabled?'cursor:no-drop;':''" @click="addSpeed">
|
||||
<span class="el-icon-plus" />
|
||||
</div>
|
||||
<div class="speedNum">{{ playSpeedList[playSpeedIndex].name }}</div>
|
||||
<div class="speedMinus" :style="isMinusDisabled?'cursor:no-drop;':''" @click="minusSpeed">
|
||||
<span class="el-icon-minus" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="comercialName">{{ userName }}的实操回放</div>
|
||||
<el-button type="primary" class="back" @click="back">返回</el-button>
|
||||
<chat-box :group="group" :user-role="userRole" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Notification } from 'element-ui';
|
||||
import ChatBox from '@/views/newMap/chatView/chatBox';
|
||||
import {setPlaySpeed, startPlaying, playingPause, endPlaying, fromPauseToPlay} from '@/api/competition';
|
||||
export default {
|
||||
name:'MenuPlay',
|
||||
components:{
|
||||
ChatBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
playSpeedIndex:5,
|
||||
playSpeedList:[
|
||||
{level:'-5', name:'-5X'},
|
||||
{level:'-4', name:'-4X'},
|
||||
{level:'-3', name:'-3X'},
|
||||
{level:'-2', name:'-2X'},
|
||||
{level:'-1', name:'-1X'},
|
||||
{level:'1', name:'1X'},
|
||||
{level:'2', name:'2X'},
|
||||
{level:'3', name:'3X'},
|
||||
{level:'4', name:'4X'},
|
||||
{level:'5', name:'5X'}
|
||||
],
|
||||
userRole:'AUDIENCE',
|
||||
isFirstPlay:true,
|
||||
isPlaying:false
|
||||
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
userName() {
|
||||
return this.$route.query.userName;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
isAddDisabled() {
|
||||
return this.playSpeedIndex >= this.playSpeedList.length - 1;
|
||||
},
|
||||
isMinusDisabled() {
|
||||
return this.playSpeedIndex <= 0;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.playBackFinish':function() {
|
||||
this.isPlaying = false;
|
||||
this.isFirstPlay = true;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
// if (this.isPlaying) {
|
||||
endPlaying({}).then(res=>{
|
||||
});
|
||||
// }
|
||||
},
|
||||
methods:{
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
});
|
||||
},
|
||||
addSpeed() {
|
||||
if (this.playSpeedIndex < this.playSpeedList.length - 1) {
|
||||
this.playSpeedIndex++;
|
||||
// if (this.isPlaying) {
|
||||
// // 暂停播放
|
||||
// playingPause({}).then(res=>{
|
||||
// this.isPlaying = false;
|
||||
// setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
|
||||
// });
|
||||
// });
|
||||
|
||||
// } else {
|
||||
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
|
||||
});
|
||||
// }
|
||||
|
||||
}
|
||||
},
|
||||
minusSpeed() {
|
||||
if (this.playSpeedIndex > 0) {
|
||||
this.playSpeedIndex--;
|
||||
// if (this.isPlaying) {
|
||||
// // 暂停播放
|
||||
// playingPause({}).then(res=>{
|
||||
// this.isPlaying = false;
|
||||
// setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
|
||||
});
|
||||
// }
|
||||
|
||||
}
|
||||
},
|
||||
startPlaying() {
|
||||
if (this.isPlaying) {
|
||||
// 暂停播放
|
||||
playingPause({}).then(res=>{
|
||||
this.isPlaying = false;
|
||||
});
|
||||
} else {
|
||||
if (this.isFirstPlay) {
|
||||
// 第一次播放
|
||||
startPlaying({}).then(res=>{
|
||||
this.isPlaying = true;
|
||||
this.isFirstPlay = false;
|
||||
});
|
||||
} else {
|
||||
// 从暂停中播放
|
||||
fromPauseToPlay({}).then(res=>{
|
||||
this.isPlaying = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ToPause{
|
||||
display: inline-block;
|
||||
}
|
||||
.menuReplay{
|
||||
position: absolute;
|
||||
width: 215px;
|
||||
height: 40px;
|
||||
right: 20px;
|
||||
top: 15px;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
font-size: 0px;
|
||||
}
|
||||
.replay,.speedAdd,.speedMinus{
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
background: #409EFF;
|
||||
border-radius: 5px;
|
||||
margin-left: 9px;
|
||||
margin-top: 8px;
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
}
|
||||
.replay span,.speedAdd span,.speedMinus span{
|
||||
font-size: 16px;
|
||||
padding: 4px 0px;
|
||||
}
|
||||
.playSpeedGroup{display: inline-block;font-size:0px;}
|
||||
.speedNum{
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
border: 1px #dedede solid;
|
||||
padding: 3px 0px;
|
||||
margin-left: 9px;
|
||||
font-size: 15px;
|
||||
height: 24px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.back{
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
bottom: 15px;
|
||||
}
|
||||
.comercialName{
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 0px;
|
||||
padding: 10px 30px;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
-webkit-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
background: #fff;
|
||||
border-radius: 0px 0px 10px 10px;
|
||||
}
|
||||
</style>
|
@ -1,81 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="show" class="TheroyResult" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false">
|
||||
<div style="max-height:500px;overflow:auto;">
|
||||
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
|
||||
<template v-if="el.children.length">
|
||||
<div class="caption">{{ index2UnicodeList[i] }}、{{ el.title }}</div>
|
||||
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-left: 20px;margin-top: 20px;">
|
||||
<span>考试总分: </span>
|
||||
<span style="font-size: 20px">{{ totalScore }}分</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Question from '@/views/jsxt/competition/theory/question';
|
||||
import { getTheroyCompetitionResult } from '@/api/competition';
|
||||
export default {
|
||||
name:'TheroyResult',
|
||||
components:{
|
||||
Question
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title:'',
|
||||
show: false,
|
||||
loading:false,
|
||||
totalScore: 0,
|
||||
examQuestions: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
question() {
|
||||
return this.examQuestions[this.index] || {};
|
||||
},
|
||||
index2UnicodeList() {
|
||||
return ['一', '二', '三', '四'];
|
||||
},
|
||||
sortedList() {
|
||||
return [
|
||||
{
|
||||
title: '判断题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
|
||||
},
|
||||
{
|
||||
title: '选择题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'select'; })
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow({row, raceId}) {
|
||||
this.loadInitData(raceId, row.id);
|
||||
this.show = true;
|
||||
this.title = '【' + row.organization + '】' + row.name + ' 理论结果';
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
loadInitData(raceId, userId) {
|
||||
this.examQuestions = [];
|
||||
getTheroyCompetitionResult(raceId, userId).then((resp)=>{
|
||||
if (resp.data) {
|
||||
resp.data.forEach((item, i) => {
|
||||
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
|
||||
});
|
||||
this.totalScore = resp.data.reduce((pre, ver) => pre + ver.score, 0);
|
||||
}
|
||||
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.TheroyResult .el-dialog .el-dialog__body{
|
||||
padding-top:10px !important;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user