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', // 区段保护锁闭 protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁 protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用) logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用) logicalTextColor: '#C0C0C0', // 逻辑区段名称颜色 (未用)
invalidColor: '#A0522D' // 计轴故障
}, },
axle: {}, // 计轴 axle: {}, // 计轴
speedLimit: { // 限速元素 speedLimit: { // 限速元素

View File

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

View File

@ -5,16 +5,12 @@ class ETrainDepart extends Group {
constructor(model) { constructor(model) {
super(); super();
this.model = model; this.model = model;
this.isNew = false; this.create();
this.timeStart = 30;
this.time = null;
} }
create(text) { create() {
if (!this.isNew) {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;
this.isNew = true;
this.trainDepart = new Text({ this.trainDepart = new Text({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
@ -22,7 +18,7 @@ class ETrainDepart extends Group {
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
text: text, text: '000',
textAlign: style.textStyle.textAlign, textAlign: style.textStyle.textAlign,
fontSize: style.StationStand.trainDepart.fontSize, fontSize: style.StationStand.trainDepart.fontSize,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
@ -35,7 +31,6 @@ class ETrainDepart extends Group {
}); });
this.add(this.trainDepart); this.add(this.trainDepart);
} }
}
setColor(color) { setColor(color) {
this.create(); this.create();
@ -44,31 +39,17 @@ class ETrainDepart extends Group {
hideMode() { hideMode() {
this.trainDepart && this.trainDepart.hide(); this.trainDepart && this.trainDepart.hide();
this.time && clearInterval(this.time);
} }
showMode() { showMode(remainTime) {
this.timeStart = 30; if (remainTime < 10) {
this.create(`0${this.timeStart}`); remainTime = '00' + remainTime;
} else {
remainTime = '0' + remainTime;
}
this.trainDepart.setStyle('text', remainTime);
this.trainDepart.show(); 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); this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor);
} else { } else {
this.trainStop && this.trainStop.showMode(); 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: [], centralizedStationList1: [],
centralizedStationList2: [], centralizedStationList2: [],
colsNum: 0, colsNum: 0,
version: '' version: '',
centralizedMap: {}
}; };
}, },
computed: { computed: {
@ -115,7 +116,10 @@ export default {
]), ]),
...mapGetters('map', [ ...mapGetters('map', [
'stationList' 'stationList'
]) ]),
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
}
}, },
watch: { watch: {
tempClassA() { tempClassA() {
@ -143,11 +147,23 @@ export default {
if (code) { if (code) {
this.stationCode = code; this.stationCode = code;
} }
},
'$store.state.socket.simulationRoleList':function(val) {
if (val && val.length) {
this.checkRoleChange(val);
}
} }
}, },
mounted() { mounted() {
this.version = this.$store.state.map.version; this.version = this.$store.state.map.version;
this.initMenu(); 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: { methods: {
initMenu() { initMenu() {
@ -158,6 +174,10 @@ export default {
this.stationList.forEach(item => { this.stationList.forEach(item => {
if (item.centralized) { if (item.centralized) {
centralizedStationList.push(item); 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) => { centralizedStationList.forEach((item, index) => {

View File

@ -224,6 +224,10 @@ export default {
{ {
label: '越红灯行驶', label: '越红灯行驶',
handler: this.handleOverEedLight handler: this.handleOverEedLight
},
{
label: '开/关门',
handler: this.handleOpenCloseDoor
} }
], ],
menuSpeed: [ menuSpeed: [
@ -350,6 +354,19 @@ export default {
params: {} params: {}
}; };
commitTrainSend(group, param).then(({valid, operate})=>{ 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) => { }).catch((error) => {
this.$refs.noticeInfo.doShow(error.message); this.$refs.noticeInfo.doShow(error.message);
}); });

View File

@ -308,8 +308,8 @@ export default {
jump() { jump() {
this.disabled = true; this.disabled = true;
setTimeout(() => { setTimeout(() => {
if (!this.drawWay) {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType }; const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
if (!this.drawWay) {
simulationNotify(data).then(resp => { 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 }; 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 }); this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
@ -319,9 +319,9 @@ export default {
this.disabled = false; this.disabled = false;
}); });
} else { } else {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => { 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 }); this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {

View File

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

View File

@ -1,13 +1,6 @@
<template> <template>
<div style="height: 100%; overflow-y: auto;"> <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;" /> <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"> <div class="draft">
<el-button-group> <el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button> <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 { getPublishMapListOnline } from '@/api/jmap/map';
import { getCmdList } from '@/api/management/dictionary'; import { getCmdList } from '@/api/management/dictionary';
import { UrlConfig } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic';
// import TrainingDraft from './draft';
import localStore from 'storejs'; import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'TrainingGeneration', name: 'TrainingGeneration',
components: { components: {
// TrainingDraft
}, },
data() { data() {
return { return {
@ -138,18 +129,11 @@ export default {
handleClick: this.demoDisplay, handleClick: this.demoDisplay,
type: '' type: ''
} }
/* {
name: this.$t('lesson.trainingRecord'),
handleClick: this.trainingRecord,
type: ''
}*/
] ]
} }
], ],
actions: [ actions: [
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging } { 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 { getAllSimulationList, postSimulationConnectById, putSimulationDisconnectById } from '@/api/simulation.js';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
export default { export default {
name: 'Equipment', name: 'Equipment',
@ -64,6 +65,11 @@ export default {
} }
}; };
}, },
computed: {
project() {
return getSessionStorage('project');
}
},
mounted() { mounted() {
EventBus.$on('selectDevice', (data) => { EventBus.$on('selectDevice', (data) => {
this.selected = data; this.selected = data;
@ -85,20 +91,26 @@ export default {
async getList() { async getList() {
try { try {
const res = await getAllSimulationList(this.group); const res = await getAllSimulationList(this.group);
this.tableData = [].concat(res.data); this.tableData = [];
this.tableData.forEach((item, index) => { res.data.forEach((item, index) => {
if (item.type == 'PLC_GATEWAY') { if (item.type == 'PLC_GATEWAY') {
this.plcInfo = { this.plcInfo = {
name: 'PLC网关', name: 'PLC网关',
status: item.online status: item.online
}; };
this.tableData.splice(index, 1);
} else { } else {
item.buttonShowType = false; item.buttonShowType = false;
item.typeName = this.typeList.find(el => el.value == item.type).label; item.typeName = this.typeList.find(el => el.value == item.type).label;
if (item.vrDeviceCode) { if (item.vrDeviceCode) {
item.vrDeviceName = this.$store.getters['map/getDeviceByCode'](item.vrDeviceCode).name; 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) { } catch (error) {

View File

@ -36,14 +36,11 @@ export default {
userRole: { userRole: {
type: String, type: String,
required: true required: true
},
offsetBottom:{
type: Number,
required: true
} }
}, },
data() { data() {
return { return {
offsetBottom:15,
scriptTip:'', scriptTip:'',
isHasCoversition:false, isHasCoversition:false,
conversitionId:'', conversitionId:'',
@ -67,7 +64,14 @@ export default {
} }
}, },
watch:{ 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 => { getSimulationMemberList(this.group).then(resp => {
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <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'}"> <div class="display-card" :style="{top: offset+'px'}">
<el-row> <el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span> <span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>

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

View File

@ -446,7 +446,7 @@ export default {
this.$jlmap.updateShowMode(list, showMode); this.$jlmap.updateShowMode(list, showMode);
EventBus.$emit('select_DrawType', showMode); EventBus.$emit('select_DrawType', showMode);
}, },
setShowStation(stationCode, isTraining) { setShowStation(stationCode, setCenter) {
const nameList = Object.keys(this.$store.state.map.map); const nameList = Object.keys(this.$store.state.map.map);
let list = []; let list = [];
nameList.forEach(item => { nameList.forEach(item => {
@ -461,7 +461,7 @@ export default {
} }
}); });
this.$jlmap.updateShowStation(list, stationCode); this.$jlmap.updateShowStation(list, stationCode);
!isTraining && this.setCenter(stationCode); !setCenter && this.setCenter(stationCode);
}, },
setOffset(data, num, sum) { setOffset(data, num, sum) {
this.$jlmap.switchScreen(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 { EventBus } from '@/scripts/event-bus';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
import Vue from 'vue'; // import Vue from 'vue';
import localStore from 'storejs'; import localStore from 'storejs';
import MembersManage from './memberManage/membersManage'; import MembersManage from './memberManage/membersManage';
import AddMember from './memberManage/addMember'; import AddMember from './memberManage/addMember';
@ -124,7 +124,7 @@ export default {
ibpPart: '', ibpPart: '',
showStation: '', showStation: '',
stationList: [], stationList: [],
showSelectStation: false, showSelectStation: false, // 线
mapViewLoadedOver: false, mapViewLoadedOver: false,
dataError: false, dataError: false,
countdownTime: '00:00:00', countdownTime: '00:00:00',
@ -133,7 +133,8 @@ export default {
questionList: [], questionList: [],
practicalExamTime: 0, practicalExamTime: 0,
isAdmin: false, isAdmin: false,
deviceShow: false deviceShow: false,
centralizedStationMap: {}
}; };
}, },
computed: { computed: {
@ -172,23 +173,21 @@ export default {
'$store.state.config.menuBarLoadedCount': function (val) { '$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition(); this.setPosition();
}, },
'$store.state.training.prdType': function (val) { '$store.state.training.prdType': function (prdType) {
this.setPosition(); this.setPosition();
if (val == '01' && this.$route.query.lineCode == '06') { if (prdType == '01' && this.$route.query.lineCode == '06') {
this.showSelectStation = true; this.showSelectStation = true;
this.mapViewLoadedOver && this.setShowStation(this.showStation);
this.cancelBigScreenMode(); this.cancelBigScreenMode();
} else if (val == '02' && this.$route.query.lineCode == '06') { } else if (prdType == '02' && this.$route.query.lineCode == '06') {
this.showSelectStation = false; this.showSelectStation = false;
this.mapViewLoadedOver && this.setShowStation('');
this.cancelBigScreenMode(); this.cancelBigScreenMode();
} else if (val == '07') { // } else if (prdType == '07') { //
this.setBigScreenMode(); this.setBigScreenMode();
} else { } else {
this.cancelBigScreenMode(); this.cancelBigScreenMode();
} }
}, },
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function () { //
this.mapViewLoadedOver = true; this.mapViewLoadedOver = true;
this.showSelectStation && this.setShowStation(this.showStation); this.showSelectStation && this.setShowStation(this.showStation);
this.initMemberUserInfo(); this.initMemberUserInfo();
@ -221,10 +220,9 @@ export default {
this.initLoadData(); this.initLoadData();
}); });
}, },
'$store.state.map.map': function (val) { '$store.state.map.map': function (map) {
if (val) { if (map) {
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01'; this.setStationList(map);
this.setStationList(val);
} }
}, },
'$store.state.socket.simulationRoleList':function(val) { '$store.state.socket.simulationRoleList':function(val) {
@ -293,7 +291,7 @@ export default {
}); });
}, },
setCenter(code) { setCenter(code) {
this.$refs.mapCanvas.setCenter(code); this.$jlmap.setCenter(code);
}, },
// //
initLoadData() { initLoadData() {
@ -311,7 +309,7 @@ export default {
}, },
initMemberUserInfo() { initMemberUserInfo() {
getSimulationMemberList(this.$route.query.group).then(resp => { 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(() => { }).catch(() => {
this.$messageBox('获取仿真成员列表失败!'); this.$messageBox('获取仿真成员列表失败!');
}); });
@ -406,7 +404,7 @@ export default {
} }
}, },
// prdTyperole // prdTyperole
setSimulationPrdType(swch) { setSimulationPrdType(deviceCode) {
// Admin Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP // Admin Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP
switch (this.userRole) { switch (this.userRole) {
case 'DISPATCHER': case 'DISPATCHER':
@ -414,11 +412,18 @@ export default {
this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.hideIbp(); this.hideIbp();
this.drivingShow = false; this.drivingShow = false;
if ((this.lineCode === '07' || this.lineCode === '06') && deviceCode) {
this.mapViewLoadedOver && this.setShowStation('');
}
break; break;
case 'STATION_SUPERVISOR': case 'STATION_SUPERVISOR':
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setPrdType', '01');
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.hideIbp(); this.hideIbp();
if (this.lineCode === '06' && deviceCode) {
this.$refs.menuSchema.chiShowStation = deviceCode;
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
}
this.drivingShow = false; this.drivingShow = false;
break; break;
case 'AUDIENCE': case 'AUDIENCE':
@ -541,11 +546,11 @@ export default {
} }
}); });
}, },
switchStationMode(val) { switchStationMode(stationCode) {
this.showStation = val; this.showStation = stationCode;
this.setShowStation(this.showStation); this.setShowStation(this.showStation);
}, },
setShowStation(val) { setShowStation(stationCode) {
const nameList = Object.keys(this.$store.state.map.map); const nameList = Object.keys(this.$store.state.map.map);
let list = []; let list = [];
nameList.forEach(item => { nameList.forEach(item => {
@ -553,14 +558,18 @@ export default {
list = [...list, ...this.$store.state.map.map[item]]; list = [...list, ...this.$store.state.map.map[item]];
} }
}); });
Vue.prototype.$jlmap.updateShowStation(list, val); this.$jlmap.updateShowStation(list, stationCode);
Vue.prototype.$jlmap.setCenter(val); this.$jlmap.setCenter(stationCode);
}, },
setStationList(val) { setStationList(map) {
this.stationList = []; this.stationList = [];
(val.stationList || []).forEach(item => { (map.stationList || []).forEach(item => {
if (item.centralized) { if (item.centralized) {
this.stationList.push({value: item.code, name: item.name}); 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) { if (this.stationList.length) {
@ -579,13 +588,13 @@ export default {
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position), list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList offsetList: offsetList
}; };
this.$jlmap.off('zoom'); this.$jlmap.off('zoom'); //
this.$jlmap.setUpdateScreen(size); this.$jlmap.setUpdateScreen(size);
} }
}, },
cancelBigScreenMode() { cancelBigScreenMode() {
this.$jlmap.on('zoom'); this.$jlmap.on('zoom'); //
this.$jlmap.setRevoverBigScreen(); this.$jlmap.setRevoverBigScreen(); //
}, },
handlerMemberManage() { handlerMemberManage() {
this.$refs.membersManage.doShow(); this.$refs.membersManage.doShow();
@ -600,7 +609,10 @@ export default {
this.$refs.demonMenu.back(); this.$refs.demonMenu.back();
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) { } else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
this.userRole = item.type || 'AUDIENCE'; this.userRole = item.type || 'AUDIENCE';
this.setSimulationPrdType(); 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" /> <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'}"> <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-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" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" @click="generateQrCode">生成二维码</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="isDriver && !dataError" @click="jumpjlmap3d">{{ $t('joinTraining.driverPerspective') }}</el-button>
<el-button v-if="isStationSupervisor && !dataError" type="jmap3dcctv" @click="jlmap3dcctv">cctv</el-button> <el-button v-if="isStationSupervisor && !dataError" @click="jlmap3dcctv">cctv</el-button>
<template v-if="isAdmin && project != 'refereeJsxt'"> <template v-if="isAdmin && project != 'refereeJsxt'">
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('joinTraining.drivingByPlan') }}</el-button> <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> <el-button type="danger" :disabled="dataError" @click="end">{{ $t('joinTraining.initialize') }}</el-button>
</template> </template>
</el-button-group> </el-button-group>
<template v-if="project==='jsxt'"> <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="success" @click="startCompetition">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button> <el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
</template> </template>
@ -88,12 +88,8 @@ export default {
data() { data() {
return { return {
isDisable: false, isDisable: false,
backLoading:false, backLoading: false,
chatShow: true, chatShow: true,
offset: 10,
userId: '',
stationList: [],
stationLists: [],
jsStart: true, jsStart: true,
isGoback: false, isGoback: false,
noQrcodeList: NoQrcodeList noQrcodeList: NoQrcodeList
@ -114,18 +110,12 @@ export default {
}, },
project() { project() {
return getSessionStorage('project'); return getSessionStorage('project');
},
isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design'
} }
}, },
watch: { 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) { '$store.state.socket.roleList': function (val) {
if (val && val.length) { if (val && val.length) {
this.$nextTick(() => { this.$nextTick(() => {
@ -144,7 +134,7 @@ export default {
this.isDisable = val; this.isDisable = val;
}, },
'$store.state.socket.simulationOver':function(val) { '$store.state.socket.simulationOver':function(val) {
if (val && this.project === 'refereeJsxt') { if (val && this.project == 'refereeJsxt') {
this.$router.go(-1); this.$router.go(-1);
} else { } else {
if (!this.isGoback) { if (!this.isGoback) {
@ -154,9 +144,7 @@ export default {
} }
}, },
async mounted() { async mounted() {
this.userId = this.$store.state.user.id; // this.backLoading = false;
this.backLoading = false;
await this.initLoadPage();
this.isDisable = this.$store.state.map.runPlanStatus; this.isDisable = this.$store.state.map.runPlanStatus;
}, },
beforeDestroy() { beforeDestroy() {
@ -167,44 +155,10 @@ export default {
} }
}, },
methods: { 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 // Admin Instructor Dispatcher Attendant Audience Driver MAINTAINER
addrolesList(list) { addrolesList(list) {
list.forEach(item => { list.forEach(item => {
if (this.userId == item.id) { if (this.$store.state.user.id == item.id) {
switch (item.userRole) { switch (item.userRole) {
case 'INSTRUCTOR': case 'INSTRUCTOR':
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'INSTRUCTOR'); this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'INSTRUCTOR');
@ -256,6 +210,7 @@ export default {
selectBeginTime() { selectBeginTime() {
this.$refs.setTime.doShow(); this.$refs.setTime.doShow();
}, },
// 仿
start(model) { start(model) {
this.isDisable = true; this.isDisable = true;
const data = { const data = {
@ -338,12 +293,12 @@ export default {
jlmap3dcctv() { jlmap3dcctv() {
this.$emit('hidejl3dcctv'); this.$emit('hidejl3dcctv');
}, },
formatTime(initTime) { // formatTime(initTime) {
const hh = prefixIntrger(initTime.getHours(), 2); // const hh = prefixIntrger(initTime.getHours(), 2);
const mm = prefixIntrger(initTime.getMinutes(), 2); // const mm = prefixIntrger(initTime.getMinutes(), 2);
const ss = prefixIntrger(initTime.getSeconds(), 2); // const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`; // return `${hh}:${mm}:${ss}`;
}, // },
startCompetition() { startCompetition() {
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => { startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
this.$emit('startCounting'); this.$emit('startCounting');
@ -361,14 +316,15 @@ export default {
this.submit(); this.submit();
}); });
}, },
// 退
refeeEndCompetition() { refeeEndCompetition() {
refereeExitSimulation(this.group).then(resp => { 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(()=> { }).catch(()=> {
this.$message.success('退出系统失败'); this.$message.success('退出系统失败');
}); });
}, },
//
submit() { submit() {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => { submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
@ -382,15 +338,14 @@ export default {
this.$emit('handlerMemberManage'); this.$emit('handlerMemberManage');
}, },
generateQrCode() { generateQrCode() {
const self = this;
getSimulationQrcode(this.$route.query.group).then(resp => { getSimulationQrcode(this.$route.query.group).then(resp => {
const param = { const param = {
url: resp.data, url: resp.data,
title: self.$t('综合演练二维码'), title: this.$t('综合演练二维码'),
group: self.$route.query.group group: this.$route.query.group
}; };
if (self.$refs) { if (this.$refs) {
self.$refs.qrCode.doShow(param); this.$refs.qrCode.doShow(param);
} }
}).catch(() => { }).catch(() => {
this.$messageBox('仿真生成二维码失败!'); 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-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
<el-button-group> <el-button-group>
<template>
<el-button v-if="userRole=== 'DISPATCHER'" size="small" @click="goBigScreen">大屏</el-button> <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> <el-button v-if="runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
</template>
<template v-if="isAdmin"> <template v-if="isAdmin">
<el-button v-if="!runing && !dataError" size="small" type="warning" @click="loadRunPlan"> <el-button v-if="!runing && !dataError" size="small" type="warning" @click="loadRunPlan">
{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- --> {{ $t('joinTraining.runGraphLoading') }}</el-button><!-- -->
@ -62,12 +58,6 @@ export default {
return []; return [];
} }
}, },
showStation: {
type: String,
default() {
return '';
}
},
dataError: { dataError: {
type: Boolean, type: Boolean,
default() { default() {
@ -147,9 +137,9 @@ export default {
} }
}); });
}, },
initPlannedDriving(isDisable) { // initPlannedDriving(isDisable) {
this.isDisable = isDisable; // this.isDisable = isDisable;
}, // },
changeOperateMode(handle) { changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle }); this.$store.dispatch('training/changeOperateMode', { mode: handle });
}, },
@ -165,9 +155,11 @@ export default {
setRuning(run) { setRuning(run) {
this.runing = run; this.runing = run;
}, },
switchStationMode(val) { //
this.$emit('switchStationMode', val); switchStationMode(stationCode) {
this.$emit('switchStationMode', stationCode);
}, },
//
goBigScreen() { goBigScreen() {
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
path:`/displayBigScreen/${this.$route.query.mapId}`, path:`/displayBigScreen/${this.$route.query.mapId}`,

View File

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

View File

@ -22,7 +22,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
:map-saveing="mapSaveing" :map-saveing="mapSaveing"
@handleSelectPhysicalView="handleSelectPhysicalView"
@saveMapEvent="saveMapEvent" @saveMapEvent="saveMapEvent"
@verifyMapEvent="verifyMapEvent" @verifyMapEvent="verifyMapEvent"
@generateCIEvent="generateCIEvent" @generateCIEvent="generateCIEvent"

View File

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

View File

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

View File

@ -10,14 +10,13 @@
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy"> <el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<div class="view-control-content"> <create-operate
<config-data ref="createForm" :form="createForm" :form-model="addModel" :rules="makeRules" /> ref="createForm"
</div> :create-form="createForm"
<div class="button_box"> :add-model="addModel"
<el-button-group class="map-draft-group"> :create-rules="makeRules"
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button> @create="create"
</el-button-group> />
</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
@ -28,14 +27,14 @@ import Cookies from 'js-cookie';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid'; import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty'; import OperateProperty from './components/operateProperty';
import ConfigData from './config/data'; import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
export default { export default {
name: 'StationStandDraft', name: 'StationStandDraft',
components: { components: {
OperateProperty, OperateProperty,
ConfigData CreateOperate
}, },
props: { props: {
selected: { selected: {
@ -169,8 +168,6 @@ export default {
}; };
}, },
create() { create() {
this.$refs['createForm'].validate((valid) => {
if (valid) {
const model = { const model = {
_type: 'Arrow', _type: 'Arrow',
code: getUID('Arrow', this.arrowList), code: getUID('Arrow', this.arrowList),
@ -184,8 +181,6 @@ export default {
}; };
this.$emit('updateMapModel', model); this.$emit('updateMapModel', model);
this.clear(); this.clear();
}
});
}, },
updateMapModel(data) { updateMapModel(data) {
this.$emit('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'])" :multiple="checkFieldType(item,['multiSelect'])"
:placeholder="item.placeholder" :placeholder="item.placeholder"
:disabled="item.disabled" :disabled="item.disabled"
@change="item.deviceChange||deviceChange" @change="((val)=>{deviceChange(val, item)})"
> >
<el-option <el-option
v-for="option in item.options" v-for="option in item.options"
@ -185,8 +185,10 @@ export default {
return option.label; return option.label;
} }
}, },
deviceChange() { deviceChange(data, item) {
if (item.deviceChange) {
item.deviceChange(data);
}
}, },
decompose(item, prop) { decompose(item, prop) {
if (!prop.includes('.')) { if (!prop.includes('.')) {

View File

@ -190,9 +190,6 @@ export default {
deviceSelect(type) { deviceSelect(type) {
this.selectDevice = type; this.selectDevice = type;
}, },
handleSelectPhysicalView(handle) {
this.$emit('handleSelectPhysicalView', handle);
},
saveMapEvent() { saveMapEvent() {
this.$emit('saveMapEvent'); this.$emit('saveMapEvent');
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -111,6 +111,7 @@ export default {
break; break;
} }
data = data.parent; data = data.parent;
if (!data) { break; }
} }
if ( obj.type === 'Map') { if ( obj.type === 'Map') {
this.mapId = obj.id; this.mapId = obj.id;
@ -181,6 +182,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null; const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId); 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; this.loading = false;
}); });
} catch (error) { } catch (error) {
@ -188,6 +191,19 @@ export default {
this.$message.error(this.$t('error.refreshFailed')); 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) { nodeExpand(obj, node, ele) {
const key = obj.id + obj.type; const key = obj.id + obj.type;
this.expandList = this.expandList.filter(item => item !== key); 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); localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
}, },
getExpandList(filterSelect) { getExpandList(filterSelect) {
this.expandList = [];
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project); let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project);
expand = expand ? (expand + '').split(',') : ''; expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) { if (expand instanceof Array) {