Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1
This commit is contained in:
commit
b71e2d959b
@ -544,3 +544,11 @@ export function createSimulation(id) {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 根据地图ID和功能ID获取仿真GroupId */
|
||||||
|
export function getGroupByMapAndFunction(mapId, functionId) {
|
||||||
|
return request({
|
||||||
|
url: `/simulation/new/map/${mapId}/function/${functionId}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -82,7 +82,7 @@ import md5 from 'js-md5';
|
|||||||
import Cookies from 'js-cookie';
|
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, getGroupByMapAndFunction } from '@/api/simulation';
|
||||||
import { getBackProjectConfigByCode } from '@/api/projectConfig';
|
import { getBackProjectConfigByCode } from '@/api/projectConfig';
|
||||||
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||||
export default {
|
export default {
|
||||||
@ -144,7 +144,7 @@ export default {
|
|||||||
return this.$route.query.projectDevice;
|
return this.$route.query.projectDevice;
|
||||||
},
|
},
|
||||||
role() {
|
role() {
|
||||||
return this.$route.query.role;
|
return this.$route.query.roleCode;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -180,7 +180,6 @@ 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');
|
||||||
@ -244,22 +243,37 @@ export default {
|
|||||||
if (res.data) {
|
if (res.data) {
|
||||||
const {mapId, functionId} = res.data;
|
const {mapId, functionId} = res.data;
|
||||||
if (functionId && mapId) {
|
if (functionId && mapId) {
|
||||||
createSimulation(functionId).then(resp => {
|
if (params.type == 'IM') {
|
||||||
const group = resp.data;
|
createSimulation(functionId).then(resp => {
|
||||||
if (this.role) {
|
const group = resp.data;
|
||||||
assignUsersPlayRoles(this.role, group).then(() => {
|
if (this.role) {
|
||||||
|
const data = [{userId: this.$store.state.user.id, memberId:this.role}];
|
||||||
|
assignUsersPlayRoles(data, group).then(() => {
|
||||||
|
this.enterSimulation(group, mapId);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
this.enterSimulation(group, mapId);
|
this.enterSimulation(group, mapId);
|
||||||
});
|
}
|
||||||
} else {
|
}).catch(error=>{
|
||||||
this.enterSimulation(group, mapId);
|
if (error.code == 10003) {
|
||||||
}
|
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||||
}).catch(error=>{
|
} else {
|
||||||
if (error.code == 10003) {
|
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
}
|
||||||
} else {
|
});
|
||||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
} else {
|
||||||
}
|
getGroupByMapAndFunction(mapId, functionId).then(resp => {
|
||||||
});
|
const group = resp.data;
|
||||||
|
if (this.role) {
|
||||||
|
const data = [{userId: this.$store.state.user.id, memberId:this.role}];
|
||||||
|
assignUsersPlayRoles(data, group).then(() => {
|
||||||
|
this.enterSimulation(group, mapId);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.enterSimulation(group, mapId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('请先配置项目信息');
|
this.$message.error('请先配置项目信息');
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getProjectDeviceList, deleteProjectDevice } from '@/api/project';
|
import { getProjectDeviceList, deleteProjectDevice, getDeviceDetail } from '@/api/project';
|
||||||
import DeviceAdd from './add';
|
import DeviceAdd from './add';
|
||||||
import EditConfigGateway from './editConfigGateway';
|
import EditConfigGateway from './editConfigGateway';
|
||||||
import EditConfig from './editConfig';
|
import EditConfig from './editConfig';
|
||||||
@ -203,19 +203,31 @@ export default {
|
|||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
},
|
},
|
||||||
getPath(index, row) {
|
getPath(index, row) {
|
||||||
let url = '';
|
getDeviceDetail(row.id).then(res=>{
|
||||||
url = `${window.location.protocol}//${window.location.host}/cbtc/login?project=${row.project.toLowerCase().replace(/_/, '')}&projectDevice=${row.code}&type=${row.type}`;
|
if (res.data) {
|
||||||
this.url = url;
|
let roleCode = '';
|
||||||
this.$messageBox();
|
if (res.data.type == 'LW') {
|
||||||
this.$confirm(`登录路径:${url}`, '登录路径', {
|
const config = JSON.parse(res.data.config);
|
||||||
confirmButtonText: '复制路径',
|
roleCode = config.roleCode;
|
||||||
cancelButtonText: '关闭',
|
}
|
||||||
type: 'success'
|
let url = '';
|
||||||
}).then(() => {
|
url = `${window.location.protocol}//${window.location.host}/cbtc/login?project=${row.project.toLowerCase().replace(/_/, '')}&projectDevice=${row.code}&type=${row.type}`;
|
||||||
const inputText = document.getElementById('device-manage-url');
|
if (roleCode) {
|
||||||
inputText.select(); // 选择对象
|
url += '&roleCode=' + roleCode;
|
||||||
document.execCommand('Copy'); // 执行浏览器复制命令
|
}
|
||||||
this.$message.success('登录路径已经复制到粘贴板');
|
this.url = url;
|
||||||
|
this.$messageBox();
|
||||||
|
this.$confirm(`登录路径:${url}`, '登录路径', {
|
||||||
|
confirmButtonText: '复制路径',
|
||||||
|
cancelButtonText: '关闭',
|
||||||
|
type: 'success'
|
||||||
|
}).then(() => {
|
||||||
|
const inputText = document.getElementById('device-manage-url');
|
||||||
|
inputText.select(); // 选择对象
|
||||||
|
document.execCommand('Copy'); // 执行浏览器复制命令
|
||||||
|
this.$message.success('登录路径已经复制到粘贴板');
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user