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