调整判断

This commit is contained in:
zyy 2020-07-24 11:01:22 +08:00
parent 5d413dba8c
commit fe08980f2f
6 changed files with 49 additions and 43 deletions

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

@ -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) {

View File

@ -29,7 +29,7 @@
:offset-bottom="offsetBottom"
:tip-bottom="tipBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@ -40,7 +40,7 @@
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationList"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@ -52,7 +52,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 +67,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 +149,7 @@ export default {
dataError: false,
group:'',
showStation: '',
stationList: [],
stationListMode: [],
showSelectStation: false, // select
prdTypeMap: {
'01': '01', // =>
@ -163,6 +163,10 @@ export default {
computed:{
...mapGetters([
'canvasWidth'
]),
...mapGetters('map', [
'map',
'stationList'
]),
mode() {
return this.$route.params.mode;
@ -217,8 +221,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 +250,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 +263,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);
@ -393,8 +398,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);
@ -509,7 +519,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;
@ -520,12 +530,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;
}
@ -548,15 +558,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

@ -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

@ -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';
@ -293,7 +293,7 @@ export default {
});
},
setCenter(code) {
this.$refs.mapCanvas.setCenter(code);
this.$jlmap.setCenter(code);
},
//
initLoadData() {
@ -553,8 +553,8 @@ 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, val);
this.$jlmap.setCenter(val);
},
setStationList(val) {
this.stationList = [];