Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/views/newMap/jointTrainingNew/index.vue
This commit is contained in:
commit
6cc8b3beaa
@ -121,7 +121,7 @@ export function Jlmap3ddata(mapid,scope){
|
||||
let switchdata = JSON.parse(netdata.switchs);
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
let standsdata = JSON.parse(netdata.stands);
|
||||
jlmap3dasset = JSON.parse(netdata.assets);
|
||||
jlmap3dasset = JSON.parse(netdata.assets);
|
||||
console.log(jlmap3dasset);
|
||||
assetloader.setmodellistnew(netdata.assets,5);
|
||||
assetloader.assetpromise(scene)
|
||||
|
171
src/jlmap3d/edit/connect/testgetmodels.js
Normal file
171
src/jlmap3d/edit/connect/testgetmodels.js
Normal file
@ -0,0 +1,171 @@
|
||||
//import request from '@/utils/request';
|
||||
|
||||
export function testgetmodels(data) {
|
||||
let postmap = {
|
||||
id:data.mapdata.id,
|
||||
mapId:data.mapdata.mapId,
|
||||
assets:"null",
|
||||
sections:"null",
|
||||
signals:"null",
|
||||
trains:"null",
|
||||
stands:"null",
|
||||
switchs:"null"
|
||||
};
|
||||
console.log(data.mapdata);
|
||||
if(data.mapdata.sectionlist.sections== undefined){
|
||||
return postmap;
|
||||
}
|
||||
|
||||
|
||||
if(data == undefined){
|
||||
|
||||
return postmap;
|
||||
}else{
|
||||
|
||||
let models = data.assetManager;
|
||||
|
||||
postmap.assets = JSON.stringify(models);
|
||||
console.log(models);
|
||||
//link轨道
|
||||
// let links = [];
|
||||
// for(let i=0;i<data.mapdata.linklist.linksgroup.children.length;i++){
|
||||
// let link = {
|
||||
// uuid:data.mapdata.linklist.linksgroup.children[i].uuid,
|
||||
// code:data.mapdata.linklist.linksgroup.children[i].code,
|
||||
// name:data.mapdata.linklist.linksgroup.children[i].name,
|
||||
// lengthfact:data.mapdata.linklist.linksgroup.children[i].lengthfact,
|
||||
// position:data.mapdata.linklist.linksgroup.children[i].position,
|
||||
// rotation:data.mapdata.linklist.linksgroup.children[i].rotation,
|
||||
// scale:data.mapdata.linklist.linksgroup.children[i].scale,
|
||||
// rightlist:data.mapdata.linklist.linksgroup.children[i].rightlist,
|
||||
// leftlist:data.mapdata.linklist.linksgroup.children[i].leftlist,
|
||||
// lp:data.mapdata.linklist.linksgroup.children[i].lp,
|
||||
// rp:data.mapdata.linklist.linksgroup.children[i].rp,
|
||||
// rail:data.mapdata.linklist.linksgroup.children[i].rail,
|
||||
// }
|
||||
// links.push(link);
|
||||
// }
|
||||
// postmap.sections.link = JSON.stringify(links);
|
||||
|
||||
//section隧道
|
||||
let sections = [];
|
||||
// console.log(data.mapdata.sectionlist.sections.datalist);
|
||||
for(let i in data.mapdata.sectionlist.sections.datalist){
|
||||
let section = {
|
||||
// uuid:data.mapdata.sectionlist.sections.modellist[i].uuid,
|
||||
code:data.mapdata.sectionlist.sections.datalist[i].code,
|
||||
name:data.mapdata.sectionlist.sections.datalist[i].name,
|
||||
lengthFact:data.mapdata.sectionlist.sections.datalist[i].mesh.lengthFact,
|
||||
standTrack:data.mapdata.sectionlist.sections.datalist[i].standTrack,
|
||||
rp:data.mapdata.sectionlist.sections.datalist[i].rp,
|
||||
lp:data.mapdata.sectionlist.sections.datalist[i].lp,
|
||||
railpoint:data.mapdata.sectionlist.sections.datalist[i].mesh.railpoint,
|
||||
rail:data.mapdata.sectionlist.sections.datalist[i].rail,
|
||||
position:data.mapdata.sectionlist.sections.datalist[i].mesh.position,
|
||||
rotation:data.mapdata.sectionlist.sections.datalist[i].mesh.rotation,
|
||||
scale:data.mapdata.sectionlist.sections.datalist[i].mesh.scale,
|
||||
}
|
||||
let nowmesh = data.mapdata.sectionlist.sectiongroup.getObjectByProperty("code",section.code);
|
||||
section.railpoint = nowmesh.railpoint
|
||||
// console.log(nowmesh.railpoint);
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].rsection){
|
||||
// section.rsection = data.mapdata.sectionlist.sections.datalist[i].rsection;
|
||||
// }
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].lsection){
|
||||
// section.lsection = data.mapdata.sectionlist.sections.datalist[i].lsection;
|
||||
// }
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].csection){
|
||||
// section.csection = data.mapdata.sectionlist.sections.datalist[i].csection;
|
||||
// }
|
||||
|
||||
// testmesh1.position.z = link.position.z;
|
||||
|
||||
sections.push(section);
|
||||
}
|
||||
let arrray = {
|
||||
section:sections,
|
||||
};
|
||||
postmap.sections = JSON.stringify(arrray);
|
||||
//道岔
|
||||
let switchs = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.switchlist.switchs.datalist.length;i++){
|
||||
let switcha = {
|
||||
// uuid:data.mapdata.switchlist.switchs.modellist[i].uuid,
|
||||
code:data.mapdata.switchlist.switchs.datalist[i].code,
|
||||
name:data.mapdata.switchlist.switchs.datalist[i].name,
|
||||
pa:data.mapdata.switchlist.switchs.datalist[i].pa,
|
||||
pb:data.mapdata.switchlist.switchs.datalist[i].pb,
|
||||
pc:data.mapdata.switchlist.switchs.datalist[i].pc,
|
||||
position:data.mapdata.switchlist.switchs.modellist[i].position,
|
||||
rotation:data.mapdata.switchlist.switchs.modellist[i].rotation,
|
||||
scale:data.mapdata.switchlist.switchs.modellist[i].scale
|
||||
}
|
||||
switchs.push(switcha);
|
||||
}
|
||||
postmap.switchs = JSON.stringify(switchs);
|
||||
//信号
|
||||
let signals = [];
|
||||
for(let i=0;i<data.mapdata.signallist.list.length;i++){
|
||||
|
||||
|
||||
let signal = {
|
||||
// uuid:data.mapdata.signallist.list[i].mesh.uuid,
|
||||
name:data.mapdata.signallist.list[i].mesh.name,
|
||||
modelid:data.mapdata.signallist.list[i].mesh.modelid,
|
||||
code:data.mapdata.signallist.list[i].mesh.code,
|
||||
right:data.mapdata.signallist.list[i].mesh.right,
|
||||
position:data.mapdata.signallist.list[i].mesh.position,
|
||||
rotation:data.mapdata.signallist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.signallist.list[i].mesh.scale
|
||||
}
|
||||
|
||||
signals.push(signal);
|
||||
}
|
||||
postmap.signals = JSON.stringify(signals);
|
||||
//车站
|
||||
let stands = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
|
||||
let station = {
|
||||
// uuid:data.mapdata.stationstandlist.list[i].uuid,
|
||||
code:data.mapdata.stationstandlist.list[i].code,
|
||||
name:data.mapdata.stationstandlist.list[i].name,
|
||||
modelid:data.mapdata.stationstandlist.list[i].modelid,
|
||||
position:data.mapdata.stationstandlist.list[i].mesh.position,
|
||||
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
|
||||
inside:data.mapdata.stationstandlist.list[i].inside,
|
||||
direction1:{
|
||||
name:data.mapdata.stationstandlist.list[i].direction1.name,
|
||||
code:data.mapdata.stationstandlist.list[i].direction1.code
|
||||
},
|
||||
direction2:{
|
||||
name:data.mapdata.stationstandlist.list[i].direction2.name,
|
||||
code:data.mapdata.stationstandlist.list[i].direction2.code
|
||||
}
|
||||
}
|
||||
stands.push(station);
|
||||
}
|
||||
postmap.stands = JSON.stringify(stands);
|
||||
//列车
|
||||
let trains = [];
|
||||
for(let i=0;i<data.assetloader.modellist.length;i++){
|
||||
if(data.assetloader.modellist[i].deviceType == "train"){
|
||||
let train = {
|
||||
id:data.assetloader.modellist[i].id,
|
||||
name:data.assetloader.modellist[i].name,
|
||||
deviceType:data.assetloader.modellist[i].deviceType,
|
||||
type:data.assetloader.modellist[i].type,
|
||||
assetUrl:data.assetloader.modellist[i].assetUrl
|
||||
}
|
||||
|
||||
trains.push(train);
|
||||
}
|
||||
}
|
||||
postmap.trains = JSON.stringify(trains);
|
||||
|
||||
return postmap;
|
||||
}
|
||||
|
||||
}
|
@ -237,6 +237,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
|
||||
}
|
||||
|
||||
this.dispose = function(){
|
||||
requestAnimationFrame();
|
||||
renderer.setAnimationLoop(null);
|
||||
renderer.dispose();
|
||||
scene.dispose();
|
||||
|
@ -173,7 +173,6 @@ import axios from 'axios';
|
||||
getSimulationTrainlistNew(this.group).then(netdata => {
|
||||
this.options = [];
|
||||
this.trainlist = netdata.data;
|
||||
console.log(netdata);
|
||||
for(let i=0;i<netdata.data.length;i++){
|
||||
let option= {
|
||||
value: netdata.data[i].groupNumber,
|
||||
@ -228,7 +227,6 @@ import axios from 'axios';
|
||||
//获取当前录制托管状态
|
||||
if(this.tuoguanbutton == true){
|
||||
getSimulationMemberNew(this.group).then(netdata => {
|
||||
console.log(netdata);
|
||||
this.userrole = netdata.data.role;
|
||||
if(netdata.data.trust){
|
||||
this.tuoguanstatus = netdata.data.trust;
|
||||
|
@ -211,9 +211,6 @@ import {driverListConfig,sceneListConfig,deviceListConfig,maintainerListConfig,c
|
||||
|
||||
export default {
|
||||
name: 'EditAction',
|
||||
props: {
|
||||
assetListAll: Object
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
@ -224,6 +221,7 @@ export default {
|
||||
size:'medium',
|
||||
isActive:-1,
|
||||
nowSelect:null,
|
||||
assetListAll:null,
|
||||
driverAssetList:driverListConfig,
|
||||
sceneAssetList:sceneListConfig,
|
||||
deviceAssetList:deviceListConfig,
|
||||
@ -353,6 +351,7 @@ export default {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
this.assetListAll ={
|
||||
driverAssetList:this.driverAssetList,
|
||||
@ -364,6 +363,7 @@ export default {
|
||||
deviceTextureList:this.deviceTextureList,
|
||||
signalTextureAssetList:this.signalTextureAssetList
|
||||
};
|
||||
changeEditAssetList(this.assetListAll);
|
||||
console.log(this.assetListAll);
|
||||
},
|
||||
actionevent(event){
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
<el-button type="save" @click="save">保存</el-button>
|
||||
|
||||
<el-button type="savetest" @click="savetest">保存</el-button>
|
||||
<el-button type="savetest" @click="savetest">测试中保存</el-button>
|
||||
|
||||
<el-button type="back" @click="back">返回</el-button>
|
||||
</el-row>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div id="testdraw" class="testdraw">
|
||||
</div>
|
||||
|
||||
<Edit-Action ref="action" :assetListAll="assetListAll" @saction="saction" @actionevent="actionevent">
|
||||
<Edit-Action ref="action" @saction="saction" @actionevent="actionevent">
|
||||
</Edit-Action>
|
||||
|
||||
<Edit-Property ref="property" :selectmodel='selectmodel'>
|
||||
@ -39,7 +39,7 @@
|
||||
import axios from 'axios';
|
||||
import { update3dMapData } from '@/api/jlmap3d/load3ddata'
|
||||
import { getmodels } from '@/jlmap3d/edit/connect/newgetmodels';
|
||||
|
||||
import { testgetmodels } from '@/jlmap3d/edit/connect/testgetmodels';
|
||||
//components
|
||||
import EditProperty from '@/views/jlmap3d/edit/component/property';
|
||||
import EditAction from '@/views/jlmap3d/edit/component/action';
|
||||
@ -75,7 +75,6 @@
|
||||
|
||||
mapdata: null,
|
||||
jlmap3dedit: null,
|
||||
assetListAll: null,
|
||||
selectmodel: null
|
||||
|
||||
}
|
||||
@ -110,6 +109,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.init();
|
||||
window.changeEditAssetList = this.changeEditAssetList;
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
if (this.jlmap3dedit) {
|
||||
@ -117,6 +121,9 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeEditAssetList(newList){
|
||||
this.jlmap3dedit.assetManager = newList;
|
||||
},
|
||||
show: function () {
|
||||
|
||||
},
|
||||
@ -179,6 +186,7 @@
|
||||
},
|
||||
save() {
|
||||
//console.log("save");
|
||||
console.log(this.jlmap3dedit.assetManager);
|
||||
let param = getmodels(this.jlmap3dedit);
|
||||
update3dMapData(param).then(data => {
|
||||
//console.log(data);
|
||||
@ -191,7 +199,17 @@
|
||||
|
||||
},
|
||||
savetest(){
|
||||
console.log();
|
||||
console.log(this.jlmap3dedit.assetManager);
|
||||
|
||||
let param = testgetmodels(this.jlmap3dedit);
|
||||
// update3dMapData(param).then(data => {
|
||||
// //console.log(data);
|
||||
// if (data.code == "200") {
|
||||
// alert("保存成功");
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// console.log(error);
|
||||
// });
|
||||
},
|
||||
back() {
|
||||
|
||||
@ -200,10 +218,7 @@
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -98,7 +98,8 @@ export default {
|
||||
if (this.jlmap3d) {
|
||||
this.jlmap3d.webwork.postMessage('off');
|
||||
this.jlmap3d.webwork.terminate();
|
||||
this.jlmap3d.jsonwebwork.terminate();
|
||||
console.log("www");
|
||||
this.jlmap3d.jsonwebworknew.terminate();
|
||||
this.jlmap3d.dispose();
|
||||
this.jlmap3d = null;
|
||||
// this.$destroy();
|
||||
|
@ -142,9 +142,9 @@ export default {
|
||||
},
|
||||
watch:{
|
||||
// $store.state.config.menuBarLoadedCount
|
||||
'offset': function (val) {
|
||||
this.dialogShow && this.dragEvent();
|
||||
},
|
||||
// 'offset': function (val) {
|
||||
// this.dialogShow && this.dragEvent();
|
||||
// },
|
||||
'$store.state.socket.autoFaultTrigger':function(val) {
|
||||
this.dialogShow && this.getSimulationFaultRules();
|
||||
}
|
||||
@ -205,7 +205,10 @@ export default {
|
||||
covertFaultType(row) {
|
||||
let faultType = '';
|
||||
if (row && row.id) {
|
||||
const type = this.covertType(row.targetDeviceType);
|
||||
let type = this.covertType(row.targetDeviceType);
|
||||
if (type == 'Station') {
|
||||
type = 'ZcControl';
|
||||
}
|
||||
const currentList = deviceFaultType[type];
|
||||
currentList.forEach(temp=>{
|
||||
if (temp.value === row.faultType) {
|
||||
@ -246,6 +249,9 @@ export default {
|
||||
this.dialogShow = true;
|
||||
this.reloadTable();
|
||||
this.getSimulationFaultRules();
|
||||
this.$nextTick(()=>{
|
||||
this.dragEvent();
|
||||
});
|
||||
// this.queryList.data = [];
|
||||
// getFailureGenerateRules({ skin: this.lineCode, group: this.group }).then(response => {
|
||||
// const data = response.data;
|
||||
@ -310,7 +316,7 @@ export default {
|
||||
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
|
||||
|
||||
dialogHeaderEl.onmousedown = (e) => {
|
||||
/** 鼠标按下,计算当前元素距离可视区的距离*/
|
||||
/** 鼠标按下,计算当前元素距离可视区的距离*/
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft;
|
||||
const disY = e.clientY - dialogHeaderEl.offsetTop;
|
||||
|
||||
@ -319,18 +325,18 @@ export default {
|
||||
|
||||
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
|
||||
if (sty.left.includes('%')) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
|
||||
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
|
||||
} else {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
styL = +sty.left.replace(/\px/g, '');
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
styT = +sty.top.replace(/\px/g, '');
|
||||
}
|
||||
|
||||
document.onmousemove = function (e) {
|
||||
/** 通过事件委托,计算移动的距离*/
|
||||
/** 通过事件委托,计算移动的距离*/
|
||||
const l = e.clientX - disX;
|
||||
const t = e.clientY - disY;
|
||||
|
||||
@ -354,8 +360,8 @@ export default {
|
||||
dragDom.style.top = `${t + styT}px`;
|
||||
}
|
||||
|
||||
/** 将此时的位置传出去*/
|
||||
// binding.value({ x: e.pageX, y: e.pageY });
|
||||
/** 将此时的位置传出去*/
|
||||
// binding.value({ x: e.pageX, y: e.pageY });
|
||||
};
|
||||
|
||||
document.onmouseup = function () {
|
||||
|
@ -471,8 +471,8 @@ export default {
|
||||
// Admin 管理员 Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号 IBP:IBP盘
|
||||
switch (this.userRole) {
|
||||
// case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break;
|
||||
case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); break;
|
||||
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); break;
|
||||
case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); this.drivingShow = false; break;
|
||||
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); this.drivingShow = false; break;
|
||||
case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break;
|
||||
case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); break;
|
||||
case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp(); break;
|
||||
@ -578,6 +578,7 @@ export default {
|
||||
|
||||
hideIbp() {
|
||||
Message.closeAll();
|
||||
this.jl3dmaintainershow = false;
|
||||
// this.drivingShow = false;
|
||||
this.panelShow = true;
|
||||
this.ibpShow = false;
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="member">
|
||||
<div class="member__head">
|
||||
<div class="member__head--title"> 成员列表</div>
|
||||
<div class="member__head--notes"> {{ members.length }}/{{ room.totalNum }}</div>
|
||||
<div class="member__head--notes"> {{ onlineNum }}/{{ members.length }}</div>
|
||||
</div>
|
||||
<div class="member__container">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.enterNameToFilter')" clearable />
|
||||
@ -58,7 +58,8 @@ export default {
|
||||
return {
|
||||
filterText: '',
|
||||
clickUserId: '',
|
||||
menuDisabled: false
|
||||
menuDisabled: false,
|
||||
onlineNum: 1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -75,6 +76,23 @@ export default {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
members: {
|
||||
handler(n, o) {
|
||||
let num = 0;
|
||||
if (n && n.length) {
|
||||
n.forEach(item => {
|
||||
if (item.online) {
|
||||
num++;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.onlineNum = num;
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleFilterNode(value, data) {
|
||||
if (!value) return true;
|
||||
|
@ -684,7 +684,6 @@ function timedCount(){
|
||||
function callback(Response) {
|
||||
|
||||
data = JSON.parse(Response.body);
|
||||
console.log(data);
|
||||
// if(data.type == 'TrainRun_3D'){
|
||||
// for (let i=0,leni = data.body.length; i<leni; i++) {
|
||||
// data.body[i].type = "TRAIN";
|
||||
|
Loading…
Reference in New Issue
Block a user