裁判平台代码调整

This commit is contained in:
joylink_cuiweidong 2020-05-22 16:26:59 +08:00
parent 4210599f6b
commit 44f5e7a87c
7 changed files with 203 additions and 299 deletions

View File

@ -67,6 +67,10 @@
</template> </template>
</template> </template>
</div> </div>
<div class="deviceStatus">
<div class="holdTrainStatus">H</div>
<div class="jumpStopStatus">S</div>
</div>
<station-control-convert ref="stationControlConvert" /> <station-control-convert ref="stationControlConvert" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" /> <password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" /> <view-train-id ref="viewTrainId" />
@ -694,7 +698,8 @@ export default {
<style scoped rel="stylesheet/scss" lang="scss"> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$width: 30px; $width: 30px;
$height: 30px; $lineHeight: 30px;
$height:74px;
$menuPadding: 10px; $menuPadding: 10px;
$menuItemHeight: 30px; $menuItemHeight: 30px;
$menuItemWidth: 190px; $menuItemWidth: 190px;
@ -705,7 +710,7 @@ export default {
position: absolute; position: absolute;
width: inherit; width: inherit;
height: $height; height: $height;
line-height: $height; line-height: $lineHeight;
} }
.nav { .nav {
@ -810,4 +815,21 @@ export default {
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
} }
.deviceStatus{
display: inline-block;
font-size: 0;
height: 40px;
background: #f0f0f0;
width: 300px;
}
.holdTrainStatus,.jumpStopStatus{
color: #fff;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
background: #ccc;
font-size:14px;
}
</style> </style>

View File

@ -132,8 +132,6 @@ const JsxtExamResult = () => import('@/views/jsxt/competition/result');
const JsxtApply = () => import('@/views/jsxt/apply/index'); const JsxtApply = () => import('@/views/jsxt/apply/index');
// const theoryManage = () => import('@/views/jsxt/competition/theory/index'); // const theoryManage = () => import('@/views/jsxt/competition/theory/index');
const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeList = () => import('@/views/jsxt/refereeList/index');
const homeJsxt = () => import('@/views/jsxt/home/index');
const RecaList = () => import('@/views/jsxt/reca/list');
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -1020,34 +1018,16 @@ export const JSXT = [
hidden: true hidden: true
} }
}, },
// 裁判系统
{ {
path: '/refereeJsxt', path: '/refereeJsxt',
redirect: '/refereeJsxt/home',
component: Layout, component: Layout,
meta: { meta: {
i18n: 'router.homeJsxt', i18n: 'router.homeJsxt',
roles: [user, admin] roles: [user, admin]
}, },
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), hidden: true,
children: [
{
path: 'preview',
component: homeJsxt,
meta: {
i18n: 'router.homeJsxt',
icon: 'design',
hidden: true
}
}
]
},
{
path: '/referee',
component: Layout,
meta: {
i18n: 'router.refereeJManage',
roles: [user, admin]
},
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'),
children: [ children: [
{ {
path: 'home', path: 'home',
@ -1059,26 +1039,6 @@ export const JSXT = [
} }
} }
] ]
},
{
path: '/referee',
component: Layout,
meta: {
i18n: 'router.recaList',
roles: [user, admin]
},
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'),
children: [
{
path: 'recaList',
component: RecaList,
meta: {
i18n: 'router.recaList',
icon: 'design',
hidden: true
}
}
]
} }
]; ];
const createRouter = () => new Router({ const createRouter = () => new Router({

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // 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.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6: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.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -1,37 +0,0 @@
<template>
<div class="content_box">
<h4>欢迎进入城市轨道交通裁判平台</h4>
</div>
</template>
<script>
export default {
name: 'RefereeList',
data() {
return {
};
},
computed: {
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.content_box{
position: relative;
.refresh_box{
float: right;
margin: 10px;
}
}
</style>

View File

@ -1,143 +0,0 @@
<template>
<div class="">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { getRaceList } from '@/api/race';
import { getRaceUserList } from '@/api/competition';
import localStore from 'storejs';
export default {
name: '',
data() {
return {
raceList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
raceId: {
type: 'select',
label: '竞赛名称',
config: {
data: []
}
},
reviewed: {
type: 'select',
label: '审核状态',
config: {
data: [
{ label: '通过', value: true },
{ label: '不通过', value: false }
]
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '名字',
prop: 'name'
},
{
title: '手机号',
prop: 'mobile'
},
{
title: '身份证号',
prop: 'idNumber'
},
{
title: '所属组织/企业/学校',
prop: 'organization'
},
{
title: '部门/专业',
prop: 'department'
},
{
title: '职位',
prop: 'position'
},
// {
// 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.update,
// type: ''
// }
]
}
],
actions: []
}
};
},
created() {
this.loadInitData();
},
methods: {
async loadInitData() {
const params = localStore.get(this.$route.path);
const param = {
pageSize: 9999,
pageIndex: 1
};
this.raceList = [];
const resp = await getRaceList(param);
resp.data.list.forEach(elem => {
this.queryForm.queryObject.raceId.config.data.push({ value: elem.id, label: elem.name });
this.raceList.push({ value: elem.id, label: elem.name });
});
if (resp.data.list.length) {
if (params && params.raceId) {
this.queryForm.queryObject.raceId.value = params.raceId;
} else {
this.queryForm.queryObject.raceId.value = '' + resp.data.list[0].id;
}
}
},
//
queryFunction(params) {
return new Promise(async(resolve, reject) => {
if (params.raceId) {
const res = await getRaceUserList(params);
resolve(res);
} else {
setTimeout(() => {
params.raceId = this.queryForm.queryObject.raceId.value;
resolve(this.queryFunction(params));
}, 500);
}
});
},
refresh() {
this.$refs.queryListPage.refresh(true);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -1,48 +1,140 @@
<template> <template>
<div class="content_box"> <div class="refereeList">
<div class="refresh_box_out"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="refresh_box"> <!-- <question-list ref="questionList" /> -->
<el-button type="primary" size="small" @click="loadQuestions">加载试题</el-button>
<el-button size="small" @click="refresh">刷新列表</el-button>
</div>
</div>
<el-card class="tableList">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="name" label="用户名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column prop="organization" label="公司" />
<el-table-column prop="department" label="部门" />
<el-table-column prop="position" label="职位" />
<el-table-column prop="score" label="评分">
<template slot-scope="scope">{{ scope.row.score?scope.row.score:0 }}</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> </div>
</template> </template>
<script> <script>
// import { getPublishMapDetailList } from '@/api/jmap/map';
import {refereeGetCompetitionList, refereeEnterSimulation} from '@/api/competition'; import {refereeGetCompetitionList, refereeEnterSimulation} from '@/api/competition';
import {getPermissionJointNew} from '@/api/jointTraining'; import {getPermissionJointNew} from '@/api/jointTraining';
import QuestionList from './questionList'; // import QuestionList from './questionList';
export default { export default {
name: 'RefereeList', name: 'RefereeList',
components:{ components:{
QuestionList // QuestionList
}, },
data() { data() {
return { return {
tableData: [], pagerConfig: {
isLeaving:false pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '名字'
},
organization: {
type: 'text',
label: '公司'
}
}
},
queryList: {
data:[
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'01'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'02'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'03'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'04',
score:80
}
],
// query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '名字',
prop: 'name'
},
{
title: '手机号',
prop: 'mobile'
},
{
title: '公司',
prop: 'organization'
},
{
title: '部门',
prop: 'department'
},
{
title: '状态',
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.covertStatus(row.status); },
tagType: (row) => { return 'success'; }
},
{
title: '分数',
prop: 'score'
},
// {
// 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 == '02' || row.status == '03'; }
},
{
name: '回放',
handleClick: this.playBack,
type: '',
showControl: (row) => { return row.status == '04'; }
},
{
name: '打分',
handleClick: this.gradeScore,
type: 'success',
showControl: (row) => { return row.status == '04'; }
}
]
}
],
actions: [
{ text: '导入试题', handler: this.handleAdd }
]
}
// isLeaving:false
}; };
}, },
computed: { computed: {
@ -51,21 +143,35 @@ export default {
this.loadInitData(); this.loadInitData();
}, },
beforeDestroy() { beforeDestroy() {
this.isLeaving = true; // this.isLeaving = true;
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.getData(); // this.getData();
}, },
getData() { covertStatus(status) {
refereeGetCompetitionList(1).then(response=>{ const statusDict = {'01':'未考试', '02':'准备中', '03':'考试中', '04':'考试结束'};
this.tableData = response.data; return statusDict[status];
setTimeout(() => { },
if (!this.isLeaving) { // getData() {
this.getData(); // refereeGetCompetitionList(1).then(response=>{
// this.tableData = response.data;
// setTimeout(() => {
// if (!this.isLeaving) {
// this.getData();
// }
// }, 2000);
// });
// },
handleAdd() {
},
//
queryFunction(params) {
if (this.$route.query.raceId) {
params['id'] = this.$route.query.raceId;
} }
}, 2000); return refereeGetCompetitionList(this.$route.query.raceId);
});
}, },
handleClick(row) { handleClick(row) {
const group = row.room.group; const group = row.room.group;
@ -76,30 +182,20 @@ export default {
}); });
}); });
}, },
refresh() { playBack() {
this.loadInitData();
}, },
loadQuestions() { gradeScore() {
this.$refs.questionList.doShow();
},
refresh() {
this.$refs.queryListPage.refresh(true);
} }
// loadQuestions() {
// this.$refs.questionList.doShow();
// }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.content_box{
position: relative;
.refresh_box{
float: right;
margin: 10px;
}
}
.tableList{
width:94%;
margin-left: 3%;
margin-top: 5px;
}
.refresh_box_out{
display: inline-block;
width: 100%;
}
</style> </style>

View File

@ -223,7 +223,7 @@ export default {
this.cookiesToken = 'UserDesignToken'; this.cookiesToken = 'UserDesignToken';
this.modelType = 'design'; this.modelType = 'design';
this.loginClient = 'Design'; this.loginClient = 'Design';
this.path = '/refereeJsxt/preview'; this.path = '/refereeJsxt/home';
} }
const nowLang = LangStorage.getLang('zh'); const nowLang = LangStorage.getLang('zh');
@ -336,17 +336,23 @@ export default {
this.tipsMsg = ''; this.tipsMsg = '';
removeSessionStorage('againEnter'); removeSessionStorage('againEnter');
if (this.$route.query.raceId) { if (this.$route.query.raceId) {
if (this.$route.path.includes('jsxt/login')) {
getIsSignUp(this.$route.query.raceId).then(res => { getIsSignUp(this.$route.query.raceId).then(res => {
if (res.data) { if (res.data) {
this.$router.push({ path: this.path }); this.$router.push({ path: this.path, query:{raceId:this.$route.query.raceId} });
} else {
this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统');
} }
}).catch(() => { }).catch(() => {
this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统'); this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统');
}); });
} else if (!this.$route.path.includes('jsxt/login')) { } else {
this.$router.push({ path: this.path, query:{raceId:this.$route.query.raceId} });
}
} else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) {
this.$router.push({ path: this.path }); this.$router.push({ path: this.path });
} else { } else {
this.$messageBox('请调整路径参数'); this.$messageBox('请输入正确的链接地址');
} }
}, },
handleLanguage() { handleLanguage() {