This commit is contained in:
ival 2019-08-23 13:44:56 +08:00
commit 554db95dd6
43 changed files with 641 additions and 978 deletions

View File

@ -32,6 +32,7 @@ export default {
pointY: 'Coordinates y:',
direct: 'The direction of:',
basisLink: 'Based on the Link:',
sectionRelSwitchCode: 'sectionRelSwitchCode',
pleaseSelectSectionName: 'Select the section name',
pleaseFillOffset: 'Please fill in the offset',

View File

@ -114,7 +114,7 @@ export default {
automaticSignalCode: '自动信号编码',
signalCodeName: '信号机名称',
signalCode: '信号机code',
sectionData: '区段数据',
sectionData: '区段列表',
preview: '预览',
operation: '操作',
compile: '编辑',
@ -124,11 +124,11 @@ export default {
sectionList: '区段列表',
automaticSignal: '自动信号',
signalID: '信号机ID:',
signalID: '信号机:',
activate: '激活',
pleaseSelectSignal: '请选择信号机',
triggerSegmentData: '请选择进路自动触发区段数据',
triggerSegmentData: '请选择进路自动触发区段',
automaticSignalSuccessful: '创建自动信号成功!',
failedCreateSignal: '创建自动信号失败',
automaticSignalUpdateSucceeded: '更新自动信号成功!',
@ -212,7 +212,7 @@ export default {
sectionLogicalNumber: '逻辑区段数量',
sectionLsectioncode: '左侧区段名称:',
sectionRsectioncode: '右侧区段名称:',
associatedSection: '关联物理区段:',
associatedSection: '所属物理/道岔区段:',
blockCoding: '区段编码:',
sectionType: '区段类型:',
sectionNameColon: '区段名称:',
@ -239,12 +239,12 @@ export default {
destinationCodeShow: '是否显示目的地码:',
leftStopPointOffset: '左向停车点偏移量:',
rightStopPointOffset: '右向停车点偏移量:',
isSwitchSection: '是否道岔区段:',
relSwitchCode: '关联道岔Code:',
isSwitchSection: '是否关联道岔:',
relSwitchCode: '关联道岔:',
logicSectionNameSort: '逻辑区段排序:',
fromSmallToLarge: '从小到大',
fromLargeToSmall: '从大到小',
relevanceLinkCode: '关联的Link:',
relevanceLinkCode: '所在Link:',
sepTypeLeft: '左侧分隔符类型:',
sectionOffsetLeft: '左侧Link偏移量:',
sepTypeRight: '右侧分隔符类型:',
@ -269,17 +269,22 @@ export default {
potLampType: '点灯类型:',
signalDirectionType: '方向类型:',
signalPositionType: '信号机位置类型:',
signalOffset: '偏移量:',
signalOffset: '所属link偏移量:',
signalLinkCode: '所属link',
signalPositionX: '信号机x:',
signalPositionY: '信号机y:',
signalPosition: '信号机坐标:',
signalNamePositionX: '信号机名字偏移量 x:',
signalNamePositionY: '信号机名字偏移量 y:',
signalNamePosition: '信号机名字偏移量:',
signalButtonShow: '是否显示按钮:',
signalButtonPositionX: '按钮x:',
signalButtonPositionY: '按钮y:',
signalButtonPosition: '按钮:',
signalGuideShow: '是否显示引导信号灯:',
signalGuidePositionX: '引导信号x:',
signalGuidePositionY: '引导信号y:',
signalGuidePosition: '引导信号:',
concentrateStationCode: '所属联锁站编码:',
stationCode: '车站编码:',
@ -296,7 +301,9 @@ export default {
stationKmPostFontColor: '公里标字体颜色:',
stationPositionX: 'x坐标:',
stationPositionY: 'y坐标:',
stationPosition: '车站坐标:',
stationControlPosition: '控制模式坐标:',
stationControlCode: '控制模式编码:',
stationControlName: '控制模式名称:',
zokContent: '中控内容:',
@ -313,6 +320,7 @@ export default {
stationstandShowName: '是否显示名称:',
stationstandWidth: '宽度 w:',
stationstandHeight: '高度 h:',
stationstandPosition: '车站坐标:',
switchCode: '道岔编码:',
switchName: '道岔名称:',
@ -320,6 +328,7 @@ export default {
switchShowName: '是否显示道岔名称:',
switchPositionX: '道岔名称x偏移量:',
switchPositionY: '道岔名称y偏移量:',
switchPosition: '道岔名称偏移量:',
turnTime: '道岔转换时间:',
timeoutShow: '是否显示道岔倒计时时间:',
sectionACode: '关联的A Section Code:',
@ -327,6 +336,11 @@ export default {
sectionCCode: '关联的C Section Code:',
switchTpX: '时间x坐标偏移量:',
switchTpY: '时间y坐标偏移量:',
switchTp: '时间坐标偏移量:',
counterPosition: '计数器坐标:',
delayUnlockPosition: '延迟解锁坐标:',
trainWindowPoints: '车次窗坐标:',
textPoints: '坐标:',
textCode: '文字编码:',
textContent: '文本内容:',
@ -370,7 +384,7 @@ export default {
startingSignalName: '始端信号机名称',
endingSignalName: '终端信号机名称',
routeID: '进路ID',
routeID: '进路',
routeName: '进路名称:',
routeStationName: '所属车站名称',
@ -381,16 +395,16 @@ export default {
accessType: '进路性质类型',
automaticRouteType: '自动进路类型',
nearSectionCode: '接近区段名称',
continueProtectSwitchData: '延续保护道岔数据',
accessSideTurnoutData: '进路侧防道岔数据',
continueProtectSwitchData: '延续保护道岔',
accessSideTurnoutData: '进路侧防道岔',
turnBackRailName: '折返轨名称',
routeSegmentData: '进路自动触发区段数据',
routeProtectsData: '进路延续保护区段数据',
accessPhysical: '进路物理区段数据',
routeRouteScreenData: '进路屏蔽门数据',
routeRouteTurnoutData: '进路道岔数据',
hostileApproachData: '敌对进路数据',
routeSegmentData: '进路自动触发区段',
routeProtectsData: '进路延续保护区段',
accessPhysical: '进路物理区段',
routeRouteScreenData: '进路屏蔽门',
routeRouteTurnoutData: '进路道岔',
hostileApproachData: '敌对进路',
relation: '关系',
associatedRoute: '关联进路:',
@ -401,20 +415,20 @@ export default {
accessTypeColon: '进路性质类型:',
automaticRouteTypeColon: '自动进路类型:',
startSignalId: '始端信号机ID:',
endSignalId: '终端信号机ID:',
startSignalId: '始端信号机:',
endSignalId: '终端信号机:',
switchType: '道岔类型',
switchId: '道岔ID',
accessSwitchList: '进路道岔数据:',
accessStandList: '进路屏蔽门数据:',
accessSectionList: '进路物理区段数据:',
turnBackSectionCode: '折返轨ID:',
routeFlankProtectionList: '侧防道岔数据:',
routeOverlapSwitchList: '延续保护道岔数据:',
routeOverlapSectionList: '进路延续保护区段数据:',
routeTriggerSectionList: '进路自动触发区段数据:',
nearSectionCodeColon: '接近区段ID:',
switchId: '道岔',
accessSwitchList: '进路道岔:',
accessStandList: '进路屏蔽门:',
accessSectionList: '进路物理区段:',
turnBackSectionCode: '折返轨:',
routeFlankProtectionList: '侧防道岔:',
routeOverlapSwitchList: '延续保护道岔:',
routeOverlapSectionList: '进路延续保护区段:',
routeTriggerSectionList: '进路自动触发区段:',
nearSectionCodeColon: '接近区段:',
thenList: '交路列表',
startStation: '起始站',
@ -485,7 +499,7 @@ export default {
routingDirection: '方向',
remarks: '描述',
remarksColon: '描述:',
trafficSegmentData: '交路区段数据:',
trafficSegmentData: '交路区段:',
startSectionColon: '起始区段:',
endStationColon: '终到站:',
endSectionColon: '终到区段:',

View File

@ -184,6 +184,7 @@ export default {
chooseUser: '请选择用户',
pleaseInputLessonName: '请输入课程名称',
pleaseSelectTraining: '请选择实训',
sectionRelSwitchCode: '请选择关联道岔',
maxScaling: '(缩放比例最大为8级)',
skinCodingInput: '请输入皮肤编码',

View File

@ -12,7 +12,11 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
text: {
active: {
routeColor: false // 进路触发颜色
},
text: { // 物理区段名称
show: true, // 物理区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -22,7 +26,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
logicText: { // 逻辑区段名称
show: true, // 逻辑区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -32,7 +37,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
standText: { // 站台轨名称
show: true, // 站台轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -43,7 +49,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
reentryText: { // 折返轨名称
show: true, // 折返轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -54,7 +61,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
transferText: { // 转换轨名称
show: true, // 转换轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -65,7 +73,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
destinationText: { // 目的码名称
show: true, // 目的码名称显示
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -262,7 +271,7 @@ class SkinCode extends defaultStyle {
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: true // 按图折返显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -12,6 +12,9 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: true // 进路触发颜色
},
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
@ -262,7 +265,11 @@ class SkinCode extends defaultStyle {
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -12,6 +12,9 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
@ -259,7 +262,11 @@ class SkinCode extends defaultStyle {
grayColor: '#C0C0C0', // 控制模式灰色
greenColor: 'green', // 控制模式绿色
redColor: 'red', // 控制模式红色
yellowColor: 'yellow' // 控制模式黄色
yellowColor: 'yellow', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: false // 控制模式箭头显隐

View File

@ -12,6 +12,9 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
@ -241,7 +244,11 @@ class SkinCode extends defaultStyle {
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: false, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: true // 控制模式箭头显隐

View File

@ -308,8 +308,10 @@ class Jlmap {
} else {
const elem = list[idex];
if (elem) {
Object.keys(elem).forEach(key => {
elem[key] = model[key];
Object.keys(model).forEach(key => {
if (key != 'instance') {
elem[key] = model[key];
}
});
} else {
list.push(Object.assign({}, model));

View File

@ -731,12 +731,21 @@ export default class Section extends Group {
/** 设置状态*/
setState(model) {
this.recover();
if (model.status == '01') {
if (this.name && this.style.Section.active.routeColor) {
this.name.setStyle({textFill: this.style.Section.text.fontColor});
}
} else {
if (this.name && this.style.Section.active.routeColor) {
this.name.setStyle({textFill: 'green'});
}
}
switch (model.status) {
case '00': /** 未定义*/
this.undefine();
break;
case '01': /** 空闲*/
this.spare();
this.spare(); // 空闲状态下 名称白色 其他条件为绿色
break;
case '02': /** 通信车占用*/
this.communicationOccupied();

View File

@ -26,57 +26,69 @@ export default class StationControl extends Group {
create() {
const model = this.model;
// 紧急站控
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.jjzkContent,
pop: false
});
if (this.style.StationControl.lamp.emergencyControlShow) {
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.jjzkContent,
pop: false
});
this.add(this.emergencyControl);
}
// 中控按钮
this.centerControl = new ESingleControl({
_subType: 'center',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zokContent,
pop: false
});
if (this.style.StationControl.lamp.centerControlShow) {
this.centerControl = new ESingleControl({
_subType: 'center',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zokContent,
pop: false
});
this.add(this.centerControl);
}
// 站控按钮
this.substationControl = new ESingleControl({
_subType: 'substation',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zakContent,
pop: false
});
if (this.style.StationControl.lamp.substationControlShow) {
this.substationControl = new ESingleControl({
_subType: 'substation',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zakContent,
pop: false
});
this.add(this.substationControl);
}
// 按图折返
this.turnedAroundControl = new ESingleControl({
_subType: 'turnedAround',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: '按图折返',
pop: false
});
if (this.style.StationControl.lamp.turnedAroundControlShow) {
this.turnedAroundControl = new ESingleControl({
_subType: 'turnedAround',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: '按图折返',
pop: false
});
this.add(this.turnedAroundControl);
}
// 箭头
if (this.style.StationControl.arrow.show) {
const point = arrow(this.model.position.x, this.model.position.y + this.style.StationControl.lamp.radiusR / 2, this.style.StationControl.lamp.distance / 6, this.style.StationControl.lamp.radiusR * 0.8);
@ -95,14 +107,6 @@ export default class StationControl extends Group {
});
this.add(this.arrowsControl);
}
this.add(this.substationControl);
this.add(this.centerControl);
if (this.style.StationControl.lamp.count == 3) {
this.add(this.emergencyControl);
} else if (this.style.StationControl.lamp.count == 4) {
this.add(this.emergencyControl);
this.add(this.turnedAroundControl);
}
}
// 设置状态

View File

@ -89,7 +89,7 @@ export default {
{ label: '综合演练', value: 'Joint'},
{ label: '大屏', value: 'BigScreen'},
{ label: '琏计划', value: 'RunPlan'},
{ label: '任务录制', value: 'ScriptRecord'}
{ label: '剧本录制', value: 'ScriptWrite'}
],
skinCode: [

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="font_box">
<el-select v-model="font" :placeholder="$t('global.font')" @input="$emit('input', inputValue)">
<el-option v-for="option in fontList" :key="option.code" :label="option.name" :value="option.code" />
</el-select>
@ -65,9 +65,20 @@ export default {
}
};
</script>
<style>
<style rel="stylesheet/scss" lang="scss" scoped>
.format {
background-color: #C0C4CC;
width: 100%;
display: flex;
padding-left: 15px;
}
.font_box{
/deep/ {
.el-select{
max-width: 50%;
display: block;
float: left;
}
}
}
</style>

View File

@ -80,18 +80,18 @@ export default {
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.routeID'),
prop: 'code'
},
// {
// title: this.$t('map.routeID'),
// prop: 'code'
// },
{
title: this.$t('map.pathName'),
prop: 'name'
},
{
title: this.$t('map.pathUnitMapName'),
prop: 'mapId'
},
// {
// title: this.$t('map.pathUnitMapName'),
// prop: 'mapId'
// },
{
title: this.$t('map.routeStationName'),
prop: 'stationCode'

View File

@ -37,6 +37,20 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.turnBackSectionCode')" prop="turnBackSectionCode">
<el-select v-model="addModel.turnBackSectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'turnBackSectionCode' ? 'danger' : 'primary'"
@click="hover('turnBackSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.automaticRouteTypeColon')" prop="autoType">
<el-select v-model="addModel.autoType" :filterable="true">
<el-option
@ -89,13 +103,6 @@
@click="hover('nearSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<!-- <el-form-item label="自动触发区段ID:" prop="autoTriggerSectionCode">
<el-select v-model="addModel.autoTriggerSectionCode" clearable :filterable="true">
<el-option v-for="item in sectionList" :key="item.code" :label="item.name + ' (' + item.code+ ')'"
:value="item.code"></el-option>
</el-select>
<el-button @click="hover('autoTriggerSectionCode')" :type=" field === 'autoTriggerSectionCode' ? 'danger' : 'primary'">{{ $t('map.activate') }}</el-button>
</el-form-item> -->
<el-form-item :label="$t('map.routeTriggerSectionList')" prop="routeTriggerSectionList">
<el-select v-model="addModel.routeTriggerSectionList" multiple clearable :filterable="true">
<el-option
@ -110,142 +117,6 @@
@click="hover('routeTriggerSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.routeOverlapSectionList')" prop="routeOverlapSectionList">
<el-select v-model="addModel.routeOverlapSectionList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSectionList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<!-- <el-form-item label="延续保护道岔ID:" prop="routeOverlapSwitchList">
<el-select v-model="addModel.routeOverlapSwitchList" multiple :filterable="true">
<el-option v-for="item in switchList" :key="item.code" :label="item.name + ' (' + item.code+ ')'"
:value="item.code"></el-option>
</el-select>
<el-button @click="hover('routeOverlapSwitchList')" :type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="延续保护道岔位置类型:" prop="overlapSwitchLocateType">
<el-select v-model="addModel.overlapSwitchLocateType" :filterable="true">
<el-option v-for="item in SwitchLocateTypeList" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select>
</el-form-item> -->
<el-form-item :label="$t('map.routeOverlapSwitchList')" prop="routeOverlapSwitchList">
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSwitchList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeOverlapSwitchList, {switchCode:overlapCode, switchLocateType:overlapType})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeOverlapSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeOverlapSwitchList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeFlankProtectionList' ? 'danger' : 'primary'"
@click="hover('routeFlankProtectionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeFlankProtectionList, {switchCode:flankCode, switchLocateType:flankType})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="flankType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeFlankProtectionList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column fixed="right" label="操作" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeFlankProtectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.turnBackSectionCode')" prop="turnBackSectionCode">
<el-select v-model="addModel.turnBackSectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'turnBackSectionCode' ? 'danger' : 'primary'"
@click="hover('turnBackSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="进路物理区段数据:" prop="routeSectionList">
<el-select v-model="addModel.routeSectionList" multiple :filterable="true" placeholder="请选择">
<el-option
@ -260,20 +131,6 @@
@click="hover('routeSectionList')"
>激活</el-button>
</el-form-item>
<el-form-item label="进路屏蔽门数据:" prop="routeStandList">
<el-select v-model="addModel.routeStandList" multiple :filterable="true" placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeStandList' ? 'danger' : 'primary'"
@click="hover('routeStandList')"
>激活</el-button>
</el-form-item>
<el-form-item label="进路道岔数据:" prop="routeSwitchList">
<el-select v-model="routeCode" clearable :filterable="true" placeholder="请选择道岔数据">
<el-option
@ -289,7 +146,7 @@
>激活</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeSwitchList, { switchCode: routeCode, switchLocateType: routeType } )"
@click="pushSwitch(addModel.routeSwitchList, { switchCode: routeCode, switchLocateType: routeType, switchType: overlapType == '01' ? '定位' : '反位' } )"
>添加</el-button>
<el-select v-model="routeType" :filterable="true" placeholder="请选择道岔类型">
<el-option
@ -300,12 +157,12 @@
/>
</el-select>
<el-table :data="addModel.routeSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" label="道岔ID">
<el-table-column prop="switchCode" label="道岔">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column prop="switchType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
@ -319,6 +176,126 @@
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="进路屏蔽门数据:" prop="routeStandList">
<el-select v-model="addModel.routeStandList" multiple :filterable="true" placeholder="请选择">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeStandList' ? 'danger' : 'primary'"
@click="hover('routeStandList')"
>激活</el-button>
</el-form-item>
<el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeFlankProtectionList' ? 'danger' : 'primary'"
@click="hover('routeFlankProtectionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeFlankProtectionList, {switchCode:flankCode, switchLocateType:flankType, switchType: overlapType == '01' ? '定位' : '反位'})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="flankType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeFlankProtectionList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchType" :label="$t('map.switchType')" />
<el-table-column fixed="right" label="操作" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeFlankProtectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.routeOverlapSectionList')" prop="routeOverlapSectionList">
<el-select v-model="addModel.routeOverlapSectionList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSectionList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.routeOverlapSwitchList')" prop="routeOverlapSwitchList">
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSwitchList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeOverlapSwitchList, {switchCode:overlapCode, switchLocateType:overlapType, switchType: overlapType == '01' ? '定位' : '反位'})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeOverlapSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeOverlapSwitchList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}

View File

@ -111,7 +111,7 @@ export default {
]),
dataForm() {
const form = {
labelWidth: '150px',
labelWidth: '130px',
items: {
code: {
name: '',
@ -126,7 +126,7 @@ export default {
{ prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
{ prop: 'zIndex', label: this.$t('map.imageZindex'), type: 'number', min: 0 },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: 0 },
{ prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '140px', children: [
{ prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }
@ -206,8 +206,6 @@ export default {
y: selected.position.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -194,7 +194,11 @@ export default {
} else if (label == 'label') {
return option.label;
} else if (label == 'name&&code') {
return option.name + ' (' + option.code+ ')';
if (option.code) {
return option.name + ' (' + option.code+ ')';
} else {
return option.name;
}
} else if (label == 'code&&name') {
return option.code + ' (' + option.name+ ')';
} else {

View File

@ -209,7 +209,11 @@ export default {
} else if (label == 'label') {
return option.label;
} else if (label == 'name&&code') {
return option.name + ' (' + option.code+ ')';
if (option.code) {
return option.name + ' (' + option.code+ ')';
} else {
return option.name;
}
} else if (label == 'code&&name') {
return option.code + ' (' + option.name+ ')';
} else {

View File

@ -150,8 +150,10 @@ export default {
{ prop: 'name', label: this.$t('map.counterName'), type: 'input' },
{ prop: 'type', label: this.$t('map.counterType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.typeList },
{ prop: 'max', label: this.$t('map.countMax'), type: 'number', min: 0, placeholder: '个' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'position', label: this.$t('map.counterPosition'), type: 'coordinate', width: '110px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -200,8 +202,6 @@ export default {
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -132,8 +132,10 @@ export default {
{ prop: 'unlockTime', label: this.$t('map.delayTime'), type: 'number', min: 0, max: 1000, placeholder: 's' },
{ prop: 'fontFamily', label: this.$t('map.font'), type: 'font' },
{ prop: 'textFontColor', label: this.$t('map.color'), type: 'color' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'position', label: this.$t('map.delayUnlockPosition'), type: 'coordinate', width: '110px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -182,8 +184,6 @@ export default {
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
this.$refs.form.clearValidate();

View File

@ -185,8 +185,6 @@ export default {
y: selected.position.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -176,8 +176,6 @@ export default {
y: selected.position.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -208,8 +208,6 @@ export default {
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationName = selected.name;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
addPoint(index) {

View File

@ -170,20 +170,19 @@ export default {
item: [
{ prop: 'code', label: this.$t('map.linkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.linkName'), type: 'input' },
{ prop: 'lengthShow', label: this.$t('map.linkDisplayLength'), type: 'number', min: 50, placeholder: 'px' },
{ prop: 'color', label: this.$t('map.linkColor'), type: 'color' },
{ prop: 'leftFdCode', label: this.$t('map.linkLeftFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'leftSdCode', label: this.$t('map.linkLeftSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'rightFdCode', label: this.$t('map.linkRightFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'rightSdCode', label: this.$t('map.linkRightSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'lp', label: this.$t('map.linkLp'), type: 'coordinate', width: '160px', children: [
{ prop: 'lp', label: this.$t('map.linkLp'), type: 'coordinate', width: '119px', children: [
{ prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: false },
{ prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: false }
] },
{ prop: 'rp', label: this.$t('map.linkRp'), type: 'coordinate', width: '160px', children: [
{ prop: 'rp', label: this.$t('map.linkRp'), type: 'coordinate', width: '119px', children: [
{ prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: false },
{ prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: false }
] }
] },
{ prop: 'color', label: this.$t('map.linkColor'), type: 'color' },
{ prop: 'leftFdCode', label: this.$t('map.linkLeftFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
{ prop: 'leftSdCode', label: this.$t('map.linkLeftSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
{ prop: 'rightFdCode', label: this.$t('map.linkRightFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
{ prop: 'rightSdCode', label: this.$t('map.linkRightSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists }
]
},
map: {
@ -279,6 +278,10 @@ export default {
this.activeName = 'first';
this.$refs.dataform.clearValidate();
});
},
linkList(value) {
this.linkLists = JSON.parse(JSON.stringify(this.linkList));
this.linkLists.unshift({code: '', name: '无'});
}
},
mounted() {
@ -301,10 +304,10 @@ export default {
this.editModel.lengthShow = Math.sqrt(Math.pow(selected.rp.x - selected.lp.x, 2) + Math.pow(selected.rp.y - selected.lp.y, 2));
this.editModel.lengthFact = selected.lengthFact;
this.editModel.color = selected.color;
this.editModel.leftFdCode = selected.leftFdCode;
this.editModel.leftSdCode = selected.leftSdCode;
this.editModel.rightFdCode = selected.rightFdCode;
this.editModel.rightSdCode = selected.rightSdCode;
this.editModel.leftFdCode = selected.leftFdCode || '';
this.editModel.leftSdCode = selected.leftSdCode || '';
this.editModel.rightFdCode = selected.rightFdCode || '';
this.editModel.rightSdCode = selected.rightSdCode || '';
this.editModel.lp = {
x: selected.lp.x,
y: selected.lp.y
@ -314,8 +317,6 @@ export default {
y: selected.rp.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
});
},

View File

@ -136,30 +136,6 @@
</el-form>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.rulesChange')" name="six">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="fiveRule" :model="editRuleModel" label-width="120px" size="mini" :rules="editRule">
<el-form-item :label="$t('map.pointY')" prop="pointY">
<el-input-number v-model="editRuleModel.pointY" />
</el-form-item>
<el-form-item :label="$t('map.trainDirection')" prop="trainType">
<el-select v-model="editRuleModel.trainType" filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="option in TrainPositionTypeList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="editSectionTrain">{{ $t('map.updateObj') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -235,13 +211,14 @@ export default {
offsetLeft: 0,
sepTypeRight: '',
offsetRight: 0,
trainPosType: '',
trainPosType: '01',
// pointY: '',
parentCode: '',
points: [],
isCurve: false
},
editRuleModel: {
trainType: '01',
// trainType: '01',
pointY: 0
},
tableData: [],
@ -304,15 +281,13 @@ export default {
item: [
{ prop: 'code', label: this.$t('map.blockCoding'), type: 'select', mode: false, optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.sectionNameColon'), type: 'input' },
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'code&&name', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
{ prop: 'namePoint', label: this.$t('map.sectionNameOffset'), type: 'coordinate', width: '150px', children: [
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'nameShow', label: this.$t('map.displayExtentName'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'axleShow', label: this.$t('map.displayAxleCounter'), type: 'checkbox', disabled: this.isStationAxleShow, isHidden: !this.isSectionType},
{ prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'logicSectionNameShow', label: this.$t('map.displayLogicalWxtentNames'), type: 'checkbox', disabled: this.islogicSectionNameShow, isHidden: !this.isSectionType },
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList, disabled: true },
{ prop: 'linkCode', label: this.$t('map.relevanceLinkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, disabled: true, isHidden: !this.isSectionType },
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow },
{ prop: 'standTrackNamePosition', label: this.$t('map.standTrackNamePosition'), type: 'coordinate', width: '150px', isHidden: !this.isstandTrackNameShow, children: [
@ -342,11 +317,12 @@ export default {
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode },
{ prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSectionType },
{ prop: 'logicSectionNameShow', label: this.$t('map.displayLogicalWxtentNames'), type: 'checkbox', disabled: this.islogicSectionNameShow, isHidden: !this.isSectionType },
{ prop: 'logicSectionNameSort', label: this.$t('map.logicSectionNameSort'), type: 'radio', isHidden: !this.isLogicSectionNameSort, radioList: [
{value: true, label: this.$t('map.fromSmallToLarge')},
{value: false, label: this.$t('map.fromLargeToSmall')}
] },
{ prop: 'linkCode', label: this.$t('map.relevanceLinkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, disabled: true, isHidden: !this.isSectionType },
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
{ prop: 'isSegmentation', label: this.$t('map.isSegmentation'), type: 'checkbox', isHidden: !this.isSectionType },
@ -364,10 +340,9 @@ export default {
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
{ prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
{ prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList },
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0 },
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 },
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList },
{ prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType }
]
}
@ -424,6 +399,9 @@ export default {
],
sepTypeRight: [
{ required: true, message: this.$t('rules.sectionSepTypeRight'), trigger: 'change' }
],
relSwitchCode: [
{ required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' }
]
};
return rules;
@ -460,6 +438,7 @@ export default {
//
isParentCode() {
// true false
return this.editModel.type == '02' || this.editModel.relSwitchCode;
},
isStationCodeDisabled() {
@ -510,6 +489,12 @@ export default {
},
pointDisabledName() {
return this.editModel.type == '02';
},
sectionColonShow() {
if (this.$store.state.map.map) {
return this.$store.state.map.map.skinVO.code == '03';
}
return false;
}
},
watch: {
@ -639,7 +624,7 @@ export default {
this.computedLogicSectionNumList(this.editModel.logicSectionNum);
// Section
this.activeName = 'three';
// this.activeName = 'three';
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
this.addModel.code = selected.code;
} else if (this.field.toUpperCase() === 'leftSection'.toUpperCase()) {
@ -650,7 +635,7 @@ export default {
this.activeName = 'first';
}
} else {
this.activeName = 'second';
// this.activeName = 'second';
this.tableData = [];
}
}
@ -766,16 +751,6 @@ export default {
this.$emit('addOrUpdateMapModel', models);
this.$emit('delMapModel', remove);
},
editSectionTrain() {
const data = [];
this.sectionList.forEach(ele => {
if (ele.points[0].y == this.editRuleModel.pointY && ele.points[ele.points.length - 1].y == this.editRuleModel.pointY) {
ele.trainPosType = this.editRuleModel.trainType;
data.push(ele);
}
});
this.$emit('addOrUpdateMapModel', data);
},
addPoint(index) {
const data = { x: 0, y: 0 };
this.editModel.points.splice(index + 1, 0, data);
@ -977,6 +952,10 @@ export default {
section.trainPosType = model.trainPosType;
edits.push(section);
}
// if (section.points[0].y == this.editModel.pointY && section.points[section.points.length - 1].y == this.editModel.pointY) {
// section.trainPosType = this.editModel.trainPosType;
// edits.push(section);
// }
});
edits.push(model);
this.fieldS = '';

View File

@ -219,22 +219,30 @@ export default {
item: [
{ prop: 'code', label: this.$t('map.signalCodeColon'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.signalNameColon'), type: 'input' },
{ prop: 'nameShow', label: this.$t('map.signalDisplayName'), type: 'checkbox' },
{ prop: 'position', label: this.$t('map.signalPosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
// { prop: 'nameShow', label: this.$t('map.signalDisplayName'), type: 'checkbox' },
{ prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList },
{ prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
{ prop: 'directionType', label: this.$t('map.signalDirectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList },
{ prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPositionTypeList },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.signalPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.signalPositionY'), type: 'number', placeholder: 'px' },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -90, max: 90, placeholder: this.$t('tip.angle') },
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: this.$t('map.signalNamePositionX'), type: 'number', placeholder: 'px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'x', label: this.$t('map.signalNamePositionY'), type: 'number', placeholder: 'px' },
{ prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'buttonShow', label: this.$t('map.signalButtonShow'), type: 'checkbox' },
{ prop: 'buttonPosition.x', firstLevel: 'buttonPosition', secondLevel: 'x', label: this.$t('map.signalButtonPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'buttonPosition.y', firstLevel: 'buttonPosition', secondLevel: 'x', label: this.$t('map.signalButtonPositionY'), type: 'number', placeholder: 'px' },
{ prop: 'buttonPosition', label: this.$t('map.signalButtonPosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'buttonPosition.x', firstLevel: 'buttonPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'buttonPosition.y', firstLevel: 'buttonPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'guideShow', label: this.$t('map.signalGuideShow'), type: 'checkbox' },
{ prop: 'guidePosition.x', firstLevel: 'guidePosition', secondLevel: 'x', label: this.$t('map.signalGuidePositionX'), type: 'number', placeholder: 'px' },
{ prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'x', label: this.$t('map.signalGuidePositionY'), type: 'number', placeholder: 'px' }
{ prop: 'guidePosition', label: this.$t('map.signalGuidePosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'guidePosition.x', firstLevel: 'guidePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -244,7 +252,7 @@ export default {
{ prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' },
{ prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList },
{ prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList },
{ prop: 'linkCode', label: 'LinkCode:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'linkCode', label: this.$t('map.signalLinkCode')+':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
{ prop: 'offset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }
]
@ -267,9 +275,6 @@ export default {
offset: [
{ required: true, message: this.$t('rules.pleaseEnterSignalOffset'), trigger: 'blur' }
],
stationCode: [
{ required: true, message: this.$t('rules.pleaseEnterSignalStation'), trigger: 'change' }
],
'position.x': [
{ required: true, message: this.$t('rules.pleaseEnterSignalPositionX'), trigger: 'blur' }
],
@ -395,8 +400,6 @@ export default {
this.addModel.sectionCode = selected.code;
}
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
hover(field) {

View File

@ -103,7 +103,7 @@ export default {
]),
form() {
const form = {
labelWidth: '150px',
labelWidth: '130px',
items: {
code: {
name: '',
@ -114,16 +114,18 @@ export default {
item: [
{ prop: 'code', label: this.$t('map.stationCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.stationName'), type: 'input' },
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'position', label: this.$t('map.stationPosition'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
// { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'nameFont', label: this.$t('map.stationNameFont'), type: 'font', placeholder: this.$t('tip.stationFont') },
{ prop: 'nameFontColor', label: this.$t('map.stationNameFontColor'), type: 'color' },
{ prop: 'kmPostShow', label: this.$t('map.stationKmPostShow'), type: 'checkbox' },
// { prop: 'kmPostShow', label: this.$t('map.stationKmPostShow'), type: 'checkbox' },
{ prop: 'kmRange', label: this.$t('map.stationKmRange'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
{ prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' },
{ prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') },
{ prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.stationPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.stationPositionY'), type: 'number', placeholder: 'px' }
{ prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' }
]
},
map: {
@ -227,8 +229,6 @@ export default {
this.addModel.sectionCode = selected.code;
}
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -109,8 +109,10 @@ export default {
{ prop: 'zakContent', label: this.$t('map.zakContent'), type: 'input' },
{ prop: 'jjzkContent', label: this.$t('map.jjzkContent'), type: 'input' },
{ prop: 'zzkContent', label: this.$t('map.zzkContent'), type: 'input' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'position', label: this.$t('map.stationControlPosition'), type: 'coordinate', width: '150px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -200,8 +202,6 @@ export default {
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -134,16 +134,18 @@ export default {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: this.$t('map.relStandCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input', disabled: true },
{ prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input' },
{ prop: 'position', label: this.$t('map.stationstandPosition'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList },
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'nameShow', label: this.$t('map.stationstandShowName'), type: 'checkbox' },
// { prop: 'nameShow', label: this.$t('map.stationstandShowName'), type: 'checkbox' },
{ prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList },
{ prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox' },
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }
]
},
map: {
@ -261,8 +263,6 @@ export default {
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -110,12 +110,15 @@ export default {
item: [
{ prop: 'code', label: this.$t('map.switchCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.switchName'), type: 'input' },
{ prop: 'nameShow', label: this.$t('map.switchShowName'), type: 'checkbox' },
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: this.$t('map.switchPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: this.$t('map.switchPositionY'), type: 'number', placeholder: 'px' },
// { prop: 'timeoutShow', label: this.$t('map.timeoutShow'), type: 'checkbox' },
{ prop: 'tp.x', firstLevel: 'tp', secondLevel: 'x', label: this.$t('map.switchTpX'), type: 'number', placeholder: 'px' },
{ prop: 'tp.y', firstLevel: 'tp', secondLevel: 'y', label: this.$t('map.switchTpY'), type: 'number', placeholder: 'px' }
// { prop: 'nameShow', label: this.$t('map.switchShowName'), type: 'checkbox' },
{ prop: 'namePoint', label: this.$t('map.switchPosition'), type: 'coordinate', width: '160px', children: [
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'tp', label: this.$t('map.switchTp'), type: 'coordinate', width: '160px', children: [
{ prop: 'tp.x', firstLevel: 'tp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'tp.y', firstLevel: 'tp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -146,9 +149,6 @@ export default {
'namePoint.y': [
{ required: true, message: this.$t('rules.switchNamePointY'), trigger: 'blur' }
],
stationCode: [
{ required: true, message: this.$t('rules.switchStationCode'), trigger: 'change' }
],
turnTime: [
{ required: true, message: this.$t('rules.switchTurnTime'), trigger: 'blur' }
],

View File

@ -23,12 +23,25 @@
</el-select>
</el-input>
</el-form-item>
<el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="addModel.position.x" />px
</el-form-item>
<el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="addModel.position.y" />px
</el-form-item>
<div class="coordinate">
<span class="title" style="width: 110px">{{ $t('map.textPoints') }}</span>
<el-form-item
label="x:"
prop="position.x"
style="display: table; float: left; margin-right: 20px;"
label-width="25px"
>
<el-input-number v-model="addModel.position.x" label="x:" />
</el-form-item>
<el-form-item
label="y:"
prop="position.y"
style="display: table; float: left;"
label-width="25px"
>
<el-input-number v-model="addModel.position.y" label="y:" />
</el-form-item>
</div>
</el-form>
</el-scrollbar>
<div class="button_box">
@ -137,8 +150,10 @@ export default {
{ prop: 'content', label: this.$t('map.textContent'), type: 'fontContent', content: 'content', prepend: 'prepend', placeholder: this.$t('map.pleaseSelect') },
{ prop: 'font', label: this.$t('map.textFont'), type: 'font', placeholder: this.$t('map.font') },
{ prop: 'fontColor', label: this.$t('map.textFontColor'), type: 'color' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }
]
},
map: {
@ -182,8 +197,6 @@ export default {
this.activeName = 'first';
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {
@ -253,6 +266,25 @@ export default {
background: #f0f0f0;
overflow: hidden;
}
.coordinate {
overflow: hidden;
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
width: 120px;
font-weight: bold;
display: block;
float: left;
margin-right: 7px;
}
}
/deep/ {
.el-select .el-input {
width: 130px;

View File

@ -64,7 +64,8 @@ export default {
},
groupNumber: '',
modelCode: ''
}
},
errorTip: this.$t('tip.selectValidInterval')
};
},
computed: {
@ -79,7 +80,7 @@ export default {
range.end >= range.beg) {
callback();
} else {
callback(new Error(this.$t('tip.selectValidInterval')));
callback(new Error(this.errorTip));
}
},
trigger: 'blur'

View File

@ -87,7 +87,7 @@ export default {
this.deviceSelect(val);
},
$route() {
this.activeName = 'first';
// this.activeName = 'first';
}
},
methods: {
@ -100,9 +100,9 @@ export default {
this.editModel.code = selected.code;
this.editModel.modelCode = selected.modelCode;
this.editModel.groupNumber = selected.groupNumber;
this.activeName = 'first';
// this.activeName = 'first';
} else {
this.activeName = 'second';
// this.activeName = 'second';
}
},
create(list) {

View File

@ -142,8 +142,10 @@ export default {
{ prop: 'code', label: this.$t('map.trainWindowCode'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.trainWindowList, change: true, deviceChange: this.deviceChange },
{ prop: 'width', label: this.$t('map.trainWindowWidth'), type: 'number', min: 0, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.trainWindowHeight'), type: 'number', min: 0, placeholder: 'px' },
{ prop: 'point.x', firstLevel: 'point', secondLevel: 'x', label: this.$t('map.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'point.y', firstLevel: 'point', secondLevel: 'y', label: this.$t('map.pointY'), type: 'number', placeholder: 'px' }
{ prop: 'point', label: this.$t('map.trainWindowPoints'), type: 'coordinate', width: '110px', children: [
{ prop: 'point.x', firstLevel: 'point', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: false },
{ prop: 'point.y', firstLevel: 'point', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: false }
] }
]
},
map: {
@ -191,8 +193,6 @@ export default {
y: selected.point.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
createModel(opts) {

View File

@ -184,8 +184,6 @@ export default {
y: selected.position.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
create() {

View File

@ -11,9 +11,6 @@
size="mini"
@submit.native.prevent
>
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
<el-form-item :label="$t('map.skinName')" prop="skinCode">
<el-select v-model="editModel.skinCode" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option
@ -24,11 +21,14 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.selectCity')" prop="cityCode">
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
<!-- <el-form-item :label="$t('map.selectCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
</el-form-item> -->
</el-form>
</template>
<template v-else>
@ -49,7 +49,6 @@
</el-form-item>
<el-form-item :label="$t('map.scalingColon')" prop="scaling">
<el-input-number v-model="updtModel.scaling" :precision="1" :step="0.2" disabled />
<!-- <el-input v-model="updtModel.scaling" :label="$t('map.scaling')" /> -->
</el-form-item>
</el-form>
</template>
@ -95,7 +94,7 @@ export default {
editModel: {
id: '',
name: '',
skinCode: '',
skinCode: '01',
cityCode: ''
},
updtModel: {

View File

@ -44,7 +44,7 @@ export default {
editModel: {
id: '',
name: '',
cityCode: ''
cityCode: '000000'
}
};
},

View File

@ -79,8 +79,6 @@ export default {
},
mapSelectChange(id){
this.loading = true;
// debugger;
// this.$store
localStore.set("script_mapId", id);
this.$store.dispatch('scriptRecord/updateScriptId',id);
this.getQuestPageList(id);

View File

@ -1,24 +1,37 @@
<template>
<div class="reminder-drag">
<div class="reminder-box" ref="drapBox" :style="{height:'100%'}">
<div class="actionPane">
<get-action ref="getAction" :group="group"></get-action>
</div>
<el-button-group class="button-group">
<el-button type="primary" @click="pauseScript" v-if="isPause" :disabled="executeDisabled">暂停</el-button>
<el-button type="primary" @click="executePlayScript" v-else :disabled="executeDisabled">恢复并执行</el-button>
<!-- <el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button> -->
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
<el-button type="primary" @click="saveScenesStage" :disabled="backDisabled">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button>
<!-- 暂停 -->
</el-button-group>
<el-container class="actionPane">
<el-header style="height:50px;">
<el-row class="actionList">
<span class="titleStyle">剧本编制</span>
</el-row>
</el-header>
<el-main style="padding-top:10px;padding-bottom:10px;">
<add-role :group="group" ref="addRole" @refresh="refresh"></add-role>
<add-action ref="addAction" :group="group" :size="size" @create="create" @setDisabled="setDisabled"></add-action>
<get-action ref="getAction" :group="group" :size="size" @setAction="setAction"></get-action>
</el-main>
<el-footer>
<el-button-group class="button-group">
<el-button type="primary" @click="pauseScript" v-if="isPause" :disabled="executeDisabled">暂停</el-button>
<el-button type="primary" @click="executePlayScript" v-else :disabled="executeDisabled">恢复并执行</el-button>
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
<el-button type="primary" @click="saveScenesStage" :disabled="backDisabled">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button>
<!-- 暂停 -->
</el-button-group>
</el-footer>
</el-container>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import AddAction from '../scriptRecord/addAction';
import GetAction from '../scriptRecord/getAction';
import AddRole from '../scriptRecord/addRole';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scriptPause, executeScript} from '@/api/simulation';
export default {
@ -31,7 +44,10 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
},
components: {
GetAction,
AddRole,
AddAction
},
mixins: [WindowResizeHandler],
// this.$t('scriptRecord.scriptTitle')
data() {
return {
@ -40,9 +56,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
mapLocation:{},
autoSaveScript: null,
isSavingScript:false,
isPause:false,
isPause:true,
executeDisabled:false,
backDisabled:false,
size:{
width:350,
height:window.innerHeight-130-212,
}
// isSaveStage: true,
}
},
@ -56,26 +76,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
mounted(){
this.initAutoSaveScript();
this.backDisabled=this.$store.state.scriptRecord.bgSet;
// this.shrink();
},
beforeDestroy() {
this.clearAutoSave();
},
methods: {
jump(obj) {
},
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
resizeHandler() {
this.size = { width:350, height:window.innerHeight-130-212};
},
setIsParse(isPause){
this.isPause=isPause;
@ -114,7 +121,6 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
});
},
saveScenesStage() {
let data=Vue.prototype.$jlmap.$options;
let group=this.$route.query.group;
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
@ -161,8 +167,8 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
// this.isSaveStage = true;
this.$parent.$refs['display'].$refs['menuScript'].resetBeginTime();
this.$refs["getAction"].loadInitData();
this.$refs["getAction"].$refs["addRole"].initData();
this.$refs["getAction"].$refs["addBehavior"].initData();
this.$refs["addRole"].initData();
this.$refs["addAction"].initData();
this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateBgSet',false);
this.$message.success('重置数据成功');
@ -173,25 +179,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
this.initAutoSaveScript();
})
},
refresh(){
this.$refs['addAction'].initData();
},
create(){
this.$refs['getAction'].loadInitData();
},
setAction(row){
debugger;
this.$refs['addAction'].doShow(row);
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
// .tip-body-box {
// position: relative;
// height:100%;
// }
.tab-pane-big{
height:420px;
// width:100%;
// height:100%;
}
.breadColor{
color:#fff;
}
.reminder-box {
position: absolute;
float: left;
@ -206,31 +209,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
.actionPane{
height: 100%;
padding-bottom: 80px;
}
.list-label {
width: 105px;
}
.button-group{
position: absolute;
bottom: 30px;
right: 20px;
}
.actionInfo{
margin-top:30px;
}
.conditionVO{
width:400px;
margin-bottom: 20px;
float: right;
}
.actionList{
margin-top: 10px;
margin-left: 5px;
font-size: 15px;
margin-bottom:10px;
padding-top: 5px;
border-bottom: 1px #ccc solid;
height: 35px;
}
.titleStyle{
margin-left:10px;
margin-left:5px;
}
.icon {

View File

@ -1,8 +1,5 @@
<template>
<div>
<!-- <el-card class="scriptTop">
<add-role :group="group" ref="addRole"></add-role>
</el-card> -->
<el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper">
<el-card class="conversitionCard">
<div class="addConversition">添加对话</div>
<el-form size="mini" :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right">
@ -67,7 +64,7 @@
</el-form-item>
</el-form>
</el-card>
</div>
</el-scrollbar>
</template>
<script>
import Vue from 'vue';
@ -82,22 +79,12 @@
type: String,
required: true
},
buttonName:{
type:String,
required: true
},
operateType:{
type:String,
size:{
type: Object,
required: true
}
},
watch:{
'$store.state.socket.simulationStart': function (val) {
if(val)
{
this.$parent.$parent.$refs['addRole'].initData();
}
},
'$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
this.isPause=!(this.$store.state.scriptRecord.simulationPause);
@ -117,13 +104,14 @@
},
data() {
return {
buttonName:"添加对话",
operateType:"add",
modalData:{
actionVO:{
memberId:"",
targetId:"",
reply:"",
type:"Conversation",
}
},
commandData:{
@ -235,8 +223,8 @@
addScriptAction(group,data).then(response=>{
this.adding=false;
this.$message.success('添加指令成功');
this.$emit('create',true);
this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
// this.initCommandActionData();
}).catch(error => {
this.adding=false;
@ -257,14 +245,14 @@
let data=this.modalData.actionVO;
let obj=this;
this.modifying=true;
if(this.$props.operateType=="add")
if(this.operateType=="add")
{
addScriptAction(group,data).then(response=>{
this.modifying=false;
this.$message.success('添加对话成功');
this.$emit('create',true);
this.$emit('create');
// this.initActionData();
this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]);
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]);
}).catch(error => {
this.modifying=false;
this.$messageBox(`添加对话失败: ${error.message}`);
@ -276,10 +264,11 @@
modifyScriptAction(group,actionId,data).then(response=>{
this.modifying=false;
this.isNotModify=true;
this.$parent.$parent.$parent.setDisabled(this.isNotModify);
this.$emit('modifyButtonName');
this.$emit("setDisabled",this.isNotModify);
this.buttonName="添加对话";
this.operateType="add";
this.$message.success('修改对话成功');
this.$emit('create',false);
this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData();
}).catch(error => {
@ -316,6 +305,7 @@
initCommandActionData(){
if(this.$refs['commandData'])
{
this.deviceCommandList=[];
this.$refs['commandData'].resetFields();
this.commandData.action.memberId="";
this.commandData.param.startStation="";
@ -350,33 +340,21 @@
doShow(data){
if(data)
{
this.clearValidate();
this.isNotModify=false;
this.$parent.$parent.$parent.setDisabled(this.isNotModify);
// this.initData();
this.modalData.actionVO.id=data.id;
this.modalData.actionVO.memberId=data.memberId;
this.modalData.actionVO.type=data.type;
if(data.type=="Conversation")
{
this.isJinLu=false;
this.modalData.actionVO.targetId=data.targetId;
this.modalData.actionVO.reply=data.reply;
}
// else if(data.type=="Command")
// {
// this.isJinLu=false;
// this.isConversitionAdd=false;
// // this.isCommandAdd=true;
// this.modalData.actionVO.reply="";
// this.modalData.actionVO.deviceCommand=data.deviceCommand;
// if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
// {
// this.isJinLu=true;
// this.modalData.param.startStation=data.commandParamList[0];
// this.modalData.param.endStation=data.commandParamList[1];
// }
// }
this.buttonName="修改对话";
this.operateType="modify";
this.clearValidate();
this.isNotModify=false;
this.$emit("setDisabled",this.isNotModify);
// this.initData();
this.modalData.actionVO.id=data.id;
this.modalData.actionVO.memberId=data.memberId;
this.modalData.actionVO.type=data.type;
if(data.type=="Conversation")
{
this.isJinLu=false;
this.modalData.actionVO.targetId=data.targetId;
this.modalData.actionVO.reply=data.reply;
}
}
}
}
@ -409,7 +387,6 @@
width:200px;
}
.conversitionCard{
margin-left: 20px;
padding-bottom: 20px;
margin-top: 10px;
}
@ -418,7 +395,6 @@
padding: 20px 10px;
}
.commandCard{
margin-left: 20px;
padding-bottom: 20px;
margin-top: 10px;
}
@ -452,9 +428,9 @@
border-right: 1px #c0c4cc solid;
height: 15px;
}
.scriptTop{
margin-left: 20px;
padding: 15px 0px 30px 0px;
width: 360px;
.addScript{
margin-top:20px;
float:left;
}
</style>

View File

@ -1,6 +1,5 @@
<template>
<div>
<!-- <div class="selectRole">选择角色</div> -->
<el-card class="scriptTop">
<el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="['所有角色', '演员角色']" @change="handleChange">
<span slot-scope="{option}">
<span>{{option.role+(option.name==undefined?'':option.name)}}</span>
@ -10,7 +9,7 @@
</el-radio-group>
</span>
</el-transfer>
</div>
</el-card>
</template>
<script>
import Vue from 'vue';
@ -34,6 +33,14 @@
mounted(){
this.initData();
},
watch:{
'$store.state.socket.simulationStart': function (val) {
if(val)
{
this.initData();
}
},
},
methods:{
initData(){
let group=this.$props.group;
@ -66,7 +73,7 @@
let data=movedKeys;
selectScriptMembers(group,data).then(response=>{
this.$message.success('选择剧本角色成功');
this.$parent.$parent.$refs['addBehavior'].initData();
this.$emit("refresh");
})
.catch(error => {
this.$messageBox(`选择剧本角色失败: ${error.message}`);
@ -78,7 +85,7 @@
let group=this.$props.group;
let data=movedKeys;
cancleScriptMembers(group,data).then(response=>{
this.$parent.$parent.$refs['addBehavior'].initData();
this.$emit("refresh");
this.$message.success('取消剧本角色成功');
})
.catch(error => {
@ -116,14 +123,14 @@
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.selectRole{
font-size: 15px;
padding: 0px 20px 15px 15px;
}
.elTransfer{
margin-left:20px;
width:700px;
}
.scriptTop{
padding: 10px 10px;
width: 730px;
}
/deep/ {
.script-player-choose .el-transfer-panel__body{
height: 120px;
@ -132,14 +139,17 @@
height: 120px;
}
.script-player-choose .el-transfer-panel{
width: 300px;
width: 310px;
}
.el-transfer-panel__item{
margin-right:0px;
}
.el-transfer__buttons{
padding: 0 20px;
}
}
</style>
<style>
.elTransfer .el-transfer-panel{
width:300px ;
}
.sexGroup{
margin-left: 10px;
}

View File

@ -1,64 +1,36 @@
<template>
<div class="actionPaneInner">
<div class="actionList">
<span class="titleStyle">剧本编制</span>
</div>
<div class="tab-pane-big">
<el-card class="scriptTop">
<add-role :group="group" ref="addRole"></add-role>
</el-card>
<div class="scriptPane">
<!-- <el-card class="scriptTop">
<template>
<div class="selectRole">选择角色</div>
<el-transfer v-model="selectRoleData" :data="allRoleData" class="elTransfer" :titles="['待选成员角色', '已选成员角色']"></el-transfer>
</template>
</el-card> -->
<div class="scriptBottom">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar" class="elScrollbar">
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName" class="addScript"></add-action>
</el-scrollbar>
<div class="block actionListTable">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<el-timeline :reverse="reverse" class="el_timeline">
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
<el-card>
<div class="actionTable">
<span class="detail" v-html="actionInfo.detail">
</span>
<span class="otherInfo" v-html="actionInfo.otherInfo"></span>
<span v-if="actionInfo.isCoversition">
<span class="roleClass">{{actionInfo.memberName}}</span>
<span></span>
<span class="roleClass">{{actionInfo.targetName}}</span>
<span>: </span>
<span>{{actionInfo.reply}}</span>
</span>
<span v-else>
<span class="roleClass">{{actionInfo.memberName}}</span>
<span>执行指令: </span>
<span class="commandStyle">{{actionInfo.command}}</span>
</span>
</div>
<div class="btnGroup">
<el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">修改</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar" class="scriptBottom" :style="{width:370+'px',height:size.height+'px'}">
<el-timeline :reverse="reverse" class="el_timeline">
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
<el-card>
<div class="actionTable">
<span class="detail" v-html="actionInfo.detail">
</span>
<span class="otherInfo" v-html="actionInfo.otherInfo"></span>
<span v-if="actionInfo.isCoversition">
<span class="roleClass">{{actionInfo.memberName}}</span>
<span></span>
<span class="roleClass">{{actionInfo.targetName}}</span>
<span>: </span>
<span>{{actionInfo.reply}}</span>
</span>
<span v-else>
<span class="roleClass">{{actionInfo.memberName}}</span>
<span>执行指令: </span>
<span class="commandStyle">{{actionInfo.command}}</span>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="btnGroup">
<el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">修改</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</template>
<script>
import Vue from 'vue';
import AddAction from './addAction';
import AddRole from './addRole';
import {getScriptRecord,deleteScriptAction,getAvailableDeviceCommand,getScriptPlayMember,getScriptMemberData} from '@/api/simulation';
import ConstConfig from '@/scripts/ConstConfig';
export default {
@ -68,24 +40,21 @@
type: String,
required: true
},
size:{
type: Object,
required: true
}
},
data() {
return {
// actionList:[],
actionInfoList:[],
deviceCommandList:[],
reverse:true,
loading:true,
behaviorName:"",
// behaviorName:"",
memberName:"",
operateType:"add",
buttonName:"添加对话",
}
},
components: {
AddAction,
AddRole
},
mounted(){
this.loadInitData();
},
@ -174,57 +143,17 @@
reloadTable(){
this.loadInitData();
},
create(data){
this.reloadTable();
},
// create(data){
// this.reloadTable();
// },
modifyAction(row){
this.operateType="modify";
this.buttonName="修改对话"
this.$refs.addBehavior.doShow(row);
},
modifyButtonName(){
this.buttonName="添加对话",
this.operateType="add"
this.$emit("setAction",row);
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.actionPaneInner{
height:100%;
padding-top:45px;
}
.addScript{
float:left;
width:380px;
display: inline-block;
}
.actionListTable{
font-size: 15px;
width:380px;
display: inline-block;
margin-left:380px;
height:100%;
}
.actionList{
height: 35px;
font-size: 18px;
padding-top: 5px;
position: absolute;
top: 0;
left: 0;
width: 740px;
border-bottom: 1px #ccc solid;
}
.titleStyle{
margin-left:10px;
}
.tab-pane-big{
height:100%;
padding-bottom: 20px;
position: relative;
}
.actionTable{
width:280px;
padding: 15px 0px 10px 15px;
@ -237,20 +166,10 @@
vertical-align: top;
display: inline-block;
}
.vertialLine{
height: 100%;
margin-left: 440px;
border-right: 1px #dadada solid;
position:absolute;
width: 0px;
}
.el_timeline{
width: 360px;
margin-top:10px;
}
.elScrollbar{
width: 380px;
position: absolute;
width: 350px;
margin-top:20px;
padding-left: 25px;
}
.roleClass{
color:#409EFF
@ -263,22 +182,7 @@
padding-top:200px;
}
.scriptBottom{
height: 100%;
position: relative;
margin-left:360px;
margin-top: 20px;
}
.scriptTop{
position: absolute;
top: 0;
left: 20px;
padding: 10px 10px;
width: 730px;
}
// .elTransfer{
// height:230px;
// margin-left:100px;
// }
// .selectRole{
// font-size: 15px;
// padding: 0px 20px 15px 15px;
// }
</style>

View File

@ -1,108 +0,0 @@
<template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate"> </el-button>
<el-button @click="doClose"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest';
export default {
name: 'ScriptDraft',
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
disabled:null,
formModel: {
name: '',
mapId: '',
description:''
},
isShow: false,
}
},
props: {
title: String,
},
computed: {
form() {
let isAdd = this.type === 'ADD'
let form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
]
}
return form
},
rules() {
let crules = {
name: [
{ required: true, message: '请输入剧本', trigger: 'blur' },
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' },
],
description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
]
}
return crules
},
// title() {
// return ''
// }
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
doShow(questid) {
if(questid)
{
getQuestById(questid).then(resp=>{
let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
this.formModel=data;
this.formModel.id=questid;
this.disabled="disabled";
this.dialogVisible = true
});
}
else
{
this.disabled=null;
this.dialogVisible = true
}
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}
}
</script>

View File

@ -1,173 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-script ref="createScript" title="创建脚本" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-script ref="modifyScript" title="修改脚本" @reloadTable="reloadTable" @create="handleConfirmModify" />
</div>
</template>
<script>
// import { listPublishMap } from '@/api/jmap/mapdraft';
import { listPublishMap } from '@/api/jmap/map';
// import { getSkinCodeList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
import { getQuestPageList, createQuest, deleteQuest, updateQuest} from '@/api/quest';
import { scriptRecordNotify } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import CreateScript from './create';
export default {
name: 'ScriptManage',
components: {
CreateScript
},
data() {
return {
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图',
config: {
data: []
}
}
}
},
queryList: {
query: getQuestPageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '剧本名称',
prop: 'name'
},
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.mapId, this.mapList, ['id', 'name']);
},
tagType: (row) => { return ''; }
},
{
title: '创建时间',
prop: 'createTime'
},
{
type: 'button',
title: '操作',
width: '350',
// hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: '录制',
handleClick: this.handleRecord,
type: 'success'
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
},
{
name: '修改',
handleClick: this.handleModify,
type: ''
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreate }
]
},
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
// this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
response.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
});
});
},
//
handleConfirmCreate(data) {
createQuest(data).then(resp => {
this.reloadTable();
this.$message.success('创建剧本成功');
}).catch(error => {
this.$messageBox(`创建剧本失败: ${error.message}`);
});
},
//
handleModify(index, row) {
this.$refs.modifyScript.doShow(row.id);
},
//
handleConfirmModify(data) {
updateQuest(data.id, data).then(resp => {
this.reloadTable();
this.$message.success('修改剧本成功');
}).catch(error => {
this.$messageBox(`修改剧本失败: ${error.message}`);
});
},
//
handleCreate(index, row) {
this.$refs.createScript.doShow(null);
},
//
handleRecord(index, row) {
scriptRecordNotify(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id };
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
});
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除此剧本脚本, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuest(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(error => {
this.reloadTable();
if (error.code == 500) {
this.$messageBox('删除失败');
} else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除');
}
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>