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

This commit is contained in:
ival 2019-09-04 19:04:58 +08:00
commit 664fbb8f7f
30 changed files with 495 additions and 283 deletions

File diff suppressed because one or more lines are too long

View File

@ -141,6 +141,14 @@ class IbpPan {
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
if (type === deviceType.Background) {
this.canvasSize = {
x: 0,
y: 0,
width: elem.width,
height: elem.height
};
}
updateIbpData(elem);
const oDevice = this.ibpDevice[code] || deviceFactory(type, elem);
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem));

View File

@ -104,14 +104,19 @@ class MouseController extends Eventful {
const draggingTarget = e.target;
// draggingTarget.draggable
if (draggingTarget) {
if (e.target.parent.getName()=='background') {
if (e.target.parent.name=='background') {
this._draggingName='background';
} else if (this.isAllowDragging&&e.target.parent.getName()=='simple') {
} else if (this.isAllowDragging&&e.target.parent.name=='simple') {
this._draggingName='simple';
} else if (this.isAllowDragging&&e.target.parent.getName()=='group') {
} else if (this.isAllowDragging&&e.target.parent.name=='group') {
this._draggingName='group';
} else if (this.isAllowDragging&&e.target.parent.getName()=='group_child') {
this._offsetX=e.offsetX;
this._offsetY=e.offsetY;
// this._draggingTarget.parent.model.point
} else if (this.isAllowDragging&&(e.target.parent.name=='group_child'||e.target.name=='group_child')) {
this._draggingName='group_child';
this._offsetX=e.offsetX;
this._offsetY=e.offsetY;
}
this._draggingTarget = draggingTarget;
// draggingTarget.dragging = true;
@ -120,13 +125,6 @@ class MouseController extends Eventful {
this._dragging = true;
// this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event);
}
// var x = e.offsetX;
// var y = e.offsetY;
// this._x = x;
// this._y = y;
// this._dragging = true;
}
mousemove(e) {
@ -154,27 +152,46 @@ class MouseController extends Eventful {
} else if (this.isAllowDragging&&this._draggingTarget&&this._draggingName=='simple') {
this._draggingTarget.drift(dx, dy, e);
return true;
} else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group'||this._draggingName=='group_child')) {
// debugger;
if (this._draggingName=='group') {
} else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group_child')) {
// this._draggingName=='group'||
if (this._draggingTarget.parent.parent.name=='group') {
this._draggingTarget.parent.drift(dx, dy, e);
return true;
} else {
this._draggingTarget.parent.parent.drift(dx, dy, e);
return true;
}
// if (this._draggingName=='group') {
// // this._draggingTarget.parent.model.point.x+=dx;
// // this._draggingTarget.parent.model.point.y+=dy;
// // this._draggingTarget.parent.dirty();
// this._draggingTarget.parent.drift(dx, dy, e);
// return true;
// } else {
// this._draggingTarget.parent.parent.drift(dx, dy, e);
// return true;
// }
}
} else {
// debugger;
return true;
}
}
mouseup(e) {
// debugger;
const draggingTarget = this._draggingTarget;
if (!eventTool.notLeftMouse(e)&&draggingTarget) {
if (this._draggingName=='simple') {
console.log();
} else if (this._draggingName=='group'||this._draggingName=='group_child') {
if (this._draggingTarget.parent.parent.name=='group') {
this._draggingTarget.parent.parent.setModal(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this._draggingTarget.parent.parent.dirty();
} else {
this._draggingTarget.parent.parent.parent.setModal(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this._draggingTarget.parent.dirty();
}
}
this._dragging = false;
this._draggingTarget = null;
this._draggingName=='';

View File

@ -1,6 +1,6 @@
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group';
import {arrow} from '@/jmap/shape/utils/ShapePoints';
import {arrow} from './utils';
// import { updateIbpData } from '@/ibp/utils/parser';
import store from '@/store';

View File

@ -28,26 +28,37 @@ export default class clock extends Group {
this.initTime = 0;
this.name='group';
this.create();
}
create() {
this.grouper=new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.clockBg = new Image({
zlevel: this.zlevel,
z: this.z,
style: {
image: clockBg,
x: this.model.point.x,
y: this.model.point.y,
// x: this.model.point.x,
// y: this.model.point.y,
x: 0,
y: 0,
width: this.model.width,
height: this.model.width/493*156
}
});
this.clockBg.name ='group_child';
this.num1 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.1,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.1,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.1,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -55,10 +66,13 @@ export default class clock extends Group {
this.num2 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.22,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.22,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.22,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -66,10 +80,13 @@ export default class clock extends Group {
this.num3 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.39,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.39,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.39,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -77,10 +94,13 @@ export default class clock extends Group {
this.num4 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.52,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.52,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.52,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -88,10 +108,13 @@ export default class clock extends Group {
this.num5 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.69,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.69,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.69,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -99,10 +122,13 @@ export default class clock extends Group {
this.num6 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.82,
y: this.model.point.y+this.model.width*0.052,
// x: this.model.point.x+this.model.width*0.82,
// y: this.model.point.y+this.model.width*0.052,
x: this.model.width*0.82,
y: this.model.width*0.052,
width: this.model.width*0.1,
height: this.model.width*0.1/37*74
}
@ -110,10 +136,13 @@ export default class clock extends Group {
this.clockColon1 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: clockColon,
x: this.model.point.x+this.model.width*0.16,
y: this.model.point.y-this.model.width*0.028,
// x: this.model.point.x+this.model.width*0.16,
// y: this.model.point.y-this.model.width*0.028,
x: +this.model.width*0.16,
y: -this.model.width*0.028,
width: this.model.width*0.37,
height: this.model.width/1*0.37
}
@ -121,23 +150,27 @@ export default class clock extends Group {
this.clockColon2 = new Image({
zlevel: this.zlevel,
z: this.z,
name: 'group_child',
style: {
image: clockColon,
x: this.model.point.x+this.model.width*0.46,
y: this.model.point.y-this.model.width*0.028,
// x: this.model.point.x+this.model.width*0.46,
// y: this.model.point.y-this.model.width*0.028,
x: +this.model.width*0.46,
y: -this.model.width*0.028,
width: this.model.width*0.37,
height: this.model.width/1*0.37
}
});
this.add(this.clockBg);
this.add(this.num1);
this.add(this.num2);
this.add(this.num3);
this.add(this.num4);
this.add(this.num5);
this.add(this.num6);
this.add(this.clockColon1);
this.add(this.clockColon2);
this.grouper.add(this.clockBg);
this.grouper.add(this.num1);
this.grouper.add(this.num2);
this.grouper.add(this.num3);
this.grouper.add(this.num4);
this.grouper.add(this.num5);
this.grouper.add(this.num6);
this.grouper.add(this.clockColon1);
this.grouper.add(this.clockColon2);
this.add(this.grouper);
}
getImagePic(context) {
let pic = clock0;
@ -263,4 +296,22 @@ export default class clock extends Group {
getName() {
return this.name;
}
setModal(dx, dy) {
// debugger;
// this.parent.dirty();
//
this.model.point.x+=dx;
this.model.point.y+=dy;
// this.attr('transform', [1, 0, 0, 1, 0, 0]);
// this.transform = [1, 0, 0, 1, 0, 0];
// this.invTransform = [1, 0, 0, 1, 0, 0];
// console.log(this.model, this);
// this.eachChild(function(child) {
// // // debugger;
// child.style.x+=dx;
// child.style.y+=dy;
// // child.dirty();
// }, this.parent);
}
}

View File

@ -102,4 +102,8 @@ export default class elevator extends Group {
// this.grouper.attr('draggable', true);
// this.createMouseEvent();
}
setModal(dx, dy) {
this.model.point.x+=dx;
this.model.point.y+=dy;
}
}

11
src/ibp/shape/utils.js Normal file
View File

@ -0,0 +1,11 @@
export function arrow(modelX, modelY, length, radius) {
return [
[modelX, modelY],
[modelX + radius /1.5, modelY - radius/1.5],
[modelX + radius /1.5, modelY - radius/3],
[modelX + length, modelY - radius/3],
[modelX + length, modelY + radius/3],
[modelX + radius /1.5, modelY + radius/3],
[modelX + radius /1.5, modelY + radius/1.5]
];
}

View File

@ -1,11 +1,12 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-if="!isScreen">
<menu-bar v-show="isShowMenu" ref="menuBar" :selected="selected" />
<menu-tool v-show="isShowMenu" ref="menuTool" :selected="selected" />
<status-bar v-show="isShowMenu" ref="statusBar" :selected="selected" />
<template v-show="!isScreen">
<template v-show="isShowMenu">
<menu-bar ref="menuBar" :selected="selected" />
<menu-tool ref="menuTool" :selected="selected" />
<status-bar ref="statusBar" :selected="selected" />
</template>
<menu-station-control ref="menuStationControl" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
@ -68,7 +69,8 @@ export default {
'width'
]),
isScreen() {
return this.$route.params.mode == 'dp';
return this.$route.params.mode == 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
isShowMenu() {
return this.$store.state.training.prdType != '';

View File

@ -6,12 +6,10 @@
<script>
import PopMenu from '@/components/PopMenu';
// import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { runDiagramQuit } from '@/api/simulation';
// import { screenTopic, clearSubscribe } from '@/utils/stomp';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -47,7 +45,8 @@ export default {
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp';
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
@ -56,8 +55,8 @@ export default {
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = !((this.menu[1] && val));
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {

View File

@ -1,7 +1,7 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-if="isShowAll">
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-button ref="menuButton" />
<menu-station-control ref="menuStationControl" :selected="selected" />
@ -68,7 +68,8 @@ export default {
]),
isShowAll() {
return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan';
this.$route.params.mode !== 'plan' &&
this.$store.state.training.roles != 'BigScreen';
},
isShowBar() {
return this.$store.state.training.prdType != '';

View File

@ -45,7 +45,8 @@ export default {
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp';
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
@ -75,33 +76,33 @@ export default {
},
initMenu() {
this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}

View File

@ -1,8 +1,8 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-if="isShowAll">
<template v-if="isShowBar">
<template v-show="isShowAll">
<template v-show="isShowBar">
<menu-bar ref="menuBar" :selected="selected" />
</template>
<menu-station-control ref="menuStationControl" :selected="selected" />
@ -67,7 +67,8 @@ export default {
]),
isShowAll() {
return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan';
this.$route.params.mode !== 'plan' &&
this.$store.state.training.roles != 'BigScreen';
},
isShowBar() {
return this.$store.state.training.prdType != '';

View File

@ -103,7 +103,6 @@
<script>
import { mapGetters } from 'vuex';
import { TrainingMode, OperationEvent } from '@/scripts/ConstDic';
// import { OperateMode } from '@/scripts/ConstDic';
import { menuBarConvert, SystemType } from './utils/menuItemStatus';
import StationControlConvert from './menuDialog/stationControlConvert';
import TrainAdd from './menuDialog/trainAdd';

View File

@ -6,12 +6,10 @@
<script>
import PopMenu from '@/components/PopMenu';
// import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { runDiagramQuit } from '@/api/simulation';
// import { screenTopic, clearSubscribe } from '@/utils/stomp';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -47,7 +45,8 @@ export default {
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp';
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
@ -56,8 +55,8 @@ export default {
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = !((this.menu[1] && val));
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
@ -83,14 +82,14 @@ export default {
// label: station.name,
// children: []
// }
//
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
@ -100,7 +99,7 @@ export default {
// }
// }
// })
//
//
// this.menuNormal.push(node);
// }
// });

View File

@ -1,8 +1,8 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-if="isShowAll">
<template v-if="isShowBar">
<template v-show="isShowAll">
<template v-show="isShowBar">
<menu-bar ref="menuBar" :selected="selected" />
</template>
<menu-station-control ref="menuStationControl" :selected="selected" />
@ -67,7 +67,8 @@ export default {
]),
isShowAll() {
return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan';
this.$route.params.mode !== 'plan' &&
this.$store.state.training.roles != 'BigScreen';
},
isShowBar() {
return this.$store.state.training.prdType != '';

View File

@ -6,12 +6,10 @@
<script>
import PopMenu from '@/components/PopMenu';
// import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { runDiagramQuit } from '@/api/simulation';
// import { screenTopic, clearSubscribe } from '@/utils/stomp';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -47,7 +45,8 @@ export default {
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp';
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
@ -56,8 +55,8 @@ export default {
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = !((this.menu[1] && val));
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {

View File

@ -1,7 +1,7 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-if="isShowAll">
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-station-control ref="menuStationControl" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
@ -61,8 +61,9 @@ export default {
'width'
]),
isShowAll() {
return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan';
return this.$route.params.mode != 'dp' &&
this.$route.params.mode != 'plan' &&
this.$store.state.training.roles != 'BigScreen';
},
isShowBar() {
return this.$store.state.training.prdType != '';

View File

@ -1,145 +1,144 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
</div>
<div>
<pop-menu ref="popMenu" :menu="menu" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { Notification } from 'element-ui';
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { screenTopic, clearSubscribe } from '@/utils/stomp';
import PopMenu from '@/components/PopMenu';
import { Notification } from 'element-ui';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
}
},
computed: {
...mapGetters('map', [
'stationList',
]),
isScreen() { //
return this.$route.params.mode === 'dp'
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = (this.menu[1] && val) ? false : true;
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
let node = {
label: station.name,
children: []
}
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
const node = {
label: station.name,
children: []
};
this.stationList.forEach(elem => {
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
}
this.stationList.forEach(elem => {
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
}
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation,
});
}
}
})
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation
});
}
}
});
this.menuNormal.push(node);
}
});
this.menuNormal.push(node);
}
});
if (this.isScreen) {
this.menu = [...this.menuScreen];
} else {
this.menu = [...this.menuNormal];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
history.go(-1);
Notification.closeAll();
exitFullscreen();
}
}
}
</script>
if (this.isScreen) {
this.menu = [...this.menuScreen];
} else {
this.menu = [...this.menuNormal];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
history.go(-1);
Notification.closeAll();
exitFullscreen();
}
}
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="箭头编号" prop="code">
<el-input :disabled="true" v-model="form.code" >
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
@ -23,6 +23,12 @@
<el-form-item label="箭头颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input>
</el-form-item>
<el-form-item label="顶点X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="顶点Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
@ -42,16 +48,14 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 10,
y: 10
},
form: {
code: '',
orientation: '',
arrowWidth: '',
arrowLength: '',
fillColor: ''
fillColor: '',
x: 10,
y: 10
},
rules: {
code: [
@ -87,7 +91,8 @@
this.form.arrowLength = model.length;
this.form.arrowWidth = model.width;
this.form.fillColor = model.fill;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
@ -98,7 +103,10 @@
this.$refs[form].validate((valid) => {
if (valid){
const arrowModel = {
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Arrow',
code: this.form.code,
orientation: this.form.orientation,
@ -116,7 +124,10 @@
},
deleteDevice() {
const arrowModel = {
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Arrow',
code: this.form.code,
orientation: this.form.orientation,
@ -136,9 +147,7 @@
orientation: '',
arrowWidth: '',
arrowLength: '',
fillColor: ''
};
this.point = {
fillColor: '',
x: 10,
y: 10
};

View File

@ -70,7 +70,7 @@ export default {
return false;
},
isScreen() {
return this.$route.params.mode === 'dp';
return this.$route.params.mode == 'dp' || this.$store.state.training.roles == 'BigScreen';
}
},
watch: {

View File

@ -300,6 +300,7 @@ export default {
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); break;
case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); break;
case 'BigScreen': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen'); break;
}
}
await this.getTrainDetail(this.skinCode);

View File

@ -8,7 +8,7 @@
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button>
<el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button>
</template>
<el-button type="primary" @click="back">返回</el-button>
<el-button v-if="!isBigScreen" type="primary" @click="back">返回</el-button>
</el-button-group>
</div>
<qr-code ref="qrCode" />
@ -75,6 +75,9 @@ export default {
},
isIBP() {
return this.userRole == 'IBP';
},
isBigScreen() {
return this.userRole == 'BigScreen';
}
},
watch: {
@ -242,6 +245,14 @@ export default {
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair');
this.$emit('getUserRole');
break;
case 'IBP':
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP');
this.$emit('getUserRole');
break;
case 'BigScreen':
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen');
this.$emit('getUserRole');
break;
default:
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience');
this.$emit('getUserRole');

View File

@ -439,11 +439,24 @@ export default {
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const model = Object.assign({_type: 'Link'}, this.editModel);
this.$emit('addOrUpdateMapModel', model);
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
const model = {
_type: 'Link',
code: this.editModel.code,
name: this.editModel.name,
color: this.editModel.color == '' ? '#4e8de6' : this.editModel.color,
leftFdCode: this.editModel.leftFdCode,
leftSdCode: this.editModel.leftSdCode,
rightFdCode: this.editModel.rightFdCode,
rightSdCode: this.editModel.rightSdCode,
lengthFact: this.editModel.lengthFact
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -312,8 +312,6 @@ export default {
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
] },
{ prop: 'destinationCodeShow', label: this.$t('map.destinationCodeShow'), type: 'checkbox', isHidden: !this.isdestinationCode },
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ 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, disabled: true },
@ -340,6 +338,8 @@ 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: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ 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 },

View File

@ -366,11 +366,48 @@ export default {
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const model = Object.assign({_type: 'Signal'}, this.editModel);
this.$emit('addOrUpdateMapModel', model);
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
const model = {
_type: 'Signal',
code: this.editModel.code,
name: this.editModel.name,
uniqueName: this.editModel.uniqueName,
useType: this.editModel.useType,
lampPostType: this.editModel.lampPostType,
lampPositionType: this.editModel.lampPositionType,
potLampType: this.editModel.potLampType,
positionType: this.editModel.positionType,
directionType: this.editModel.directionType,
nameShow: this.editModel.nameShow,
buttonShow: this.editModel.buttonShow,
guideShow: this.editModel.guideShow,
offset: this.editModel.offset,
rotate: this.editModel.rotate,
position: {
x: this.editModel.position.x,
y: this.editModel.position.y
},
namePosition: {
x: this.editModel.namePosition.x,
y: this.editModel.namePosition.y
},
guidePosition: {
x: this.editModel.guidePosition.x,
y: this.editModel.guidePosition.y
},
buttonPosition: {
x: this.editModel.buttonPosition.x,
y: this.editModel.buttonPosition.y
},
stationCode: this.editModel.stationCode,
linkCode: this.editModel.linkCode
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -241,11 +241,36 @@ export default {
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const model = Object.assign({_type: 'Station'}, this.editModel);
this.$emit('addOrUpdateMapModel', model);
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
var model = {
_type: 'Station',
code: this.editModel.code,
visible: this.editModel.visible,
runPlanName: this.editModel.runPlanName,
name: this.editModel.name,
zcCode: this.editModel.zcCode,
nameFont: this.editModel.nameFont,
nameFontColor: this.editModel.nameFontColor,
kmPostShow: this.editModel.kmPostShow,
kmRange: this.editModel.kmRange,
kmPost: this.editModel.kmPost,
kmPostFontColor: this.editModel.kmPostFontColor,
kmPostFont: this.editModel.kmPostFont,
isShowControlMode: this.editModel.isShowControlMode,
centralized: this.editModel.centralized,
concentrateStationCode: this.editModel.concentrateStationCode,
position: {
x: this.editModel.position.x,
y: this.editModel.position.y
}
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -224,11 +224,27 @@ export default {
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const model = Object.assign({_type: 'StationControl'}, this.editModel);
this.$emit('addOrUpdateMapModel', model);
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
const model = {
_type: 'StationControl',
code: this.editModel.code,
zokContent: this.editModel.zokContent,
zbjkContent: this.editModel.zbjkContent,
zakContent: this.editModel.zakContent,
jjzkContent: this.editModel.jjzkContent,
zzkContent: this.editModel.zzkContent,
stationCode: this.editModel.stationCode,
position: {
x: this.editModel.position.x,
y: this.editModel.position.y
}
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -5,9 +5,7 @@
</template>
<script>
// import Vue from 'vue';
import MapCommon from './common/index';
// import StompClient from '@/utils/sock';
import { handleToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic, planTopic } from '@/utils/stomp';
import { sendCommand } from '@/api/jmap/training';

View File

@ -47,7 +47,7 @@ export default {
},
computed: {
title() {
return '新建运行图';
return '修改运行图名称';
},
rules() {
return {

View File

@ -126,16 +126,22 @@ export default {
},
//
handleDelete() {
deleteRunPlan(this.planId).then(Response => {
this.$message.success(`删除成功!`);
if (this.planId === this.$route.query.planId) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
this.$confirm('您确认是否删除此运行图?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(this.planId).then(Response => {
this.$message.success(`删除成功!`);
if (this.planId === this.$route.query.planId) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
},
//
handleEdit() {