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 => { (list || []).forEach(elem => {
const code = elem.code; const code = elem.code;
const type = elem._type; const type = elem._type;
if (type === deviceType.Background) {
this.canvasSize = {
x: 0,
y: 0,
width: elem.width,
height: elem.height
};
}
updateIbpData(elem); updateIbpData(elem);
const oDevice = this.ibpDevice[code] || deviceFactory(type, elem); const oDevice = this.ibpDevice[code] || deviceFactory(type, elem);
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem)); const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem));

View File

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

View File

@ -1,6 +1,6 @@
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; 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 { updateIbpData } from '@/ibp/utils/parser';
import store from '@/store'; import store from '@/store';

View File

@ -28,26 +28,37 @@ export default class clock extends Group {
this.initTime = 0; this.initTime = 0;
this.name='group'; this.name='group';
this.create(); this.create();
} }
create() { create() {
this.grouper=new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.clockBg = new Image({ this.clockBg = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: { style: {
image: clockBg, image: clockBg,
x: this.model.point.x, // x: this.model.point.x,
y: this.model.point.y, // y: this.model.point.y,
x: 0,
y: 0,
width: this.model.width, width: this.model.width,
height: this.model.width/493*156 height: this.model.width/493*156
} }
}); });
this.clockBg.name ='group_child';
this.num1 = new Image({ this.num1 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.1, // x: this.model.point.x+this.model.width*0.1,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -55,10 +66,13 @@ export default class clock extends Group {
this.num2 = new Image({ this.num2 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.22, // x: this.model.point.x+this.model.width*0.22,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -66,10 +80,13 @@ export default class clock extends Group {
this.num3 = new Image({ this.num3 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.39, // x: this.model.point.x+this.model.width*0.39,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -77,10 +94,13 @@ export default class clock extends Group {
this.num4 = new Image({ this.num4 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.52, // x: this.model.point.x+this.model.width*0.52,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -88,10 +108,13 @@ export default class clock extends Group {
this.num5 = new Image({ this.num5 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.69, // x: this.model.point.x+this.model.width*0.69,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -99,10 +122,13 @@ export default class clock extends Group {
this.num6 = new Image({ this.num6 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: this.getImagePic('0'), image: this.getImagePic('0'),
x: this.model.point.x+this.model.width*0.82, // x: this.model.point.x+this.model.width*0.82,
y: this.model.point.y+this.model.width*0.052, // 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, width: this.model.width*0.1,
height: this.model.width*0.1/37*74 height: this.model.width*0.1/37*74
} }
@ -110,10 +136,13 @@ export default class clock extends Group {
this.clockColon1 = new Image({ this.clockColon1 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: clockColon, image: clockColon,
x: this.model.point.x+this.model.width*0.16, // x: this.model.point.x+this.model.width*0.16,
y: this.model.point.y-this.model.width*0.028, // 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, width: this.model.width*0.37,
height: this.model.width/1*0.37 height: this.model.width/1*0.37
} }
@ -121,23 +150,27 @@ export default class clock extends Group {
this.clockColon2 = new Image({ this.clockColon2 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
name: 'group_child',
style: { style: {
image: clockColon, image: clockColon,
x: this.model.point.x+this.model.width*0.46, // x: this.model.point.x+this.model.width*0.46,
y: this.model.point.y-this.model.width*0.028, // 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, width: this.model.width*0.37,
height: this.model.width/1*0.37 height: this.model.width/1*0.37
} }
}); });
this.add(this.clockBg); this.grouper.add(this.clockBg);
this.add(this.num1); this.grouper.add(this.num1);
this.add(this.num2); this.grouper.add(this.num2);
this.add(this.num3); this.grouper.add(this.num3);
this.add(this.num4); this.grouper.add(this.num4);
this.add(this.num5); this.grouper.add(this.num5);
this.add(this.num6); this.grouper.add(this.num6);
this.add(this.clockColon1); this.grouper.add(this.clockColon1);
this.add(this.clockColon2); this.grouper.add(this.clockColon2);
this.add(this.grouper);
} }
getImagePic(context) { getImagePic(context) {
let pic = clock0; let pic = clock0;
@ -263,4 +296,22 @@ export default class clock extends Group {
getName() { getName() {
return this.name; 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.grouper.attr('draggable', true);
// this.createMouseEvent(); // 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> <template>
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" /> <menu-cancel ref="menuCancel" />
<template v-if="!isScreen"> <template v-show="!isScreen">
<menu-bar v-show="isShowMenu" ref="menuBar" :selected="selected" /> <template v-show="isShowMenu">
<menu-tool v-show="isShowMenu" ref="menuTool" :selected="selected" /> <menu-bar ref="menuBar" :selected="selected" />
<status-bar v-show="isShowMenu" ref="statusBar" :selected="selected" /> <menu-tool ref="menuTool" :selected="selected" />
<status-bar ref="statusBar" :selected="selected" />
</template>
<menu-station-control ref="menuStationControl" :selected="selected" /> <menu-station-control ref="menuStationControl" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" /> <menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" /> <menu-switch ref="menuSwitch" :selected="selected" />
@ -68,7 +69,8 @@ export default {
'width' 'width'
]), ]),
isScreen() { isScreen() {
return this.$route.params.mode == 'dp'; return this.$route.params.mode == 'dp' ||
this.$store.state.training.roles == 'BigScreen';
}, },
isShowMenu() { isShowMenu() {
return this.$store.state.training.prdType != ''; return this.$store.state.training.prdType != '';

View File

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

View File

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

View File

@ -45,7 +45,8 @@ export default {
'stationList' 'stationList'
]), ]),
isScreen() { // isScreen() { //
return this.$route.params.mode === 'dp'; return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
}, },
group() { group() {
return this.$route.query.group; return this.$route.query.group;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,19 +1,17 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu> <pop-menu ref="popMenu" :menu="menu" />
</div> </div>
</template> </template>
<script> <script>
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler'; import { Notification } from 'element-ui';
import { Notification } from 'element-ui'; import { mapGetters } from 'vuex';
import { mapGetters } from 'vuex'; import { DeviceMenu } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { exitFullscreen } from '@/utils/screen';
import { exitFullscreen } from '@/utils/screen';
import { screenTopic, clearSubscribe } from '@/utils/stomp';
export default { export default {
name: 'CancelMenu', name: 'CancelMenu',
components: { components: {
PopMenu PopMenu
@ -39,21 +37,22 @@
disabled: false disabled: false
} }
] ]
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList'
]), ]),
isScreen() { // isScreen() { //
return this.$route.params.mode === 'dp' return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
} }
}, },
watch: { watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) { '$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) { if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true; // this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = (this.menu[1] && val) ? false : true; // this.menu[1].disabled = !((this.menu[1] && val));
} }
}, },
'$store.state.menuOperation.menuCount': function (val) { '$store.state.menuOperation.menuCount': function (val) {
@ -66,19 +65,19 @@
}, },
methods: { methods: {
clickEvent() { clickEvent() {
let self = this; const self = this;
window.onclick = function (e) { window.onclick = function (e) {
self.doClose(); self.doClose();
} };
}, },
initMenu() { initMenu() {
this.menuNormal = []; this.menuNormal = [];
this.stationList.forEach(station => { this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) { if (station.code === station.concentrateStationCode) {
let node = { const node = {
label: station.name, label: station.name,
children: [] children: []
} };
this.stationList.forEach(elem => { this.stationList.forEach(elem => {
if (elem.visible) { if (elem.visible) {
@ -91,11 +90,11 @@
node.children.push({ node.children.push({
code: elem.code, code: elem.code,
label: elem.name, label: elem.name,
handler: this.mapLocation, handler: this.mapLocation
}); });
} }
} }
}) });
this.menuNormal.push(node); this.menuNormal.push(node);
} }
@ -141,5 +140,5 @@
exitFullscreen(); exitFullscreen();
} }
} }
} };
</script> </script>

View File

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

View File

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

View File

@ -300,6 +300,7 @@ export default {
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); break; 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 '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 '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); await this.getTrainDetail(this.skinCode);

View File

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

View File

@ -439,11 +439,24 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
const model = Object.assign({_type: 'Link'}, this.editModel); this.$emit('addOrUpdateMapModel', this.buildEditModel());
this.$emit('addOrUpdateMapModel', model);
} }
}); });
}, },
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() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); 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: '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: '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: '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 }, { 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: '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: '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: '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: '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: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0 },
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 }, { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 },

View File

@ -366,11 +366,48 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
const model = Object.assign({_type: 'Signal'}, this.editModel); this.$emit('addOrUpdateMapModel', this.buildEditModel());
this.$emit('addOrUpdateMapModel', model);
} }
}); });
}, },
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() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -241,11 +241,36 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
const model = Object.assign({_type: 'Station'}, this.editModel); this.$emit('addOrUpdateMapModel', this.buildEditModel());
this.$emit('addOrUpdateMapModel', model);
} }
}); });
}, },
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() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -224,11 +224,27 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
const model = Object.assign({_type: 'StationControl'}, this.editModel); this.$emit('addOrUpdateMapModel', this.buildEditModel());
this.$emit('addOrUpdateMapModel', model);
} }
}); });
}, },
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() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

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

View File

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

View File

@ -126,6 +126,11 @@ export default {
}, },
// //
handleDelete() { handleDelete() {
this.$confirm('您确认是否删除此运行图?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(this.planId).then(Response => { deleteRunPlan(this.planId).then(Response => {
this.$message.success(`删除成功!`); this.$message.success(`删除成功!`);
if (this.planId === this.$route.query.planId) { if (this.planId === this.$route.query.planId) {
@ -136,6 +141,7 @@ export default {
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
}); });
}).catch(() => { });
}, },
// //
handleEdit() { handleEdit() {