This commit is contained in:
zyy 2019-09-03 14:38:11 +08:00
commit 8c69b7afd0
12 changed files with 118 additions and 117 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 MiB

After

Width:  |  Height:  |  Size: 13 MiB

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,7 @@ export default class CircularLamp extends Group {
this.offsetY = 0;
this.dragging = false;
this.create();
this.setStatus(this.model);
}
create() {
@ -48,7 +49,7 @@ export default class CircularLamp extends Group {
this.event.disable();
if (e.which == 3) {
store.dispatch('ibp/setUpdateDeviceData', this.model);
return;
return;
}
this.offsetX = e.offsetX;
this.offsetY = e.offsetY;
@ -64,4 +65,11 @@ export default class CircularLamp extends Group {
this.dragging = false;
}
}
setStatus(model) {
if (model.switch === 'on') {
this.lamp.setStyle('fill', '#D8FCF2');
} else {
this.lamp.setStyle('fill', '#332C22');
}
}
}

View File

@ -13,12 +13,13 @@ export default class key extends Group {
this.event = device.event;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create();
}
create() {
const model = this.model;
this.imageBg = new Image({
this.keyImage = new Image({
zlevel: this.zlevel,
z: model.z,
draggable: false,
@ -30,15 +31,15 @@ export default class key extends Group {
height: 932
}
});
this.add(this.imageBg);
this.add(this.keyImage);
this.transformScale();
}
/** 缩放按钮 */
transformScale() {
this.imageBg.origin = [this.model.point.x, this.model.point.y];
this.imageBg.scale =[this.model.width/314, this.model.width/314];
this.imageBg.dirty();
this.keyImage.origin = [this.model.point.x, this.model.point.y];
this.keyImage.scale =[this.model.width/314, this.model.width/314];
this.keyImage.dirty();
}
getRotateColor() {
@ -55,18 +56,33 @@ export default class key extends Group {
return keyPic;
}
}
onclick() {
if (!this.keyImage.draggable) {
switch (this.model.status) {
case 'off': {
this.keyImage.setStyle({image: keyPicOn});
this.model.status='on';
break;
}
case 'on': {
this.keyImage.setStyle({image: keyPic});
this.model.status='off';
break;
}
}
}
}
setStatus(model) {
switch (model.status) {
case 'on': {
// 开放
this.imageBg.setStyle({image: keyPicOn});
this.keyImage.setStyle({image: keyPicOn});
this.model.status='on';
break;
}
case 'off': {
// 关闭
this.imageBg.setStyle({image: keyPic});
this.keyImage.setStyle({image: keyPic});
this.model.status='off';
break;
}
@ -74,7 +90,7 @@ export default class key extends Group {
}
setDraggable() {
this.imageBg.attr('draggable', true);
this.keyImage.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
@ -87,10 +103,11 @@ export default class key extends Group {
this.event.disable();
if (e.which == 3) {
store.dispatch('ibp/setUpdateDeviceData', this.model);
return;
return;
}
this.offsetX = e.offsetX;
this.offsetY = e.offsetY;
this.dragging = true;
}
mousemove(e) {
@ -98,7 +115,10 @@ export default class key extends Group {
mouseup(e) {
this.event.enable();
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
if (this.dragging) {
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
this.dragging = false;
}
}
}

View File

@ -32,6 +32,7 @@ class TransformHandle {
view.transform = this.transform;
view.decomposeTransform();
this.revisibleView(view);
view.transform = '';
}
}

View File

@ -24,7 +24,7 @@ class Jlmap {
this.skinCode = '';
// 皮肤风格
this.style = this.loadStyle();
this.style = {};
// 设备数据
this.mapDevice = {};
@ -80,11 +80,12 @@ class Jlmap {
this.$options.scaleRate = map.skinVO.scaling || 1;
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0;
// 更新视图大小
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
}
// 解析地图数据
// 更新视图大小
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
// 解析后的数据
this.mapDevice = mapDevice;
// 加载对应皮肤

View File

@ -33,7 +33,6 @@ class TransformHandle {
view.decomposeTransform();
this.revisibleView(view);
}
// return view;
}
// 处理所有视图缩放/平移

View File

@ -169,7 +169,7 @@
},
methods: {
createDataModel(model) {
const newModel = modelFactory(model.type, model);
const newModel = modelFactory(model._type, model);
this.$store.dispatch('ibp/updateIbpDevices', newModel);
},
deleteDataModel(model) {

View File

@ -14,6 +14,14 @@ import { mapGetters } from 'vuex';
export default {
name: 'Ibp',
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
width: this.$store.state.config.width,
@ -31,19 +39,10 @@ export default {
}
},
showBackButton: true,
initZrender: false,
initTime: '',
started: false
started: false
};
},
props: {
size: {
type: Object,
default() {
return null;
}
}
},
computed: {
...mapGetters([
'canvasWidth',
@ -55,14 +54,10 @@ export default {
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
if (this.initZrender) {
this.resetSize();
}
this.reSize();
},
'$store.state.app.windowSizeCount': function() {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height});
this.setWindowSize();
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
@ -70,12 +65,12 @@ export default {
this.initClockTime(initTime);
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp){
this.setClockStart(started);
}
}
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp) {
this.setClockStart(started);
}
}
},
mounted() {
this.setWindowSize();
@ -86,7 +81,7 @@ export default {
}
},
methods: {
show: function () {
show () {
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
@ -116,30 +111,10 @@ export default {
window.document.oncontextmenu = function () {
return false;
};
this.initZrender = true;
},
setMap(data) {
this.$ibp.setMap(ibpData, data);
},
resetSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.$emit('hideIbp');
},
//
onSelected(em) {
this.$emit('onSelect', em);
@ -157,10 +132,28 @@ export default {
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
}
//
setClockStart(started) {
this.$ibp.setClockStart(started);
},
reSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.$emit('hideIbp');
}
}
};
</script>
@ -171,9 +164,4 @@ export default {
right: 20px;
bottom: 15px;
}
.ibp-canvas{
/*background-image: url('../../assets/ibp_images/ibp_bg.png');*/
/*background-repeat:repeat;*/
/*background-size: 4096px 2048px;*/
}
</style>

View File

@ -285,8 +285,6 @@ export default {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
console.log(this.skinCode);
if (this.skinCode) {
// 01 02 ''
const resp = await this.getUserRole();

View File

@ -2,7 +2,7 @@
<div>
<div class="display-draft">
<el-button-group>
<el-button v-if="isIBP" @click="jumpIbp">IBP盘</el-button>
<el-button v-if="isIBP" type="warning" @click="jumpIbp">IBP盘</el-button>
<el-button v-if="isDriver" type="jumpjlmap3d" @click="jumpjlmap3d">司机视角</el-button>
<template v-if="isAdmin">
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button>

View File

@ -26,7 +26,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delDispatch(nor, index)"
@click="handleDelUser(dispatchList, nor, index)"
/>
</li>
</ul>
@ -42,7 +42,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delEquipment(nor, index)"
@click="handleDelEquipment(nor, index)"
/>
<div style="float: right; margin-right: 15px;">
<el-select
@ -82,7 +82,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delAdmin(nor, index)"
@click="handleDelUser(adminList, nor, index)"
/>
</li>
</ul>
@ -98,7 +98,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delSignal(nor, index)"
@click="handleDelUser(signalList, nor, index)"
/>
</li>
</ul>
@ -116,7 +116,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delDriver(nor, index)"
@click="handleDelUser(driverList, nor, index)"
/>
</li>
</ul>
@ -132,7 +132,7 @@
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delIBP(nor, index)"
@click="handleDelUser(ibpList, nor, index)"
/>
</li>
</ul>
@ -223,14 +223,15 @@
<script>
import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance } from '@/api/chat';
import trainChat from './trainChat';
import AddPerson from './addPerson';
import QrCode from '@/components/QrCode';
import { getStationList } from '@/api/runplan';
import TreeOperateMenu from './operateMenu';
import { launchFullscreen } from '@/utils/screen';
import { DeviceMenu } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { getPublishMapInfo } from '@/api/jmap/map';
import trainChat from './trainChat';
import AddPerson from './addPerson';
import QrCode from '@/components/QrCode';
import TreeOperateMenu from './operateMenu';
export default {
name: 'TrainRoom',
@ -359,6 +360,7 @@ export default {
const rest = await getPublishMapInfo(param.mapId);
const query = { skinCode: rest.data.skinCode, mapId: param.mapId, group: param.group };
this.$router.push({ path: `/jointTraining`, query: query });
launchFullscreen();
}
this.$store.dispatch('socket/setJointRoomInfo'); //
},
@ -389,6 +391,7 @@ export default {
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.$route.query.group };
this.$router.push({ path: `/jointTraining`, query: query });
launchFullscreen();
},
// 线/线
addPeopleList(obj) {
@ -658,6 +661,18 @@ export default {
});
});
},
//
addingRoles(name, title) {
this.listName = name;
const treeList = [];
this.treeData.forEach(item => {
if (!item.select) {
delete item.select;
treeList.push(item);
}
});
this.$refs.addPerson.doShow(title, treeList);
},
// Admin Instructor Dispatcher Attendant Audience Driver Repair
async handleDispatch(list) {
const arr = [];
@ -711,18 +726,6 @@ export default {
}
}
},
//
addingRoles(name, title) {
this.listName = name;
const treeList = [];
this.treeData.forEach(item => {
if (!item.select) {
delete item.select;
treeList.push(item);
}
});
this.$refs.addPerson.doShow(title, treeList);
},
handleUserList(list) {
this.treeData.forEach(item => {
list.forEach(nor => {
@ -732,12 +735,11 @@ export default {
});
});
},
//
delDispatch(item, index) {
this.dispatchList.splice(index, 1);
handleDelUser(list, item, index) {
list.splice(index, 1);
this.handleProperty(item);
},
delEquipment(item, index) {
handleDelEquipment(item, index) {
this.equipmentList.splice(index, 1);
this.stationList.forEach(item => {
item.disabled = false;
@ -749,22 +751,6 @@ export default {
});
this.handleProperty(item);
},
delAdmin(item, index) {
this.adminList.splice(index, 1);
this.handleProperty(item);
},
delDriver(item, index) {
this.driverList.splice(index, 1);
this.handleProperty(item);
},
delSignal(item, index) {
this.signalList.splice(index, 1);
this.handleProperty(item);
},
delIBP(item, index) {
this.ibpList.splice(index, 1);
this.handleProperty(item);
},
handleProperty(item) {
const treeIndex = this.treeData.findIndex(nor => nor.id == item.id);
if (treeIndex > -1) {