This commit is contained in:
fan 2020-10-15 18:33:47 +08:00
commit 54cde2a1da
25 changed files with 963 additions and 780 deletions

View File

@ -22,11 +22,21 @@ export function addRpTrip(data) {
}
/**
* 修改到站时间
* 删除车次
*/
export function justTripNoArrival(tripNo, data) {
export function delRpTrip(tripNo) {
return request({
url: `/api/rpTools/${tripNo}/arrival`,
url: `/api/rpTools/${tripNo}/trip`,
method: 'delete'
})
}
/**
* 修改运行时间
*/
export function justTripNoRunning(tripNo, data) {
return request({
url: `/api/rpTools/${tripNo}/running`,
method: 'put',
data
})
@ -34,11 +44,11 @@ export function justTripNoArrival(tripNo, data) {
/**
* 修改发车时间
* 修改停站时间
*/
export function justTripNoDeparture(tripNo, data) {
export function justTripNoStop(tripNo, data) {
return request({
url: `/api/rpTools/${tripNo}/departure`,
url: `/api/rpTools/${tripNo}/stop`,
method: 'put',
data
})
@ -56,12 +66,3 @@ export function translateTripNo(tripNo, data) {
}
/**
* 删除车次
*/
export function deleteTripNo(tripNo) {
return request({
url: `/api/rpTools/${tripNo}/trip`,
method: 'delete'
})
}

View File

@ -270,7 +270,7 @@ deviceRender[deviceType.ArcStatus] = {
deviceRender[deviceType.IscsButton] = {
_type: deviceType.IscsButton,
zlevel: 1,
z: 4
z: 5
};
/** 状态表 */
deviceRender[deviceType.StateTable] = {

View File

@ -27,6 +27,7 @@ export default class Button extends Group {
this.buttonText = new Text({
zlevel: model.zlevel,
z: model.z + 1,
z2: model.z2 || 0,
style: {
x: 0,
y: 0,
@ -46,6 +47,7 @@ export default class Button extends Group {
this.imageButton = new Image({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
style: {
x: textRect.x - model.levelPadding,
y: textRect.y - model.verticalPadding,
@ -61,6 +63,7 @@ export default class Button extends Group {
this.textButtonRect = new Rect({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
shape: {
x: textRect.x - model.levelPadding,
y: textRect.y - model.verticalPadding,
@ -75,6 +78,7 @@ export default class Button extends Group {
this.lineLeftTop = new Polyline({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
draggable: false,
shape: {
points: [
@ -91,6 +95,7 @@ export default class Button extends Group {
this.lineBottomRight = new Polyline({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
draggable: false,
shape: {
points: [
@ -111,6 +116,7 @@ export default class Button extends Group {
this.textButtonRectSmall = new Rect({
zlevel: model.zlevel,
z: model.z,
z2: model.z2 || 0,
shape: {
x: textRect.x - model.levelPadding + 6,
y: textRect.y - model.verticalPadding + 6,
@ -145,7 +151,6 @@ export default class Button extends Group {
this.add(this.grouper);
this.on('mouseout', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColor || '#FFF'}); });
this.on('mouseover', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColorActive || '#000'}); });
}
setModel(dx, dy) {
this.model.point.x += dx;

View File

@ -437,7 +437,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
rails = loadrails;
console.log(trainlisttest.group.children[0]);
trainlisttest.group.children[0].getObjectByName("c1").add(cameracctv);
trainlisttest.group.children[0].getObjectByName("c3").add(cameracctv);
}
this.eventon = function() {

View File

@ -306,15 +306,19 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
if(event.data.type == "topTrain"){
if(trainControl.toptrain.status != 1){
if(event.data.offset>=0.0360){
trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(event.data.offset));
}
}
}
if(event.data.type == "downTrain"){
if(trainControl.downtrain.status != 1){
if(event.data.offset<=0.965){
trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(event.data.offset));
}
}
}
//上行列车车门控制
if(event.data.type == "topTrainDoor"){
@ -322,6 +326,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
trainControl.closetraindoor(trainControl.toptrain,event.data.doorCode,positionStatus,"top");
// trainLeaveStation("top");
}else{
trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(0.0365));
trainControl.opentraindoor(trainControl.toptrain,event.data.doorCode,"top");
trainControl.toptrain.status = 1;
}
@ -333,6 +338,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
trainControl.closetraindoor(trainControl.downtrain,event.data.doorCode,positionStatus,"down");
// trainLeaveStation("down");
}else{
trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(0.961));
trainControl.opentraindoor(trainControl.downtrain,event.data.doorCode,"down");
trainControl.downtrain.status = 1;
}

View File

@ -16,22 +16,23 @@ export default {
/** 按车次遍历数据*/
if (tripList && tripList.length) {
tripList.forEach(trip => {
const opt = { name: `run-${trip.tripNo}`, type: 'line', markPoint: { data: [] }, data: []};
const opt = { name: `run-${trip.tripNo}`, type: 'line', showAllSymbol:true, symbolKeepAspect: false, symbolSize: 6, markPoint: { data: [] }, data: []};
if (trip.tripNo &&
trip.stationTimeList.length) {
opt.markPoint.data.push(createMartPointReverse({
name: `${trip.tripNo}`,
color: '#000' || lineStyle.color,
coord: [
trip.stationTimeList[0].arrivalTime,
this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
]
}));
}
// const length = trip.stationTimeList.length;
// if (trip.tripNo &&
// trip.stationTimeList.length) {
// opt.markPoint.data.push(createMartPointReverse({
// name: `${trip.tripNo}`,
// color: '#000' || lineStyle.color,
// coord: [
// trip.stationTimeList[0].arrivalTime,
// this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
// ]
// }));
// }
/** 计算停站点坐标集合*/
trip.stationTimeList.forEach(elem => {
trip.stationTimeList.forEach((elem,idx) => {
if (elem.arrivalTime) {
opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
}
@ -45,8 +46,6 @@ export default {
});
}
console.log(models);
return models;
},

View File

@ -130,7 +130,8 @@ export const DeviceMenu = {
IscsSystem: '108',
IscsInterface: '109',
planAusContextMenu: '200'
planJustArrival: '200',
planJustDeparture: '201'
};
/**

View File

@ -70,6 +70,7 @@ export function createMarkLineModels(stations, computedYaxis) {
markLineModel.markLine.data = [];
markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 };
markLineModel.markLine.symbol = 'none';
markLineModel.elements = []
stations.forEach((elem, index) => {
markLineModel.markLine.data.push(
{

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="100px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" size="small" />
</el-form-item>
<el-form-item v-if="isUpdate" label="按钮编号:" prop="code">
<el-input v-model="form.code" size="small" :disabled="true" />
</el-form-item>
@ -19,6 +22,12 @@
<el-form-item label="选中文字颜色:" prop="textColorActive">
<el-color-picker v-model="form.textColorActive" size="small" />
</el-form-item>
<!-- <el-form-item label="背景颜色:" prop="textColor">
<el-color-picker v-model="form.fillColor" size="small" />
</el-form-item>
<el-form-item label="选中背景颜色:" prop="textColor">
<el-color-picker v-model="form.fillColorActive" size="small" />
</el-form-item> -->
<el-form-item label="文字大小:" prop="fontSize">
<el-input-number v-model="form.fontSize" size="small" controls-position="right" :min="1" />
</el-form-item>
@ -72,6 +81,7 @@ export default {
],
form: {
code: '',
z2: 0,
levelPadding: 10,
verticalPadding: 5,
fontSize: 10,
@ -80,6 +90,8 @@ export default {
context: '',
function: '',
textColor: '',
// fillColor: '#D1C2C2',
// fillColorActive: '#847b7b',
textColorActive: '#000'
},
rules: {
@ -105,6 +117,7 @@ export default {
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.z2 = model.z2;
this.form.levelPadding = model.levelPadding;
this.form.verticalPadding = model.verticalPadding;
this.form.x = model.point.x;
@ -149,6 +162,7 @@ export default {
},
code: this.isUpdate ? this.form.code : getUID('IscsButton', this.iscs.iscsButtonList),
_type: 'IscsButton',
z2: this.form.z2,
levelPadding: this.form.levelPadding,
verticalPadding: this.form.verticalPadding,
context: this.form.context,
@ -186,6 +200,7 @@ export default {
this.showDeleteButton = false;
this.form = {
code: '',
z2: '',
levelPadding: 10,
verticalPadding: 2,
fontSize: 10,

View File

@ -2,6 +2,19 @@
<div v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.6)" style="width:100%;height:100%;">
<div class="Substation" :style="{'background':bacground}">
<div class="Substation_header">{{ title }}</div>
<div v-if="mode.includes('environmentFive')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentFive01'}" @click="handleButton('01', mode == 'environmentFive01')">小系统1模式</div>
<div class="button_box" :class="{'active': mode == 'environmentFive02'}" @click="handleButton('02', mode == 'environmentFive02')">小系统2模式</div>
<div class="button_box" :class="{'active': mode == 'environmentFive03'}" @click="handleButton('03', mode == 'environmentFive03')">小系统3模式</div>
</div>
<div v-if="mode.includes('environmentNine')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentNine01'}" @click="handleIllumination('01', mode == 'environmentNine01')">照明系统</div>
<div class="button_box" :class="{'active': mode == 'environmentNine02'}" @click="handleIllumination('02', mode == 'environmentNine02')">照明系统监测</div>
</div>
<div v-if="mode.includes('environmentEleven') || mode.includes('environmentTwelve')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentEleven'}" @click="handleEnvironment('environmentEleven', mode == 'environmentEleven', '人防门')">人防门</div>
<div class="button_box" :class="{'active': mode == 'environmentTwelve'}" @click="handleEnvironment('environmentTwelve', mode == 'environmentTwelve', '防淹门系统')">防淹门</div>
</div>
<div>
<iscsSystem ref="iscsPlate" />
</div>
@ -27,7 +40,9 @@ export default {
loading: false,
width: window.innerWidth,
scaleRate: window.innerWidth / 1920,
height:1000
height: 1000,
mode: '',
system: ''
};
},
computed:{
@ -36,21 +51,47 @@ export default {
},
stationId() {
return this.$route.query.stationId;
},
mode() {
return this.$route.params.mode;
}
},
watch:{
$route() {
this.mode = this.$route.params.mode;
this.getInitData();
}
},
created() {
this.mode = this.$route.params.mode;
},
mounted() {
this.getInitData();
},
methods:{
handleButton(type, judge) {
if (!judge) {
this.mode = `environmentFive${type}`;
this.system = 'environmentFive';
this.title = `${this.stationName} 小系统${Number(type)}原理图`;
this.getDetail();
}
},
handleIllumination(type, judge) {
if (!judge) {
this.mode = `environmentNine${type}`;
this.system = 'environmentNine';
this.title = `${this.stationName} 照明系统`;
this.getDetail();
}
},
handleEnvironment(type, judge, name) {
if (!judge) {
this.mode = type;
this.title = `${this.stationName} ${name}`;
this.getDetail();
}
},
getInitData() {
this.system = 'environment';
if (this.mode == 'environmentThree') {
this.title = this.stationName + ' 隧道通风系统';
this.scaleRate = window.innerWidth / 2000;
@ -60,6 +101,12 @@ export default {
this.title = this.stationName + ' 大系统';
this.scaleRate = window.innerWidth / 2000;
this.height = 900;
} else if (this.mode == 'environmentFive') {
this.mode = 'environmentFive01';
this.system = 'environmentFive';
this.title = this.stationName + ' 小系统1原理图';
this.scaleRate = window.innerWidth / 2000;
this.height = 800;
} else if (this.mode == 'environmentSix') {
this.title = this.stationName + ' 冷水系统 原理图';
this.scaleRate = window.innerWidth / 2000;
@ -73,9 +120,11 @@ export default {
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentNine') {
this.system = 'environmentNine';
this.mode = 'environmentNine01';
this.title = this.stationName + ' 照明系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
this.height = 800;
} else if (this.mode == 'environmentTen') {
this.title = this.stationName + ' 自动扶梯系统';
this.scaleRate = window.innerWidth / 1920;
@ -84,10 +133,21 @@ export default {
this.title = this.stationName + ' 传感器';
this.scaleRate = window.innerWidth / 1920;
this.height = 1000;
} else if (this.mode == 'environmentEleven') {
this.title = this.stationName + ' 人防门';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentTwelve') {
this.title = this.stationName + ' 防淹门系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
}
this.getDetail();
},
getDetail() {
const params = {
lineCode: this.$route.query.lineCode,
system: 'environment',
system: this.system,
totalSystem :'environment02',
userInterface : this.mode
};
@ -122,4 +182,21 @@ export default {
.SubstationIn{
display: inline-block;
}
.environmentFive-box{
position: absolute;
right: 60px;
top: 68px;
z-index: 100;
.button_box{
background: #D1C1C4;
border: 1px solid #fff;
float: left;
padding: 8px 10px;
cursor: pointer;
font-size: 14px;
&.active{
color: #939393;
}
}
}
</style>

View File

@ -5,12 +5,15 @@
<normal v-else-if="mode=='environmentThree'" />
<normal v-else-if="mode=='environmentFour'" />
<normal v-else-if="mode=='environmentFive'" />
<normal v-else-if="mode=='environmentSix'" />
<normal v-else-if="mode=='environmentSeven'" />
<normal v-else-if="mode=='environmentEight'" />
<normal v-else-if="mode=='environmentNine'" />
<normal v-else-if="mode=='environmentTen'" />
<normal v-else-if="mode=='environmentThirteen'" />
<normal v-else-if="mode=='environmentEleven'" />
<normal v-else-if="mode=='environmentTwelve'" />
<!-- -->
</div>

View File

@ -90,7 +90,7 @@ export default {
this.title = this.stationName + ' 降压变电所主接线图';
params.userInterface = 'stepDown';
}
this.scaleRate = window.innerWidth / 2200;
this.scaleRate = window.innerWidth / 2000;
this.bacground = 'rgba(0,0,0,0)';
}

View File

@ -19,6 +19,11 @@ export default {
components:{
iscsSystem
},
data() {
return {
scaleRate:window.innerWidth / 1950
};
},
computed:{
stationName() {
return this.$route.query.stationName;
@ -37,10 +42,11 @@ export default {
system: 'psdSystem',
userInterface: 'psdOne'
};
this.$refs.iscsPlate.show({}, this.width, this.height, this.scaleRate);
getIscsData(params).then(resp=>{
if (resp.data) {
const data = JSON.parse(resp.data.graphData);
this.$refs.iscsPlate.show(data);
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
}
});
}

View File

@ -10,7 +10,7 @@
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
<div class="userMessage">
<!-- <span class="el-icon-video-play playicon" /> -->
<img :src="yuyin" alt="playicon1">
<img :src="yuyin" class="playicon1">
<!-- <span class="messageText">{{ chatContent.content }}</span> -->
</div>
</div>

View File

@ -75,6 +75,8 @@
<operational-statistic ref="operationalStatistic" @finishTraining="finishTraining" />
<test-result ref="testResult" />
</div>
</template>
@ -106,6 +108,7 @@ import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus';
import { createSimulationNew } from '@/api/simulation';
import OperationalStatistic from './operationalStatistic.vue';
import TestResult from './testResult.vue';
import Vue from 'vue';
export default {
@ -119,6 +122,7 @@ export default {
TheoryExamSelect,
TheoryExam,
OperationalStatistic,
TestResult,
// TheoryQuiz,
// ThroryResult,
SelectRole
@ -166,6 +170,7 @@ export default {
scriptMode: ScriptMode.TEACH,
mapLocation:{},
playerList:[],
actionList:[],
currentPlayList:[],
// formatUsedTime:'',
formatScore:0,
@ -449,11 +454,12 @@ export default {
// this.$refs.menuScript.initLoadPage();
// }
},
selectScript({playerList, mapLocation}) {
selectScript({playerList, mapLocation, actionList}) {
this.changeScriptMode(this.scriptMode);
this.isScriptLoad = true;
this.playerList = playerList;
this.mapLocation = mapLocation;
this.actionList = actionList;
this.userRole = 'AUDIENCE';
this.$store.dispatch('training/setRoles', 'AUDIENCE');
},
@ -463,15 +469,21 @@ export default {
(this.$store.state.training.memberData[role.id] || {}).disabled = true;
this.runScriptMode(memberId);
},
finishTraining() {
finishTraining(data) {
this.isScriptRun = false;
this.showResultData(data);
},
showResultData(data) {
this.$refs.testResult.doShow({data:data, actionList:this.actionList});
},
endTraining() {
competitionPracticalSceneFinish(this.group, {operationStatisticVO:{}}).then(res=>{
this.isScriptRun = false;
// if (this.scriptMode == ScriptMode.TEST) {
this.formatScore = res.data;
this.$messageBox('得分:' + this.formatScore);
// this.formatScore = res.data;
// this.
this.showResultData(res.data);
// this.$messageBox('' + this.formatScore);
// }
// this.userRole = 'AUDIENCE';
// this.$store.dispatch('training/setRoles', 'AUDIENCE');

View File

@ -78,9 +78,9 @@ export default {
} else {
competitionPracticalSceneFinish(this.$route.query.group, this.resultData).then(res=>{
this.$message.success('运营统计数据提交成功');
this.formatScore = res.data;
this.$messageBox('得分:' + this.formatScore);
this.$emit('finishTraining');
// this.formatScore = res.data;
// this.$messageBox('' + this.formatScore);
this.$emit('finishTraining', res.data);
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS);
this.dialogShow = false;
}).catch(error=>{

View File

@ -120,6 +120,7 @@ export default {
const playerList = [];
EventBus.$emit('clearRunSeries');
EventBus.$emit('loadScene');
const actionList = {};
if (res.data.memberList && res.data.memberList.length > 0) {
this.form.type = '';
res.data.memberList.sort((a, b) => {
@ -128,6 +129,7 @@ export default {
this.$store.dispatch('training/setMemberList', {memberList:res.data.memberList, userId:this.$store.state.user.id});
const activeMemberList = [];
res.data.actionList.forEach((activeMember)=>{
actionList[activeMember.id] = activeMember;
if (!(activeMemberList.length > 0 && activeMemberList.includes(activeMember.memberId))) {
activeMemberList.push(activeMember.memberId);
}
@ -177,14 +179,14 @@ export default {
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.confirm(playerList);
this.confirm(playerList, actionList);
}
}
},
confirm(playerList) {
confirm(playerList, actionList) {
// this.$store.dispatch('training/setScriptOperationType', this.operationType);
// operationType:ScriptMode[this.operationType]
this.$emit('selectScript', {playerList:playerList, mapLocation:this.mapLocation});
this.$emit('selectScript', {playerList:playerList, mapLocation:this.mapLocation, actionList:actionList});
this.doClose();
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {

View File

@ -0,0 +1,263 @@
<template>
<el-dialog
title="竞赛结果详情"
:visible.sync="dialogShow"
top="50px"
width="900px"
:before-do-close="doClose"
class="OSResult"
:close-on-click-modal="false"
>
<div class="operationStatisticResult">
<div class="OSTcompleted">
<span>竞赛{{ completed?'已完成':'未完成' }}</span>
<span style="margin-left:20px;">竞赛总分{{ totalScore }} </span>
<span style="margin-left:20px;">用户得分{{ userScore }} </span>
</div>
<div class="OSTitle">关键步骤信息</div>
<el-table :data="commandPublishStatisticVO" border class="OSTTable3" height="400">
<el-table-column prop="actionId" label="步骤描述" width="200">
<template slot-scope="scope">
{{ covert(scope.row.actionId) }}
</template>
</el-table-column>
<el-table-column prop="keyWords" label="关键字" width="200">
<template slot-scope="scope">
<el-tag v-for="(tag,index) in scope.row.keyWords" :key="index" class="eachTag">{{ tag }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="timeConsumed" label="用时" width="100" />
<el-table-column prop="timeOut" label="超时时间" width="100">
<template slot-scope="scope">
{{ scope.row.timeOut?scope.row.timeOut+'s':'' }}
</template>
</el-table-column>
<el-table-column prop="score" label="步骤总分" width="100" />
<el-table-column prop="finalPointsDeducted" label="用户扣分" width="100" />
</el-table>
<div class="OSTitle">运营统计信息</div>
<el-table :data="operationStaticItemVOs" border class="OSTTable">
<el-table-column prop="description" label="数据名称" width="200" />
<el-table-column label="正确答案" width="150">
<template slot-scope="scope">
<div v-if="scope.row.type=='Time'">{{ scope.row.time }}</div>
<div v-else-if="scope.row.type=='Non_Time'">{{ scope.row.standardAnswer }}</div>
</template>
</el-table-column>
<el-table-column label="用户填写" width="150">
<template slot-scope="scope">
<div v-if="scope.row.type=='Time'">{{ scope.row.timeFilledInByUser }}</div>
<div v-else-if="scope.row.type=='Non_Time'">{{ scope.row.userAnswer }}</div>
</template>
</el-table-column>
<el-table-column prop="finalPointsDeducted" label="扣分" />
</el-table>
<div class="OSTSignInfo">运营指标信息</div>
<div v-if="!completed" class="OSTSignInfoTips">
<span class="el-icon-info" style="font-size: 16px;" /> 因竞赛未完成运营指标不得分
</div>
<div class="OSTSignInfoTips">晚点列车信息</div>
<el-table :data="finalLateStatistics" border class="OSTTable1">
<el-table-column prop="groupNumber" label="车组号" width="299" />
<el-table-column prop="dt" label="晚点时间" width="300">
<template slot-scope="scope">
{{ scope.row.dt }} s
</template>
</el-table-column>
</el-table>
<div class="OSTSignInfoTips">区间停车信息</div>
<el-table :data="finalStopInSectionStatistics" border class="OSTTable2">
<el-table-column prop="groupNumber" label="车组号" width="299" />
<el-table-column prop="duration" label="停车时长" width="300">
<template slot-scope="scope">
{{ scope.row.duration }} s
</template>
</el-table-column>
</el-table>
<div class="OSTSignInfoTips">
运营指标总扣分{{ finalPointsDeducted4OperationIndex }}
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doClose">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import {covertOperate} from '@/views/newMap/displayNew/scriptDisplay/component/covertOperation';
export default {
name:'TestResult',
data() {
return {
dialogShow:false,
operationStaticItemVOs:[],
finalLateStatistics:[],
finalStopInSectionStatistics:[],
commandPublishStatisticVO:[],
completed:false,
totalScore:'',
userScore:'',
actionList:[],
finalPointsDeducted4OperationIndex:0
};
},
methods:{
doShow({data, actionList}) {
this.dialogShow = true;
this.completed = data.completed;
this.operationStaticItemVOs = data.operationStatisticVO.itemVOS;
this.finalLateStatistics = data.operationIndexStatisticVO.finalLateStatistics;
this.finalStopInSectionStatistics = data.operationIndexStatisticVO.finalStopInSectionStatistics;
this.commandPublishStatisticVO = data.commandPublishStatisticVO;
this.actionList = actionList;
this.totalScore = data.totalScore;
this.userScore = data.userScore;
this.finalPointsDeducted4OperationIndex = data.finalPointsDeducted4OperationIndex;
},
doClose() {
this.dialogShow = false;
},
covert(actionId) {
// return actionId;
const element = this.actionList[actionId];
// this.$store.state.training.memberData[memberId]
const member = this.$store.state.training.memberData[element.memberId];
let resultData = '';
if (element.type == 'Accept_Conversation_Invitation') {
resultData = member.label + '请接受会话邀请';
} else if (element.type == 'Conversation') {
resultData = member.label + '说:' + element.content;
} else if (element.type == 'Operation') {
resultData = covertOperate(element.operationType, element.operationParamMap);
resultData = resultData.replace('请', member.label);
// this.scriptTipMessage = '' + deviceName + '' + operateName.label + '';
} else if (element.type == 'Exit_Conversation') {
resultData = member.label + '结束当前会话';
} else if (element.type == 'Start_Conversation' ) {
const inviteMember = [];
// this.$emit('allowCreatCoversition');
if (element.communicationObject) {
if (element.communicationObject == 'ALL_STATION') {
inviteMember.push('所有车站');
} else if (element.communicationObject == 'ALL_TRAIN') {
inviteMember.push('所有司机');
}
} else {
element.conversationMemberIds.forEach(id=>{
if (element.memberId != id) {
inviteMember.push((this.memberList[id] || {label: ''}).label);
}
});
}
resultData = member.label + '创建会话,选择' + inviteMember.toString();
} else if (element.type == 'Command') {
const targetName = this.memberList[element.commandInitiateVO.targetMemberId];
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
resultData = member.label + '对【' + targetName.label + '】下达【' + CommandList[element.commandInitiateVO.commandType] + '】指令';
} else if (element.type == 'Drive') {
if (element.targetSectionCode) {
const section = this.$store.getters['map/getDeviceByCode'](element.targetSectionCode);
if (section && section.name) {
resultData = member.label + '把车开到区段' + section.name;
}
}
}
return resultData;
}
}
};
</script>
<style lang="scss" scoped>
.operationStatisticResult{
height: 500px;
overflow: auto;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
.OSTTable3{
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
.OSTitle{
padding: 10px 5px;
font-size: 15px;
font-weight: bold;
}
.OSTTable{
width:600px;
}
.OSTTable1,.OSTTable2{
width:600px;
}
.OSTTable3{
width:802px;
}
.OSTcompleted{
padding: 5px 5px;
font-size: 15px;
}
.OSTSignInfo{
padding: 15px 5px 10px 5px;
font-size: 15px;
font-weight: bold;
}
.OSTSignInfoTips{
padding: 10px 5px;
font-size: 15px;
}
.eachTag{
margin-left:10px;
}
</style>
<style lang="scss">
.OSResult .el-dialog__body{
padding: 10px 20px;
}
.OSTTable3 .el-table__body-wrapper.is-scrolling-none {
&::-webkit-scrollbar{
width: 4px !important;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
</style>

View File

@ -1,90 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="popMenuClass" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { Notification } from 'element-ui';
import { DeviceMenu } from '@/scripts/ConstDic';
import { deleteTripNo, justTripNoArrival, justTripNoDeparture} from '@/api/rpTools';
export default {
props: {
tripNo: {
type: [String, Number]
}
},
components: {
PopMenu
},
data() {
return {
menu: [
{
label: '调整起始时间',
handler: this.doJustBeginTime,
disabled: false
},
{
label: '调整停站时间',
handler: this.doJustStopTime,
disabled: false
},
{
label: '删除',
handler: this.doDeleteTrip,
disabled: false
}
]
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planAusContextMenu)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
doShow(point) {
this.clickEvent();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
doDeleteTrip() {
if (this.tripNo) {
deleteTripNo(this.tripNo).then(resp => {
this.$emit('reload')
}).catch(error => {
this.$message.error('delete error');
})
}
},
doJustBeginTime() {
},
doJustStopTime() {
}
}
};
</script>
<style lang="scss" scoped>
.popMenuClass{
background: #fff;
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<el-dialog v-dialogDrag append-to-body title="Modify run time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
<el-form-item label="Running time" prop="time">
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
<span style="padding-left: 10px">s</span>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" @click="doConfirm">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
export default {
props: {
selected: {
type: Object,
default() {
return null
}
}
},
data() {
return {
dialogShow: false,
formModel: {
time: 0,
},
rules: {
time: { required: true, message: 'Please select the arrival time.', trigger: 'change' },
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustArrival)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
},
selected: function(val) {
if (val) this.formModel.time = val.runTime;
}
},
methods: {
doShow() {
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
doConfirm() {
this.$refs.form.validate((valid) => {
this.$emit('justRunning', this.formModel.time);
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,66 @@
<template>
<el-dialog v-dialogDrag append-to-body title="Modify stop time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
<el-form-item label="Stop time" prop="time">
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
<span style="padding-left: 10px">s</span>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" @click="doConfirm">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
export default {
props: {
selected: {
type: Object,
default() {
return null
}
}
},
data() {
return {
dialogShow: false,
formModel: {
time: 0
},
rules: {
time: { required: true, message: 'Please select the stop time.', trigger: 'change' },
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustDeparture)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
},
selected: function(val) {
if (val) this.formModel.time = val.depTime;
}
},
methods: {
doShow() {
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
doConfirm() {
this.$refs.form.validate((valid) => {
this.$emit('justStop', this.formModel.time);
this.doClose();
});
}
}
};
</script>

View File

@ -27,10 +27,10 @@ export default {
return '00';
},
width() {
return this.$store.state.app.width;
return this.$store.state.app.width - 2;
},
height() {
return this.$store.state.app.height - 60;
return this.$store.state.app.height - 72;
}
},
created() {
@ -96,297 +96,4 @@ export default {
overflow: hidden !important;
}
/* .planEdit__tool .el-dialog {
overflow: hidden !important;
background: rgba(202, 221, 253, 0.88);;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 2px solid #727375;
border-radius: 4px;
color: #000;
font-size: 14px;
}
.planEdit__tool .el-dialog .el-dialog__header {
height: 30px;
padding: 5px;
}
.planEdit__tool .el-dialog .el-dialog__footer {
background: #ECE9D8;
opacity: 1;
}
.planEdit__tool .el-dialog .el-dialog__body {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
margin: 0px 3px 3px 3px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
color: #000;
background: #ECE9D8;
opacity: 1;
}
.planEdit__tool .el-dialog .el-dialog__title {
font-size: 16px;
}
.planEdit__tool .el-dialog .el-dialog__headerbtn {
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid white;
border-radius: 4px;
top: 0px;
right: 3px;
line-height: 26px;
width: 26px;
}
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.planEdit__tool .el-dialog .el-tabs--top {
border: 2px outset #FEFEFD;
border-radius: 4px;
}
.planEdit__tool .el-dialog .el-tabs__item {
height: 30px;
line-height: 30px;
text-align: center;
color: #000 !important;
border-right: 2px outset #fff;
padding-left: 10px !important;
padding-right: 10px !important;
}
.planEdit__tool .el-dialog .el-tab-pane {
margin: 10px !important;
}
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
border-bottom: none
}
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item:not(.is-active) {
border-bottom: 2px inset #fff
}
.planEdit__tool .el-dialog .el-form {
background: #ECE9D8 !important;
}
.planEdit__tool .el-dialog .el-card {
background: #ECE9D8 !important;
}
.planEdit__tool .el-dialog .el-button {
height: 32px;
line-height: 32px;
padding: 0px;
width: 80px;
border: 2px outset #E2E2E2;
border-radius: 0px !important;
color: #000;
background: #ECE9D8;
}
.planEdit__tool .el-dialog .expand {
width: 120px;
}
.planEdit__tool .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.planEdit__tool .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.planEdit__tool .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.planEdit__tool .el-dialog .el-button:disabled span {
border: 0px;
}
.planEdit__tool .el-dialog .button-group {
margin-top: 10px;
}
.planEdit__tool .el-dialog .el-input {
border: 2px inset #E9E9E9;
}
.planEdit__tool .el-dialog .el-input .el-input__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.planEdit__tool .el-dialog .el-input.is-disabled .el-input__inner {
background: #F0F0F0 !important;
}
.planEdit__tool .el-dialog .el-textarea {
border: 2px inset #E9E9E9;
border-radius: 0px;
}
.planEdit__tool .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.planEdit__tool .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.planEdit__tool .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.planEdit__tool .el-dialog .el-table .cell {
line-height: unset !important;
}
.planEdit__tool .el-dialog .el-table th.is-leaf {
background: #ECE9D8 !important;
border-right: 1px solid #BDBDBD !important;
border-bottom: 1px solid #BDBDBD !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.planEdit__tool .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.planEdit__tool .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
}
.planEdit__tool .el-dialog .current-row>td {
background: #316AC5 !important;
color: #fff !important;
}
.planEdit__tool .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.planEdit__tool .el-dialog .el-checkbox__label {
color: #000 !important;
}
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
position: absolute;
-webkit-box-sizing: content-box;
box-sizing: content-box;
content: "";
border: 1px solid #000;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
top: 1px;
}
.planEdit__tool .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.planEdit__tool .el-dialog .el-radio__label {
color: #000 !important;
}
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
width: 4px;
height: 4px;
border-radius: 100%;
background-color: #000 !important;
position: absolute;
left: 50%;
top: 50%;
}
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.planEdit__tool .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -15px;
top: -18px;
}
.planEdit__tool .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.planEdit__tool .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.planEdit__tool .el-dialog .table {
margin-top: 10px;
}
.planEdit__tool .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.planEdit__tool .el-dialog .button-group {
margin-top: 10px;
}
.planEdit__tool .el-dialog .el-tree__empty-block {
background: #E9E9E9 !important;
color: #000 !important;
} */
</style>

View File

@ -1,19 +1,17 @@
import echarts from 'echarts';
import { DeviceMenu } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date';
export default {
data() {
return {
isDragging: false,
createModel: {
endStationCode: '',
startStationCode: '',
startTime: {
hour: '',
minute: '',
second: ''
}
}
startTime: ''
},
selected: null,
dragging: false
}
},
watch: {
@ -54,89 +52,214 @@ export default {
listenersBind() {
if (this.myChart) {
const zr = this.myChart.getZr();
zr.on('click', this.onClick, this)
zr.on('contextmenu', this.onContextMenu, this);
this.myChart.on('mousedown', this.onDragStart);
this.myChart.on('mouseup', this.onDragEnd);
this.myChart.on('click', 'series', this.onSelect);
this.myChart.on('datazoom', this.onClearMarks);
this.myChart.on('contextmenu', this.onContextMenu);
this.myChart.on('mousedown', this.onMouseDown);
this.myChart.on('datazoom', this.onUpdateZoom);
window.addEventListener('resize', this.onUpdatePosition);
}
},
listenersOff() {
if (this.myChart) {
const zr = this.myChart.getZr();
zr.off('click', this.onClick);
zr.off('contextmenu', this.onContextMenu);
this.myChart.off('mousedown', this.onDragStart);
this.myChart.off('mouseup', this.onDragEnd);
this.myChart.off('click', 'series', this.onSelect);
this.myChart.off('datazoom', this.onClearMarks);
this.myChart.off('contextmenu', this.onContextMenu)
this.myChart.off('mousedown', this.onMouseDown);
this.myChart.off('datazoom', this.onUpdateZoom);
window.removeEventListener('resize', this.onUpdatePosition);
}
},
loadInitGraphic() {
const option = this.myChart.getOption();
const graphic = option.series.map((el,i) => {
return {
id: el.name,
elements: echarts.util.map(el.data||[], (el, dataIndex) => {
return {
type: 'circle',
position: this.myChart.convertToPixel('grid', el),
shape: {
cx: 0,
cy: 0,
r: 10
},
invisible: true,
draggable: true,
ondrag: echarts.util.curry(this.onPointDragging, dataIndex),
onmousemove: echarts.util.curry(this.onShowTooltip, dataIndex),
onmouseout: echarts.util.curry(this.onHideTooltip, dataIndex),
z: 100
};
})
}
})
graphic.push({ id: 'operate', elements: [] })
this.myChart.setOption({ graphic });
},
onPointDragging(dataIndex, dx, dy) {
//
},
onShowTooltip(dataIndex) {
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: dataIndex
});
},
onHideTooltip(dataIndex) {
this.myChart.dispatchAction({type: 'hideTip'});
},
onUpdatePosition(e) {
const option = this.myChart.getOption();
const shapes = option.graphic;
// const graphic = shapes.map(el => {
// return echarts.util.map(el.elements||[], function (item, dataIndex) {
// console.log(item, this.myChart.convertToPixel('grid', item.point))
// return {
// position: this.myChart.convertToPixel('grid', item.point)
// };
// })
// })
// this.myChart.setOption({graphic});
},
onUpdateZoom(e) {;
const option = this.myChart.getOption();
const shapes = option.graphic;
// const graphic = shapes.map(el => {
// console.log(el)
// const points = (el.elements||[]).map(el => { return el.point; });
// return echarts.util.map(points, function (point, dataIndex) {
// console.log(point, this.myChart.convertToPixel('grid', point))
// return {
// position: this.myChart.convertToPixel('grid', point)
// };
// })
// })
// this.myChart.setOption({graphic});
},
onClick(e) {
this.pixelExecCb(e, this.handleMarkPoint)
switch(this.action) {
case 'Plan':
this.pixelExecCb(e, this.handleMarkPoint);
break;
}
},
onContextMenu(e) {
console.log(e, 'onContextMenu');
this.onClearMarks();
if(e.target) {
const event = e.event;
const point = {
x: event.clientX,
y: event.clientY
}
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planAusContextMenu });
} else {
this.$message.info('No train number selected')
if (e.componentType == "series" &&
e.componentSubType == "line" &&
e.seriesName.includes('run-')) {
const value = e.value;
const option = this.myChart.getOption();
const dataList = option.series[e.seriesIndex].data;
const length = dataList.length;
const nxt = dataList[e.dataIndex+1];
const pre = dataList[e.dataIndex-1];
this.selected = {
seriesId: e.seriesName.replace('run-', ''),
depTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
runTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
stationCode: value[2]
}
if (e.dataIndex == length - 1 ||
e.dataIndex < length - 1 && value[1] == nxt[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustDeparture });
} else if (e.dataIndex == 0 ||
e.dataIndex > 0 && value[1] == pre[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustArrival });
}
}
},
onClearMarks() {
if (this.myChart) {
let op = this.myChart.getOption();
op.graphic[0].elements = [];
this.myChart.setOption(op, {notMerge: true})
onMouseDown(e) {
if (e.componentType == "series" &&
e.componentSubType == "line" &&
e.seriesName.includes('run-')) {
const value = e.value;
const option = this.myChart.getOption();
const dataList = option.series[e.seriesIndex].data;
const length = dataList.length;
const nxt = dataList[e.dataIndex+1];
const pre = dataList[e.dataIndex-1];
this.selected = {
seriesId: e.seriesName.replace('run-', ''),
depTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
runTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
stationCode: value[2]
}
this.dragging = true;
}
},
onSelect(e) {
console.log(e, 'select')
},
onDragStart(e) {
console.log(e, 'dragStart');
},
onDragEnd(e) {
console.log(e, 'dragEnd');
clearMarks() {
const option = this.myChart.getOption();
const graphic = option.graphic;
const index = graphic.findIndex(el => { return el.id == 'operate'});
if (index >= 0) {
graphic[index].elements = [];
}
this.myChart.setOption(option, {notMerge: true});
},
createMarkPoint(point, text) {
return {
type: 'group',
z: 100,
children: [
{
type: 'circle',
z: 100,
position: point,
point,
shape: {
cx: point[0],
cy: point[1],
r: 5
},
style: {
fill: 'rgba(0,0,0,0.3)'
}
},
{
type: 'circle',
z: 100,
shape: {
cx: point[0],
cy: point[1],
cx: 0,
cy: 0,
r: 10
},
style: {
fill: 'rgba(0,0,0,0.3)'
}
}
]
}
// return {
// type: 'group',
// z: 100,
// position: point,
// point,
// children: [
// {
// type: 'circle',
// z: 100,
// shape: {
// cx: 0,
// cy: 0,
// r: 5
// },
// style: {
// fill: 'rgba(0,0,0,0.3)'
// }
// },
// {
// type: 'circle',
// z: 100,
// shape: {
// cx: 0,
// cy: 0,
// r: 10
// },
// style: {
// fill: 'rgba(0,0,0,0.3)'
// }
// }
// ]
// }
},
handleMarkPoint(yObj, xVal, pointInPixel) {
let myChart = this.myChart;
@ -151,7 +274,7 @@ export default {
this.createModel.startTime = timeFormat(xVal);
} else if (graphic.elements.length >= 2) {
this.createModel.endStationCode = yObj.code;
this.createRpTrip(this.createModel);
this.handleCreate(this.createModel);
}
}
}

View File

@ -1,24 +1,43 @@
<template>
<div id="PlanSchedule">
<div class="left">
<div :id="runPlanId" />
<context-menu :tripNo="tripNo" />
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="menus">
<el-button-group v-model="active">
<el-button v-for="(el,i) in buttonList"
:type="active == i? 'primary':''"
:key="i" @click="handleBtnSelect(el,i)">{{el.name}}</el-button>
</el-button-group>
<el-button @click="handleCancle">Reset</el-button>
<el-button-group style="margin-left: 20px">
<el-button :type="selected?'danger':'info'" icon="el-icon-delete" @click="handleRemove" />
</el-button-group>
</div>
</div>
<div :id="runPlanId" />
</el-card>
<plan-just-running :selected="selected" @justRunning="handleJustRunning" />
<plan-just-stop :selected="selected" @justStop="handleJustStop"/>
</div>
</template>
<script>
import echarts from 'echarts';
import PlanJustRunning from './dialog/planJustRunning.vue';
import PlanJustStop from './dialog/planJustStop.vue';
import Monitor from './monitor.js';
import ContextMenu from './contextMenu.vue';
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { getStationList } from '@/api/runplan';
import { getRpTools, addRpTrip } from '@/api/rpTools';
import { getRpTools, addRpTrip, delRpTrip, justTripNoRunning, justTripNoStop} from '@/api/rpTools';
import { loadMapDataById } from '@/utils/loaddata';
import { getPublishMapInfo } from '@/api/jmap/map';
import echarts from 'echarts';
export default {
components: {
PlanJustRunning,
PlanJustStop
},
props: {
planConvert: {
type: Object,
@ -46,49 +65,35 @@ export default {
}
},
mixins: [Monitor],
components: {
ContextMenu
},
data() {
return {
top: 0,
height: 0,
mapName: 'XXX',
runPlanId: 'plan-tool',
myChart: null,
showTrain: false,
tripNo: '',
serviceNumberConfig: {
data: [],
title: this.$t('planMonitor.serviceNumber'),
showHeader: false,
highlightCurrentRow: true,
handleChange: this.serviceNumberChange,
showClose: false,
columns: [
{
prop: 'serviceNumber',
label: this.$t('planMonitor.serviceNumber')
}
]
},
tripNumberConfig: {
data: [],
title: this.$t('planMonitor.tripNumber'),
showHeader: false,
highlightCurrentRow: true,
handleChange: this.tripNumberChange,
showClose: false,
columns: [
{
prop: 'tripNumber',
label: this.$t('planMonitor.tripNumber')
}
]
},
realData: {},
kmRangeCoordMap: {},
option: {
stationsObj: {},
active: -1,
action: '',
buttonList: [
{
name: 'Plan',
type: 'Plan'
} ]
};
},
computed: {
...mapGetters('rpTools', [
'stations'
]),
planId() {
return this.$route.query.planId;
},
mapId() {
return 9;
},
option() {
return {
title: {
text: '',
left: 'center',
@ -175,13 +180,9 @@ export default {
max: 0
},
graphic: [{
id: 'static',
id: 'operate',
elements: []
}],
markPoint: [{
id: 'mark',
data: []
}],
series: [],
dataZoom: [
{
@ -191,34 +192,12 @@ export default {
moveOnMouseWheel: 'ctrl'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
type: 'slider',
filterMode: 'empty',
bottom: '20px'
}
]
},
absoluteTime: 2 * 3600,
indexKmRangeMap: {},
stationsObj: {}
};
},
computed: {
...mapGetters('rpTools', [
'stations'
]),
planId() {
return this.$route.query.planId;
},
mapId() {
return 9;
}
}
},
watch: {
@ -251,120 +230,28 @@ export default {
this.destroy();
},
methods: {
displayTrain() {
this.showTrain = !this.showTrain;
},
serviceNumberChange(row) {
let serviceNumber = null;
let serviceObj = {};
if (row) {
serviceNumber = row.serviceNumber;
serviceObj = this.$store.state.rpTools.editData[row.serviceNumber] || {};
const op = this.myChart.getOption();
op.series.forEach((item, index) => {
item.lineStyle.color = '#000';
switch (item.name) {
case serviceNumber: {
item.lineStyle.color = 'red';
break;
}
case 'trainLabel': {
op.series.pop();
break;
}
}
});
this.myChart.setOption(op, true);
}
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: null });
this.analyticalTripNumber(serviceObj.trainMap || {});
},
tripNumberChange(row) {
const serviceNumber = this.$store.state.rpTools.selected.serviceNumber;
let tripNumber = null;
if (row) {
const data = [];
tripNumber = row.tripNumber;
const op = this.myChart.getOption();
op.series.forEach((item, index) => {
switch (item.name) {
case serviceNumber: {
item.data.forEach(nor => {
if (nor[3] == tripNumber) {
data.push(nor);
}
});
break;
}
case 'trainLabel': {
op.series.pop();
this.myChart && this.myChart.setOption(op, true);
break;
}
}
});
op.series.push({
name: 'trainLabel',
lineStyle: {
color: 'green'
},
type: 'line',
data: data
});
setTimeout(() => {
this.myChart && this.myChart.setOption(op, true);
}, 50);
}
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
},
async analyticalServiceNumber(data) {
this.serviceNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.map(serviceNumber => { return { serviceNumber }; });
},
async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.map(tripNumber => { return { tripNumber }; });
},
async setPosition() {
setPosition() {
this.$nextTick(() => {
let top = 3;
const width = this.maxWidth;
let height = this.maxHeight;
const titleBar = document.getElementById('PlanTitleBar');
const menuBar = document.getElementById('PlanMenuBar');
const menuTool = document.getElementById('PlanMenuTool');
const statusBar = document.getElementById('PlanStatusBar');
if (titleBar) {
top += (titleBar.offsetHeight || 0);
}
if (menuBar) {
top += (menuBar.offsetHeight || 0);
}
if (menuTool) {
top += (menuTool.offsetHeight || 0);
}
if (statusBar) {
height -= (statusBar.offsetHeight || 0);
}
height = height - top;
const height = this.maxHeight;
this.$store.dispatch('rpTools/resize', { width, height });
if (this.top != top) {
this.top = top;
});
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
if (this.height != height) {
this.height = height - 20 * 2;
if (this.$route.query.planName || this.$route.query.prdType === '05') {
this.option.title.text = this.mapName;
}
this.myChart = echarts.init(document.getElementById(this.runPlanId));
this.myChart.setOption(this.option, {notMerge: true});
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
resolve(true);
} catch (error) {
reject(error);
}
});
},
@ -380,12 +267,17 @@ export default {
return el.name.includes(it)
}) < 0;
});
this.stationsObj = {};
stations.forEach(item => {
this.stationsObj[Math.floor(item.kmRange)] = item;
});
this.$store.dispatch('rpTools/setStations', stations).then(() => {
this.loadInitData();
this.myChart && this.myChart.showLoading();
getRpTools().then(rest => {
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
this.analyticalServiceNumber(this.$store.state.rpTools.editData);
this.loadChartData();
this.myChart && this.myChart.hideLoading();
});
@ -405,34 +297,28 @@ export default {
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
}
},
async loadChartData() {
try {
const stations = this.$store.state.rpTools.stations;
const planData = this.$store.state.rpTools.planData;
this.stationsObj = {};
stations.forEach(item => {
this.stationsObj[Math.floor(item.kmRange)] = item;
});
this.viewDisabled = true;
this.option.series = [];
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
await this.loadInitChart();
this.viewDisabled = false;
} catch (error) {
this.viewDisabled = false;
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
}
},
async loadInitData() {
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart();
},
async loadChartData() {
try {
const stations = this.$store.state.rpTools.stations;
const planData = this.$store.state.rpTools.planData;
const option = this.myChart.getOption();
option.series = [];
option.graphic = [{ id: 'operate', elements: [] }];
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
this.pushModels(option.series, [this.planConvert.initializeYaxis(this.stations)]);
this.pushModels(option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
this.myChart.setOption(option, {notMerge: true});
this.loadInitGraphic();
} catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
@ -455,24 +341,6 @@ export default {
}
return series;
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
if (this.$route.query.planName || this.$route.query.prdType === '05') {
this.option.title.text = this.mapName;
}
this.myChart = echarts.init(document.getElementById(this.runPlanId));
this.myChart.setOption(this.option, {notMerge: true});
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
resolve(true);
} catch (error) {
reject(error);
}
});
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
@ -480,14 +348,6 @@ export default {
this.myChart = null;
}
},
clearCanvas() {
this.option.series = [];
this.option.title.text = '';
if (this.myChart) {
this.myChart.clear();
}
this.myChart.setOption(this.option);
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
@ -509,7 +369,7 @@ export default {
}
const startValue = 3600 * 6;
const offsetTime = 3600 * 1;
const offsetTime = 3600 / 6;
this.option.xAxis[0].data = list;
if (!this.option.dataZoom[0].startValue) {
@ -555,17 +415,88 @@ export default {
});
}
},
createRpTrip(data) {
addRpTrip(data).then(resp => {
this.loadChartData();
}).catch(error => {
handleBtnSelect(el, i) {
this.active = i;
this.action = el.type;
},
handleCancle() {
this.active = -1;
this.action = '';
this.selected = null;
this.clearMarks();
},
handleCreate(data) {
if (this.myChart) {
const op = this.myChart.getOption();
op.graphic[0].elements = [];
this.myChart.setOption(op, {notMerge: true});
}
addRpTrip(data).then(resp => {
getRpTools().then(rest => {
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
this.loadChartData();
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}).catch(error => {
this.$message(error.message);
this.clearMarks();
})
}
},
handleRemove() {
if (this.myChart && this.selected) {
delRpTrip(this.selected.seriesId).then(resp => {
getRpTools().then(rest => {
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
this.loadChartData();
this.handleCancle();
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}).catch(error => {
this.$message(error.message);
})
}
},
handleJustRunning(time) {
if (this.selected) {
const model = {
seconds: time,
stationCode: this.selected.stationCode
}
justTripNoRunning(this.selected.seriesId, model).then(resp => {
getRpTools().then(rest => {
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
this.loadChartData();
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}).catch(error => {
this.$message(error.message);
})
}
},
handleJustStop(time){
if (this.selected) {
const model = {
seconds: time,
stationCode: this.selected.stationCode
}
justTripNoStop(this.selected.seriesId, model).then(resp => {
getRpTools().then(rest => {
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
this.loadChartData();
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}).catch(error => {
this.$message(error.message);
})
}
}
}
};
</script>
@ -575,25 +506,14 @@ export default {
#PlanSchedule {
z-index: 0;
width: 100%;
height: calc(100% - 45px);
position: relative;
margin-top: 45px;
.left {
height: 100%;
width: 100%;
float: left;
}
position: relative;
.position {
position: absolute;
top: 0px;
right: 50px;
width: 220px;
height: calc(100% - 45px);
}
.data_table_box{
height: 50%;
.menus {
margin: 0 80px;
display: flex;
justify-content: flex-end;
align-items: center;
}
}
</style>

Binary file not shown.