This commit is contained in:
joylink_cuiweidong 2020-04-28 14:04:39 +08:00
commit ef20f2024f
14 changed files with 477 additions and 59 deletions

View File

@ -151,6 +151,7 @@ export default {
},
methods: {
resetShowPosition(point) {
console.log(this.tipMsg, '====================');
if (point) {
this.show = true;
const self = this;
@ -249,7 +250,7 @@ export default {
position: fixed;
padding: 5px 0px;
border: 1px solid gray;
z-index: 2;
z-index: 9999;
.dsp-block {
display: block;

View File

@ -213,7 +213,7 @@ class SkinCode extends defaultStyle {
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 20}, // 折返偏移量
offset: {x: -16, y: -15}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},

View File

@ -134,13 +134,14 @@ class StationStand extends Group {
/** 站台折返策略*/
if (style.StationStand.reentry.offset) {
const reentryH = style.StationStand.standEmergent.mergentR;
const reentryX = model.position.x - (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.x - model.width / 2);
const reentryY = model.position.y + (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.y) + drict * reentryH;
const isRight = model.right ? -1 : 1;
const reentryX = model.position.x - (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.x - model.width / 2);
const reentryY = model.position.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH;
this.reentry = new EReentry({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
drict: drict,
drict: isRight,
x: reentryX,
y: reentryY,
lineWidth: 0,
@ -512,7 +513,13 @@ class StationStand extends Group {
}
/** 设置折返策略*/
switch (model.reentryStrategy) {
let reentryStrategy = '';
if (model.reentryStrategy !== '04') {
reentryStrategy = model.reentryStrategy;
} else {
reentryStrategy = model.defaultReentryStrategy;
}
switch (reentryStrategy) {
case '04': /** 默认*/
case '01':
this.noReentry(); /** 无折返策略*/

View File

@ -13,6 +13,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<passive-contorl ref="passiveControl" />
<menu-request ref="menuRequest" />
<menu-station-stand ref="menuStationStand" :selected="selected" @popMenuStationStand="popMenuStationStand" />
<pop-station-stand ref="popStationStand" :selected="selected" @closeMenuStationStand="closeMenuStationStand" @standOperationCallback="standOperationCallback" />
</template>
@ -36,6 +37,7 @@ import MenuLimit from './menuLimit';
import PassiveContorl from './passiveDialog/control';
import MenuStationStand from './menuStationStand';
import PopStationStand from './popStationStand';
import MenuRequest from './menuRequest';
// import PassiveTimeout from './passiveDialog/timeout';
export default {
@ -55,7 +57,8 @@ export default {
MenuStationStand,
// PassiveAlarm,
PassiveContorl,
PopStationStand
PopStationStand,
MenuRequest
// PassiveTimeout
},
props: {

View File

@ -0,0 +1,232 @@
<template>
<div class="xian-02__system request_box">
<div class="title-box">
<div class="title-name">操作请求堆栈</div>
<div class="icon" :class="{'is-active': unfold}" @click="unflodDiv">
<i class="el-icon-arrow-down" />
</div>
</div>
<div class="content-box" :class="{'is-active': unfold}">
<el-table ref="table" :data="tempData" border :cell-style="tableStyle" style="width: 100%;background: #000;border: none;outline: none; height: 120px;" size="mini" highlight-current-row :show-header="false" @row-click="clickEvent">
<el-table-column prop="station" style="margin-left:10px" />
<el-table-column prop="operation" style="margin-left:10px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="2" :offset="4" class="button-top">
<el-button :id="domIdConfirm" size="mini" style="float: left;" :loading="loading" @click="commit">重做</el-button>
</el-col>
<el-col :span="2" :offset="12" class="button-top">
<el-button :id="domIdCancel" size="mini" style="float: right;" @click="cancel">撤销</el-button>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="8" class="button-bottom-left">
<el-button :id="domIdConfirm" size="mini" style="float: left;" :loading="loading" @click="commit">发送请求</el-button>
</el-col>
<el-col :span="8" :offset="8" class="button-bottom-right">
<el-button :id="domIdCancel" size="mini" style="float: right;" @click="cancel">取消请求</el-button>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'CancelMenu',
components: {
},
data() {
return {
unfold: true,
tempData: [],
tableStyle: {
'border-bottom': 'none',
'border-right': 'none'
},
row: {},
loading: false
};
},
computed: {
...mapGetters('menuOperation', [
'requestList'
]),
domIdConfirm() {
return OperationEvent.Signal.arrangementRoute.menu.domId;
},
domIdCancel() {
return OperationEvent.Command.cancel.menu.domId;
}
},
watch: {
'$store.state.menuOperation.requestList': function (list) {
this.tempData = [];
if (list && list.length) {
list.forEach(item => {
if (item.device && item.device.code) {
const station = this.$store.getters['map/getDeviceByCode'](item.device.stationCode);
const param = {
station: `CP ${station.name}`,
operation: `${item.device.name} ${item.operation.name}`,
operateCode: item.operation.code,
deviceCode: item.device.code
};
this.tempData.push(param);
}
});
}
}
},
mounted() {
},
methods: {
unflodDiv() {
this.unfold = !this.unfold;
},
clickEvent(row, event, column) {
this.row = row;
},
cancel() {
if (this.row && this.row.deviceCode) {
this.$store.dispatch('menuOperation/spliceRequestList', this.row);
}
},
commit() {
const requestList = this.$store.state.menuOperation.requestList;
if (requestList && requestList.length > 0) {
this.commitEachCommand(requestList, 0);
}
},
commitEachCommand(requestList, index) {
const eachCmd = requestList[index];
const operate = {
over: true,
operation: eachCmd.operation.code,
cmdType: eachCmd.operation.cmdType,
param: eachCmd.operation.param //
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code});
const nextIndex = index++;
if (nextIndex < requestList.length) {
this.commitEachCommand(requestList, nextIndex);
}
// this.doClose();
}
}).catch(() => {
this.loading = false;
// this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>
<style lang="scss" scope>
.request_box{
width: 600px;
height: auto;
position: absolute;
bottom: 10px;
left: 50%;
background: #fff;
z-index: 10;
transform: translateX(-300px);
background: #518E86;
.title-box{
width: 100%;
height: 25px;
color: #333;
background: #94A1A3;
position: relative;
.title-name{
height: 25px;
line-height: 25px;
margin: 0 auto;
display: table;
}
.icon{
position: absolute;
right: 20px;
top: 0;
font-size: 14px;
color: #333;
cursor: pointer;
height: 25px;
line-height: 25px;
padding: 0px 6px;
transition: transform .3s,-webkit-transform .3s;
font-weight: 300;
&.is-active{
transform: rotate(180deg);
}
}
}
.content-box{
height: 210px;
overflow: hidden;
padding: 8px;
box-sizing: border-box;
transition: height .3s;
&.is-active{
height: 0;
padding: 0;
}
.button-group{
margin-top: 8px;
.button-top{
.el-button{
width: 40px;
padding: 0;
border: 2px outset #B7D4D5;
border-radius: 0 !important;
color: #000;
background: #BBBBBB;
span {
height: 20px;
line-height: 20px;
}
}
}
.button-bottom-left{
.el-button{
width: 60px;
padding: 0;
border: 2px outset #B7D4D5;
border-radius: 0 !important;
color: #000;
background: #00FF7F;
span {
height: 20px;
line-height: 20px;
}
}
}
.button-bottom-right{
.el-button{
width: 60px;
padding: 0;
border: 2px outset #B7D4D5;
border-radius: 0 !important;
color: #000;
background: #5F9EA0;
span {
height: 20px;
line-height: 20px;
}
}
}
}
}
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" trigger="click" pop-class="xian-02__pop_tip_station" />
<pop-menu ref="popMenu" :menu="menu" trigger="click" :tip-msg="topTip" pop-class="xian-02__pop_tip_station" />
<notice-info ref="noticeInfo" />
<update-stand-plan ref="updateStandPlan" :selected="selected" />
<warning-confirm ref="warningConfirm" :selected="selected" />
@ -39,6 +39,7 @@ export default {
data() {
return {
menu: [],
topTip: '',
totalMenu: {
Local: [],
Center: [
@ -209,11 +210,6 @@ export default {
psdInfoConfirm: {
Local: [],
Center: [
{
label: '站台屏蔽门报警-站台屏蔽门信息确认',
handler: this.setStopTime,
cmdType: ''
},
{
label: '站台屏蔽门报警确认',
handler: this.confirmPsdWarning,
@ -301,6 +297,7 @@ export default {
switch (type) {
case 'updateStandPlan':
// this.menu = MenuContextHandler.covert(this.updateStandPlan);
this.topTip = '';
this.menu = this.updateStandPlan.Center;
break;
case 'stopJumping':
@ -316,6 +313,7 @@ export default {
this.menu = this.standDetain.Center;
break;
case 'psdInfoConfirm':
this.topTip = '站台屏蔽门报警-站台屏蔽门信息确认';
this.menu = this.psdInfoConfirm.Center;
break;
case 'upStopProfile':
@ -326,7 +324,7 @@ export default {
break;
}
// this.menu = MenuContextHandler.covert(this.menuNormal);
console.log(this.menu, type);
console.log(this.menu, type, this.topTip);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;

View File

@ -50,6 +50,38 @@
</el-button-group>
</el-form-item>
</el-form>
<el-form ref="roadModel" :model="roadModel" label-width="200px" size="mini" :rules="roadRules">
<el-form-item label="起止区段:" prop="sectionCode">
<el-select v-model="roadModel.sectionCode" filterable>
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + '(' + item.code + ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'sectionRoadCode' ? 'danger' : 'primary'"
size="small"
@click="hover('sectionRoadCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="线路类型">
<el-select v-model="roadModel.roadType">
<el-option
v-for="item in sectionRoadTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" size="big" @click="setRoadType">{{ $t('global.set') }}</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
</template>
@ -78,10 +110,18 @@ export default {
modelList: [],
trainPosType: ''
},
roadModel: {
roadType: '',
sectionCode: ''
},
positionTypes: [
{ name: '上方', type: '01' },
{ name: '下方', type: '02' }
],
sectionRoadTypeList: [
{code: 'LEFT', name: '左行线'},
{code: 'RIGHT', name: '右行线'}
],
tipInfoList: [],
formRules: {
trainPosType: [
@ -90,6 +130,14 @@ export default {
modelList: [
{ required: true, message: '请选择', trigger: 'change' }
]
},
roadRules: {
sectionCode: [
{ required: true, message: '请选择', trigger: 'change' }
],
roadType: [
{ required: true, message: '请选择', trigger: 'change' }
]
}
};
},
@ -139,6 +187,65 @@ export default {
this.$refs.formModel.resetFields(); //
}
});
},
getSetRoadList(models, direction, section) {
section.roadType = this.roadModel.roadType;
models.push(section);
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(item => {
const logicSection = this.$store.getters['map/getDeviceByCode'](item);
logicSection.roadType = this.roadModel.roadType;
models.push(logicSection);
});
}
let nextSection = '';
if (direction === 'left' && section.leftSectionCode) {
nextSection = this.$store.getters['map/getDeviceByCode'](section.leftSectionCode);
} else if (direction === 'right' && section.rightSectionCode) {
nextSection = this.$store.getters['map/getDeviceByCode'](section.rightSectionCode);
} else if (section.switch && section.switch.code) {
const switchDevcie = this.$store.getters['map/getDeviceByCode'](section.switch.code);
if (switchDevcie.sectionACode === section.code) {
nextSection = this.$store.getters['map/getDeviceByCode'](switchDevcie.sectionBCode);
} else if (switchDevcie.sectionBCode === section.code) {
nextSection = this.$store.getters['map/getDeviceByCode'](switchDevcie.sectionACode);
}
if ((nextSection.points[0].x > section.points[0].x && direction === 'left') || (nextSection.points[0].x < section.points[0].x && direction === 'right')) {
nextSection = '';
}
}
if (nextSection) {
this.getSetRoadList(models, direction, nextSection);
}
},
setRoadType() {
const models = [];
this.$refs['roadModel'].validate((valid) => {
if (valid) {
const section = this.$store.getters['map/getDeviceByCode'](this.roadModel.sectionCode);
let direction = '';
if (section.leftSectionCode) {
direction = 'left';
} else if (section.rightSectionCode) {
direction = 'right';
} else if (section.switch && section.switch.code) {
let nextSection = '';
const switchDevcie = this.$store.getters['map/getDeviceByCode'](section.switch.code);
if (switchDevcie.sectionACode === section.code) {
nextSection = this.$store.getters['map/getDeviceByCode'](switchDevcie.sectionBCode);
direction = nextSection.points[0].x > section.points[0].x ? 'right' : 'left';
} else if (switchDevcie.sectionBCode === section.code) {
nextSection = this.$store.getters['map/getDeviceByCode'](switchDevcie.sectionACode);
direction = nextSection.points[0].x > section.points[0].x ? 'right' : 'left';
}
}
if (direction) {
this.getSetRoadList(models, direction, section);
}
}
this.$emit('updateMapModel', models, 'five');
this.$refs.roadModel.resetFields(); //
});
}
}
};

View File

@ -225,7 +225,8 @@ export default {
relevanceSectionList: [],
points: [],
leftAxlePosition: 0,
rightAxlePosition: 0
rightAxlePosition: 0,
roadType: ''
};
},
//

View File

@ -71,6 +71,13 @@ export default {
{value: 2, label: '特殊计轴下方显示'},
{value: -2, label: '特殊计轴上方显示'}
],
sectionRoadTypeList: [
{code: 'LEFT', name: '左行线'},
{code: 'RIGHT', name: '右行线'},
{code: 'CROSS', name: '渡线'},
{code: 'DEPOT', name: '联段线'},
{code: 'PARKING', name: '库线'}
],
editModel: {
code: '',
name: '',
@ -115,7 +122,8 @@ export default {
logicSectionStartOffset: 0,
logicSectionEndOffset: 0,
leftAxlePosition: 0,
rightAxlePosition: 0
rightAxlePosition: 0,
roadType: ''
},
oldPoint: [], //
logicSectionNums: [1],
@ -152,6 +160,7 @@ export default {
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList }, //
{ prop: 'roadType', label: '线路类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.sectionRoadTypeList, isHidden: !this.isSwitchSectionType},
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection}, //
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection}, //
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode }, // /code
@ -455,6 +464,9 @@ export default {
} else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) {
this.$refs.batchSettings.formModel.modelList.push(selected.code);
this.activeName = 'five';
} else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) {
this.$refs.batchSettings.roadModel.sectionCode = selected.code;
this.activeName = 'five';
}
}
},

View File

@ -205,7 +205,8 @@ export default {
}
],
namePosition: { x: 0, y: 0 },
relevanceSectionList: []
relevanceSectionList: [],
roadType: selected.roadType
};
models.push(model);
}
@ -281,7 +282,8 @@ export default {
kmRangeLeft: '',
region: '',
trainWindowCode: '',
relevanceSectionList: []
relevanceSectionList: [],
roadType: ''
};
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true }));
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));

View File

@ -66,6 +66,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属联锁站:">
<el-select v-model="addModel.interlockStationCode">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name + item.code"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
@ -98,7 +108,8 @@ export default {
right: false,
leftOrRight: 'L', //
positionType: '01',
stationCode: ''
stationCode: '',
interlockStationCode: ''
},
SignalPositionTypeList:[],
SignalDirectionList: [
@ -172,6 +183,7 @@ export default {
_type: 'Signal',
code: uid,
name: uname,
type: 'PROTECTION',
uniqueName: uid,
sectionCode: this.addModel.sectionCode,
positionType: this.addModel.positionType,

View File

@ -73,11 +73,17 @@ export default {
{ code: '00', name: this.$t('map.normal') },
{ code: '01', name: this.$t('map.signalFilamentAlarm') }
],
signalTypeList: [
{ code: 'PROTECTION', name: '防护信号机'},
{ code: 'BLOCKING', name: '阻挡信号机'},
{ code: 'PASSING', name: '通过信号机'}
],
questionList: [],
field:'',
editModel: {
code: '',
name: '',
type: 'PROTECTION',
uniqueName: '',
nameShow: false,
lampPostType: '',
@ -98,7 +104,8 @@ export default {
position: { x: 0, y: 0 },
positionPoint: { x: 0, y: 0 },
buttonPosition: { x: 0, y: 0 },
guidePosition: { x: 0, y: 0 }
guidePosition: { x: 0, y: 0 },
interlockStationCode: ''
},
addModel: {
number: 2
@ -149,6 +156,7 @@ 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: 'type', label: '信号机类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.signalTypeList},
{ prop: 'positionPoint', label: '信号机偏移坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'positionPoint.x', firstLevel: 'positionPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'positionPoint.y', firstLevel: 'positionPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
@ -180,6 +188,7 @@ export default {
name: this.$t('map.mapData'),
item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
{ prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList},
{ 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: 'sectionCode', label: this.$t('map.belongsSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList },

View File

@ -79,6 +79,10 @@ export default {
{ code: false, name: '向左'},
{ code: true, name: '向右'}
],
reentryStrategyList: [
{ code: '02', name: '自动无人折返'},
{ code: '03', name: '自动换端'}
],
editModel: {
code: '',
name: '',
@ -94,6 +98,7 @@ export default {
right: true,
standTrackCode: '',
small: false,
defaultReentryStrategy: '', //
stopJumpLamp: false, //
stopJumpLampPoint: {x: 0, y: 0}, //
cancelStopJumpLamp: false, //
@ -116,6 +121,7 @@ export default {
standTrackDownCode: '', //
stationstandDirection: '02', //
right: true,
defaultReentryStrategy: '', //
inside: false, //
small: false,
stopJumpLamp: false, //
@ -163,6 +169,7 @@ export default {
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'editSectionSelectCode', buttonShowType: this.isButtonTypeES },
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'defaultReentryStrategy', label: '默认折返策略:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.reentryStrategyList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox', disabled: true },
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' },
{ prop: 'stopJumpLamp', label: '跳停按钮:', type: 'checkbox'},
@ -246,6 +253,7 @@ export default {
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS },
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'defaultReentryStrategy', label: '默认折返策略:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.reentryStrategyList, clearable: true },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' },
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' },
{ prop: 'stopJumpLamp', label: '跳停按钮:', type: 'checkbox'},

View File

@ -1,15 +1,22 @@
<template>
<div v-show="dialogVisible">
<el-dialog v-dialogDrag title="通用配置项" :visible.sync="dialogVisible" width="550px" :before-close="handleClose" center :close-on-click-modal="false" :z-index="2000">
<div style="height: 370px; overflow: auto;">
<el-table :data="tableData" style="width: 100%;">
<el-table-column prop="configKey" label="key" />
<el-dialog v-dialogDrag title="配置项" :visible.sync="dialogVisible" width="550px" :before-close="handleClose" center :close-on-click-modal="false" :z-index="2000">
<el-card>
<div slot="header" style="font-weight: bold;text-align: center;">
<span>通用配置项</span>
</div>
<el-table :data="generalData" style="width: 100%;" height="200">
<el-table-column prop="configKey" label="key" width="300px" />
<el-table-column prop="configValue" label="value">
<template slot-scope="scope">
<div v-if="scope.row.type === 'input'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer;" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100%" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'number'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input-number v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100px;" :min="0" controls-position="right" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'boolean'">
<el-checkbox v-model="scope.row.configValue">{{ scope.row.configValue }}</el-checkbox>
</div>
@ -25,28 +32,46 @@
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="description" label="描述" /> -->
<!-- <el-table-column>
<template slot="header">
<div class="flex_box">
<span>操作</span>
<i class="el-icon-circle-plus-outline icon_font" @click="addModel(scope)" />
</el-table>
</el-card>
<el-card style="margin-top: 10px">
<div slot="header" style="font-weight: bold;text-align: center;">
<span>联锁配置项</span>
</div>
<el-table :data="roadData" style="width: 100%;" height="200">
<el-table-column prop="configKey" label="key" width="300px" />
<el-table-column prop="configValue" label="value">
<template slot-scope="scope">
<div v-if="scope.row.type === 'input'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer;" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100%" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'number'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input-number v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100px;" :min="0" controls-position="right" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'boolean'">
<el-checkbox v-model="scope.row.configValue">{{ scope.row.configValue }}</el-checkbox>
</div>
<div v-else-if="scope.row.type === 'select'">
<el-select v-model="scope.row.configValue" size="mini" style="width: 80px;">
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
<template slot-scope="scope">
<el-button type="text" size="small" @click="editModel(scope.row, scope.$index)">编辑</el-button>
<el-button type="text" size="small" @click="delModel(scope.row, scope.$index)">删除</el-button>
</template>
</el-table-column> -->
</el-table-column>
</el-table>
</div>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="save">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
<!-- <edit-config ref="addConfig" type="ADD" @create="createModel" />
<edit-config ref="editConfig" type="EDIT" @update="updateModel" /> -->
</div>
</template>
@ -71,10 +96,15 @@ export default {
dialogVisible: false,
index: 0,
id: '',
tableData: [],
generalData: [],
roadData: [],
focus: false,
booleanList: ['lockFirst', 'switchSingleHandle'],
booleanList: ['lockFirst', 'switchSingleHandle', 'signalApproachOnlyOne', 'signalApproachOnlyNpSwitch',
'routeNameUseEndOppositeSignalName', 'generateTbRoute', 'tbRouteNameUseEndOppositeSignalName', 'routeSignalAlwaysGreen',
'routeApartByOverlap', 'overlapOnlySwitch', 'overlapSwitchNpOnly', 'overlapSignalOppositeSwitchNpOnly', 'overlapOnlyOneSwitch'],
selectList: ['upDirection'],
generalConfig: ['lockFirst', 'switchSingleHandle', 'upDirection'],
numberList: ['overlapReleaseTime', 'routeReleaseTime'],
optionsMap: {
upDirection: [{label: 'right', value: 'right'}, {label: 'left', value: 'left'}]
}
@ -103,7 +133,8 @@ export default {
const res = await getRealLineConfigList(this.id);
if (res.data) {
const keys = Object.keys(res.data);
this.tableData = [];
this.generalData = [];
this.roadData = [];
keys.forEach(key => {
// let value = '';
let type = 'input';
@ -113,6 +144,8 @@ export default {
} else if (this.selectList.indexOf(key) >= 0) {
type = 'select';
options = this.optionsMap[key];
} else if (this.numberList.indexOf(key) >= 0) {
type = 'number';
} else {
type = 'input';
}
@ -122,10 +155,15 @@ export default {
type: type,
options: options
};
this.tableData.push(param);
if (this.generalConfig.includes(key)) {
this.generalData.push(param);
} else {
this.roadData.push(param);
}
});
} else {
this.tableData = [];
this.generalData = [];
this.roadData = [];
}
} catch (error) {
console.log(error);
@ -145,30 +183,18 @@ export default {
this.$refs.editConfig.show(item);
this.index = index;
},
delModel(item, index) {
this.$confirm('此操作将删除该配置项, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.tableData.splice(index, 1);
});
},
createModel(data) {
this.tableData.push(data);
},
updateModel(data) {
this.tableData.splice(this.index, 1, data);
},
save() {
const param = {};
this.tableData.forEach(item => {
this.generalData.forEach(item => {
param[item.configKey] = item.configValue;
// if (item.boolean) {
// const value = item.configValue == 'true';
// param[item.configKey] = value;
// }
});
this.roadData.forEach(item => {
param[item.configKey] = item.configValue;
});
putRealLineConfig(this.id, param).then(res => {
this.$message.success(`保存配置项成功!`);
this.dialogVisible = false;