代码调整

This commit is contained in:
fan 2021-02-04 18:38:33 +08:00
parent 766059611c
commit 88683b3763
7 changed files with 56 additions and 14 deletions

View File

@ -46,6 +46,9 @@ export default class Line2 extends Group {
case '02':
this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]);
break;
case '03':
this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]);
break;
}
}

View File

@ -104,7 +104,8 @@ export default {
message: '',
timeCountCommand: -1,
timeCountConfirm: -1,
stationName: ''
stationName: '',
selected: {}
};
},
computed: {
@ -232,6 +233,7 @@ export default {
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.selected = selected;
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.stationName = selected.name;

View File

@ -25,13 +25,16 @@
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmTip',
data() {
return {
dialogShow: false,
message: '',
confirmId: ''
operation: ''
};
},
computed: {
@ -40,6 +43,13 @@ export default {
},
title() {
return '确认对话框';
},
confirmId() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
return OperationEvent.Signal.arrangementRoute.secondaryConfirm.operation;
} else {
return '';
}
}
},
mounted() {
@ -47,12 +57,23 @@ export default {
},
methods: {
doShow(operate) {
this.message = operate.message || '<div>命令:进路设置</div><div>始端信号机xxx</div><div>进路:测试进路 </div>';
this.message = operate.message || '';
this.dialogShow = true;
this.confirmId = operate.confirmId;
this.operation = operate.operation;
},
confirm() {
this.$emit('close');
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
const step = {
operation: OperationEvent.Signal.arrangementRoute.secondaryConfirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
};
commitOperate(step, {}, 2).then(({valid, operate})=>{
if (valid) {
this.$emit('close');
this.doClose();
}
});
}
},
doClose() {
this.dialogShow = false;

View File

@ -217,10 +217,13 @@ export default {
commit() {
if (this.row && this.row.canSetting) {
this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then(({valid})=>{
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 1).then(({valid, operate})=>{
this.loading = false;
if (valid) {
this.doClose();
const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode);
operate.message = `<div>命令:进路设置</div><div>始端信号机:${signal.name}</div><div>进路:${this.row.name} </div>`;
this.$refs.confirmTip.doShow(operate);
}
}).catch(() => {
this.loading = false;

View File

@ -430,7 +430,7 @@ export default {
minDuration: 8,
operateType: 'Switch_Confirm_Axis_Valid',
skinCode: '06',
trainingName: '确认计轴有效({8}{9})',
trainingName: '确认计轴有效({7})',
trainingRemark: '确认计轴有效功能',
trainingType: 'Switch',
productTypes: ['02'],

View File

@ -22,7 +22,7 @@ export const OperationEvent = {
close: {
operation: 'com05',
domId: '_Tips-Cmd-Common-Close'
},
},
choose1: {
operation: 'com06',
@ -43,9 +43,9 @@ export const OperationEvent = {
close1: {
operation: 'com10',
domId: '_Tips-Cmd-Common-Close1'
},
},
choose2: {
choose2: {
operation: 'com11',
domId: '_Tips-Cmd-Common-Choose2'
},
@ -1084,6 +1084,10 @@ export const OperationEvent = {
menuButton:{
operation: '3013',
domId: '_Tips-Signal-ArrangementRoute-Menu{BOTTOM}'
},
secondaryConfirm: {
operation: '3014',
domId: '_Tips-Signal-ArrangementRoute-SecondaryConfirm'
}
},
// 取消进路

View File

@ -59,7 +59,9 @@ export default {
lineColor: '',
showConditions: '01',
points: [],
stationCode: ''
stationCode: '',
offsetX: 0,
offsetY: 0
},
addModel: {
type: '',
@ -69,7 +71,9 @@ export default {
points: [
{ x: 0, y: 0 },
{ x: 100, y: 100 }
]
],
offsetX: 0,
offsetY: 0
},
rules: {
code: [
@ -91,7 +95,7 @@ export default {
'lineCode'
]),
showConditionsList() {
const showConditionsList = ConstConfig.ConstSelect.showConditionsList;
const showConditionsList = [...ConstConfig.ConstSelect.showConditionsList, { enlabel:'Draw', label: '仅绘图', value: '04'}];
return Cookies.get('user_lang') == 'en'
? showConditionsList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
: showConditionsList.map(elem => { return { value: elem.value, label: elem.label }; });
@ -113,7 +117,9 @@ export default {
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
{ prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList},
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint },
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
{ prop: 'offsetX', label: '右侧设备X偏移:', type: 'number', min: 0, isHidden: !this.isFoldLine },
{ prop: 'offsetY', label: '左侧设备Y偏移:', type: 'number', min: 0, isHidden: !this.isFoldLine }
]
},
map: {
@ -145,6 +151,9 @@ export default {
},
isPointsShow() {
return this.editModel.points.length > 0;
},
isFoldLine() {
return this.editModel.type == '03';
}
},
mounted() {