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 StompClient from '@/utils/sock';
import { logout } from '@/api/login';
var clock = new THREE.Clock(); var clock = new THREE.Clock();
export function Jl3ddeviceNew(dom,group,token,skinCode) { export function Jl3ddeviceNew(dom,group,token,skinCode) {
var scope = this; 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,22 +151,29 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.anime = null; this.anime = null;
this.modelmanager = new ModelManager(); this.modelmanager = new ModelManager();
console.log(skinCode);
getPublish3dMapDetail(skinCode).then(netdata => { getPublish3dMapDetail(skinCode).then(netdata => {
setpsdstationmap(JSON.parse(netdata.data.stands)); console.log(netdata);
Standtextureload(scope,JSON.parse(netdata.data.assets)); if(netdata.data){
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) { setpsdstationmap(JSON.parse(netdata.data.stands));
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); Standtextureload(scope,JSON.parse(netdata.data.assets));
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
if(scope.stationtexture["stationlist"]){ moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"]; daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; if(scope.stationtexture["stationlist"]){
} scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
if(scope.stationtexture["pingbimen"]){ scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"]; }
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true; if(scope.stationtexture["pingbimen"]){
} scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"];
animate(); scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true;
}) }
})
}
animate();
}); });
function setpsdstationmap(stationlist){ function setpsdstationmap(stationlist){

View File

@ -10,7 +10,7 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr
let topic = '/user/queue/simulation/jl3d/'+routegroup; let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() }; let header = {'X-Token': getToken() };
socketon(topic); socketon(topic);
function socketon(topic) { function socketon(topic) {
@ -127,7 +127,7 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr
window.location.reload(); window.location.reload();
}).catch(error => { }).catch(error => {
});; });
} }
} }
let actions; let actions;

View File

@ -432,18 +432,20 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
getPublish3dMapDetail(skinCode).then(netdata3d => { getPublish3dMapDetail(skinCode).then(netdata3d => {
if(netdata3d.data){
Materialload(scope,JSON.parse(netdata3d.data.assets));
Materialload(scope,JSON.parse(netdata3d.data.assets)); }
getPublishMapDetail(skinCode).then(netdata => { getPublishMapDetail(skinCode).then(netdata => {
scope.switchviews(4); scope.switchviews(4);
inithumans(); inithumans();
initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList); initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
socktest = new PassflowConnect(scope,deviceaction,toptrain,downtrain,routegroup); socktest = new PassflowConnect(scope,deviceaction,toptrain,downtrain,routegroup);
loadingInstance.close();
}); });
}); });
loadingInstance.close();
animate(); animate();
}) })
@ -479,8 +481,10 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
if(stationlist[i].name == stationname){ if(stationlist[i].name == stationname){
scope.nowstation = stationlist[i]; scope.nowstation = stationlist[i];
scope.resetscene(); scope.resetscene();
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code]; if(scope.stationtexture["stationlist"]){
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; 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; i=leni;
} }
} }
@ -1035,7 +1039,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
// console.log(humanlist.children.length); // console.log(humanlist.children.length);
} }
function initstationlist(stationdata,standdata,psddata){ function initstationlist(stationdata,standdata,psddata){
let list = []; let list = [];
if(psddata){ if(psddata){
for(let i=0,leni = standdata.length;i<leni;i++){ for(let i=0,leni = standdata.length;i<leni;i++){
@ -1082,14 +1086,17 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
} }
scope.nowstation = stationlist[0]; scope.nowstation = stationlist[0];
scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"]; if(scope.stationtexture["stationlist"]){
scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
if(scope.modelmanager.station.mesh.getObjectByName("menkuangyanse")){ scope.modelmanager.station.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
scope.modelmanager.station.mesh.getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"]; if(scope.modelmanager.station.mesh.getObjectByName("menkuangyanse")){
scope.modelmanager.station.mesh.getObjectByName("menkuangyanse").material.map.needsUpdate = true; scope.modelmanager.station.mesh.getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
scope.modelmanager.station.mesh.getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.modelmanager.station.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
} }
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); updatestationlist(stationlist);
}else{ }else{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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