This commit is contained in:
fan 2020-06-05 10:50:16 +08:00
commit b47d5a0f57
17 changed files with 427 additions and 202 deletions

View File

@ -232,3 +232,11 @@ export function fromPauseToPlay(params) {
});
}
/** 裁判查询理论考试结果 */
export function getTheroyCompetitionResult(competitionId, raceUserId) {
return request({
url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`,
method: 'get'
});
}

View File

@ -265,5 +265,11 @@ deviceRender[deviceType.Cistern] = {
_type: deviceType.Cistern,
zlevel: 1,
z: 5
}
};
// 电动阀
deviceRender[deviceType.Electrically] = {
_type: deviceType.Electrically,
zlevel: 1,
z: 5
};
export default deviceRender;

View File

@ -40,7 +40,8 @@ const deviceType = {
LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve',
Cistern: 'Cistern'
Cistern: 'Cistern',
Electrically: 'Electrically'
};
export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this.code = device.model.code;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.grouper.add(this.path);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -67,15 +67,19 @@ const map = {
ElectricButterflyValve: {
width: 39,
path: 'M38,24V44H1V24H18.237L18,21s-6.5.6-9-8C7.705,8.542,10.288,2,20,2S31.849,8.083,31,13c-1.586,9.183-9,8-9,8v3H38Zm-3,4.077L24,34a4.361,4.361,0,0,1-3,5c-3.052,1.215-7,0-7,0L9,41H35V28.077ZM25.872,17.466A6.259,6.259,0,0,0,29,12a18.6,18.6,0,0,0-1-4L25,5H16L12.511,7.279C10.464,8.908,11.044,14.092,11,10.9a10.963,10.963,0,0,0,2.23,5.284L14,7h2l3.181,6.95L23,7h2Zm-1.924.915L23.261,10.13,19.91,17H18l-2.341-5.907L15.1,17.8A8.481,8.481,0,0,0,20,19C17.855,19.073,20.85,19.478,23.948,18.38ZM4,27V39.556L12,36a6.888,6.888,0,0,1,3-7c4.261-2.736,8,1,8,1l6-3H4Z'
},
},
Cistern: {
width: 323,
path: 'M264,27v3l-13-5.353V31s-8.068-6-16-6c-8.067,0-16,6-16,6V26H207V84H167v28H135v6s-7.614-6-16-6c-8.11,0-17,6-17,6v-6H23.467L26,119,4,109l23-9-3.13,7H76V31h72V12h59v9h12V14s8.08,5,16,5c8.079,0,16-5,16-5v7.353L264,16v7h54v4H264ZM148,37H82v70h20V99s8.89,8,17,8c8.386,0,16-8,16-8v8h26V84H148V37Zm54-20H153V55h15.5s-5.715-3.318-4.5-15c0.657-6.32,9-9,9-9l22-10h7V17Zm0,9h-6l-13,5s8.644,5.651,8,13c-0.827,9.433-4.75,11-4.75,11H202V26Zm-25,8a9,9,0,1,1-9,9A9,9,0,0,1,177,34Z'
},
StaircaseOneWay: {
width: 51,
path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z'
}
StaircaseOneWay: {
width: 51,
path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z'
},
Electrically: {
width: 73,
path: 'M88,61h44L118,96v11l17,36H88l12-31a27.845,27.845,0,0,1-20,9c-10.918.076-17.578-9.2-18-19-0.3-6.868,4.7-19.035,19-19,15.658,0.038,18,8,18,8ZM71,99c2.055-8.165,13.821-5.509,17-3,2.941,2.321,1.828,10.958-1,13a12.742,12.742,0,0,1-12,1C71.1,108.294,69.5,104.972,71,99Z'
}
};
export default function createPathSvg(model) {

View File

@ -41,6 +41,7 @@ import StateTable from './stateTable';
import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve';
import Cistern from './bas/cistern';
import Electrically from './bas/electrically';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -86,6 +87,7 @@ iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
iscsShape[deviceType.Cistern] = Cistern;
iscsShape[deviceType.Electrically] = Electrically;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -2,8 +2,8 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender';
import store from '@/store/index_APP_TARGET';
import { deepClone } from '@/utils/index';
// import store from '@/store/index_APP_TARGET';
// import { deepClone } from '@/utils/index';
export function createTransform(opts) {
let transform = matrix.create();
@ -163,12 +163,15 @@ export function parser(data) {
zrUtil.each(data.balancedElectricList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.BalancedElectric, elem);
});
zrUtil.each(data.electricButterflyValveList || [], elem => {
zrUtil.each(data.electricButterflyValveList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.ElectricButterflyValve, elem);
});
zrUtil.each(data.cisternList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Cistern, elem);
})
});
zrUtil.each(data.electricallyList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Electrically, elem);
});
}
return iscsDevice;
@ -194,129 +197,47 @@ function updateIscsListByDevice(state, name, device) {
export function updateIscsData(state, device) {
// const state = store.state;
switch (device._type) {
case deviceType.Vidicon :
updateIscsListByDevice(state, 'vidiconList', device);
break;
case deviceType.VidiconCloud :
updateIscsListByDevice(state, 'vidiconCloudList', device);
break;
case deviceType.ManualAlarmButton :
updateIscsListByDevice(state, 'manualAlarmButtonList', device);
break;
case deviceType.FireHydranAlarmButton:
updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device);
break;
case deviceType.GasFireControl:
updateIscsListByDevice(state, 'gasFireControlList', device);
break;
case deviceType.SmokeDetector:
updateIscsListByDevice(state, 'smokeDetectorList', device);
break;
case deviceType.TemperatureDetector:
updateIscsListByDevice(state, 'temperatureDetectorList', device);
break;
case deviceType.PlatformScreenDoor:
updateIscsListByDevice(state, 'platformScreenDoorList', device);
break;
case deviceType.FrozenPump :
updateIscsListByDevice(state, 'frozenPumpList', device);
break;
case deviceType.Ventilator :
updateIscsListByDevice(state, 'ventilatorList', device);
break;
case deviceType.Chiller :
updateIscsListByDevice(state, 'chillerList', device);
break;
case deviceType.CoolTower :
updateIscsListByDevice(state, 'coolTowerList', device);
break;
case deviceType.EndDoor:
updateIscsListByDevice(state, 'endDoorList', device);
break;
case deviceType.BorderRadius:
updateIscsListByDevice(state, 'borderRadiusList', device);
break;
case deviceType.BrakeMachine:
updateIscsListByDevice(state, 'brakeMachineList', device);
break;
case deviceType.EntranceGuard:
updateIscsListByDevice(state, 'entranceGuardList', device);
break;
case deviceType.TicketMachine:
updateIscsListByDevice(state, 'ticketMachineList', device);
break;
case deviceType.SemiAutomaticTicketMachine:
updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device);
break;
case deviceType.AirConditioner:
updateIscsListByDevice(state, 'airConditionerList', device);
break;
case deviceType.OrbitalVentilator:
updateIscsListByDevice(state, 'orbitalVentilatorList', device);
break;
case deviceType.JetFan:
updateIscsListByDevice(state, 'jetFanList', device);
break;
case deviceType.TunnelFan:
updateIscsListByDevice(state, 'tunnelFanList', device);
break;
case deviceType.FireDamper:
updateIscsListByDevice(state, 'fireDamperList', device);
break;
case deviceType.SmookExhaustFd:
updateIscsListByDevice(state, 'smookExhaustFdList', device);
break;
case deviceType.SmookProofFd:
updateIscsListByDevice(state, 'smookProofFdList', device);
break;
case deviceType.VolumeControlDamper:
updateIscsListByDevice(state, 'volumeControlDamperList', device);
break;
case deviceType.IscsRect:
updateIscsListByDevice(state, 'iscsRectList', device);
break;
case deviceType.IscsText:
updateIscsListByDevice(state, 'iscsTextList', device);
break;
case deviceType.IscsLine:
updateIscsListByDevice(state, 'iscsLineList', device);
break;
case deviceType.Escalator:
updateIscsListByDevice(state, 'escalatorList', device);
break;
case deviceType.StairControl:
updateIscsListByDevice(state, 'stairControlList', device);
break;
case deviceType.FasBrakeMachine:
updateIscsListByDevice(state, 'fasBrakeMachineList', device);
break;
case deviceType.Staircase:
updateIscsListByDevice(state, 'staircaseList', device);
break;
case deviceType.SingleStaircase:
updateIscsListByDevice(state, 'singleStaircaseList', device);
break;
case deviceType.ArcStatus:
updateIscsListByDevice(state, 'arcStatusList', device);
break;
case deviceType.IscsButton:
updateIscsListByDevice(state, 'iscsButtonList', device);
break;
case deviceType.StateTable:
updateIscsListByDevice(state, 'stateTableList', device);
break;
case deviceType.LightingGroup:
updateIscsListByDevice(state, 'lightingGroupList', device);
break;
case deviceType.BalancedElectric:
updateIscsListByDevice(state, 'balancedElectricList', device);
break;
case deviceType.ElectricButterflyValve:
updateIscsListByDevice(state, 'electricButterflyValveList', device);
break;
case deviceType.Cistern:
updateIscsListByDevice(state, 'cisternList', device);
break;
case deviceType.Vidicon : updateIscsListByDevice(state, 'vidiconList', device); break;
case deviceType.VidiconCloud : updateIscsListByDevice(state, 'vidiconCloudList', device); break;
case deviceType.ManualAlarmButton : updateIscsListByDevice(state, 'manualAlarmButtonList', device); break;
case deviceType.FireHydranAlarmButton: updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); break;
case deviceType.GasFireControl: updateIscsListByDevice(state, 'gasFireControlList', device); break;
case deviceType.SmokeDetector: updateIscsListByDevice(state, 'smokeDetectorList', device); break;
case deviceType.TemperatureDetector: updateIscsListByDevice(state, 'temperatureDetectorList', device); break;
case deviceType.PlatformScreenDoor: updateIscsListByDevice(state, 'platformScreenDoorList', device); break;
case deviceType.FrozenPump : updateIscsListByDevice(state, 'frozenPumpList', device); break;
case deviceType.Ventilator : updateIscsListByDevice(state, 'ventilatorList', device); break;
case deviceType.Chiller : updateIscsListByDevice(state, 'chillerList', device); break;
case deviceType.CoolTower : updateIscsListByDevice(state, 'coolTowerList', device); break;
case deviceType.EndDoor: updateIscsListByDevice(state, 'endDoorList', device); break;
case deviceType.BorderRadius: updateIscsListByDevice(state, 'borderRadiusList', device); break;
case deviceType.BrakeMachine: updateIscsListByDevice(state, 'brakeMachineList', device); break;
case deviceType.EntranceGuard: updateIscsListByDevice(state, 'entranceGuardList', device); break;
case deviceType.TicketMachine: updateIscsListByDevice(state, 'ticketMachineList', device); break;
case deviceType.SemiAutomaticTicketMachine: updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device); break;
case deviceType.AirConditioner: updateIscsListByDevice(state, 'airConditionerList', device); break;
case deviceType.OrbitalVentilator: updateIscsListByDevice(state, 'orbitalVentilatorList', device); break;
case deviceType.JetFan: updateIscsListByDevice(state, 'jetFanList', device); break;
case deviceType.TunnelFan: updateIscsListByDevice(state, 'tunnelFanList', device); break;
case deviceType.FireDamper: updateIscsListByDevice(state, 'fireDamperList', device); break;
case deviceType.SmookExhaustFd: updateIscsListByDevice(state, 'smookExhaustFdList', device); break;
case deviceType.SmookProofFd: updateIscsListByDevice(state, 'smookProofFdList', device); break;
case deviceType.VolumeControlDamper: updateIscsListByDevice(state, 'volumeControlDamperList', device); break;
case deviceType.IscsRect: updateIscsListByDevice(state, 'iscsRectList', device); break;
case deviceType.IscsText: updateIscsListByDevice(state, 'iscsTextList', device); break;
case deviceType.IscsLine: updateIscsListByDevice(state, 'iscsLineList', device); break;
case deviceType.Escalator: updateIscsListByDevice(state, 'escalatorList', device); break;
case deviceType.StairControl: updateIscsListByDevice(state, 'stairControlList', device); break;
case deviceType.FasBrakeMachine: updateIscsListByDevice(state, 'fasBrakeMachineList', device); break;
case deviceType.Staircase: updateIscsListByDevice(state, 'staircaseList', device); break;
case deviceType.SingleStaircase: updateIscsListByDevice(state, 'singleStaircaseList', device); break;
case deviceType.ArcStatus: updateIscsListByDevice(state, 'arcStatusList', device); break;
case deviceType.IscsButton: updateIscsListByDevice(state, 'iscsButtonList', device); break;
case deviceType.StateTable: updateIscsListByDevice(state, 'stateTableList', device); break;
case deviceType.LightingGroup: updateIscsListByDevice(state, 'lightingGroupList', device); break;
case deviceType.BalancedElectric: updateIscsListByDevice(state, 'balancedElectricList', device); break;
case deviceType.ElectricButterflyValve: updateIscsListByDevice(state, 'electricButterflyValveList', device); break;
case deviceType.Cistern: updateIscsListByDevice(state, 'cisternList', device); break;
case deviceType.Electrically: updateIscsListByDevice(state, 'electricallyList', device); break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -12,6 +12,8 @@ import Rect from 'zrender/src/graphic/shape/Rect';
import BoundingRect from 'zrender/src/core/BoundingRect';
// import {isShowThePrdType} from '../../utils/handlePath';
import Text from 'zrender/src/graphic/Text';
import store from '@/store/index_APP_TARGET';
import Vue from 'vue';
export default class Station extends Group {
constructor(model, style) {
@ -319,6 +321,15 @@ export default class Station extends Group {
if (!this.isShowShape) return;
this.recover();
model.controlMode && this['handle' + model.controlMode]();
if (model.tbStrategyId) {
store.state.map.map.tbStrategyList.forEach(item => {
if (item.stationCode == model.code) {
const modelData = Vue.prototype.$jlmap.mapDevice[item.code];
modelData && modelData.instance && modelData.instance.setState(modelData, model.tbStrategyId);
}
});
}
}
getShapeTipPoint(opts) {

View File

@ -86,18 +86,34 @@ export default class StationTurnBack extends Group {
this.add(this.controlRect);
this.add(this.text);
this.add(this.strategyText);
this.strategyText.hide();
}
}
recover() {
this.strategyText.hide();
}
handleStatus(name) {
this.strategyText.show();
this.strategyText.attr({
style: {
text: name
}
});
}
// 设置状态
setState(model) {
setState(model, tbStrategyId = null) {
// if (!this.isShowShape) return;
// this.recover();
this.recover();
if (tbStrategyId) {
model.tbStrategyId = tbStrategyId;
model.optionList.forEach(item => {
if (item.id == tbStrategyId) {
this.handleStatus(item.label);
}
});
}
// console.log(model, '站后折返model')
}
@ -117,4 +133,4 @@ export default class StationTurnBack extends Group {
// this.isShowShape = false;
// }
}
}
}

View File

@ -101,8 +101,9 @@ export default {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
const name = selected.optionList.find(ele => ele.id == selected.tbStrategyId).label;
this.stationName = selected.name || '';
this.stationStrategy = ''; //
this.stationStrategy = selected.tbStrategyId ? name : '无策略折返'; //
this.strategyList = selected.optionList; //
}

View File

@ -16,7 +16,7 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
export default {
name: 'menuStationTurnBack',
name: 'MenuStationTurnBack',
components: {
PopMenu,
StandBackStrategy
@ -45,7 +45,7 @@ export default {
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
},
}
]
}
};
@ -87,9 +87,12 @@ export default {
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
if (this.menu) {
this.setBackStrategy();
}
// if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
// this.$refs.popMenu.resetShowPosition(point);
// }
},
doClose() {
if (this.$refs && this.$refs.popMenu) {

View File

@ -0,0 +1,139 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="颜色" prop="fill">
<el-color-picker v-model="form.fill" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
rotate: 0,
fill: '#000',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'Electrically' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.fill = model.fill;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Electrically',
code: this.isUpdate ? this.form.code : getUID('Electrically', this.iscs.electricallyList || []),
width: this.form.width,
rotate: this.form.rotate,
fill: this.form.fill
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Electrically',
code: this.form.code,
width: this.form.width,
fill: '#000'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -123,6 +123,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="电动阀" name="Electrically">
<electrically
ref="electrically"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="水池" name="Cistern">
<cistern
ref="cistern"
@ -222,6 +230,7 @@ import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve';
import Cistern from './cistern';
import Electrically from './electrically';
import Escalator from '../iscsOperate/escalator'; //
import FasBrakeMachine from '../iscsOperate/brakeMachine'; //
import StateTable from '../iscsCommonElem/stateTable';
@ -250,6 +259,7 @@ export default {
ElectricButterflyValve,
Cistern,
Escalator,
Electrically,
FasBrakeMachine,
StateTable
},

View File

@ -3,6 +3,7 @@
<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>
@ -10,11 +11,13 @@
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
editScore,
TheoryResult
},
data() {
return {
@ -176,8 +179,9 @@ export default {
}, 2000);
});
},
handleTheoryResult() {
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
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` });
},
handleAdd() {
const loading = this.$loading({

View File

@ -0,0 +1,69 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false">
<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 style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span>
</div>
</el-dialog>
</template>
<script>
import { getTheroyCompetitionResult } from '@/api/competition';
export default {
name:'TheroyResult',
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.userId);
this.show = true;
this.title = '【' + row.organization + '】' + row.name + ' 理论结果';
},
doClose() {
this.show = false;
},
loadInitData(raceId, userId) {
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>

View File

@ -4,48 +4,48 @@
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules">
<div class="card-box" v-if="editModel.type == 'StationTurnBack'">
<div class="card_title">站后折返数据</div>
<div>
<el-table :data="editModel.optionList" border style="width: 100%">
<el-table-column prop="id" label="编号" width="100px" />
<el-table-column prop="label" label="描述" width="250px" />
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="deleteOverlab(editModel.optionList, scope.$index)">移出</el-button>
<el-button type="text" size="small" @click.native.prevent="editOverlab(editModel.optionList, scope.$index)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">{{ cardTitle }}</span>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
</el-button-group>
</div>
<div>
<el-form ref="hostileForm" :model="addBackModel" :rules="addBackRules" label-width="135px" size="mini" style="margin-top: 15px;padding-right: 10px;">
<el-form-item label="类型:" prop="type">
<el-select v-model="addBackModel.type" clearable :filterable="true">
<el-option v-for="item in turnBackList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="描述:" prop="label">
<el-input v-model="addBackModel.label" type="text" maxlength="30" :show-word-limit="true" />
</el-form-item>
<el-form-item label="折返轨:" prop="sectionList" v-if="addBackModel.type != 'NONE'">
<el-select v-model="addBackModel.sectionList" clearable multiple :filterable="true">
<el-option v-for="item in sectionList" :key="item.value" :label="`${item.name}(${item.code})`" :value="item.value" />
</el-select>
<el-button :type="field === 'sectionCode1' ? 'danger' : 'primary'" @click="hover('sectionCode1')">激活</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
<div v-if="editModel.type == 'StationTurnBack'" class="card-box">
<div class="card_title">站后折返数据</div>
<div>
<el-table :data="editModel.optionList" border style="width: 100%">
<el-table-column prop="id" label="编号" width="100px" />
<el-table-column prop="label" label="描述" width="250px" />
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="deleteOverlab(editModel.optionList, scope.$index)">移出</el-button>
<el-button type="text" size="small" @click.native.prevent="editOverlab(editModel.optionList, scope.$index)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">{{ cardTitle }}</span>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
</el-button-group>
</div>
<div>
<el-form ref="hostileForm" :model="addBackModel" :rules="addBackRules" label-width="135px" size="mini" style="margin-top: 15px;padding-right: 10px;">
<el-form-item label="类型:" prop="type">
<el-select v-model="addBackModel.type" clearable :filterable="true">
<el-option v-for="item in turnBackList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="描述:" prop="label">
<el-input v-model="addBackModel.label" type="text" maxlength="30" :show-word-limit="true" />
</el-form-item>
<el-form-item v-if="addBackModel.type != 'NONE'" label="折返轨:" prop="sectionList">
<el-select v-model="addBackModel.sectionList" clearable multiple :filterable="true">
<el-option v-for="item in sectionList" :key="item.value" :label="`${item.name}(${item.code})`" :value="item.value" />
</el-select>
<el-button :type="field === 'sectionCode1' ? 'danger' : 'primary'" @click="hover('sectionCode1')">激活</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</div>
</config-list>
</el-scrollbar>
@ -320,12 +320,12 @@ export default {
x: 0,
y: 0
}
}
};
},
typeChange(type) { //
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.clearInfo();
this.addModel.type = type;
this.editModel.type = type;
@ -487,7 +487,7 @@ export default {
id: this.addBackModel.id,
type: this.addBackModel.type,
label: this.addBackModel.label,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
};
this.editModel.optionList.splice(this.addBackModel.parentIndex, 1, data);
this.$refs.hostileForm.resetFields();
@ -504,7 +504,7 @@ export default {
id: id,
type: this.addBackModel.type,
label: this.addBackModel.label,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
});
this.$refs.hostileForm.resetFields();
this.addBackModel.sectionList = [];
@ -518,9 +518,9 @@ export default {
createUid(list) {
if (list.length) {
let num = Number(list[list.length - 1].id);
return ++num
return ++num;
} else {
return 1
return 1;
}
}
}