This commit is contained in:
joylink_cuiweidong 2020-05-29 18:16:43 +08:00
commit ba23dbe2b7
23 changed files with 291 additions and 119 deletions

View File

@ -416,7 +416,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#870E10', // 道岔单锁'定位'颜色
monolockInversionColor: '#870E10', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -383,7 +383,8 @@ class SkinCode extends defaultStyle {
locateColor: 'lightgreen', // 道岔定位颜色
inversionColor: 'lightgreen', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -366,7 +366,8 @@ class SkinCode extends defaultStyle {
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -404,7 +404,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: '#c00000', // 道岔单锁'定位'颜色 (红色)
monolockInversionColor: '#c00000', // 道岔单锁'反位'颜色 (红色)
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -386,7 +386,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -413,7 +413,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#fff', // 道岔反位颜色
monolock: true, // 名称单锁显示包围框
monolockLocationColor: '#fff', // 道岔单锁'定位'颜色
monolockInversionColor: '#fff' // 道岔单锁'反位'颜色
monolockInversionColor: '#fff', // 道岔单锁'反位'颜色
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: true, // 道岔 关联区段显示

View File

@ -269,7 +269,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: 'lightgreen', // 道岔单锁'定位'颜色 (浅绿色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -408,7 +408,9 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: false, // 故障闪烁
lossRect: true // 道岔失表矩形
},
sectionAction: {
flag: false, // 道岔 关联区段显示
@ -466,7 +468,7 @@ class SkinCode extends defaultStyle {
this[deviceType.SwitchFault] = {
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
text: {
fontSize: 11, // 字体大小
fontSize: 14, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},

View File

@ -436,7 +436,8 @@ class SkinCode extends defaultStyle {
locateColor: '#FFFFFF', // 道岔定位颜色
inversionColor: '#FFFFFF', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -224,4 +224,7 @@ export default class SaidLamp extends Group {
this.isShowShape = false;
}
}
setControlColor(color) {
this.control && this.control.setControlColor(color);
}
}

View File

@ -50,6 +50,9 @@ class ESwLocal extends Group {
cb(child);
});
}
getLocal() {
return this.locShelter;
}
}
export default ESwLocal;

View File

@ -4,6 +4,7 @@
import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import JTriangle from '../../utils/JTriangle';
import ESwName from './ESwName.js';
import ESwLocal from './ESwLocal.js';
@ -105,7 +106,27 @@ export default class Switch extends Group {
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
if (this.style.Switch.text.lossRect) {
const lossRect = this.locShelter.getLocal().getBoundingRect();
this.lossShow = new Rect({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x: lossRect.x - 5,
y: lossRect.y - 5,
width: lossRect.width + 10,
height: lossRect.height + 10
},
style: {
fill: 'rgba(0, 0, 0, 1)',
lineDash: [3, 3],
stroke: '#F00',
lineWidth: 1
}
});
this.add(this.lossShow);
this.lossShow.hide();
}
const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength;
const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1];
const Tspoint2 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]];
@ -268,6 +289,8 @@ export default class Switch extends Group {
this.locShelter.hide(); // 定位覆盖图形
this.relocShelter.hide(); // 反位覆盖图形
this.enabledName.hide(); // 使能隐藏
this.lossShow && this.lossShow.hide();
this.lossShow && this.lossShow.stopAnimation(false);
}
/** 定位*/
@ -298,7 +321,7 @@ export default class Switch extends Group {
}
/** 失去*/
setLossAction(nameFlicker) {
setLossAction() {
// this.recover();
this.locShelter.show();
this.relocShelter.show();
@ -306,9 +329,24 @@ export default class Switch extends Group {
this.sheltertriangle.show();
this.sheltertriangle.setColor(this.style.backgroundColor);
this.setTextColor(this.style.Switch.text.lossColor);
nameFlicker && this.nameTextAnimation();
}
this.style.Switch.text.faultFlashing && this.nameTextAnimation();
this.lossShow && this.lossShow.show();
this.lossShow && this.lossShow.animateStyle(true)
.when(0, { stroke: this.style.backgroundColor })
.when(1000, { stroke: '#F00' })
.when(2000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(split) {
if (this.model.switchFaultCode && split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor('#F00');
} else if (this.model.switchFaultCode && !split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor(this.style.backgroundColor);
}
}
/** 挤叉*/
setForkAction() {
this.rhomboid.hide(); // 平行四边形
@ -479,8 +517,9 @@ export default class Switch extends Group {
} else if (model.reversePosition) {
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction(true);
this.setLossAction();
}
/** 道岔单锁 */
model.singleLock && this.setMonolock();
/** 道岔封锁 */
@ -490,6 +529,7 @@ export default class Switch extends Group {
// this.setForkAction(); // 道岔挤岔完成
// 道岔使能显示
model.isCiConfirm && this.setCiConfirm();
this.setSwitchFault(model.split);
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];

View File

@ -93,7 +93,7 @@ export default {
operation: '',
planMode: 5,
headMode: 5,
fontSize: 16
fontSize: 30
};
},
computed: {

View File

@ -36,7 +36,7 @@ class Model {
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
nameFontSize: 30 // 字体大小
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true

View File

@ -150,6 +150,48 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.powerLineList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];
if (cnodeSection && lnodeSection && rnodeSection) {
cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code];
const sectionParent = mapDevice[cnodeSection.parentCode];
if (sectionParent) {
sectionParent['switch'] = mapDevice[elem.code];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[0].x,
y: cnodeSection.points[0].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[rnodeSection.points.length - 2].x,
y: rnodeSection.points[rnodeSection.points.length - 2].y
};
} else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[cnodeSection.points.length - 1].x,
y: cnodeSection.points[cnodeSection.points.length - 1].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[1].x,
y: rnodeSection.points[1].y
};
}
const section = mapDevice[cnodeSection.parentCode];
if (section) {
mapDevice[elem.code].sectionName = section.name;
mapDevice[elem.code].sectionParentCode = section.code;
section['relSwitchCode'] = elem.code;
}
rnodeSection['layer'] = -1;
}
}, this);
zrUtil.each(data.indicatorLightList || [], elem => {
switch (elem.type) {
case 'AtsControl':
@ -205,6 +247,7 @@ export function parser(data, skinCode, showConfig) {
break;
case 'SwitchFault':
mapDevice[elem.code] = createDevice(deviceType.SwitchFault, elem, propConvert, showConfig);
mapDevice[elem.switchCode].switchFaultCode = elem.code; // 道岔数据上关联道岔故障表示灯需保证该数据在switchList之后处理
break;
}
}, this);
@ -218,49 +261,6 @@ export function parser(data, skinCode, showConfig) {
}
}
}, this);
zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];
if (cnodeSection && lnodeSection && rnodeSection) {
cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code];
const sectionParent = mapDevice[cnodeSection.parentCode];
if (sectionParent) {
sectionParent['switch'] = mapDevice[elem.code];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[0].x,
y: cnodeSection.points[0].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[rnodeSection.points.length - 2].x,
y: rnodeSection.points[rnodeSection.points.length - 2].y
};
} else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[cnodeSection.points.length - 1].x,
y: cnodeSection.points[cnodeSection.points.length - 1].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[1].x,
y: rnodeSection.points[1].y
};
}
const section = mapDevice[cnodeSection.parentCode];
if (section) {
mapDevice[elem.code].sectionName = section.name;
mapDevice[elem.code].sectionParentCode = section.code;
section['relSwitchCode'] = elem.code;
}
rnodeSection['layer'] = -1;
}
}, this);
}
return mapDevice;

View File

@ -2,11 +2,11 @@ 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.82:9000'; // 杜康
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -2,15 +2,64 @@
<div class="emergency_release">
<div class="emergency_release_header">
<div class="emergency_header_text">中心PIS紧急信息一览</div>
<el-table v-model="tableData" :header-cell-style="headerCellStyle" height="50%" style="width: 94%; position: relative;left: 3%">
<el-table-column prop="time" label="时间" width="150" />
<el-table-column prop="description" label="信息描述" />
<el-table-column prop="level" label="等级" />
</el-table>
<div style="width: 75%; position: relative;left: 3%;background: #FFF;margin-top: 10px;padding: 2px;display: inline-block">
<div style="width: 100%;text-align: center;font-size: 13px;padding-top:5px;">显示内容</div>
<div style="width:100%; height: 100px; border: 1px solid #000;" />
</div>
<div style="width: 15%;background: #939FAC; display: inline-block;margin-left: 6%;margin-top: 10px;">
<div class="emergency_select_button">区域详细</div>
<div style="width: 100%;text-align: center;color: #FFF;font-size: 13px;background: #121A86;">紧急信息清除</div>
<div class="emergency_select_button">清除</div>
</div>
</div>
</div>
</template>
<script>
export default {
name:'EmergencyRelease',
data() {
return {
tableData: [],
headerCellStyle: {background: '#121A86', height: '25px', color: '#FFF'}
};
}
};
</script>
<style lang="scss" scoped>
.emergency_release{padding:20px;}
.emergency_header_text{margin-top:10px;text-align: center;color: #9af1ec;font-size: 18px;padding-bottom: 10px;}
.emergency_select_button {
text-align: center;
width: 90px;
height: 30px;
background: #A9A9A9;
border-top: 2px solid #FFF;
border-left: 2px solid #FFF;
border-right: 2px solid #898888;
border-bottom: 2px solid #898888;
margin: 5px 12px 10px;
font-size: 14px;
line-height: 30px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.emergency_select_button :active {
border-top: 2px solid #898888;
border-left: 2px solid #898888;
border-right: 2px solid #FFF;
border-bottom: 2px solid #FFF;
}
/deep/
.el-table th{
padding: 0;
}
</style>

View File

@ -3,7 +3,7 @@
<div class="lcdControl_title">LCD控制屏</div>
<div class="area_select" style="margin-top: 110px;">
<div class="area_select_title">特定区域</div>
<div class="area_select_button">全线</div>
<div class="area_select_button" @click="selectedAllArea">全线</div>
</div>
<div class="area_select" style="margin-top: 200px;">
<div>
@ -15,23 +15,28 @@
</div>
<div class="lcd_content_box">
<div>
<div style="display: inline-block;">
<div class="lcd_content_box_left_title">车站</div>
<div class="lcd_content_box_left_title">选择</div>
</div>
<div v-for="(station, index) in stationList" :key="index" style="display: inline-block;text-align: center;">
<div class="each_station_info">{{ station }}</div>
<div class="button_default_content">
<div class="button_default" :style="{background:selectedAreaList.includes(station.stationName + '-' + index)?'#2EFF74':'#CDCDCD'}" />
<div style="display: inline-block;position:absolute;width: 50px;z-index: 2;background: #45607B;">
<div class="lcd_content_box_left_title">车站</div>
<div class="lcd_content_box_left_title">选择</div>
</div>
<div style="width: 100%; overflow-x: auto;white-space: nowrap;height: 100%;">
<div style="position: relative; left: 50px;">
<div v-for="(station, index) in stationList" :key="index" style="display: inline-block;text-align: center;">
<div class="each_station_info" @click="selectedArea(station)">{{ station }}</div>
<div class="button_default_content">
<div class="button_default" :style="{background:selectedAreaList.includes(station)?'#2EFF74':'#CDCDCD'}" @click="selectedArea(station)" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getByGroupStationList } from '@/api/jmap/map';
export default {
name:'LcdControl',
data() {
return {
columns: ['车站', '选择'],
@ -39,6 +44,35 @@ export default {
lcdSwitch: true,
selectedAreaList:[]
};
},
async created () {
// 线
try {
const res = await getByGroupStationList(this.$route.query.group);
if (res.code == 200) {
this.stationList = [];
res.data.forEach(station => {
if (!station.depot) {
this.stationList.push(station.name);
}
});
}
} catch (e) {
this.$message.error('获取车站列表失败!');
}
},
methods: {
selectedArea(station) {
const index = this.selectedAreaList.indexOf(station);
if (index < 0) {
this.selectedAreaList.push(station);
} else {
this.selectedAreaList.splice(index, 1);
}
},
selectedAllArea() {
this.selectedAreaList = [...this.stationList];
}
}
};
</script>
@ -81,9 +115,19 @@ export default {
margin: 5px 12px 10px;
font-size: 14px;
line-height: 30px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.area_select_button:active {
border-top: 2px solid #898888;
border-left: 2px solid #898888;
border-right: 2px solid #FFF;
border-bottom: 2px solid #FFF;
}
.each_station_info{
/*display: inline-block;*/
vertical-align:top;
font-size: 13px;
padding: 2px 2px;
@ -93,6 +137,11 @@ export default {
border-right: 2px solid #898888;
border-bottom: 2px solid #898888;
margin-right: 5px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.lcd_content_box{
margin-top: 110px;
@ -105,14 +154,12 @@ export default {
border-right: 3px solid #fff;
border-bottom: 3px solid #fff;
padding-top: 10px;
padding-left: 10px;
overflow-x: auto;
}
.lcd_content_box_left_title{
vertical-align:top;
font-size: 13px;
color: #CBFFFF;
padding: 10px 10px 5px;
padding: 5px 10px 10px;
}
.button_default_content{
margin-top: 5px;

View File

@ -103,24 +103,29 @@ export default {
},
async created () {
// 线
const res = await getByGroupStationList(this.$route.query.group);
if (res.code == 200) {
this.stationList = [];
res.data.forEach(station => {
if (!station.depot) {
const param = {
stationName: station.name,
children:[
{status:'none'}, {status:'default'},
{status:'default'}, {status:'default'},
{status:'none'}, {status:'none'},
{status:'none'}, {status:'default'}
]
};
this.stationList.push(param);
}
});
try {
const res = await getByGroupStationList(this.$route.query.group);
if (res.code == 200) {
this.stationList = [];
res.data.forEach(station => {
if (!station.depot) {
const param = {
stationName: station.name,
children:[
{status:'none'}, {status:'default'},
{status:'default'}, {status:'default'},
{status:'none'}, {status:'none'},
{status:'none'}, {status:'default'}
]
};
this.stationList.push(param);
}
});
}
} catch (e) {
this.$message.error('获取车站列表失败!');
}
},
methods:{
showInfoBrroadcast() {

View File

@ -2,14 +2,14 @@
<div class="question">
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
<template v-if="checkType(option, 'judge')">
<el-radio-group v-model="answer" disabled @change="onChnage">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
<span>{{ el.content }}</span>
</el-radio>
</el-radio-group>
</template>
<template v-else-if="checkType(option, 'select')">
<el-radio-group v-model="answer" disabled class="select-box" @change="onChnage">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
<span>{{ $asc2chart(i+65) }}. </span>
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
@ -53,11 +53,22 @@ export default {
return option.type == type;
},
appendIndex(str, index, option) {
console.log(option);
let result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
let result = '';
const i = option.optionList.findIndex(ele => ele.correct);
if (option.type === 'select') {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: D)</span>`;
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${this.$asc2chart(i + 65)})</span>`;
}
} else if (option.type === 'judge') {
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${option.optionList[i].content})</span>`;
}
}
this.$set(option, 'rightAnswer', option.optionList[i].id);
//
return `${index + 1}. ${str} ${result}`;
},

View File

@ -11,6 +11,10 @@
<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 style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span>
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<el-button-group class="buttons">
@ -25,7 +29,8 @@
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import Question from './question';
import { getTheoryQuestion } from '@/api/competition';
// import { getTheoryQuestion } from '@/api/competition';
import { getCompetitionDetail } from '@/api/competition';
export default {
components: {
@ -47,6 +52,7 @@ export default {
totalScore: 0,
passScore: 10
},
totalScore: 0,
examQuestions: []
};
},
@ -86,13 +92,13 @@ export default {
},
methods: {
loadInitData() {
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
getCompetitionDetail(this.$route.query.raceId).then((resp)=>{
if (resp.data) {
this.examQuestions = resp.data.questions.map((el, i) => {
el.index = i;
el.answer = String(el.optionList[0].id);
return el;
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);
console.log(this.totalScore);
}
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
},

View File

@ -58,11 +58,12 @@ export default {
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.theoryScore,
practiceScore: data.practiceScore
theoryScore: data.artificialTheoryScore || data.theoryScore,
practiceScore: data.artificialPracticeScore || data.practiceScore
};
});
},
@ -75,8 +76,8 @@ export default {
const data = {
raceId: this.info.raceId,
userId: this.info.userId,
theoryScore: this.info.theoryScore,
practiceScore: this.info.practiceScore
artificialTheoryScore: Number(this.info.theoryScore),
artificialPracticeScore: Number(this.info.practiceScore)
};
putRefereeScoring(data).then(res => {
this.doClose();

View File

@ -39,7 +39,6 @@ export default {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
afterQuery:this.afterQuery,
columns: [
{
title: '名字',
@ -70,11 +69,17 @@ export default {
},
{
title: '理论分数',
prop: 'theoryScore'
prop: 'theoryScore',
type: 'tag',
columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || ''; },
tagType: (row) => { return 'success'; }
},
{
title: '实操分数',
prop: 'practiceScore'
prop: 'practiceScore',
type: 'tag',
columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || ''; },
tagType: (row) => { return 'success'; }
},
{
title: '总分',
@ -196,14 +201,6 @@ export default {
gradeScore(index, row) { //
this.$refs.editScore.doShow(row);
},
// afterQuery(data) {
// clearTimeout(this.inter);
// this.inter = setTimeout(() => {
// if (!this.isLeaving) {
// this.refresh();
// }
// }, 3000);
// },
refresh() {
this.$refs.queryListPage.refresh(false);
}