From 5fe4a7a3fb461a948bb157e04d3a1c773b7c78ed Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Thu, 2 Sep 2021 18:05:29 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=BC=96=E8=BE=91=E5=99=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=9C=BA=E6=99=AF=E8=A7=86=E8=A7=92=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/lesson3d/lesson3dplayer.js | 10 +++-- .../lesson3d/manager/assetmodelmanager.js | 22 ++++++++++ .../lesson3d/manager/controlmanager.js | 41 ++++++++++++++----- .../assetmodelmanager/assetmodelmanager.js | 2 +- .../lesson3dedit/component/property.vue | 3 +- .../jlmap3d/lesson3dplayer/lesson3dplayer.vue | 17 ++++---- .../lesson3dplayer/tools/explainpane.vue | 20 +++------ .../lesson3dplayer/tools/processlog.vue | 9 ++-- .../lesson3dplayer/tools/stepstips.vue | 27 +++++++++--- static/lesson3d/occPZ.obj | 8 ++-- 10 files changed, 108 insertions(+), 51 deletions(-) diff --git a/src/jlmap3d/lesson3d/lesson3dplayer.js b/src/jlmap3d/lesson3d/lesson3dplayer.js index 1a84b8f0b..bb7e36e89 100644 --- a/src/jlmap3d/lesson3d/lesson3dplayer.js +++ b/src/jlmap3d/lesson3d/lesson3dplayer.js @@ -104,13 +104,17 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { // console.log(nowRole); // console.log(lessonData.lessonProgress[lessonIndex].roleName); if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){ - controlManager.initControlMode(lessonIndex); + assetModelManager.changeSceneGroup(scope.nowSceneType); controlManager.initRoleMode(true,nowRole); + controlManager.initControlMode(lessonIndex); controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,true,assetModelManager.lessonTriggerList[scope.nowSceneType]); - }else{ - controlManager.initControlMode(lessonIndex); + } else{ + if(lessonData.lessonProgress[lessonIndex].roleName == 'kong'){ + assetModelManager.changeSceneGroup(scope.nowSceneType); controlManager.initRoleMode(false,nowRole); + } controlManager.initRoleMode(false,nowRole); + controlManager.initControlMode(lessonIndex); controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false,assetModelManager.lessonTriggerList[scope.nowSceneType]); } diff --git a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js index 8c430e5a6..8118cd0ec 100644 --- a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js +++ b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js @@ -13,6 +13,7 @@ export function AssetModelManager(editor,scene) { groupList["standstation"] = new THREE.Group(); groupList["stopstation"] = new THREE.Group(); groupList["device"] = new THREE.Group(); + groupList["occ"] = new THREE.Group(); groupList["xl"] = new THREE.Group(); groupList["dc"] = new THREE.Group(); @@ -90,15 +91,36 @@ export function AssetModelManager(editor,scene) { sceneType:"stopstation", }; + scope.staticAsset['occ'] = { + modelId:'occ', + packageName:"occ大厅", + url:"/MODEL/2021-09-02/210-32471.FBX", + mesh:"", + assetType:'onlineasset', + isUse:true, + resourceType:"三维课程", + sceneType:"occ", + }; //场景中可触发事件模型 this.lessonTriggerList = []; scope.lessonTriggerList["standstation"] = []; scope.lessonTriggerList["stopstation"] = []; scope.lessonTriggerList["device"] = []; + scope.lessonTriggerList["occ"] = []; scope.lessonTriggerList["xl"] = []; scope.lessonTriggerList["dc"] = []; + this.changeSceneGroup = function(groupType){ + // console.log(groupType); + // console.log(editor.nowSceneType); + // console.log(scope.lessonTriggerList[editor.nowSceneType]); + editor.nowSceneType = groupType; + scene.remove(this.otherModel); + this.otherModel = groupList[groupType]; + scene.add(this.otherModel); + updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]); + } //加载课程资源 this.lessonAssetsLoader = function(lessonData){ let initlist = []; diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js index 4e64c1665..81f90cca5 100644 --- a/src/jlmap3d/lesson3d/manager/controlmanager.js +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -84,7 +84,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { let loaderObj = new THREE.OBJLoader(); - let standstationPZ,stopstationPZ; + let standstationPZ,stopstationPZ,occPZ; // load a resource loaderObj.load( JL3D_LOCAL_STATIC+'/lesson3d/standstationPZ.obj', @@ -110,6 +110,19 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { console.log( 'An error happened' ); } ); + loaderObj.load( + JL3D_LOCAL_STATIC+'/lesson3d/occPZ.obj', + function ( object ) { + occPZ = object; + }, + function ( xhr ) { + console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' ); + }, + function ( error ) { + console.log( 'An error happened' ); + } + ); + this.initRoleMode = function(rMode,role){ roleMode = rMode; nowRole = role; @@ -215,7 +228,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { this.init = function(actions){ - worldOctree.fromGraphNode( standstationPZ ); + // worldOctree.fromGraphNode( standstationPZ ); actionList = actions; } @@ -279,6 +292,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { } }else if(raycasterBoxs[i].type == "urgeSwitch"){ + console.log(raycasterBoxs[i]); if(raycasterBoxs[i].action.status == "02"){ raycasterBoxs[i].action.status = "01"; raycasterBoxs[i].action.action.stop(); @@ -485,16 +499,23 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { } this.initControlMode = function(nowLessonIndex){ - console.log(lessonData.lessonProgress[nowLessonIndex].progressScene); + // console.log(lessonData.lessonProgress[nowLessonIndex].progressScene); if(lessonData.lessonProgress[nowLessonIndex].progressScene == "standstation"){ worldOctree.fromGraphNode( standstationPZ ); }else if(lessonData.lessonProgress[nowLessonIndex].progressScene == "stopstation"){ worldOctree.fromGraphNode( stopstationPZ ); + }else if(lessonData.lessonProgress[nowLessonIndex].progressScene == "occ"){ + worldOctree.fromGraphNode( occPZ ); } - scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; - if(lessonData.lessonProgress[nowLessonIndex].changeCamera == true){ + + + + if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){ + console.log(scope.controlMode); + + scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; if(scope.controlMode == "free" || scope.controlMode == "non"){ scope.nowCamera = orbitCamera; oribitControl.enabled = true; @@ -537,11 +558,11 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { // eventBoxs = newEventBoxs; raycasterBoxs = []; roleMode = rMode; - console.log("---------changeIndex--------"); - console.log(actions); - console.log(roleMode); - console.log(eventTrigger); - console.log("----------------------------"); + // console.log("---------changeIndex--------"); + // console.log(actions); + // console.log(roleMode); + // console.log(eventTrigger); + // console.log("----------------------------"); if(actions.length>0 && roleMode){ diff --git a/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js b/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js index 3250ebb3c..6feedfdea 100644 --- a/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js +++ b/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js @@ -102,7 +102,7 @@ export function AssetModelManager(editor,scene) { scope.staticAsset['occ'] = { modelId:'occ', packageName:"occ大厅", - url:"/MODEL/2021-08-23/203-65635.FBX", + url:"/MODEL/2021-09-02/210-32471.FBX", mesh:"", assetType:'onlineasset', isUse:true, diff --git a/src/views/jlmap3d/lesson3dedit/component/property.vue b/src/views/jlmap3d/lesson3dedit/component/property.vue index 4dec42bcd..31041e13d 100644 --- a/src/views/jlmap3d/lesson3dedit/component/property.vue +++ b/src/views/jlmap3d/lesson3dedit/component/property.vue @@ -216,11 +216,12 @@ - + + diff --git a/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue b/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue index 9f06ac12a..92b5e10ef 100644 --- a/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue +++ b/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue @@ -45,22 +45,23 @@ + :nowRole ='nowRole' + v-show="lessonTools[0].isShow" + @jumpEvent="jumpEvent"> + v-show="lessonTools[1].isShow"> + v-show="lessonTools[2].isShow && !examMode" + > + v-show="lessonTools[3].isShow"> @@ -273,7 +274,7 @@ this.selectJobList = loadData.setup.checkedRole; this.jobPaneData.dataList = loadData.toolJobPane; this.$refs.jobpane.initJobList(this.jobPaneData.dataList); - + console.log(loadData.lessonTools); this.lessonTools = loadData.lessonTools; this.lessonData.loadLessonProgress(loadData.lessonProgress); diff --git a/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue b/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue index e52e8903a..b2556c520 100644 --- a/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue +++ b/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue @@ -3,19 +3,16 @@ v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]" :style="{'background-image': 'url('+lessonbg+')'}"> - -
+
+ 操作提示 +
+
{{lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.text}}
-
+
+ + diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue new file mode 100644 index 000000000..12a892c63 --- /dev/null +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/src/views/newMap/newMapdraft/mapoperate/localConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue similarity index 95% rename from src/views/newMap/newMapdraft/mapoperate/localConfig.vue rename to src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue index a6d58382c..644b7db80 100644 --- a/src/views/newMap/newMapdraft/mapoperate/localConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue @@ -91,7 +91,9 @@ export default { data() { return { tableData: [], + otherData: [], addModel: { + type: 'LOCAL', stationCodeList: [], switchStationCodeList:[], elementList: [] @@ -125,7 +127,6 @@ export default { 'tempSpeedLimitList', 'textList', 'totalGuideLockButtonVOList', - 'localStationConfig', 'seclectDeviceList' ]), cardTitle() { @@ -158,7 +159,14 @@ export default { // } // }, initData() { - this.tableData = this.$store.state.map.map.displayList || []; + // this.tableData = (this.$store.state.map.map.displayList || []).filter(item => item.type === 'LOCAL'); + this.$store.state.map.map.displayList.forEach( item => { + if (item.type === 'LOCAL') { + this.tableData.push(item); + } else { + this.otherData.push(item); + } + }); }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) { @@ -222,7 +230,7 @@ export default { save() { const map = this.$store.state.map.map; const param = { - displayList: this.tableData, + displayList: [...this.tableData, ...this.otherData], mapId: this.$route.params.mapId }; this.dataLoading = true; @@ -285,7 +293,7 @@ export default { }); const map = this.$store.state.map.map; const param = { - displayList: this.tableData, + displayList: [...this.tableData, ...this.otherData], mapId: this.$route.params.mapId }; saveMap(Object.assign(map, param)).then(response => { diff --git a/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/splitScreen.vue similarity index 100% rename from src/views/newMap/newMapdraft/mapoperate/splitScreen.vue rename to src/views/newMap/newMapdraft/mapoperate/displayConfig/splitScreen.vue diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 9eea48018..c61d4f0d8 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -13,8 +13,10 @@ 配置 + 行调配置 现地配置 大屏配置 + 车辆段配置 @@ -38,16 +40,10 @@ /> - - + + + + @@ -75,11 +71,13 @@ import ResponderDraft from './responder/index'; import ControlLamp from './controlLamp'; import SplitStation from './splitStation'; import Arrow from './arrow'; -import SplitScreen from './splitScreen'; +import SplitScreen from './displayConfig/splitScreen'; import FloodGate from './floodGate'; import DirectionRod from './directionRod'; import SignalButton from './signalButton'; -import LocalConfig from './localConfig'; +import LocalConfig from './displayConfig/localConfig'; +import DispatchConfig from './displayConfig/dispatchConfig'; +import DepotConfig from './displayConfig/depotConfig'; export default { name: 'MapOperate', @@ -111,7 +109,9 @@ export default { FloodGate, DirectionRod, SignalButton, - LocalConfig + LocalConfig, + DispatchConfig, + DepotConfig }, props: { selected: { @@ -188,12 +188,18 @@ export default { dataRelation() { this.$emit('selectView', 'path'); }, + showDispatchConfig() { + this.configShow = 'dispatch'; + }, showLocalConfig() { this.configShow = 'local'; }, showScreenConfig() { this.configShow = 'screen'; }, + showDepotConfig() { + this.configShow = 'depot'; + }, goDraw() { this.configShow = 'none'; }, From 9ed4b26a57c104a4869849ddc82dcaac4dd91f66 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 6 Sep 2021 15:41:38 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=9E=E6=80=A7ctcSetOverlap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/models.js | 1 + src/views/newMap/newMapdraft/mapoperate/signal/index.vue | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/models.js b/src/views/newMap/newMapdraft/mapoperate/models.js index 33586451a..a6736bd6a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/models.js +++ b/src/views/newMap/newMapdraft/mapoperate/models.js @@ -86,6 +86,7 @@ class Model { this.callOn = true; this.turnBack = false; this.ctc = true; // 是否灭灯显示 + this.ctcSetOverlap = true; // CTC级别是否办理延续保护 this.noOverlap = false; // 是否无延续保护 this.routeEnd = false; // 是否进路终端 this.noRoute = false; // 是否不生成进路 diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 4af1059ef..0df6e5804 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -150,11 +150,11 @@ export default { { prop: 'callOn', label: '是否引导信号:', type: 'checkbox'}, { prop: 'turnBack', label: '是否自动折返始端:', type: 'checkbox', isHidden: this.editModel.virtual}, { prop: 'ctc', label: '是否灭灯显示(CTC级)', type: 'checkbox'}, + { prop: 'ctcSetOverlap', label: 'CTC级别是否办理延续保护', type: 'checkbox' }, { prop: 'noOverlap', label: '是否无延续保护', type: 'checkbox'}, { prop: 'routeEnd', label: '是否进路终端', type: 'checkbox'}, { prop: 'ignoreRouteEnd', label: '不生成进路的信号机终端', type: 'multiSelectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, hover: this.hover, buttonType: 'signalIgnoreRouteEnd', buttonShowType: this.signalIgnoreRouteEnd }, { prop: 'noRoute', label: this.$t('map.signalNoRoute') + ':', type: 'checkbox'} - ] }, map: { @@ -166,7 +166,6 @@ export default { { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList, hover: this.hover, buttonType: 'signalSection', buttonShowType: this.signalSectionShow }, { prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') } - ] } } From ab01e5e99d092a1697962b21ee2e124b2f4b5b41 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 6 Sep 2021 16:10:27 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=BC=A9=E6=94=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 58 +++++++++++++++++++------- src/jmapNew/painter.js | 5 +++ src/jmapNew/transformHandleScreen.js | 45 ++++++++++++++++++-- src/views/designPlatform/bigScreen.vue | 2 +- 4 files changed, 90 insertions(+), 20 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 7184e2d03..bd8957be6 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -37,6 +37,9 @@ class Jlmap { // 设备数据 this.mapDevice = {}; + // 大屏配置 + this.splitList = []; + // 默认状态 this.defaultStateDict = this.loadDefaultState(); @@ -143,6 +146,7 @@ class Jlmap { setOptions(opts) { const options = this.pullBack(opts); if (this.screenFlag) { + this.$options.update(options); this.$painter.updateScreen(options); } else { this.$options.update(options); @@ -216,8 +220,6 @@ class Jlmap { setUpdateScreen(opts) { this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 }); this.screenFlag = true; - const screenList = []; - const rectList = []; let rect = ''; for (const i in this.mapDevice) { const element = this.mapDevice[i]; @@ -233,31 +235,57 @@ class Jlmap { opts.offsetList = []; } const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit; - const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160; - const splitList = JSON.parse(JSON.stringify(screenSplit)); + this.splitList = JSON.parse(JSON.stringify(screenSplit)); const num = screenSplit.length + 1; - const offsetY = (opts.height - 100) / num; // 高度差 const maxWidth = rect.width; - splitList.push(maxWidth); + this.splitList.push(maxWidth); const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100; const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100; - const scale = Math.min(scaleX, scaleY); + this.screenScale = Math.min(scaleX, scaleY); - for (let i = 0; i < splitList.length; i++) { + this.optsWidth = opts.width; + this.optsHeight = opts.height; + this.optsOffsetList = opts.offsetList; + + const scaleBili = this.screenScale; + + this.$options.scaleRate = this.screenScale || 1; + this.$options.scaleIndex = 0; + this.$options.offsetX = 0; + this.$options.offsetY = 0; + // 更新视图大小 + // this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY }); + + const {screenList, rectList} = this.calculateScreenPosition(scaleBili); + console.log(screenList, '初次加载'); + this.$painter.updateTransform1(screenList, rectList); + } + + calculateScreenPosition(scaleBili) { + const screenList = []; + const rectList = []; + const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160; + const bili = scaleBili / this.screenScale; + const offsetY = (this.optsHeight - 100) / this.splitList.length; // 高度差 + + for (let i = 0; i < this.splitList.length; i++) { let offsetX = ''; if (i == 0) { - offsetX = -(opts.width - splitList[0] * scale) / 2; + offsetX = -(this.optsWidth - this.splitList[0] * scaleBili) / 2; } else { - const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值 - offsetX = splitList[i - 1] * scale - dx; + const dx = (this.optsWidth - (this.splitList[i] - this.splitList[i - 1]) * scaleBili) / 2; // 居中计算偏移值 + offsetX = this.splitList[i - 1] * scaleBili - dx; } - const offset = opts.offsetList[i] || 0; - const param = { scaleRateX: scale, scaleRateY: scale, offsetX: offsetX, offsetY: -screenDifference - (offsetY * i) - offset }; + const offset = this.optsOffsetList[i] || 0; + const param = { scaleRateX: scaleBili, scaleRateY: scaleBili, offsetX: offsetX, offsetY: (-screenDifference - (offsetY * i) - offset) * bili }; screenList.push(param); - const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height}; + const rect = {x: 0, y: 0, width: Number(this.splitList[i]) + 5, height: this.optsHeight}; rectList.push(rect); } - this.$painter.updateTransform1(screenList, rectList); + return { + screenList, + rectList + }; } setLevelVisible(list) { diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index 970c8a776..d8f8f4765 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -225,6 +225,11 @@ class Painter { this.screenFlag = true; this.$transformHandleScreen.updateTransform(list, opts); } + + updateScreenZoom(bili) { + return this.$jmap.calculateScreenPosition(bili); + } + /** * 更新zrender尺寸 * @param {*} opt diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index f85a545a3..e841f7bdd 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -1,9 +1,24 @@ import {createTransform1, createBoundingRect} from './utils/parser'; + class TransformHandle { constructor(painter) { this.$painter = painter; + this.scale = ''; + this.scaleIndex = 0; + this.scaleList = [ + 0.2, 0.4, 0.6, 0.8, 0.9, + 1, 1.2, 1.4, 1.6, 1.8, + 2, 2.2, 2.4, 2.6, 2.8, + 3, 3.2, 3.4, 3.6, 3.8, + 4, 4.2, 4.4, 4.6, 4.8, + 5, 5.2, 5.4, 5.6, 5.8, + 6, 6.2, 6.4, 6.6, 6.8, + 7, 7.2, 7.4, 7.6, 7.8, + 8 + ]; + this.parentLevel = painter.getParentLevel(); this.rect = { x: 0, y: 0, width: 0, height: 0 }; @@ -79,6 +94,7 @@ class TransformHandle { // 更新偏移量 updateTransform(list, rectList) { this.rectList = rectList; + // this.scale = list[0].scaleRateX; this.transform = []; list.forEach(item => { this.transform.push(createTransform1(item)); @@ -87,10 +103,31 @@ class TransformHandle { this.transformAll(); } updataOffset(opt) { - this.transform.forEach(item => { - item[4] = item[4] + opt.dx; - item[5] = item[5] + opt.dy; - }); + if (opt.scale) { + if (opt.scale <= 0) { + this.scaleIndex = this.scaleIndex <= 0 ? 0 : this.scaleIndex - 1; + } else { + this.scaleIndex = this.scaleIndex >= 40 ? 40 : this.scaleIndex + 1; + } + + // console.log('缩放比例计算', this.scaleList[this.scaleIndex]); + const {screenList, rectList} = this.$painter.updateScreenZoom(this.scaleList[this.scaleIndex]); + console.log(screenList); + this.rectList = rectList; + this.transform = []; + screenList.forEach(item => { + this.transform.push(createTransform1(item)); + }); + // this.transform.forEach(item => { + // item[4] = item[4] + opt.dx; + // item[5] = item[5] + opt.dy; + // }); + } else { + this.transform.forEach(item => { + item[4] = item[4] + opt.dx; + item[5] = item[5] + opt.dy; + }); + } this.transformAll1(); } updataOffsetNum(opts) { diff --git a/src/views/designPlatform/bigScreen.vue b/src/views/designPlatform/bigScreen.vue index 2257960e9..7af525824 100644 --- a/src/views/designPlatform/bigScreen.vue +++ b/src/views/designPlatform/bigScreen.vue @@ -62,7 +62,7 @@ export default { }, '$store.state.map.mapViewLoadedCount':function() { this.$store.dispatch('map/setTrainWindowShow', false); - this.$jlmap.off('zoom'); + // this.$jlmap.off('zoom'); this.handleUpdateScreen(); if (this.$route.query.group && !this.$route.path.includes('displayIscs')) { this.subscribe(); From 98c365c448bba8ffcb6d4d4748710edb1d94244a Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 6 Sep 2021 16:18:31 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 1 - src/jmapNew/transformHandleScreen.js | 7 ------- src/utils/baseUrl.js | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index bd8957be6..ad9dba79e 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -257,7 +257,6 @@ class Jlmap { // this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY }); const {screenList, rectList} = this.calculateScreenPosition(scaleBili); - console.log(screenList, '初次加载'); this.$painter.updateTransform1(screenList, rectList); } diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index e841f7bdd..7de040eda 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -109,19 +109,12 @@ class TransformHandle { } else { this.scaleIndex = this.scaleIndex >= 40 ? 40 : this.scaleIndex + 1; } - - // console.log('缩放比例计算', this.scaleList[this.scaleIndex]); const {screenList, rectList} = this.$painter.updateScreenZoom(this.scaleList[this.scaleIndex]); - console.log(screenList); this.rectList = rectList; this.transform = []; screenList.forEach(item => { this.transform.push(createTransform1(item)); }); - // this.transform.forEach(item => { - // item[4] = item[4] + opt.dx; - // item[5] = item[5] + opt.dy; - // }); } else { this.transform.forEach(item => { item[4] = item[4] + opt.dx; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index cda1b5c90..1d7f89989 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ 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.167:9000'; // 旭强 + // BASE_API = 'http://192.168.8.167:9000'; // 旭强 // BASE_API = 'http://192.168.2.183:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; From 5e5474aee994a353032981b4509a503f295ca7eb Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 6 Sep 2021 17:49:44 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=85=8D=E7=BD=AE?= =?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/jmapNew/shape/graph/Arrow/index.js | 2 +- src/jmapNew/shape/graph/AutoTurnBack/index.js | 2 +- .../shape/graph/AutomacticRoute/index.js | 2 +- src/jmapNew/shape/graph/AxleReset/index.js | 2 +- src/jmapNew/shape/graph/DirectionRod/index.js | 2 +- src/jmapNew/shape/graph/FloodGate/index.js | 2 +- src/jmapNew/shape/graph/GuideLock/index.js | 2 +- src/jmapNew/shape/graph/LcControl/index.js | 2 +- src/jmapNew/shape/graph/LimitControl/index.js | 2 +- src/jmapNew/shape/graph/Line/index.js | 2 +- src/jmapNew/shape/graph/OutFrame/index.js | 2 +- src/jmapNew/shape/graph/Power/index.js | 2 +- src/jmapNew/shape/graph/Psd/index.js | 2 +- src/jmapNew/shape/graph/Resource/index.js | 2 +- src/jmapNew/shape/graph/Responder/index.js | 2 +- src/jmapNew/shape/graph/SaidLamp/index.js | 2 +- src/jmapNew/shape/graph/Section/index.js | 2 +- src/jmapNew/shape/graph/Signal/index.js | 2 +- src/jmapNew/shape/graph/SignalButton/index.js | 2 +- src/jmapNew/shape/graph/SplitStation/index.js | 2 +- src/jmapNew/shape/graph/Station/index.js | 2 +- .../shape/graph/StationCounter/index.js | 2 +- .../shape/graph/StationDelayUnlock/index.js | 2 +- src/jmapNew/shape/graph/StationStand/index.js | 2 +- .../shape/graph/StationTurnBack/index.js | 2 +- src/jmapNew/shape/graph/Switch/index.js | 2 +- src/jmapNew/shape/graph/Text/index.js | 2 +- src/jmapNew/shape/graph/Train/index.js | 2 +- src/jmapNew/shape/graph/ZcControl/index.js | 2 +- src/jmapNew/theme/xian_01/menus/index.vue | 4 +- src/store/modules/map.js | 6 ++- .../mapoperate/displayConfig/depotConfig.vue | 21 ++------ .../displayConfig/dispatchConfig.vue | 5 +- .../mapoperate/displayConfig/localConfig.vue | 52 +++++++++++++++++-- 34 files changed, 90 insertions(+), 56 deletions(-) diff --git a/src/jmapNew/shape/graph/Arrow/index.js b/src/jmapNew/shape/graph/Arrow/index.js index 407539661..d3abc7cdd 100644 --- a/src/jmapNew/shape/graph/Arrow/index.js +++ b/src/jmapNew/shape/graph/Arrow/index.js @@ -54,7 +54,7 @@ export default class Arrow extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/AutoTurnBack/index.js b/src/jmapNew/shape/graph/AutoTurnBack/index.js index 864cc4252..fe9068545 100644 --- a/src/jmapNew/shape/graph/AutoTurnBack/index.js +++ b/src/jmapNew/shape/graph/AutoTurnBack/index.js @@ -173,7 +173,7 @@ export default class AutoTurnBack extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/AutomacticRoute/index.js b/src/jmapNew/shape/graph/AutomacticRoute/index.js index 9d36efa3d..3498c6402 100644 --- a/src/jmapNew/shape/graph/AutomacticRoute/index.js +++ b/src/jmapNew/shape/graph/AutomacticRoute/index.js @@ -138,7 +138,7 @@ export default class AutomacticRoute extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/AxleReset/index.js b/src/jmapNew/shape/graph/AxleReset/index.js index d8582e78b..d5812cc85 100644 --- a/src/jmapNew/shape/graph/AxleReset/index.js +++ b/src/jmapNew/shape/graph/AxleReset/index.js @@ -142,7 +142,7 @@ export default class AxleReset extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/DirectionRod/index.js b/src/jmapNew/shape/graph/DirectionRod/index.js index e565710b0..7f3ad987e 100644 --- a/src/jmapNew/shape/graph/DirectionRod/index.js +++ b/src/jmapNew/shape/graph/DirectionRod/index.js @@ -98,7 +98,7 @@ export default class DirectionRod extends Group { } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/FloodGate/index.js b/src/jmapNew/shape/graph/FloodGate/index.js index 1b544c886..1103774e5 100644 --- a/src/jmapNew/shape/graph/FloodGate/index.js +++ b/src/jmapNew/shape/graph/FloodGate/index.js @@ -62,7 +62,7 @@ export default class FloodGate extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/GuideLock/index.js b/src/jmapNew/shape/graph/GuideLock/index.js index 04c46cbeb..22ac2311e 100644 --- a/src/jmapNew/shape/graph/GuideLock/index.js +++ b/src/jmapNew/shape/graph/GuideLock/index.js @@ -149,7 +149,7 @@ export default class GuideLock extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.isShowShape = true; this.showMode(); } else { diff --git a/src/jmapNew/shape/graph/LcControl/index.js b/src/jmapNew/shape/graph/LcControl/index.js index 468322f6d..ba619d55c 100644 --- a/src/jmapNew/shape/graph/LcControl/index.js +++ b/src/jmapNew/shape/graph/LcControl/index.js @@ -89,7 +89,7 @@ export default class LcControl extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.control.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/LimitControl/index.js b/src/jmapNew/shape/graph/LimitControl/index.js index d318cca2a..02f6a9bba 100644 --- a/src/jmapNew/shape/graph/LimitControl/index.js +++ b/src/jmapNew/shape/graph/LimitControl/index.js @@ -94,7 +94,7 @@ export default class LimitControl extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.control.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/Line/index.js b/src/jmapNew/shape/graph/Line/index.js index ccb30003f..4d2e17433 100644 --- a/src/jmapNew/shape/graph/Line/index.js +++ b/src/jmapNew/shape/graph/Line/index.js @@ -106,7 +106,7 @@ export default class Line2 extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.segment && this.segment.show(); this.viceSegment && this.viceSegment.show(); this.isShowShape = true; diff --git a/src/jmapNew/shape/graph/OutFrame/index.js b/src/jmapNew/shape/graph/OutFrame/index.js index 3d17b19f2..58b2ba980 100644 --- a/src/jmapNew/shape/graph/OutFrame/index.js +++ b/src/jmapNew/shape/graph/OutFrame/index.js @@ -58,7 +58,7 @@ export default class OutFrame extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.box && this.box.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/Power/index.js b/src/jmapNew/shape/graph/Power/index.js index 99563bc82..59fe2591d 100644 --- a/src/jmapNew/shape/graph/Power/index.js +++ b/src/jmapNew/shape/graph/Power/index.js @@ -136,7 +136,7 @@ export default class Line2 extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild((child) => { child.show(); }); diff --git a/src/jmapNew/shape/graph/Psd/index.js b/src/jmapNew/shape/graph/Psd/index.js index e01796eac..e54be1fb2 100644 --- a/src/jmapNew/shape/graph/Psd/index.js +++ b/src/jmapNew/shape/graph/Psd/index.js @@ -92,7 +92,7 @@ export default class Line2 extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Resource/index.js b/src/jmapNew/shape/graph/Resource/index.js index f90a5c02f..66e188d20 100644 --- a/src/jmapNew/shape/graph/Resource/index.js +++ b/src/jmapNew/shape/graph/Resource/index.js @@ -71,7 +71,7 @@ export default class Resource extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.image && this.image.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/Responder/index.js b/src/jmapNew/shape/graph/Responder/index.js index 676a17802..c58e09523 100644 --- a/src/jmapNew/shape/graph/Responder/index.js +++ b/src/jmapNew/shape/graph/Responder/index.js @@ -189,7 +189,7 @@ export default class Responder extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.block && this.block.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/SaidLamp/index.js b/src/jmapNew/shape/graph/SaidLamp/index.js index b126ee18b..e1bedff9f 100644 --- a/src/jmapNew/shape/graph/SaidLamp/index.js +++ b/src/jmapNew/shape/graph/SaidLamp/index.js @@ -223,7 +223,7 @@ export default class SaidLamp extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.control && this.control.show(); this.isShowShape = true; this.setState(this.model); diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js index 33ace11cb..ec75cdefe 100644 --- a/src/jmapNew/shape/graph/Section/index.js +++ b/src/jmapNew/shape/graph/Section/index.js @@ -597,7 +597,7 @@ export default class Section extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Signal/index.js b/src/jmapNew/shape/graph/Signal/index.js index 95c4d6151..f557d9356 100644 --- a/src/jmapNew/shape/graph/Signal/index.js +++ b/src/jmapNew/shape/graph/Signal/index.js @@ -1189,7 +1189,7 @@ class Signal extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/SignalButton/index.js b/src/jmapNew/shape/graph/SignalButton/index.js index 3ced63ed2..e406f7035 100644 --- a/src/jmapNew/shape/graph/SignalButton/index.js +++ b/src/jmapNew/shape/graph/SignalButton/index.js @@ -132,7 +132,7 @@ export default class SignalButton extends Group { setShowMode() { } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/SplitStation/index.js b/src/jmapNew/shape/graph/SplitStation/index.js index 0e075bc02..889ac5c28 100644 --- a/src/jmapNew/shape/graph/SplitStation/index.js +++ b/src/jmapNew/shape/graph/SplitStation/index.js @@ -133,7 +133,7 @@ export default class SplitStation extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Station/index.js b/src/jmapNew/shape/graph/Station/index.js index 49ef9ae33..50b09ed83 100644 --- a/src/jmapNew/shape/graph/Station/index.js +++ b/src/jmapNew/shape/graph/Station/index.js @@ -784,7 +784,7 @@ export default class Station extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { if (this.model.visible) { this.eachChild(item => { item.show(); diff --git a/src/jmapNew/shape/graph/StationCounter/index.js b/src/jmapNew/shape/graph/StationCounter/index.js index 7a74bbbf6..10e382313 100644 --- a/src/jmapNew/shape/graph/StationCounter/index.js +++ b/src/jmapNew/shape/graph/StationCounter/index.js @@ -91,7 +91,7 @@ export default class StationCounter extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/StationDelayUnlock/index.js b/src/jmapNew/shape/graph/StationDelayUnlock/index.js index 3f061abf7..0231ebafa 100644 --- a/src/jmapNew/shape/graph/StationDelayUnlock/index.js +++ b/src/jmapNew/shape/graph/StationDelayUnlock/index.js @@ -109,7 +109,7 @@ export default class StationDelayUnlock extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/StationStand/index.js b/src/jmapNew/shape/graph/StationStand/index.js index 82d911d65..f773dceb1 100644 --- a/src/jmapNew/shape/graph/StationStand/index.js +++ b/src/jmapNew/shape/graph/StationStand/index.js @@ -249,7 +249,7 @@ class StationStand extends Group { } } setShowStation(stationCode) { - if ((!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) && this.model.visible) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code) && this.model.visible) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/StationTurnBack/index.js b/src/jmapNew/shape/graph/StationTurnBack/index.js index 5cb821923..c7ede760b 100644 --- a/src/jmapNew/shape/graph/StationTurnBack/index.js +++ b/src/jmapNew/shape/graph/StationTurnBack/index.js @@ -199,7 +199,7 @@ export default class StationTurnBack extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Switch/index.js b/src/jmapNew/shape/graph/Switch/index.js index 565aedd83..b90ee8602 100644 --- a/src/jmapNew/shape/graph/Switch/index.js +++ b/src/jmapNew/shape/graph/Switch/index.js @@ -811,7 +811,7 @@ export default class Switch extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Text/index.js b/src/jmapNew/shape/graph/Text/index.js index ee484fe2d..e128ca6b0 100644 --- a/src/jmapNew/shape/graph/Text/index.js +++ b/src/jmapNew/shape/graph/Text/index.js @@ -70,7 +70,7 @@ export default class Text2 extends Group { } } setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index a98851c87..5a6236b64 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -462,7 +462,7 @@ export default class Train extends Group { } } setShowStation(stationCode) { - if ((this.model.sectionModel && store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel.code)) || !stationCode) { + if (this.model.sectionModel && store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel.code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/shape/graph/ZcControl/index.js b/src/jmapNew/shape/graph/ZcControl/index.js index 04d21ab79..e1e6250ca 100644 --- a/src/jmapNew/shape/graph/ZcControl/index.js +++ b/src/jmapNew/shape/graph/ZcControl/index.js @@ -111,7 +111,7 @@ export default class ZcControl extends Group { } setShowMode() {} setShowStation(stationCode) { - if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) { + if (store.getters['map/checkDeviceShow'](stationCode, this._code)) { this.eachChild(item => { item.show(); }); diff --git a/src/jmapNew/theme/xian_01/menus/index.vue b/src/jmapNew/theme/xian_01/menus/index.vue index 2d1c4fb81..ad6a6c05b 100644 --- a/src/jmapNew/theme/xian_01/menus/index.vue +++ b/src/jmapNew/theme/xian_01/menus/index.vue @@ -148,7 +148,9 @@ export default { const roleDeviceCode = this.$store.state.training.roleDeviceCode; const displayList = this.$store.state.map.map.displayList; const display = displayList.find(each=>{ - return each.stationCodeList.includes(roleDeviceCode); + if (each.type === 'LOCAL') { + return each.stationCodeList.includes(roleDeviceCode); + } }); if (display) { const codeList = [...display.switchStationCodeList]; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index d6984df37..d4b480abf 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -671,7 +671,11 @@ const map = { if (state.map && state.map.displayList && state.map.displayList.length) { let flag = false; state.map.displayList.forEach(item => { - if (item.stationCodeList.includes(stationCode) && item.elementList.includes(deviceCode)) { + if ( store.state.training.prdType === '01' && item.type === 'LOCAL' && item.stationCodeList.includes(stationCode) && item.elementList.includes(deviceCode)) { + flag = true; + } else if ( store.state.training.prdType === '02' && item.type === 'CENTER' && item.elementList.includes(deviceCode)) { + flag = true; + } else if ( store.state.training.prdType === '09' && item.type === 'DEPOT_IL' && item.elementList.includes(deviceCode)) { flag = true; } }); diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue index 3fb0003e7..dc0ab224a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue @@ -141,28 +141,13 @@ export default { back() { this.$emit('goDraw'); }, - generateOverlab() { // 生成 - if (!this.addModel.stationCodeList.length) { - this.$messageBox('请选择车站!'); - return; - } - if (!this.addModel.switchStationCodeList.length) { - this.$messageBox('请选择可切换显示的车站!'); - return; - } - this.tableData.push(this.addModel); - this.clearData(); - }, + clear() { - this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; - }, - clearData() { - this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; - this.index = ''; + this.addModel = { type: 'DEPOT_IL', elementList: [] }; }, generateData() { this.loading = true; - this.tableData = []; + this.clear(); const station = this.stationList.find(item => item.depot); console.log(station, station.code); [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue index 12a892c63..cee399e27 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/dispatchConfig.vue @@ -142,13 +142,12 @@ export default { this.$emit('goDraw'); }, clear() { - this.addModel = {elementList: []}; + this.addModel = { type: 'CENTER', elementList: []}; }, generateData() { this.loading = true; - this.tableData = []; + this.clear(); const station = this.stationList.find(item => item.depot); - [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList, ...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => { diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue index 644b7db80..8010d9981 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue @@ -65,7 +65,8 @@
- 按集中站生成并保存 + 按集中站生成 + 全显生成 保存 返回
@@ -259,20 +260,63 @@ export default { this.clearData(); }, clear() { - this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; }, clearData() { - this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; this.index = ''; this.cardMode = 'generate'; }, + generateAllData() { + this.loading = true; + this.tableData = []; + const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; + const stationCodeList = []; + this.stationList.forEach(item => { + if (!item.depot) { + tempData.stationCodeList.push(item.code); + } else { stationCodeList.push(item.code); } + }); + [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, + ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList, + ...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => { + if (!stationCodeList.includes(item.stationCode)) { + tempData.elementList.push(item.code); + } + }); + [...this.directionRodList].forEach(item => { + if (!stationCodeList.includes(item.deviceStationCode)) { + tempData.elementList.push(item.code); + } + }); + this.psdList.forEach(item => { + const stand = this.$store.getters['map/getDeviceByCode'](item.standCode); + if (!stationCodeList.includes(stand.stationCode)) { + tempData.elementList.push(item.code); + } + }); + this.tableData.push(tempData); + const map = this.$store.state.map.map; + const param = { + displayList: [...this.tableData, ...this.otherData], + mapId: this.$route.params.mapId + }; + saveMap(Object.assign(map, param)).then(response => { + this.loading = false; + this.$message.success('保存现地配置成功'); + this.cancelOverlab(); + }).catch(() => { + this.loading = false; + this.$messageBox('保存现地配置失败'); + }); + }, generateData() { this.loading = true; this.tableData = []; // switchStationCodeList:[...item.switchStationCodeList, item.code] this.stationList.forEach(item => { if (item.centralized) { - this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]}); + this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]}); } }); From ba0999856c8d53c36ad8b2c48bc00fee0e7b9076 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Tue, 7 Sep 2021 09:53:47 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E8=A1=8C=E8=BD=A6=E5=92=8C=E4=B8=89=E7=BB=B4=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jl3ddrive/drivecontrol/simulation.js | 16 + .../lesson3d/manager/controlmanager.js | 2 +- src/jlmap3d/lesson3dedit/accident/fire.js | 236 +++++++++++ src/jlmap3d/lesson3dedit/lesson3deditor.js | 8 +- .../lesson3dedit/manager/accidentmanager.js | 39 ++ .../lesson3dedit/manager/assetmodelmanager.js | 388 ++++++++++++++++++ src/utils/baseUrl.js | 4 +- .../drive/drivecontrol/toprightpane.vue | 226 +++++++--- .../component/lessontoolsmanager.vue | 13 + 9 files changed, 862 insertions(+), 70 deletions(-) create mode 100644 src/jlmap3d/lesson3dedit/accident/fire.js create mode 100644 src/jlmap3d/lesson3dedit/manager/accidentmanager.js create mode 100644 src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js diff --git a/src/jlmap3d/jl3ddrive/drivecontrol/simulation.js b/src/jlmap3d/jl3ddrive/drivecontrol/simulation.js index 421b4355e..975ab60dc 100644 --- a/src/jlmap3d/jl3ddrive/drivecontrol/simulation.js +++ b/src/jlmap3d/jl3ddrive/drivecontrol/simulation.js @@ -130,3 +130,19 @@ export function trainSimulationDoorControl(group, data) { data: data }); } + +export function trainSimulationDoorSelection(group, data) { + return request({ + url: `/simulation/${group}/operate/Driver_Door_Selection`, + method: 'post', + data: data + }); +} + +export function trainSimulationDoorMode(group, data) { + return request({ + url: `/simulation/${group}/operate/Driver_Door_Mode`, + method: 'post', + data: data + }); +} diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js index 81f90cca5..dfa66751c 100644 --- a/src/jlmap3d/lesson3d/manager/controlmanager.js +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -513,7 +513,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){ - console.log(scope.controlMode); + scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; if(scope.controlMode == "free" || scope.controlMode == "non"){ diff --git a/src/jlmap3d/lesson3dedit/accident/fire.js b/src/jlmap3d/lesson3dedit/accident/fire.js new file mode 100644 index 000000000..d8a244c56 --- /dev/null +++ b/src/jlmap3d/lesson3dedit/accident/fire.js @@ -0,0 +1,236 @@ +export function Fire() { + let scope = this; + this.points = {}; + var last_time_activate = Date.now(); + + + this.init = function(scene){ + scope.points = new Points(); + scope.points.init(); + scene.add(scope.points.obj); + } + + this.update = function(){ + var now = Date.now(); + scope.points.update(); + if (now - last_time_activate > 10) { + + scope.points.activateMover(); + last_time_activate = Date.now(); + } + } + + var Mover = function() { + this.position = new THREE.Vector3(); + this.velocity = new THREE.Vector3(); + this.acceleration = new THREE.Vector3(); + this.anchor = new THREE.Vector3(); + this.mass = 1; + this.r = 0; + this.g = 0; + this.b = 0; + this.a = 1; + this.time = 0; + this.is_active = false; + }; + + Mover.prototype = { + init: function(vector) { + this.position = vector.clone(); + this.velocity = vector.clone(); + this.anchor = vector.clone(); + this.acceleration.set(0, 0, 0); + this.a = 1; + this.time = 0; + }, + updatePosition: function() { + this.position.copy(this.velocity); + }, + updateVelocity: function() { + this.acceleration.divideScalar(this.mass); + this.velocity.add(this.acceleration); + // if (this.velocity.distanceTo(this.position) >= 1) { + // this.direct(this.velocity); + // } + }, + applyForce: function(vector) { + this.acceleration.add(vector); + }, + applyFriction: function() { + var friction = friction(this.acceleration, 0.1); + this.applyForce(friction); + }, + applyDragForce: function(value) { + var drag = drag(this.acceleration, value); + this.applyForce(drag); + }, + hook: function(rest_length, k) { + var force = hook(this.velocity, this.anchor, rest_length, k); + this.applyForce(force); + }, + activate: function() { + this.is_active = true; + }, + inactivate: function() { + this.is_active = false; + } + }; + + + var Points = function() { + this.movers_num = 3000; + this.movers = []; + this.geometry = null; + this.material = null; + this.obj = null; + this.texture = null; + this.antigravity = new THREE.Vector3(0, 0.1, 0); +}; + +Points.prototype = { + init: function() { + this.createTexture(); + this.geometry = new THREE.Geometry(); + this.material = new THREE.PointsMaterial({ + color: 0xff6633, + size: 3, + transparent: true, + opacity: 0.5, + map: this.texture, + // depthTest: false, + depthWrite:false, + alphaTest: 0.1, + blending: THREE.AdditiveBlending, + }); + for (var i = 0; i < this.movers_num; i++) { + var mover = new Mover(); + + mover.init(new THREE.Vector3((10*Math.random()-49), 1.6, (10*Math.random()+11))); + this.movers.push(mover); + this.geometry.vertices.push(mover.position); + } + this.obj = new THREE.Points(this.geometry, this.material); + this.obj.renderOrder = 1; + }, + update: function() { + var points_vertices = []; + + for (var i = 0; i < this.movers.length; i++) { + var mover = this.movers[i]; + if (mover.is_active) { + mover.applyForce(this.antigravity); + mover.updateVelocity(); + mover.updatePosition(); + if (mover.position.y > 8) { + mover.inactivate(); + } + } + points_vertices.push(mover.position); + } + this.obj.geometry.vertices = points_vertices; + this.obj.geometry.verticesNeedUpdate = true; + }, + activateMover: function() { + var count = 0; + for (var i = 0; i < this.movers.length; i++) { + var mover = this.movers[i]; + + if (mover.is_active) continue; + var rad1 = getRadian(Math.log(getRandomInt(200, 256)) / Math.log(256) * 270); + var rad2 = getRadian(getRandomInt(0, 360)); + var force = getSpherical(rad1, rad2, 1); + mover.activate(); + mover.init(new THREE.Vector3((10*Math.random()-49), 5, (10*Math.random()+11))); + mover.applyForce(force); + + count++; + if (count >= 10) break; + } + }, + createTexture: function() { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var grad = null; + + canvas.width = 200; + canvas.height = 200; + grad = ctx.createRadialGradient(100, 100, 20, 100, 100, 100); + grad.addColorStop(0.2, 'rgba(255, 255, 255, 1)'); + grad.addColorStop(0.5, 'rgba(255, 255, 255, 0.3)'); + grad.addColorStop(1.0, 'rgba(255, 255, 255, 0)'); + ctx.fillStyle = grad; + ctx.arc(100, 100, 100, 0, Math.PI / 180, true); + ctx.fill(); + this.texture = new THREE.Texture(canvas); + this.texture.minFilter = THREE.NearestFilter; + this.texture.needsUpdate = true; + } + }; + + var HemiLight = function() { + this.rad1 = getRadian(60); + this.rad2 = getRadian(30); + this.range = 1000; + this.hex1 = 0xffffff; + this.hex2 = 0x333333; + this.intensity = 1; + this.obj; + }; + + HemiLight.prototype = { + init: function(hex1, hex2) { + if (hex1) this.hex1 = hex1; + if (hex2) this.hex2 = hex2; + this.obj = new THREE.HemisphereLight(this.hex1, this.hex2, this.intensity); + this.setPosition(); + }, + setPosition: function() { + var points = getSpherical(this.rad1, this.rad2, this.range); + this.obj.position.copy(points); + } + }; + + function getRandomInt(min, max) { + return Math.floor(Math.random() * (max - min)) + min; + } + function getDegree(radian) { + return radian / Math.PI * 180; + } + function getRadian(degrees) { + return degrees * Math.PI / 180; + } + function getSpherical(rad1, rad2, r) { + var x = Math.cos(rad1) * Math.cos(rad2) * r; + var z = Math.cos(rad1) * Math.sin(rad2) * r; + var y = Math.sin(rad1) * r; + return new THREE.Vector3(x, y, z); + } + + + function friction(acceleration, mu, normal, mass) { + var force = acceleration.clone(); + if (!normal) normal = 1; + if (!mass) mass = 1; + force.multiplyScalar(-1); + force.normalize(); + force.multiplyScalar(mu); + return force; + } + + function drag(acceleration, value) { + var force = acceleration.clone(); + force.multiplyScalar(-1); + force.normalize(); + force.multiplyScalar(acceleration.length() * value); + return force; + } + + function hook(velocity, anchor, rest_length, k) { + var force = velocity.clone().sub(anchor); + var distance = force.length() - rest_length; + force.normalize(); + force.multiplyScalar(-1 * k * distance); + return force; + } + +} diff --git a/src/jlmap3d/lesson3dedit/lesson3deditor.js b/src/jlmap3d/lesson3dedit/lesson3deditor.js index bbd0f81de..0f0b567f4 100644 --- a/src/jlmap3d/lesson3dedit/lesson3deditor.js +++ b/src/jlmap3d/lesson3dedit/lesson3deditor.js @@ -10,7 +10,9 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; //骨骼动画模型辅助工具 import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; -import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js'; +import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js'; + +import { AccidentManager } from '@/jlmap3d/lesson3dedit/manager/accidentmanager.js'; import { TransformControls } from '@/jlmap3d/lesson3dedit/controls/TransformControls'; @@ -74,8 +76,8 @@ export function Lesson3dEditor(dom,lessonData) { } ); // scene.add(transcontrol); - - + let accidentManager = new AccidentManager(scene); + accidentManager.init(); let assetModelManager = new AssetModelManager(scope,scene); if(lessonData){ diff --git a/src/jlmap3d/lesson3dedit/manager/accidentmanager.js b/src/jlmap3d/lesson3dedit/manager/accidentmanager.js new file mode 100644 index 000000000..d57ab3b77 --- /dev/null +++ b/src/jlmap3d/lesson3dedit/manager/accidentmanager.js @@ -0,0 +1,39 @@ +// import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js'; +import { Fire } from '@/jlmap3d/lesson3dedit/accident/fire.js'; + +export function AccidentManager(scene) { + let scope = this; + + this.accidentList = []; + this.accidentGroup = new THREE.Group(); + scene.add(scope.accidentGroup); + + this.init = function(){ + let fire = new Fire(); + fire.init(scene); + } + + this.createNewAccident = function(type,pos){ + + let fire = new Fire(); + fire.init(scene); + + let newAccident = { + id:"xx", + type:type + }; + } + + this.loadAccidentList = function(){ + + } + + this.changeAccidentStatus = function(){ + + } + + this.update = function(){ + + } + +} diff --git a/src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js b/src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js new file mode 100644 index 000000000..6feedfdea --- /dev/null +++ b/src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js @@ -0,0 +1,388 @@ +import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js'; + +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; + +export function AssetModelManager(editor,scene) { + let scope = this; + + + this.assetList = []; + + this.otherModel = new THREE.Group(); + + let groupList = []; + groupList["standstation"] = new THREE.Group(); + groupList["stopstation"] = new THREE.Group(); + groupList["occ"] = new THREE.Group(); + groupList["device"] = new THREE.Group(); + groupList["xl"] = new THREE.Group(); + groupList["dc"] = new THREE.Group(); + + let geometryDevice = new THREE.PlaneGeometry( 100, 100, 32 ); + let materialDevice = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} ); + let planeDevice = new THREE.Mesh( geometryDevice, materialDevice ); + planeDevice.rotation.x = -Math.PI/2; + groupList["device"].add(planeDevice); + + let geometryXl = new THREE.PlaneGeometry( 100, 100, 32 ); + let materialXl = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} ); + let planeXl = new THREE.Mesh( geometryXl, materialXl ); + planeXl.rotation.x = -Math.PI/2; + groupList["xl"].add(planeXl); + + + this.loadAsset = []; + + this.staticAsset = []; + scope.staticAsset['station'] = { + modelId:'station', + packageName:"车站", + url:JL3D_LOCAL_STATIC+"/lesson3d/station.FBX", + mesh:"", + assetType:'static', + isUse:true, + resourceType:"三维课程", + sceneType:"standstation", + }; + + scope.staticAsset['FTDH'] = { + modelId:'FTDH', + packageName:"电扶梯", + url:JL3D_LOCAL_STATIC+"/lesson3d/FTDH.FBX", + mesh:"", + assetType:'static', + isUse:true, + resourceType:"三维课程", + sceneType:"standstation", + }; + + scope.staticAsset['IN'] = { + modelId:'IN', + packageName:"进闸机", + url:JL3D_LOCAL_STATIC+"/lesson3d/IN.FBX", + mesh:"", + assetType:'static', + isUse:true, + resourceType:"三维课程", + sceneType:"standstation", + }; + + scope.staticAsset['OUT'] = { + modelId:'OUT', + packageName:"出闸机", + url:JL3D_LOCAL_STATIC+"/lesson3d/OUT.FBX", + mesh:"", + assetType:'static', + isUse:true, + resourceType:"三维课程", + sceneType:"standstation", + }; + + scope.staticAsset['PBMDH'] = { + modelId:'PBMDH', + packageName:"屏蔽门", + url:JL3D_LOCAL_STATIC+"/lesson3d/PBMDH.FBX", + mesh:"", + assetType:'static', + isUse:true, + resourceType:"三维课程", + sceneType:"standstation", + }; + scope.staticAsset['wxc'] = { + modelId:'wxc', + packageName:"维修厂", + url:"/MODEL/2021-08-12/196-43574.FBX", + mesh:"", + assetType:'onlineasset', + isUse:true, + resourceType:"三维课程", + sceneType:"stopstation", + }; + + scope.staticAsset['occ'] = { + modelId:'occ', + packageName:"occ大厅", + url:"/MODEL/2021-09-02/210-32471.FBX", + mesh:"", + assetType:'onlineasset', + isUse:true, + resourceType:"三维课程", + sceneType:"occ", + }; + + + //场景中可触发事件模型 + this.lessonTriggerList = []; + + scope.lessonTriggerList["standstation"] = []; + scope.lessonTriggerList["stopstation"] = []; + + scope.lessonTriggerList["occ"] = []; + + scope.lessonTriggerList["device"] = []; + scope.lessonTriggerList["xl"] = []; + scope.lessonTriggerList["dc"] = []; + + this.changeSceneGroup = function(groupType){ + // console.log(groupType); + // console.log(editor.nowSceneType); + // console.log(scope.lessonTriggerList[editor.nowSceneType]); + editor.nowSceneType = groupType; + scene.remove(this.otherModel); + this.otherModel = groupList[groupType]; + scene.add(this.otherModel); + updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]); + } + + this.saveModelList = function(){ + let modelList = { + assetList:[], + modelList:[], + }; + + for(let k in scope.loadAsset){ + modelList.assetList.push({ + modelId:scope.loadAsset[k].modelId, + packageName:scope.loadAsset[k].packageName, + url:scope.loadAsset[k].url, + assetType:scope.loadAsset[k].assetType, + isUse:scope.loadAsset[k].isUse, + resourceType:scope.loadAsset[k].resourceType, + sceneType:scope.loadAsset[k].sceneType, + }); + } + + for(let g in scope.lessonTriggerList){ + for(let i=0;i { + + initTriggerList(); + if(lessonData){ + let modelList = lessonData.modelList; + for(let i=0;i { + //console.log(error); + }); + + }); + } + + this.deleteAsset = function(selectModel,nowSceneType){ + scope.otherModel.remove(selectModel); + for(let i=0;i + // + // + // + // + //FT 扶梯 + //FTAN 扶梯按钮(急停) + //FTD 扶梯灯 + //FTKG 扶梯开关(钥匙孔) + //FTTJ 扶梯台阶 + function initTriggerList(){ + scope.staticAsset['station'].mesh.getObjectByName("FTAN").showType = "default"; + scope.staticAsset['station'].mesh.getObjectByName("FTAN").label = "扶梯急停按钮"; + scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTAN")); + + scope.staticAsset['station'].mesh.getObjectByName("FTKG").showType = "default"; + scope.staticAsset['station'].mesh.getObjectByName("FTKG").label = "扶梯钥匙孔"; + scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTKG")); + + scope.staticAsset['station'].mesh.getObjectByName("spbmkg").showType = "default"; + scope.staticAsset['station'].mesh.getObjectByName("spbmkg").label = "屏蔽门开关"; + scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg")); + + + + // console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG")); + } + + //动态加载资源 + this.lessonAssetsNewLoader = function(assetData,pos,nowSceneType){ + let isLoaded = false; + var rand = Math.floor(Math.random () * 900) + 100; + if(scope.loadAsset[assetData.id]){ + let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true); + newModelTrigger.modelId = assetData.id; + newModelTrigger.showType = "loadModel"; + newModelTrigger.label = assetData.packageName +rand; + newModelTrigger.position.copy(pos); + newModelTrigger.sceneType = nowSceneType; + + scope.lessonTriggerList[nowSceneType].push(newModelTrigger); + groupList[nowSceneType].add(newModelTrigger); + + updateTriggerList(scope.lessonTriggerList[nowSceneType]); + }else{ + scope.loadAsset[assetData.id] = { + modelId:assetData.id, + packageName:assetData.packageName +rand, + url:assetData.url, + mesh:"", + assetType:'loadModel', + isUse:true, + resourceType:"三维课程", + sceneType:nowSceneType, + }; + console.log("new"); + + fbxpromise(scope.loadAsset[assetData.id]).then(function(object){ + + console.log(scope.loadAsset[assetData.id].mesh); + + let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true); + newModelTrigger.showType = "loadModel"; + newModelTrigger.modelId = assetData.id; + newModelTrigger.label = assetData.packageName+rand; + newModelTrigger.position.copy(pos); + newModelTrigger.sceneType = nowSceneType; + + scope.lessonTriggerList[nowSceneType].push(newModelTrigger); + groupList[nowSceneType].add(newModelTrigger); + + updateTriggerList(scope.lessonTriggerList[nowSceneType]); + // resolve("loadednew"); + }); + } + } + + + //fbx模型加载 + function fbxpromise(asset){ + return new Promise(function(resolve, reject){ + var loader = new THREE.FBXLoader(); + // console.log(asset); + // console.log(asset.url); + if(asset.assetType == "static"){ + loader.load( asset.url, function ( object ) { + if(asset.sceneType){ + object.sceneType = asset.sceneType; + } + asset.mesh = object; + groupList[asset.sceneType].add(object); + // scope.otherModel.add(object); + resolve(); + } ); + }else if(asset.assetType == "onlineasset"){ + loader.load( BASE_ASSET_API+asset.url, function ( object ) { + if(asset.sceneType){ + object.sceneType = asset.sceneType; + } + asset.mesh = object; + groupList[asset.sceneType].add(object); + + resolve(); + } ); + }else{ + loader.load( BASE_ASSET_API+asset.url, function ( object ) { + if(asset.sceneType){ + object.sceneType = asset.sceneType; + } + asset.mesh = object; + if(asset.assetType == "default"){ + + console.log(object); + // scene.add(object); + }else if(asset.assetType == 'loadModel'){ + + } + + resolve(); + } ); + } + + + }); + } + +} diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index a01be0900..fff11fe1f 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,9 +3,9 @@ export function getBaseUrl() { if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud'; - // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 + BASE_API = 'http://192.168.8.152:9000'; // 袁琪 // BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线 - BASE_API = 'http://192.168.8.167:9000'; // 旭强 无线 + // BASE_API = 'http://192.168.8.167:9000'; // 旭强 无线 // BASE_API = 'http://192.168.2.183:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/jlmap3d/drive/drivecontrol/toprightpane.vue b/src/views/jlmap3d/drive/drivecontrol/toprightpane.vue index be7595f7f..c656e749f 100644 --- a/src/views/jlmap3d/drive/drivecontrol/toprightpane.vue +++ b/src/views/jlmap3d/drive/drivecontrol/toprightpane.vue @@ -103,14 +103,6 @@
{{ $t('jlmap3d.removalATP') }}
-
{{ $t('jlmap3d.openRightDoor') }}
@@ -123,14 +115,23 @@
{{ $t('jlmap3d.emergencyBraking') }}
- + @@ -140,7 +141,17 @@ - - From 7dfa74857c07ed2c188bf14eee1c1b83396027cb Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 8 Sep 2021 14:42:44 +0800 Subject: [PATCH 20/20] =?UTF-8?q?Revert=20"=E6=98=BE=E7=A4=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ab38588a --- src/scripts/ConstConfig.js | 3 +- .../mapoperate/displayConfig/depotConfig.vue | 221 ------------------ .../newMap/newMapdraft/mapoperate/index.vue | 32 ++- .../{displayConfig => }/localConfig.vue | 68 +----- .../{displayConfig => }/splitScreen.vue | 0 5 files changed, 22 insertions(+), 302 deletions(-) delete mode 100644 src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue rename src/views/newMap/newMapdraft/mapoperate/{displayConfig => }/localConfig.vue (78%) rename src/views/newMap/newMapdraft/mapoperate/{displayConfig => }/splitScreen.vue (100%) diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 4abaabc07..bdf4c6ba5 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -159,8 +159,7 @@ export default { { enlabel: 'Comprehensive exercise cloud platform', label: '综合演练云平台', value: '03'}, { enlabel: 'Driver simulation driving system', label: '司机模拟驾驶系统', value: '04'}, { enlabel: 'Dispatch workstation', label: '派班工作站', value: '05'}, - { enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'}, - { enlabel: 'Interlocking station at depot', label: '车辆段联锁工作站', value: '09' } + { enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'} ], trainingDeviceType: { Switch: {enlabel: 'Switch training', label:'道岔实训'}, diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue deleted file mode 100644 index dc0ab224a..000000000 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue +++ /dev/null @@ -1,221 +0,0 @@ - - - - - diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index c61d4f0d8..9eea48018 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -13,10 +13,8 @@ 配置 - 行调配置 现地配置 大屏配置 - 车辆段配置 @@ -40,10 +38,16 @@ /> - - - - + + @@ -71,13 +75,11 @@ import ResponderDraft from './responder/index'; import ControlLamp from './controlLamp'; import SplitStation from './splitStation'; import Arrow from './arrow'; -import SplitScreen from './displayConfig/splitScreen'; +import SplitScreen from './splitScreen'; import FloodGate from './floodGate'; import DirectionRod from './directionRod'; import SignalButton from './signalButton'; -import LocalConfig from './displayConfig/localConfig'; -import DispatchConfig from './displayConfig/dispatchConfig'; -import DepotConfig from './displayConfig/depotConfig'; +import LocalConfig from './localConfig'; export default { name: 'MapOperate', @@ -109,9 +111,7 @@ export default { FloodGate, DirectionRod, SignalButton, - LocalConfig, - DispatchConfig, - DepotConfig + LocalConfig }, props: { selected: { @@ -188,18 +188,12 @@ export default { dataRelation() { this.$emit('selectView', 'path'); }, - showDispatchConfig() { - this.configShow = 'dispatch'; - }, showLocalConfig() { this.configShow = 'local'; }, showScreenConfig() { this.configShow = 'screen'; }, - showDepotConfig() { - this.configShow = 'depot'; - }, goDraw() { this.configShow = 'none'; }, diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue b/src/views/newMap/newMapdraft/mapoperate/localConfig.vue similarity index 78% rename from src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue rename to src/views/newMap/newMapdraft/mapoperate/localConfig.vue index 8010d9981..a6d58382c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/localConfig.vue @@ -65,8 +65,7 @@
- 按集中站生成 - 全显生成 + 按集中站生成并保存 保存 返回
@@ -92,9 +91,7 @@ export default { data() { return { tableData: [], - otherData: [], addModel: { - type: 'LOCAL', stationCodeList: [], switchStationCodeList:[], elementList: [] @@ -128,6 +125,7 @@ export default { 'tempSpeedLimitList', 'textList', 'totalGuideLockButtonVOList', + 'localStationConfig', 'seclectDeviceList' ]), cardTitle() { @@ -160,14 +158,7 @@ export default { // } // }, initData() { - // this.tableData = (this.$store.state.map.map.displayList || []).filter(item => item.type === 'LOCAL'); - this.$store.state.map.map.displayList.forEach( item => { - if (item.type === 'LOCAL') { - this.tableData.push(item); - } else { - this.otherData.push(item); - } - }); + this.tableData = this.$store.state.map.map.displayList || []; }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) { @@ -231,7 +222,7 @@ export default { save() { const map = this.$store.state.map.map; const param = { - displayList: [...this.tableData, ...this.otherData], + displayList: this.tableData, mapId: this.$route.params.mapId }; this.dataLoading = true; @@ -260,63 +251,20 @@ export default { this.clearData(); }, clear() { - this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; }, clearData() { - this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] }; this.index = ''; this.cardMode = 'generate'; }, - generateAllData() { - this.loading = true; - this.tableData = []; - const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; - const stationCodeList = []; - this.stationList.forEach(item => { - if (!item.depot) { - tempData.stationCodeList.push(item.code); - } else { stationCodeList.push(item.code); } - }); - [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, - ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList, - ...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => { - if (!stationCodeList.includes(item.stationCode)) { - tempData.elementList.push(item.code); - } - }); - [...this.directionRodList].forEach(item => { - if (!stationCodeList.includes(item.deviceStationCode)) { - tempData.elementList.push(item.code); - } - }); - this.psdList.forEach(item => { - const stand = this.$store.getters['map/getDeviceByCode'](item.standCode); - if (!stationCodeList.includes(stand.stationCode)) { - tempData.elementList.push(item.code); - } - }); - this.tableData.push(tempData); - const map = this.$store.state.map.map; - const param = { - displayList: [...this.tableData, ...this.otherData], - mapId: this.$route.params.mapId - }; - saveMap(Object.assign(map, param)).then(response => { - this.loading = false; - this.$message.success('保存现地配置成功'); - this.cancelOverlab(); - }).catch(() => { - this.loading = false; - this.$messageBox('保存现地配置失败'); - }); - }, generateData() { this.loading = true; this.tableData = []; // switchStationCodeList:[...item.switchStationCodeList, item.code] this.stationList.forEach(item => { if (item.centralized) { - this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]}); + this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]}); } }); @@ -337,7 +285,7 @@ export default { }); const map = this.$store.state.map.map; const param = { - displayList: [...this.tableData, ...this.otherData], + displayList: this.tableData, mapId: this.$route.params.mapId }; saveMap(Object.assign(map, param)).then(response => { diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/splitScreen.vue b/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue similarity index 100% rename from src/views/newMap/newMapdraft/mapoperate/displayConfig/splitScreen.vue rename to src/views/newMap/newMapdraft/mapoperate/splitScreen.vue