From 08516915877006a5e1a0a1ce398369cb55b47fb1 Mon Sep 17 00:00:00 2001 From: fan Date: Fri, 2 Sep 2022 17:03:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/designPlatform/demonList.vue | 4 ++-- src/views/designPlatform/trainingJlmap.vue | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index d6eee0c74..3b65843db 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -135,12 +135,12 @@ export default { break; } case 'trainingDesign': { - const data = { mapId: obj.mapId }; + const data = { mapId: obj.mapId, prdType: '01' }; createSimulationNew(data).then(resp => { if (this.loadingProjectList.includes(this.project)) { this.$store.dispatch('app/transitionAnimations'); } - const query = { ...data, group: resp.data, lineCode:obj.lineCode}; + const query = { mapId: obj.mapId, group: resp.data, lineCode:obj.lineCode}; this.$router.push({ path: `/trainingDesign`, query }); }).catch(error => { this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`); diff --git a/src/views/designPlatform/trainingJlmap.vue b/src/views/designPlatform/trainingJlmap.vue index ab2753152..87292b2e7 100644 --- a/src/views/designPlatform/trainingJlmap.vue +++ b/src/views/designPlatform/trainingJlmap.vue @@ -459,6 +459,14 @@ export default { if (this.$route.query.newApi + '' === 'true') { getMemberListCommon(this.group).then(resp => { this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.userId }); + const member = resp.data.find(elem => elem.userId === this.userId); + if (member) { + this.userRole = member.type || 'AUDIENCE'; + this.$store.dispatch('training/setRoleDeviceCode', member.deviceCode); + this.$store.dispatch('training/setUserRole', this.userRole); + this.deviceCode = member.deviceCode; + this.setSimulationPrdType(this.centralizedStationMap[member.deviceCode]); + } getUserListCommon(this.group).then(res => { this.$store.dispatch('training/setSimulationUserList', res.data); }).catch(() => { @@ -471,6 +479,14 @@ export default { // 获取仿真成员列表 getSimulationMemberList(this.group).then(resp => { this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.userId }); + const member = resp.data.find(elem => elem.userId === this.userId); + if (member) { + this.userRole = member.type || 'AUDIENCE'; + this.$store.dispatch('training/setRoleDeviceCode', member.deviceCode); + this.$store.dispatch('training/setUserRole', this.userRole); + this.deviceCode = member.deviceCode; + this.setSimulationPrdType(this.centralizedStationMap[member.deviceCode]); + } getAllSimulationUser(this.group).then(res => { this.$store.dispatch('training/setSimulationUserList', res.data); }).catch(() => {