diff --git a/.env.development b/.env.development index b387ff05b..1f981edf9 100644 --- a/.env.development +++ b/.env.development @@ -8,6 +8,7 @@ NODE_ENV = 'development' VUE_APP_BASE_API = 'http://192.168.3.6:9000' VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_BASE_SITE='https://test.joylink.club/cbtc' # VUE_APP_VOICE_API = 'http://192.168.8.110:9008' diff --git a/.env.heb b/.env.heb index 6f94e6d38..f812f3b43 100644 --- a/.env.heb +++ b/.env.heb @@ -6,3 +6,4 @@ VUE_APP_PRO = 'local' VUE_APP_BASE_API = 'https://joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_BASE_SITE='https://joylink.club/cbtc' diff --git a/.env.ntyl b/.env.ntyl index 1ba6de5da..23049259f 100644 --- a/.env.ntyl +++ b/.env.ntyl @@ -6,3 +6,4 @@ VUE_APP_PRO = 'ntyl' VUE_APP_BASE_API = 'https://joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_BASE_SITE='https://joylink.club/cbtc' diff --git a/.env.production b/.env.production index 71363ca9f..6924d751f 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,4 @@ NODE_ENV = 'production' VUE_APP_BASE_API = 'https://api.joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_BASE_SITE='https://joylink.club/cbtc' diff --git a/.env.staging b/.env.staging index d1042b068..35048ea21 100644 --- a/.env.staging +++ b/.env.staging @@ -5,3 +5,4 @@ NODE_ENV = 'test' VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_BASE_SITE='https://test.joylink.club/cbtc' diff --git a/src/App.vue b/src/App.vue index f327f2ba1..73df28b15 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +
@@ -108,3 +108,6 @@ export default { }; + diff --git a/src/api/jmap/mapdraft.js b/src/api/jmap/mapdraft.js index 6eba1062e..4fc677c8e 100644 --- a/src/api/jmap/mapdraft.js +++ b/src/api/jmap/mapdraft.js @@ -562,3 +562,35 @@ export function deleteStationDestination(mapId, code) { method: 'delete' }); } + +// 大铁地图进路相关接口 创建,修改,删除,根据id查询, +export function postBigRoute(data, mapId) { + return request({ + url: `/api/draftMap/${mapId}/route/railway `, + method: 'post', + data:data + }); +} +export function getBigRouteList(mapId) { + return request({ + url: `/api/draftMap/${mapId}/route/all `, + method: 'get' + }); +} +// 大铁地图进路删除接口 +export function deleteBigRoute(mapId, code) { + return request({ + url: `/api/draftMap/${mapId}/route/${code}`, + method: 'delete' + }); +} + +// 草稿地图修改检查配置接口 +export function checkConfig(mapId, data) { + return request({ + url: `/api/mapBuild/${mapId}/checkConfig `, + method: 'PUT', + data + }); +} +// { check: true/false } (body体) diff --git a/src/api/rtSimulation.js b/src/api/rtSimulation.js new file mode 100644 index 000000000..034133da0 --- /dev/null +++ b/src/api/rtSimulation.js @@ -0,0 +1,94 @@ +import request from '@/utils/request'; +/** 创建仿真 */ +export function createSimulation(data) { + return request({ + url: `/rtSimulation?mapId=${data.mapId}&prdType=${data.prdType}`, + method: 'post' + }); +} +/** 根据仿真group获取仿真基础信息 */ +export function getSimulationInfoByGroup(groupId) { + return request({ + url: `/rtSimulation/${groupId}`, + method: 'get' + }); +} +/** 根据仿真group获取仿真地图数据 */ +export function getMapDataByGroup(groupId) { + return request({ + url: `/rtSimulation/${groupId}/mapData`, + method: 'get' + }); +} +/** 仿真发送指令 */ +export function sendSimulationCommand(group, memberId, type, data) { + return request({ + url: `/common/simulation/${group}/member/${memberId}/operate/${type}`, + method: 'post', + data + }); +} +/** 获取仿真成员列表 */ +export function getMemberListCommon(group) { + return request({ + url: `/common/simulation/${group}/members`, + method: 'get' + }); +} +/** 获取仿真用户列表 */ +export function getUserListCommon(group) { + return request({ + url: `/common/simulation/${group}/users`, + method: 'get' + }); +} +/** 销毁仿真 */ +export function destroySimulation(group) { + return request({ + url: `/common/simulation/${group}/destroy`, + method: 'delete' + }); +} +/** 初始化仿真 */ +export function initSimulation(group) { + return request({ + url: `/common/simulation/${group}/init`, + method: 'put' + }); +} +/** 设置故障 */ +export function setSimulationFault(group, data) { + return request({ + url: `/common/simulation/${group}/fault`, + method: 'post', + data + }); +} +/** 取消故障 */ +export function cancelSimulationFault(group, deviceId, faultType) { + return request({ + url: `/common/simulation/${group}/device/${deviceId}/fault/${faultType}`, + method: 'delete' + }); +} +/** 仿真运行倍速 */ +export function timesSpeedPlayback(group, speed) { + return request({ + url: `/common/simulation/${group}/updateSpeed/${speed}`, + method: 'put' + }); +} +/** 仿真暂停 */ +export function simulationPause(group) { + return request({ + url: `/common/simulation/${group}/pause`, + method: 'put' + }); +} +/** 仿真开始 */ +export function simulationStart(group) { + return request({ + url: `/common/simulation/${group}/start`, + method: 'put' + }); +} diff --git a/src/api/trainingPlatform.js b/src/api/trainingPlatform.js index 277ffebb1..6a3d9a6b2 100644 --- a/src/api/trainingPlatform.js +++ b/src/api/trainingPlatform.js @@ -15,6 +15,13 @@ export function generateMapSystem(mapId) { method: 'post' }); } +/** 生成指定子系统 */ +export function generateAppointMapSystem(mapId, prdType) { + return request({ + url: `/api/mapSystem/generate/${mapId}/${prdType}`, + method: 'post' + }); +} /** 查询子系统信息 */ export function getSubSystemInfo(id) { return request({ diff --git a/src/components/QrCode/index.vue b/src/components/QrCode/index.vue index 91f669e57..7f7b653f6 100644 --- a/src/components/QrCode/index.vue +++ b/src/components/QrCode/index.vue @@ -1,9 +1,9 @@ -
+
diff --git a/src/i18n/langs/zh/planMonitor.js b/src/i18n/langs/zh/planMonitor.js index ed8fcf544..3e8e64076 100644 --- a/src/i18n/langs/zh/planMonitor.js +++ b/src/i18n/langs/zh/planMonitor.js @@ -20,9 +20,7 @@ export default { deletePlanCar: '删除计划车' }, openRunPlan: { - // selectRunplan: '选择运行图', delete: '删除', - // modify: '修改', runPlanList: '运行图列表', getRunPlanListFail: '获取运行图列表失败', confirmDeleteRunPlan: '您确认是否删除此运行图?', @@ -32,71 +30,24 @@ export default { modifying: { tripNumber: '车次号:', pleaseSelect: '请选择', - manual: '手工', - defaultStopTime: '缺省停站时间:', serviceNumber: '表号:', - clearGuest: '清客', - continuationPlan: '延续计划', - firstTrain: '首班车', - serialNumber: '序列号:', defaultRunLevel: '运行等级:', startTime: '开始时间', selectTime: '选择时间', - inStock: '入库', - outStock: '出库', - lastTrain: '末班车', - route: '交路:', - // startingStation 起始站 - // startSection 起始区段 - // endStationTitle 终到站 - // endSection 终到区段 - // description 描述 - // detail: '详情:', - // station: '车站', - // section: '区段', - // stopTime: '停站时间', - // runLevel: '运行等级', - // arrivalTime: '到点', - // departureTime: '发点', - showDefaultTime: '显示默认停站时间和运行等级', automatic: '自动', - default: '默认', modifyTask: '修改任务', - // setMessageTip1: '请先设置开始区段', - // setMessageTip2: '终到区段', - // setMessageTip3: '的站间运行时间', modifyTaskSuccess: '修改任务成功!', modifyTaskFailed: '修改任务失败', - startingStation: '起始站', startSection: '起始区段', endStation: '终点站', endSection: '终点区段', direction: '方向', distance: '距离', - // operation: '操作', - // edit: '编辑', - // save: '保存', - // cancelAndQuit: '取消&退出', modifySuccess: '修改成功!', modifyFailed: '修改失败', modifyRunLevel: '修改运行等级', - modifyStopTime:'修改停站时间', - - // startStationTips: '起始站发车时间不变', - // endStationTips: '终到站到达时间不变', - // startStationTitle: '起始站', - // startedStation: '起始站台', - endStationTitle: '终到站' - // endedStation: '终到站台', - // description: '描述', - // modifyTaskRoute: '修改任务交路', - // time: '时间', - - // modifyStartTime: '修改开始时间:', - // modifyStartTimeTitle: '修改起始时间', - // search: '查找', - // modifyTwoStationTime: '修改两站之间的时间' + modifyStopTime:'修改停站时间' }, editSmoothRun: { trainProportion: '分车比例', diff --git a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js index 5ed51299c..d870f5bfd 100644 --- a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js +++ b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js @@ -509,26 +509,28 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { } if (data.type == "SIGNAL") {//从上往下红绿黄 + if(data.red == 1){ - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; } if(data.yellow == 1){ - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; } if(data.green == 1){ - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; } } @@ -541,7 +543,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { scope.modelmanager.standmodel.action.time = 0; scope.modelmanager.standmodel.action.timeScale = 1; scope.modelmanager.standmodel.action.play(); - console.log(data); + localVoicePlay("开往"+psdVoiceStationList[data.code].finlStationName+"方向的列车进站了!"); } @@ -562,12 +564,12 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { this.deviceFaultSet = function (data) { if (data.type == "SIGNAL") {//从上往下红绿黄 - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; } if (data.type == "PSD" || data.type == "STAND") { scope.modelmanager.standmodel.screenDoorOpenStatus = "0"; @@ -653,35 +655,37 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { } if (data._type == "Signal") { + if(data.logicLight == 0){ if(data.redOpen == 1){ - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; } if(data.yellowOpen == 1){ - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; } if(data.greenOpen == 1){ - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; }else{ - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; } }else{ - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"]; + scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; } } diff --git a/src/jlmap3d/lesson3d/lesson3dplayer.js b/src/jlmap3d/lesson3d/lesson3dplayer.js new file mode 100644 index 000000000..5273dd56d --- /dev/null +++ b/src/jlmap3d/lesson3d/lesson3dplayer.js @@ -0,0 +1,88 @@ +import store from '@/store/index'; +// import { Loading } from 'element-ui'; +import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; +//静态资源文件路径 +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; +//loader +import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; +//轨道视角控制 +import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; +//骨骼动画模型辅助工具 +import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; + +import { AssetModelManager } from '@/jlmap3d/lesson3d/manager/assetmodelmanager.js'; + +import { ControlManager } from '@/jlmap3d/lesson3d/manager/controlmanager.js'; + +// import { AnimationManager } from '@/jlmap3d/lesson3d/manager/assetmodelmanager.js'; + + +//动画播放相关 +let clock = new THREE.Clock(); +let delta; + +let scene; + +export function Lesson3dPlayer(dom,lessonData,lessonIndex) { + + // let stats = new Stats(); + // dom.appendChild( stats.dom ); + + let scope = this; + this.dom = dom; + + //定义相机 + + + //定义场景(渲染容器) + scene = new THREE.Scene(); + scene.background = new THREE.Color(0xa0a0a0); + + //定义全局光 + let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); + scene.add(ambientLight); + var light = new THREE.HemisphereLight( 0xffffff, 0x444444 ); + light.position.set( 0, 4000, 0 ); + scene.add( light ); + + let controlManager = new ControlManager( dom,scene,lessonData,lessonIndex); + + let assetModelManager = new AssetModelManager(scene,controlManager); + assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList).then((result) => { + controlManager.initOctree(assetModelManager.loadAsset['default1'].mesh); + + animate(); + console.log(lessonData.lessonProgress[lessonIndex]); + if(lessonData.lessonProgress[lessonIndex].action.length>0){ + controlManager.initNewEvent(lessonData.lessonProgress[lessonIndex].action,assetModelManager.lessonTriggerList); + } + resolve("loadeend"); //['成功了', 'success'] + }).catch((error) => { + //console.log(error); + });; + + + + this.actionRemove = function(actionModel){ + assetModelManager.otherModel.remove(actionModel); + } + + + + //循环渲染函数 + function animate() { + + if(controlManager.controlMode == "free"){ + controlManager.updateOrbitControl(); + } + if(controlManager.controlMode == "fps"){ + controlManager.updateFpsControl(); + } + // delta = clock.getDelta(); + requestAnimationFrame(animate); + + } + + this.attachModel = function(selectModel){ + } +} diff --git a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js new file mode 100644 index 000000000..81012032f --- /dev/null +++ b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js @@ -0,0 +1,160 @@ +import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js'; + +export function AssetModelManager(scene) { + let scope = this; + + + this.assetList = []; + + this.otherModel = new THREE.Group(); + + scene.add(this.otherModel); + + this.loadAsset = []; + + this.loadAsset['default1'] = { + modelId:'default1', + packageName:"车站", + url:"/MODEL/2021-04-06/1381-54584.FBX", + mesh:"", + assetType:'default', + isUse:true, + resourceType:"三维课程", + }; + + //场景中可触发事件模型 + this.lessonTriggerList = []; + + //加载课程资源 + this.lessonAssetsLoader = function(assetList,modelList){ + let initlist = []; + if(assetList){ + for(let i = 0;i { + + initTriggerList(); + for(let i=0;i { + //console.log(error); + }); + + }); + resolve("loaderassets"); + + } + + + + // + // + // + // + // + //FT 扶梯 + //FTAN 扶梯按钮(急停) + //FTD 扶梯灯 + //FTKG 扶梯开关(钥匙孔) + //FTTJ 扶梯台阶 + function initTriggerList(){ + + scope.loadAsset['default1'].mesh.getObjectByName("FTAN").showType = "default"; + scope.loadAsset['default1'].mesh.getObjectByName("FTAN").label = "扶梯急停按钮"; + scope.lessonTriggerList.push(scope.loadAsset['default1'].mesh.getObjectByName("FTAN")); + + scope.loadAsset['default1'].mesh.getObjectByName("FTKG").showType = "default"; + scope.loadAsset['default1'].mesh.getObjectByName("FTKG").label = "扶梯钥匙孔"; + scope.lessonTriggerList.push(scope.loadAsset['default1'].mesh.getObjectByName("FTKG")); + + + // console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG")); + } + + //动态加载资源 + this.lessonAssetsNewLoader = function(assetData,pos){ + let isLoaded = false; + + 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; + newModelTrigger.position.copy(pos); + scope.otherModel.add(newModelTrigger); + scope.lessonTriggerList.push(newModelTrigger); + updateTriggerList(scope.lessonTriggerList); + }else{ + scope.loadAsset[assetData.id] = { + modelId:assetData.id, + packageName:assetData.packageName, + url:assetData.url, + mesh:"", + assetType:'loadModel', + isUse:true, + resourceType:"三维课程", + }; + + fbxpromise(scope.loadAsset[assetData.id]).then(function(object){ + + let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true); + newModelTrigger.showType = "loadModel"; + newModelTrigger.modelId = assetData.id; + newModelTrigger.label = assetData.packageName; + newModelTrigger.position.copy(pos); + scope.otherModel.add(newModelTrigger); + scope.lessonTriggerList.push(newModelTrigger); + + updateTriggerList(scope.lessonTriggerList); + // resolve("loadednew"); + }); + } + } + + + //fbx模型加载 + function fbxpromise(asset){ + return new Promise(function(resolve, reject){ + var loader = new THREE.FBXLoader(); + loader.load( BASE_ASSET_API+asset.url, function ( object ) { + + if(asset.assetType == "default"){ + scene.add(object); + }else if(asset.assetType == 'loadModel'){ + + } + object.label = asset.packageName; + asset.mesh = object; + resolve(); + } ); + + }); + } + +} diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js new file mode 100644 index 000000000..e306df16b --- /dev/null +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -0,0 +1,403 @@ + +import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js'; + +import { Octree } from '@/jlmap3d/lesson3d/math/Octree.js'; + +export function ControlManager(dom,scene,lessonData,lessonIndex) { + + let scope = this; + this.controlMode = ""; + this.controls = {}; + this.nowCamera = null; + this.eventHitMode = false; + + let eventBoxs = []; + + + + let renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setClearColor(new THREE.Color(0x000000)); + renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight); + renderer.setScissor( 0, 0, dom.offsetWidth, dom.offsetHeight); + renderer.setScissorTest( false ); + renderer.setSize(dom.offsetWidth, dom.offsetHeight); + renderer.sortObjects = true; + dom.appendChild(renderer.domElement); + + let orbitCamera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000); + orbitCamera.position.set(0, 80, 40); + orbitCamera.aspect = dom.offsetWidth / dom.offsetHeight; + orbitCamera.updateProjectionMatrix(); + + let oribitControl = new THREE.OrbitControls(orbitCamera,dom); + oribitControl.maxPolarAngle = Math.PI / 2; + oribitControl.minPolarangle = Math.PI / 5; + oribitControl.maxDistance = 800; + oribitControl.screenSpacePanning = true; + oribitControl.update(); + + + let fpsCamera = new THREE.PerspectiveCamera( 75,dom.offsetWidth / dom.offsetHeight, 0.1, 1000 ); + fpsCamera.aspect = dom.offsetWidth / dom.offsetHeight; + fpsCamera.rotation.order = 'YXZ'; + + let attachBox = new THREE.Mesh( + new THREE.BoxGeometry(1, 5, 1), + new THREE.MeshBasicMaterial({color: 0xff00000})//RED box + ); + let hitBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3()); + hitBox.setFromObject(attachBox); + scene.add(attachBox); + + //fps control + const GRAVITY = 30; + + const NUM_SPHERES = 20; + const SPHERE_RADIUS = 0.2; + + const sphereGeometry = new THREE.SphereGeometry( SPHERE_RADIUS, 32, 32 ); + const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0x888855, roughness: 0.8, metalness: 0.5 } ); + + const spheres = []; + let sphereIdx = 0; + + for ( let i = 0; i < NUM_SPHERES; i ++ ) { + + const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial ); + + + scene.add( sphere ); + + spheres.push( { mesh: sphere, collider: new THREE.Sphere( new THREE.Vector3( 0, - 100, 0 ), SPHERE_RADIUS ), velocity: new THREE.Vector3() } ); + + } + + scope.controlMode = lessonData.lessonProgress[lessonIndex].controlMode; + // scope.controls = oribitControl; + if(scope.controlMode == "free"){ + scope.nowCamera = orbitCamera; + scope.controls.enabled = true; + }else if(scope.controlMode == "fps"){ + scope.nowCamera = fpsCamera; + scope.controls.enabled = false; + } + + + + const worldOctree = new Octree(); + + const playerCollider = new Capsule( new THREE.Vector3( 0, 10, 0 ), new THREE.Vector3( 0, 11.9, 0 ), 1 ); + playerCollider.set( + new THREE.Vector3( + lessonData.lessonProgress[lessonIndex].cameraPosition.x, + lessonData.lessonProgress[lessonIndex].cameraPosition.y, + lessonData.lessonProgress[lessonIndex].cameraPosition.z), + new THREE.Vector3( + lessonData.lessonProgress[lessonIndex].cameraPosition.x, + lessonData.lessonProgress[lessonIndex].cameraPosition.y+1.5, + lessonData.lessonProgress[lessonIndex].cameraPosition.z ), 1); + attachBox.position.x = lessonData.lessonProgress[lessonIndex].cameraPosition.x; + attachBox.position.y = lessonData.lessonProgress[lessonIndex].cameraPosition.y ; + attachBox.position.z = lessonData.lessonProgress[lessonIndex].cameraPosition.z; + + + + + const playerVelocity = new THREE.Vector3(); + const playerDirection = new THREE.Vector3(); + + let playerOnFloor = false; + + const keyStates = {}; + let clock = new THREE.Clock(); + + this.updateOrbitControl = function(){ + oribitControl.update(); + }; + + this.updateFpsControl = function(){ + const deltaTime = Math.min( 0.1, clock.getDelta() ); + + controls( deltaTime ); + + updatePlayer( deltaTime ); + + updateSpheres( deltaTime ); + + if(scope.eventHitMode == true){ + if(eventBoxs.length>0){ + + attachBox.position.copy(fpsCamera.position); + for(let i=0;i { + + keyStates[ event.code ] = true; + + } ); + + document.addEventListener( 'keyup', ( event ) => { + + keyStates[ event.code ] = false; + + } ); + let fpsMouseStatus = false; + document.addEventListener( 'mousedown', () => { + fpsMouseStatus = true; + // document.body.requestPointerLock(); + } ); + + document.body.addEventListener( 'mousemove', ( event ) => { + if(fpsMouseStatus == true){ + fpsCamera.rotation.y -= event.movementX / 500; + fpsCamera.rotation.x -= event.movementY / 500; + } + // if ( document.pointerLockElement === document.body ) { + // } + } ); + + document.addEventListener( 'mouseup', () => { + fpsMouseStatus = false; + } ); + + + function playerCollitions() { + + const result = worldOctree.capsuleIntersect( playerCollider ); + + playerOnFloor = false; + + if ( result ) { + + playerOnFloor = result.normal.y > 0; + + if ( ! playerOnFloor ) { + + playerVelocity.addScaledVector( result.normal, - result.normal.dot( playerVelocity ) ); + + } + + playerCollider.translate( result.normal.multiplyScalar( result.depth ) ); + + } + + } + + function updatePlayer( deltaTime ) { + + if ( playerOnFloor ) { + + const damping = Math.exp( - 3 * deltaTime ) - 1; + playerVelocity.addScaledVector( playerVelocity, damping ); + + } else { + + playerVelocity.y -= GRAVITY * deltaTime; + + } + + const deltaPosition = playerVelocity.clone().multiplyScalar( deltaTime ); + playerCollider.translate( deltaPosition ); + + playerCollitions(); + + fpsCamera.position.copy( playerCollider.end ); + + } + + function spheresCollisions() { + + for ( let i = 0; i < spheres.length; i ++ ) { + + const s1 = spheres[ i ]; + + for ( let j = i + 1; j < spheres.length; j ++ ) { + + const s2 = spheres[ j ]; + + const d2 = s1.collider.center.distanceToSquared( s2.collider.center ); + const r = s1.collider.radius + s2.collider.radius; + const r2 = r * r; + + if ( d2 < r2 ) { + + const normal = s1.collider.clone().center.sub( s2.collider.center ).normalize(); + const v1 = normal.clone().multiplyScalar( normal.dot( s1.velocity ) ); + const v2 = normal.clone().multiplyScalar( normal.dot( s2.velocity ) ); + s1.velocity.add( v2 ).sub( v1 ); + s2.velocity.add( v1 ).sub( v2 ); + + const d = ( r - Math.sqrt( d2 ) ) / 2; + + s1.collider.center.addScaledVector( normal, d ); + s2.collider.center.addScaledVector( normal, - d ); + + } + + } + + } + + } + + function updateSpheres( deltaTime ) { + + spheres.forEach( sphere =>{ + + sphere.collider.center.addScaledVector( sphere.velocity, deltaTime ); + + const result = worldOctree.sphereIntersect( sphere.collider ); + + if ( result ) { + + sphere.velocity.addScaledVector( result.normal, - result.normal.dot( sphere.velocity ) * 1.5 ); + sphere.collider.center.add( result.normal.multiplyScalar( result.depth ) ); + + } else { + + sphere.velocity.y -= GRAVITY * deltaTime; + + } + + const damping = Math.exp( - 1.5 * deltaTime ) - 1; + sphere.velocity.addScaledVector( sphere.velocity, damping ); + + spheresCollisions(); + + sphere.mesh.position.copy( sphere.collider.center ); + + } ); + + } + + function getForwardVector() { + + fpsCamera.getWorldDirection( playerDirection ); + playerDirection.y = 0; + playerDirection.normalize(); + + return playerDirection; + + } + + function getSideVector() { + + fpsCamera.getWorldDirection( playerDirection ); + playerDirection.y = 0; + playerDirection.normalize(); + playerDirection.cross( fpsCamera.up ); + + return playerDirection; + + } + + function controls( deltaTime ) { + + const speed = 25; + + if ( playerOnFloor ) { + + if ( keyStates[ 'KeyW' ] ) { + + playerVelocity.add( getForwardVector().multiplyScalar( speed * deltaTime ) ); + + } + + if ( keyStates[ 'KeyS' ] ) { + + playerVelocity.add( getForwardVector().multiplyScalar( - speed * deltaTime ) ); + + } + + if ( keyStates[ 'KeyA' ] ) { + + playerVelocity.add( getSideVector().multiplyScalar( - speed * deltaTime ) ); + + } + + if ( keyStates[ 'KeyD' ] ) { + + playerVelocity.add( getSideVector().multiplyScalar( speed * deltaTime ) ); + + } + + + + } + + } + + function render(){ + + if(scope.nowCamera){ + renderer.render( scene, scope.nowCamera ); + } + } + window.onresize = function () { + renderer.setSize(dom.offsetWidth,dom.offsetHeight); + } + + this.initNewEvent = function(actions,lessonTriggerList){ + console.log(actions); + console.log(lessonTriggerList); + eventBoxs = []; + for(let i=0;i 8 && level < 16 ) { + + subTrees[ i ].split( level + 1 ); + + } + + if ( len != 0 ) { + + this.subTrees.push( subTrees[ i ] ); + + } + + } + + return this; + + }, + + build: function () { + + this.calcBox(); + this.split( 0 ); + + return this; + + }, + + getRayTriangles: function ( ray, triangles ) { + + for ( var i = 0; i < this.subTrees.length; i ++ ) { + + var subTree = this.subTrees[ i ]; + if ( ! ray.intersectsBox( subTree.box ) ) continue; + + if ( subTree.triangles.length > 0 ) { + + for ( var j = 0; j < subTree.triangles.length; j ++ ) { + + if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] ); + + } + + } else { + + subTree.getRayTriangles( ray, triangles ); + + } + + } + + return triangles; + + }, + + triangleCapsuleIntersect: function ( capsule, triangle ) { + + var point1, point2, line1, line2; + + triangle.getPlane( _plane ); + + var d1 = _plane.distanceToPoint( capsule.start ) - capsule.radius; + var d2 = _plane.distanceToPoint( capsule.end ) - capsule.radius; + + if ( ( d1 > 0 && d2 > 0 ) || ( d1 < - capsule.radius && d2 < - capsule.radius ) ) { + + return false; + + } + + var delta = Math.abs( d1 / ( Math.abs( d1 ) + Math.abs( d2 ) ) ); + var intersectPoint = _v1.copy( capsule.start ).lerp( capsule.end, delta ); + + if ( triangle.containsPoint( intersectPoint ) ) { + + return { normal: _plane.normal.clone(), point: intersectPoint.clone(), depth: Math.abs( Math.min( d1, d2 ) ) }; + + } + + var r2 = capsule.radius * capsule.radius; + + line1 = _line1.set( capsule.start, capsule.end ); + + var lines = [ + [ triangle.a, triangle.b ], + [ triangle.b, triangle.c ], + [ triangle.c, triangle.a ] + ]; + + for ( var i = 0; i < lines.length; i ++ ) { + + line2 = _line2.set( lines[ i ][ 0 ], lines[ i ][ 1 ] ); + + [ point1, point2 ] = capsule.lineLineMinimumPoints( line1, line2 ); + + if ( point1.distanceToSquared( point2 ) < r2 ) { + + return { normal: point1.clone().sub( point2 ).normalize(), point: point2.clone(), depth: capsule.radius - point1.distanceTo( point2 ) }; + + } + + } + + return false; + + }, + + triangleSphereIntersect: function ( sphere, triangle ) { + + triangle.getPlane( _plane ); + + if ( ! sphere.intersectsPlane( _plane ) ) return false; + + var depth = Math.abs( _plane.distanceToSphere( sphere ) ); + var r2 = sphere.radius * sphere.radius - depth * depth; + + var plainPoint = _plane.projectPoint( sphere.center, _v1 ); + + if ( triangle.containsPoint( sphere.center ) ) { + + return { normal: _plane.normal.clone(), point: plainPoint.clone(), depth: Math.abs( _plane.distanceToSphere( sphere ) ) }; + + } + + var lines = [ + [ triangle.a, triangle.b ], + [ triangle.b, triangle.c ], + [ triangle.c, triangle.a ] + ]; + + for ( var i = 0; i < lines.length; i ++ ) { + + _line1.set( lines[ i ][ 0 ], lines[ i ][ 1 ] ); + _line1.closestPointToPoint( plainPoint, true, _v2 ); + + var d = _v2.distanceToSquared( sphere.center ); + + if ( d < r2 ) { + + return { normal: sphere.center.clone().sub( _v2 ).normalize(), point: _v2.clone(), depth: sphere.radius - Math.sqrt( d ) }; + + } + + } + + return false; + + }, + + getSphereTriangles: function ( sphere, triangles ) { + + for ( var i = 0; i < this.subTrees.length; i ++ ) { + + var subTree = this.subTrees[ i ]; + + if ( ! sphere.intersectsBox( subTree.box ) ) continue; + + if ( subTree.triangles.length > 0 ) { + + for ( var j = 0; j < subTree.triangles.length; j ++ ) { + + if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] ); + + } + + } else { + + subTree.getSphereTriangles( sphere, triangles ); + + } + + } + + }, + + getCapsuleTriangles: function ( capsule, triangles ) { + + for ( var i = 0; i < this.subTrees.length; i ++ ) { + + var subTree = this.subTrees[ i ]; + + if ( ! capsule.intersectsBox( subTree.box ) ) continue; + + if ( subTree.triangles.length > 0 ) { + + for ( var j = 0; j < subTree.triangles.length; j ++ ) { + + if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] ); + + } + + } else { + + subTree.getCapsuleTriangles( capsule, triangles ); + + } + + } + + }, + + sphereIntersect( sphere ) { + + _sphere.copy( sphere ); + + var triangles = [], result, hit = false; + + this.getSphereTriangles( sphere, triangles ); + + for ( var i = 0; i < triangles.length; i ++ ) { + + if ( result = this.triangleSphereIntersect( _sphere, triangles[ i ] ) ) { + + hit = true; + + _sphere.center.add( result.normal.multiplyScalar( result.depth ) ); + + } + + } + + if ( hit ) { + + var collisionVector = _sphere.center.clone().sub( sphere.center ); + var depth = collisionVector.length(); + + return { normal: collisionVector.normalize(), depth: depth }; + + } + + return false; + + }, + + capsuleIntersect: function ( capsule ) { + + _capsule.copy( capsule ); + + var triangles = [], result, hit = false; + + this.getCapsuleTriangles( _capsule, triangles ); + + for ( var i = 0; i < triangles.length; i ++ ) { + + if ( result = this.triangleCapsuleIntersect( _capsule, triangles[ i ] ) ) { + + hit = true; + + _capsule.translate( result.normal.multiplyScalar( result.depth ) ); + + } + + } + + if ( hit ) { + + var collisionVector = _capsule.getCenter( new THREE.Vector3() ).sub( capsule.getCenter( _v1 ) ); + var depth = collisionVector.length(); + + return { normal: collisionVector.normalize(), depth: depth }; + + } + + return false; + + }, + + rayIntersect: function ( ray ) { + + if ( ray.direction.length() === 0 ) return; + + var triangles = [], triangle, position, + distance = 1e100, + result; + + this.getRayTriangles( ray, triangles ); + + for ( var i = 0; i < triangles.length; i ++ ) { + + result = ray.intersectTriangle( triangles[ i ].a, triangles[ i ].b, triangles[ i ].c, true, _v1 ); + + if ( result ) { + + var newdistance = result.sub( ray.origin ).length(); + + if ( distance > newdistance ) { + + position = result.clone().add( ray.origin ); + distance = newdistance; + triangle = triangles[ i ]; + + } + + } + + } + + return distance < 1e100 ? { distance: distance, triangle: triangle, position: position } : false; + + }, + + fromGraphNode: function ( group ) { + + group.traverse( ( obj ) => { + + if ( obj.type === 'Mesh' ) { + + obj.updateMatrix(); + obj.updateWorldMatrix(); + + var geometry, isTemp = false; + + if ( obj.geometry.index ) { + + isTemp = true; + geometry = obj.geometry.clone().toNonIndexed(); + + } else { + + geometry = obj.geometry; + + } + + var positions = geometry.attributes.position.array; + var transform = obj.matrixWorld; + + for ( var i = 0; i < positions.length; i += 9 ) { + + var v1 = new THREE.Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); + var v2 = new THREE.Vector3( positions[ i + 3 ], positions[ i + 4 ], positions[ i + 5 ] ); + var v3 = new THREE.Vector3( positions[ i + 6 ], positions[ i + 7 ], positions[ i + 8 ] ); + + v1.applyMatrix4( transform ); + v2.applyMatrix4( transform ); + v3.applyMatrix4( transform ); + + this.addTriangle( new THREE.Triangle( v1, v2, v3 ) ); + + } + + if ( isTemp ) { + + geometry.dispose(); + + } + + } + + } ); + + this.build(); + + return this; + + } + + } ); + + return Octree; + +} )(); + +export { Octree }; diff --git a/src/jlmap3d/lesson3d/model/lessondata.js b/src/jlmap3d/lesson3d/model/lessondata.js new file mode 100644 index 000000000..96cc06a5b --- /dev/null +++ b/src/jlmap3d/lesson3d/model/lessondata.js @@ -0,0 +1,177 @@ + +export function LessonData() { + let scope = this; + + this.lessonId = ""; + this.lessonName = ""; + this.lessonType = ""; + this.lessonStatus = ""; + this.lessonData = { + //资源列表 + assetList:[], + //场景交互物体列表 + modelList:[], + //课程组件启用状态 + lessonTools:[], + dataType:"", + toolJobPane:[], + //课程内容 + lessonProgress:[ + + ] + }; + + this.initLessonProgress = function(){ + let newLessonProgress = { + id:generateUUID(), + progressName:"命名", + roleName:"", + roleUse:true, + + progressScene:"", + nextCode:"", + nextNode:"", + triggerType:"", + triggerMode:"", + triggerTime:"", + triggerModel:"", + controlMode:"", + cameraMode:"", + changeCamera:false, + cameraPosition:{ + x:0, + y:0, + z:0 + }, + cameraTarget:{ + x:0, + y:0, + z:0 + }, + assetId:scope.lessonData.lessonProgress.length, + assetPos:"", + assetRot:"", + assetType:"", + index:"", + stepTipsData:{ + tittle:"标题", + text:"内容", + }, + explainPane:{ + tittle:"标题", + picurl:"url", + text:"内容", + }, + action:[], + }; + + scope.lessonData.lessonProgress.push(newLessonProgress); + + } + + this.loadLessonProgress = function(loadData){ + console.log(loadData); + for(let i=0;i { @@ -99,8 +99,12 @@ export function AssetModelManager(scene) { newModelTrigger.label = modelList[i].label; newModelTrigger.modelId = modelList[i].modelId; newModelTrigger.visible = modelList[i].visible; - newModelTrigger.position.copy(modelList[i].pos); - newModelTrigger.rotation.copy(modelList[i].rot); + newModelTrigger.position.x = modelList[i].pos.x; + newModelTrigger.position.y = modelList[i].pos.y; + newModelTrigger.position.z = modelList[i].pos.z; + newModelTrigger.rotation.x = modelList[i].rot.x; + newModelTrigger.rotation.y = modelList[i].rot.y; + newModelTrigger.rotation.z = modelList[i].rot.z; scope.otherModel.add(newModelTrigger); scope.lessonTriggerList.push(newModelTrigger); } diff --git a/src/jlmap3d/lesson3dedit/lesson3deditor.js b/src/jlmap3d/lesson3dedit/lesson3deditor.js index f6e058dc1..dd26886df 100644 --- a/src/jlmap3d/lesson3dedit/lesson3deditor.js +++ b/src/jlmap3d/lesson3dedit/lesson3deditor.js @@ -12,7 +12,7 @@ import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js'; - +import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/TransformControls'; //动画播放相关 let clock = new THREE.Clock(); @@ -64,26 +64,48 @@ export function Lesson3dEditor(dom,lessonData) { lesson3dUpdateControl(scope.controls); + let transcontrol = new THREE.TransformControls( scope.camerass, scope.renderer.domElement ); + // + transcontrol.addEventListener( 'change', render ); + // + transcontrol.addEventListener( 'dragging-changed', function ( event ) { + scope.controls.enabled = ! event.value; + } ); + // + scene.add(transcontrol); + + + let assetModelManager = new AssetModelManager(scene); - if(lessonData.assetList.length>0 || lessonData.modelList.length>0){ - assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList); + console.log(lessonData); + if(lessonData){ + if(lessonData.assetList.length>0 || lessonData.modelList.length>0){ + assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList); + }else{ + assetModelManager.lessonAssetsLoader(); + } }else{ assetModelManager.lessonAssetsLoader(); } + animate(); //循环渲染函数 function animate() { - scope.renderer.render( scene, scope.camerass ); + render(); scope.controls.update(); // delta = clock.getDelta(); requestAnimationFrame(animate); } + function render(){ + scope.renderer.render( scene, scope.camerass ); + } + window.onresize = function () { scope.renderer.setSize(dom.offsetWidth,dom.offsetHeight); } @@ -111,4 +133,8 @@ export function Lesson3dEditor(dom,lessonData) { this.saveAssetModel = function(){ return assetModelManager.saveModelList(); } + + this.attachModel = function(selectModel){ + transcontrol.attach(selectModel); + } } diff --git a/src/jlmap3d/lesson3dedit/model/lessondata.js b/src/jlmap3d/lesson3dedit/model/lessondata.js index f3e972c21..96cc06a5b 100644 --- a/src/jlmap3d/lesson3dedit/model/lessondata.js +++ b/src/jlmap3d/lesson3dedit/model/lessondata.js @@ -24,7 +24,7 @@ export function LessonData() { this.initLessonProgress = function(){ let newLessonProgress = { id:generateUUID(), - progressName:"", + progressName:"命名", roleName:"", roleUse:true, @@ -37,8 +37,17 @@ export function LessonData() { triggerModel:"", controlMode:"", cameraMode:"", - cameraPosition:"", - cameraTarget:"", + changeCamera:false, + cameraPosition:{ + x:0, + y:0, + z:0 + }, + cameraTarget:{ + x:0, + y:0, + z:0 + }, assetId:scope.lessonData.lessonProgress.length, assetPos:"", assetRot:"", @@ -53,10 +62,7 @@ export function LessonData() { picurl:"url", text:"内容", }, - action:{ - actionType:"事件操作类型", - actionMode:"触发事件类型", - }, + action:[], }; scope.lessonData.lessonProgress.push(newLessonProgress); @@ -81,6 +87,7 @@ export function LessonData() { triggerModel:loadData[i].triggerModel, controlMode:loadData[i].controlMode, cameraMode:loadData[i].cameraMode, + changeCamera:loadData[i].changeCamera, cameraPosition:loadData[i].cameraPosition, cameraTarget:loadData[i].cameraTarget, assetId:loadData[i].assetId, @@ -102,7 +109,7 @@ export function LessonData() { let inheirIndex = index - 1; let newLessonProgress = { id:generateUUID(), - progressName:"", + progressName:"命名", roleName:scope.lessonData.lessonProgress[inheirIndex].roleName, roleUse:scope.lessonData.lessonProgress[inheirIndex].roleUse, score:0, @@ -115,6 +122,7 @@ export function LessonData() { triggerModel:"", controlMode:scope.lessonData.lessonProgress[inheirIndex].controlMode, cameraMode:scope.lessonData.lessonProgress[inheirIndex].cameraMode, + changeCamera:scope.lessonData.lessonProgress[inheirIndex].changeCamera, cameraPosition:scope.lessonData.lessonProgress[inheirIndex].cameraPosition, cameraTarget:scope.lessonData.lessonProgress[inheirIndex].cameraTarget, assetId:scope.lessonData.lessonProgress.length, @@ -134,10 +142,9 @@ export function LessonData() { picurl:"url", text:"内容", }, - action:{ - actionType:"事件操作类型", - actionMode:"触发事件类型", - }, + action:[ + + ], jobPane:[], }; diff --git a/src/jlmap3d/lesson3dedit/toolsmodel/jobpanedata.js b/src/jlmap3d/lesson3dedit/toolsmodel/jobpanedata.js index ce9f5919d..e9452de06 100644 --- a/src/jlmap3d/lesson3dedit/toolsmodel/jobpanedata.js +++ b/src/jlmap3d/lesson3dedit/toolsmodel/jobpanedata.js @@ -6,6 +6,7 @@ export function JobPaneData() { this.dataList = [ { name:"值班站长", + value:"zbzz", text:"执行分公司、部、中心、车站的有关规章制度,加强班组管理,掌握列车运行情况,安排车站行车组织工作", picurl:"", controlList:[ @@ -28,6 +29,7 @@ export function JobPaneData() { }, { name:"行车值班员", + value:"xczby", text:"在本班组值班站长的指挥下开展工作,负责本班组车站综合控制室,负责车站行车工作,监视列车到、发情况及乘客上下车、候车动态,监控设备运作状况。", picurl:"", controlList:[ @@ -50,6 +52,7 @@ export function JobPaneData() { }, { name:"客运值班员", + value:"kyzby", text:"在值班站长的领导下,主管车站客运、票务管理,组织站务员从事客运服务工作", picurl:"", controlList:[ @@ -71,7 +74,8 @@ export function JobPaneData() { ], }, { - name:"票厅岗", + name:"票厅员", + value:"spy", text:"执行分公司、部、中心、车站的有关规章制度,在客运值班员领导下,负责车站售票工作。", picurl:"", controlList:[ @@ -94,6 +98,7 @@ export function JobPaneData() { }, { name:"站台岗", + value:"ztg", text:"", picurl:"", controlList:[ @@ -116,6 +121,7 @@ export function JobPaneData() { }, { name:"站长", + value:"zz", text:"在站务中心(副)主任领导下,组织领导站内员工开展车站各项工作。负责车站员工的日常管理,定期进行员工教育,掌握员工思想状况。", picurl:"", controlList:[ @@ -138,6 +144,7 @@ export function JobPaneData() { }, { name:"分部助理", + value:"fbzl", text:"", picurl:"", controlList:[ @@ -160,6 +167,7 @@ export function JobPaneData() { }, { name:"行车调度", + value:"xcdd", text:"", picurl:"", controlList:[ @@ -182,6 +190,7 @@ export function JobPaneData() { }, { name:"生产调度", + value:"scdd", text:"", picurl:"", controlList:[ @@ -203,7 +212,8 @@ export function JobPaneData() { ], }, { - name:"厅巡岗", + name:"平台岗", + value:"ptg", text:"负责站厅乘客服务,设备的巡视、紧急情况下事件的处理等。", picurl:"", controlList:[ @@ -226,6 +236,7 @@ export function JobPaneData() { }, { name:"地铁公安", + value:"110", text:"", picurl:"", controlList:[ @@ -248,6 +259,7 @@ export function JobPaneData() { }, { name:"120", + value:"120", text:"", picurl:"", controlList:[ @@ -270,6 +282,7 @@ export function JobPaneData() { }, { name:"119", + value:"119", text:"", picurl:"", controlList:[ diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index b48231fcd..94354546d 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -765,6 +765,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index a439fdc77..dbd3950f7 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -699,6 +699,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 4a0e58e8b..f715b1f5b 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -916,6 +916,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/datie_01.js b/src/jmapNew/config/skinCode/datie_01.js index daf8b317a..9707823b8 100644 --- a/src/jmapNew/config/skinCode/datie_01.js +++ b/src/jmapNew/config/skinCode/datie_01.js @@ -6,7 +6,7 @@ class SkinCode extends defaultStyle { super(); this.fontFamily = '宋体'; this[deviceType.Section] = { - elemnetType:['name', 'line', 'separator', 'badShunt'], + elemnetType:['name', 'line', 'separator', 'badShunt', 'derailer'], // 'speedLimit', 'speedLimitName','standTrackText','reentryTrackText','transferTrackText', active: { routeColor: true // 进路触发颜色 @@ -143,11 +143,23 @@ class SkinCode extends defaultStyle { invadeSpecial:true, // 特殊侵限 halfHeight: 3 // 区段分隔符高度的一半 }, - shuttleBack: { // 折返进路 (存在此对象 显示折返箭头) + shuttleBack: { // 折返进路 (存在此对象 显示折返箭头) z: 10, width: 1.5, color: '#FFFFFF', - distance: 5 // 限速线距离区段距离 + distance: 5 // 限速线距离区段距离 + }, + derailer: { + text: { + color: 'green', + offset: { + x: -5, + y: -15 + } + }, + symbol: { + color: 'red' + } }, trainPosition:{ display: false // 列车实时位置显示 @@ -156,6 +168,7 @@ class SkinCode extends defaultStyle { this[deviceType.Signal] = { distance: 10, // 设备距离区段的距离 + colorSpecial: true, // 特殊处理灯位颜色 post: { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 @@ -170,16 +183,25 @@ class SkinCode extends defaultStyle { fontSize: 11, // 信号机名称字体大小 fontWeight: 'bold', // 信号机名称字体粗细 defaultColor: '#FFFFFF', // 信号灯字体默认色 - blockColor: '#EF0C08', // 信号灯字体锁定颜色 + blockColor: '#FFFFFF', // 信号灯字体锁定颜色 checkColor: '#00FF00' // 信号保护区段检查颜色 }, + remainTimeColor: '#F00', + tText: { + offsetX: 0, + offsetY: -30, + fontSize: 11, // 信号机名称字体大小 + fontWeight: 'bold', // 信号机名称字体粗细 + defaultColor: '#F00', // 信号灯字体默认色 + defaultText: 0 + }, lamp: { bgShow: false, // 是否被选中 guidName: 'singleRY', // 成都三号线引导类型 - borderVariable: true, // 信号灯边框可变 + borderVariable: false, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 borderWidth: 2, // 信号灯边框线宽度 - borderColor: '#3149C3', // 信号灯边框线颜色 + borderColor: '#677DBB', // 信号灯边框线颜色 radiusR: 6, // 信号灯半径 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 @@ -187,7 +209,8 @@ class SkinCode extends defaultStyle { yellowColor: '#FFFF00', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 blueColor: '#0070C0', // 信号灯蓝色 - faultType: 'light' // 信号机故障类型 (light闪) + faultType: 'light', // 信号机故障类型 (light闪) + special:true // 大铁类型信号机 }, route: { direction: true, // 自动通过方向 @@ -258,71 +281,19 @@ class SkinCode extends defaultStyle { }; this[deviceType.StationStand] = { - // 成都三号线站台元素 站台 站台紧急关闭 扣车元素 停站时间 运行等级 跳停 - elemnetType:['solidStand', 'emergentRhombus', 'detainNormal', 'stopTime', 'level', 'jumpCircle'], + // 站台元素 站台 + elemnetType:['lineStand'], // 站台 - solidStand:{ + lineStand:{ // 层级 z:0, - spareColor: '#ffffff', // 站台空闲颜色 - jumpStopColor: '#808080', // 站台跳停颜色 - designatedJumpStopColor: '#808080', // 站台指定列车跳停颜色 - headFontSize: 10, // 站台首端字体大小 - stopColor: '#FFF000' // 站台列车停站颜色 + spareColor: '#00ff00', // 站台空闲颜色 + lineWidth:2 // 线宽 + // jumpStopColor: '#808080', // 站台跳停颜色 + // designatedJumpStopColor: '#808080', // 站台指定列车跳停颜色 + // headFontSize: 10, // 站台首端字体大小 + // stopColor: '#FFF000' // 站台列车停站颜色 }, - // 站台紧急关闭 - emergentRhombus:{ - z:1, - flicker: true, // 闪烁 - mergentR: 5, // 站台紧急关闭半径 - mergentN: 4, // 站台紧急关闭边数 - insideOffset: { x: 0, y: -30 }, // 内站台紧急关闭偏移量 - outsideOffset: { x: 0, y: 30}, // 外站台紧急关闭偏移量 - closeColor: '#F61107' // 站台紧急关闭颜色 - }, - // 扣车元素 普通扣车 - detainNormal:{ - z:0, - position: -1, // 扣车标识在站台上显示方向 - text: '扣', // 扣车显示内容 - insideOffset: {x: -8, y: 20}, // 内站台扣车偏移量 - outsideOffset: {x: -8, y: 20}, // 外站台扣车偏移量 - centerTrainColor: '#C0C0C0', // 中心扣车颜色 - andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色 - detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色 - fontSize: 10, // 字体大小 - fontWeight: 'normal' - }, - // 停站时间 - stopTime:{ - z:1, - textFontSize: 10, // 停站时间字体大小 - textColor: '#FFFFFF', // 停站时间字体颜色 - position: -1, // 停站时间方向 - offset: {x: -8, y: 10} // 停站时间偏移量 - }, - // 运行等级 - level:{ - z:1, - textFontSize: 10, // 运行等级字体大小 - position: 1, // 运行等级方向 - offset: {x: -8, y: 15}, // 运行等级偏移量 - textColor: '#FFF000' // 停站等级字体颜色 - }, - // 跳停 - jumpCircle: { - z:1, - position: 1, // 停跳方向 - text: '跳', // 停跳显示内容 - offset: {x: -8, y: 10}, - textColor: '#00ffcc', // 停跳文字颜色 - arcColor: '#00ffcc', // 停跳圆圈颜色 - fillColor: 'rgba(0,0,0,0)', // 透明填充颜色 - r: 8, // 圆半径大小 - fontWeight: 'normal', // 文字居中 - fontSize: 11 // 文字大小 - }, - common: { // 通用属性 textFontSize: 10, // 站台默认字体大小 functionButtonShow: '03' // 功能灯按钮显示条件(prdType) @@ -479,36 +450,36 @@ class SkinCode extends defaultStyle { }, core: { length: 6, // 道岔单边长度 - graphShow: true, // 图形显示 - graphInversionColor: '#FFFF00', // 反位颜色 - graphLocalColor: '#00FF00' // 定位颜色 + graphShow: true, // 图形显示 + graphInversionColor: '#FFFF00', // 反位颜色 + graphLocalColor: '#00FF00' // 定位颜色 }, jointImg: { // 道岔 A B C D四元素属性配置 - trapezoidLength: 8, // 直角梯形元素默认长度 - faultStatus: true, // 挤岔表示 + trapezoidLength: 8, // 直角梯形元素默认长度 + faultStatus: true, // 挤岔表示 fork: true, // 挤岔专用(如有挤岔操作 变为true) forKColor: 'red' // 挤岔颜色 配合挤岔专用 }, - arcBlcok: { // 圆形封锁图形 - show: false, // 显示 - arcBorderColor: 'green', // 默认边框颜色 - locationColor: 'green', // 定位封锁颜色 - inversionColor: '#FFFF00' // 反位封锁颜色 - }, + // arcBlcok: { // 圆形封锁图形 + // show: false, // 显示 + // arcBorderColor: 'green', // 默认边框颜色 + // locationColor: 'green', // 定位封锁颜色 + // inversionColor: '#FFFF00' // 反位封锁颜色 + // }, rectLock: { // 矩形封锁框图形 rectWidth: 18, // 矩形框 宽高 rectBorderColor: '#fff', // 矩形边框颜色 block: true, // 封锁显示 blockColor: 'red', // 封锁颜色 - followName: true, // 位置跟随名称确定 + followName: true // 位置跟随名称确定 }, - arcBlcok: { // 圆形封锁图形 + arcBlcok: { // 圆形封锁图形 show: true, // 显示 shapeR: 10, arcBorderColor: 'red', // 默认边框颜色 locationColor: 'red', // 定位封锁颜色 inversionColor: 'red' // 反位封锁颜色 - }, + } }; this[deviceType.LcControl] = { @@ -942,6 +913,19 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = { + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + indicator:{ + radiusR:6, + offset:{ x:0, y:20}, + color:'red' + }, + text:{ + fontWeight:'normal', + fontSize:12, + fontFamily:'宋体' + } + }; } } diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 769efeaf3..4a0d18837 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -726,6 +726,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index d2eadb400..571539220 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -733,6 +733,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index e9de33339..e7f2e7990 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -829,6 +829,7 @@ class SkinCode extends defaultStyle { fontOffsetX: 45, fontOffsetY: 24 }; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index 4c9f5ab90..92a273335 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -933,6 +933,7 @@ class SkinCode extends defaultStyle { // textFill: '#fff' // } // }; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index ee53df454..bf6046322 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -858,6 +858,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index 6af36bbd8..da0e069f0 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -190,7 +190,7 @@ class SkinCode extends defaultStyle { guidName: 'half', // 默认引导类型 borderVariable: false, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 - borderWidth: 2, // 信号灯边框线宽度 + borderWidth: 1, // 信号灯边框线宽度 borderColor: '#000000', // 信号灯边框线颜色 physicColor:'#ffffff', // 物理点灯信号灯边框线颜色 radiusR: 5, // 信号灯半径 @@ -200,7 +200,9 @@ class SkinCode extends defaultStyle { yellowColor: 'yellow', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 blueColor: '#0070C0', // 信号灯蓝色 - faultType: 'cross' // 信号机故障类型 (cross叉形狀) + faultType: 'cross', // 信号机故障类型 (cross叉形狀) + guideSector: true, // 引导扇形 + guideSectorColor: '#FFFF00' // 引导扇形颜色 }, route: { direction: false, // 自动通过方向 @@ -879,6 +881,7 @@ class SkinCode extends defaultStyle { allowCLoseStrokeColor: '#FFFF00' // 允许关门描边颜色 }; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index 034037688..aa4da8d91 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -529,8 +529,8 @@ class SkinCode extends defaultStyle { core: { length: 6, // 道岔单边长度 graphShow: true, // 图形显示 - graphInversionColor: '#FFFF00', // 反位颜色 - graphLocalColor: '#00FF00' // 定位颜色 + graphInversionColor: '#FFFF00', // 反位颜色 + graphLocalColor: '#00FF00' // 定位颜色 }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 @@ -662,13 +662,14 @@ class SkinCode extends defaultStyle { changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 specialTrainType: [ { - type: '03', + type: 'MANUAL', serviceNumber: 'M0', nameFormat: 'serviceNumber:groupNumber' }, { - type: '02', - nameFormat: 'targetCode:groupNumber' + type: 'HEAD', + serviceNumber: 'M0', + nameFormat: 'serviceNumber:targetCode' } ], // 特殊列车类型需设置显示格式 lrPadding: 4, // 两边间隔 @@ -697,8 +698,8 @@ class SkinCode extends defaultStyle { textAContent: 'A'// textA文本 }, trainNumber: { - targetCodePrefix: '000', // 目的地码前缀 - trainNumberOffset: { x: 0, y: 1 }// 目的地码偏移量 + targetCodePrefix: '00', // 目的地码前缀 + trainNumberOffset: { x: 0, y: 4 }// 目的地码偏移量 }, trainServer: { serviceNumberPrefix: '00', // 服务号(表号)前缀 @@ -803,6 +804,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 710d19d85..e79502458 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -792,6 +792,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 160f05814..a32dfb12b 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -849,6 +849,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.FloodGate] = {}; this[deviceType.DirectionRod] = {}; + this[deviceType.IndicatorLight] = {}; } } diff --git a/src/jmapNew/constant/deviceRender.js b/src/jmapNew/constant/deviceRender.js index 3769d1c60..03ef547cb 100644 --- a/src/jmapNew/constant/deviceRender.js +++ b/src/jmapNew/constant/deviceRender.js @@ -280,4 +280,9 @@ deviceRender[deviceType.SignalButton] = { _type: deviceType.SignalButton, zlevel: 1 }; +/** 指示灯 */ +deviceRender[deviceType.IndicatorLight] = { + _type: deviceType.IndicatorLight, + zlevel: 1 +} export default deviceRender; diff --git a/src/jmapNew/constant/deviceState.js b/src/jmapNew/constant/deviceState.js index 15d1d5f96..750b9736c 100644 --- a/src/jmapNew/constant/deviceState.js +++ b/src/jmapNew/constant/deviceState.js @@ -260,4 +260,6 @@ deviceState[deviceType.Train] = { }; deviceState[deviceType.Responder] = { }; +deviceState[deviceType.IndicatorLight] = { +} export default deviceState; diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js index 87929a7a5..3e8f5f2a4 100644 --- a/src/jmapNew/constant/deviceType.js +++ b/src/jmapNew/constant/deviceType.js @@ -42,6 +42,7 @@ const deviceType = { Axle: 'Axle', SplitStation:'SplitStation', SwitchFault: 'SwitchFault', + IndicatorLight: 'IndicatorLight', Arrow: 'Arrow', Power: 'Power', StationTurnBack: 'StationTurnBack', diff --git a/src/jmapNew/shape/SaidLamp/EIndicatorLight.js b/src/jmapNew/shape/SaidLamp/EIndicatorLight.js new file mode 100644 index 000000000..a5ba63843 --- /dev/null +++ b/src/jmapNew/shape/SaidLamp/EIndicatorLight.js @@ -0,0 +1,83 @@ +/* +* 表示灯 +*/ +import Group from 'zrender/src/container/Group'; +import Circle from 'zrender/src/graphic/shape/Circle'; +import Text from 'zrender/src/graphic/Text'; + +export default class IndicatorLight extends Group { + constructor(model) { + super(); + this.model = model; + this.zlevel = model.zlevel; + this.z = model.z; + this._subType = model._subType; + this.create(); + } + + create() { + this.createLight(); + this.createText(); + } + + createLight() { + const model = this.model; + const style = this.model.style; + const indicatorStyle = style.IndicatorLight.indicator || {}; + const radiusR = indicatorStyle.radiusR || 12; + const offsetStyle = indicatorStyle.offset || {}; + const offsetX = offsetStyle.x || 0; + const offsetY = offsetStyle.y || 0; + const textColor = indicatorStyle.color || 'red'; + + this.indicator = new Circle({ + zlevel: this.zlevel, + z: this.z, + shape: { + cx: model.x + offsetX, + cy: model.y + offsetY, + r: radiusR + }, + style: { + lineWidth: 1, + stroke: '#fff', + fill: textColor + } + }); + this.add(this.indicator); + } + + createText() { + const model = this.model; + const style = this.model.style; + const textStyle = style.IndicatorLight.text || {}; + // const offsetStyle = textStyle.offset || {}; + // const offsetX = offsetStyle.x || 0; + // const offsetY = offsetStyle.y || 0; + const fontWeight = textStyle.fontWeight || style.textStyle.fontWeight; + const fontSize = textStyle.fontSize || style.textStyle.fontSize; + const fontFamily = textStyle.fontFamily || style.textStyle.fontFamily; + + this.text = new Text({ + zlevel: this.zlevel, + z: this.z, + // position: [0, 0], + style: { + x: model.x, + y: model.y, + fontWeight: fontWeight, + fontSize: fontSize, + fontFamily: fontFamily, + text: model.text, + textFill: '#fff', + textAlign: 'middle', + textVerticalAlign: 'top' + } + }); + this.add(this.text); + } + + setControlColor(color) { + this.indicator.setStyle({fill: color}); + } +} diff --git a/src/jmapNew/shape/SaidLamp/index.js b/src/jmapNew/shape/SaidLamp/index.js index 24dea1034..78fae230e 100644 --- a/src/jmapNew/shape/SaidLamp/index.js +++ b/src/jmapNew/shape/SaidLamp/index.js @@ -9,6 +9,7 @@ import EDeviceStatus from './EDeviceStatus'; import EModeStatus from './EModeStatus'; import EUnmanned from './EUnmanned'; import EAxle from './EAxle'; +import EIndicatorLight from './EIndicatorLight'; export default class SaidLamp extends Group { constructor(model, {style}) { @@ -165,6 +166,17 @@ export default class SaidLamp extends Group { }); this.add(this.control); } + } else if (this._type === 'IndicatorLight') { + this.control = new EIndicatorLight({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + text: model.name, + style: this.style, + _subType: 'IndicatorLight' + }); + this.add(this.control); } } diff --git a/src/jmapNew/shape/Section/EDerailer.js b/src/jmapNew/shape/Section/EDerailer.js new file mode 100644 index 000000000..28e06880c --- /dev/null +++ b/src/jmapNew/shape/Section/EDerailer.js @@ -0,0 +1,85 @@ +import Group from "zrender/src/container/Group"; +import Text from "zrender/src/graphic/Text"; +import Polygon from "zrender/src/graphic/shape/Polygon"; + +class EDerailer extends Group { + constructor(model) { + super(); + this.zlevel = model.zlevel; + this.z = model.z; + this.style = model.style; + this.model = model; + this.create(); + } + + create() { + this.createText(); + this.createSymbol(); + } + + createText() { + const style = this.model.style; + const model = this.model.modelData; + const length = model.points.length; + const offset = style.Section.derailer.text.offset||{}; + const offsetX = offset.x||0; + const offsetY = offset.y||0; + const positionX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX; + const positionY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY; + + this.text = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: positionX, + y: positionY, + text: 'T', + fontWeight: style.fontWeight, + fontSize: style.fontSize, + fontFamily: style.fontFamily, + textFill: style.Section.derailer.text.color, + textPosition: 'inside', + textAlign: 'center', + textVerticalAlign: 'center' + } + }) + this.add(this.text); + } + + createSymbol() { + const style = this.model.style; + const model = this.model.modelData; + const length = model.points.length; + const offset = style.Section.derailer.symbol.offset||{}; + const offsetX = offset.x||0; + const offsetY = offset.y||0; + const pointX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX; + const pointY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY; + + this.symbol = new Polygon({ + zlevel: this.zlevel, + z: this.z, + shape: { + points: [ + [pointX-3, pointY], + [pointX, pointY-8], + [pointX+3, pointY] + ] + }, + style: { + fill: style.Section.derailer.symbol.color, + } + }) + this.add(this.symbol); + } + + setTextStyle(style) { + this.text && this.text.setStyle(style); + } + + setSymbolStyle(style) { + this.symbol && this.symbol.setStyle(style); + } +} + +export default EDerailer; diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index b65457a35..dea35f8c7 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -6,6 +6,7 @@ import EblockLines from './EblockLines'; // 区段封锁特有 import ESeparator from './ESeparator'; // 分隔符 (私有) import EMouse from './EMouse'; import EAxle from './EAxle'; // 创建计轴 +import EDerailer from './EDerailer'; //脱轨器 // import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头 import EBackArrowGroup from './EBackArrow'; // 折返进路箭头 import ELimitName from './ELimitName'; // 成都三号线 限速名称 @@ -15,6 +16,40 @@ import EStopRouteImg from './EStopRouteImg'; import EBadShunt from './EBadShunt'; import store from '@/store/index'; +const exec = (f,...args) => { f && f(...args); }; +const DerailerMap = { + 0: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'green'}); + derailer.setSymbolStyle({fill: 'red'}); + }, + 1: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'yellow'}); + derailer.setSymbolStyle({fill: 'red'}); + }, + 2: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'green'}); + derailer.setSymbolStyle({fill: 'green'}); + }, + 3: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'yellow'}); + derailer.setSymbolStyle({fill: 'green'}); + }, + 4: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'red'}); + derailer.setSymbolStyle({fill: 'red'}); + }, + 5: (derailer, style) => { + derailer.show(); + derailer.setTextStyle({textFill: 'red'}); + derailer.setSymbolStyle({fill: 'gray'}); + } +} + /** 区段*/ export default class Section extends Group { constructor(model, {style, mapDevice}) { @@ -63,7 +98,8 @@ export default class Section extends Group { 'speedLimit': ELimitLines, // 限速线 'speedLimitName': ELimitName, // 限速线名称 'shuttleBack': EBackArrowGroup, // 折返箭头 (成都三号线显示) - 'badShunt':EBadShunt // 大铁项目 分路不良 + 'badShunt':EBadShunt, // 大铁项目 分路不良 + 'derailer': EDerailer }; // 遍历当前线路下的绘图元素 const model = this.model; @@ -105,6 +141,7 @@ export default class Section extends Group { // this.line.setRunLineDefault(); } this.name && this.name.recover(); + this.derailer && this.derailer.hide(); this.speedLimit && this.speedLimit.hide(); this.speedLimitName && this.speedLimitName.hide(); this.badShunt && this.badShunt.hide(); @@ -428,6 +465,9 @@ export default class Section extends Group { model.faultLock && this.faultLock(); // 设置灰显 model.noStatus && this.setAshShow(); + // 设置脱轨器 + model.signalDerailer && exec(DerailerMap[model.signalDerailer], this.derailer, this.style); + /** 道岔区段更新岔心颜色 */ if (model.type === '03' && model.switch) { const sectionSwitch = this.mapDevice[model.switch.code]; diff --git a/src/jmapNew/shape/Signal/ESigLamp.js b/src/jmapNew/shape/Signal/ESigLamp.js index 4d763a54e..5c060ad5d 100644 --- a/src/jmapNew/shape/Signal/ESigLamp.js +++ b/src/jmapNew/shape/Signal/ESigLamp.js @@ -1,5 +1,6 @@ import Line from 'zrender/src/graphic/shape/Line'; import Arc from 'zrender/src/graphic/shape/Arc'; +import Sector from 'zrender/src/graphic/shape/Sector'; import Group from 'zrender/src/container/Group'; // import Path from 'zrender/src/graphic/Path'; import {ESigFault} from './ESigFault'; @@ -32,7 +33,27 @@ class ESigLamp extends Group { stroke: style.Signal.lamp.borderColor } }); - + if (style.Signal.lamp.guideSector) { + this.lampSector = new Sector({ + _subType: 'SignalLamp', + _val: '3', + name: model.index, + zlevel: model.zlevel, + z: model.z + 1, + shape: { + cx: model.x, + cy: model.y, + r: style.Signal.lamp.radiusR, + startAngle: Math.PI * 3 / 2, + endAngle: Math.PI / 2 + }, + style: { + fill: style.Signal.lamp.guideSectorColor + } + }); + this.add(this.lampSector); + this.lampSector.hide(); + } if (style.Signal.lamp.faultType && style.Signal.lamp.faultType == 'flash') { this.lampFault = new ESigFault({ zlevel: model.zlevel, @@ -144,7 +165,13 @@ class ESigLamp extends Group { faultHide() { this.lampFault && this.lampFault.hide(); } - + setGuideSectorShowHide(flag) { + if (flag) { + this.lampSector && this.lampSector.show(); + } else { + this.lampSector && this.lampSector.hide(); + } + } setColor(color) { if (this.model.style.Signal.lamp.borderVariable) { this.lamp.setStyle({ fill: color, stroke: color }); diff --git a/src/jmapNew/shape/Signal/ESigName.js b/src/jmapNew/shape/Signal/ESigName.js index 55c9feccf..b8025bd18 100644 --- a/src/jmapNew/shape/Signal/ESigName.js +++ b/src/jmapNew/shape/Signal/ESigName.js @@ -44,13 +44,23 @@ class ESigName extends Group { getNameText() { return this.name; } - hide() { this.name.hide(); } show() { this.name.show(); } + setAnimationStart(color) { + this.name && this.name.animateStyle(true) + .when(0, { textFill: this.model.style.backgroundColor }) + .when(1000, { textFill: color }) + .when(2000, { textFill: this.model.style.backgroundColor }) + .when(3000, { textFill: color }) + .start(); + } + setAnimationEnd() { + this.name && this.name.stopAnimation(false); + } } export default ESigName; diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 1dd4f0eda..6ac1c30b2 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -18,16 +18,179 @@ import Text from 'zrender/src/graphic/Text'; import Isogon from 'zrender/src/graphic/shape/Isogon'; import deviceType from '../../constant/deviceType'; import { findDeviceByModelDepType } from '../utils/ShapeDepFind'; +import store from '@/store/index'; // import BoundingRect from 'zrender/src/core/BoundingRect'; // import background from './../../../ibp/shape/background'; +const exec = (f, ...args) => { f && f(...args); }; +const SignalAspectMap = { + // 1-红 + 1: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.redColor); + }, + 2: () => { + lamps[0].setColor(style.Signal.lamp.redColor); + lamps[1].setColor(style.backgroundColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 2-绿 + 2: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.greenColor); + }, + 2: () => { + lamps[0].setColor(style.backgroundColor); + lamps[1].setColor(style.Signal.lamp.greenColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 3-黄; + 3: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.yellowColor); + }, + 2: () => { + lamps[0].setColor(style.Signal.lamp.yellowColor); + lamps[1].setColor(style.backgroundColor); + }, + 3: (lamps, style) => {} + }; + exec(lampsMap[lamps.length]); + }, + // 4-黄红; + 4: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.yellowColor); + lamps[1].setColor(style.Signal.lamp.redColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 5-绿绿; + 5: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.greenColor); + lamps[1].setColor(style.Signal.lamp.greenColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 6-绿黄; + 6: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.greenColor); + lamps[1].setColor(style.Signal.lamp.yellowColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 7-黄黄; + 7: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.yellowColor); + lamps[1].setColor(style.Signal.lamp.yellowColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 8-黄闪黄; + 8: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.yellowColor); + lamps[1].setAnimationStart(style.Signal.lamp.yellowColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 9-白红; + 9: (lamps, style) => { + const lampsMap = { + 1: () => {}, + 2: () => { + lamps[0].setColor(style.Signal.lamp.whiteColor); + lamps[1].setColor(style.Signal.lamp.redColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 10-蓝; + 10: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.blueColor); + }, + 2: () => { + lamps[0].setColor(style.backgroundColor); + lamps[1].setColor(style.Signal.lamp.blueColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 11-白; + 11: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.whiteColor); + }, + 2: () => { + lamps[0].setColor(style.Signal.lamp.whiteColor); + lamps[1].setColor(style.backgroundColor); + }, + 3: () => {} + }; + exec(lampsMap[lamps.length]); + }, + // 12 红闪 + 12: (lamps, style) => { + const lampsMap = { + 1: () => { + lamps[0].setColor(style.Signal.lamp.redColor); + lamps[0].setAnimationStart(style.Signal.lamp.redColor); + }, + 2: () => { + lamps[0].setColor(style.Signal.lamp.redColor); + lamps[0].setAnimationStart(style.Signal.lamp.redColor); + lamps[1].setColor(style.backgroundColor); + }, + 3: () =>{} + }; + exec(lampsMap[lamps.length]); + } +}; + class Signal extends Group { constructor(model, {style, mapDevice}) { super(); this._code = model.code; this._type = model._type; this.model = model; - this.mapDevice = mapDevice; + this.mapDevice = mapDevice; this.style = style; this.count = parseInt(model.lampPositionType); this.lamps = new Array(this.count); @@ -116,8 +279,8 @@ class Signal extends Group { z: this.z, _val: '3', style: { - x: endPoint.x, - y: endPoint.y, + x: endPoint.x + (style.Signal.tText.offsetX || 0), + y: endPoint.y + (style.Signal.tText.offsetY || 0), fontWeight: style.Signal.tText.fontWeight, fontSize: style.Signal.tText.fontSize, fontFamily: style.fontFamily, @@ -213,7 +376,7 @@ class Signal extends Group { fontWeight: style.Signal.text.fontWeight, fontSize: 12, fontFamily: style.fontFamily, - textFill: '#FFF', + textFill: style.Signal.remainTimeColor || '#FFF', textAlign: 'center', textVerticalAlign: 'middle' }); @@ -322,12 +485,12 @@ class Signal extends Group { const drict = this.model.right ? 1 : -1; // 朝向 左:右 const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 // 信号机名称 - const actual = this.mapDevice[model.linkSignalCode]; + const actual = this.mapDevice[model.linkSignalCode]; const sigNameX = model.position.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x; const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.right ? 'left' : 'right'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; - const fillColor = actual.virtual? style.Signal.transmission.fillColorVirtual: style.Signal.transmission.fillColor; + const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor; this.sigName = new ESigName({ zlevel: this.zlevel, z: this.z, @@ -508,15 +671,18 @@ class Signal extends Group { this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 }); } else if (this.style.Signal.lamp.guidName === 'post') { this.sigPost.setHorColor(this.style.Signal.post.guideHorColor); + } else if (this.style.Signal.lamp.guidName === 'half') { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + this.lamps[0] && this.lamps[0].setGuideSectorShowHide(true); } if (this.style.Signal.lamp.guidName !== 'singleRY') { - if (this.lamps.length == 1) { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); - } else { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); - this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); - } + if (this.lamps.length == 1) { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + } else { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); + } } } @@ -533,7 +699,7 @@ class Signal extends Group { if (this.style.Signal.text.nameBorderShow) { this.sigName.setStyle({ textBorderWidth: 1 }); } - if (this.sigBack) { + if (this.sigBack && (!this.model.signalButtonList || !this.model.signalButtonList.length)) { this.sigBack.show(); this.sigBack.setStyle('fill', this.style.Signal.sigBack.fillColor); } @@ -541,6 +707,12 @@ class Signal extends Group { this.lamps[0].setBorderColor(this.style.Signal.lamp.borderColor); this.lamps[0].setAnimationStart(this.style.Signal.lamp.blockColor); } + if (this.model.signalButtonList && this.model.signalButtonList.length) { + this.model.signalButtonList.forEach(item => { + const button = store.getters['map/getDeviceByCode'](item); + button && button.instance && button.instance.blockShow(); + }); + } } reblock() { this.sigPost.setHorColor(this.style.Signal.post.reblockHorColor); @@ -695,7 +867,8 @@ class Signal extends Group { } // 恢复状态 recover() { - this.lamps && this.lamps.forEach(item=> { item.show(); }); + this.sigName && this.sigName.setAnimationEnd(); + this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); }); this.sigName.setStyle({ textBorderWidth: 0 }); this.sigName.setColor(this.style.Signal.text.defaultColor); this.remainTImeName && this.remainTImeName.hide(); @@ -734,9 +907,16 @@ class Signal extends Group { this.ciConfirm && this.ciConfirm.stopAnimation(false); this.ciConfirm && this.ciConfirm.hide(); this.sigBack && this.sigBack.hide(); + this.tText && this.tText.hide(); this.sigBack && this.sigBack.stopAnimation(false); this.lamps && this.lamps[0] && this.lamps[0].setAnimationEnd(); this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor); + if (this.model.signalButtonList && this.model.signalButtonList.length) { + this.model.signalButtonList.forEach(item => { + const button = store.getters['map/getDeviceByCode'](item); + button && button.instance && button.instance.recover(); + }); + } } setState(model) { @@ -764,7 +944,6 @@ class Signal extends Group { model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 - /** 信号机封锁 */ // 缺一个功能封锁 model.blockade && this.block(); model.reblockade && this.reblock(); @@ -825,8 +1004,22 @@ class Signal extends Group { } else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) { this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor); } + + if (this.style.Signal.lamp.special) { + // 灯颜色状态显示 + exec(SignalAspectMap[model.signalAspect], this.lamps, this.style); + // 灯是否点灯显示 + this.lamps.forEach(lamp => { lamp.setStop(model.signalLight); }); + } + if (model.hasSelected) { + this.sigName && this.sigName.setAnimationStart(this.style.Signal.text.defaultColor); + } // 信号机故障 model.fault && this.fault(); + if (model.guideTime) { + this.tText && this.tText.setStyle('text', model.guideTime); + this.tText && this.tText.show(); + } // 设置灰显 if (model.noStatus || model.level === 0) { this.setAshShow(); @@ -859,8 +1052,8 @@ class Signal extends Group { default: var drict = this.model.right ? 1 : -1; // 朝向 右:左 var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下 - var shape = this.model.type == 'TRANSMISSION'? this.transmission: this.sigPost; - rect = shape.getBoundingRect().clone(); + var shape = this.model.type == 'TRANSMISSION' ? this.transmission : this.sigPost; + rect = shape.getBoundingRect().clone(); rect.x = rect.x + drict * this.style.Signal.post.standardVerticalWidth; rect.y = rect.y - offsetY; break; diff --git a/src/jmapNew/shape/SignalButton/index.js b/src/jmapNew/shape/SignalButton/index.js index 52d3afb48..e1d8d15e1 100644 --- a/src/jmapNew/shape/SignalButton/index.js +++ b/src/jmapNew/shape/SignalButton/index.js @@ -20,16 +20,10 @@ export default class SignalButton extends Group { create() { const model = this.model; - let fillColor = '#008000'; - if (model.type === 'GUIDE') { - fillColor = '#5050E1'; - } else if (model.type === 'FLEXIBLE' || model.type === 'SHUNT_TERMINAL') { - fillColor = '#808080'; - } + const fillColor = this.getTypeColor(); this.rectButton = new Rect({ zlevel: this.zlevel, z: this.z, - silent: true, shape: { x: model.position.x, y: model.position.y, @@ -38,18 +32,20 @@ export default class SignalButton extends Group { }, style: { lineDash: null, - stroke: '#808080', + stroke: '#69666E', + lineWidth:1, fill: fillColor } }); + this.add(this.rectButton); this.leftLine = new Line({ zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x, - y1: model.position.y, - x2: model.position.x + 14, - y2: model.position.y + 14 + x1: model.position.x + 1, + y1: model.position.y + 1, + x2: model.position.x + 13, + y2: model.position.y + 13 }, style: { lineWidth: 2, @@ -62,10 +58,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x + 14, - y1: model.position.y, - x2: model.position.x, - y2: model.position.y + 14 + x1: model.position.x + 13, + y1: model.position.y + 1, + x2: model.position.x + 1, + y2: model.position.y + 13 }, style: { lineWidth: 2, @@ -74,42 +70,62 @@ export default class SignalButton extends Group { }); this.add(this.rightLine); this.rightLine.hide(); - this.buttonText = new Text({ - zlevel: this.zlevel, - z: this.z, - style: { - x: model.position.x + 7, - y: model.position.y - 20, - fontWeight: '400', - fontSize: 12, - fontFamily: '', - text: model.name, - textFill: '#C0C0C0', - textAlign: 'middle', - textVerticalAlign: 'top' - } - }); - this.add(this.rectButton); - this.add(this.buttonText); + if (model.type === 'PASS') { + this.buttonText = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: model.position.x + model.nameOffset.x, + y: model.position.y + model.nameOffset.y, + fontWeight: '400', + fontSize: 10, + fontFamily: '', + text: model.name, + textFill: '#C0C0C0', + textAlign: 'middle', + textVerticalAlign: 'top' + } + }); + this.add(this.buttonText); + } } startAnimate() { - let color = '#008000'; - if (this.model.type === 'TRAIN_TERMINAL') { - color = '#008000'; - } else if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') { - color = '#808080'; - } this.rectButton && this.rectButton.animateStyle(true) .when(0, { fill: '#000' }) - .when(1000, { fill: color }) + .when(1000, { fill: this.getTypeColor() }) .when(2000, { fill: '#000' }) .start(); } stopAnimation() { this.rectButton && this.rectButton.stopAnimation(true); } + getTypeColor() { + let color = ''; + if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') { + color = '#808080'; + } else if (this.model.type === 'GUIDE') { + color = '#5050E1'; + } else { + color = '#008000'; + } + return color; + } + recover() { + this.stopAnimation(); + this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() }); + this.rightLine && this.rightLine.hide(); + this.leftLine && this.leftLine.hide(); + } + blockShow() { + this.rightLine && this.rightLine.show(); + this.leftLine && this.leftLine.show(); + } setState(model) { + this.recover(); if (!this.isShowShape) return; + if (model.hasSelected) { + this.startAnimate(); + } } // 设置显示模式 setShowMode() { diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index c037e110c..cdcf8516d 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -3,6 +3,7 @@ import Group from 'zrender/src/container/Group'; import ESolidStand from './safeStand/ESolidStand'; import EHollowStand from './safeStand/EHollowStand'; import EGapStand from './safeStand/EGapStand'; +import ELineStand from './safeStand/ELineStand'; // 扣车元素 import EDetain from './detain/EDetain'; import EDetainHollow from './detain/EDetainHollow'; @@ -65,6 +66,7 @@ class StationStand extends Group { 'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式) 'hollowStand':EHollowStand, // 矩形空心站台 (西安二号线站台样式) 'gapStand':EGapStand, // 分割站台(哈尔滨站台特有) + 'lineStand':ELineStand, // 大铁折线站台 'emergentCross':EEmergentCross, // 站台紧急关闭 西安二号线 正八边形 'emergentArrow':EEmergentArrow, // 站台紧急关闭 哈尔滨 箭头型 diff --git a/src/jmapNew/shape/StationStand/safeStand/ELineStand.js b/src/jmapNew/shape/StationStand/safeStand/ELineStand.js new file mode 100644 index 000000000..30c5f7435 --- /dev/null +++ b/src/jmapNew/shape/StationStand/safeStand/ELineStand.js @@ -0,0 +1,70 @@ +import Group from 'zrender/src/container/Group'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; +// import Rect from 'zrender/src/graphic/shape/Rect'; +// import Text from 'zrender/src/graphic/Text'; + +class ESolidStand extends Group { + constructor(model) { + super(); + this.model = model; + this.create(); + } + + create() { + const model = this.model.modelData; + const style = this.model.style; + const standX = model.position.x - model.width / 2; + const standY = model.position.y - model.height / 2; + const direction = model.right ? 1 : -1; + + this.stand = new Polyline({ + zlevel: this.model.zlevel, + z: this.model.z + 2, + shape: { + points:[ + [standX, standY + direction * model.height], + [standX, standY], + [standX + model.width, standY], + [standX + model.width, standY + direction * model.height] + ] + }, + style: { + stroke:style.StationStand.lineStand.spareColor, + lineWidth: style.StationStand.lineStand.lineWidth + } + }); + this.add(this.stand); + + // if (style.StationStand.solidStand.stationHoldTrainColor) { + // const direction = model.right ? 1 : -1; + // this.holdTrain = new Rect({ + // zlevel: this.model.zlevel, + // z: this.model.z + 2, + // shape: { + // x: standX, + // y: standY + (1 - direction) / 2 * model.height / 2, + // width: model.width, + // height: model.height / 2 + // }, + // style: { + // fill:style.StationStand.solidStand.spareColor, + // lineWidth: 0 + // } + // }); + // this.add(this.holdTrain); + // this.holdTrain.hide(); + // } + } + setStroke(color) { + this.stand.setStyle('stroke', color); + } + recover() { + // const style = this.model.style; + } + + setState(model) { + } + +} + +export default ESolidStand; diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index e1370ce0a..fdec3adfb 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -230,16 +230,16 @@ export default class Switch extends Group { offsetX = directx * this.style.Switch.rectLock.offset.x; offsetY = directy * this.style.Switch.rectLock.offset.y; } - let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX; - let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY; - if (this.style.Switch.rectLock.followName) { - const directx = this.triangle.drictx; - const rect = this.name.getBoundingRect(); - const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0? rect.width: rect.width/2); - const hLen = this.style.Switch.rectLock.rectWidth - rect.height - x = rect.x - wLen/2; - y = rect.y - hLen/2 - } + let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX; + let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY; + if (this.style.Switch.rectLock.followName) { + const directx = this.triangle.drictx; + const rect = this.name.getBoundingRect(); + const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0 ? rect.width : rect.width / 2); + const hLen = this.style.Switch.rectLock.rectWidth - rect.height; + x = rect.x - wLen / 2; + y = rect.y - hLen / 2; + } this.lockRect = new ELockRect({ // 单锁矩形框 zlevel: this.zlevel, @@ -326,7 +326,7 @@ export default class Switch extends Group { /** 恢复状态*/ recover() { this.lockRect && this.lockRect.hide(); // 矩形包围框 - this.lockCircle && this.lockCircle.hide(); // 圆形包围框 + this.lockCircle && this.lockCircle.hide(); // 圆形包围框 this.lockArc && this.lockArc.hide(); // 圆形单锁框 this.name.getNameText().stopAnimation(false); this.shapeModelC.hide(); // 形状 C @@ -703,6 +703,9 @@ export default class Switch extends Group { this.setInversionAction(model); /** 反位*/ } else { this.setLossAction(model.fault); // 失去 + if (model.switchSplit) { + this.setForkAction(); + } } model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示 diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index dd8be5b04..3d1444c7d 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -40,21 +40,11 @@ export default class TrainBody extends Group { create() { const model = this.model; const style = this.model.style; - this.nameFormat = model.nameFormat; const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode ? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber) : model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号 const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (style.Train.trainTargetNumber.lineNumber || '') + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber); // 车组号 - let serviceNumber = ''; // 服务号(表号) - if (this.model.type == 'PLAN') { // 计划车 - serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber); - } else if (this.model.type == 'HEAD') { // 头码车 - serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); - this.nameFormat = 'serviceNumber:groupNumber'; - } else if (this.model.type == 'MANUAL') { // 人工车 - serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceHeadNum); - this.nameFormat = 'serviceNumber:groupNumber'; - } + const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);// 服务号(表号) let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码 if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好 targetCode = '01'; diff --git a/src/jmapNew/shape/factory.js b/src/jmapNew/shape/factory.js index f3aba1679..5869a93bd 100644 --- a/src/jmapNew/shape/factory.js +++ b/src/jmapNew/shape/factory.js @@ -31,6 +31,7 @@ import FloodGate from './FloodGate/index'; import DirectionRod from './DirectionRod/index'; import Responder from './Responder/index'; import SignalButton from './SignalButton/index'; +// import IndicatorLight from './SaidLamp/index'; /** 图库*/ const mapShape = {}; @@ -74,6 +75,7 @@ mapShape[deviceType.FaultStatusGroup] = SaidLamp; mapShape[deviceType.ReturnModeGroup] = SaidLamp; mapShape[deviceType.Axle] = SaidLamp; mapShape[deviceType.SwitchFault] = SaidLamp; +mapShape[deviceType.IndicatorLight] = SaidLamp; mapShape[deviceType.SplitStation] = SplitStation; mapShape[deviceType.Arrow] = Arrow; mapShape[deviceType.Power] = Power; diff --git a/src/jmapNew/theme/chengdu_01/model.js b/src/jmapNew/theme/chengdu_01/model.js index c7d80a99e..b7c5f905f 100644 --- a/src/jmapNew/theme/chengdu_01/model.js +++ b/src/jmapNew/theme/chengdu_01/model.js @@ -39,6 +39,9 @@ class Model { this['private'][deviceType.TrainWindow] = { trainWindowShow: true }; + this['private'][deviceType.SignalButton] = { + hasSelected: 0 + }; } initPublicProps(model) { diff --git a/src/jmapNew/theme/components/menus/dialog/setFault.vue b/src/jmapNew/theme/components/menus/dialog/setFault.vue index 868e92d7a..9e9aa69f8 100644 --- a/src/jmapNew/theme/components/menus/dialog/setFault.vue +++ b/src/jmapNew/theme/components/menus/dialog/setFault.vue @@ -110,7 +110,7 @@ export default { }, groupNumber: '', field: '', - selected: null, + selected: null, rules: { faultType: [ { required: true, message: '请选择故障类型', trigger: 'change'} @@ -172,8 +172,8 @@ export default { this.field = field == this.field ? '' : field; }, doShow(operate, selected, judge) { - this.$root.$emit('dialogOpen', selected); - this.selected = selected; + this.$root.$emit('dialogOpen', selected); + this.selected = selected; if (!this.dialogShow) { this.switchName = ''; this.stationName = ''; @@ -210,7 +210,7 @@ export default { this.dialogShow = false; this.form.faultType = ''; this.$refs.form.resetFields(); - this.$root.$emit('dialogClose', this.selected); + this.$root.$emit('dialogClose', this.selected); this.$store.dispatch('training/emitTipFresh'); }, commit() { diff --git a/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue b/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue new file mode 100644 index 000000000..86b662260 --- /dev/null +++ b/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue @@ -0,0 +1,400 @@ + + + + + + + diff --git a/src/jmapNew/theme/datie_01/menus/dialog/childDialog/passwordInputBox.vue b/src/jmapNew/theme/datie_01/menus/dialog/childDialog/passwordInputBox.vue index 5d5a948dc..2f41411df 100644 --- a/src/jmapNew/theme/datie_01/menus/dialog/childDialog/passwordInputBox.vue +++ b/src/jmapNew/theme/datie_01/menus/dialog/childDialog/passwordInputBox.vue @@ -102,7 +102,7 @@ export default { return this.dialogShow && !this.$store.state.menuOperation.break; }, domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.password.domId : '' + return this.dialogShow ? OperationEvent.Command.cancel.password.domId : ''; }, domIdConfirm() { return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : ''; diff --git a/src/jmapNew/theme/datie_01/menus/menuButton.vue b/src/jmapNew/theme/datie_01/menus/menuButton.vue index 71a930450..f0a9a8956 100644 --- a/src/jmapNew/theme/datie_01/menus/menuButton.vue +++ b/src/jmapNew/theme/datie_01/menus/menuButton.vue @@ -1,109 +1,106 @@ @@ -112,12 +109,11 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import Handler from '@/scripts/cmdPlugin/Handler'; -import { getAutoReentryBySignalCode } from '@/utils/mapList'; import PasswordBox from './dialog/childDialog/passwordInputBox.vue'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; -import { OperateMode } from '@/scripts/ConstDic'; +// import { OperateMode } from '@/scripts/ConstDic'; export default { name: 'MapButtonMenu', @@ -129,18 +125,25 @@ export default { return { point: { x: 0, - y: 15 + y: 0 }, operation: '0', buttonName: '', - buttonDownColor: '#A8A8A8', + guideColorDown: '#FEEE1A', + guideColorUp: '#DCDCDC', + buttonDownColor: '#FEEE1A', buttonUpColor: '#DCDCDC', - width: 58, + width: 78, tempData: null, offset: {}, commandTypeList: [], cmdTypeList: [], - deviceList: [] + deviceList: [], + timer: null, + deviceTimer: null, + routeDataMap: null, + guideLockRightFlag: false, + guideLockLeftFlag: false }; }, computed: { @@ -188,6 +191,10 @@ export default { return CMD.Switch.CMD_SWITCH_NORMAL_POSITION; case this.Switch.reverse.button.operation: // 道岔反位 return CMD.Switch.CMD_SWITCH_REVERSE_POSITION; + case this.Switch.block.button.operation: // 道岔封锁 + return CMD.Switch.CMD_SWITCH_BLOCK; + case this.Switch.unblock.button.operation: + return CMD.Switch.CMD_SWITCH_UNBLOCK; case this.Signal.atsAutoControl.button.operation: // 自动控 return CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING; case this.Signal.humanControl.button.operation: // 人工控 @@ -200,10 +207,6 @@ export default { return CMD.Signal.CMD_SIGNAL_SET_ROUTE; case this.Signal.guide.button.operation: // 办理引导 return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE; - case this.Signal.reopenSignal.button.operation: - return CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL; - case this.Station.guideLock.button.operation: - return CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK; } return ''; } @@ -214,15 +217,22 @@ export default { }, '$store.state.menuOperation.selectedCount': function (val) { this.selectedChange(); + }, + '$store.state.map.clearButtonCount': function(val) { + this.commandTypeList = []; + this.$store.dispatch('menuOperation/setButtonOperation', null); + this.clearOperate(); + this.guideLockRightFlag = false; + this.guideLockLeftFlag = false; } }, beforeDestroy() { - this.resetMbmButton(); + this.routeDataMap = null; }, methods: { passWordCommit(data) { let operate = {}; - if (data.overNext) { + if (data.overNext) { operate = { over: true, code: data.code, @@ -235,24 +245,27 @@ export default { operate = { over: true, operation: data.operation, - cmdType: data.nextCmdType + cmdType: data.nextCmdType, + param: data.param }; } else { operate = { + operationPre: data.operation, operation: data.operateNext }; } this.trainingOperation(operate); }, - checkCancel() { - Handler.clear(); // 清空操作组 - this.$store.dispatch('menuOperation/setButtonOperation', null); - }, // 执行操作 trainingOperation(operate) { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { + if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) { + this.guideLockLeftFlag = !this.guideLockLeftFlag; + } else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) { + this.guideLockRightFlag = !this.guideLockRightFlag; + } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } }).catch((error) => { @@ -280,20 +293,50 @@ export default { } } }, + guideLockLeftButtonDown() { + const operate = { + operation: this.Switch.guideLock.leftButton.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + if (this.guideLockRightFlag) { + operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK; + operate.param = {right: false}; + } + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + operate['operateNext'] = this.Command.close.password.operation; + this.$refs.password.doShow(operate); + } + }); + }, + guideLockRightButtonDown() { + const operate = { + operation: this.Switch.guideLock.rightButton.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + if (this.guideLockRightFlag) { + operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK; + operate.param = {right: true}; + } + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + operate['operateNext'] = this.Command.close.password.operation; + this.$refs.password.doShow(operate); + } + }); + }, buttonDown(operation, commandTypeList) { + this.clearOperate(); // 清空当前的选择的设备 - this.deviceList = []; if (operation != this.Command.cancel.clearMbm.operation) { const operate = { operation: operation }; - // 以下 会弹出密码框 (总人解,区故解,道岔解封,解封按钮,总取消,引导总锁) - const operationList = [this.Signal.humanTrainRoute.button.operation, - this.Section.fault.button.operation, - this.Switch.unlock.button.operation, - this.MixinCommand.unblock.button.operation, - this.Station.guideLock.button.operation - // this.MixinCommand.totalCancel.button.operation + // 以下 会弹出密码框 (总人解,区故解, 引导总锁) + const operationList = [ + this.Signal.humanTrainRoute.button.operation, + this.Section.fault.button.operation + // this.Switch.guideLock.leftButton.operation ]; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { @@ -307,6 +350,9 @@ export default { operate['operateNext'] = this.Command.close.password.operation; this.$refs.password.doShow(operate); } + this.timer = setTimeout(() => { + this.clearOperate(); + }, 15000); this.$store.dispatch('training/emitTipFresh'); } }); @@ -319,150 +365,93 @@ export default { if (valid) { this.commandTypeList = []; this.$store.dispatch('menuOperation/setButtonOperation', null); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - Handler.clear(); // 清空操作组 } }); } }, - resetMbmButton() { - this.commandTypeList = []; - this.$store.dispatch('menuOperation/setButtonOperation', null); - Handler.clear(); // 清空操作组 + handleRouteDataMap() { + this.routeDataMap = {}; + this.routeList.forEach(item => { + this.routeDataMap[item.btnCodeList.join('-')] = item; + }); }, // 排列进路 OR 信号重开操作 arrangementRouteOperation(deviceList) { const operate = { - operation: this.$store.state.menuOperation.buttonOperation + operation: this.Signal.arrangementRoute.button.operation }; - let isArrangementRoute = false; - if (deviceList.length === 1) { - const signal = deviceList[0]; - const sectionModel = this.$store.getters['map/getDeviceByCode'](signal.sectionCode); - if (sectionModel) { - // 判断 信号机所在区段的 左右关联区段 是否有锁闭 - const sectionLeft = this.$store.getters['map/getDeviceByCode'](sectionModel.leftSectionCode); - const sectionRight = this.$store.getters['map/getDeviceByCode'](sectionModel.rightSectionCode); - if (sectionLeft.routeLock || sectionRight.routeLock) { - isArrangementRoute = true; + if (!this.routeDataMap) { this.handleRouteDataMap(); } + if (this.deviceTimer) { + clearTimeout(this.deviceTimer); + } + const _that = this; + this.deviceTimer = setTimeout(() => { + if (deviceList[0]._type === 'SignalButton') { + _that.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'SignalButton', hasSelected: 0}]); + } else if (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING') { + _that.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'Signal', hasSelected: 0}]); + } + _that.deviceList = []; + }, 15000); + let signal = {}; + if (deviceList[0]._type === 'Signal') { + signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code); + } else if (deviceList[0]._type === 'SignalButton') { + signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].signalCode); + } + if (deviceList.length === 1 && !signal.routeLock) { + operate.code = deviceList[0].code; // 进路排列 + this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { + if (valid) { + if (deviceList[0]._type === 'SignalButton') { + this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'SignalButton', hasSelected: 1}]); + } else if (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING') { + this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'Signal', hasSelected: 1}]); + } } - } - // 如果该信号机红灯亮 而且 所属区段左右两侧区段锁闭 执行信号重启操作 - if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { // 信号重启 - operate.over = true; - operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL; - operate.code = deviceList[0].code; - operate.param = {signalCode: deviceList[0].code}; - this.deviceList = []; - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - } else { - operate.code = deviceList[0].code; // 进路排列 - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - } - } else if (deviceList.length === 2) { - let flag = false; - this.routeList.forEach(item => { - // item.endButtonSignalCode - // 起始信号机 和 结束信号机按钮 过滤进路 - if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) { - operate.over = true; - operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; - operate.code = deviceList[1].code; - operate.param = {routeCode: item.code}; - this.deviceList = []; - flag = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { - }).catch(() => { - this.$refs.noticeInfo.doShow(); - }); + }).catch(() => { + this.$refs.noticeInfo.doShow(); + }); + } else if (deviceList.length === 1 && signal.routeLock) { + operate.operation = this.Signal.reopenSignal.button.operation; + operate.over = true; + operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL; + operate.code = signal.code; + operate.param = {signalId: signal.code}; + this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => { + this.clearOperate(); + }).catch(() => this.$refs.noticeInfo.doShow() ); + } else if (deviceList.length > 1) { + let key = ''; + deviceList.forEach((item, index) => { + if (index) { + key += `-${item.code}`; + } else { + key = item.code; } }); - if (!flag) { + const route = this.routeDataMap[key]; + if (route) { + operate.over = true; + operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; + operate.code = deviceList[deviceList.length - 1].code; + operate.param = {routeId: route.code}; this.deviceList = []; - this.$refs.noticeInfo.doShow('未找到选择的进路!'); + this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { + if (deviceList[0]._type === 'SignalButton') { + this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'SignalButton', hasSelected: 0}]); + } else if (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING') { + _that.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: 'Signal', hasSelected: 0}]); + } + this.deviceTimer && clearTimeout(this.deviceTimer); + }).catch(() => { + this.deviceTimer && clearTimeout(this.deviceTimer); + this.$refs.noticeInfo.doShow(); + }); } } }, - // - handelFunctionButton(model, subType) { - const operate = { - over: true, - operation: this.$store.state.menuOperation.buttonOperation, - param: {} - }; - if (model._type === 'StationStand' && subType === 'StopJumpLamp') { - operate.cmdType = CMD.Stand.CMD_STAND_SET_JUMP_STOP; - operate.param = {standCode: model.code, trainGroupNumber: ''}; - operate.code = model.code; - } else if (model._type === 'StationStand' && subType === 'CancelStopJumpLamp') { - operate.cmdType = CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP; - operate.param = {standCode: model.code, trainGroupNumber: ''}; - operate.code = model.code; - } else if (model._type === 'AutoTurnBack' ) { - operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK; - operate.param = {cycleCode: model.cycleCode}; - operate.code = model.code; - } else if (model._type === 'AutomaticRoute') { - const route = this.routeData[model.automaticRouteCode]; - operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_CI_AUTO; - operate.param = {signalCode: route.startSignalCode}; - operate.code = model.code; - } else if (model._type === 'Station') { - switch (subType) { - case 'substation': - operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL; - operate.param = {stationCodes: [model.code]}; - operate.code = model.code; - break; - case 'center': - // operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL; - delete operate.over; - operate.subType = 'center'; - operate.param = {stationCodes: [model.code]}; - operate.code = model.code; - break; - case 'emergency': - // operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL; - delete operate.over; - operate.subType = 'emergency'; - operate.param = {stationCodes: [model.code]}; - operate.code = model.code; - break; - case 'interconnected': - // operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL; - delete operate.over; - operate.subType = 'interconnected'; - operate.param = {stationCodes: [model.code]}; - operate.code = model.code; - break; - } - } - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { - // 判断是否需要 弹窗密码框 - // const operate = Object.assign({}, operate); - if (subType == 'center ' || subType == 'emergency' || subType == 'interconnected' ) { - operate['operateNext'] = operate.operation = this.Command.close.password.operation; - if (subType == 'center') { - operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL; - } else if (subType == 'emergency') { - operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL; - } else { - operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_INTERLOCK_CONTROL; - } - this.$refs.password.doShow(operate); - } - }).catch((error) => { - this.deviceList = []; - console.error(error); - this.$refs.noticeInfo.doShow(); - - }); - }, - handelTotalCancel(model, subType) { + handelTotalCancel(model) { const operate = { over: true, code: model.code, @@ -471,129 +460,68 @@ export default { param: {} }; if (model._type === 'Signal') { - const autoReentry = getAutoReentryBySignalCode(model.code, this.routeList, this.autoReentryList); - let autoReentrySet = ''; - autoReentry.forEach(item => { - const autoReentryRel = this.autoReentryData[item.code]; - if (autoReentryRel.setUp) { - autoReentrySet = autoReentryRel; - } - }); - if (autoReentrySet) { - operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK; - operate.param = {cycleCode: autoReentrySet.code, cancelRoute: true}; - } else { - operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; - operate.param = {signalCode: model.code}; - } - } else if (model._type === 'AutoTurnBack') { - operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK; - operate.param = {cycleCode: model.cycleCode, cancelRoute: false}; - operate.code = model.code; - } else if (model._type === 'AutomaticRoute') { - const route = this.routeData[model.automaticRouteCode]; - operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO; - operate.param = {signalCode: route.startSignalCode}; - operate.code = model.code; + operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; + operate.param = {signalId: model.code}; + } else if (model._type === 'SignalButton') { + operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; + operate.param = { signalId: model.signalCode }; } - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { + this.clearOperate(); + }).catch((error) => { this.deviceList = []; console.error(error); this.$refs.noticeInfo.doShow(); }); }, - handleGuideRoute(deviceList) { - if (deviceList.length === 1) { - let route = ''; - this.routeList.forEach(item => { - if (item.startSignalCode === deviceList[0].code && this.routeData[item.code].lock) { - route = item; - } - }); - - if (!route) { - const operate = { - code: deviceList[0].code, - operation: this.$store.state.menuOperation.buttonOperation - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - operate['operateNext'] = this.Command.close.password.operation; - this.$refs.password.doShow(operate); - } - }).catch((error) => { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - } else { - const operate = { - code: deviceList[0].code, - operation: this.$store.state.menuOperation.buttonOperation, - overNext: true, - param: {routeCode: route.code, signalCode: deviceList[0].code} - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.deviceList = []; - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - operate['operateNext'] = this.Command.close.password.operation; - operate['operation'] = this.Command.close.password.operation; - this.$refs.password.doShow(operate); - } - }).catch((error) => { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - } - } else if (deviceList.length === 2) { - const operate = { - over: true, - code: deviceList[1].code, - cmdType: this.cmdType, - operation: this.$store.state.menuOperation.buttonOperation, - overNext: true - }; - let flag = false; - this.routeList.forEach(item => { - if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) { - operate.param = {routeCode: item.code, signalCode: deviceList[0].code}; - this.deviceList = []; - flag = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => { - this.$refs.noticeInfo.doShow(); - console.error(error); - }); - } - }); - if (!flag) { + handleGuideSignal(model) { + const operate = { + over: true, + code: model.code, + operation: this.Signal.guide.button.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, + param: {signalId: model.signalCode} + }; + const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode); + if (signal.guideTime) { + this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { + this.clearOperate(); + }).catch((error) => { this.deviceList = []; - this.$refs.noticeInfo.doShow('未找到选择进路!'); - } + console.error(error); + this.$refs.noticeInfo.doShow(); + }); + } else { + operate.nextCmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE; + this.$refs.password.doShow(operate); } }, handleTotalHumanSolution(model) { const operate = { send: true, - overNext: true, - code: model.code, + overNext: true, + code: model.code, operation: this.$store.state.menuOperation.buttonOperation }; - - if (model.yellowOpen && model.redOpen) { - operate.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE; - operate.param = {signalCode: model.code}; - this.deviceList = []; - this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}); - } else { + const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code); + if (model._type === 'SignalButton' && model.type === 'PICK' && signal.routeLock) { operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE; - operate.param = {signalCode: model.code}; - operate.val = model.code; + operate.param = {signalId: model.signalCode}; + operate.val = model.code; this.deviceList = []; this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); - }); + }).finally(() =>{ this.clearOperate(); }); + } else if (model._type === 'Signal' && model.type === 'SHUNTING' && signal.routeLock) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE; + operate.param = {signalId: model.code}; + operate.val = model.code; + this.deviceList = []; + this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { + console.error(error); + this.$refs.noticeInfo.doShow(); + }).finally(() =>{ this.clearOperate(); }); } }, handelControlRoute(model) { // 自动控 人工控点击button 发送 @@ -623,14 +551,27 @@ export default { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, cmdType: this.cmdType, - param: { switchCode: model.code} + param: { id: model.code} }; - this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { + this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => { this.clearOperate(); }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); + }); }, - handelBlockOrUnblock(model) { + checkHasTrainButton(model) { + if (model.signalButtonList && model.signalButtonList.length > 0) { + let flag = false; + model.signalButtonList.forEach(item => { + const signalButton = this.$store.getters['map/getDeviceByCode'](item); + flag = flag || signalButton.type === 'PICK'; + }); + return flag; + } else { + return false; + } + }, + handelSignalBlockOrUnblock(model) { const buttonOperation = this.$store.state.menuOperation.buttonOperation; const operate = { over: true, @@ -639,112 +580,128 @@ export default { cmdType: '', param: {} }; - if (model._type === 'Switch' && buttonOperation === this.MixinCommand.block.button.operation) { - operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK; - operate.param = {switchCode: model.code}; - } else if (model._type === 'Switch' && buttonOperation === this.MixinCommand.unblock.button.operation) { - operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK; - operate.param = {switchCode: model.code}; - } else if (model._type === 'Signal' && buttonOperation === this.MixinCommand.block.button.operation) { - operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK; - operate.param = {signalCode: model.code}; - } else if (model._type === 'Signal' && buttonOperation === this.MixinCommand.unblock.button.operation) { - operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK; - operate.param = {signalCode: model.code}; + if (model._type === 'Signal' && !this.checkHasTrainButton(model)) { + if (buttonOperation === this.Signal.lock.button.operation) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK; + operate.param = {signalId: model.code}; + } else if (buttonOperation === this.Signal.unlock.button.operation) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK; + operate.param = {signalId: model.code}; + } + } else if (model._type === 'SignalButton' && model.type === 'PICK') { + if (buttonOperation === this.Signal.lock.button.operation) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK; + operate.param = {signalId: model.signalCode}; + } else if (buttonOperation === this.Signal.unlock.button.operation) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK; + operate.param = {signalId: model.signalCode}; + } } this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); + }).finally(() => { + this.clearOperate(); }); }, - handelGuideLock(model) { - const operate = { - over: true, - code: model.code, - operation: this.$store.state.menuOperation.buttonOperation, - cmdType: '', - param: {stationCode: model.stationCode} - }; - if (model.totalGuideLock) { - operate.cmdType = CMD.Station.CMD_STATION_CANCEL_MASTER_GUIDE_LOCK; - } else { - operate.cmdType = CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK; + handleGuideLock(model) { + const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode); + if (signal && (this.guideLockRightFlag && signal.right) || (this.guideLockLeftFlag && !signal.right)) { + const operate = { + over: true, + code: model.code, + operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton, + nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK, + param: {signalId: model.signalCode} + }; + this.$refs.password.doShow(operate); } - this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => { - this.resetMbmButton(); - }).catch((error) => { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); }, handelFaultSection(model) { - const operate = { - over: true, - code: model.code, - operation: this.$store.state.menuOperation.buttonOperation, - cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, - param: {sectionCode: model.code} - }; - this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); + if (model._type === 'Section') { + const operate = { + over: true, + code: model.code, + operation: this.$store.state.menuOperation.buttonOperation, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, + param: {id: model.code} + }; + this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { + console.error(error); + this.$refs.noticeInfo.doShow(); + }).finally(() => this.clearOperate()); + } }, selectedChange() { // 按钮按下时 if (this.$store.state.training.prdType != '01') { return ''; } - const buttonOperation = this.$store.state.menuOperation.buttonOperation; const model = this.$store.state.menuOperation.selected; // 选择设备 const subType = this.$store.state.menuOperation.subType; // 选择设备的子元素 - const switchOperation = [this.Switch.lock.button.operation, this.Switch.unlock.button.operation, this.Switch.locate.button.operation, this.Switch.reverse.button.operation]; + const switchOperation = [ + this.Switch.lock.button.operation, + this.Switch.unlock.button.operation, + this.Switch.locate.button.operation, + this.Switch.reverse.button.operation, + this.Switch.block.button.operation, + this.Switch.unblock.button.operation + ]; if (!model._type && !model._code) { return; } - if (buttonOperation && buttonOperation === this.MixinCommand.functionButton.button.operation) { - this.handelFunctionButton(model, subType); + if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') { + this.handleGuideLock(model); } else { const station = this.$store.getters['map/getDeviceByCode'](model.stationCode); if (station) { - if (station.controlMode == 'Local' || station.controlMode == 'Emergency') { - if (buttonOperation && this.commandTypeList.includes(model._type)) { + if (buttonOperation && this.commandTypeList.includes(model._type)) { + if (buttonOperation === this.MixinCommand.totalCancel.button.operation) { + this.handelTotalCancel(model, subType); + } else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) { + this.handleTotalHumanSolution(model); + } else if (buttonOperation === this.Signal.atsAutoControl.button.operation || buttonOperation === this.Signal.humanControl.button.operation) { + this.handelControlRoute(model); + } else if (switchOperation.includes(buttonOperation)) { + this.handelSwitchOperate(model); + } else if (buttonOperation === this.Signal.lock.button.operation || buttonOperation === this.Signal.unlock.button.operation) { + this.handelSignalBlockOrUnblock(model); + } else if (buttonOperation === this.Section.fault.button.operation) { + this.handelFaultSection(model); + } else { + this.clearOperate(); + } + } else if (!buttonOperation) { + if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) { + this.handleGuideSignal(model); + } else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) { this.deviceList.push(model); - if (buttonOperation === this.Signal.arrangementRoute.button.operation) { - this.arrangementRouteOperation(this.deviceList); - } else if (buttonOperation === this.MixinCommand.totalCancel.button.operation) { - this.handelTotalCancel(model, subType); - } else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) { - this.handleTotalHumanSolution(model); - } else if (buttonOperation === this.Signal.guide.button.operation) { - this.handleGuideRoute(this.deviceList); - } else if (buttonOperation === this.Signal.atsAutoControl.button.operation || buttonOperation === this.Signal.humanControl.button.operation) { - this.handelControlRoute(model); - } else if (switchOperation.includes(buttonOperation)) { - this.handelSwitchOperate(model); - } else if (buttonOperation === this.MixinCommand.block.button.operation || buttonOperation === this.MixinCommand.unblock.button.operation) { - this.handelBlockOrUnblock(model); - } else if (buttonOperation === this.Station.guideLock.button.operation) { - this.handelGuideLock(model); - } else if (buttonOperation === this.Section.fault.button.operation) { - this.handelFaultSection(model); - } else { - this.clearOperate(); - } + this.arrangementRouteOperation(this.deviceList); } else { this.clearOperate(); } } else { this.clearOperate(); - this.operatemode != OperateMode.FAULT && this.$message.info('请先切换到站控或紧急站控'); } } } + if (this.timer) { + clearTimeout(this.timer); + } + }, + checkSignalBlock(code) { + if (code) { + const signal = this.$store.getters['map/getDeviceByCode'](code); + return signal && signal.blockade; + } else { return false; } }, clearOperate() { + if (this.deviceList && this.deviceList.length) { + this.$store.dispatch('training/updateMapState', [{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0}]); + } + this.deviceList = []; Handler.clear(); // 清空操作组 - this.deviceList = []; this.$store.dispatch('menuOperation/setButtonOperation', null); } } @@ -752,10 +709,12 @@ export default { diff --git a/src/views/authorization/apply.vue b/src/views/authorization/apply.vue index a4f35f370..058d47f3b 100644 --- a/src/views/authorization/apply.vue +++ b/src/views/authorization/apply.vue @@ -1,30 +1,28 @@ - - diff --git a/src/views/planSchedule/menusPlan/createWeekPlan.vue b/src/views/planSchedule/menusPlan/createWeekPlan.vue index 26066f48a..f2da5725d 100644 --- a/src/views/planSchedule/menusPlan/createWeekPlan.vue +++ b/src/views/planSchedule/menusPlan/createWeekPlan.vue @@ -10,36 +10,30 @@ :modal="false" :close-on-click-modal="false" > - - - - - - - - - - - - - - - - + + + + + + + + + + - 确 定 + 确 定 取 消 @@ -143,18 +137,9 @@ export default { diff --git a/src/views/planSchedule/schedule.vue b/src/views/planSchedule/schedule.vue index d3dc1af33..07bfaeec5 100644 --- a/src/views/planSchedule/schedule.vue +++ b/src/views/planSchedule/schedule.vue @@ -342,7 +342,7 @@ export default { option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime; option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime; option.series = series; - option.title.text = (this.$store.state.runPlan.runPlanInfo||{}).name||''; + option.title.text = (this.$store.state.runPlan.runPlanInfo || {}).name || ''; this.myChart = echarts.init(document.getElementById(this.runPlanId)); if (this.myChart) { this.myChart.setOption(option); diff --git a/src/views/system/systemGenerate/create.vue b/src/views/system/systemGenerate/create.vue index 8eda049f8..5ba8ddf7d 100644 --- a/src/views/system/systemGenerate/create.vue +++ b/src/views/system/systemGenerate/create.vue @@ -11,7 +11,7 @@ diff --git a/src/views/trainingPlatform/secondaryHome.vue b/src/views/trainingPlatform/secondaryHome.vue index 11afde3d1..02ff84a1f 100644 --- a/src/views/trainingPlatform/secondaryHome.vue +++ b/src/views/trainingPlatform/secondaryHome.vue @@ -1,18 +1,16 @@ @@ -36,7 +34,7 @@ export default { { src: simulation4 }, { src: simulation5 } ], - teachImgList: [ + lessonImgList: [ { src: teach1 } ], examImgList: [ @@ -46,26 +44,11 @@ export default { }, computed: { listImg() { - if (this.$route.query.type === 'Simulation') { - return this.simulationImgList; - } else if (this.$route.query.type === 'Lesson') { - return this.teachImgList; - } else if (this.$route.query.type === 'Exam') { - return this.examImgList; - } else { - return []; - } + return this[(this.$route.query.type || '').toLowerCase() + 'ImgList'] || []; }, title() { - if (this.$route.query.type === 'Simulation') { - return '仿真系统'; - } else if (this.$route.query.type === 'Lesson') { - return '教学系统'; - } else if (this.$route.query.type === 'Exam') { - return '考试系统'; - } else { - return ''; - } + const typeMap = {'Simulation':'仿真系统', 'Lesson':'教学系统', 'Exam':'考试系统'}; + return typeMap[this.$route.query.type] || ''; } } }; @@ -80,7 +63,7 @@ export default { .joylink-card{ height: 100%; font-family: 'Microsoft YaHei'; - overflow: hidden; + overflow: auto; .content_box{ padding: 0 100px 15px; } @@ -108,12 +91,12 @@ export default { padding: 0 50px; } - .brief-box { - font-size: 18px; - text-indent: 2em; - line-height: 32px; - padding: 40px 20px 0; - font-family: unset; - } + // .brief-box { + // font-size: 18px; + // text-indent: 2em; + // line-height: 32px; + // padding: 40px 20px 0; + // font-family: unset; + // } } diff --git a/static/lesson3d/addbutton.png b/static/lesson3d/addbutton.png new file mode 100644 index 000000000..0373c96f0 Binary files /dev/null and b/static/lesson3d/addbutton.png differ diff --git a/static/lesson3d/back.png b/static/lesson3d/back.png new file mode 100644 index 000000000..3eb9afd5b Binary files /dev/null and b/static/lesson3d/back.png differ diff --git a/static/lesson3d/bag.png b/static/lesson3d/bag.png new file mode 100644 index 000000000..5e9a4b1b3 Binary files /dev/null and b/static/lesson3d/bag.png differ diff --git a/static/lesson3d/guide.png b/static/lesson3d/guide.png new file mode 100644 index 000000000..a33e5bb20 Binary files /dev/null and b/static/lesson3d/guide.png differ diff --git a/static/lesson3d/jobpic.png b/static/lesson3d/jobpic.png new file mode 100644 index 000000000..82461e4fd Binary files /dev/null and b/static/lesson3d/jobpic.png differ diff --git a/static/lesson3d/lessonbg.png b/static/lesson3d/lessonbg.png new file mode 100644 index 000000000..4a3acf4a7 Binary files /dev/null and b/static/lesson3d/lessonbg.png differ diff --git a/static/lesson3d/lkgw.png b/static/lesson3d/lkgw.png new file mode 100644 index 000000000..5a8355283 Binary files /dev/null and b/static/lesson3d/lkgw.png differ diff --git a/static/lesson3d/选项.png b/static/lesson3d/选项.png new file mode 100644 index 000000000..d1c258863 Binary files /dev/null and b/static/lesson3d/选项.png differ