代码调整
This commit is contained in:
parent
98e1a75705
commit
6a1bf40183
@ -83,6 +83,8 @@ import Cookies from 'js-cookie';
|
|||||||
// getLoginWmurl, checkLoginStatus,
|
// getLoginWmurl, checkLoginStatus,
|
||||||
import { getOrgList, selectOrgnization } from '@/api/login';
|
import { getOrgList, selectOrgnization } from '@/api/login';
|
||||||
import { createSimulation, getSimulationInfoNew } from '@/api/simulation';
|
import { createSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||||
|
import { getBackProjectConfigByCode } from '@/api/projectConfig';
|
||||||
|
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||||
export default {
|
export default {
|
||||||
name:'NormalLogin',
|
name:'NormalLogin',
|
||||||
props: {
|
props: {
|
||||||
@ -140,6 +142,9 @@ export default {
|
|||||||
},
|
},
|
||||||
projectDevice() {
|
projectDevice() {
|
||||||
return this.$route.query.projectDevice;
|
return this.$route.query.projectDevice;
|
||||||
|
},
|
||||||
|
role() {
|
||||||
|
return this.$route.query.role;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -175,6 +180,7 @@ export default {
|
|||||||
this.checkOrgnizationInfo();
|
this.checkOrgnizationInfo();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
debugger;
|
||||||
console.log(error);
|
console.log(error);
|
||||||
// if (error.code === '30001') {
|
// if (error.code === '30001') {
|
||||||
// this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
// this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||||
@ -233,34 +239,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
judgeOtherPage(params) {
|
judgeOtherPage(params) {
|
||||||
// containDevice:false, // 是否包含设备
|
|
||||||
// deviceRelatedMap:'', // 设备关联地图
|
|
||||||
// deviceRelatedFunction:'' // 设备关联功能
|
|
||||||
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
|
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
|
||||||
const {containDevice, deviceRelatedMap, deviceRelatedFunction} = this.$store.state.projectConfig.deviceRelated;
|
getBackProjectConfigByCode(this.project).then(res=>{
|
||||||
if (containDevice && deviceRelatedMap && deviceRelatedFunction) {
|
if (res.data) {
|
||||||
createSimulation(deviceRelatedFunction).then(res => {
|
const {mapId, functionId} = res.data;
|
||||||
getSimulationInfoNew(res.data).then(resp => {
|
if (functionId && mapId) {
|
||||||
const paramVO = resp.data.paramVO;
|
createSimulation(functionId).then(resp => {
|
||||||
const query = {
|
const group = resp.data;
|
||||||
lineCode: resp.data.map.lineCode,
|
if (this.role) {
|
||||||
group: res.data,
|
assignUsersPlayRoles(this.role, group).then(() => {
|
||||||
mapId: resp.data.map.id,
|
this.enterSimulation(group, mapId);
|
||||||
project: this.project,
|
|
||||||
projectDevice:params.projectDevice,
|
|
||||||
type:params.type
|
|
||||||
};
|
|
||||||
if (paramVO && paramVO.domConfig && paramVO.domConfig.client) {
|
|
||||||
query.client = paramVO.domConfig.client;
|
|
||||||
}
|
|
||||||
if (paramVO && paramVO.domConfig && paramVO.domConfig.singleClient) {
|
|
||||||
query.singleClient = paramVO.domConfig.singleClient;
|
|
||||||
}
|
|
||||||
// if (this.loadingProjectList.includes(this.project)) {
|
|
||||||
// this.$store.dispatch('app/transitionAnimations');
|
|
||||||
// }
|
|
||||||
this.$router.push({ path: `/display/demon`, query: query });
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.enterSimulation(group, mapId);
|
||||||
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
if (error.code == 10003) {
|
if (error.code == 10003) {
|
||||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||||
@ -269,8 +261,29 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('请先配置项目设备登录信息');
|
this.$message.error('请先配置项目信息');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enterSimulation(group, mapId) {
|
||||||
|
getSimulationInfoNew(group).then(response=>{
|
||||||
|
debugger;
|
||||||
|
const paramVO = response.data.paramVO;
|
||||||
|
const query = {
|
||||||
|
lineCode: response.data.map.lineCode,
|
||||||
|
group: group,
|
||||||
|
mapId: mapId,
|
||||||
|
project: this.project
|
||||||
|
};
|
||||||
|
if (paramVO && paramVO.domConfig && paramVO.domConfig.client) {
|
||||||
|
query.client = paramVO.domConfig.client;
|
||||||
|
}
|
||||||
|
if (paramVO && paramVO.domConfig && paramVO.domConfig.singleClient) {
|
||||||
|
query.singleClient = paramVO.domConfig.singleClient;
|
||||||
|
}
|
||||||
|
this.$router.push({ path: `/display/demon`, query: query });
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 登陆
|
// 登陆
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
|
Loading…
Reference in New Issue
Block a user