This commit is contained in:
zyy 2020-07-08 14:40:18 +08:00
commit 7c8d1319f3
10 changed files with 94 additions and 51 deletions

View File

@ -14,6 +14,8 @@ import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import StompClient from '@/utils/sock';
import { logout } from '@/api/login';
var clock = new THREE.Clock();
export function Jl3ddeviceNew(dom,group,token,skinCode) {
var scope = this;
@ -125,6 +127,13 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
}
if(data.type == 'Simulation_Over'){
logout(getToken()).then(() => {
window.location.reload();
}).catch(error => {
});
}
// }
@ -142,7 +151,10 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.anime = null;
this.modelmanager = new ModelManager();
console.log(skinCode);
getPublish3dMapDetail(skinCode).then(netdata => {
console.log(netdata);
if(netdata.data){
setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets));
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
@ -156,8 +168,12 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"];
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true;
}
animate();
})
}
animate();
});
function setpsdstationmap(stationlist){

View File

@ -127,7 +127,7 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr
window.location.reload();
}).catch(error => {
});;
});
}
}
let actions;

View File

@ -432,18 +432,20 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
getPublish3dMapDetail(skinCode).then(netdata3d => {
if(netdata3d.data){
Materialload(scope,JSON.parse(netdata3d.data.assets));
}
getPublishMapDetail(skinCode).then(netdata => {
scope.switchviews(4);
inithumans();
initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
socktest = new PassflowConnect(scope,deviceaction,toptrain,downtrain,routegroup);
});
});
loadingInstance.close();
});
});
animate();
})
@ -479,8 +481,10 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
if(stationlist[i].name == stationname){
scope.nowstation = stationlist[i];
scope.resetscene();
if(scope.stationtexture["stationlist"]){
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
i=leni;
}
}
@ -1082,6 +1086,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
}
scope.nowstation = stationlist[0];
if(scope.stationtexture["stationlist"]){
scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
if(scope.modelmanager.station.mesh.getObjectByName("menkuangyanse")){
@ -1091,6 +1096,8 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
updatestationlist(stationlist);
}else{
olddataai = true;

View File

@ -13,8 +13,8 @@
<el-button type="primary" @click="switchhide">{{switchshow}}</el-button>
</el-button-group>
</div>
<div id="jl3dwindow" class="windowbutton" @click="windowchange"></div>
<div id="jl3dclose" class="backbutton" @click="close3ddeviceview"></div>
<div id="jl3dwindow" v-show="isPsd" class="windowbutton" @click="windowchange"></div>
<div id="jl3dclose" v-show="isPsd" class="backbutton" @click="close3ddeviceview"></div>
</div>
</template>
<script>
@ -42,6 +42,7 @@
disperreset:"整体拆解",
switchshow:"隐藏轨道",
switchstatus:true,
isPsd:true,
isswitch:false,
}
},
@ -116,6 +117,16 @@
// console.log(this.$store.state.menuOperation);
// console.log(this.$store.state.map.map.linkList);
// console.log(this.$store.state.map.map.linkList);
if(this.$route.query.type == "VR_PSD"){
this.isPsd = false;
let changeelement = document.getElementById('jl3d');
changeelement.style.width = '100%';
changeelement.style.height = '100%';
changeelement.style.top = '0';
this.windowstatus = true;
// this.jl3d.updatewindowstatus('1');
}
if(this.$store.state.map.map.linkList){
this.datastatus = "old";
this.initolddata(group,header);
@ -123,6 +134,9 @@
this.datastatus = "new";
this.initnewdata(group,header);
}
if(this.$route.query.type == "VR_PSD"){
this.jl3d.updatewindowstatus('1');
}
// const mapdata = this.$store.getters['map/map'];
// console.log(mapdata);
// if (group) {

View File

@ -27,7 +27,7 @@
</div>
<div class="menudown">
<el-button-group>
<el-button type="primary" @click="back">退出</el-button>
<el-button v-show="isCctv" type="primary" @click="back">退出</el-button>
</el-button-group>
</div>
</div>
@ -50,12 +50,13 @@ export default {
renderswitch:false,
stationlist:[],
value:"",
isCctv:true,
};
},
computed: {
code() {
return this.$route.query.code;
}
},
},
watch: {
@ -66,6 +67,9 @@ export default {
mounted() {
this.init();
window.updatestationlist = this.updatestationlist;
if(this.$route.query.type == "CCTV"){
this.isCctv = false;
}
},
beforeDestroy() {

View File

@ -423,7 +423,9 @@ export default {
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
mapid:resp.data.map.id,
group:res.data.group,
project: getSessionStorage('project')
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
} else {
this.$router.push({ path: `/jointTrainingNew`, query: query });

View File

@ -405,7 +405,7 @@ export default {
async getUserRole() {
const res = await getSimulationUserInfo(this.group);
const data = res.data || {};
this.userRole = data.role || 'AUDIENCE';
this.userRole = data.type || 'AUDIENCE';
this.deviceCode = data.deviceCode;
this.isAdmin = data.admin;
@ -429,7 +429,7 @@ export default {
let resp = {data: {}};
if (this.project == 'jsxt' ) {
resp = await getRaceUserById(this.$route.query.raceId);
resp.data.userRole = resp.data.role;
resp.data.userRole = resp.data.type;
const paperResp = await getTestPaperDatail(this.$route.query.raceId);
if (paperResp.data && paperResp.data.practicalQuestions) {
this.questionList = [];
@ -455,7 +455,7 @@ export default {
resp = await this.getUserRole();
}
if (resp && resp.code == 200) {
this.userRole = resp.data.role || 'AUDIENCE';
this.userRole = resp.data.type || 'AUDIENCE';
this.setSimulationPrdType();
}
await this.getTrainDetail();
@ -664,7 +664,7 @@ export default {
this.$messageBox('您已经被请离房间!');
this.$refs.demonMenu.back();
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
this.userRole = item.role || 'AUDIENCE';
this.userRole = item.type || 'AUDIENCE';
this.setSimulationPrdType();
}
});

View File

@ -9,8 +9,8 @@
:close-on-click-modal="false"
>
<el-form ref="form" :model="formModel" label-width="120px" :rules="rules">
<el-form-item label="添加仿真成员:" prop="role">
<el-select v-model="formModel.role" placeholder="请选择" size="small">
<el-form-item label="添加仿真成员:" prop="type">
<el-select v-model="formModel.type" placeholder="请选择" size="small">
<el-option
v-for="item in typeList"
:key="item.value"
@ -35,10 +35,10 @@ export default {
return {
dialogVisible: false,
formModel: {
role: ''
type: ''
},
rules: {
role: [
type: [
{ required: true, message: '请选择显示位置', trigger: 'change' }
]
},
@ -71,7 +71,7 @@ export default {
handleClose() {
this.dialogVisible = false;
this.formModel = {
role: ''
type: ''
};
this.$refs.form.resetFields();
}

View File

@ -32,7 +32,7 @@
>
<span :id="data.id" slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ data.label }}</span>
<span v-if="data.role">
<span v-if="data.type">
<el-select :key="data.id" v-model="data.userId" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)">
<el-option
v-for="item in simulationUserList"
@ -104,15 +104,15 @@ export default {
memberData: {},
treeData: [{
label: '行调',
type: 'role',
// type: 'role',
children: []
}, {
label: '车站值班员',
type: 'role',
// type: 'role',
children: []
}, {
label: '司机',
type: 'role',
// type: 'role',
children: []
}, {
label: '通号',
@ -163,7 +163,7 @@ export default {
const maintainerList = [];
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
switch (item.role) {
switch (item.type) {
case 'DISPATCHER':
this.memberData[item.id].label = '行调' + (dispatcherList.length + 1);
dispatcherList.push(this.memberData[item.id]);
@ -274,7 +274,7 @@ export default {
flag = this.memberData[data.id].nickName.indexOf(value) !== -1;
}
let driverNoShow = true;
if (data.role && data.role === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
if (data.role && data.type === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
driverNoShow = false;
}
return (data.label.indexOf(value) !== -1 || flag) && driverNoShow;

View File

@ -218,7 +218,7 @@ export default {
const maintainerList = [];
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
switch (item.role) {
switch (item.type) {
case 'DISPATCHER':
this.memberData[item.id].label = '行调' + (dispatcherList.length + 1);
dispatcherList.push(this.memberData[item.id]);