This commit is contained in:
zyy 2020-05-20 18:33:08 +08:00
commit 81187912f0
10 changed files with 192 additions and 54 deletions

View File

@ -37,6 +37,23 @@ export function participantCompleteCompetition(id, group) {
});
}
/** 分页获取地图下的实操列表 */
export function getQuestionListByMapId(params) {
return request({
url: `/api/v1/competitionPractical`,
method: 'get',
params
});
}
// 加载实操及内容
export function loadQuestionList(data) {
return request({
url: `/api/v1/competitionPractical/distribute`,
method: 'post',
data
});
}
/** 竞赛报名 */
export function postSignUp(id, data) {
return request({

View File

@ -559,6 +559,12 @@ class SkinCode extends defaultStyle {
trainBodyFillColor: '#725A64', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
},
soonerOrLater: {
level: 3,
earlyColor: '#00FF00',
lateColor: '#F4A460',
normalColor: '#FFF'
},
directionArrow: {
},
hsda: {

View File

@ -560,6 +560,7 @@ class SkinCode extends defaultStyle {
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
},
soonerOrLater: {
level: 5,
earlyColor: '#00FF00',
severeEarlyColor: '#0000FF',
lateColor: '#FF00FF',

View File

@ -233,7 +233,8 @@ class SkinCode extends defaultStyle {
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
circle: true // 空心圆环
},
stopTime: { // 停站时间
position: 1, // 运行时间方向

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle';
class EDetain extends Group {
constructor(model) {
@ -29,6 +30,24 @@ class EDetain extends Group {
textVerticalAlign: style.textStyle.textVerticalAlign
}
});
if (style.StationStand.detainCar.circle) {
const offsetX = model.right ? 8 : -8;
this.circleDetain = new Circle({
zlevel: model.zlevel,
z: model.z,
shape: {
cx: model.x + offsetX,
cy: model.y - 3,
r: 2
},
style: {
fill: '#000',
lineWidth: 1,
stroke: '#FFf'
}
});
this.add(this.circleDetain);
}
this.add(this.detain);
}
}

View File

@ -308,7 +308,7 @@ export default class TrainBody extends Group {
}
}
setSoonerOrLater(dt) {
if (this.style.Train.soonerOrLater) {
if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 5) {
if (dt > 120) {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.severeEarlyColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.severeEarlyColor});
@ -325,7 +325,14 @@ export default class TrainBody extends Group {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.normalColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.normalColor});
}
} else if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 3) {
if (dt > 0) {
} else if (dt < 0) {
} else {
}
}
}
formatChangePosition(model, style) {

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -70,6 +70,15 @@ export default {
name: '修改',
handleClick: this.update,
type: ''
},
{
name: '报名地址',
handleClick: this.showApplyUrl,
type: ''
},
{
name: '参赛地址',
handleClick: this.showJoinUrl
}
]
}
@ -106,6 +115,12 @@ export default {
},
update(index, row) {
this.$refs.createRace.doShow(row);
},
showJoinUrl(index, row) {
this.$messageBox(`${row.name}参赛路径:${window.location.protocol}//${window.location.host}/jsxt/login?raceId=${row.id}`);
},
showApplyUrl(index, row) {
this.$messageBox(`${row.name}报名路径:${window.location.protocol}//${window.location.host}/jsxtApply?raceId=${row.id}`);
}
}
};

View File

@ -1,81 +1,61 @@
<template>
<div class="content_box">
<div class="refresh_box">
<el-button type="primary" size="small" @click="startExam">开始考试</el-button>
<el-button size="small" @click="refresh">刷新列表</el-button>
<div class="refresh_box_out">
<div class="refresh_box">
<el-button type="primary" size="small" @click="loadQuestions">加载试题</el-button>
<el-button size="small" @click="refresh">刷新列表</el-button>
</div>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="name" label="姓名" />
<el-table-column prop="numberId" label="身份证号" />
<el-table-column prop="company" label="公司" />
<el-table-column prop="department" label="部门" />
<el-table-column prop="value" label="分数" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handleClick(scope.row)">查看</el-button>
<el-button size="small">打分</el-button>
</template>
</el-table-column>
</el-table>
<el-card class="tableList">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="roomName" label="房间名">
<template slot-scope="scope">{{ scope.row.roomName+'的房间' }}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handleClick(scope.row)">进入</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<question-list ref="questionList" />
</div>
</template>
<script>
// import { getPublishMapDetailList } from '@/api/jmap/map';
import { loadingPractical } from '@/api/practical';
import {refereeGetCompetitionList} from '@/api/competition';
import QuestionList from './questionList';
export default {
name: 'RefereeList',
components:{
QuestionList
},
data() {
return {
tableData: [{
numberId: '142652197505972679',
name: '王小虎',
company: '西安地铁公司',
department: '调度一部',
value: ''
}, {
numberId: '142652197505972679',
name: '王小虎',
company: '西安地铁公司',
department: '调度一部',
value: ''
}, {
numberId: '142652197505972679',
name: '王小虎',
company: '西安地铁公司',
department: '调度一部',
value: ''
}, {
numberId: '142652197505972679',
name: '王小虎',
company: '西安地铁公司',
department: '调度一部',
value: ''
}]
tableData: []
};
},
computed: {
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
refereeGetCompetitionList(1).then(response=>{
this.tableData = response.data;
});
},
handleClick(row) {
console.log(row);
},
refresh() {
console.log('列表刷新');
this.loadInitData();
},
startExam() {
// console.log('');
loadingPractical([1]).then(resp => {
console.log(resp, '123122');
});
loadQuestions() {
this.$refs.questionList.doShow();
}
}
};
@ -88,4 +68,13 @@ export default {
margin: 10px;
}
}
.tableList{
width: 50%;
margin-left: 25%;
border-radius:10px;
}
.refresh_box_out{
display: inline-block;
width: 100%;
}
</style>

View File

@ -0,0 +1,83 @@
<template>
<el-dialog
v-dialogDrag
title="试题列表"
:visible.sync="show"
top="20px"
width="500px"
:before-do-close="doClose"
:close-on-click-modal="false"
>
<el-table :data="questionList" style="width: 100%" border @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
/>
<el-table-column prop="name" label="试题名称" />
</el-table>
<div class="startExam">
<span><el-button type="primary" :loading="loading" @click="startExam">开始竞赛</el-button></span>
</div>
</el-dialog>
</template>
<script>
import {getQuestionListByMapId, loadQuestionList} from '@/api/competition';
export default {
name:'QuestionList',
data() {
return {
show: false,
loading:false,
questionList:[
{id:1, name:'实操试题1'},
{id:2, name:'实操试题2'},
{id:3, name:'实操试题3'},
{id:4, name:'实操试题4'},
{id:5, name:'实操试题5'},
{id:6, name:'实操试题6'},
{id:7, name:'实操试题7'}
],
multipleSelection:[]
};
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
reloadTable() {
getQuestionListByMapId({mapId:41, pageNum:10, pageSize:1}).then(response=>{
// this.questionList = response.data;
});
},
doClose() {
this.show = false;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
startExam() {
if (this.multipleSelection.length > 0) {
const ids = [];
this.multipleSelection.forEach(question=>{
ids.push(question.id);
});
loadQuestionList(ids).then((response)=>{
this.$message('开始考试成功!');
this.doClose();
}).catch(()=>{
this.$message('开始考试失败');
});
} else {
this.$messageBox('请选择试题');
}
}
}
};
</script>
<style lang="scss" scoped>
.startExam{
text-align:center;
margin-top:20px;
}
</style>