From dfbeb6b604d97b151c039b55335a8e46a4f3da88 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 3 Dec 2020 14:01:15 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editTool/routingoperate/routeMap.vue | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/views/planMonitor/editTool/routingoperate/routeMap.vue b/src/views/planMonitor/editTool/routingoperate/routeMap.vue index 889b36b85..9021d0de8 100644 --- a/src/views/planMonitor/editTool/routingoperate/routeMap.vue +++ b/src/views/planMonitor/editTool/routingoperate/routeMap.vue @@ -92,7 +92,6 @@ - 生成交路区段 { - if (valid) { - this.generating = true; - gernateRoutingSection(this.buildModel(setUID('Routing'))).then(resp => { - this.generating = false; - if (resp.data.parkSectionCodeList && resp.data.parkSectionCodeList.length > 2) { - this.addModel.parkSectionCodeList = resp.data.parkSectionCodeList; - } - }).catch((error) => { - this.$messageBox('生成交路区段数据失败: ' + error.message); - this.generating = false; - }); - } - }); - }, editData(data) { this.isSave = false; this.allowSelect = true; @@ -666,8 +648,6 @@ export default { selectedList.forEach(each=>{ const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); const list = section.logicSectionCodeList; - // if() - // relSwitchCode if (list && list.length > 0) { list.forEach(logicSectionCode=>{ const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode); From a52c9786c1ff359c7cd3aefb7fd48c3add8bcff8 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 3 Dec 2020 15:29:45 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=9C=B0=E5=9B=BE=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=9C=B0=E5=9B=BE=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/publish/publishMap/exportMap.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/publish/publishMap/exportMap.vue b/src/views/publish/publishMap/exportMap.vue index df95d6207..13a170844 100644 --- a/src/views/publish/publishMap/exportMap.vue +++ b/src/views/publish/publishMap/exportMap.vue @@ -43,9 +43,15 @@ export default { this.idx = idx; }, async confirm() { - this.dialogVisible = false; this.$set(this.row, 'loading' + this.idx, true); try { + const loading = this.$loading({ + lock: true, + text: '正在导出中...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + this.dialogVisible = false; const data = { mapData: this.checkList.includes('MAP_DATA'), runPlan: this.checkList.includes('RUN_PLAN'), @@ -69,9 +75,11 @@ export default { el.click(); urlObject.revokeObjectURL(url); this.$set(this.row, 'loading' + this.idx, false); + loading.close(); } catch { this.$message.error('导出失败'); this.$set(this.row, 'loading' + this.idx, false); + this.dialogVisible = false; } } } From 66c8fd8de946a04ded4fb746a05bc028c3d69611 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Thu, 3 Dec 2020 16:23:14 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=89=94=E9=99=A4=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E4=B8=AD=E6=97=A7=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/edit/Jlmap3ddata.js | 196 ---- src/jlmap3d/edit/Jlmap3dnewdata.js | 190 ---- src/jlmap3d/edit/editmodel/LinkList.js | 315 ------ src/jlmap3d/edit/editmodel/RailList.js | 69 -- src/jlmap3d/edit/editmodel/RealSectionList.js | 185 ---- .../edit/editmodel/RealSectionModel.js | 8 - src/jlmap3d/edit/editmodel/SectionList.js | 842 ---------------- src/jlmap3d/edit/editmodel/SectionModel.js | 26 - src/jlmap3d/edit/editmodel/SignalList.js | 222 ----- src/jlmap3d/edit/editmodel/SignalModel.js | 36 - .../edit/editmodel/StationStandList.js | 190 ---- .../edit/editmodel/StationStandModel.js | 35 - src/jlmap3d/edit/editmodel/SwitchList.js | 29 - src/jlmap3d/edit/editmodel/SwitchModel.js | 22 - src/jlmap3d/edit/editmodel/TrainList.js | 108 --- src/jlmap3d/edit/editmodel/TrainListTest.js | 175 ---- src/jlmap3d/edit/editmodel/TrainModel.js | 8 - src/jlmap3d/edit/neweditmodel/RailList.js | 84 -- src/jlmap3d/edit/neweditmodel/SectionList.js | 911 ------------------ src/jlmap3d/edit/neweditmodel/SectionModel.js | 26 - src/jlmap3d/edit/neweditmodel/SignalList.js | 270 ------ src/jlmap3d/edit/neweditmodel/SignalModel.js | 36 - .../edit/neweditmodel/StationStandList.js | 301 ------ .../edit/neweditmodel/StationStandModel.js | 35 - src/jlmap3d/edit/neweditmodel/SwitchList.js | 135 --- src/jlmap3d/edit/neweditmodel/SwitchModel.js | 22 - src/jlmap3d/edit/neweditmodel/TrainModel.js | 8 - .../edit/testEditorModel/SectionList.js | 2 +- .../edit/testEditorModel/StationStandList.js | 2 +- 29 files changed, 2 insertions(+), 4486 deletions(-) delete mode 100644 src/jlmap3d/edit/Jlmap3ddata.js delete mode 100644 src/jlmap3d/edit/Jlmap3dnewdata.js delete mode 100644 src/jlmap3d/edit/editmodel/LinkList.js delete mode 100644 src/jlmap3d/edit/editmodel/RailList.js delete mode 100644 src/jlmap3d/edit/editmodel/RealSectionList.js delete mode 100644 src/jlmap3d/edit/editmodel/RealSectionModel.js delete mode 100644 src/jlmap3d/edit/editmodel/SectionList.js delete mode 100644 src/jlmap3d/edit/editmodel/SectionModel.js delete mode 100644 src/jlmap3d/edit/editmodel/SignalList.js delete mode 100644 src/jlmap3d/edit/editmodel/SignalModel.js delete mode 100644 src/jlmap3d/edit/editmodel/StationStandList.js delete mode 100644 src/jlmap3d/edit/editmodel/StationStandModel.js delete mode 100644 src/jlmap3d/edit/editmodel/SwitchList.js delete mode 100644 src/jlmap3d/edit/editmodel/SwitchModel.js delete mode 100644 src/jlmap3d/edit/editmodel/TrainList.js delete mode 100644 src/jlmap3d/edit/editmodel/TrainListTest.js delete mode 100644 src/jlmap3d/edit/editmodel/TrainModel.js delete mode 100644 src/jlmap3d/edit/neweditmodel/RailList.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SectionList.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SectionModel.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SignalList.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SignalModel.js delete mode 100644 src/jlmap3d/edit/neweditmodel/StationStandList.js delete mode 100644 src/jlmap3d/edit/neweditmodel/StationStandModel.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SwitchList.js delete mode 100644 src/jlmap3d/edit/neweditmodel/SwitchModel.js delete mode 100644 src/jlmap3d/edit/neweditmodel/TrainModel.js diff --git a/src/jlmap3d/edit/Jlmap3ddata.js b/src/jlmap3d/edit/Jlmap3ddata.js deleted file mode 100644 index 01d712ebf..000000000 --- a/src/jlmap3d/edit/Jlmap3ddata.js +++ /dev/null @@ -1,196 +0,0 @@ -import { getPublishMapDetail,getMapDetail,set3dMapData,get3dMapData } from '@/api/jlmap3d/load3ddata'; - -//原始信息obj化提供给三维建模 -import {SetObj} from '@/jlmap3d/edit/utils/SetObj.js'; -//componnent -import {SectionList} from '@/jlmap3d/edit/editmodel/SectionList.js'; -import {SignalList} from '@/jlmap3d/edit/editmodel/SignalList.js'; -import {StationStandList} from '@/jlmap3d/edit/editmodel/StationStandList.js'; -import {TrainList} from '@/jlmap3d/edit/editmodel/TrainList.js'; -import {TrainListTest} from '@/jlmap3d/edit/editmodel/TrainListTest.js'; -import {LinkList} from '@/jlmap3d/edit/editmodel/LinkList.js'; -import {RailList} from '@/jlmap3d/edit/editmodel/RailList.js'; - - -import {RealSectionList} from '@/jlmap3d/edit/editmodel/RealSectionList.js'; - -import axios from 'axios'; -import {getmodels} from '@/jlmap3d/edit/connect/getmodels'; -import { Loading } from 'element-ui'; -// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js'; - -export function Jlmap3ddata(mapid,scope){ - let editmapid = mapid; - let scene = scope.scene; - let jlmap3ddata = scope.mapdata; - let assetloader = scope.assetloader; - let loadingInstance = Loading.service({ fullscreen: true }); - get3dMapData(editmapid).then(data => { - //console.log(data); - if(data.code == "200"){ - //console.log("数据存在"); - let isSection = false; - //console.log(data.data); - if(data.data.assets){ - let assets = JSON.parse(data.data.assets); - for(let i=0;i { - //console.log(error); - if(error.code == "30001"){ - //console.log("没有三维数据"); - let params = {mapId:editmapid}; - - set3dMapData(params).then(data => { - if(data.code == "200"){ - //console.log("创建三维数据成功"); - // console.log(data); - initobj(editmapid,data.data.id); - - } - }).catch(error => { - //console.log(error); - }); - - } - }); - - function initobj(mapid,data3did){ - getMapDetail(mapid).then(data => { - let mapdata = data.data; - //console.log(data3did); - jlmap3ddata.id = data3did; - jlmap3ddata.mapId = mapid; - //初始化轨道和道岔 暂时 - jlmap3ddata.linklist = new LinkList(); - jlmap3ddata.sectionlist = new SectionList(); - jlmap3ddata.signallist = new SignalList(); - //初始化站台 - jlmap3ddata.stationstandlist = new StationStandList(); - jlmap3ddata.trainlisttest = new TrainListTest(); - - jlmap3ddata.raillist = new RailList(); - - - assetloader.assetinit(scene) - .then(function(data){ - //console.log(data); - return jlmap3ddata.linklist.initpromise(mapdata.linkList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - loadingInstance.close(); - }); - //初始化信号 - //SetObj(mapdata,scope); - - }); - } - - function init3d(mapid,netdata){ - // console.log(netdata) - getMapDetail(mapid).then(data => { - jlmap3ddata.id = netdata.id; - jlmap3ddata.mapId = mapid; - let mapdata = data.data; - - jlmap3ddata.linklist = new LinkList(); - //初始化轨道和道岔 暂时 - jlmap3ddata.sectionlist = new SectionList(); - jlmap3ddata.signallist = new SignalList(); - //初始化站台 - jlmap3ddata.stationstandlist = new StationStandList(); - //初始化测试列车 - jlmap3ddata.trainlisttest = new TrainListTest(); - - jlmap3ddata.raillist = new RailList(); - - let loaderdata = JSON.parse(netdata.sections); - let switchdata = JSON.parse(netdata.switchs); - let signaldata = JSON.parse(netdata.signals); - let standsdata = JSON.parse(netdata.stands); - console.log(mapdata); - assetloader.setmodellist(netdata.assets,5); - assetloader.assetpromise(scene) - .then(function(data){ - //console.log(data); - return jlmap3ddata.linklist.loadpromise(loaderdata.link,mapdata.linkList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,loaderdata.section,switchdata,scene); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader,standsdata); - }) - .then(function(data){ - return jlmap3ddata.sectionlist.sectionpromise(loaderdata.link,mapdata.linkList,mapdata.sectionList,switchdata,standsdata,scene); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader,"0"); - }) - // .then(function(data){ - // //console.log(data); - // return jlmap3ddata.realsectionlist.loadpromise(jlmap3ddata,scene,assetloader); - // }) - .then(function(data){ - //console.log(data); - - for(let mn=0;mn { - console.log("3dmapdata:"); - console.log(data); - if(data.data ){ - if(data.data.assets){ - // initobj(editmapid,data.data.id); - init3d(editmapid,data.data); - }else{ - initobj(editmapid,data.data.id); - } - - }else{ - let params = {mapId:editmapid}; - - set3dMapData(params).then(data => { - if(data.code == "200"){ - //console.log("创建三维数据成功"); - // console.log(data); - initobj(editmapid,data.data.id); - - } - }).catch(error => { - console.log(error); - }); - } - - }).catch(error => { - console.log(error); - }); - - function initobj(mapid,data3did){ - // console.log(mapid); - // console.log(data3did); - getMapDetail(mapid).then(data => { - console.log(data); - let mapdata = data.data; - //console.log(data3did); - jlmap3ddata.id = data3did; - jlmap3ddata.mapId = mapid; - - // //初始化站台 - jlmap3ddata.stationstandlist = new StationStandList(); - //初始化轨道和道岔 暂时 - jlmap3ddata.sectionlist = new SectionList(); - - jlmap3ddata.signallist = new SignalList(); - - jlmap3ddata.switchlist = new SwitchList(); - // - jlmap3ddata.raillist = new RailList(); - jlmap3ddata.raillist.setrail(); - - assetloader.assetinit(scene) - .then(function(data){ - //console.log(data); - return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene); - }) - .then(function(data){ - //console.log(data); - return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader); - }) - .then(function(data){ - return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader); - }) - - .then(function(data){ - //console.log(data); - loadingInstance.close(); - }); - //初始化信号 - //SetObj(mapdata,scope); - - }); - } - - function init3d(mapid,netdata){ - - // console.log(netdata) - getMapDetail(mapid).then(data => { - jlmap3ddata.id = netdata.id; - jlmap3ddata.mapId = mapid; - let mapdata = data.data; - // console.log(netdata); - // //初始化站台 - jlmap3ddata.stationstandlist = new StationStandList(); - //初始化轨道和道岔 暂时 - jlmap3ddata.sectionlist = new SectionList(); - - jlmap3ddata.signallist = new SignalList(); - - jlmap3ddata.switchlist = new SwitchList(); - - jlmap3ddata.raillist = new RailList(); - - let sectiondata = JSON.parse(netdata.sections); - let switchdata = JSON.parse(netdata.switchs); - let signaldata = JSON.parse(netdata.signals); - let standsdata = JSON.parse(netdata.stands); - jlmap3dasset = JSON.parse(netdata.assets); - console.log(netdata); - if(jlmap3dasset.sceneAssetList == undefined){ - - // loadEditAllAsset(jlmap3dasset); - assetloader.setmodellistnew(netdata.assets,5); - assetloader.assetpromise(scene) - .then(function(data){ - // return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader); - return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - // return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene); - return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene); - }) - .then(function(data){ - //console.log(data); - // return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader); - return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList); - }) - .then(function(data){ - // return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader); - return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - loadingInstance.close(); - }); - }else{ - loadEditAllAsset(jlmap3dasset); - assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5); - assetloader.assetPromiseOver(scene) - .then(function(data){ - console.log(assetloader.modellist); - // return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader); - return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - // return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene); - return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene); - }) - .then(function(data){ - //console.log(data); - // return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader); - return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList); - }) - .then(function(data){ - // return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader); - return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader); - }) - .then(function(data){ - //console.log(data); - loadingInstance.close(); - }); - } - - - }); - } - - - -} diff --git a/src/jlmap3d/edit/editmodel/LinkList.js b/src/jlmap3d/edit/editmodel/LinkList.js deleted file mode 100644 index a4b100395..000000000 --- a/src/jlmap3d/edit/editmodel/LinkList.js +++ /dev/null @@ -1,315 +0,0 @@ - -export function LinkList(data){ - - let scope = this; - - this.type = "linklist"; - - this.linkdata = []; - - this.linksgroup = new THREE.Group(); - this.linksgroup.name = "link"; - - this.initpromise = function(linkdata,scene,assetloader){ - return new Promise(function(resolve, reject){ - linkhelp(linkdata,scene); - - scene.add(scope.linksgroup); - linktest(linkdata,scene,assetloader); - resolve("loadedrealsection"); - }); - }; - - this.loadpromise = function(linkdata,netlink,scene,assetloader){ - return new Promise(function(resolve, reject){ - scene.add(scope.linksgroup); - loadlink(linkdata,netlink,scene,assetloader); - resolve("loadedrealsection"); - }); - }; - -function linkhelp(data,scene){ - let groups = new THREE.Group(); - for(let i=0;i0.49){ - rightlist.push(i); - } - if(autorail.geometry.attributes.position.array[i*3] <-0.49){ - leftlist.push(i); - } - } - - - - for(let i=0;i0.49){ - rightlist.push(i); - } - if(autorail.geometry.attributes.position.array[i*3] <-0.49){ - leftlist.push(i); - } - } - - autorail.rightlist = rightlist; - autorail.leftlist = leftlist; - - - let reallinks = []; - let testlink; - testlink = data; - if(data){ - let index,startdata; - for(let n=0;n=0){ - if(reallinks[i].leftFdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"left"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - if(reallinks[i].leftSdCode && j>=0){ - - if(reallinks[i].leftSdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"left"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - if(reallinks[i].rightFdCode && j>=0){ - if(reallinks[i].rightFdCode == data[j].code){ - - buildmodel(data[j],reallinks[i],j,"right"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - if(reallinks[i].rightSdCode && j>=0){ - if(reallinks[i].rightSdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"right"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - } - } - - function buildmodel(data,mdata,sx,direct){ - let len = data.lengthFact; - - let testmesh2 = autorail.clone(true); - for(let i=0;idata.rp.y){ - testmesh2.rotation.z = 0.218; - data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.lp.y = data.rp.y + (data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.lp.ydata.rp.y){ - testmesh2.rotation.z = 0.218; - data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.rp.y = data.lp.y-(data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.lp.yswitchlist[i].pb[0].x){ - if(((switchlist[i].pc[0].y+switchlist[i].pc[1].y)/2) < switchlist[i].pa[0].y){ - if(((switchlist[i].pc[0].x+switchlist[i].pc[1].x)/2)>switchlist[i].pa[0].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchlist[i].pc[0].x+switchlist[i].pc[1].x)/2)>switchlist[i].pa[0].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.y = Math.PI; - } - switchposx = (saleftpoint+sbrightpoint)/2; - }else{ - if(((switchlist[i].pc[0].y+switchlist[i].pc[1].y)/2) < switchlist[i].pa[1].y){ - if(((switchlist[i].pc[0].x+switchlist[i].pc[1].x)/2)>switchlist[i].pa[1].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchlist[i].pc[0].x+switchlist[i].pc[1].x)/2)>switchlist[i].pa[1].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.y = Math.PI; - } - switchposx = (sarightpoint+sbleftpoint)/2; - } - - sectionA.matrixAutoUpdate = false; - - - testswitch.position.x = switchposx; - testswitch.position.y = 0; - testswitch.position.z = switchposz; - - scope.switchs.modellist.push(testswitch); - scope.switchgroup.add(testswitch); - } - - resolve("loadersection"); - }); - - } - - this.sectionpromise = function(linkdata,linklist,sectiondata,switchdata,standsdata,scene){ - // console.log(linkdata); - // console.log(linklist); - // console.log(sectiondata); - console.log(standsdata); - return new Promise(function(resolve, reject){ - let linkrail = []; - let switchrail = []; - for(let i=0;i0){ - let testline = new THREE.CatmullRomCurve3([ - new THREE.Vector3(linkrail[linkdata[i].code].lp.x,0,linkrail[linkdata[i].code].lp.z), - new THREE.Vector3(linkrail[linkdata[i].code].rp.x,0,linkrail[linkdata[i].code].rp.z) - ]); - - linkrail[linkdata[i].code].type = 1; - if(linkrail[linkdata[i].code].lswitch){ - let switchpoint = switchrail[linkrail[linkdata[i].code].lswitch].position; - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z-0.01)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+3.5,0,switchpoint.z-0.05)); - } - - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92)); - - if(linkrail[linkdata[i].code].rswitch){ - let switchpoint = switchrail[linkrail[linkdata[i].code].rswitch].position; - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-3.5,0,switchpoint.z+0.05)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z+0.01)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - } - - }else{ - let testline = new THREE.CatmullRomCurve3([ - new THREE.Vector3(linkrail[linkdata[i].code].lp.x,0,linkrail[linkdata[i].code].lp.z), - new THREE.Vector3(linkrail[linkdata[i].code].rp.x,0,linkrail[linkdata[i].code].rp.z) - ]); - linkrail[linkdata[i].code].type = 2; - if(linkrail[linkdata[i].code].lswitch){ - let switchpoint = switchrail[linkrail[linkdata[i].code].lswitch].position; - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z+0.01)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+3.5,0,switchpoint.z+0.05)); - } - - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82)); - linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92)); - - if(linkrail[linkdata[i].code].rswitch){ - let switchpoint = switchrail[linkrail[linkdata[i].code].rswitch].position; - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-3.5,0,switchpoint.z-0.05)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z-0.01)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z)); - linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - } - } - } - - } - - for(let i=0;i{ - rightpoints.push(item); - } - ); - rightpoints.reverse(); - linkrail[linkdata[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints); - linkrail[linkdata[i].code].lineright.curveType = "centripetal"; - - // scope.linkrail[linkdata[i].code].lineright.tension = 0.11; - var points = linkrail[linkdata[i].code].lineleft.getPoints( 50 ); - var geometry = new THREE.BufferGeometry().setFromPoints( points ); - var material; - if(linkrail[linkdata[i].code].type == 0){ - material = new THREE.LineBasicMaterial( { color : 0xff0000 } ); - } - if(linkrail[linkdata[i].code].type == 1){ - material = new THREE.LineBasicMaterial( { color : 0x00ff00 } ); - } - if(linkrail[linkdata[i].code].type == 2){ - material = new THREE.LineBasicMaterial( { color : 0x0000ff } ); - } - - - // Create the final object to add to the scene - var curveObject = new THREE.Line( geometry, material ); - - curveObject.position.y = Math.random(); - scene.add(curveObject); - } - - let standsections = []; - for(let i=0,len=sectiondata.length;istandsdata[n].position.z){ - circle1.position.x = standsdata[n].position.x-64; - circle1.position.y = 5; - circle1.position.z = linkrail[linklist[j].code].points[0].z; - circle1.rotation.x = -Math.PI/2; - - circle2.position.x = standsdata[n].position.x+64; - circle2.position.y = 5; - circle2.position.z = linkrail[linklist[j].code].points[0].z-(linkrail[linklist[j].code].points[0].z-standsdata[n].position.z)*2; - circle2.rotation.x = -Math.PI/2; - }else{ - circle1.position.x = standsdata[n].position.x+64; - circle1.position.y = 5; - circle1.position.z = linkrail[linklist[j].code].points[0].z+(standsdata[n].position.z-linkrail[linklist[j].code].points[0].z)*2; - circle1.rotation.x = -Math.PI/2; - - circle2.position.x = standsdata[n].position.x-64; - circle2.position.y = 5; - circle2.position.z = linkrail[linklist[j].code].points[0].z; - circle2.rotation.x = -Math.PI/2; - } - - - scene.add( circle1 ); - scene.add( circle2 ); - n = lenn; - } - } - // console.log(standsections[i]); - // console.log(linklist[j]); - // console.log("===================================="); - - let progress1 = standsections[i].leftStopPointOffset/linklist[j].lengthFact; - let progress2 = standsections[i].rightStopPointOffset/linklist[j].lengthFact; - - let point1 = linkrail[linklist[j].code].lineleft.getPointAt(progress1); - - var geometry = new THREE.CircleGeometry( 2, 16 ); - var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - let circle1 = new THREE.Mesh( geometry, material ); - circle1.position.x = point1.x; - circle1.position.y = point1.y; - circle1.position.z = point1.z; - circle1.rotation.x = -Math.PI/2; - scene.add( circle1 ); - - let point2 = linkrail[linklist[j].code].lineleft.getPointAt(progress2); - let circle2 = new THREE.Mesh( geometry, material ); - circle2.position.x = point2.x; - circle2.position.y = point2.y; - circle2.position.z = point2.z; - circle2.rotation.x = -Math.PI/2; - scene.add( circle2 ); - // console.log(progress1); - // console.log(progress2); - // console.log(standsections[i].leftStopPointOffset); - // console.log(standsections[i].rightStopPointOffset); - // console.log(linklist[j].lengthFact); - // console.log(linkrail[linklist[j].code].lineleft.points); - // console.log(point1); - // console.log(point2); - // console.log("===================================="); - - j = lenj; - - - - } - } - } - resolve("loadersection"); - }); - - } - // - // this.init = function(sectiondata,switchdata,scene){ - // - // //遍历区段 - // for(let i=0;iswitchdata[i].pb[0].x){ - if(((switchdata[i].pc[0].y+switchdata[i].pc[1].y)/2) < switchdata[i].pa[0].y){ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[0].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[0].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.z = Math.PI; - } - }else{ - if(((switchdata[i].pc[0].y+switchdata[i].pc[1].y)/2) < switchdata[i].pa[1].y){ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[1].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[1].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.z = Math.PI; - } - } - - testswitch.position.x = switchdata[i].position.x; - testswitch.position.y = switchdata[i].position.y; - testswitch.position.z = switchdata[i].position.z; - // testswitch.rotation.x = switchdata[i].rotation._x; - // testswitch.rotation.y = switchdata[i].rotation._y; - // testswitch.rotation.z = switchdata[i].rotation._z; - - scope.switchs.datalist.push(newswitch); - scope.switchs.modellist.push(testswitch); - scope.switchgroup.add(testswitch); - } - - resolve("loadersection"); - }); - - } - - function buildsuidao(linkdata,suidaodata,assetloader,scene){ - let autosuidao; - for(let i=0;i7){ - rightlist.push(i); - if(autosuidao.geometry.attributes.position.array[i*3] > rightpoint){ - rightpoint = i; - } - } - if(autosuidao.geometry.attributes.position.array[i*3] <-7){ - leftlist.push(i); - if(autosuidao.geometry.attributes.position.array[i*3] < rightpoint){ - leftpoint = i; - } - } - } - autosuidao.rightlist = rightlist; - autosuidao.leftlist = leftlist; - autosuidao.rightpoint = rightpoint; - autosuidao.leftpoint = leftpoint; - // console.log(autosuidao); - // console.log(linkdata.linksgroup.children); - // console.log(suidaodata.datalist); - for(let i = 0;i < suidaodata.datalist.length;i++){ - let link = linkdata.linksgroup.getObjectByProperty("code",suidaodata.datalist[i].linkCode); - let suidao = suidaodata.datalist[i]; - let len = suidao.offsetRight-suidao.offsetLeft; - // console.log("-------------------------------------"); - // console.log("name:"+link.name); - // console.log(link.lengthfact); - // console.log(len); - // console.log("ofl:"+suidao.offsetLeft+" "+"ofr:"+suidao.offsetRight); - // console.log("-------------------------------------"); - - let testmesh1 = autosuidao.clone(true); - for(let i=0;i link.rp.y){ - testmesh1.position.z = link.lp.y-suidao.offsetLeft*(len/lenfact) + (link.rp.y-link.lp.y)*(len/lenfact)/2; - }else{ - testmesh1.position.z = link.lp.y+suidao.offsetLeft*(len/lenfact) + (link.rp.y-link.lp.y)*(len/lenfact)/2; - } - }else{ - testmesh1.position.x = link.lp.x+suidao.offsetLeft+len/2; - testmesh1.position.z = link.position.z; - } - testmesh1.position.y = 3.5; - // testmesh1.rotation.x = Math.PI/4; - testmesh1.code = suidaodata.datalist[i].code; - testmesh1.name = suidaodata.datalist[i].code; - // testmesh1.position.z = link.position.z; - testmesh1.relStandCode = suidaodata.datalist[i].relStandCode; - // testmesh1.stationCode = suidaodata.datalist[i].stationCode; - - testmesh1.rightlist = autosuidao.rightlist; - testmesh1.leftlist = autosuidao.leftlist; - testmesh1.rightpoint = autosuidao.rightpoint; - testmesh1.leftpoint = autosuidao.leftpoint; - testmesh1.isStandTrack = suidaodata.datalist[i].isStandTrack; - testmesh1.lengthfact = len; - testmesh1.linkCode = suidao.linkCode; - if(suidaodata.datalist[i].isStandTrack == false){ - scope.sectiongroup.add(testmesh1); - - }else{ - scope.standtrack.push(testmesh1); - var box = new THREE.BoxHelper( testmesh1, 0xff0000 ); - scope.sectiongroup.add( box ); - } - scope.sections.modellist.push(testmesh1); - } - } - - this.resetsection = function(scene){ - scene.remove(scope.sectiongroup); - }; - - this.reposition = function(){ - - } - - - this.update = function(){ - - } - - this.renderon = function(){ - - } - - this.renderoff = function(){ - - } - - this.dispose = function(){ - - } - -} diff --git a/src/jlmap3d/edit/editmodel/SectionModel.js b/src/jlmap3d/edit/editmodel/SectionModel.js deleted file mode 100644 index 9ba9abb07..000000000 --- a/src/jlmap3d/edit/editmodel/SectionModel.js +++ /dev/null @@ -1,26 +0,0 @@ -export function SectionModel(data) { - var scope = this; - //命名 - this.name = null; - //code - this.code = null; - //索引位置 - this.index = null; - //轨迹点 - this.rail = []; - - this.railline = null; - //长度 - this.distance = []; - - this.isStandTrack = null; - - this.type = null; - //指向模型 - this.mesh = null; - // //模型地址 - // this.meshurl = null; - // //贴图地址 - // this.picurl = null; - -} diff --git a/src/jlmap3d/edit/editmodel/SignalList.js b/src/jlmap3d/edit/editmodel/SignalList.js deleted file mode 100644 index 06e6d98d6..000000000 --- a/src/jlmap3d/edit/editmodel/SignalList.js +++ /dev/null @@ -1,222 +0,0 @@ -import {SignalModel} from '@/jlmap3d/edit/editmodel/SignalModel.js'; - -export function SignalList() { - - let scope = this; - - this.type = "signallist"; - - this.list = []; - - this.group = new THREE.Group(); - - this.initpromise = function(jlmap3ddata,data,scene,assetloader,netdata){ - return new Promise(function(resolve, reject){ - scope.group.name = "signal"; - //遍历信号数据 - let netsignal = null; - let haddata = false; - if(netdata){ - netsignal = JSON.parse(netdata); - haddata = true; - } - let linkdata = jlmap3ddata.linklist; - for(let i=0;i link.lengthfact/2){ - posx = link.position.x + data[i].offset - link.lengthfact/2-10; - }else{ - posx = link.position.x - (link.lengthfact/2 - data[i].offset)+10; - } - //根据线路方向修改信号灯位置 - if(data[i].directionType == "01"){ - newmesh.position.set(posx,0,link.position.z-3); - newmesh.rotation.z = ( Math.PI / 2 ); - }else if(data[i].directionType == "02"){ - newmesh.position.set(posx,0,link.position.z+3); - newmesh.rotation.z = ( - Math.PI / 2 ); - } - newmesh.scale.x = 0.05; - newmesh.scale.y = 0.05; - newmesh.scale.z = 0.05; - newmesh.offset = data[i].offset; - newmest.linkCode = data[i].linkCode; - newsignal.mesh = newmesh; - newsignal.offset = data[i].offset; - newsignal.mesh.status = "01"; - scope.group.add(newsignal.mesh); - scope.list.push(newsignal); - - }else{ - for(let j=0;j0.49){ - rightlist.push(i); - } - if(autorail.geometry.attributes.position.array[i*3] <-0.49){ - leftlist.push(i); - } - } - autorail.rightlist = rightlist; - autorail.leftlist = leftlist; - - return new Promise(function(resolve, reject){ - // scene.add(scope.sectiondata); - scene.add(scope.sectiongroup); - - - //收集需要显示区段 - for(let i=0;i sectiondata[i].points[sectiondata[i].points.length-1].y){ - // newsection.iscur = "1"; - // }else if(sectiondata[i].points[0].y < sectiondata[i].points[sectiondata[i].points.length-1].y){ - // newsection.iscur = "2"; - // }else{ - // newsection.iscur = "3"; - // } - // console.log(scope.sections.datalist[sectiondata[i].code]); - if(sectiondata[i].standTrack == true){ - sectiondata[i].startx = sectiondata[i].points[0].x; - sectiondata[i].starty = sectiondata[i].points[0].y; - scope.sections.datalist[sectiondata[i].code].lengthFact = 134; - sectiondata[i].lengthFact = 134; - // console.log(sectiondata[i].lengthFact); - scope.stopsection.push(sectiondata[i]); - } - // sections.modellist.push(""); - } - } - - //连接区段 - for(let i=0;i cposx){ - if(aposy < cposy){ - // ——A - // /C - scope.sections.datalist[ccode].ctype = 1; - }else{ - // \C - // ——A - scope.sections.datalist[ccode].ctype = 2; - } - }else{ - if(aposy < cposy){ - // A—— - // \C - scope.sections.datalist[ccode].ctype = 3; - }else{ - // /C - // A—— - scope.sections.datalist[ccode].ctype = 4; - } - } - - if(scope.sections.datalist[acode].rsection == "" || scope.sections.datalist[acode].rsection == undefined){ - scope.sections.datalist[acode].rsection = bcode; - scope.sections.datalist[acode].csection = ccode; - }else if(scope.sections.datalist[acode].lsection == "" || scope.sections.datalist[acode].lsection == undefined){ - scope.sections.datalist[acode].lsection = bcode; - scope.sections.datalist[acode].csection = ccode; - } - - if(scope.sections.datalist[bcode].rsection == "" || scope.sections.datalist[bcode].rsection == undefined){ - scope.sections.datalist[bcode].rsection = acode; - }else if(scope.sections.datalist[bcode].lsection == "" ||scope.sections.datalist[bcode].lsection == undefined ){ - scope.sections.datalist[bcode].lsection = acode; - } - - if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){ - scope.sections.datalist[ccode].rsection = acode; - }else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){ - scope.sections.datalist[ccode].lsection = acode; - } - } - - - // console.log(scope.sections.datalist); - // console.log(scope.stopsection); - let stationlist = jlmap3ddata.stationstandlist.list; - console.log(jlmap3ddata.stationstandlist.list); - let stopsections = []; - - - for(let i=0,leni = stationlist.length;i scope.stopsection[i+1].starty){ - // realstopsection.topsection = scope.stopsection[i+1]; - // realstopsection.downsection = scope.stopsection[i]; - // }else{ - // realstopsection.topsection = scope.stopsection[i]; - // realstopsection.downsection = scope.stopsection[i+1]; - // } - // stopsections.push(realstopsection); - // i=i+2; - // } - // - // }else{ - // alert("erro stopsection length"); - // } - - let leng1 = 0; - let leng2 = 0; - for(let i=0,leni=stopsections.length;i downresults.distance){ - let offset = topresults.distance - downresults.distance; - console.log(downresults.findarray); - for(let n=0,lenn= downresults.findarray.length;nmaxsection){ - maxlengthfact = downresults.findarray[n].lengthFact; - console.log(n); - - - maxsection = downresults.findarray[n]; - } - } - console.log(maxsection); - scope.sections.datalist[maxsection.code].lengthFact += offset; - }else if(topresults.distance < downresults.distance){ - let offset = downresults.distance - topresults.distance; - for(let n=0,lenn= topresults.findarray.length;nmaxsection){ - maxlengthfact = topresults.findarray[n].lengthFact; - maxsection = topresults.findarray[n]; - } - } - scope.sections.datalist[maxsection.code].lengthFact += offset; - } - - } - } - - let topstartpoint = { - x:stopsections[0].topsection.points[0].x, - y:0, - z:stopsections[0].topsection.points[0].y - }; - - let downstartpoint = { - x:stopsections[0].downsection.points[0].x, - y:0, - z:stopsections[0].downsection.points[0].y - }; - console.log(stopsections[1].topsection.lengthFact); - createsection(autorail,topstartpoint,stopsections[0].topsection.code,stopsections[1].topsection.code,0); - createsection(autorail,downstartpoint,stopsections[0].downsection.code,stopsections[1].downsection.code,34.8); - for(let i=1,leni=stopsections.length;idata.points[data.pointslength].y){ - testmesh2.rotation.z = 0.2193; - data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z); - - }else if(data.points[0].ydata.points[data.pointslength].y){ - testmesh2.rotation.z = 0.2193; - data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.points[0].ydata.points[data.pointslength].y){ - testmesh2.rotation.z = 0.2193; - data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.points[0].ydata.points[data.pointslength].y){ - testmesh2.rotation.z = 0.2193; - data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.points[0].y2){ - // console.log(newsection); - let height = Math.random()/1000; - var closedSpline = new THREE.CatmullRomCurve3( [ - new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z), - new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z), - new THREE.Vector3(newsection.railpoint[2].x,height,newsection.railpoint[2].z) - ] ); - closedSpline.type = 'catmullrom'; - closedSpline.closed = false; - var extrudeSettings = { - steps : 5, - curveSegments : 1, - bevelSegments : 1, - bevelEnabled : false, - extrudePath : closedSpline, - }; - var shape = new THREE.Shape(); - shape.moveTo( 0,-2 ); - shape.lineTo( 0, 2 ); - var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings ); - testmesh2 = new THREE.Mesh( geometry, selectmaterial ); - - testmesh2.railpoint = [ - {x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z}, - {x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[1].z}, - {x:newsection.railpoint[2].x,y:height,z:newsection.railpoint[2].z}, - ]; - testmesh2.lengthFact = newsection.railpoint[2].x - newsection.railpoint[0].x; - // closedSpline.arcLengthDivisions; - let count = testmesh2.geometry.attributes.position.count/3; - - for(let i=0;i section.lengthFact/2){ - posx = section.mesh.position.x + data[i].sectionOffset - section.lengthFact/2; - }else{ - posx = section.mesh.position.x - (section.lengthFact/2 - data[i].sectionOffset); - } - //根据线路方向修改信号灯位置 - if(data[i].right == false){ - if(section.standTrack == true){ - posx = posx - 7; - } - - newmesh.position.set(posx,0,section.mesh.position.z-3); - newmesh.rotation.z = ( Math.PI / 2 ); - }else if(data[i].right == true){ - if(section.standTrack == true){ - posx = posx + 7; - } - newmesh.position.set(posx,0,section.mesh.position.z+3); - newmesh.rotation.z = ( - Math.PI / 2 ); - } - newmesh.scale.x = 0.05; - newmesh.scale.y = 0.05; - newmesh.scale.z = 0.05; - newmesh.sectionOffset = data[i].sectionOffset; - newmesh.sectionCode = data[i].sectionCode; - newmesh.right = data[i].right; - newsignal.mesh = newmesh; - - newsignal.sectionOffset = data[i].sectionOffset; - newsignal.mesh.status = "01"; - newsignal.name = data[i].name; - newsignal.modelid = assetloader.modellist[num].id; - newsignal.code = data[i].code; - newsignal.sectionCode = data[i].sectionCode; - newsignal.right = data[i].right; - scope.group.add(newmesh); - scope.list.push(newsignal); - - }else{ - for(let j=0;jsectiondata[data[i].sectionBCode].mesh.position.x){ - autoswitch.position.set(sectiondata[data[i].sectionACode].lp.x,0,sectiondata[data[i].sectionACode].lp.z); - autoswitch.rotation.z = Math.PI; - }else{ - autoswitch.position.set(sectiondata[data[i].sectionACode].rp.x,0,sectiondata[data[i].sectionACode].rp.z); - - } - } - - resolve("loadedswitch"); - }); - - } - - this.loadpromise = function(jlmap3ddata,switchdata,scene,assetloader){ - return new Promise(function(resolve, reject){ - scene.add( scope.switchgroup ); - // let sectiondata = jlmap3ddata.sectionlist.sections.datalist; - // console.log(sectiondata); - let num; - for(let j=0;j sectionB.railpoint[0].x){ - scope.switchs.modellist[i].position.set(sectionA.railpoint[0].x,0,sectionA.railpoint[0].z); - }else{ - scope.switchs.modellist[i].position.set(sectionA.railpoint[1].x,0,sectionA.railpoint[1].z); - } - } - } - - this.update = function(){ - - } - - this.renderon = function(){ - - } - - this.renderoff = function(){ - - } - - this.dispose = function(){ - - } - -} diff --git a/src/jlmap3d/edit/neweditmodel/SwitchModel.js b/src/jlmap3d/edit/neweditmodel/SwitchModel.js deleted file mode 100644 index bd8e452a3..000000000 --- a/src/jlmap3d/edit/neweditmodel/SwitchModel.js +++ /dev/null @@ -1,22 +0,0 @@ -export function SwitchModel() { - - var scope = this; - //命名 - this.name = null; - //code - this.code = null; - //索引位置 - this.index = null; - //轨迹点 - this.rail = []; - //长度 - this.distance = null; - - this.action = null; - //指向模型 - this.mesh = null; - // //模型地址 - // this.meshurl = null; - // //贴图地址 - // this.picurl = null; -} diff --git a/src/jlmap3d/edit/neweditmodel/TrainModel.js b/src/jlmap3d/edit/neweditmodel/TrainModel.js deleted file mode 100644 index 7bf6a92cb..000000000 --- a/src/jlmap3d/edit/neweditmodel/TrainModel.js +++ /dev/null @@ -1,8 +0,0 @@ -export function TrainModel(opts) { - - var scope = this; - - this.mesh = null; - this.meshurl = null; - this.picurl = null; -} diff --git a/src/jlmap3d/edit/testEditorModel/SectionList.js b/src/jlmap3d/edit/testEditorModel/SectionList.js index 5f43109e3..0113f0556 100644 --- a/src/jlmap3d/edit/testEditorModel/SectionList.js +++ b/src/jlmap3d/edit/testEditorModel/SectionList.js @@ -1027,7 +1027,7 @@ export function SectionList() { let ccode = switch2d[i].sectionCCode; // console.log(switchdata[i]); - console.log(scope.sections.datalist[acode]); + // console.log(scope.sections.datalist[acode]); let aposx = (scope.sections.datalist[acode].points[0].x + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].x)/2; let cposx = (scope.sections.datalist[ccode].points[0].x + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].x)/2; diff --git a/src/jlmap3d/edit/testEditorModel/StationStandList.js b/src/jlmap3d/edit/testEditorModel/StationStandList.js index 5cc7e5e1d..b9f2537c8 100644 --- a/src/jlmap3d/edit/testEditorModel/StationStandList.js +++ b/src/jlmap3d/edit/testEditorModel/StationStandList.js @@ -90,7 +90,7 @@ export function StationStandList() { this.loadpromise = function(jlmap3ddata,standsdata,jlmapstanddata,scene,assetloader){ return new Promise(function(resolve, reject){ // console.log(jlmap3ddata); - // console.log(standsdata); + console.log(standsdata); // console.log(jlmapstanddata); let stations = jlmap3ddata.stationstandlist.list; let num; From ddd6905a0c6b33ad41191f31aeb7fdf537f89ecb Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 3 Dec 2020 16:36:21 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/cmdPlugin/Handler.js | 5 +++++ src/views/demonstration/detail/index.vue | 20 ++++++++++++-------- src/views/teach/detail/index.vue | 24 ++++++++++-------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index 832693c12..bacaea416 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -52,6 +52,8 @@ class Handler { } reject(error); }); + } else { + reject(); } }); } @@ -122,6 +124,9 @@ class Handler { } else { resolve(rtn); } + }).catch(()=>{ + rtn.valid = valid; + resolve(rtn); }); }); } diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 56de6af57..153bfd875 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -33,7 +33,7 @@ import { getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; export default { - name: 'ExamDetailList', + name: 'SimulationDetailList', components: { LimitList }, @@ -255,18 +255,21 @@ export default { .joylink-card{ height: 100%; overflow: hidden; - .card-title{ - height: 47px; - line-height: 47px; - text-align: center; - border-bottom: 1px solid #d6d6d6; - } + display:flex; + flex-direction: column; + } + .card-title{ + width: 100%; + height: 47px; + line-height: 47px; + text-align: center; + border-bottom: 1px solid #d6d6d6; } .simulation-detail { padding: 50px; padding-bottom: 0; - height: calc(100% - 107px); overflow: auto; + flex: 1; } .list-item { @@ -288,6 +291,7 @@ export default { .btn-buy { text-align: center; padding: 10px 0; + flex-shrink: 0; } .el-tabs--border-card>.el-tabs__header .el-tabs__item { diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index b572b0e72..c2f6a9904 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -244,16 +244,18 @@ export default { @import "src/styles/mixin.scss"; .joylink-card{ height: 100%; - .card-title{ - height: 47px; - line-height: 47px; - text-align: center; - border-bottom: 1px solid #e6e6e6; - } + display:flex; + flex-direction: column; } + .card-title{ + height: 47px; + line-height: 47px; + text-align: center; + border-bottom: 1px solid #e6e6e6; + } .content_box{ padding: 50px; - height: calc(100% - 107px); + flex: 1; overflow: auto; padding-bottom: 0; } @@ -273,12 +275,6 @@ export default { .btn-buy { text-align: center; padding: 10px 0; - } - .custom-tree-node { - flex: 1; - display: flex; - align-items: center; - justify-content: space-between; - padding-right: 50px; + flex-shrink: 0; } From a61bba357af80c6873bfb0226756867273090abb Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Thu, 3 Dec 2020 16:49:38 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=89=94=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit/testEditorModel/SectionList.js | 4 +- .../edit/testEditorModel/SignalList.js | 2 +- .../edit/testEditorModel/SwitchList.js | 2 +- src/jlmap3d/edit/testEditorModel/TrainList.js | 108 ++++++++++++++++++ src/jlmap3d/main/newmodel/TrainListN.js | 2 +- 5 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 src/jlmap3d/edit/testEditorModel/TrainList.js diff --git a/src/jlmap3d/edit/testEditorModel/SectionList.js b/src/jlmap3d/edit/testEditorModel/SectionList.js index 0113f0556..66ead2811 100644 --- a/src/jlmap3d/edit/testEditorModel/SectionList.js +++ b/src/jlmap3d/edit/testEditorModel/SectionList.js @@ -1,5 +1,5 @@ -import {SectionModel} from '@/jlmap3d/edit/editmodel/SectionModel.js'; -import {SwitchModel} from '@/jlmap3d/edit/editmodel/SwitchModel.js'; +import {SectionModel} from '@/jlmap3d/edit/testEditorModel/SectionModel.js'; +import {SwitchModel} from '@/jlmap3d/edit/testEditorModel/SwitchModel.js'; import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; export function SectionList() { diff --git a/src/jlmap3d/edit/testEditorModel/SignalList.js b/src/jlmap3d/edit/testEditorModel/SignalList.js index 606fb257d..410b966a2 100644 --- a/src/jlmap3d/edit/testEditorModel/SignalList.js +++ b/src/jlmap3d/edit/testEditorModel/SignalList.js @@ -1,4 +1,4 @@ -import {SignalModel} from '@/jlmap3d/edit/editmodel/SignalModel.js'; +import {SignalModel} from '@/jlmap3d/edit/testEditorModel/SignalModel.js'; export function SignalList() { diff --git a/src/jlmap3d/edit/testEditorModel/SwitchList.js b/src/jlmap3d/edit/testEditorModel/SwitchList.js index b66bbedf8..01bb357ce 100644 --- a/src/jlmap3d/edit/testEditorModel/SwitchList.js +++ b/src/jlmap3d/edit/testEditorModel/SwitchList.js @@ -1,4 +1,4 @@ -import {SwitchModel} from '@/jlmap3d/edit/neweditmodel/SwitchModel.js'; +import {SwitchModel} from '@/jlmap3d/edit/testEditorModel/SwitchModel.js'; export function SwitchList() { diff --git a/src/jlmap3d/edit/testEditorModel/TrainList.js b/src/jlmap3d/edit/testEditorModel/TrainList.js new file mode 100644 index 000000000..d9cac625e --- /dev/null +++ b/src/jlmap3d/edit/testEditorModel/TrainList.js @@ -0,0 +1,108 @@ +import {TrainModel} from '@/jlmap3d/edit/testEditorModel/TrainModel.js'; +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; + +export function TrainList() { + + let scope = this; + + this.type = "trainlist"; + + this.list = []; + + this.group = []; + + this.textlist = []; + + this.init = function(data,scene){ + scope.group = new THREE.Group(); + scope.group.name = "train"; + scene.add(scope.group); + // model + THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() ) ; + for(let i=0;i Date: Thu, 3 Dec 2020 18:22:04 +0800 Subject: [PATCH 6/9] company update --- src/api/management/user.js | 4 ++-- .../haerbin_01/menus/menuDialog/logDetail.vue | 4 ++-- src/layout/components/userInfo.vue | 24 +++++++------------ src/utils/baseUrl.js | 4 ++-- src/views/system/userControl/edit.vue | 4 ++-- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/api/management/user.js b/src/api/management/user.js index ed32b4ef5..e70b2d586 100644 --- a/src/api/management/user.js +++ b/src/api/management/user.js @@ -52,9 +52,9 @@ export function saveUserSubscribe(data) { } // 修改用户信息 -export function putRoles(data) { +export function updateUserInfo(data) { return request({ - url: `/api/user/${data.id}/info`, + url: `/api/user/superAdmin/update/userInfo`, method: 'put', data: data }); diff --git a/src/jmapNew/theme/haerbin_01/menus/menuDialog/logDetail.vue b/src/jmapNew/theme/haerbin_01/menus/menuDialog/logDetail.vue index 5537c3176..295893e1c 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuDialog/logDetail.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuDialog/logDetail.vue @@ -26,10 +26,10 @@ style="width: 100%" height="600" > - + - + - - - - - - - - +
+
单位:
+
+
+ {{ userInfo.companyId }} +
+
+
绑定微信:
@@ -286,7 +286,7 @@ import QrcodeVue from 'qrcode.vue'; import { setInterval, clearInterval } from 'timers'; import { checkLoginStatus } from '@/api/login'; import { getSessionStorage } from '@/utils/auth'; -import { getCompanyList } from '@/api/company'; +// import { getCompanyList } from '@/api/company'; export default { components: { QrcodeVue }, @@ -322,7 +322,6 @@ export default { mobileShow: true, emailShow: true, passwordShow: true, - companyShow: true, mobileCode: null, emailCode: null, passWordCode: null, @@ -413,16 +412,11 @@ export default { this.mobileShow = true; this.emailShow = true; this.passwordShow = true; - this.companyShow = true; }, switcherName() { this.editInfo.name = this.userInfo.name; this.nameShow = !this.nameShow; }, - switcherCompany() { - this.editInfo.companyId = this.userInfo.companyId; - this.companyShow = !this.companyShow; - }, async saveName() { if (this.editInfo.name) { try { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index c0569ef83..ef240edc3 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,10 +2,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.129:9000'; // 旭强 - // BASE_API = 'http://192.168.8.119:9000'; // 张赛 + BASE_API = 'http://192.168.8.119:9000'; // 张赛 // BASE_API = 'http://192.168.8.110:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/system/userControl/edit.vue b/src/views/system/userControl/edit.vue index 8db7652b9..c56f573be 100644 --- a/src/views/system/userControl/edit.vue +++ b/src/views/system/userControl/edit.vue @@ -9,7 +9,7 @@