Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
sheng 2020-03-08 13:37:33 +08:00
commit 1f881fc204
9 changed files with 411 additions and 102 deletions

View File

@ -203,6 +203,7 @@ class SkinCode extends defaultStyle {
common: { // 通用属性
textFontSize: 11, // 站台默认字体大小
special: true, // 特殊站台
haveJumpShow: true, // 站台是否有列车停跳显示
functionButtonShow: [] // 功能灯按钮显示条件prdType
},
safetyDoor: { // 屏蔽门
@ -241,6 +242,15 @@ class SkinCode extends defaultStyle {
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
jump: {
text: '跳', // 停跳显示内容
position: -1, // 停跳方向
offset: { x: -8, y: 0 },
textColor: '#0000FF', // 停跳文字颜色
arcColor: '#0000FF', // 停跳圆圈颜色
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
r: 8 // 圆半径大小
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: { x: -8, y: 26 }, // 运行时间偏移量
@ -491,10 +501,17 @@ class SkinCode extends defaultStyle {
lrPadding: 1, // 两边间隔
upPadding: 1, // 上边距离
trainBodyFillColor: '#000000', // 列车车身填充颜色
trainSidelineColor: '#FFFF00',
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
},
hsda: {
trainHSDATextFontSize: 8// 列车HDSA字号
lrPaddingHSDA: 3, // HSDA两边间隔
upPaddingHSDA: 20, // HSDA上边距离
trainHSDATextFontSize: 8, // 列车HDSA字号
textHContent: '扣', // textH文本
textSContent: '跳', // textS文本
textDContent: '门', // textD文本
textAContent: '警' // textA文本
},
trainAtrStatus: {
trainAtrStatusOffset: { x: 68, y: 9},
@ -521,13 +538,15 @@ class SkinCode extends defaultStyle {
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'BB', // 默认服务号(表号)
trainServerOffset: { x: 35, y: 3 }// 列车服务号偏移
trainServerOffset: { x: 35, y: 3 }, // 列车服务号偏移
fontColor: '#00C300'
},
trainTarget: {
tripNumberPrefix: '000', // 车次号前缀
defaultDirectionCode: '', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 10, y: 3 }// 列车车次号偏移
trainTargetOffset: { x: 10, y: 3 }, // 列车车次号偏移
fontColor: '#00C300'
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀

View File

@ -1,5 +1,5 @@
import { deepAssign } from '@/utils/index';
import deviceType from './deviceType';
// import deviceType from './deviceType';
// 所有默认状态在这里都要有 用来转换后台发送的数据状态
class Status {

View File

@ -7,9 +7,9 @@ class EDetain extends Group {
this.model = model;
this.isNew = false;
this.detain = null;
if (this.model.style.StationStand.common.special) {
this.create('E');
}
// if (this.model.style.StationStand.common.special) {
this.create();
// }
}
create(textName) {
@ -42,7 +42,6 @@ class EDetain extends Group {
position = -model.width / 4 - gagX;
}
}
console.log(textName);
this.detain = new Text({
zlevel: model.zlevel,
z: model.z,
@ -93,11 +92,12 @@ class EDetain extends Group {
show(nameText) {
if (this.model.style.StationStand.common.special && nameText) {
this.create();
this.detain.setStyle('text', nameText);
} else {
this.create();
this.detain.show();
}
this.detain.show();
}
}

View File

@ -11,12 +11,52 @@ class EJump extends Group {
this.setStatus(model.allSkip, model.assignSkip);
}
create() {
create(textName) {
if (!this.isNew) {
const model = this.model;
const style = this.model.style;
this.isNew = true;
if (style.StationStand.common.special) {
// inside true 内侧
const gag = 22;
const gagX = 6; // 左右间隔
let height = '';
let position = '';
if (model.right) {
if (model.inside) {
height = -gag;
position = -model.width / 4 - gagX;
} else {
height = gag;
position = model.width / 4 + gagX;
}
} else {
if (model.inside) {
height = gag;
position = model.width / 4 + gagX;
} else {
height = -gag;
position = -model.width / 4 - gagX;
}
}
this.jump = new Text({
zlevel: model.zlevel,
z: model.z,
position: [0, 0],
style: {
x: model.x + position,
y: model.y + height,
text: textName,
textAlign: 'center',
fontWeight: 'blod',
fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`,
textFill: textName == 'S' ? 'green' : '#fff',
textVerticalAlign: 'middle'
}
});
this.add(this.jump);
} else {
this.jump = new Text({
zlevel: model.zlevel,
z: model.z,
@ -50,12 +90,14 @@ class EJump extends Group {
this.jumpArc.hide();
}
}
}
setName(val) {
this.create();
this.jump.setStyle('text', val);
}
setStatus(allSkip, assignSkip) {
if (this.jumpArc) {
this.jumpArc.hide();
if (assignSkip) {
this.jumpArc.hide(); // 指定站台跳停
@ -63,6 +105,7 @@ class EJump extends Group {
this.jumpArc.show(); // 站台全部跳停
}
}
}
setColor(color) {
this.create();
this.jump.setStyle('textFill', color);
@ -73,8 +116,13 @@ class EJump extends Group {
this.jump.hide();
}
show() {
show(nameText) {
if (this.model.style.StationStand.common.special && nameText) {
this.create();
this.jump.setStyle('text', nameText);
} else {
this.create();
}
this.jump.show();
}
}

View File

@ -182,10 +182,14 @@ class StationStand extends Group {
/** 列车停跳 */
if (style.StationStand.common.haveJumpShow) {
const jumpDirct = model.right ? -1 : 1;
const jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
const jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
let jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
let jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
const jumpCX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
const jumpCY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
if (style.StationStand.common.special) {
jumpX = model.position.x;
jumpY = model.position.y;
}
this.jump = new EJump({
zlevel: this.zlevel,
z: this.z + 1,
@ -194,6 +198,9 @@ class StationStand extends Group {
y: jumpY,
cx: jumpCX,
cy: jumpCY,
width: model.width,
inside: model.inside,
right: model.right,
textAlign: 'center',
textVerticalAlign: 'middle',
allSkip: model.allSkip,
@ -351,9 +358,9 @@ class StationStand extends Group {
recover() {
this.time && this.time.hide();
this.level && this.level.hide();
if (!this.style.StationStand.common.special) {
// if (!this.style.StationStand.common.special) {
this.detain && this.detain.hide();
}
// }
this.emergent && this.emergent.hide();
this.trainStop && this.trainStop.hide(); // 列车停站
this.trainDepart && this.trainDepart.hide();
@ -384,6 +391,10 @@ class StationStand extends Group {
if (!this.style.StationStand.common.special) {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
}
if (this.style.StationStand.common.special) {
this.detain && this.detain.show('E');
this.detain && this.detain.setColor('#fff');
}
this.emergent && this.emergent.show();
if (this.style.StationStand.standEmergent.flicker) {
this.emergent.getElement().animateStyle(true)
@ -397,7 +408,12 @@ class StationStand extends Group {
/** 指定列车跳站*/
designatedJumpStop() {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.designatedJumpStopColor);
if (this.style.StationStand.common.special) {
this.jump && this.jump.show('S');
this.jump && this.jump.setColor('green');
} else {
this.jump && this.jump.show();
}
this.jump && this.jump.setStatus(0, 1);
}
@ -410,7 +426,12 @@ class StationStand extends Group {
/** 站台跳停*/
jumpStop() {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.jumpStopColor);
if (this.style.StationStand.common.special) {
this.jump && this.jump.show('S');
this.jump && this.jump.setColor('green');
} else {
this.jump && this.jump.show();
}
this.jump && this.jump.setStatus(1, 0);
}
@ -488,8 +509,8 @@ class StationStand extends Group {
}
/** 设置跳停*/
// model.assignSkip = 1;
model.assignSkip && this.designatedJumpStop(); // 指定站台跳停
// model.allSkip = 1;
model.assignSkip && this.designatedJumpStop(); // 指定列车跳停
model.allSkip && this.jumpStop(); // 站台全部跳停
/** 设置扣车*/

View File

@ -110,7 +110,7 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
textFill: style.trainTextColor,
textFill: model.style.Train.trainServer.fontColor || style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
@ -122,7 +122,7 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
textFill: style.trainTextColor,
textFill: model.style.Train.trainTarget.fontColor || style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: style.Train.trainTarget.trainTargetTextAlign,
@ -178,7 +178,7 @@ export default class TrainBody extends Group {
fill: '#ff0000'
}
});
this.add(this.atrStatus);
// this.add(this.atrStatus);
}
if (style.Train.common.hasTravelSigns) {
this.travelSigns = new ETextName({
@ -186,8 +186,8 @@ export default class TrainBody extends Group {
z: model.z + 1,
x: parseInt(model.point.x + style.Train.travelSigns.trainTravelSignsOffset.x),
y: parseInt(model.point.y + style.Train.travelSigns.trainTravelSignsOffset.y),
text: '<',
textFill: style.trainTextColor,
text: this.deviceModel.right ? '>' : '<',
textFill: '#00C300',
textStroke: style.trainTextColor,
textStrokeWidth: 0,
fontSize: model.fontSize,
@ -221,7 +221,7 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
text: 'AA',
textFill: style.trainTextColor,
textFill: '#00C300',
textStroke: style.trainTextColor,
textStrokeWidth: 0,
fontSize: model.fontSize,
@ -238,7 +238,7 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
text: '0',
textFill: style.trainTextColor,
textFill: '#DADA00',
textStroke: style.trainTextColor,
textStrokeWidth: 0,
fontSize: model.fontSize,

View File

@ -0,0 +1,226 @@
<template>
<el-dialog
v-dialogDrag
class="haerbin-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
<el-form-item prop="trainCode" label="车组号:">
<!--<el-input v-model="addModel.trainCode"/>-->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange" filterable>
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default {
name: 'TrainCreateNumber',
mixins: [
CancelMouseState
],
data() {
return {
trainNoList: [],
selected: null,
sectionName: '',
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode:'',
tripNumber:'',
serviceNumber: ''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'change'}
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '新建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumberList = [];
resp.data.forEach(item => {
if (!this.serviceNumberList.includes(item)) {
this.serviceNumberList.push(item);
}
});
});
if (this.serviceNumberList.length === 1) {
this.addModel.serviceNumber = this.serviceNumberList[0];
}
},
doShow(operate, selected) {
this.selected = selected;
//
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber: ''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
}).catch(error => {
this.$messageBox(error.message);
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
this.$messageBox(error.message);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
.el-dialog-div {
height: 200px;
overflow: auto;
}
</style>

View File

@ -7,6 +7,7 @@
<train-move ref="trainMove" />
<train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber" />
<train-init-plan ref="trainInitPlan"/>
</div>
</template>
@ -22,6 +23,7 @@ import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber';
import TrainInitPlan from './dialog/trainInitPlan';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
@ -33,7 +35,8 @@ export default {
TrainDelete,
TrainMove,
TrainSwitch,
TrainEditNumber
TrainEditNumber,
TrainInitPlan
},
props: {
selected: {
@ -47,44 +50,19 @@ export default {
return {
menu: [],
menuNormal: {
Local: [],
Local: [
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
],
Center: [
// {
// label: this.$t('menu.menuTrain.addTrainId'),
// handler: this.addTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.deleteTrainId'),
// handler: this.delTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainId'),
// handler: this.editTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainNo'),
// handler: this.editTrainNo,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.moveTrainId'),
// handler: this.moveTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.switchTrainId'),
// handler: this.switchTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// }
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
]
},
menuForce: [
@ -162,6 +140,23 @@ export default {
// this.$store.dispatch('map/setTrainWindowShow', false);
}
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
const step = {