This commit is contained in:
fan 2021-07-30 18:07:57 +08:00
commit b8d2df5cd8
7 changed files with 200 additions and 54 deletions

View File

@ -305,10 +305,29 @@ export function JLmap3dEdit(dom, data, mapid) {
for(let i=0,leni=scope.mapdata.stationstandlist.list.length;i<leni;i++){
if(changeStation.code == scope.mapdata.stationstandlist.list[i].code){
let changeData = scope.mapdata.stationstandlist.list[i];
console.log(changeData);
let topStandTrack = scope.mapdata.sectionlist.sections.datalist[changeData.stands[0].section];
let downStandTrack = scope.mapdata.sectionlist.sections.datalist[changeData.stands[changeData.stands.length-1].section];
changeStation.position.set(topStandTrack.railpoint[0].x+(topStandTrack.leftStopPointOffset+topStandTrack.rightStopPointOffset)/2,topStandTrack.railpoint[1].y,(topStandTrack.railpoint[1].z+downStandTrack.railpoint[1].z)/2);
console.log(scope.mapdata.sectionlist.sections);
console.log(topStandTrack);
console.log(downStandTrack);
let rightpos = topStandTrack.rightStopPercent*(topStandTrack.railpoint[2].x -topStandTrack.railpoint[0].x)+topStandTrack.railpoint[0].x;
let leftpos = downStandTrack.leftStopPercent*(downStandTrack.railpoint[2].x -downStandTrack.railpoint[0].x)+downStandTrack.railpoint[0].x;
let rightX = changeData.mesh.position.x-63.2 - rightpos;
let leftX = changeData.mesh.position.x+63.2 - leftpos;
topStandTrack.mesh.position.x = topStandTrack.mesh.position.x + rightX;
downStandTrack.mesh.position.x = downStandTrack.mesh.position.x + leftX;
// changeStation.position.set(topStandTrack.railpoint[0].x+(topStandTrack.leftStopPointOffset+topStandTrack.rightStopPointOffset)/2,topStandTrack.railpoint[1].y,(topStandTrack.railpoint[1].z+downStandTrack.railpoint[1].z)/2);
topStandTrack.mesh.railpoint[0].x = topStandTrack.mesh.railpoint[0].x+rightX;
topStandTrack.mesh.railpoint[2].x = topStandTrack.mesh.railpoint[2].x+rightX;
downStandTrack.mesh.railpoint[0].x = downStandTrack.mesh.railpoint[0].x+leftX;
downStandTrack.mesh.railpoint[2].x = downStandTrack.mesh.railpoint[2].x+leftX;
}
}
}

View File

@ -242,7 +242,7 @@
console.log(error);
})
,200,true);
updatemmic1(this.move);
// updatemmic1(this.move);
},
speedend: function(event){
document.getElementById("div1").onmousemove = null;

View File

@ -27,7 +27,7 @@
</div>
<div class = "right">
<div class = "rightstatus narea n-tiaoting" :style="{backgroundImage: 'url(' + nimage + ')' }">
<div class = "rightstatus narea n-tiaoting" :style="{backgroundImage: 'url(' + tiaotingimage + ')' }">
</div>
<div class = "rightstatus darea d-info" :style="{backgroundImage: 'url(' + dimage + ')' }">
</div>
@ -111,11 +111,13 @@ export default {
nowspeed:0,
nowatpspeed:0,
nowatospeed:0,
oldspeed:0,
endstation:'',
nextstation:'',
mmimodel:null,
nstate:"tiaoting",
nimage:null,
tiaotingjump:"false",
tiaotinghold:"false",
tiaotingimage:null,
dstate:"info",
dimage:null,
m1state:null,
@ -125,13 +127,15 @@ export default {
m3state:"zhefan",
m3image:null,
m4state:"out",
m4parking:false,
m4inTheStandArea:false,
m4image:null,
m5stateleft:false,
m5stateright:false,
m5image:null,
m6state:"fache",
m6image:null,
m7state:"aoac",
m7state:"aomc",
m7image:null,
m8state:"jinjizhidong",
m8image:null,
@ -156,7 +160,7 @@ export default {
}
},
mounted() {
window.updatemmic1 = this.updatemmic1;
// window.updatemmic1 = this.updatemmic1;
this.init();
},
beforeDestroy() {
@ -179,18 +183,18 @@ export default {
this.setimage();
},
setimage(){
this.nimage = this.images.n['tiaoting'];
this.tiaotingimage = this.images.n['none'];
this.dimage = this.images.d['info'];
this.m1image = this.images.m1['rm'];
this.m2image = this.images.m2['cbtc'];
this.m3image = this.images.m3['zhefan'];
this.m4image = this.images.m4['out'];
this.m3image = this.images.m3['none'];
this.m4image = this.images.m4['none'];
this.m5image = this.images.m5['noalloffdoor'];
this.m6image = this.images.m6['fache'];
this.m7image = this.images.m7['aoac'];
this.m6image = this.images.m6['none'];
this.m7image = this.images.m7['aomc'];
this.m8image = this.images.m8['none'];
this.m9image = this.images.m9['ato'];
this.m10image = this.images.m10['jinduan'];
this.m9image = this.images.m9['none'];
this.m10image = this.images.m10['none'];
this.c1image = this.images.c1['none'];
this.c2image = this.images.c2['none'];
this.c3image = this.images.c3['normal'];
@ -211,7 +215,7 @@ export default {
},
updatetrainstatus(newdata){
// console.log(newdata);
if(typeof(newdata.eb) != "undefined"){
this.updateEbStatus(newdata.eb);
@ -227,6 +231,7 @@ export default {
this.updatemmidrivemodelevel(newdata.runLevel,newdata.driveMode,newdata.atoOn,newdata.atpOn);
// this.updatammirunlevel(newdata.runLevel);
//
@ -241,6 +246,31 @@ export default {
this.updateMmiEndStation(newdata.endStation);
}
if(newdata.jump){
}
console.log(newdata.parking);
if(newdata.parking != undefined){
this.m4parking = newdata.parking;
this.updateM4(newdata);
}
if(newdata.inTheStandArea != undefined){
this.m4inTheStandArea = newdata.inTheStandArea;
this.updateM4(newdata);
}
if(newdata.jump != undefined){
this.tiaotingjump = newdata.jump;
this.updateTiaoting(newdata);
}
if(newdata.hold != undefined){
this.tiaotinghold = newdata.hold;
this.updateTiaoting(newdata);
}
this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose);
},
updatemmistate(aaa){
@ -283,6 +313,7 @@ export default {
}
}else{
this.nowspeed = parseInt(speed);
this.updatemmic1(this.nowspeed);
if(this.mmimodel.updatezz){
this.mmimodel.updatezz(speed);
}
@ -303,14 +334,49 @@ export default {
}
if(this.newa1state != this.a1state){
this.a1state = this.newa1state;
}
this.oldspeed=this.nowspeed;
}
},
updateM4(newdata){
console.log(newdata );
if(newdata.parking != undefined){
if(newdata.parking == true){
this.m4image = this.images.m4['in'];
}
}
if(newdata.inTheStandArea != undefined){
if(newdata.inTheStandArea == true){
this.m4image = this.images.m4['out'];
}
}
if(this.m4parking == false && this.m4inTheStandArea == false){
this.m4image = this.images.m4['none'];
}
},
updateTiaoting(newdata){
console.log(newdata);
if(newdata.jump != undefined){
if(newdata.jump == true){
this.tiaotingimage = this.images.n['tiaoting'];
}
}
if(newdata.hold != undefined){
if(newdata.hold == true){
this.tiaotingimage = this.images.n['kouche'];
}
}
if(this.tiaotingjump == false&& this.tiaotinghold == false){
this.tiaotingimage = this.images.n['none'];
}
},
updatedrivedata(drivedata){
// if(drivedata == "breaker"){
//
@ -409,24 +475,24 @@ export default {
}
}
//
if(this.m9state1){
this.m9state1 = atoon;
if(atoon){
}else{
this.m9image = this.images.m9["ato"];
// this.c2image = this.images.c2['none'];
}
}
if(this.m9state2 != atpon){
this.m9state2 = atpon;
if(atpon){
}else{
this.m9image = this.images.m9["atp"];
}
}
// if(this.m9state1){
// this.m9state1 = atoon;
// if(atoon){
//
// }else{
// this.m9image = this.images.m9["ato"];
// // this.c2image = this.images.c2['none'];
// }
// }
//
// if(this.m9state2 != atpon){
// this.m9state2 = atpon;
// if(atpon){
//
// }else{
// this.m9image = this.images.m9["atp"];
// }
// }
},
updatemmidoormode(leftDoorCanClose,rightDoorCanClose){
@ -482,16 +548,16 @@ export default {
this.malen = +parseInt(len)/2*10+"px";
}
},
updatemmic1(qspeed){
updatemmic1(nowspeed){
if(this.nowspeed != 0 ){
this.newc1state = 'duoxing';
}else{
this.newc1state = 'none';
}
if(qspeed>0){
if(nowspeed>this.oldspeed){
this.newc1state = 'qianyin';
}else if(qspeed<0){
}else if(nowspeed<this.oldspeed){
this.newc1state = 'zhidong';
}

View File

@ -5,7 +5,9 @@
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
<el-tab-pane label="课程场景" name="progresslist" >
<draggable v-model="lessonData.lessonData.lessonProgress" group="people" @start="drag=true" @end="drag=false" >
<div class="progressdiv" v-for="(element,index) in lessonData.lessonData.lessonProgress">
<div class="progressdiv"
:style="{'background-image': 'url('+localstatic+'/lesson3d/sc.png)'}"
v-for="(element,index) in lessonData.lessonData.lessonProgress">
<div class="changeprogressdiv" @click="changeProgressView(index)">{{element.progressName}}</div>
<div class="delprogressdiv" @click="removeProgress(index)" >X</div>
</div>
@ -16,9 +18,14 @@
</el-tab-pane>
<el-tab-pane label="场景三维资源" name="assetlist" >
<div class="progressdiv" v-for="(elementtrigger,indextrigger) in triggerList" :key="elementtrigger.label">
<div class="changeprogressdiv" @click="selectModel(elementtrigger)">{{elementtrigger.label}}</div>
<div class="delprogressdiv" v-if="(elementtrigger.showType == 'loadModel')" @click="deleteModel(elementtrigger)" >X</div>
<div class="progressdiv"
v-for="(elementtrigger,indextrigger) in triggerList" :key="elementtrigger.label">
<div class="progressdivimg"
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
<div class="progressdivtext" @click="selectModel(elementtrigger)">{{elementtrigger.label}}</div>
<div class="delprogressdiv" v-if="(elementtrigger.showType == 'loadModel')" @click="deleteModel(elementtrigger)" >删除</div>
</div>
</el-tab-pane>
@ -120,13 +127,32 @@
top:5px;
}
.progressdiv{
width:100px;
width:80px;
height:100px;
// display:inline;
margin: 20px;
float:left;
border:solid 2px #000;
border:solid 1px #409EFF;
}
.progressdivimg{
width:70px;
height:70px;
margin-left: 5px;
left:5px;
background-size: 100%;
// display:inline;
float:left;
}
.progressdivtext{
width:80px;
height:30px;
margin: 0;
// display:inline;
float:left;
bottom: 0;
border:solid 1px #409EFF;
font-size: 15px;
}
.changeprogressdiv{
@ -140,11 +166,13 @@
.delprogressdiv{
// position: relative;
width: 100%;
height: 20%;
width: 20px;
height: 20px;
right: 0;
bottom: 0;
border:solid 2px #000;
top: 0;
float: right;
// position:absolute;
border:solid 2px #409EFF;
}
</style>

View File

@ -19,16 +19,23 @@
<el-tab-pane label="三维资源" name="modelTrigger">
<!-- <Assets-Model></Assets-Model> -->
<draggable v-model="lessonAssetList" group="lessonAssetList" @start="drag=true" @end="drag=false" >
<div class="progressdiv" v-for="(item,index) in lessonAssetList" @dragend="createModel($event,item,index)">
{{item.packageName}}
<div class="progressdiv" v-for="(item,index) in lessonAssetList"@dragend="createModel($event,item,index)">
<div class="progressdivimg"
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
<div class="progressdivtext">{{item.packageName}}</div>
</div>
</draggable>
</el-tab-pane>
<el-tab-pane label="图片资源列表" name="picasset">
<draggable v-model="picAssetList" group="picasset" @start="drag=true" @end="drag=false">
<div class="progressdiv"
:style="{'background-image': 'url('+localStatic+item.url+')'}"
v-for="item in picAssetList" @click="changePicUrl($event,item)">
<div class="progressdivimg"
:style="{'background-image': 'url('+netStatic+item.url+')'}"/>
<div class="progressdivtext">{{item.packageName}}</div>
</div>
</draggable>
<!-- <Assets-Model></Assets-Model> -->
@ -50,6 +57,8 @@
import { BASE_ASSET_API,getMap3dModelData } from '@/api/jlmap3d/assets3d.js'
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'LessonTools',
props:['lessonTools'],
@ -58,7 +67,8 @@
},
data() {
return {
localStatic:BASE_ASSET_API,
localStatic:JL3D_LOCAL_STATIC,
netStatic:BASE_ASSET_API,
activeName: 'lessoncomponent',
lessonAssetList:[],
picAssetList:[],
@ -73,9 +83,13 @@
},
watch: {
},
onReady(){
},
mounted() {
console.log(this.localStatic);
this.localstatic = JL3D_LOCAL_STATIC;
console.log(this.localstatic);
getMap3dModelData("三维课程").then(netdata => {
this.lessonAssetList = netdata.data;
}).catch(error => {
@ -153,13 +167,32 @@
}
.progressdiv{
width:100px;
width:80px;
height:100px;
// display:inline;
margin: 20px;
float:left;
border:solid 1px #409EFF;
}
.progressdivimg{
width:70px;
height:70px;
margin-left: 5px;
left:5px;
background-size: 100%;
border:solid 2px #000;
// display:inline;
float:left;
}
.progressdivtext{
width:80px;
height:30px;
margin: 0;
// display:inline;
float:left;
bottom: 0;
border:solid 1px #409EFF;
font-size: 15px;
}

BIN
static/lesson3d/box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/lesson3d/sc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB