This commit is contained in:
joylink_zyy 2020-07-25 15:07:59 +08:00
commit c50adf149b
35 changed files with 556 additions and 560 deletions

View File

@ -94,7 +94,8 @@ class SkinCode extends defaultStyle {
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
logicalTextColor: '#C0C0C0', // 逻辑区段名称颜色 (未用)
invalidColor: '#A0522D' // 计轴故障
},
axle: {}, // 计轴
speedLimit: { // 限速元素

View File

@ -86,6 +86,7 @@ class SkinCode extends defaultStyle {
unCommunicationOccupiedColor: '#ff0000', // 区段非通讯车占用颜色 红色
routeLockColor: '#00FF00', // 区段路由锁定颜色
faultLockColor: '#9B4A0A', // 区段故障锁定颜色
invalidColor: '#ff0000', // 计轴故障
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
blockColor: '#000080', // 区段封锁颜色 深蓝色
@ -249,7 +250,7 @@ class SkinCode extends defaultStyle {
},
trainDepart:{ // 停车计时
insideOffset:{ x: 25, y: -21}, // 内站台停车计时偏移量
outsideOffset: { x: -25, y: 21}, // 外站台停车计时偏移量
outsideOffset: { x: -25, y: -11}, // 外站台停车计时偏移量
textFill: '#00FF00', // 文字颜色
textBorderColor: '#00FF00', // 文字边框颜色
fontSize: 10 // 字体大小

View File

@ -5,36 +5,31 @@ class ETrainDepart extends Group {
constructor(model) {
super();
this.model = model;
this.isNew = false;
this.timeStart = 30;
this.time = null;
this.create();
}
create(text) {
if (!this.isNew) {
const model = this.model;
const style = this.model.style;
this.isNew = true;
this.trainDepart = new Text({
zlevel: model.zlevel,
z: model.z,
position: [0, 0],
style: {
x: model.x,
y: model.y,
text: text,
textAlign: style.textStyle.textAlign,
fontSize: style.StationStand.trainDepart.fontSize,
fontFamily: style.fontFamily,
textFill: style.StationStand.trainDepart.textFill,
textVerticalAlign: style.textStyle.textVerticalAlign,
textBorderColor: style.StationStand.trainDepart.textBorderColor,
textPadding: 2,
textBorderWidth: 1
}
});
this.add(this.trainDepart);
}
create() {
const model = this.model;
const style = this.model.style;
this.trainDepart = new Text({
zlevel: model.zlevel,
z: model.z,
position: [0, 0],
style: {
x: model.x,
y: model.y,
text: '000',
textAlign: style.textStyle.textAlign,
fontSize: style.StationStand.trainDepart.fontSize,
fontFamily: style.fontFamily,
textFill: style.StationStand.trainDepart.textFill,
textVerticalAlign: style.textStyle.textVerticalAlign,
textBorderColor: style.StationStand.trainDepart.textBorderColor,
textPadding: 2,
textBorderWidth: 1
}
});
this.add(this.trainDepart);
}
setColor(color) {
@ -44,31 +39,17 @@ class ETrainDepart extends Group {
hideMode() {
this.trainDepart && this.trainDepart.hide();
this.time && clearInterval(this.time);
}
showMode() {
this.timeStart = 30;
this.create(`0${this.timeStart}`);
showMode(remainTime) {
if (remainTime < 10) {
remainTime = '00' + remainTime;
} else {
remainTime = '0' + remainTime;
}
this.trainDepart.setStyle('text', remainTime);
this.trainDepart.show();
setTimeout(() => {
this.animition();
}, 1000);
}
animition() {
this.time && clearInterval(this.time);
this.time = setInterval(() => {
this.timeStart--;
if (this.timeStart >= 0) {
if (this.timeStart < 10) {
this.trainDepart.setStyle('text', `00${this.timeStart}`);
} else {
this.trainDepart.setStyle('text', `0${this.timeStart}`);
}
} else {
clearInterval(this.time);
}
}, 1000);
}
}

View File

@ -398,7 +398,7 @@ class StationStand extends Group {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor);
} else {
this.trainStop && this.trainStop.showMode();
this.trainDepart && this.trainDepart.showMode();
this.trainDepart && this.trainDepart.showMode(this.model.remainTime);
}
}

View File

@ -102,7 +102,8 @@ export default {
centralizedStationList1: [],
centralizedStationList2: [],
colsNum: 0,
version: ''
version: '',
centralizedMap: {}
};
},
computed: {
@ -115,7 +116,10 @@ export default {
]),
...mapGetters('map', [
'stationList'
])
]),
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
}
},
watch: {
tempClassA() {
@ -143,11 +147,23 @@ export default {
if (code) {
this.stationCode = code;
}
},
'$store.state.socket.simulationRoleList':function(val) {
if (val && val.length) {
this.checkRoleChange(val);
}
}
},
mounted() {
this.version = this.$store.state.map.version;
this.initMenu();
if (this.$store.state.socket.simulationRoleList && this.$store.state.socket.simulationRoleList.length) {
this.$store.state.socket.simulationRoleList.forEach(item => {
if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId && item.type === 'STATION_SUPERVISOR') {
this.switchShowStation(this.centralizedMap[item.deviceCode]);
}
});
}
},
methods: {
initMenu() {
@ -158,6 +174,10 @@ export default {
this.stationList.forEach(item => {
if (item.centralized) {
centralizedStationList.push(item);
this.centralizedMap[item.code] = item.code;
item.chargeStationCodeList && item.chargeStationCodeList.length && item.chargeStationCodeList.forEach(ele => {
this.centralizedMap[ele] = item.code;
});
}
});
centralizedStationList.forEach((item, index) => {

View File

@ -224,6 +224,10 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开/关门',
handler: this.handleOpenCloseDoor
}
],
menuSpeed: [
@ -350,6 +354,19 @@ export default {
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});
},
// /
handleOpenCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});

View File

@ -308,8 +308,8 @@ export default {
jump() {
this.disabled = true;
setTimeout(() => {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
if (!this.drawWay) {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
simulationNotify(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
@ -319,9 +319,9 @@ export default {
this.disabled = false;
});
} else {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
this.$store.dispatch('training/setPrdType', this.currentPrdType); // prdType
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
}).catch(error => {

View File

@ -149,9 +149,6 @@ export default {
this.deleteChapter(params.node);
break;
}
},
refresh() {
this.initPageData();
}
}
};

View File

@ -1,13 +1,6 @@
<template>
<div style="height: 100%; overflow-y: auto;">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 98%;margin-left:1%;margin-top:20px;" />
<!-- <training-draft
ref="draftTrain"
:map-id-list="mapIdList"
:training-type-list="trainingTypeList"
:training-operate-type-map="trainingOperateTypeMap"
@refresh="reloadTable"
/> -->
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
@ -25,14 +18,12 @@ import { launchFullscreen } from '@/utils/screen';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getCmdList } from '@/api/management/dictionary';
import { UrlConfig } from '@/scripts/ConstDic';
// import TrainingDraft from './draft';
import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainingGeneration',
components: {
// TrainingDraft
},
data() {
return {
@ -138,18 +129,11 @@ export default {
handleClick: this.demoDisplay,
type: ''
}
/* {
name: this.$t('lesson.trainingRecord'),
handleClick: this.trainingRecord,
type: ''
}*/
]
}
],
actions: [
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging }
// { text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
// { text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
]
},

View File

@ -40,6 +40,7 @@
import { getAllSimulationList, postSimulationConnectById, putSimulationDisconnectById } from '@/api/simulation.js';
import ConstConfig from '@/scripts/ConstConfig';
import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'Equipment',
@ -63,7 +64,12 @@ export default {
StationStand: '站台'
}
};
},
},
computed: {
project() {
return getSessionStorage('project');
}
},
mounted() {
EventBus.$on('selectDevice', (data) => {
this.selected = data;
@ -85,20 +91,26 @@ export default {
async getList() {
try {
const res = await getAllSimulationList(this.group);
this.tableData = [].concat(res.data);
this.tableData.forEach((item, index) => {
this.tableData = [];
res.data.forEach((item, index) => {
if (item.type == 'PLC_GATEWAY') {
this.plcInfo = {
name: 'PLC网关',
status: item.online
};
this.tableData.splice(index, 1);
} else {
item.buttonShowType = false;
item.typeName = this.typeList.find(el => el.value == item.type).label;
if (item.vrDeviceCode) {
item.vrDeviceName = this.$store.getters['map/getDeviceByCode'](item.vrDeviceCode).name;
}
}
if (this.project == 'heb' || this.project == 'designheb') {
if (item.type == 'SWITCH') {
this.tableData.push(item);
}
} else {
this.tableData.push(item);
}
}
});
} catch (error) {

View File

@ -36,14 +36,11 @@ export default {
userRole: {
type: String,
required: true
},
offsetBottom:{
type: Number,
required: true
}
},
data() {
return {
offsetBottom:15,
scriptTip:'',
isHasCoversition:false,
conversitionId:'',
@ -67,7 +64,14 @@ export default {
}
},
watch:{
'$store.state.map.mapViewLoadedCount': function (val) { //
'$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.offsetBottom = 15;
const menuBottom = document.getElementById('menuButton');
this.offsetBottom = this.offsetBottom + (menuBottom ? menuBottom.offsetHeight || 0 : 0);
});
},
'$store.state.map.mapViewLoadedCount': function (val) { // 仿
getSimulationMemberList(this.group).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;

View File

@ -76,8 +76,8 @@ export default {
dataError: false,
panelShow: true,
memberData:[],
simulationShow: false,
drivingShow: false,
// simulationShow: false,
// drivingShow: false,
isscriptRun:false, //
showStation: '',
stationListMode: [],
@ -141,8 +141,6 @@ export default {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
// this.mapBoxP = document.getElementById(this.canvasId).children[0];
// this.mapBoxP.style.cursor = '';
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
@ -167,9 +165,9 @@ export default {
this.setStationList();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
// this.$nextTick(() => {
this.initLoadData();
// });
}
},
created() {
@ -180,7 +178,6 @@ export default {
await this.initLoadData();
},
async beforeDestroy() {
// await this.clearAllTimer();
await this.quit();
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');

View File

@ -5,8 +5,6 @@
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
<!-- :group="group" -->
<!-- :show-station="showStation" -->
<menu-demon
v-if="isDemon"
ref="menuDemon"
@ -29,7 +27,7 @@
:offset-bottom="offsetBottom"
:tip-bottom="tipBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@ -40,7 +38,7 @@
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@ -52,7 +50,7 @@
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchMode="switchMode"
@selectQuest="selectQuest"
@ -67,7 +65,7 @@
:offset="offset"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
:data-error="dataError"
@switchMode="switchMode"
@ -149,7 +147,7 @@ export default {
dataError: false,
group:'',
showStation: '',
stationList: [],
stationListMode: [],
showSelectStation: false, // select
prdTypeMap: {
'01': '01', // =>
@ -163,6 +161,10 @@ export default {
computed:{
...mapGetters([
'canvasWidth'
]),
...mapGetters('map', [
'map',
'stationList'
]),
mode() {
return this.$route.params.mode;
@ -217,8 +219,9 @@ export default {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.training.prdType': function (val) { //
this.setPosition();
'$store.state.training.prdType': function (val) { //
this.setPosition();
this.setMode();
},
'size.width': function(val) {
this.setWindowSize();
@ -245,10 +248,9 @@ export default {
}
});
},
'$store.state.map.map': function (val) {
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
this.showSelectStation && this.setStationList(val);
},
'stationList': function () {
this.setStationList();
},
'$store.state.map.mapViewLoadedCount': function (val) { //
if (this.planRunning) {
this.$store.dispatch('training/simulationStart');
@ -259,7 +261,8 @@ export default {
async mounted() {
this.group = this.$route.query.group;
await this.setWindowSize();
await this.initLoadData();
await this.initLoadData();
this.setMode();
},
beforeDestroy() {
this.quit(this.group);
@ -399,8 +402,13 @@ export default {
});
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
},
this.$store.dispatch('training/setPrdType', prdType); // prdType
},
setMode() {
if (this.map) {
this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
}
},
//
selectQuest(row) {
this.scriptId = parseInt(row.id);
@ -515,7 +523,7 @@ export default {
offsetBottom = (menuBottom.offsetHeight || 0) + 15;
}
if (menuButtonsBox) {
this.tipBottom = menuButtonsBox.offsetHeight + 15 || 0;
this.tipBottom = (menuButtonsBox.offsetHeight || 0) + 15;
}
if (this.offset != offset) {
this.offset = offset;
@ -526,12 +534,12 @@ export default {
});
},
setCenter(code) {
this.$refs.mapCanvas.setCenter(code);
this.$jlmap.setCenter(code);
},
switchStationMode(val) {
if (this.stationList.length > 0) {
if (this.stationListMode.length > 0) {
if (val == null) {
this.showStation = this.stationList[0].value;
this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
@ -554,15 +562,15 @@ export default {
// this.$store.dispatch('map/setShowCentralizedStationNum');
}
},
setStationList(val) {
this.stationList = [];
(val.stationList || []).forEach(item => {
setStationList() {
this.stationListMode = [];
(this.stationList || []).forEach(item => {
if (item.centralized) {
this.stationList.push({value: item.code, name: item.name});
this.stationListMode.push({value: item.code, name: item.name});
}
});
if (this.stationList.length) {
this.showStation = this.stationList[0].value;
if (this.stationListMode.length && this.showSelectStation) {
this.showStation = this.stationListMode[0].value;
}
}
}

View File

@ -1,6 +1,6 @@
<template>
<div>
<demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset-bottom="offsetBottom" />
<demon-chat ref="chatbox" :group="group" :user-role="userRole" />
<div class="display-card" :style="{top: offset+'px'}">
<el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
@ -61,7 +61,7 @@ export default {
default() {
return 0;
}
},
},
dataError: {
type: Boolean,
default() {
@ -76,7 +76,7 @@ export default {
timeNow: 0, //
time: null, //
countTime: 0, //
remainingTime: 0,
remainingTime: 0,
goodsId: this.$route.query.goodsId,
try: this.$route.query.try, //
training: {
@ -244,7 +244,7 @@ export default {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
},
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then(()=>{

View File

@ -4,8 +4,8 @@
<el-select v-if="(isScript&&!isScriptCommand) || isDesignPlatform" v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<!-- ||(isScriptCommand && isLocalStation) -->
<el-select v-if="showSelectStation&&((!isScriptCommand&&swch=='01')||(isScriptCommand && isLocalStation))" v-model="showStationContent" style="width: 100px;" size="small" @change="switchStationModeInfo">
<!-- showSelectStation&&((!isScriptCommand&&swch=='01')||(isScriptCommand && isLocalStation)) -->
<el-select v-if="showSelectStation && isLocalStation && !isScript" v-model="showStationContent" style="width: 100px;" size="small" @change="switchStationModeInfo">
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-button-group>
@ -112,7 +112,7 @@ export default {
isDemon() {
return this.$route.params.mode === 'demon';
},
isDesignPlatform() {
isDesignPlatform() { //
return this.$route.fullPath.includes('design/displayNew/demon');
},
isScheduling() {
@ -153,8 +153,6 @@ export default {
},
async mounted() {
await this.loadRunData(this.$route.query);
// this.isScriptCommand = this.$store.state.scriptRecord.bgSet;
// this.showStationContent = this.showStation;
},
methods: {
loadRunData(opt) {

View File

@ -446,7 +446,7 @@ export default {
this.$jlmap.updateShowMode(list, showMode);
EventBus.$emit('select_DrawType', showMode);
},
setShowStation(stationCode, isTraining) {
setShowStation(stationCode, setCenter) {
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
@ -461,7 +461,7 @@ export default {
}
});
this.$jlmap.updateShowStation(list, stationCode);
!isTraining && this.setCenter(stationCode);
!setCenter && this.setCenter(stationCode);
},
setOffset(data, num, sum) {
this.$jlmap.switchScreen(data, num, sum);

View File

@ -80,7 +80,7 @@ import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
import { EventBus } from '@/scripts/event-bus';
import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui';
import Vue from 'vue';
// import Vue from 'vue';
import localStore from 'storejs';
import MembersManage from './memberManage/membersManage';
import AddMember from './memberManage/addMember';
@ -124,7 +124,7 @@ export default {
ibpPart: '',
showStation: '',
stationList: [],
showSelectStation: false,
showSelectStation: false, // 线
mapViewLoadedOver: false,
dataError: false,
countdownTime: '00:00:00',
@ -133,7 +133,8 @@ export default {
questionList: [],
practicalExamTime: 0,
isAdmin: false,
deviceShow: false
deviceShow: false,
centralizedStationMap: {}
};
},
computed: {
@ -172,24 +173,22 @@ export default {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.training.prdType': function (val) {
this.setPosition();
if (val == '01' && this.$route.query.lineCode == '06') {
'$store.state.training.prdType': function (prdType) {
this.setPosition();
if (prdType == '01' && this.$route.query.lineCode == '06') {
this.showSelectStation = true;
this.mapViewLoadedOver && this.setShowStation(this.showStation);
this.cancelBigScreenMode();
} else if (val == '02' && this.$route.query.lineCode == '06') {
} else if (prdType == '02' && this.$route.query.lineCode == '06') {
this.showSelectStation = false;
this.mapViewLoadedOver && this.setShowStation('');
this.cancelBigScreenMode();
} else if (val == '07') { //
} else if (prdType == '07') { //
this.setBigScreenMode();
} else {
this.cancelBigScreenMode();
}
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.mapViewLoadedOver = true;
'$store.state.map.mapViewLoadedCount': function () { //
this.mapViewLoadedOver = true;
this.showSelectStation && this.setShowStation(this.showStation);
this.initMemberUserInfo();
if (this.$route.query.type === 'VR_PSD') {
@ -221,10 +220,9 @@ export default {
this.initLoadData();
});
},
'$store.state.map.map': function (val) {
if (val) {
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
this.setStationList(val);
'$store.state.map.map': function (map) {
if (map) {
this.setStationList(map);
}
},
'$store.state.socket.simulationRoleList':function(val) {
@ -293,7 +291,7 @@ export default {
});
},
setCenter(code) {
this.$refs.mapCanvas.setCenter(code);
this.$jlmap.setCenter(code);
},
//
initLoadData() {
@ -311,7 +309,7 @@ export default {
},
initMemberUserInfo() {
getSimulationMemberList(this.$route.query.group).then(resp => {
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId: this.$store.state.user.id});
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
@ -406,7 +404,7 @@ export default {
}
},
// prdTyperole
setSimulationPrdType(swch) {
setSimulationPrdType(deviceCode) {
// Admin Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP
switch (this.userRole) {
case 'DISPATCHER':
@ -414,11 +412,18 @@ export default {
this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.hideIbp();
this.drivingShow = false;
if ((this.lineCode === '07' || this.lineCode === '06') && deviceCode) {
this.mapViewLoadedOver && this.setShowStation('');
}
break;
case 'STATION_SUPERVISOR':
this.$store.dispatch('training/setPrdType', '01');
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.hideIbp();
if (this.lineCode === '06' && deviceCode) {
this.$refs.menuSchema.chiShowStation = deviceCode;
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
}
this.drivingShow = false;
break;
case 'AUDIENCE':
@ -541,11 +546,11 @@ export default {
}
});
},
switchStationMode(val) {
this.showStation = val;
switchStationMode(stationCode) {
this.showStation = stationCode;
this.setShowStation(this.showStation);
},
setShowStation(val) {
setShowStation(stationCode) {
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
@ -553,14 +558,18 @@ export default {
list = [...list, ...this.$store.state.map.map[item]];
}
});
Vue.prototype.$jlmap.updateShowStation(list, val);
Vue.prototype.$jlmap.setCenter(val);
this.$jlmap.updateShowStation(list, stationCode);
this.$jlmap.setCenter(stationCode);
},
setStationList(val) {
setStationList(map) {
this.stationList = [];
(val.stationList || []).forEach(item => {
(map.stationList || []).forEach(item => {
if (item.centralized) {
this.stationList.push({value: item.code, name: item.name});
this.centralizedStationMap[item.code] = item.code;
item.chargeStationCodeList && item.chargeStationCodeList.length && item.chargeStationCodeList.forEach(ele => {
this.centralizedStationMap[ele] = item.code;
});
}
});
if (this.stationList.length) {
@ -579,13 +588,13 @@ export default {
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.off('zoom');
this.$jlmap.off('zoom'); //
this.$jlmap.setUpdateScreen(size);
}
},
cancelBigScreenMode() {
this.$jlmap.on('zoom');
this.$jlmap.setRevoverBigScreen();
this.$jlmap.on('zoom'); //
this.$jlmap.setRevoverBigScreen(); //
},
handlerMemberManage() {
this.$refs.membersManage.doShow();
@ -599,8 +608,11 @@ export default {
this.$messageBox('您已经被请离房间!');
this.$refs.demonMenu.back();
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
this.userRole = item.type || 'AUDIENCE';
this.setSimulationPrdType();
this.userRole = item.type || 'AUDIENCE';
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
this.$nextTick(() => {
if (item.deviceCode) { this.setCenter(item.deviceCode); }
});
}
});
}

View File

@ -3,18 +3,18 @@
<chat-box :group="group" :user-role="userRole" />
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group>
<el-button v-if="isAdmin" @click="handleEquipment">设备管理</el-button>
<el-button v-if="isAdmin && isProject" @click="handleEquipment">设备管理</el-button>
<el-button v-if="isAdmin" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isDriver && !dataError" type="jumpjlmap3d" @click="jumpjlmap3d">{{ $t('joinTraining.driverPerspective') }}</el-button>
<el-button v-if="isStationSupervisor && !dataError" type="jmap3dcctv" @click="jlmap3dcctv">cctv</el-button>
<el-button v-if="isDriver && !dataError" @click="jumpjlmap3d">{{ $t('joinTraining.driverPerspective') }}</el-button>
<el-button v-if="isStationSupervisor && !dataError" @click="jlmap3dcctv">cctv</el-button>
<template v-if="isAdmin && project != 'refereeJsxt'">
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('joinTraining.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end">{{ $t('joinTraining.initialize') }}</el-button>
</template>
</el-button-group>
<template v-if="project==='jsxt'">
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:'+countdownTime }}</div>
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:' + countdownTime }}</div>
<el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
</template>
@ -88,12 +88,8 @@ export default {
data() {
return {
isDisable: false,
backLoading:false,
backLoading: false,
chatShow: true,
offset: 10,
userId: '',
stationList: [],
stationLists: [],
jsStart: true,
isGoback: false,
noQrcodeList: NoQrcodeList
@ -114,18 +110,12 @@ export default {
},
project() {
return getSessionStorage('project');
}
},
isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design'
}
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.map.stationList': function (val) { //
if (val && val.length) {
this.stationList = val;
this.stationLists = val;
}
},
'$store.state.socket.roleList': function (val) {
if (val && val.length) {
this.$nextTick(() => {
@ -144,7 +134,7 @@ export default {
this.isDisable = val;
},
'$store.state.socket.simulationOver':function(val) {
if (val && this.project === 'refereeJsxt') {
if (val && this.project == 'refereeJsxt') {
this.$router.go(-1);
} else {
if (!this.isGoback) {
@ -154,9 +144,7 @@ export default {
}
},
async mounted() {
this.userId = this.$store.state.user.id;
this.backLoading = false;
await this.initLoadPage();
// this.backLoading = false;
this.isDisable = this.$store.state.map.runPlanStatus;
},
beforeDestroy() {
@ -167,44 +155,10 @@ export default {
}
},
methods: {
async initLoadPage() {
try {
// const resp = await runDiagramIsStart(this.group);
// if (resp && resp.data) {
// this.isDisable = true;
// this.$store.dispatch('training/simulationStart');
// } else {
// this.isDisable = false;
// this.$store.dispatch('training/over');
// }
} catch (error) {
console.log(error);
}
},
setPosition() {
this.$nextTick(() => {
let offset = 10;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
// Admin Instructor Dispatcher Attendant Audience Driver MAINTAINER
addrolesList(list) {
list.forEach(item => {
if (this.userId == item.id) {
if (this.$store.state.user.id == item.id) {
switch (item.userRole) {
case 'INSTRUCTOR':
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'INSTRUCTOR');
@ -255,7 +209,8 @@ export default {
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
},
// 仿
start(model) {
this.isDisable = true;
const data = {
@ -338,12 +293,12 @@ export default {
jlmap3dcctv() {
this.$emit('hidejl3dcctv');
},
formatTime(initTime) {
const hh = prefixIntrger(initTime.getHours(), 2);
const mm = prefixIntrger(initTime.getMinutes(), 2);
const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`;
},
// formatTime(initTime) {
// const hh = prefixIntrger(initTime.getHours(), 2);
// const mm = prefixIntrger(initTime.getMinutes(), 2);
// const ss = prefixIntrger(initTime.getSeconds(), 2);
// return `${hh}:${mm}:${ss}`;
// },
startCompetition() {
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
this.$emit('startCounting');
@ -360,15 +315,16 @@ export default {
}).then(() => {
this.submit();
});
},
},
// 退
refeeEndCompetition() {
refereeExitSimulation(this.group).then(resp => {
// this.$router.go(-1);
this.$router.replace({ path: `/refereeJsxt/home`, query: { raceId:this.$route.query.raceId } });
this.$router.replace({ path: `/refereeJsxt/home`, query: { raceId: this.$route.query.raceId } });
}).catch(()=> {
this.$message.success('退出系统失败');
});
},
},
//
submit() {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
@ -382,15 +338,14 @@ export default {
this.$emit('handlerMemberManage');
},
generateQrCode() {
const self = this;
getSimulationQrcode(this.$route.query.group).then(resp => {
const param = {
url: resp.data,
title: self.$t('综合演练二维码'),
group: self.$route.query.group
title: this.$t('综合演练二维码'),
group: this.$route.query.group
};
if (self.$refs) {
self.$refs.qrCode.doShow(param);
if (this.$refs) {
this.$refs.qrCode.doShow(param);
}
}).catch(() => {
this.$messageBox('仿真生成二维码失败!');

View File

@ -4,12 +4,8 @@
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-button-group>
<template>
<el-button v-if="userRole=== 'DISPATCHER'" size="small" @click="goBigScreen">大屏</el-button>
</template>
<template>
<el-button v-if="runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
</template>
<el-button v-if="userRole=== 'DISPATCHER'" size="small" @click="goBigScreen">大屏</el-button>
<el-button v-if="runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
<template v-if="isAdmin">
<el-button v-if="!runing && !dataError" size="small" type="warning" @click="loadRunPlan">
{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- -->
@ -62,12 +58,6 @@ export default {
return [];
}
},
showStation: {
type: String,
default() {
return '';
}
},
dataError: {
type: Boolean,
default() {
@ -147,9 +137,9 @@ export default {
}
});
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
// initPlannedDriving(isDisable) {
// this.isDisable = isDisable;
// },
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
},
@ -164,10 +154,12 @@ export default {
},
setRuning(run) {
this.runing = run;
},
switchStationMode(val) {
this.$emit('switchStationMode', val);
},
},
//
switchStationMode(stationCode) {
this.$emit('switchStationMode', stationCode);
},
//
goBigScreen() {
const routeData = this.$router.resolve({
path:`/displayBigScreen/${this.$route.query.mapId}`,

View File

@ -122,11 +122,11 @@ export default {
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
clearInterval(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearTimeout(this.checkLine);
clearInterval(this.checkLine);
this.checkLine = null;
}
},

View File

@ -22,7 +22,6 @@
:map-info="mapInfo"
:selected="selected"
:map-saveing="mapSaveing"
@handleSelectPhysicalView="handleSelectPhysicalView"
@saveMapEvent="saveMapEvent"
@verifyMapEvent="verifyMapEvent"
@generateCIEvent="generateCIEvent"
@ -327,7 +326,7 @@ export default {
return device;
},
onSelect(device) {
this.selected = device || null;
this.selected = device || null;
this.selected && this.handleSelectControlPage(device);
},
onContextmenu(em) {

View File

@ -56,14 +56,13 @@
</div>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="formMake" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="formMake"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -72,7 +71,7 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
import { getRouteNewList, getAutoReentryList } from '@/api/jmap/mapdraft';
@ -80,7 +79,7 @@ export default {
name: 'AutoMaticRoute',
components: {
ConfigList,
ConfigData
CreateOperate
},
props: {
selected: {
@ -226,7 +225,7 @@ export default {
const form = {
labelWidth: '150px',
items: [
{ prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, change: true, deviceChange: this.typeChange },
{ prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, deviceChange: this.typeChange },
{ prop: 'name', label: this.$t('map.buttonMainName'), type: 'input' },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
@ -320,8 +319,7 @@ export default {
},
typeChange(type) { //
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.createForm && this.$refs.createForm.resetFields();
this.clearInfo();
this.addModel.type = type;
this.editModel.type = type;
@ -415,28 +413,24 @@ export default {
},
//
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID(this.addModel.type, this.selectLists); // uid
const model = {
_type: this.addModel.type,
code: uid,
name: this.addModel.name,
subtitleName: this.addModel.subtitleName,
show: true,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
optionList: [],
automaticRouteCode: this.addModel.automaticRouteCode, // code
cycleCode: this.addModel.cycleCode, // code
stationCode: this.addModel.stationCode //
};
this.$emit('updateMapModel', model);
this.$refs.make.resetForm();
}
});
const uid = getUID(this.addModel.type, this.selectLists); // uid
const model = {
_type: this.addModel.type,
code: uid,
name: this.addModel.name,
subtitleName: this.addModel.subtitleName,
show: true,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
optionList: [],
automaticRouteCode: this.addModel.automaticRouteCode, // code
cycleCode: this.addModel.cycleCode, // code
stationCode: this.addModel.stationCode //
};
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
},
//
edit() {

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="makeForm" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="makeForm"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -26,14 +25,14 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'ResourceDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -181,26 +180,23 @@ export default {
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('Resource', this.resourceList);
const model = {
_type: 'Resource',
code: uid,
name: uid,
width: this.addModel.width,
rotate: 0,
zIndex: 5,
height: this.addModel.height,
url: this.addModel.url,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
};
this.$emit('updateMapModel', model);
const uid = getUID('Resource', this.resourceList);
const model = {
_type: 'Resource',
code: uid,
name: uid,
width: this.addModel.width,
rotate: 0,
zIndex: 5,
height: this.addModel.height,
url: this.addModel.url,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
});
};
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="createForm" :form="createForm" :form-model="addModel" :rules="makeRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="makeRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -28,14 +27,14 @@ import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'StationStandDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -169,23 +168,19 @@ export default {
};
},
create() {
this.$refs['createForm'].validate((valid) => {
if (valid) {
const model = {
_type: 'Arrow',
code: getUID('Arrow', this.arrowList),
length: this.addModel.length,
lineWidth: this.addModel.lineWidth,
showConditions: this.addModel.showConditions,
color: this.addModel.color,
position: this.addModel.position,
triangleHeight: this.addModel.triangleHeight,
triangleLength: this.addModel.triangleLength
};
this.$emit('updateMapModel', model);
this.clear();
}
});
const model = {
_type: 'Arrow',
code: getUID('Arrow', this.arrowList),
length: this.addModel.length,
lineWidth: this.addModel.lineWidth,
showConditions: this.addModel.showConditions,
color: this.addModel.color,
position: this.addModel.position,
triangleHeight: this.addModel.triangleHeight,
triangleLength: this.addModel.triangleLength
};
this.$emit('updateMapModel', model);
this.clear();
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -0,0 +1,50 @@
<template>
<div style="height:100%">
<div class="view-control-content">
<config-data ref="createForm" :form="createForm" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import ConfigData from '../config/data';
export default {
name:'CreateOperate',
components: {
ConfigData
},
props:{
createForm:{
type:Object,
required:true
},
addModel:{
type:Object,
required:true
},
createRules:{
type:Object,
required:true
}
},
methods:{
create() {
this.$refs['createForm'].validate((valid) => {
if (valid) {
this.$emit('create');
}
});
},
resetFields() {
this.$refs.createForm && this.$refs.createForm.resetFields();
},
resetForm() {
this.$refs.createForm.resetForm();
}
}
};
</script>

View File

@ -10,7 +10,7 @@
:multiple="checkFieldType(item,['multiSelect'])"
:placeholder="item.placeholder"
:disabled="item.disabled"
@change="item.deviceChange||deviceChange"
@change="((val)=>{deviceChange(val, item)})"
>
<el-option
v-for="option in item.options"
@ -185,8 +185,10 @@ export default {
return option.label;
}
},
deviceChange() {
deviceChange(data, item) {
if (item.deviceChange) {
item.deviceChange(data);
}
},
decompose(item, prop) {
if (!prop.includes('.')) {

View File

@ -23,7 +23,7 @@
<component
:is="each.menus"
:ref="each.name"
:selected="selected"
:selected="selected"
v-bind="$attrs"
v-on="$listeners"
@deviceSelect="deviceSelect"
@ -190,9 +190,6 @@ export default {
deviceSelect(type) {
this.selectDevice = type;
},
handleSelectPhysicalView(handle) {
this.$emit('handleSelectPhysicalView', handle);
},
saveMapEvent() {
this.$emit('saveMapEvent');
},

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="createForm" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -26,14 +25,14 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'LcControlDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -158,21 +157,18 @@ export default {
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('LcControl', this.lcList);
const model = {
_type: 'LcControl',
code: uid,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
};
this.$emit('updateMapModel', model);
const uid = getUID('LcControl', this.lcList);
const model = {
_type: 'LcControl',
code: uid,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
});
};
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="createForm" :form-model="addModel" :rules="makeRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="makeRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -28,14 +27,14 @@ import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'StationStandDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -181,27 +180,22 @@ export default {
this.addModel.points.splice(index, 1);
},
create() {
this.$refs['make'].validate((valid) => {
if (valid) {
if (JSON.stringify(this.addModel.points[0]) !== JSON.stringify(this.addModel.points[this.addModel.points.length - 1])) {
const pointArr = JSON.stringify(this.addModel.points);
const model = {
_type: 'Line',
code: getUID('Line', this.lineList),
type: this.addModel.type,
width: this.addModel.width,
showConditions: this.addModel.showConditions,
lineColor: this.addModel.lineColor,
points: JSON.parse(pointArr)
};
this.$emit('updateMapModel', model);
this.$refs.make && this.$refs.make.resetFields();
} else {
this.$message.console.error(this.$t('tip.cannotCoincide'));
}
}
});
if (JSON.stringify(this.addModel.points[0]) !== JSON.stringify(this.addModel.points[this.addModel.points.length - 1])) {
const pointArr = JSON.stringify(this.addModel.points);
const model = {
_type: 'Line',
code: getUID('Line', this.lineList),
type: this.addModel.type,
width: this.addModel.width,
showConditions: this.addModel.showConditions,
lineColor: this.addModel.lineColor,
points: JSON.parse(pointArr)
};
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
} else {
this.$message.console.error(this.$t('tip.cannotCoincide'));
}
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="createForm" :form-model="addModel" :rules="makeRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="makeRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -28,14 +27,14 @@ import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'StationStandDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -169,27 +168,23 @@ export default {
this.addModel.points.splice(index, 1);
},
create() {
this.$refs['make'].validate((valid) => {
if (valid) {
if (JSON.stringify(this.addModel.points[0]) !== JSON.stringify(this.addModel.points[this.addModel.points.length - 1])) {
const pointArr = JSON.stringify(this.addModel.points);
const model = {
_type: 'Power',
code: getUID('Power', this.powerLineList),
width: this.addModel.width,
leftTerminal: true,
rightTerminal: true,
showConditions: this.addModel.showConditions,
points: JSON.parse(pointArr)
};
this.$emit('updateMapModel', model);
this.$refs.make && this.$refs.make.resetFields();
} else {
this.$message.console.error(this.$t('tip.cannotCoincide'));
if (JSON.stringify(this.addModel.points[0]) !== JSON.stringify(this.addModel.points[this.addModel.points.length - 1])) {
const pointArr = JSON.stringify(this.addModel.points);
const model = {
_type: 'Power',
code: getUID('Power', this.powerLineList),
width: this.addModel.width,
leftTerminal: true,
rightTerminal: true,
showConditions: this.addModel.showConditions,
points: JSON.parse(pointArr)
};
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
} else {
this.$message.console.error(this.$t('tip.cannotCoincide'));
}
}
});
}
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="createForm" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.batchSettings')" name="three" :lazy="lazy">
<el-form ref="oprt" :model="allModel" label-width="130px" size="mini">
@ -41,14 +40,14 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'PsdDraft',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -208,28 +207,25 @@ export default {
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('Psd', this.psdList);
const model = {
_type: 'Psd',
code: uid,
name: `Psd${this.psdList.length + 1}`,
width: this.addModel.width,
height: this.addModel.height,
standCode: this.addModel.standCode // code
};
this.stationStandList.forEach(elem => {
if (elem.code === this.addModel.standCode) {
model.position = { x: elem.position.x, y: elem.position.y - (elem.height / 2) - 8 };
if (this.addModel.doorLocationType == '01') { //
model.position = { x: elem.position.x, y: elem.position.y + (elem.height / 2) + 8 };
}
}
});
this.$emit('updateMapModel', model);
const uid = getUID('Psd', this.psdList);
const model = {
_type: 'Psd',
code: uid,
name: `Psd${this.psdList.length + 1}`,
width: this.addModel.width,
height: this.addModel.height,
standCode: this.addModel.standCode // code
};
this.stationStandList.forEach(elem => {
if (elem.code === this.addModel.standCode) {
model.position = { x: elem.position.x, y: elem.position.y - (elem.height / 2) - 8 };
if (this.addModel.doorLocationType == '01') { //
model.position = { x: elem.position.x, y: elem.position.y + (elem.height / 2) + 8 };
}
}
});
this.$emit('updateMapModel', model);
this.$refs.createForm.resetForm();
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -10,14 +10,13 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="formMake" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="formMake"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -26,13 +25,13 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'SplitStation',
components: {
OperateProperty,
ConfigData
CreateOperate
},
props: {
selected: {
@ -139,26 +138,22 @@ export default {
},
//
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID(this.addModel.type, this.splitStationList); // uid
const models = [];
const model = {
_type: this.addModel.type,
type: this.addModel.type,
code: uid,
rightStationName: this.addModel.rightStationName,
leftStationName: this.addModel.leftStationName,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
};
models.push(model);
this.$emit('updateMapModel', models);
this.$refs.make.resetForm();
const uid = getUID(this.addModel.type, this.splitStationList); // uid
const models = [];
const model = {
_type: this.addModel.type,
type: this.addModel.type,
code: uid,
rightStationName: this.addModel.rightStationName,
leftStationName: this.addModel.leftStationName,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
});
};
models.push(model);
this.$emit('updateMapModel', models);
this.$refs.createForm.resetForm();
},
updateMapModel(data) {
this.$emit('updateMapModel', data);

View File

@ -12,14 +12,13 @@
</div>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="createForm" :form-model="addModel" :rules="makeRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="makeRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -30,14 +29,14 @@ import Cookies from 'js-cookie';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'StationStandDraft',
components: {
ConfigList,
ConfigData
CreateOperate
},
props: {
selected: {
@ -176,22 +175,19 @@ export default {
}
},
create() {
this.$refs['make'].validate((valid) => {
if (valid) {
const model = {
_type: 'Text',
code: getUID('Text', this.textList),
font: '14',
fontColor: '#FFFFFF',
content: `${this.addModel.prepend}::${this.addModel.content}`,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
};
this.$emit('updateMapModel', model);
const model = {
_type: 'Text',
code: getUID('Text', this.textList),
font: '14',
fontColor: '#FFFFFF',
content: `${this.addModel.prepend}::${this.addModel.content}`,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
});
};
this.$refs.createForm.resetForm();
this.$emit('updateMapModel', model);
},
//
edit() {

View File

@ -12,14 +12,13 @@
</div>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content">
<config-data ref="make" :form="formMake" :form-model="addModel" :rules="createRules" />
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
<create-operate
ref="createForm"
:create-form="formMake"
:add-model="addModel"
:create-rules="createRules"
@create="create"
/>
</el-tab-pane>
</el-tabs>
</template>
@ -28,14 +27,14 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import ConfigData from './config/data';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
export default {
name: 'ZcControlDraft',
components: {
ConfigList,
ConfigData
CreateOperate
},
props: {
selected: {
@ -198,30 +197,26 @@ export default {
});
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('ZcControl', this.zcList);
let models = [];
const model = {
_type: 'ZcControl',
code: uid,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
concentrateStationList:this.addModel.concentrateStationList
};
models.push(model);
model.concentrateStationList.forEach(stationCode=>{
const arr = this.setStationStand(stationCode, model.code);
models = [...models, ...arr];
});
this.$emit('updateMapModel', models);
this.getConcertrateStation();
this.$refs.make.resetForm();
}
const uid = getUID('ZcControl', this.zcList);
let models = [];
const model = {
_type: 'ZcControl',
code: uid,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
concentrateStationList:this.addModel.concentrateStationList
};
models.push(model);
model.concentrateStationList.forEach(stationCode=>{
const arr = this.setStationStand(stationCode, model.code);
models = [...models, ...arr];
});
this.$emit('updateMapModel', models);
this.getConcertrateStation();
this.$refs.createForm.resetForm();
},
//
edit() {

View File

@ -111,6 +111,7 @@ export default {
break;
}
data = data.parent;
if (!data) { break; }
}
if ( obj.type === 'Map') {
this.mapId = obj.id;
@ -181,6 +182,8 @@ export default {
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
checkId && this.findTree(this.treeList, checkId);
!checkId && this.treeList && this.treeList.length && this.clickEvent(this.treeList[0], {data: this.treeList[0]});
this.loading = false;
});
} catch (error) {
@ -188,6 +191,19 @@ export default {
this.$message.error(this.$t('error.refreshFailed'));
}
},
/* 根据localstorage缓存的trainingPlatformCheckId跳转右侧显示页面 */
findTree(treeList, checkId, data) {
treeList && treeList.length && treeList.forEach(item =>{
if (item.type === 'Map') {
data = item;
}
if (checkId === item.key) {
this.clickEvent(item, {data: data});
} else {
this.findTree(item.children, checkId, data);
}
});
},
nodeExpand(obj, node, ele) {
const key = obj.id + obj.type;
this.expandList = this.expandList.filter(item => item !== key);
@ -200,6 +216,7 @@ export default {
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
},
getExpandList(filterSelect) {
this.expandList = [];
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project);
expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) {