Merge remote-tracking branch 'remotes/origin/test_switch' into test_deplotSimulation
This commit is contained in:
commit
5e3006bf91
@ -180,12 +180,61 @@ class Iscs {
|
|||||||
update(list) {
|
update(list) {
|
||||||
(list || []).forEach(elem => {
|
(list || []).forEach(elem => {
|
||||||
const code = elem.code;
|
const code = elem.code;
|
||||||
const oDevice = this.iscsDevice[code];
|
if (elem.deviceType === 'IBP') {
|
||||||
if (elem.dispose) {
|
if (this.iscsDevice['IscsCircle_20']) {
|
||||||
this.$painter.delete(oDevice);
|
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_20']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_17']) {
|
||||||
|
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_17']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_18']) {
|
||||||
|
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_18']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_19']) {
|
||||||
|
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_19']);
|
||||||
|
}
|
||||||
|
} else if (elem.deviceType === 'PSL') {
|
||||||
|
if (this.iscsDevice['IscsCircle_12']) {
|
||||||
|
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_12']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_9']) {
|
||||||
|
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_9']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_35']) {
|
||||||
|
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_35']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_37']) {
|
||||||
|
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_37']);
|
||||||
|
}
|
||||||
|
} else if (elem.deviceType === 'SAFETY_CIRCLE') {
|
||||||
|
if (this.iscsDevice['IscsCircle_26']) {
|
||||||
|
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_26']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_25']) {
|
||||||
|
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_25']);
|
||||||
|
}
|
||||||
|
if (this.iscsDevice['IscsCircle_27']) {
|
||||||
|
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#008DCE';
|
||||||
|
this.$painter.update(this.iscsDevice['IscsCircle_27']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.hookHandle(oDevice.model, elem)) {
|
const oDevice = this.iscsDevice[code];
|
||||||
this.$painter.update(oDevice);
|
if (oDevice && elem.dispose) {
|
||||||
|
this.$painter.delete(oDevice);
|
||||||
|
} else if (oDevice) {
|
||||||
|
if (this.hookHandle(oDevice.model, elem)) {
|
||||||
|
this.$painter.update(oDevice);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ class Painter {
|
|||||||
} else {
|
} else {
|
||||||
const instance = device.instance;
|
const instance = device.instance;
|
||||||
if (instance) {
|
if (instance) {
|
||||||
instance.setState(device);
|
instance.setState(device.model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,15 +68,29 @@ export default class fuzhouPsd extends Group {
|
|||||||
this.add(this.grouper);
|
this.add(this.grouper);
|
||||||
}
|
}
|
||||||
setState(model) {
|
setState(model) {
|
||||||
if (model.alarm) {
|
// if (model.alarm) {
|
||||||
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
|
// this.fuzhouPsdBorder.setStyle('lineWidth', 1);
|
||||||
}
|
// }
|
||||||
if (model.noStatus) {
|
if (model.status === 'UNDEFINED') {
|
||||||
this.fuzhouPsdLeft.attr({shape:{x: 2}});
|
this.fuzhouPsdLeft.attr({shape:{x: 2}});
|
||||||
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
|
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
|
||||||
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
|
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
|
||||||
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
|
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
|
||||||
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
|
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
|
||||||
|
} else if (model.status === 'DCU_FAULT') {
|
||||||
|
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
|
||||||
|
} else if (model.status === 'OPEN') {
|
||||||
|
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
|
||||||
|
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
|
||||||
|
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
|
||||||
|
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
|
||||||
|
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
|
||||||
|
} else if (model.status === 'CLOSE') {
|
||||||
|
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
|
||||||
|
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
|
||||||
|
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
|
||||||
|
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
|
||||||
|
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setModel(dx, dy) {
|
setModel(dx, dy) {
|
||||||
|
@ -130,3 +130,19 @@ export function trainSimulationDoorControl(group, data) {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function trainSimulationDoorSelection(group, data) {
|
||||||
|
return request({
|
||||||
|
url: `/simulation/${group}/operate/Driver_Door_Selection`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trainSimulationDoorMode(group, data) {
|
||||||
|
return request({
|
||||||
|
url: `/simulation/${group}/operate/Driver_Door_Mode`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -145,7 +145,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
|||||||
scene.add(controls3.getObject());
|
scene.add(controls3.getObject());
|
||||||
|
|
||||||
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
|
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
|
||||||
cameracctv.position.set( -3, 0,4.5 );
|
cameracctv.position.set( 1, 0,4.5 );
|
||||||
|
|
||||||
cameracctv.rotation.y = -Math.PI/2;
|
cameracctv.rotation.y = -Math.PI/2;
|
||||||
cameracctv.rotation.x = Math.PI/2;
|
cameracctv.rotation.x = Math.PI/2;
|
||||||
@ -387,7 +387,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
|||||||
rails = loadrails;
|
rails = loadrails;
|
||||||
|
|
||||||
// console.log(trainlisttest.group.children[0]);
|
// console.log(trainlisttest.group.children[0]);
|
||||||
trainlisttest.group.children[0].getObjectByName("C3").add(cameracctv);
|
trainlisttest.group.children[0].getObjectByName("C6").add(cameracctv);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eventon = function() {
|
this.eventon = function() {
|
||||||
|
@ -823,7 +823,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
// console.log(trainmodel.openleft);
|
// console.log(trainmodel.openleft);
|
||||||
// console.log(trainmodel.openright);
|
// console.log(trainmodel.openright);
|
||||||
if(trainmodel.code == data.code){
|
if(trainmodel.code == data.code){
|
||||||
|
console.log(data);
|
||||||
if(trainmodel.right == "0"){
|
if(trainmodel.right == "0"){
|
||||||
if(data.doorCode == "2"){
|
if(data.doorCode == "2"){
|
||||||
|
|
||||||
@ -834,10 +834,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||||
actions["traindoor"].top[an].timeScale = -1;
|
actions["traindoor"].top[an].timeScale = -1;
|
||||||
actions["traindoor"].top[an].play();
|
actions["traindoor"].top[an].play();
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(trainmodel.openleft != data.open && data.open == "1"){
|
}else if(trainmodel.openleft != data.open && data.open == "1"){
|
||||||
trainmodel.openleft = "1";
|
trainmodel.openleft = "1";
|
||||||
console.log(data);
|
|
||||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||||
actions["traindoor"].top[an].reset();
|
actions["traindoor"].top[an].reset();
|
||||||
actions["traindoor"].top[an].time = 0;
|
actions["traindoor"].top[an].time = 0;
|
||||||
|
@ -73,15 +73,19 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
|
|
||||||
|
|
||||||
this.actionModelControl = function(actionType,actionModel){
|
this.actionModelControl = function(actionType,actionModel){
|
||||||
console.log(actionType);
|
// console.log(actionType);
|
||||||
console.log(actionModel);
|
// console.log(actionModel);
|
||||||
if(actionType == "remove"){
|
if(actionType == "remove"){
|
||||||
|
|
||||||
assetModelManager.otherModel.remove(actionModel);
|
assetModelManager.otherModel.remove(actionModel);
|
||||||
|
}else if(actionType == "show"){
|
||||||
|
actionModel.visible = true;
|
||||||
|
assetModelManager.otherModel.add(actionModel);
|
||||||
}else if(actionType == "changeIndex"){
|
}else if(actionType == "changeIndex"){
|
||||||
actionModel.visible = true;
|
actionModel.visible = true;
|
||||||
assetModelManager.otherModel.add(actionModel);
|
assetModelManager.otherModel.add(actionModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.actionRemove = function(actionModel){
|
this.actionRemove = function(actionModel){
|
||||||
@ -91,15 +95,16 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
this.changeIndex = function(nowIndex){
|
this.changeIndex = function(nowIndex){
|
||||||
if(nowIndex!=0){
|
if(nowIndex!=0){
|
||||||
oldIndex = lessonIndex;
|
oldIndex = lessonIndex;
|
||||||
|
if(lessonData.lessonProgress[oldIndex].roleName == nowRole){
|
||||||
|
updateExam(lessonData.lessonProgress[oldIndex],oldIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(lessonData.lessonProgress[oldIndex].roleName == nowRole){
|
|
||||||
updateExam(lessonData.lessonProgress[oldIndex],oldIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
lessonIndex = nowIndex;
|
lessonIndex = nowIndex;
|
||||||
|
|
||||||
console.log(nowIndex);
|
// console.log(nowIndex);
|
||||||
scope.nowSceneType = lessonData.lessonProgress[nowIndex].progressScene;
|
scope.nowSceneType = lessonData.lessonProgress[nowIndex].progressScene;
|
||||||
// console.log(nowRole);
|
// console.log(nowRole);
|
||||||
// console.log(lessonData.lessonProgress[lessonIndex].roleName);
|
// console.log(lessonData.lessonProgress[lessonIndex].roleName);
|
||||||
@ -118,7 +123,10 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false,assetModelManager.lessonTriggerList[scope.nowSceneType]);
|
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false,assetModelManager.lessonTriggerList[scope.nowSceneType]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nowIndex == lessonData.lessonProgress.length-1){
|
|
||||||
|
if(nowIndex == (lessonData.lessonProgress.length-1)){
|
||||||
|
console.log(nowIndex);
|
||||||
|
console.log(lessonData.lessonProgress.length);
|
||||||
lessonEnd();
|
lessonEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,6 +145,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
}
|
}
|
||||||
controlManager.initRoleMode(roleMode);
|
controlManager.initRoleMode(roleMode);
|
||||||
for(let i=0;i<lessonData.lessonProgress.length;i++){
|
for(let i=0;i<lessonData.lessonProgress.length;i++){
|
||||||
|
|
||||||
if(nowRole == lessonData.lessonProgress[i].roleName){
|
if(nowRole == lessonData.lessonProgress[i].roleName){
|
||||||
examList.push(
|
examList.push(
|
||||||
{
|
{
|
||||||
@ -157,7 +166,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
time:0,
|
time:0,
|
||||||
};
|
};
|
||||||
controlManager.initExam(examList,examData);
|
controlManager.initExam(examList,examData);
|
||||||
updataExamStatus(examData);
|
// updataExamStatus(examData);
|
||||||
// if(lessonData.lessonProgress[lessonIndex].action.length>0){
|
// if(lessonData.lessonProgress[lessonIndex].action.length>0){
|
||||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,roleMode,assetModelManager.lessonTriggerList[scope.nowSceneType]);
|
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,roleMode,assetModelManager.lessonTriggerList[scope.nowSceneType]);
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ export function AssetModelManager(editor,scene) {
|
|||||||
scope.staticAsset['station'] = {
|
scope.staticAsset['station'] = {
|
||||||
modelId:'station',
|
modelId:'station',
|
||||||
packageName:"车站",
|
packageName:"车站",
|
||||||
url:JL3D_LOCAL_STATIC+"/lesson3d/station.FBX",
|
url:"/MODEL/2021-09-08/211-9861.FBX",
|
||||||
mesh:"",
|
mesh:"",
|
||||||
assetType:'static',
|
assetType:'onlineasset',
|
||||||
isUse:true,
|
isUse:true,
|
||||||
resourceType:"三维课程",
|
resourceType:"三维课程",
|
||||||
sceneType:"standstation",
|
sceneType:"standstation",
|
||||||
@ -219,7 +219,12 @@ export function AssetModelManager(editor,scene) {
|
|||||||
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").actionName = "PBMDH";
|
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").actionName = "PBMDH";
|
||||||
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg"));
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg"));
|
||||||
|
|
||||||
// console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").showType = "default";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").label = "隔离门";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").actionName = "PBMDH";
|
||||||
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("DMH"));
|
||||||
|
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").rotation.z = Math.PI/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//动态加载资源
|
//动态加载资源
|
||||||
|
@ -513,7 +513,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
|||||||
|
|
||||||
|
|
||||||
if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){
|
if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){
|
||||||
console.log(scope.controlMode);
|
|
||||||
|
|
||||||
scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode;
|
scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode;
|
||||||
if(scope.controlMode == "free" || scope.controlMode == "non"){
|
if(scope.controlMode == "free" || scope.controlMode == "non"){
|
||||||
@ -564,70 +564,110 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
|||||||
// console.log(eventTrigger);
|
// console.log(eventTrigger);
|
||||||
// console.log("----------------------------");
|
// console.log("----------------------------");
|
||||||
|
|
||||||
|
console.log(roleMode);
|
||||||
if(actions.length>0 && roleMode){
|
if(actions.length>0 ){
|
||||||
scope.eventHitMode = true;
|
scope.eventHitMode = true;
|
||||||
for(let i=0;i<actions.length;i++){
|
for(let i=0;i<actions.length;i++){
|
||||||
|
|
||||||
if(actions[i].actionType == "auto"){
|
if(actions[i].actionType == "auto"){
|
||||||
|
|
||||||
|
console.log(actions[i]);
|
||||||
if(actions[i].actionMode == "play"){
|
if(actions[i].actionMode == "play"){
|
||||||
for(let j=0;j<eventTrigger.length;j++){
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
if(eventTrigger[j].label == actions[i].actionModel){
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
|
|
||||||
if(actionList[eventTrigger[j].actionName].status == "01"){
|
if(actionList[eventTrigger[j].actionName].status == "01"){
|
||||||
actionList[eventTrigger[j].actionName].status = "02";
|
actionList[eventTrigger[j].actionName].status = "02";
|
||||||
|
|
||||||
|
actionList[eventTrigger[j].actionName].action.reset();
|
||||||
|
actionList[eventTrigger[j].actionName].action.timeScale = 1;
|
||||||
|
actionList[eventTrigger[j].actionName].action.clampWhenFinished = true;
|
||||||
|
actionList[eventTrigger[j].actionName].action.setLoop(THREE.LoopOnce);
|
||||||
actionList[eventTrigger[j].actionName].action.play();
|
actionList[eventTrigger[j].actionName].action.play();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
actionList[eventTrigger[j].actionName].status = "01";
|
||||||
|
|
||||||
|
actionList[eventTrigger[j].actionName].action.reset();
|
||||||
|
actionList[eventTrigger[j].actionName].action.timeScale = -1;
|
||||||
|
actionList[eventTrigger[j].actionName].action.clampWhenFinished = true;
|
||||||
|
actionList[eventTrigger[j].actionName].action.setLoop(THREE.LoopOnce);
|
||||||
|
actionList[eventTrigger[j].actionName].action.play();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(actions[i].actionMode == "show"){
|
||||||
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
|
actionEvent("show",actions[i],eventTrigger[j]);
|
||||||
|
j = eventTrigger.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(actions[i].actionMode == "remove"){
|
||||||
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
|
actionEvent("remove",actions[i],eventTrigger[j]);
|
||||||
|
j = eventTrigger.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log(eventTrigger);
|
if(roleMode){
|
||||||
if(actions[i].actionType == "contact"){
|
if(actions[i].actionType == "contact"){
|
||||||
for(let j=0;j<eventTrigger.length;j++){
|
if(eventTrigger){
|
||||||
if(eventTrigger[j].label == actions[i].actionModel){
|
|
||||||
let eventTestBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
eventTestBox.setFromObject(eventTrigger[j]);
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
eventTestBox.mesh = eventTrigger[j];
|
let eventTestBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||||
eventTestBox.action = actions[i];
|
eventTestBox.setFromObject(eventTrigger[j]);
|
||||||
eventBoxs.push(eventTestBox);
|
eventTestBox.mesh = eventTrigger[j];
|
||||||
actionEvent("changeIndex",eventBoxs[i].action,eventTestBox.mesh);
|
eventTestBox.action = actions[i];
|
||||||
|
eventBoxs.push(eventTestBox);
|
||||||
|
actionEvent("changeIndex",eventBoxs[i].action,eventTestBox.mesh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actions[i].actionType == "switch"){
|
||||||
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
|
|
||||||
|
let eventRaycaster = {
|
||||||
|
mesh:eventTrigger[j],
|
||||||
|
action:actionList[eventTrigger[j].actionName],
|
||||||
|
type:actions[i].actionType,
|
||||||
|
actionMode:actions[i].actionMode,
|
||||||
|
jumpNode:actions[i].jumpNode,
|
||||||
|
};
|
||||||
|
raycasterBoxs.push(eventRaycaster);
|
||||||
|
|
||||||
|
actionEvent("changeIndex",actions[i],eventTrigger[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actions[i].actionType == "urgeSwitch"){
|
||||||
|
for(let j=0;j<eventTrigger.length;j++){
|
||||||
|
if(eventTrigger[j].label == actions[i].actionModel){
|
||||||
|
let eventRaycaster = {
|
||||||
|
mesh:eventTrigger[j],
|
||||||
|
action:actionList[eventTrigger[j].actionName],
|
||||||
|
type:actions[i].actionType,
|
||||||
|
};
|
||||||
|
raycasterBoxs.push(eventRaycaster);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(actions[i].actionType == "switch"){
|
|
||||||
for(let j=0;j<eventTrigger.length;j++){
|
|
||||||
if(eventTrigger[j].label == actions[i].actionModel){
|
|
||||||
|
|
||||||
let eventRaycaster = {
|
|
||||||
mesh:eventTrigger[j],
|
|
||||||
action:actionList[eventTrigger[j].actionName],
|
|
||||||
type:actions[i].actionType,
|
|
||||||
actionMode:actions[i].actionMode,
|
|
||||||
jumpNode:actions[i].jumpNode,
|
|
||||||
};
|
|
||||||
raycasterBoxs.push(eventRaycaster);
|
|
||||||
|
|
||||||
actionEvent("changeIndex",actions[i],eventTrigger[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(actions[i].actionType == "urgeSwitch"){
|
|
||||||
for(let j=0;j<eventTrigger.length;j++){
|
|
||||||
if(eventTrigger[j].label == actions[i].actionModel){
|
|
||||||
let eventRaycaster = {
|
|
||||||
mesh:eventTrigger[j],
|
|
||||||
action:actionList[eventTrigger[j].actionName],
|
|
||||||
type:actions[i].actionType,
|
|
||||||
};
|
|
||||||
raycasterBoxs.push(eventRaycaster);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else if(actions.length>0){
|
}else if(actions.length>0){
|
||||||
console.log(actions);
|
// console.log(actions);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
238
src/jlmap3d/lesson3dedit/accident/fire.js
Normal file
238
src/jlmap3d/lesson3dedit/accident/fire.js
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
export function Fire() {
|
||||||
|
let scope = this;
|
||||||
|
this.points = {};
|
||||||
|
var last_time_activate = Date.now();
|
||||||
|
|
||||||
|
|
||||||
|
this.createNew = function(scene,pos){
|
||||||
|
scope.points = new Points(pos);
|
||||||
|
scope.points.init(pos);
|
||||||
|
scene.add(scope.points.obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.update = function(){
|
||||||
|
var now = Date.now();
|
||||||
|
scope.points.update();
|
||||||
|
if (now - last_time_activate > 10) {
|
||||||
|
|
||||||
|
scope.points.activateMover();
|
||||||
|
last_time_activate = Date.now();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var Mover = function() {
|
||||||
|
this.position = new THREE.Vector3();
|
||||||
|
this.velocity = new THREE.Vector3();
|
||||||
|
this.acceleration = new THREE.Vector3();
|
||||||
|
this.anchor = new THREE.Vector3();
|
||||||
|
this.mass = 1;
|
||||||
|
this.r = 0;
|
||||||
|
this.g = 0;
|
||||||
|
this.b = 0;
|
||||||
|
this.a = 1;
|
||||||
|
this.time = 0;
|
||||||
|
this.is_active = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
Mover.prototype = {
|
||||||
|
init: function(vector) {
|
||||||
|
this.position = vector.clone();
|
||||||
|
this.velocity = vector.clone();
|
||||||
|
this.anchor = vector.clone();
|
||||||
|
this.acceleration.set(0, 0, 0);
|
||||||
|
this.a = 1;
|
||||||
|
this.time = 0;
|
||||||
|
},
|
||||||
|
updatePosition: function() {
|
||||||
|
this.position.copy(this.velocity);
|
||||||
|
},
|
||||||
|
updateVelocity: function() {
|
||||||
|
this.acceleration.divideScalar(this.mass);
|
||||||
|
this.velocity.add(this.acceleration);
|
||||||
|
// if (this.velocity.distanceTo(this.position) >= 1) {
|
||||||
|
// this.direct(this.velocity);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
applyForce: function(vector) {
|
||||||
|
this.acceleration.add(vector);
|
||||||
|
},
|
||||||
|
applyFriction: function() {
|
||||||
|
var friction = friction(this.acceleration, 0.1);
|
||||||
|
this.applyForce(friction);
|
||||||
|
},
|
||||||
|
applyDragForce: function(value) {
|
||||||
|
var drag = drag(this.acceleration, value);
|
||||||
|
this.applyForce(drag);
|
||||||
|
},
|
||||||
|
hook: function(rest_length, k) {
|
||||||
|
var force = hook(this.velocity, this.anchor, rest_length, k);
|
||||||
|
this.applyForce(force);
|
||||||
|
},
|
||||||
|
activate: function() {
|
||||||
|
this.is_active = true;
|
||||||
|
},
|
||||||
|
inactivate: function() {
|
||||||
|
this.is_active = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var Points = function(pos) {
|
||||||
|
this.movers_num = 3000;
|
||||||
|
this.movers = [];
|
||||||
|
this.pos = pos;
|
||||||
|
this.geometry = null;
|
||||||
|
this.material = null;
|
||||||
|
this.obj = null;
|
||||||
|
this.texture = null;
|
||||||
|
this.antigravity = new THREE.Vector3(0, 0.1, 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
Points.prototype = {
|
||||||
|
init: function(pos) {
|
||||||
|
this.createTexture();
|
||||||
|
this.geometry = new THREE.Geometry();
|
||||||
|
this.material = new THREE.PointsMaterial({
|
||||||
|
color: 0xff6633,
|
||||||
|
size: 3,
|
||||||
|
transparent: true,
|
||||||
|
opacity: 0.5,
|
||||||
|
map: this.texture,
|
||||||
|
// depthTest: false,
|
||||||
|
depthWrite:false,
|
||||||
|
alphaTest: 0.1,
|
||||||
|
blending: THREE.AdditiveBlending,
|
||||||
|
});
|
||||||
|
for (var i = 0; i < this.movers_num; i++) {
|
||||||
|
var mover = new Mover();
|
||||||
|
|
||||||
|
mover.init(new THREE.Vector3((10*Math.random()+pos.x),pos.y, (10*Math.random()+pos.z)));
|
||||||
|
this.movers.push(mover);
|
||||||
|
this.geometry.vertices.push(mover.position);
|
||||||
|
}
|
||||||
|
this.obj = new THREE.Points(this.geometry, this.material);
|
||||||
|
this.obj.renderOrder = 1;
|
||||||
|
},
|
||||||
|
update: function() {
|
||||||
|
var points_vertices = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < this.movers.length; i++) {
|
||||||
|
var mover = this.movers[i];
|
||||||
|
if (mover.is_active) {
|
||||||
|
mover.applyForce(this.antigravity);
|
||||||
|
mover.updateVelocity();
|
||||||
|
mover.updatePosition();
|
||||||
|
if (mover.position.y > (this.pos.y+5)) {
|
||||||
|
mover.inactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
points_vertices.push(mover.position);
|
||||||
|
}
|
||||||
|
this.obj.geometry.vertices = points_vertices;
|
||||||
|
this.obj.geometry.verticesNeedUpdate = true;
|
||||||
|
},
|
||||||
|
activateMover: function() {
|
||||||
|
var count = 0;
|
||||||
|
let pos = this.pos;
|
||||||
|
for (var i = 0; i < this.movers.length; i++) {
|
||||||
|
var mover = this.movers[i];
|
||||||
|
|
||||||
|
if (mover.is_active) continue;
|
||||||
|
var rad1 = getRadian(Math.log(getRandomInt(200, 256)) / Math.log(256) * 270);
|
||||||
|
var rad2 = getRadian(getRandomInt(0, 360));
|
||||||
|
var force = getSpherical(rad1, rad2, 1);
|
||||||
|
mover.activate();
|
||||||
|
mover.init(new THREE.Vector3((10*Math.random()+pos.x), pos.y+5, (10*Math.random()+pos.z)));
|
||||||
|
mover.applyForce(force);
|
||||||
|
|
||||||
|
count++;
|
||||||
|
if (count >= 10) break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createTexture: function() {
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
var grad = null;
|
||||||
|
|
||||||
|
canvas.width = 200;
|
||||||
|
canvas.height = 200;
|
||||||
|
grad = ctx.createRadialGradient(100, 100, 20, 100, 100, 100);
|
||||||
|
grad.addColorStop(0.2, 'rgba(255, 255, 255, 1)');
|
||||||
|
grad.addColorStop(0.5, 'rgba(255, 255, 255, 0.3)');
|
||||||
|
grad.addColorStop(1.0, 'rgba(255, 255, 255, 0)');
|
||||||
|
ctx.fillStyle = grad;
|
||||||
|
ctx.arc(100, 100, 100, 0, Math.PI / 180, true);
|
||||||
|
ctx.fill();
|
||||||
|
this.texture = new THREE.Texture(canvas);
|
||||||
|
this.texture.minFilter = THREE.NearestFilter;
|
||||||
|
this.texture.needsUpdate = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var HemiLight = function() {
|
||||||
|
this.rad1 = getRadian(60);
|
||||||
|
this.rad2 = getRadian(30);
|
||||||
|
this.range = 1000;
|
||||||
|
this.hex1 = 0xffffff;
|
||||||
|
this.hex2 = 0x333333;
|
||||||
|
this.intensity = 1;
|
||||||
|
this.obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
HemiLight.prototype = {
|
||||||
|
init: function(hex1, hex2) {
|
||||||
|
if (hex1) this.hex1 = hex1;
|
||||||
|
if (hex2) this.hex2 = hex2;
|
||||||
|
this.obj = new THREE.HemisphereLight(this.hex1, this.hex2, this.intensity);
|
||||||
|
this.setPosition();
|
||||||
|
},
|
||||||
|
setPosition: function() {
|
||||||
|
var points = getSpherical(this.rad1, this.rad2, this.range);
|
||||||
|
this.obj.position.copy(points);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function getRandomInt(min, max) {
|
||||||
|
return Math.floor(Math.random() * (max - min)) + min;
|
||||||
|
}
|
||||||
|
function getDegree(radian) {
|
||||||
|
return radian / Math.PI * 180;
|
||||||
|
}
|
||||||
|
function getRadian(degrees) {
|
||||||
|
return degrees * Math.PI / 180;
|
||||||
|
}
|
||||||
|
function getSpherical(rad1, rad2, r) {
|
||||||
|
var x = Math.cos(rad1) * Math.cos(rad2) * r;
|
||||||
|
var z = Math.cos(rad1) * Math.sin(rad2) * r;
|
||||||
|
var y = Math.sin(rad1) * r;
|
||||||
|
return new THREE.Vector3(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function friction(acceleration, mu, normal, mass) {
|
||||||
|
var force = acceleration.clone();
|
||||||
|
if (!normal) normal = 1;
|
||||||
|
if (!mass) mass = 1;
|
||||||
|
force.multiplyScalar(-1);
|
||||||
|
force.normalize();
|
||||||
|
force.multiplyScalar(mu);
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
|
||||||
|
function drag(acceleration, value) {
|
||||||
|
var force = acceleration.clone();
|
||||||
|
force.multiplyScalar(-1);
|
||||||
|
force.normalize();
|
||||||
|
force.multiplyScalar(acceleration.length() * value);
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hook(velocity, anchor, rest_length, k) {
|
||||||
|
var force = velocity.clone().sub(anchor);
|
||||||
|
var distance = force.length() - rest_length;
|
||||||
|
force.normalize();
|
||||||
|
force.multiplyScalar(-1 * k * distance);
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,7 +10,9 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
|||||||
//骨骼动画模型辅助工具
|
//骨骼动画模型辅助工具
|
||||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||||
|
|
||||||
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js';
|
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js';
|
||||||
|
|
||||||
|
import { AccidentManager } from '@/jlmap3d/lesson3dedit/manager/accidentmanager.js';
|
||||||
|
|
||||||
import { TransformControls } from '@/jlmap3d/lesson3dedit/controls/TransformControls';
|
import { TransformControls } from '@/jlmap3d/lesson3dedit/controls/TransformControls';
|
||||||
|
|
||||||
@ -75,6 +77,8 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
//
|
//
|
||||||
scene.add(transcontrol);
|
scene.add(transcontrol);
|
||||||
|
|
||||||
|
let accidentManager = new AccidentManager(scene);
|
||||||
|
accidentManager.initAccident();
|
||||||
|
|
||||||
let assetModelManager = new AssetModelManager(scope,scene);
|
let assetModelManager = new AssetModelManager(scope,scene);
|
||||||
|
|
||||||
@ -85,6 +89,11 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
}else{
|
}else{
|
||||||
assetModelManager.lessonAssetsLoader();
|
assetModelManager.lessonAssetsLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(lessonData.accidentList){
|
||||||
|
accidentManager.loadAccidentList(lessonData.accidentList)
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
assetModelManager.lessonAssetsLoader();
|
assetModelManager.lessonAssetsLoader();
|
||||||
}
|
}
|
||||||
@ -98,6 +107,7 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
render();
|
render();
|
||||||
scope.controls.update();
|
scope.controls.update();
|
||||||
// delta = clock.getDelta();
|
// delta = clock.getDelta();
|
||||||
|
accidentManager.update();
|
||||||
requestAnimationFrame(animate);
|
requestAnimationFrame(animate);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -112,8 +122,11 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
|
|
||||||
this.changeIndex = function(nowIndex){
|
this.changeIndex = function(nowIndex){
|
||||||
lessonIndex = nowIndex;
|
lessonIndex = nowIndex;
|
||||||
|
console.log(lessonData.lessonProgress[lessonIndex]);
|
||||||
scope.nowSceneType = lessonData.lessonProgress[lessonIndex].progressScene;
|
scope.nowSceneType = lessonData.lessonProgress[lessonIndex].progressScene;
|
||||||
assetModelManager.changeSceneGroup(scope.nowSceneType);
|
assetModelManager.changeSceneGroup(scope.nowSceneType);
|
||||||
|
|
||||||
|
accidentManager.changeSceneGroup(scope.nowSceneType);
|
||||||
// if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
|
// if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
|
||||||
// controlManager.initControlMode(lessonIndex);
|
// controlManager.initControlMode(lessonIndex);
|
||||||
// controlManager.initRoleMode(true,nowRole);
|
// controlManager.initRoleMode(true,nowRole);
|
||||||
@ -131,6 +144,7 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
console.log(value2);
|
console.log(value2);
|
||||||
if(type == "changeScene"){
|
if(type == "changeScene"){
|
||||||
assetModelManager.changeSceneGroup(value1);
|
assetModelManager.changeSceneGroup(value1);
|
||||||
|
accidentManager.changeSceneGroup(value1);
|
||||||
scope.nowSceneType = value1;
|
scope.nowSceneType = value1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,10 +169,32 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.createAccident = function(accidentData,mousePos){
|
||||||
|
var mouse = new THREE.Vector2();
|
||||||
|
|
||||||
|
var raycaster = new THREE.Raycaster();
|
||||||
|
|
||||||
|
mouse.x = ( mousePos.x / window.innerWidth ) * 2 - 1;
|
||||||
|
|
||||||
|
mouse.y = - ( mousePos.y / dom.offsetHeight ) * 2 + 1;
|
||||||
|
|
||||||
|
raycaster.setFromCamera(mouse,scope.camerass) // 也可以给构造函数传参的形式写
|
||||||
|
|
||||||
|
var intersects = raycaster.intersectObjects( scene.children,true );
|
||||||
|
|
||||||
|
if(intersects.length>0){
|
||||||
|
accidentManager.createNewAccident(accidentData,intersects[0].point,scope.nowSceneType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.saveAssetModel = function(){
|
this.saveAssetModel = function(){
|
||||||
return assetModelManager.saveModelList();
|
return assetModelManager.saveModelList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.saveAccidentModel = function(){
|
||||||
|
return accidentManager.saveDataList();
|
||||||
|
}
|
||||||
|
|
||||||
this.attachModel = function(selectModel){
|
this.attachModel = function(selectModel){
|
||||||
transcontrol.attach(selectModel);
|
transcontrol.attach(selectModel);
|
||||||
}
|
}
|
||||||
@ -167,4 +203,8 @@ export function Lesson3dEditor(dom,lessonData) {
|
|||||||
transcontrol.detach();
|
transcontrol.detach();
|
||||||
assetModelManager.deleteAsset(selectModel,scope.nowSceneType);
|
assetModelManager.deleteAsset(selectModel,scope.nowSceneType);
|
||||||
}
|
}
|
||||||
|
this.deleteAccident = function(selectAccident){
|
||||||
|
accidentManager.deleteAccident(selectAccident,scope.nowSceneType);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
146
src/jlmap3d/lesson3dedit/manager/accidentmanager.js
Normal file
146
src/jlmap3d/lesson3dedit/manager/accidentmanager.js
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
// import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js';
|
||||||
|
import { Fire } from '@/jlmap3d/lesson3dedit/accident/fire.js';
|
||||||
|
|
||||||
|
export function AccidentManager(scene) {
|
||||||
|
let scope = this;
|
||||||
|
|
||||||
|
this.accidentList = [];
|
||||||
|
|
||||||
|
this.accidentGroup = new THREE.Group();
|
||||||
|
|
||||||
|
//场景中可触发事件模型
|
||||||
|
this.accidentList = [];
|
||||||
|
|
||||||
|
scope.accidentList["standstation"] = [];
|
||||||
|
scope.accidentList["stopstation"] = [];
|
||||||
|
|
||||||
|
scope.accidentList["occ"] = [];
|
||||||
|
|
||||||
|
scope.accidentList["device"] = [];
|
||||||
|
scope.accidentList["xl"] = [];
|
||||||
|
scope.accidentList["dc"] = [];
|
||||||
|
|
||||||
|
let groupList = [];
|
||||||
|
groupList["standstation"] = new THREE.Group();
|
||||||
|
groupList["stopstation"] = new THREE.Group();
|
||||||
|
groupList["occ"] = new THREE.Group();
|
||||||
|
groupList["device"] = new THREE.Group();
|
||||||
|
groupList["xl"] = new THREE.Group();
|
||||||
|
groupList["dc"] = new THREE.Group();
|
||||||
|
|
||||||
|
let updateSceneType = "standstation";
|
||||||
|
|
||||||
|
scene.add(scope.accidentGroup);
|
||||||
|
|
||||||
|
this.initAccident = function(nowSceneType){
|
||||||
|
let accidentData = [
|
||||||
|
{
|
||||||
|
id:'1',
|
||||||
|
name:"火灾",
|
||||||
|
type:"fire"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
jl3dUpdateAccidentData(accidentData);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveDataList = function(){
|
||||||
|
let saveList = [];
|
||||||
|
for(let g in scope.accidentList){
|
||||||
|
for(let i=0;i<scope.accidentList[g].length;i++){
|
||||||
|
if(scope.accidentList[g][i].showType != "default"){
|
||||||
|
saveList.push({
|
||||||
|
id:scope.accidentList[g][i].id,
|
||||||
|
name:scope.accidentList[g][i].name,
|
||||||
|
label:scope.accidentList[g][i].label,
|
||||||
|
type:scope.accidentList[g][i].type,
|
||||||
|
pos:{
|
||||||
|
x:scope.accidentList[g][i].pos.x,
|
||||||
|
y:scope.accidentList[g][i].pos.y,
|
||||||
|
z:scope.accidentList[g][i].pos.z
|
||||||
|
},
|
||||||
|
showType:scope.accidentList[g][i].showType,
|
||||||
|
sceneType:scope.accidentList[g][i].sceneType,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return saveList;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.changeSceneGroup = function(nowSceneType){
|
||||||
|
if(scope.accidentGroup.children.length>0){
|
||||||
|
scope.accidentGroup.remove(scope.accidentGroup.children[0]);
|
||||||
|
}
|
||||||
|
scope.accidentGroup.add(groupList[nowSceneType]);
|
||||||
|
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||||
|
updateSceneType = nowSceneType;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.createNewAccident = function(type,pos,nowSceneType){
|
||||||
|
|
||||||
|
var rand = Math.floor(Math.random () * 900) + 100;
|
||||||
|
|
||||||
|
let newAccident = {
|
||||||
|
id:rand,
|
||||||
|
name:type,
|
||||||
|
label:type+rand,
|
||||||
|
type:type,
|
||||||
|
object:{},
|
||||||
|
pos:pos,
|
||||||
|
sceneType:nowSceneType,
|
||||||
|
showType:"loadModel",
|
||||||
|
};
|
||||||
|
if(type == "fire"){
|
||||||
|
newAccident.object = new Fire();
|
||||||
|
newAccident.object.createNew(groupList[nowSceneType],pos);
|
||||||
|
}
|
||||||
|
scope.accidentList[nowSceneType].push(newAccident);
|
||||||
|
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.deleteAccident = function(selectAccident,nowSceneType){
|
||||||
|
groupList[nowSceneType].remove(selectAccident.object.points.obj);
|
||||||
|
console.log(selectAccident);
|
||||||
|
for(let i=0;i<scope.accidentList[nowSceneType].length;i++){
|
||||||
|
if(scope.accidentList[nowSceneType][i].id == selectAccident.id){
|
||||||
|
scope.accidentList[nowSceneType].splice(i,1);
|
||||||
|
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.loadAccidentList = function(accidentList){
|
||||||
|
console.log(accidentList);
|
||||||
|
for(let i=0;i<accidentList.length;i++){
|
||||||
|
let newAccident = {
|
||||||
|
id:accidentList[i].id,
|
||||||
|
name:accidentList[i].name,
|
||||||
|
label:accidentList[i].label,
|
||||||
|
type:accidentList[i].type,
|
||||||
|
object:{},
|
||||||
|
pos:accidentList[i].pos,
|
||||||
|
sceneType:accidentList[i].sceneType,
|
||||||
|
showType:"loadModel",
|
||||||
|
};
|
||||||
|
if(accidentList[i].type == "fire"){
|
||||||
|
newAccident.object = new Fire();
|
||||||
|
newAccident.object.createNew(groupList[accidentList[i].sceneType],accidentList[i].pos);
|
||||||
|
}
|
||||||
|
scope.accidentList[accidentList[i].sceneType].push(newAccident);
|
||||||
|
// jl3dUpdateAccidentlist(scope.accidentList[accidentList[i].sceneType]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.changeAccidentStatus = function(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.update = function(){
|
||||||
|
for(let i=0;i<scope.accidentList[updateSceneType].length;i++){
|
||||||
|
scope.accidentList[updateSceneType][i].object.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
391
src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js
Normal file
391
src/jlmap3d/lesson3dedit/manager/assetmodelmanager.js
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
|
||||||
|
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
|
||||||
|
export function AssetModelManager(editor,scene) {
|
||||||
|
let scope = this;
|
||||||
|
|
||||||
|
|
||||||
|
this.assetList = [];
|
||||||
|
|
||||||
|
this.otherModel = new THREE.Group();
|
||||||
|
|
||||||
|
//场景中可触发事件模型
|
||||||
|
this.lessonTriggerList = [];
|
||||||
|
|
||||||
|
scope.lessonTriggerList["standstation"] = [];
|
||||||
|
scope.lessonTriggerList["stopstation"] = [];
|
||||||
|
|
||||||
|
scope.lessonTriggerList["occ"] = [];
|
||||||
|
|
||||||
|
scope.lessonTriggerList["device"] = [];
|
||||||
|
scope.lessonTriggerList["xl"] = [];
|
||||||
|
scope.lessonTriggerList["dc"] = [];
|
||||||
|
|
||||||
|
let groupList = [];
|
||||||
|
groupList["standstation"] = new THREE.Group();
|
||||||
|
groupList["stopstation"] = new THREE.Group();
|
||||||
|
groupList["occ"] = new THREE.Group();
|
||||||
|
groupList["device"] = new THREE.Group();
|
||||||
|
groupList["xl"] = new THREE.Group();
|
||||||
|
groupList["dc"] = new THREE.Group();
|
||||||
|
|
||||||
|
let geometryDevice = new THREE.PlaneGeometry( 100, 100, 32 );
|
||||||
|
let materialDevice = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
|
||||||
|
let planeDevice = new THREE.Mesh( geometryDevice, materialDevice );
|
||||||
|
planeDevice.rotation.x = -Math.PI/2;
|
||||||
|
groupList["device"].add(planeDevice);
|
||||||
|
|
||||||
|
let geometryXl = new THREE.PlaneGeometry( 100, 100, 32 );
|
||||||
|
let materialXl = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
|
||||||
|
let planeXl = new THREE.Mesh( geometryXl, materialXl );
|
||||||
|
planeXl.rotation.x = -Math.PI/2;
|
||||||
|
groupList["xl"].add(planeXl);
|
||||||
|
|
||||||
|
|
||||||
|
this.loadAsset = [];
|
||||||
|
|
||||||
|
this.staticAsset = [];
|
||||||
|
scope.staticAsset['station'] = {
|
||||||
|
modelId:'station',
|
||||||
|
packageName:"车站",
|
||||||
|
url:"/MODEL/2021-09-08/211-9861.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'onlineasset',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"standstation",
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.staticAsset['FTDH'] = {
|
||||||
|
modelId:'FTDH',
|
||||||
|
packageName:"电扶梯",
|
||||||
|
url:JL3D_LOCAL_STATIC+"/lesson3d/FTDH.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'static',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"standstation",
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.staticAsset['IN'] = {
|
||||||
|
modelId:'IN',
|
||||||
|
packageName:"进闸机",
|
||||||
|
url:JL3D_LOCAL_STATIC+"/lesson3d/IN.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'static',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"standstation",
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.staticAsset['OUT'] = {
|
||||||
|
modelId:'OUT',
|
||||||
|
packageName:"出闸机",
|
||||||
|
url:JL3D_LOCAL_STATIC+"/lesson3d/OUT.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'static',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"standstation",
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.staticAsset['PBMDH'] = {
|
||||||
|
modelId:'PBMDH',
|
||||||
|
packageName:"屏蔽门",
|
||||||
|
url:JL3D_LOCAL_STATIC+"/lesson3d/PBMDH.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'static',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"standstation",
|
||||||
|
};
|
||||||
|
scope.staticAsset['wxc'] = {
|
||||||
|
modelId:'wxc',
|
||||||
|
packageName:"维修厂",
|
||||||
|
url:"/MODEL/2021-08-12/196-43574.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'onlineasset',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"stopstation",
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.staticAsset['occ'] = {
|
||||||
|
modelId:'occ',
|
||||||
|
packageName:"occ大厅",
|
||||||
|
url:"/MODEL/2021-09-02/210-32471.FBX",
|
||||||
|
mesh:"",
|
||||||
|
assetType:'onlineasset',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:"occ",
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.changeSceneGroup = function(groupType){
|
||||||
|
// console.log(groupType);
|
||||||
|
// console.log(editor.nowSceneType);
|
||||||
|
// console.log(scope.lessonTriggerList[editor.nowSceneType]);
|
||||||
|
editor.nowSceneType = groupType;
|
||||||
|
scene.remove(this.otherModel);
|
||||||
|
this.otherModel = groupList[groupType];
|
||||||
|
scene.add(this.otherModel);
|
||||||
|
updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveModelList = function(){
|
||||||
|
let modelList = {
|
||||||
|
assetList:[],
|
||||||
|
modelList:[],
|
||||||
|
};
|
||||||
|
|
||||||
|
for(let k in scope.loadAsset){
|
||||||
|
modelList.assetList.push({
|
||||||
|
modelId:scope.loadAsset[k].modelId,
|
||||||
|
packageName:scope.loadAsset[k].packageName,
|
||||||
|
url:scope.loadAsset[k].url,
|
||||||
|
assetType:scope.loadAsset[k].assetType,
|
||||||
|
isUse:scope.loadAsset[k].isUse,
|
||||||
|
resourceType:scope.loadAsset[k].resourceType,
|
||||||
|
sceneType:scope.loadAsset[k].sceneType,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let g in scope.lessonTriggerList){
|
||||||
|
for(let i=0;i<scope.lessonTriggerList[g].length;i++){
|
||||||
|
if(scope.lessonTriggerList[g][i].showType != "default"){
|
||||||
|
modelList.modelList.push({
|
||||||
|
name:scope.lessonTriggerList[g][i].name,
|
||||||
|
modelId:scope.lessonTriggerList[g][i].modelId,
|
||||||
|
label:scope.lessonTriggerList[g][i].label,
|
||||||
|
pos:{
|
||||||
|
x:scope.lessonTriggerList[g][i].position.x,
|
||||||
|
y:scope.lessonTriggerList[g][i].position.y,
|
||||||
|
z:scope.lessonTriggerList[g][i].position.z
|
||||||
|
},
|
||||||
|
rot:{
|
||||||
|
x:scope.lessonTriggerList[g][i].rotation.x,
|
||||||
|
y:scope.lessonTriggerList[g][i].rotation.y,
|
||||||
|
z:scope.lessonTriggerList[g][i].rotation.z
|
||||||
|
},
|
||||||
|
showType:scope.lessonTriggerList[g][i].showType,
|
||||||
|
visible:scope.lessonTriggerList[g][i].visible,
|
||||||
|
sceneType:scope.lessonTriggerList[g][i].sceneType,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log(modelList);
|
||||||
|
return modelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//加载课程资源
|
||||||
|
this.lessonAssetsLoader = function(lessonData){
|
||||||
|
let initlist = [];
|
||||||
|
if(lessonData){
|
||||||
|
// scene.remove(this.otherModel);
|
||||||
|
this.otherModel = groupList[lessonData.lessonProgress[0].progressScene];
|
||||||
|
scene.add(this.otherModel);
|
||||||
|
|
||||||
|
let assetList = lessonData.assetList;
|
||||||
|
for(let i = 0;i<assetList.length;i++){
|
||||||
|
assetList[i].mesh = "";
|
||||||
|
// assetList[i].sceneType = "standstation";
|
||||||
|
if(assetList[i].modelId == "default1"){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
scope.loadAsset[assetList[i].modelId] = assetList[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.otherModel = groupList["standstation"];
|
||||||
|
scene.add(this.otherModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let k in scope.staticAsset){
|
||||||
|
initlist.push(fbxpromise(scope.staticAsset[k]));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let k in scope.loadAsset){
|
||||||
|
initlist.push(fbxpromise(scope.loadAsset[k]));
|
||||||
|
}
|
||||||
|
return new Promise(function(resolve, reject){
|
||||||
|
Promise.all(initlist).then((result) => {
|
||||||
|
|
||||||
|
initTriggerList();
|
||||||
|
if(lessonData){
|
||||||
|
let modelList = lessonData.modelList;
|
||||||
|
for(let i=0;i<modelList.length;i++){
|
||||||
|
let newModelTrigger = scope.loadAsset[modelList[i].modelId].mesh.clone(true);
|
||||||
|
// modelList[i].sceneType = "standstation";
|
||||||
|
newModelTrigger.showType = "loadModel";
|
||||||
|
newModelTrigger.label = modelList[i].label;
|
||||||
|
newModelTrigger.modelId = modelList[i].modelId;
|
||||||
|
newModelTrigger.visible = modelList[i].visible;
|
||||||
|
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;
|
||||||
|
newModelTrigger.sceneType = modelList[i].sceneType;
|
||||||
|
scope.lessonTriggerList[modelList[i].sceneType].push(newModelTrigger);
|
||||||
|
groupList[modelList[i].sceneType].add(newModelTrigger);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
editor.changeIndex(0);
|
||||||
|
updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]);
|
||||||
|
|
||||||
|
resolve("loaderassets"); //['成功了', 'success']
|
||||||
|
}).catch((error) => {
|
||||||
|
//console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.deleteAsset = function(selectModel,nowSceneType){
|
||||||
|
scope.otherModel.remove(selectModel);
|
||||||
|
for(let i=0;i<scope.lessonTriggerList[nowSceneType].length;i++){
|
||||||
|
if(scope.lessonTriggerList[nowSceneType][i].uuid == selectModel.uuid){
|
||||||
|
scope.lessonTriggerList[nowSceneType].splice(i,1);
|
||||||
|
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// <el-option label="车站" value="standstation"></el-option>
|
||||||
|
// <el-option label="停车场" value="stopstation"></el-option>
|
||||||
|
// <el-option label="单体设备" value="device"></el-option>
|
||||||
|
// <el-option label="线路" value="xl"></el-option>
|
||||||
|
// <el-option label="道岔" value="dc"></el-option>
|
||||||
|
//FT 扶梯
|
||||||
|
//FTAN 扶梯按钮(急停)
|
||||||
|
//FTD 扶梯灯
|
||||||
|
//FTKG 扶梯开关(钥匙孔)
|
||||||
|
//FTTJ 扶梯台阶
|
||||||
|
function initTriggerList(){
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("FTAN").showType = "default";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("FTAN").label = "扶梯急停按钮";
|
||||||
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTAN"));
|
||||||
|
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("FTKG").showType = "default";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("FTKG").label = "扶梯钥匙孔";
|
||||||
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTKG"));
|
||||||
|
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").showType = "default";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").label = "屏蔽门开关";
|
||||||
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg"));
|
||||||
|
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").showType = "default";
|
||||||
|
scope.staticAsset['station'].mesh.getObjectByName("DMH").label = "隔离门";
|
||||||
|
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("DMH"));
|
||||||
|
|
||||||
|
|
||||||
|
// console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//动态加载资源
|
||||||
|
this.lessonAssetsNewLoader = function(assetData,pos,nowSceneType){
|
||||||
|
let isLoaded = false;
|
||||||
|
var rand = Math.floor(Math.random () * 900) + 100;
|
||||||
|
if(scope.loadAsset[assetData.id]){
|
||||||
|
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||||
|
newModelTrigger.modelId = assetData.id;
|
||||||
|
newModelTrigger.showType = "loadModel";
|
||||||
|
newModelTrigger.label = assetData.packageName +rand;
|
||||||
|
newModelTrigger.position.copy(pos);
|
||||||
|
newModelTrigger.sceneType = nowSceneType;
|
||||||
|
|
||||||
|
scope.lessonTriggerList[nowSceneType].push(newModelTrigger);
|
||||||
|
groupList[nowSceneType].add(newModelTrigger);
|
||||||
|
|
||||||
|
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
|
||||||
|
}else{
|
||||||
|
scope.loadAsset[assetData.id] = {
|
||||||
|
modelId:assetData.id,
|
||||||
|
packageName:assetData.packageName +rand,
|
||||||
|
url:assetData.url,
|
||||||
|
mesh:"",
|
||||||
|
assetType:'loadModel',
|
||||||
|
isUse:true,
|
||||||
|
resourceType:"三维课程",
|
||||||
|
sceneType:nowSceneType,
|
||||||
|
};
|
||||||
|
console.log("new");
|
||||||
|
|
||||||
|
fbxpromise(scope.loadAsset[assetData.id]).then(function(object){
|
||||||
|
|
||||||
|
console.log(scope.loadAsset[assetData.id].mesh);
|
||||||
|
|
||||||
|
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||||
|
newModelTrigger.showType = "loadModel";
|
||||||
|
newModelTrigger.modelId = assetData.id;
|
||||||
|
newModelTrigger.label = assetData.packageName+rand;
|
||||||
|
newModelTrigger.position.copy(pos);
|
||||||
|
newModelTrigger.sceneType = nowSceneType;
|
||||||
|
|
||||||
|
scope.lessonTriggerList[nowSceneType].push(newModelTrigger);
|
||||||
|
groupList[nowSceneType].add(newModelTrigger);
|
||||||
|
|
||||||
|
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
|
||||||
|
// resolve("loadednew");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//fbx模型加载
|
||||||
|
function fbxpromise(asset){
|
||||||
|
return new Promise(function(resolve, reject){
|
||||||
|
var loader = new THREE.FBXLoader();
|
||||||
|
// console.log(asset);
|
||||||
|
// console.log(asset.url);
|
||||||
|
if(asset.assetType == "static"){
|
||||||
|
loader.load( asset.url, function ( object ) {
|
||||||
|
if(asset.sceneType){
|
||||||
|
object.sceneType = asset.sceneType;
|
||||||
|
}
|
||||||
|
asset.mesh = object;
|
||||||
|
groupList[asset.sceneType].add(object);
|
||||||
|
// scope.otherModel.add(object);
|
||||||
|
resolve();
|
||||||
|
} );
|
||||||
|
}else if(asset.assetType == "onlineasset"){
|
||||||
|
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||||
|
if(asset.sceneType){
|
||||||
|
object.sceneType = asset.sceneType;
|
||||||
|
}
|
||||||
|
asset.mesh = object;
|
||||||
|
groupList[asset.sceneType].add(object);
|
||||||
|
|
||||||
|
resolve();
|
||||||
|
} );
|
||||||
|
}else{
|
||||||
|
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||||
|
if(asset.sceneType){
|
||||||
|
object.sceneType = asset.sceneType;
|
||||||
|
}
|
||||||
|
asset.mesh = object;
|
||||||
|
if(asset.assetType == "default"){
|
||||||
|
|
||||||
|
console.log(object);
|
||||||
|
// scene.add(object);
|
||||||
|
}else if(asset.assetType == 'loadModel'){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve();
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -9,6 +9,7 @@ export function LessonData() {
|
|||||||
this.lessonData = {
|
this.lessonData = {
|
||||||
//资源列表
|
//资源列表
|
||||||
assetList:[],
|
assetList:[],
|
||||||
|
accidentList:[],
|
||||||
setup:{
|
setup:{
|
||||||
examMode:"",
|
examMode:"",
|
||||||
checkedRole:"",
|
checkedRole:"",
|
||||||
@ -32,7 +33,7 @@ export function LessonData() {
|
|||||||
roleName:"",
|
roleName:"",
|
||||||
roleUse:true,
|
roleUse:true,
|
||||||
score:0,
|
score:0,
|
||||||
progressScene:"",
|
progressScene:"standstation",
|
||||||
nextCode:"",
|
nextCode:"",
|
||||||
nextNode:"",
|
nextNode:"",
|
||||||
triggerType:"",
|
triggerType:"",
|
||||||
|
@ -102,7 +102,7 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
|
|||||||
.then(function(data){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
//console.log(assetloader);
|
//console.log(assetloader);
|
||||||
console.log(stationstandlist);
|
// console.log(stationstandlist);
|
||||||
return tdt.initTdt(stationstandlist.list,mapdata.sectionList,rails.sectionrail,sceneload);
|
return tdt.initTdt(stationstandlist.list,mapdata.sectionList,rails.sectionrail,sceneload);
|
||||||
})
|
})
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
|
@ -36,11 +36,11 @@ export function TdtList() {
|
|||||||
let pos = stationData[k].mesh.position;
|
let pos = stationData[k].mesh.position;
|
||||||
if(stationData[k].stands[i].right == true){
|
if(stationData[k].stands[i].right == true){
|
||||||
newmesh.rotation.y = -Math.PI/2;
|
newmesh.rotation.y = -Math.PI/2;
|
||||||
newmesh.position.set(pos.x+75,0,pos.z+14.8);
|
newmesh.position.set(pos.x+75,0,pos.z+12.8);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
newmesh.rotation.y = Math.PI/2;
|
newmesh.rotation.y = Math.PI/2;
|
||||||
newmesh.position.set(pos.x-75,0,pos.z-14.8);
|
newmesh.position.set(pos.x-75,0,pos.z-12.8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,7 @@ deviceState[deviceType.Switch] = {
|
|||||||
blockade: 0, // 是否封锁
|
blockade: 0, // 是否封锁
|
||||||
routeLock: 0, // 是否进路锁闭
|
routeLock: 0, // 是否进路锁闭
|
||||||
overlapLock: 0, // 是否进路延续保护锁闭
|
overlapLock: 0, // 是否进路延续保护锁闭
|
||||||
normalPosition: 1, // 是否定位
|
pos:'N', // // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
reversePosition: 0, // 是否反位
|
|
||||||
isCiConfirm: 0, // 是否进行联锁确认
|
isCiConfirm: 0, // 是否进行联锁确认
|
||||||
/** 定位状态*/
|
/** 定位状态*/
|
||||||
// locateType: {
|
// locateType: {
|
||||||
@ -72,9 +71,7 @@ deviceState[deviceType.Switch] = {
|
|||||||
deviceState[deviceType.Signal] = {
|
deviceState[deviceType.Signal] = {
|
||||||
blockade: 0, // 是否锁闭
|
blockade: 0, // 是否锁闭
|
||||||
logicLight: 0, // 逻辑点灯
|
logicLight: 0, // 逻辑点灯
|
||||||
greenOpen: 0, // 绿灯开放
|
aspect:'R', // 信号机颜色默认状态
|
||||||
yellowOpen: 0, // 黄灯开放
|
|
||||||
redOpen: 1, // 红灯开放(默认状态)
|
|
||||||
delayTime: 0, // 信号机延迟解锁倒计时
|
delayTime: 0, // 信号机延迟解锁倒计时
|
||||||
atsControl: 1, // 0是人工,1是自动
|
atsControl: 1, // 0是人工,1是自动
|
||||||
checkConflict:0, // 0是不检查冲突,1是检测冲突(检测冲突进路)
|
checkConflict:0, // 0是不检查冲突,1是检测冲突(检测冲突进路)
|
||||||
|
@ -45,8 +45,7 @@ class Status {
|
|||||||
blockade: device.blockade, // 是否封锁
|
blockade: device.blockade, // 是否封锁
|
||||||
routeLock: device.routeLock, // 是否进路锁闭
|
routeLock: device.routeLock, // 是否进路锁闭
|
||||||
overlapLock: device.overlapLock, // 是否进路延续保护锁闭
|
overlapLock: device.overlapLock, // 是否进路延续保护锁闭
|
||||||
normalPosition: device.normalPosition, // 是否定位
|
pos:device.pos, // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
reversePosition: device.reversePosition, // 是否反位
|
|
||||||
fault: device.fault /** 非故障*/
|
fault: device.fault /** 非故障*/
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -56,9 +55,7 @@ class Status {
|
|||||||
atsControl: device.atsControl, /** 0是人工控制,1是自动控制 */
|
atsControl: device.atsControl, /** 0是人工控制,1是自动控制 */
|
||||||
blockade: device.blockade,
|
blockade: device.blockade,
|
||||||
logicLight: device.logicLight,
|
logicLight: device.logicLight,
|
||||||
greenOpen: device.greenOpen,
|
aspect:device.aspect, // 信号机颜色默认状态 R-红 G-绿 Y-黄 W-月白 B-蓝 RY-红黄 RW-红白 GG-绿绿 GY-绿黄 YY-黄黄 RF-红闪 YF-黄闪 GF-绿闪 WF-白闪
|
||||||
redOpen: device.redOpen,
|
|
||||||
yellowOpen: device.yellowOpen,
|
|
||||||
ciControl: device.ciControl || 0,
|
ciControl: device.ciControl || 0,
|
||||||
canSetCi: !!device.canSetCi
|
canSetCi: !!device.canSetCi
|
||||||
};
|
};
|
||||||
|
@ -37,6 +37,9 @@ class Jlmap {
|
|||||||
// 设备数据
|
// 设备数据
|
||||||
this.mapDevice = {};
|
this.mapDevice = {};
|
||||||
|
|
||||||
|
// 大屏配置
|
||||||
|
this.splitList = [];
|
||||||
|
|
||||||
// 默认状态
|
// 默认状态
|
||||||
this.defaultStateDict = this.loadDefaultState();
|
this.defaultStateDict = this.loadDefaultState();
|
||||||
|
|
||||||
@ -143,6 +146,7 @@ class Jlmap {
|
|||||||
setOptions(opts) {
|
setOptions(opts) {
|
||||||
const options = this.pullBack(opts);
|
const options = this.pullBack(opts);
|
||||||
if (this.screenFlag) {
|
if (this.screenFlag) {
|
||||||
|
this.$options.update(options);
|
||||||
this.$painter.updateScreen(options);
|
this.$painter.updateScreen(options);
|
||||||
} else {
|
} else {
|
||||||
this.$options.update(options);
|
this.$options.update(options);
|
||||||
@ -216,8 +220,6 @@ class Jlmap {
|
|||||||
setUpdateScreen(opts) {
|
setUpdateScreen(opts) {
|
||||||
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
||||||
this.screenFlag = true;
|
this.screenFlag = true;
|
||||||
const screenList = [];
|
|
||||||
const rectList = [];
|
|
||||||
let rect = '';
|
let rect = '';
|
||||||
for (const i in this.mapDevice) {
|
for (const i in this.mapDevice) {
|
||||||
const element = this.mapDevice[i];
|
const element = this.mapDevice[i];
|
||||||
@ -233,31 +235,56 @@ class Jlmap {
|
|||||||
opts.offsetList = [];
|
opts.offsetList = [];
|
||||||
}
|
}
|
||||||
const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit;
|
const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit;
|
||||||
const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160;
|
this.splitList = JSON.parse(JSON.stringify(screenSplit));
|
||||||
const splitList = JSON.parse(JSON.stringify(screenSplit));
|
|
||||||
const num = screenSplit.length + 1;
|
const num = screenSplit.length + 1;
|
||||||
const offsetY = (opts.height - 100) / num; // 高度差
|
|
||||||
const maxWidth = rect.width;
|
const maxWidth = rect.width;
|
||||||
splitList.push(maxWidth);
|
this.splitList.push(maxWidth);
|
||||||
const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
|
const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
|
||||||
const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
|
const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
|
||||||
const scale = Math.min(scaleX, scaleY);
|
this.screenScale = Math.min(scaleX, scaleY);
|
||||||
|
|
||||||
for (let i = 0; i < splitList.length; i++) {
|
this.optsWidth = opts.width;
|
||||||
|
this.optsHeight = opts.height;
|
||||||
|
this.optsOffsetList = opts.offsetList;
|
||||||
|
|
||||||
|
const scaleBili = this.screenScale;
|
||||||
|
|
||||||
|
this.$options.scaleRate = this.screenScale || 1;
|
||||||
|
this.$options.scaleIndex = 0;
|
||||||
|
this.$options.offsetX = 0;
|
||||||
|
this.$options.offsetY = 0;
|
||||||
|
// 更新视图大小
|
||||||
|
// this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||||
|
|
||||||
|
const {screenList, rectList} = this.calculateScreenPosition(scaleBili);
|
||||||
|
this.$painter.updateTransform1(screenList, rectList);
|
||||||
|
}
|
||||||
|
|
||||||
|
calculateScreenPosition(scaleBili) {
|
||||||
|
const screenList = [];
|
||||||
|
const rectList = [];
|
||||||
|
const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160;
|
||||||
|
const bili = scaleBili / this.screenScale;
|
||||||
|
const offsetY = (this.optsHeight - 100) / this.splitList.length; // 高度差
|
||||||
|
|
||||||
|
for (let i = 0; i < this.splitList.length; i++) {
|
||||||
let offsetX = '';
|
let offsetX = '';
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
offsetX = -(opts.width - splitList[0] * scale) / 2;
|
offsetX = -(this.optsWidth - this.splitList[0] * scaleBili) / 2;
|
||||||
} else {
|
} else {
|
||||||
const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值
|
const dx = (this.optsWidth - (this.splitList[i] - this.splitList[i - 1]) * scaleBili) / 2; // 居中计算偏移值
|
||||||
offsetX = splitList[i - 1] * scale - dx;
|
offsetX = this.splitList[i - 1] * scaleBili - dx;
|
||||||
}
|
}
|
||||||
const offset = opts.offsetList[i] || 0;
|
const offset = this.optsOffsetList[i] || 0;
|
||||||
const param = { scaleRateX: scale, scaleRateY: scale, offsetX: offsetX, offsetY: -screenDifference - (offsetY * i) - offset };
|
const param = { scaleRateX: scaleBili, scaleRateY: scaleBili, offsetX: offsetX, offsetY: (-screenDifference - (offsetY * i) - offset) * bili };
|
||||||
screenList.push(param);
|
screenList.push(param);
|
||||||
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height};
|
const rect = {x: 0, y: 0, width: Number(this.splitList[i]) + 5, height: this.optsHeight};
|
||||||
rectList.push(rect);
|
rectList.push(rect);
|
||||||
}
|
}
|
||||||
this.$painter.updateTransform1(screenList, rectList);
|
return {
|
||||||
|
screenList,
|
||||||
|
rectList
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
setLevelVisible(list) {
|
setLevelVisible(list) {
|
||||||
|
@ -225,6 +225,11 @@ class Painter {
|
|||||||
this.screenFlag = true;
|
this.screenFlag = true;
|
||||||
this.$transformHandleScreen.updateTransform(list, opts);
|
this.$transformHandleScreen.updateTransform(list, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateScreenZoom(bili) {
|
||||||
|
return this.$jmap.calculateScreenPosition(bili);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新zrender尺寸
|
* 更新zrender尺寸
|
||||||
* @param {*} opt
|
* @param {*} opt
|
||||||
|
@ -93,12 +93,12 @@ export default class EBadShunt extends Group {
|
|||||||
|
|
||||||
if (swch && swch.instance) {
|
if (swch && swch.instance) {
|
||||||
const traingle = new JTriangle(swch.intersection, swch.skew);
|
const traingle = new JTriangle(swch.intersection, swch.skew);
|
||||||
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
|
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
|
||||||
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||||
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
|
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
|
||||||
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||||
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
||||||
}
|
}
|
||||||
|
@ -93,12 +93,12 @@ export default class ELimitLines extends Group {
|
|||||||
|
|
||||||
if (swch && swch.instance) {
|
if (swch && swch.instance) {
|
||||||
const traingle = new JTriangle(swch.intersection, swch.skew);
|
const traingle = new JTriangle(swch.intersection, swch.skew);
|
||||||
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
|
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
|
||||||
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||||
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
|
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
|
||||||
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||||
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
||||||
}
|
}
|
||||||
|
@ -388,17 +388,18 @@ export default class Section extends Group {
|
|||||||
const sectionB = this.mapDevice[switchModel.sectionBCode];
|
const sectionB = this.mapDevice[switchModel.sectionBCode];
|
||||||
const sectionC = this.mapDevice[switchModel.sectionCCode];
|
const sectionC = this.mapDevice[switchModel.sectionCCode];
|
||||||
const sectionA = this.mapDevice[switchModel.sectionACode];
|
const sectionA = this.mapDevice[switchModel.sectionACode];
|
||||||
if (switchModel && switchModel.normalPosition === 1) {
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
|
if (switchModel && switchModel.pos === 'N') {
|
||||||
this.setSwitchSectionColor(sectionC, sectionB);// 定位
|
this.setSwitchSectionColor(sectionC, sectionB);// 定位
|
||||||
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
|
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
|
||||||
this.setSwitchSectionColor(sectionC, sectionB);// 反位转定位前
|
this.setSwitchSectionColor(sectionC, sectionB);// 反位转定位前
|
||||||
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
|
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
|
||||||
this.setSwitchSectionColor(sectionC, sectionB);// 定位变失表或定位失表
|
this.setSwitchSectionColor(sectionC, sectionB);// 定位变失表或定位失表
|
||||||
} else if (switchModel && switchModel.reversePosition === 1) {
|
} else if (switchModel && switchModel.pos === 'R') {
|
||||||
this.setSwitchSectionColor(sectionB, sectionC); // 反位
|
this.setSwitchSectionColor(sectionB, sectionC); // 反位
|
||||||
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
|
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
|
||||||
this.setSwitchSectionColor(sectionB, sectionC); // 定位转反位前
|
this.setSwitchSectionColor(sectionB, sectionC); // 定位转反位前
|
||||||
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
|
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
|
||||||
this.setSwitchSectionColor(sectionB, sectionC);// 反位变失表后反位失表
|
this.setSwitchSectionColor(sectionB, sectionC);// 反位变失表后反位失表
|
||||||
}
|
}
|
||||||
if (this.style.Section.switchFault && switchModel.fault === 'SQUEEZE') {
|
if (this.style.Section.switchFault && switchModel.fault === 'SQUEEZE') {
|
||||||
|
@ -826,8 +826,6 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
if (this.style.Signal.post.autoRouteColor) {
|
if (this.style.Signal.post.autoRouteColor) {
|
||||||
this.sigPost.setColor(this.style.Signal.post.autoRouteColor);
|
this.sigPost.setColor(this.style.Signal.post.autoRouteColor);
|
||||||
} else if (this.style.Signal.post.autoRouteVerColor) {
|
|
||||||
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,10 +964,32 @@ class Signal extends Group {
|
|||||||
model.isRouteSignal && this.setLowButtonShow();
|
model.isRouteSignal && this.setLowButtonShow();
|
||||||
|
|
||||||
/** 设置灯的颜色 */
|
/** 设置灯的颜色 */
|
||||||
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
|
switch (model.aspect) {
|
||||||
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
|
// 红
|
||||||
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
|
case 'R': {
|
||||||
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
|
this.close(model.logicLight); // 信号关闭
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 绿
|
||||||
|
case 'G': {
|
||||||
|
this.openPositive(model.logicLight); // 信号正向开放
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 黄
|
||||||
|
case 'Y': {
|
||||||
|
this.openLateral(model.logicLight); // 信号侧向开放
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 红黄
|
||||||
|
case 'RY': {
|
||||||
|
this.guid(); // 引导信号显示
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (model.remainTime) {
|
if (model.remainTime) {
|
||||||
this.showRemainTime(model.remainTime);
|
this.showRemainTime(model.remainTime);
|
||||||
} else {
|
} else {
|
||||||
@ -1034,12 +1054,15 @@ class Signal extends Group {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// LEVEL_Close = 0;---关闭 LEVEL_Guide = 1;-----引导级 LEVEL_Atp = 2;-----ATP级 LEVEL_Main = 3-----主信号级
|
||||||
if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor && !model.fleetMode) {
|
if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor && !model.fleetMode) {
|
||||||
this.sigPost.setVerColor(this.style.Signal.post.mainSignalVerColor);
|
this.sigPost.setVerColor(this.style.Signal.post.mainSignalVerColor);
|
||||||
} else if (model.level === 1 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
|
} else if (model.level === 0 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
|
||||||
this.sigPost.setVerColor(this.style.Signal.post.closeSignalVerColor);
|
this.sigPost.setVerColor(this.style.Signal.post.closeSignalVerColor);
|
||||||
} else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
|
} else if (model.level === 1 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
|
||||||
this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor);
|
this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor);
|
||||||
|
} else if (model.level === 2 && this.style.Signal.post.autoRouteVerColor && !model.fleetMode) {
|
||||||
|
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.style.Signal.lamp.special) {
|
if (this.style.Signal.lamp.special) {
|
||||||
@ -1059,7 +1082,7 @@ class Signal extends Group {
|
|||||||
this.tText && this.tText.show();
|
this.tText && this.tText.show();
|
||||||
}
|
}
|
||||||
// 设置灰显
|
// 设置灰显
|
||||||
if (model.noStatus || model.level === 0) {
|
if (model.noStatus) {
|
||||||
this.setAshShow();
|
this.setAshShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,22 +77,22 @@ class EMouse extends Group {
|
|||||||
});
|
});
|
||||||
this.textRect && this.textRect.show();
|
this.textRect && this.textRect.show();
|
||||||
|
|
||||||
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
|
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
|
||||||
this.device.shapeModelA.show();
|
this.device.shapeModelA.show();
|
||||||
this.device.shapeModelB.show();
|
this.device.shapeModelB.show();
|
||||||
this.device.shapeModelA.removeHover();
|
this.device.shapeModelA.removeHover();
|
||||||
this.device.shapeModelB.removeHover();
|
this.device.shapeModelB.removeHover();
|
||||||
this.device.shapeModelA.addHover({
|
this.device.shapeModelA.addHover({
|
||||||
stroke: this.device.__over
|
stroke: this.device.__over
|
||||||
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
|
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
|
||||||
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
|
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
|
||||||
})
|
});
|
||||||
this.device.shapeModelB.addHover({
|
this.device.shapeModelB.addHover({
|
||||||
stroke: this.device.__over
|
stroke: this.device.__over
|
||||||
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
|
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
|
||||||
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
|
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||||
@ -102,33 +102,34 @@ class EMouse extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseout(e) {
|
mouseout(e) {
|
||||||
if (!this.device.__down) {
|
if (!this.device.__down) {
|
||||||
this.switchBorder && this.switchBorder.hide();
|
this.switchBorder && this.switchBorder.hide();
|
||||||
this.device.setTextStyle({
|
this.device.setTextStyle({
|
||||||
textFill: this.device.style.backgroundColor
|
textFill: this.device.style.backgroundColor
|
||||||
});
|
});
|
||||||
this.textRect && this.textRect.hide();
|
this.textRect && this.textRect.hide();
|
||||||
this.device.setState(this.device.model);
|
this.device.setState(this.device.model);
|
||||||
|
|
||||||
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
|
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
|
||||||
this.device.shapeModelA.removeHover();
|
this.device.shapeModelA.removeHover();
|
||||||
this.device.shapeModelB.removeHover();
|
this.device.shapeModelB.removeHover();
|
||||||
if (this.device.model.normalPosition) {
|
// if (this.device.model.normalPosition) {
|
||||||
this.device.shapeModelA.hide();
|
if (this.device.model.pos == 'N') {
|
||||||
this.device.shapeModelB.show();
|
this.device.shapeModelA.hide();
|
||||||
} else {
|
this.device.shapeModelB.show();
|
||||||
this.device.shapeModelA.show();
|
} else {
|
||||||
this.device.shapeModelB.show();
|
this.device.shapeModelA.show();
|
||||||
}
|
this.device.shapeModelB.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||||
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
||||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||||
instance.mouseEvent.mouseLeave(e);
|
instance.mouseEvent.mouseLeave(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,15 +433,17 @@ export default class Switch extends Group {
|
|||||||
.when(1000, { stroke: this.style.backgroundColor })
|
.when(1000, { stroke: this.style.backgroundColor })
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
setSwitchFault(fault, normalPosition, reversePosition) {
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
if (this.style.Switch.jointImg.faultStatus && fault && !reversePosition && !normalPosition ) { // 宁波线失表状态
|
setSwitchFault(fault, pos) {
|
||||||
this.setForkAction(); // 道岔挤岔
|
if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态
|
||||||
|
this.setForkAction(fault); // 道岔挤岔
|
||||||
} else if (this.style.Switch.faultNoHandle ) {
|
} else if (this.style.Switch.faultNoHandle ) {
|
||||||
this.shapeModelA.hide();
|
this.shapeModelA.hide();
|
||||||
this.shapeModelB.hide();
|
this.shapeModelB.hide();
|
||||||
this.shapeModelC.hide();
|
this.shapeModelC.hide();
|
||||||
} else {
|
} else {
|
||||||
if (this.model.switchFaultCode && (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))) {
|
// (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
|
||||||
|
if (this.model.switchFaultCode && (pos == 'NO' || pos == 'EX') ) {
|
||||||
const switchFault = this.mapDevice[this.model.switchFaultCode];
|
const switchFault = this.mapDevice[this.model.switchFaultCode];
|
||||||
switchFault.instance.setControlColor('#F00', true);
|
switchFault.instance.setControlColor('#F00', true);
|
||||||
} else if (this.model.switchFaultCode) {
|
} else if (this.model.switchFaultCode) {
|
||||||
@ -455,7 +457,7 @@ export default class Switch extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 挤叉*/
|
/** 挤叉*/
|
||||||
setForkAction() {
|
setForkAction(fault) {
|
||||||
if (this.style.Switch.jointImg.fork) {
|
if (this.style.Switch.jointImg.fork) {
|
||||||
this.recover();
|
this.recover();
|
||||||
this.shapeModelB.show();
|
this.shapeModelB.show();
|
||||||
@ -483,11 +485,13 @@ export default class Switch extends Group {
|
|||||||
.start();
|
.start();
|
||||||
});
|
});
|
||||||
this.setTextColor('red');
|
this.setTextColor('red');
|
||||||
|
} else {
|
||||||
|
this.setLossAction(fault); // 若不是具有特殊的挤岔,则显示状态和失表一样
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单锁*/
|
/** 单锁*/
|
||||||
setMonolock(normalPosition, reversePosition) {
|
setMonolock(pos) {
|
||||||
if (this.style.Switch.rectLock &&
|
if (this.style.Switch.rectLock &&
|
||||||
this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示
|
this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示
|
||||||
this.lockRect.show();
|
this.lockRect.show();
|
||||||
@ -503,9 +507,9 @@ export default class Switch extends Group {
|
|||||||
if (this.style.Switch.arcBlcok &&
|
if (this.style.Switch.arcBlcok &&
|
||||||
this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示
|
this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示
|
||||||
this.lockArc.show();
|
this.lockArc.show();
|
||||||
if (normalPosition) {
|
if (pos == 'N') {
|
||||||
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor });
|
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor });
|
||||||
} else if (reversePosition) {
|
} else if (pos == 'R') {
|
||||||
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
|
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -513,7 +517,7 @@ export default class Switch extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 封锁 */
|
/** 封锁 */
|
||||||
block(normalPosition, reversePosition) {
|
block(pos) {
|
||||||
if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示
|
if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示
|
||||||
this.shapeModelB.show();
|
this.shapeModelB.show();
|
||||||
this.shapeModelB.animateStyle(item => {
|
this.shapeModelB.animateStyle(item => {
|
||||||
@ -547,10 +551,10 @@ export default class Switch extends Group {
|
|||||||
this.setTextColor(this.style.Switch.text.blockText);
|
this.setTextColor(this.style.Switch.text.blockText);
|
||||||
}
|
}
|
||||||
if (this.style.Switch.jointImg.trapezoidBlock) { // 范围且封锁时显示
|
if (this.style.Switch.jointImg.trapezoidBlock) { // 范围且封锁时显示
|
||||||
if (normalPosition) {
|
if ( pos == 'N') {
|
||||||
this.shapeModelB.show();
|
this.shapeModelB.show();
|
||||||
this.shapeModelB.setColor('#000080');
|
this.shapeModelB.setColor('#000080');
|
||||||
} else if (reversePosition) {
|
} else if ( pos == 'R') {
|
||||||
this.shapeModelA.show();
|
this.shapeModelA.show();
|
||||||
this.shapeModelA.setColor('#000080');
|
this.shapeModelA.setColor('#000080');
|
||||||
}
|
}
|
||||||
@ -600,11 +604,11 @@ export default class Switch extends Group {
|
|||||||
// 处理岔芯颜色
|
// 处理岔芯颜色
|
||||||
setSectionState(state) {
|
setSectionState(state) {
|
||||||
const sectionC = this.mapDevice[state.sectionCCode];
|
const sectionC = this.mapDevice[state.sectionCCode];
|
||||||
if (sectionC && state.reversePosition && !state.blockade) {
|
if (sectionC && state.pos == 'R' & !state.blockade) {
|
||||||
this.setSwitchModelStatus(this.shapeModelA, sectionC);
|
this.setSwitchModelStatus(this.shapeModelA, sectionC);
|
||||||
}
|
}
|
||||||
const sectionA = this.mapDevice[state.sectionACode];
|
const sectionA = this.mapDevice[state.sectionACode];
|
||||||
if (sectionA && state.normalPosition && !this.style.Switch.core.graphShow && !state.blockade) {
|
if (sectionA && state.pos == 'N' && !this.style.Switch.core.graphShow && !state.blockade) {
|
||||||
this.setSwitchModelStatus(this.shapeModelB, sectionA);
|
this.setSwitchModelStatus(this.shapeModelB, sectionA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -650,23 +654,23 @@ export default class Switch extends Group {
|
|||||||
this.shapeModelC.setColor('#7F7F7F');
|
this.shapeModelC.setColor('#7F7F7F');
|
||||||
this.name.getNameText().setStyle({textFill: '#7F7F7F'});
|
this.name.getNameText().setStyle({textFill: '#7F7F7F'});
|
||||||
}
|
}
|
||||||
preReset(normalPosition, reversePosition ) {
|
preReset(pos) {
|
||||||
const coverBlock = this.style.Switch.coverBlock;
|
const coverBlock = this.style.Switch.coverBlock;
|
||||||
if (coverBlock && coverBlock.preResetColor) { // 范围且封锁时显示
|
if (coverBlock && coverBlock.preResetColor) { // 范围且封锁时显示
|
||||||
if (normalPosition) {
|
if (pos == 'N') {
|
||||||
this.shapeModelB.show();
|
this.shapeModelB.show();
|
||||||
this.shapeModelB.setColor(coverBlock.preResetColor);
|
this.shapeModelB.setColor(coverBlock.preResetColor);
|
||||||
} else if (reversePosition) {
|
} else if (pos == 'R') {
|
||||||
this.shapeModelA.show();
|
this.shapeModelA.show();
|
||||||
this.shapeModelA.setColor(coverBlock.preResetColor);
|
this.shapeModelA.setColor(coverBlock.preResetColor);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const sectionReset = this.style.Section.sectionMiddle;
|
const sectionReset = this.style.Section.sectionMiddle;
|
||||||
if (sectionReset && sectionReset.preResetColor) {
|
if (sectionReset && sectionReset.preResetColor) {
|
||||||
if (normalPosition) {
|
if (pos == 'N') {
|
||||||
this.shapeModelB.show();
|
this.shapeModelB.show();
|
||||||
this.shapeModelB.setColor(sectionReset.preResetColor);
|
this.shapeModelB.setColor(sectionReset.preResetColor);
|
||||||
} else if (reversePosition) {
|
} else if (pos == 'R') {
|
||||||
this.shapeModelA.show();
|
this.shapeModelA.show();
|
||||||
this.shapeModelA.setColor(sectionReset.preResetColor);
|
this.shapeModelA.setColor(sectionReset.preResetColor);
|
||||||
}
|
}
|
||||||
@ -678,13 +682,13 @@ export default class Switch extends Group {
|
|||||||
this.recover();
|
this.recover();
|
||||||
// 只响应前端自定义类型的状态变化
|
// 只响应前端自定义类型的状态变化
|
||||||
if (model._free) {
|
if (model._free) {
|
||||||
if (model.normalPosition) {
|
if (model.pos == 'N') {
|
||||||
this.switchPosition = 'normal';
|
this.switchPosition = 'normal';
|
||||||
this.setLocationAction(model); /** 定位*/
|
this.setLocationAction(model); /** 定位*/
|
||||||
if (model.routeLock) {
|
if (model.routeLock) {
|
||||||
this.setSectionState(model);
|
this.setSectionState(model);
|
||||||
}
|
}
|
||||||
} else if (model.reversePosition) {
|
} else if (model.pos == 'R') {
|
||||||
this.switchPosition = 'reverse';
|
this.switchPosition = 'reverse';
|
||||||
this.setInversionAction(model); /** 反位*/
|
this.setInversionAction(model); /** 反位*/
|
||||||
if (model.routeLock) {
|
if (model.routeLock) {
|
||||||
@ -694,23 +698,26 @@ export default class Switch extends Group {
|
|||||||
this.setAshShow();
|
this.setAshShow();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
|
this.setSwitchFault(model.fault, model.pos);
|
||||||
if (model.normalPosition) {
|
|
||||||
|
// model.pos == 'NO' || model.pos == 'EX';
|
||||||
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
|
|
||||||
|
if (model.pos == 'N') {
|
||||||
this.switchPosition = 'normal';
|
this.switchPosition = 'normal';
|
||||||
this.setLocationAction(model); /** 定位*/
|
this.setLocationAction(model); /** 定位*/
|
||||||
} else if (model.reversePosition) {
|
} else if (model.pos == 'R') {
|
||||||
this.switchPosition = 'reverse';
|
this.switchPosition = 'reverse';
|
||||||
this.setInversionAction(model); /** 反位*/
|
this.setInversionAction(model); /** 反位*/
|
||||||
} else {
|
} else if (model.pos == 'NO') {
|
||||||
this.setLossAction(model.fault); // 失去
|
this.setLossAction(model.fault); // 失去
|
||||||
if (model.switchSplit) {
|
} else if (model.pos == 'EX') {
|
||||||
this.setForkAction();
|
this.setForkAction(model.fault); // 挤岔
|
||||||
}
|
|
||||||
}
|
}
|
||||||
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
||||||
|
|
||||||
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
|
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
|
||||||
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
|
model.blockade && this.block(model.pos); // 道岔封锁
|
||||||
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
|
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (!path.includes('/map/draw')) {
|
if (!path.includes('/map/draw')) {
|
||||||
@ -720,7 +727,7 @@ export default class Switch extends Group {
|
|||||||
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
|
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
|
||||||
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
|
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
|
||||||
// this.interlockingReserved(); // 联锁预留道岔
|
// this.interlockingReserved(); // 联锁预留道岔
|
||||||
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
|
model.preReset && this.preReset(model.pos); // 道岔预复位
|
||||||
|
|
||||||
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
|
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
|
||||||
const switchModel = this.mapDevice[model.code];
|
const switchModel = this.mapDevice[model.code];
|
||||||
|
@ -243,7 +243,7 @@ export default {
|
|||||||
}
|
}
|
||||||
case OperationEvent.Signal.reopenSignal.button.operation: {
|
case OperationEvent.Signal.reopenSignal.button.operation: {
|
||||||
// 信号重开
|
// 信号重开
|
||||||
if (selectType.greenOpen) {
|
if (selectType.aspect == 'G') { // 绿灯开放
|
||||||
this.$refs.noticeInfo.doShow(`信号机[${selectType.name}(${selectType.code})]已开启,无需重开信号机`);
|
this.$refs.noticeInfo.doShow(`信号机[${selectType.name}(${selectType.code})]已开启,无需重开信号机`);
|
||||||
} else {
|
} else {
|
||||||
// 开放进路信号机因故关闭
|
// 开放进路信号机因故关闭
|
||||||
|
@ -173,14 +173,14 @@ export default {
|
|||||||
switch (buttonOperation) {
|
switch (buttonOperation) {
|
||||||
case OperationEvent.Switch.locate.button.operation: {
|
case OperationEvent.Switch.locate.button.operation: {
|
||||||
// 道岔总定
|
// 道岔总定
|
||||||
if (!selectType.normalPosition && selectType.reversePosition) {
|
if (selectType.pos == 'R') {
|
||||||
this.locate(selectType);
|
this.locate(selectType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OperationEvent.Switch.reverse.button.operation: {
|
case OperationEvent.Switch.reverse.button.operation: {
|
||||||
// 道岔总反
|
// 道岔总反
|
||||||
if (selectType.normalPosition && !selectType.reversePosition) {
|
if (selectType.pos == 'N') {
|
||||||
this.reverse(selectType);
|
this.reverse(selectType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -316,7 +316,7 @@ export default {
|
|||||||
},
|
},
|
||||||
checkRoutes(routes) {
|
checkRoutes(routes) {
|
||||||
const route = routes.filter(route => {
|
const route = routes.filter(route => {
|
||||||
return route.greenOpen;
|
return route.aspect == 'G';
|
||||||
});
|
});
|
||||||
return route[0].code;
|
return route[0].code;
|
||||||
},
|
},
|
||||||
|
@ -222,7 +222,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
passWordCommit(data) {
|
passWordCommit(data) {
|
||||||
let operate = {};
|
let operate = {};
|
||||||
if (data.overNext) {
|
if (data.overNext) {
|
||||||
operate = {
|
operate = {
|
||||||
over: true,
|
over: true,
|
||||||
code: data.code,
|
code: data.code,
|
||||||
@ -348,7 +348,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果该信号机红灯亮 而且 所属区段左右两侧区段锁闭 执行信号重启操作
|
// 如果该信号机红灯亮 而且 所属区段左右两侧区段锁闭 执行信号重启操作
|
||||||
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { // 信号重启
|
if (signal.aspect == 'R' && isArrangementRoute) { // 信号重启
|
||||||
operate.over = true;
|
operate.over = true;
|
||||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
|
||||||
operate.code = deviceList[0].code;
|
operate.code = deviceList[0].code;
|
||||||
@ -538,7 +538,7 @@ export default {
|
|||||||
this.deviceList = [];
|
this.deviceList = [];
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
operate['operateNext'] = this.Command.close.password.operation;
|
||||||
operate['operation'] = this.Command.close.password.operation;
|
operate['operation'] = this.Command.close.password.operation;
|
||||||
this.$refs.password.doShow(operate);
|
this.$refs.password.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
@ -550,7 +550,7 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
code: deviceList[1].code,
|
code: deviceList[1].code,
|
||||||
cmdType: this.cmdType,
|
cmdType: this.cmdType,
|
||||||
operation: this.$store.state.menuOperation.buttonOperation,
|
operation: this.$store.state.menuOperation.buttonOperation,
|
||||||
overNext: true
|
overNext: true
|
||||||
};
|
};
|
||||||
@ -575,12 +575,12 @@ export default {
|
|||||||
handleTotalHumanSolution(model) {
|
handleTotalHumanSolution(model) {
|
||||||
const operate = {
|
const operate = {
|
||||||
send: true,
|
send: true,
|
||||||
overNext: true,
|
overNext: true,
|
||||||
code: model.code,
|
code: model.code,
|
||||||
operation: this.$store.state.menuOperation.buttonOperation
|
operation: this.$store.state.menuOperation.buttonOperation
|
||||||
};
|
};
|
||||||
|
|
||||||
if (model.yellowOpen && model.redOpen) {
|
if (model.aspect == 'RY') {
|
||||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE;
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE;
|
||||||
operate.param = {signalCode: model.code};
|
operate.param = {signalCode: model.code};
|
||||||
this.deviceList = [];
|
this.deviceList = [];
|
||||||
@ -588,7 +588,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
||||||
operate.param = {signalCode: model.code};
|
operate.param = {signalCode: model.code};
|
||||||
operate.val = model.code;
|
operate.val = model.code;
|
||||||
this.deviceList = [];
|
this.deviceList = [];
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -744,7 +744,7 @@ export default {
|
|||||||
},
|
},
|
||||||
clearOperate() {
|
clearOperate() {
|
||||||
Handler.clear(); // 清空操作组
|
Handler.clear(); // 清空操作组
|
||||||
this.deviceList = [];
|
this.deviceList = [];
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$store.state.menuOperation.selectedCount': function(val) {
|
'$store.state.menuOperation.selectedCount': function(val) {
|
||||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
|
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
|
||||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,19 +193,32 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
operationHandler(buttonOperation, selectType) {
|
operationHandler(buttonOperation, selectType) {
|
||||||
|
debugger;
|
||||||
switch (buttonOperation) {
|
switch (buttonOperation) {
|
||||||
case OperationEvent.Section.fault.button.operation: {
|
case OperationEvent.Section.fault.button.operation: {
|
||||||
// 事故解锁
|
// 事故解锁
|
||||||
if (!selectType.normalPosition && selectType.reversePosition) {
|
debugger;
|
||||||
this.locate(selectType);
|
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
|
||||||
}
|
if (valid) {
|
||||||
|
// this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||||
|
}
|
||||||
|
}).catch(error=>{
|
||||||
|
console.log(error);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OperationEvent.Section.axlePreReset.button.operation: {
|
case OperationEvent.Section.axlePreReset.button.operation: {
|
||||||
// 计轴复零
|
// 计轴复零
|
||||||
if (selectType.normalPosition && !selectType.reversePosition) {
|
debugger;
|
||||||
this.reverse(selectType);
|
commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
|
||||||
}
|
if (valid) {
|
||||||
|
// this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||||
|
}
|
||||||
|
}).catch(error=>{
|
||||||
|
console.log(error);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,14 +213,14 @@ export default {
|
|||||||
switch (buttonOperation) {
|
switch (buttonOperation) {
|
||||||
case OperationEvent.Switch.locate.button.operation: {
|
case OperationEvent.Switch.locate.button.operation: {
|
||||||
// 道岔总定
|
// 道岔总定
|
||||||
if (!selectType.normalPosition && selectType.reversePosition) {
|
if (selectType.pos == 'R') {
|
||||||
this.locate(selectType);
|
this.locate(selectType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OperationEvent.Switch.reverse.button.operation: {
|
case OperationEvent.Switch.reverse.button.operation: {
|
||||||
// 道岔总反
|
// 道岔总反
|
||||||
if (selectType.normalPosition && !selectType.reversePosition) {
|
if (selectType.pos == 'N') {
|
||||||
this.reverse(selectType);
|
this.reverse(selectType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-show="showExpand" :span="showExpand? 18: 0">
|
<el-col v-show="showExpand" :span="showExpand? 18: 0">
|
||||||
<map-visual ref="map" :mapData="mapData" :width="780" :height="600" />
|
<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||||
@ -98,9 +98,9 @@ export default {
|
|||||||
title() {
|
title() {
|
||||||
return '进路设置';
|
return '进路设置';
|
||||||
},
|
},
|
||||||
expandTitle() {
|
expandTitle() {
|
||||||
return this.showExpand? '收起进路预览' : '展开进路预览'
|
return this.showExpand ? '收起进路预览' : '展开进路预览';
|
||||||
},
|
},
|
||||||
commitDisabled() {
|
commitDisabled() {
|
||||||
let disabled = true;
|
let disabled = true;
|
||||||
if (this.row) {
|
if (this.row) {
|
||||||
@ -124,7 +124,7 @@ export default {
|
|||||||
this.showExpand = !this.showExpand;
|
this.showExpand = !this.showExpand;
|
||||||
},
|
},
|
||||||
doShow(operate, selected, tempData) {
|
doShow(operate, selected, tempData) {
|
||||||
this.$root.$emit('dialogOpen', selected);
|
this.$root.$emit('dialogOpen', selected);
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||||
if (!this.dialogShow) {
|
if (!this.dialogShow) {
|
||||||
@ -166,7 +166,7 @@ export default {
|
|||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
this.row = null;
|
this.row = null;
|
||||||
this.restoreBeforeDevices();
|
this.restoreBeforeDevices();
|
||||||
this.$root.$emit('dialogClose', this.selected);
|
this.$root.$emit('dialogClose', this.selected);
|
||||||
this.$refs.table.setCurrentRow();
|
this.$refs.table.setCurrentRow();
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
mouseCancelState(this.selected);
|
mouseCancelState(this.selected);
|
||||||
@ -183,8 +183,8 @@ export default {
|
|||||||
|
|
||||||
if (this.beforeSwitchList && this.beforeSwitchList.length) {
|
if (this.beforeSwitchList && this.beforeSwitchList.length) {
|
||||||
this.beforeSwitchList.forEach(el => {
|
this.beforeSwitchList.forEach(el => {
|
||||||
el.normalPosition = false;
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
el.reversePosition = false;
|
el.pos = 'NO';
|
||||||
el.routeLock = false;
|
el.routeLock = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ export default {
|
|||||||
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
|
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
|
||||||
const diff = signalBegin.position.x - signalEnd.position.x;
|
const diff = signalBegin.position.x - signalEnd.position.x;
|
||||||
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
|
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
|
||||||
const signal = diff > 0? signalEnd: signalBegin;
|
const signal = diff > 0 ? signalEnd : signalBegin;
|
||||||
const switchCodeList = [];
|
const switchCodeList = [];
|
||||||
|
|
||||||
this.$refs.map.setCenterWithOffset(code, 50, signal.position.y);
|
this.$refs.map.setCenterWithOffset(code, 50, signal.position.y);
|
||||||
@ -235,7 +235,8 @@ export default {
|
|||||||
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
|
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
|
||||||
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
|
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
|
||||||
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
|
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
|
||||||
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
|
// normalPosition: el.normal, reversePosition: !el.normal
|
||||||
|
containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos });
|
||||||
if (el.normal) {
|
if (el.normal) {
|
||||||
containSectionList.push({code: sectionA.code, routeLock:true });
|
containSectionList.push({code: sectionA.code, routeLock:true });
|
||||||
containSectionList.push({code: sectionC.code, preBlue: true });
|
containSectionList.push({code: sectionC.code, preBlue: true });
|
||||||
|
@ -132,17 +132,8 @@ export default {
|
|||||||
},
|
},
|
||||||
getSignalShow(code) {
|
getSignalShow(code) {
|
||||||
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
|
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
|
||||||
return '红';
|
return data[signalEle.aspect] || '';
|
||||||
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
|
|
||||||
return '绿';
|
|
||||||
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
|
|
||||||
return '黄';
|
|
||||||
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
|
|
||||||
return '引导';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getCanGuide(code) {
|
getCanGuide(code) {
|
||||||
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
|
@ -134,17 +134,8 @@ export default {
|
|||||||
},
|
},
|
||||||
getSignalShow(code) {
|
getSignalShow(code) {
|
||||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
|
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
|
||||||
return '红';
|
return data[elem.aspect] || '';
|
||||||
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
|
|
||||||
return '绿';
|
|
||||||
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
|
|
||||||
return '黄';
|
|
||||||
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
|
|
||||||
return '引导';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -245,17 +245,8 @@ export default {
|
|||||||
},
|
},
|
||||||
getSignalShow(code) {
|
getSignalShow(code) {
|
||||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
|
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
|
||||||
return '红';
|
return data[elem.aspect] || '';
|
||||||
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
|
|
||||||
return '绿';
|
|
||||||
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
|
|
||||||
return '黄';
|
|
||||||
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
|
|
||||||
return '引导';
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
},
|
},
|
||||||
getCanGuide(code) {
|
getCanGuide(code) {
|
||||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
<el-table-column prop="name" label="ID" />
|
<el-table-column prop="name" label="ID" />
|
||||||
<el-table-column prop="status" label="信号指示模式">
|
<el-table-column prop="status" label="信号指示模式">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.redOpen">灭灯模式</span>
|
<!-- <span v-if="scope.row.redOpen">灭灯模式</span> -->
|
||||||
|
<span v-if="scope.row.aspect=='R'">灭灯模式</span>
|
||||||
<span v-else>开灯模式</span>
|
<span v-else>开灯模式</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -109,7 +110,7 @@ export default {
|
|||||||
'selected': function(val) {
|
'selected': function(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
|
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||||
if (signal && signal.redOpen) {
|
if (signal && signal.aspect == 'R') {
|
||||||
this.status = true;
|
this.status = true;
|
||||||
} else {
|
} else {
|
||||||
this.status = false;
|
this.status = false;
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="radio-box-title">设置位置</div>
|
<div class="radio-box-title">设置位置</div>
|
||||||
<div class="radio-box">
|
<div class="radio-box">
|
||||||
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.normalPosition || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
|
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.pos=='N' || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
|
||||||
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.reversePosition || selectedSwitch.auto)" style="display: block;">反位</el-radio>
|
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.pos=='R' || selectedSwitch.auto)" style="display: block;">反位</el-radio>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio-box-title">设置预留</div>
|
<div class="radio-box-title">设置预留</div>
|
||||||
<div class="radio-box">
|
<div class="radio-box">
|
||||||
@ -208,9 +208,10 @@ export default {
|
|||||||
},
|
},
|
||||||
getSwitchPosition(code) {
|
getSwitchPosition(code) {
|
||||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
if (elem.normalPosition) {
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
|
if (elem.pos == 'N') {
|
||||||
return '定位';
|
return '定位';
|
||||||
} else if (elem.reversePosition) {
|
} else if (elem.pos == 'R') {
|
||||||
return '反位';
|
return '反位';
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
@ -109,9 +109,10 @@ export default {
|
|||||||
},
|
},
|
||||||
getSwitchPosition(code) {
|
getSwitchPosition(code) {
|
||||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
if (elem.normalPosition) {
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
|
if (elem.pos == 'N') {
|
||||||
return '定位';
|
return '定位';
|
||||||
} else if (elem.reversePosition) {
|
} else if (elem.pos == 'R') {
|
||||||
return '反位';
|
return '反位';
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
@ -1,9 +1,24 @@
|
|||||||
|
|
||||||
import {createTransform1, createBoundingRect} from './utils/parser';
|
import {createTransform1, createBoundingRect} from './utils/parser';
|
||||||
|
|
||||||
class TransformHandle {
|
class TransformHandle {
|
||||||
constructor(painter) {
|
constructor(painter) {
|
||||||
this.$painter = painter;
|
this.$painter = painter;
|
||||||
|
|
||||||
|
this.scale = '';
|
||||||
|
this.scaleIndex = 0;
|
||||||
|
this.scaleList = [
|
||||||
|
0.2, 0.4, 0.6, 0.8, 0.9,
|
||||||
|
1, 1.2, 1.4, 1.6, 1.8,
|
||||||
|
2, 2.2, 2.4, 2.6, 2.8,
|
||||||
|
3, 3.2, 3.4, 3.6, 3.8,
|
||||||
|
4, 4.2, 4.4, 4.6, 4.8,
|
||||||
|
5, 5.2, 5.4, 5.6, 5.8,
|
||||||
|
6, 6.2, 6.4, 6.6, 6.8,
|
||||||
|
7, 7.2, 7.4, 7.6, 7.8,
|
||||||
|
8
|
||||||
|
];
|
||||||
|
|
||||||
this.parentLevel = painter.getParentLevel();
|
this.parentLevel = painter.getParentLevel();
|
||||||
|
|
||||||
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
||||||
@ -79,6 +94,7 @@ class TransformHandle {
|
|||||||
// 更新偏移量
|
// 更新偏移量
|
||||||
updateTransform(list, rectList) {
|
updateTransform(list, rectList) {
|
||||||
this.rectList = rectList;
|
this.rectList = rectList;
|
||||||
|
// this.scale = list[0].scaleRateX;
|
||||||
this.transform = [];
|
this.transform = [];
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
this.transform.push(createTransform1(item));
|
this.transform.push(createTransform1(item));
|
||||||
@ -87,10 +103,24 @@ class TransformHandle {
|
|||||||
this.transformAll();
|
this.transformAll();
|
||||||
}
|
}
|
||||||
updataOffset(opt) {
|
updataOffset(opt) {
|
||||||
this.transform.forEach(item => {
|
if (opt.scale) {
|
||||||
item[4] = item[4] + opt.dx;
|
if (opt.scale <= 0) {
|
||||||
item[5] = item[5] + opt.dy;
|
this.scaleIndex = this.scaleIndex <= 0 ? 0 : this.scaleIndex - 1;
|
||||||
});
|
} else {
|
||||||
|
this.scaleIndex = this.scaleIndex >= 40 ? 40 : this.scaleIndex + 1;
|
||||||
|
}
|
||||||
|
const {screenList, rectList} = this.$painter.updateScreenZoom(this.scaleList[this.scaleIndex]);
|
||||||
|
this.rectList = rectList;
|
||||||
|
this.transform = [];
|
||||||
|
screenList.forEach(item => {
|
||||||
|
this.transform.push(createTransform1(item));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.transform.forEach(item => {
|
||||||
|
item[4] = item[4] + opt.dx;
|
||||||
|
item[5] = item[5] + opt.dy;
|
||||||
|
});
|
||||||
|
}
|
||||||
this.transformAll1();
|
this.transformAll1();
|
||||||
}
|
}
|
||||||
updataOffsetNum(opts) {
|
updataOffsetNum(opts) {
|
||||||
|
@ -15,6 +15,7 @@ const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
|||||||
const Jlmap3dAssetManager = () => import('@/views/jlmap3d/jl3dassetmanager/assetmanager');
|
const Jlmap3dAssetManager = () => import('@/views/jlmap3d/jl3dassetmanager/assetmanager');
|
||||||
const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3dedit');
|
const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3dedit');
|
||||||
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
|
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
|
||||||
|
const Jlmap3dLesson3dSelect = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dselect');
|
||||||
|
|
||||||
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
||||||
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
|
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
|
||||||
@ -41,6 +42,7 @@ const PracticeDisplay = () => import('@/views/newMap/displayNew/practiceDisplay'
|
|||||||
const BigLPFStrategy = () => import('@/views/newMap/displayNew/bigLPFStrategy');
|
const BigLPFStrategy = () => import('@/views/newMap/displayNew/bigLPFStrategy');
|
||||||
|
|
||||||
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
|
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
|
||||||
|
const jointTrainingNewCCTV = () => import('@/views/newMap/jointTrainingNew/realCCTV');
|
||||||
|
|
||||||
const Errpr404 = () => import('@/views/error-page/404');
|
const Errpr404 = () => import('@/views/error-page/404');
|
||||||
|
|
||||||
@ -289,6 +291,12 @@ export const constantRoutes = [
|
|||||||
component: Jlmap3dLesson3dPlayer,
|
component: Jlmap3dLesson3dPlayer,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/jlmap3d/lesson3dselect',
|
||||||
|
component: Jlmap3dLesson3dSelect,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/data2json',
|
path: '/data2json',
|
||||||
component: () => import('@/views/planMonitor/data2json/page.vue'),
|
component: () => import('@/views/planMonitor/data2json/page.vue'),
|
||||||
@ -346,6 +354,7 @@ export const constantRoutes = [
|
|||||||
component: Jl3dRailwayDrive,
|
component: Jl3dRailwayDrive,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/jlmap3d/devicemodel',
|
path: '/jlmap3d/devicemodel',
|
||||||
component: Jlmap3dModel,
|
component: Jlmap3dModel,
|
||||||
@ -442,6 +451,11 @@ export const publicAsyncRoute = [
|
|||||||
component: JointTrainingNew,
|
component: JointTrainingNew,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/jointTrainingNewCCTV',
|
||||||
|
component: jointTrainingNewCCTV,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/jlmap3d',
|
path: '/jlmap3d',
|
||||||
component: Jlmap3d,
|
component: Jlmap3d,
|
||||||
|
@ -448,6 +448,17 @@ export const loginInfo = {
|
|||||||
navigationMarginLeft: '50px',
|
navigationMarginLeft: '50px',
|
||||||
systemType: '022'
|
systemType: '022'
|
||||||
},
|
},
|
||||||
|
richorlesson3d:{
|
||||||
|
title: '中航锐创城市轨道交通实训平台',
|
||||||
|
loginPath: '/login?project=richorlesson3d',
|
||||||
|
loginParam: 'RICHOR',
|
||||||
|
bottomColumn: '中航锐创(北京)科技发展有限公司 联系电话:4000500081',
|
||||||
|
linkIcon: FaviconRichor,
|
||||||
|
titleIcon: FaviconRichor,
|
||||||
|
navigationLogoWidth: '40px',
|
||||||
|
navigationMarginLeft: '50px',
|
||||||
|
systemType: '022'
|
||||||
|
},
|
||||||
designrichorjoint: {
|
designrichorjoint: {
|
||||||
title: '中航锐创城市轨道交通设计平台',
|
title: '中航锐创城市轨道交通设计平台',
|
||||||
loginPath: '/design/login?project=richorjoint',
|
loginPath: '/design/login?project=richorjoint',
|
||||||
@ -513,6 +524,7 @@ export const ProjectIcon = {
|
|||||||
cgy: FaviconCgy,
|
cgy: FaviconCgy,
|
||||||
designcgy: FaviconCgy,
|
designcgy: FaviconCgy,
|
||||||
richor:FaviconRichor,
|
richor:FaviconRichor,
|
||||||
|
richorlesson3d:FaviconRichor,
|
||||||
richorjoint: FaviconRichor,
|
richorjoint: FaviconRichor,
|
||||||
designrichorjoint: FaviconRichor
|
designrichorjoint: FaviconRichor
|
||||||
};
|
};
|
||||||
@ -546,14 +558,15 @@ export const ProjectCode = {
|
|||||||
cgy: 'CGY',
|
cgy: 'CGY',
|
||||||
designcgy: 'CGY',
|
designcgy: 'CGY',
|
||||||
richor:'RICHOR',
|
richor:'RICHOR',
|
||||||
|
richorlesson3d:'RICHOR',
|
||||||
richorjoint: 'RICHOR_JOINT',
|
richorjoint: 'RICHOR_JOINT',
|
||||||
designrichorjoint: 'RICHOR_JOINT'
|
designrichorjoint: 'RICHOR_JOINT'
|
||||||
};
|
};
|
||||||
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorjoint', 'designrichorjoint']; // 底部栏仅展示公司信息不展示备案号
|
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint']; // 底部栏仅展示公司信息不展示备案号
|
||||||
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor', 'richorjoint', 'designrichorjoint']; // 实训设计平台通过项目code获取地图列表的项目
|
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor','richorlesson3d', 'richorjoint', 'designrichorjoint']; // 实训设计平台通过项目code获取地图列表的项目
|
||||||
export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目
|
export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目
|
||||||
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角版本开发基于不展示
|
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角版本开发基于不展示
|
||||||
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角主体不展示
|
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt','richor','richorlesson3d', 'richorjoint']; // 登录页右下角主体不展示
|
||||||
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc',
|
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc',
|
||||||
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy', 'zzww', 'zzwwtest']; // 登录页样式
|
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy', 'zzww', 'zzwwtest']; // 登录页样式
|
||||||
export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl'];
|
export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl'];
|
||||||
@ -614,6 +627,7 @@ export const ProjectList = [
|
|||||||
{value: 'zzww', label: '郑州共赢'},
|
{value: 'zzww', label: '郑州共赢'},
|
||||||
{value: 'zzwwtest', label: '郑州共赢考试'},
|
{value: 'zzwwtest', label: '郑州共赢考试'},
|
||||||
{value: 'richor', label: '中航锐创'},
|
{value: 'richor', label: '中航锐创'},
|
||||||
|
{value: 'richorlesson3d', label: '中航锐创(三维课程)'},
|
||||||
{value: 'richor_joint', label: '中航锐创(实训室)'}
|
{value: 'richor_joint', label: '中航锐创(实训室)'}
|
||||||
];
|
];
|
||||||
export const localPackageProject = {
|
export const localPackageProject = {
|
||||||
|
@ -181,6 +181,9 @@ const iscs = {
|
|||||||
},
|
},
|
||||||
setCloseMusic: (state, num) => {
|
setCloseMusic: (state, num) => {
|
||||||
state.closeMusicNum = num;
|
state.closeMusicNum = num;
|
||||||
|
},
|
||||||
|
updateIscsState: (state, deviceStatus) => {
|
||||||
|
Vue.prototype.$iscs && Vue.prototype.$iscs.update(deviceStatus);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -188,6 +191,9 @@ const iscs = {
|
|||||||
setIscsData: ({ commit }, iscs) => {
|
setIscsData: ({ commit }, iscs) => {
|
||||||
commit('setIscsData', iscs);
|
commit('setIscsData', iscs);
|
||||||
},
|
},
|
||||||
|
updateIscsState: ({ commit }, deviceStatus) => {
|
||||||
|
commit('updateIscsState', deviceStatus);
|
||||||
|
},
|
||||||
updateIscsDevices: ({ commit }, models) => {
|
updateIscsDevices: ({ commit }, models) => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
if (!(models instanceof Array)) {
|
if (!(models instanceof Array)) {
|
||||||
|
@ -340,6 +340,7 @@ const socket = {
|
|||||||
competitionPracticeFinish:0, // 竞赛场景结束标识
|
competitionPracticeFinish:0, // 竞赛场景结束标识
|
||||||
simulationAlarmInfo: [], // 仿真报警信息
|
simulationAlarmInfo: [], // 仿真报警信息
|
||||||
deviceStateMessages: null, // 新版订阅设备状态消息
|
deviceStateMessages: null, // 新版订阅设备状态消息
|
||||||
|
iscsStateMessages: null, // iscs设备状态消息
|
||||||
simulationSpeed: 1, // 仿真倍速
|
simulationSpeed: 1, // 仿真倍速
|
||||||
simulationPause: false,
|
simulationPause: false,
|
||||||
simulationPslStatus: [], // PSL面板按钮状态信息
|
simulationPslStatus: [], // PSL面板按钮状态信息
|
||||||
@ -421,6 +422,9 @@ const socket = {
|
|||||||
},
|
},
|
||||||
setSimulationSpeed: (state, speed) => {
|
setSimulationSpeed: (state, speed) => {
|
||||||
state.simulationSpeed = speed;
|
state.simulationSpeed = speed;
|
||||||
|
},
|
||||||
|
setIscsStateMessages: (state, speed) => {
|
||||||
|
state.iscsStateMessages = speed;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -506,6 +510,9 @@ const socket = {
|
|||||||
},
|
},
|
||||||
setSimulationTimeSync:({ commit }, time) => {
|
setSimulationTimeSync:({ commit }, time) => {
|
||||||
commit('setSimulationTimeSync', time);
|
commit('setSimulationTimeSync', time);
|
||||||
|
},
|
||||||
|
handleIscsState:({ commit }, state) => {
|
||||||
|
commit('setIscsStateMessages', state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ export function getBaseUrl() {
|
|||||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||||
} else {
|
} else {
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
}
|
}
|
||||||
|
@ -7,24 +7,16 @@ export default function parseStatus(deviceStatus) {
|
|||||||
elem.deviceType = deviceType.Switch;
|
elem.deviceType = deviceType.Switch;
|
||||||
switch (msg[1]) {
|
switch (msg[1]) {
|
||||||
case 0:
|
case 0:
|
||||||
elem.normalPosition = 0;
|
elem.pos = 'NO'; // 失表
|
||||||
elem.reversePosition = 0;
|
|
||||||
elem.switchSplit = 0;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
elem.normalPosition = 1;
|
elem.pos = 'N'; // 定位
|
||||||
elem.reversePosition = 0;
|
|
||||||
elem.switchSplit = 0;
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
elem.normalPosition = 0;
|
elem.pos = 'R'; // 反位
|
||||||
elem.reversePosition = 1;
|
|
||||||
elem.switchSplit = 0;
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
elem.normalPosition = 0;
|
elem.pos = 'EX'; // 挤岔
|
||||||
elem.reversePosition = 0;
|
|
||||||
elem.switchSplit = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
elem.blockade = msg[2];
|
elem.blockade = msg[2];
|
||||||
|
@ -8,6 +8,7 @@ export const perpetualTopic = '/user/topic/message'; // 公用topic
|
|||||||
export const roomTopic = '/user/queue/room'; // 房间topic
|
export const roomTopic = '/user/queue/room'; // 房间topic
|
||||||
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
|
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
|
||||||
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
|
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
|
||||||
|
// export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
|
||||||
|
|
||||||
export function getTopic(type, group) {
|
export function getTopic(type, group) {
|
||||||
let topic = '';
|
let topic = '';
|
||||||
@ -24,6 +25,9 @@ export function getTopic(type, group) {
|
|||||||
// topic = `/user/queue/simulation/${group}/state`;
|
// topic = `/user/queue/simulation/${group}/state`;
|
||||||
topic = `/queue/simulation/${group}/state`;
|
topic = `/queue/simulation/${group}/state`;
|
||||||
break;
|
break;
|
||||||
|
case 'ISCSPSD':
|
||||||
|
topic = `/queue/simulation/${group}/iscs/psd`;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return topic;
|
return topic;
|
||||||
}
|
}
|
||||||
@ -49,6 +53,8 @@ function callback(Response) {
|
|||||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||||
} else if (Response.headers.destination.includes('state')) {
|
} else if (Response.headers.destination.includes('state')) {
|
||||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||||
|
} else if (Response.headers.destination.includes('iscs')) {
|
||||||
|
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
|
||||||
} else {
|
} else {
|
||||||
const data = JSON.parse(Response.body);
|
const data = JSON.parse(Response.body);
|
||||||
store.dispatch('socket/setStomp', data);
|
store.dispatch('socket/setStomp', data);
|
||||||
|
@ -62,7 +62,7 @@ export default {
|
|||||||
},
|
},
|
||||||
'$store.state.map.mapViewLoadedCount':function() {
|
'$store.state.map.mapViewLoadedCount':function() {
|
||||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||||
this.$jlmap.off('zoom');
|
// this.$jlmap.off('zoom');
|
||||||
this.handleUpdateScreen();
|
this.handleUpdateScreen();
|
||||||
if (this.$route.query.group && !this.$route.path.includes('displayIscs')) {
|
if (this.$route.query.group && !this.$route.path.includes('displayIscs')) {
|
||||||
this.subscribe();
|
this.subscribe();
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
||||||
|
<el-form-item label="编码:" prop="code">
|
||||||
|
<el-input v-model="form.code" :disabled="true" size="small" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="图层:" prop="z2">
|
<el-form-item label="图层:" prop="z2">
|
||||||
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
|
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
||||||
|
<el-form-item label="门高:" prop="height">
|
||||||
|
<el-input v-model="form.code" :disabled="true" size="small" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="门高:" prop="height">
|
<el-form-item label="门高:" prop="height">
|
||||||
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
|
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -41,6 +41,8 @@ export default {
|
|||||||
return this.$route.query.lineCode;
|
return this.$route.query.lineCode;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -173,6 +173,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.$emit('viewLoaded');
|
||||||
},
|
},
|
||||||
setIscs(data, oldData) {
|
setIscs(data, oldData) {
|
||||||
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);
|
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);
|
||||||
|
@ -58,6 +58,9 @@ export default {
|
|||||||
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
|
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
|
||||||
loadRunPlanData(this.group);
|
loadRunPlanData(this.group);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
'$store.state.socket.iscsStateMessages': function (list) {
|
||||||
|
this.$store.dispatch('iscs/updateIscsState', list);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="psdSystem">
|
<div class="psdSystem">
|
||||||
<div class="psdSystem_header">{{ stationName+' 屏蔽门系统' }}</div>
|
<div class="psdSystem_header">{{ stationName+' 屏蔽门系统' }}</div>
|
||||||
<div>
|
<div>
|
||||||
<iscsSystem ref="iscsPlate" />
|
<iscsSystem ref="iscsPlate" @viewLoaded="viewLoaded" />
|
||||||
<!-- :width-canvas="width" :canvas-height="height" -->
|
<!-- :width-canvas="width" :canvas-height="height" -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="psdSystem_footer">
|
<!-- <div class="psdSystem_footer">
|
||||||
@ -14,6 +14,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import iscsSystem from '../canvas/iscsCanvas';
|
import iscsSystem from '../canvas/iscsCanvas';
|
||||||
import {getIscsData} from '@/api/iscs';
|
import {getIscsData} from '@/api/iscs';
|
||||||
|
import { getToken } from '@/utils/auth';
|
||||||
|
import { creatSubscribe, clearSubscribe, getTopic } from '@/utils/stomp';
|
||||||
export default {
|
export default {
|
||||||
name:'PsdSystem',
|
name:'PsdSystem',
|
||||||
components:{
|
components:{
|
||||||
@ -49,9 +51,26 @@ export default {
|
|||||||
const data = JSON.parse(resp.data.graphData);
|
const data = JSON.parse(resp.data.graphData);
|
||||||
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
|
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
|
||||||
} else {
|
} else {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
viewLoaded() {
|
||||||
|
this.subscribe();
|
||||||
|
},
|
||||||
|
subscribe() {
|
||||||
|
this.clearSubscribe();
|
||||||
|
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||||
|
creatSubscribe(getTopic('ISCSPSD', this.$route.query.group), header);
|
||||||
|
this.$store.dispatch('app/animationsClose');
|
||||||
|
},
|
||||||
|
clearSubscribe() {
|
||||||
|
clearSubscribe(getTopic('ISCSPSD', this.$route.query.group));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -103,14 +103,6 @@
|
|||||||
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div>
|
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div id="staymode" class="panebutton2" style="bottom:6%;left:80%;">
|
|
||||||
<img class="buttonimg2" :src="zuoimg" />
|
|
||||||
<img class="buttonimg2" :src="niuimg" :style="{transform:toutransform}" @touchstart='stopmodetouchstart' @touchmove='stopmodetouchmove' @touchend='stopmodetouchend'/>
|
|
||||||
<div class="tfbutton" style="top:25px;left:1px;">{{ $t('jlmap3d.infliction') }}</div>
|
|
||||||
<div class="tfbutton" style="top:8px;left:25px;">{{ $t('jlmap3d.mesoPosition') }}</div>
|
|
||||||
<div class="tfbutton" style="top:25px;left:50px;">{{ $t('jlmap3d.remission') }}</div>
|
|
||||||
<div class="buttontext2">{{ $t('jlmap3d.parkingBrakeMode') }}</div>
|
|
||||||
</div> -->
|
|
||||||
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick">
|
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick">
|
||||||
<img class="buttonimg" :src="redlimg" />
|
<img class="buttonimg" :src="redlimg" />
|
||||||
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
|
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
|
||||||
@ -123,14 +115,23 @@
|
|||||||
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
|
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
|
||||||
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
|
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;">
|
<div id="doorpick" class="panebutton2" style="top:6%;left:85%;">
|
||||||
<img class="buttonimg2" :src="zuoimg" />
|
<img class="buttonimg2" :src="zuoimg" @mouseout='doorModeOut'/>
|
||||||
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/>
|
<img id="doormodeniu" class="buttonimg2" :src="niuimg" :style="{transform:doormodetou}" @mousedown='doormodetouchstart'/>
|
||||||
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
|
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">AA</div>
|
||||||
<div class="tfbutton" style="font-size:1px;top:8px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
|
<div class="tfbutton" style="font-size:8px;top:8px;left:33px;">AM</div>
|
||||||
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
|
<div class="tfbutton" style="font-size:8px;top:11px;left:48px;">MM</div>
|
||||||
|
<div class="buttontext2">{{ $t('jlmap3d.doorModel') }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;">
|
||||||
|
<img class="buttonimg2" :src="zuoimg" @mouseout='doorSelectionOut'/>
|
||||||
|
<img id="doorpickniu" class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart'/>
|
||||||
|
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">{{ $t('jlmap3d.leftSide') }}</div>
|
||||||
|
<div class="tfbutton" style="font-size:8px;top:8px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
|
||||||
|
<div class="tfbutton" style="font-size:8px;top:11px;left:48px;">{{ $t('jlmap3d.rightSide') }}</div>
|
||||||
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
|
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
|
||||||
</div> -->
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -140,7 +141,17 @@
|
|||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
// import { sendSimulationCommand } from '@/api/simulation.js';
|
// import { sendSimulationCommand } from '@/api/simulation.js';
|
||||||
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp,trainSimulationChangeHead,trainSimulationDoorControl,trainSimulationEb } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
|
import {
|
||||||
|
trainSimulationDriveMode,
|
||||||
|
trainSimulationAto ,
|
||||||
|
trainSimulationAtp,
|
||||||
|
trainSimulationChangeHead,
|
||||||
|
trainSimulationDoorControl,
|
||||||
|
trainSimulationEb,
|
||||||
|
trainSimulationDoorSelection,
|
||||||
|
trainSimulationDoorMode
|
||||||
|
} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
|
||||||
|
|
||||||
|
|
||||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
|
||||||
@ -166,7 +177,7 @@
|
|||||||
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
|
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
|
||||||
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
|
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
|
||||||
iconrotate:0,
|
iconrotate:0,
|
||||||
doordirecttou:"rotate(0deg)",
|
doordirecttou:"rotate(415deg)",
|
||||||
doormodetou:"rotate(0deg)",
|
doormodetou:"rotate(0deg)",
|
||||||
watertou:"rotate(0deg)",
|
watertou:"rotate(0deg)",
|
||||||
washtou:"rotate(0deg)",
|
washtou:"rotate(0deg)",
|
||||||
@ -198,6 +209,14 @@
|
|||||||
jgl:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
|
jgl:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
|
||||||
sgd:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
|
sgd:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
|
||||||
jgd:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
|
jgd:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
|
||||||
|
angleoffset: {
|
||||||
|
x: null,
|
||||||
|
y: null
|
||||||
|
},
|
||||||
|
oldDoorMode:"",
|
||||||
|
oldDoorSelection:"",
|
||||||
|
doorModePut:true,
|
||||||
|
doorSelectionPut:true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -253,32 +272,118 @@
|
|||||||
};
|
};
|
||||||
setTimeout( callback.bind(this),2000);
|
setTimeout( callback.bind(this),2000);
|
||||||
},
|
},
|
||||||
stopmodetouchstart:function(e){
|
doormodetouchstart:function(e){
|
||||||
// let command ={
|
|
||||||
// code:this.traincode,
|
|
||||||
// operation:"607",
|
let domoffset = document.getElementById("doormodeniu").getBoundingClientRect();
|
||||||
// type:"07",
|
// movelimit
|
||||||
// param:""
|
this.angleoffset.x = domoffset.x;
|
||||||
// };
|
this.angleoffset.y = domoffset.y;
|
||||||
// command.param = this.touchstate;
|
|
||||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
e.preventDefault();
|
||||||
// if(netdata.data == true){
|
this.doorModePut = true;
|
||||||
this.touchcontrol = true;
|
document.getElementById("doormodeniu").onmousemove = this.doormodetouchmove;
|
||||||
// }
|
document.getElementById("doormodeniu").onmouseup = this.doormodetouchend;
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
stopmodetouchmove:function(e){//finger move 触发
|
doormodetouchmove:function(e){//finger move 触发
|
||||||
if(this.touchcontrol == true){
|
this.getModeAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||||
this.getAngle(e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
stopmodetouchend:function(e){
|
doormodetouchend:function(e){
|
||||||
this.touchcontrol = false;
|
document.getElementById("doormodeniu").onmousemove = null;
|
||||||
|
document.getElementById("doormodeniu").onmouseup = null;
|
||||||
},
|
},
|
||||||
getAngle:function(mx,my){
|
doordirecttouchstart:function(e){
|
||||||
|
|
||||||
|
|
||||||
|
let domoffset = document.getElementById("doorpickniu").getBoundingClientRect();
|
||||||
|
// movelimit
|
||||||
|
this.angleoffset.x = domoffset.x;
|
||||||
|
this.angleoffset.y = domoffset.y;
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
this.doorSelectionPut = true;
|
||||||
|
document.getElementById("doorpickniu").onmousemove = this.doordirecttouchmove;
|
||||||
|
document.getElementById("doorpickniu").onmouseup = this.doordirecttouchend;
|
||||||
|
},
|
||||||
|
doordirecttouchmove:function(e){//finger move 触发
|
||||||
|
this.getDirectAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||||
|
|
||||||
|
},
|
||||||
|
doordirecttouchend:function(e){
|
||||||
|
document.getElementById("doorpickniu").onmousemove = null;
|
||||||
|
document.getElementById("doorpickniu").onmouseup = null;
|
||||||
|
},
|
||||||
|
getModeAngle:function(mx,my){
|
||||||
//圆心坐标
|
//圆心坐标
|
||||||
let px=140;
|
// console.log(mx);
|
||||||
let py=510;
|
// console.log(my);
|
||||||
|
let px=30;
|
||||||
|
let py=30;
|
||||||
|
let command ={
|
||||||
|
groupNumber:this.groupNum,
|
||||||
|
doorMode:""
|
||||||
|
};
|
||||||
|
let angle = this.transAngle(px,py,mx,my);
|
||||||
|
if(angle<250 && angle>122){
|
||||||
|
if(angle<160 && angle>122){
|
||||||
|
command.doorMode = "AA";
|
||||||
|
}else if(angle<210 && angle>=160){
|
||||||
|
command.doorMode = "AM";
|
||||||
|
}else if(angle<250 && angle>=210){
|
||||||
|
command.doorMode = "MM";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.doorModePut == true && this.oldDoorMode != command.doorMode){
|
||||||
|
this.doorModePut = false;
|
||||||
|
this.oldDoorMode = command.doorMode;
|
||||||
|
trainSimulationDoorMode(this.group,command).then(netdata => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
getDirectAngle:function(mx,my){
|
||||||
|
//圆心坐标
|
||||||
|
// console.log(mx);
|
||||||
|
// console.log(my);
|
||||||
|
let px=30;
|
||||||
|
let py=30;
|
||||||
|
let angle = this.transAngle(px,py,mx,my);
|
||||||
|
let command ={
|
||||||
|
groupNumber:this.groupNum,
|
||||||
|
doorSelection:""
|
||||||
|
};
|
||||||
|
if(angle<250 && angle>122){
|
||||||
|
if(angle<160 && angle>122){
|
||||||
|
command.doorSelection = "L";
|
||||||
|
}else if(angle<210 && angle>=160){
|
||||||
|
command.doorSelection = "Z";
|
||||||
|
}else if(angle<250 && angle>=210){
|
||||||
|
command.doorSelection = "R";
|
||||||
|
}
|
||||||
|
if(this.doorSelectionPut == true && this.oldDoorSelection != command.doorSelection ){
|
||||||
|
this.doorSelectionPut = false;
|
||||||
|
this.oldDoorSelection = command.doorSelection;
|
||||||
|
trainSimulationDoorSelection(this.group,command).then(netdata => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
doorSelectionOut: function(event){
|
||||||
|
document.getElementById("doorpickniu").onmousemove = null;
|
||||||
|
document.getElementById("doorpickniu").onmouseup = null;
|
||||||
|
},
|
||||||
|
doorModeOut: function(event){
|
||||||
|
document.getElementById("doormodeniu").onmousemove = null;
|
||||||
|
document.getElementById("doormodeniu").onmouseup = null;
|
||||||
|
},
|
||||||
|
transAngle: function(px,py,mx,my){
|
||||||
let x = Math.abs(px-mx);
|
let x = Math.abs(px-mx);
|
||||||
let y = Math.abs(py-my);
|
let y = Math.abs(py-my);
|
||||||
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
|
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
|
||||||
@ -309,50 +414,7 @@
|
|||||||
if(mx<px&&my<py){//鼠标在第二象限
|
if(mx<px&&my<py){//鼠标在第二象限
|
||||||
angle = 360 - angle;
|
angle = 360 - angle;
|
||||||
}
|
}
|
||||||
if(angle<338 && angle>219){
|
return angle;
|
||||||
|
|
||||||
if(angle<245 && angle>219){
|
|
||||||
this.toutransform = "rotate(305deg)";
|
|
||||||
}else if(angle<295 && angle>245){
|
|
||||||
this.toutransform = "rotate(359deg)";
|
|
||||||
}else if(angle<338 && angle>295){
|
|
||||||
this.toutransform = "rotate(412deg)";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doordirecttouchstart:function(e){
|
|
||||||
// let command ={
|
|
||||||
// code:this.traincode,
|
|
||||||
// operation:"607",
|
|
||||||
// type:"07",
|
|
||||||
// param:""
|
|
||||||
// };
|
|
||||||
// command.param = this.touchstate;
|
|
||||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
|
||||||
// if(netdata.data == true){
|
|
||||||
this.touchcontrol = true;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
doordirecttouchmove:function(e){//finger move 触发
|
|
||||||
if(this.touchcontrol == true){
|
|
||||||
let px=230;
|
|
||||||
let py=180;
|
|
||||||
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
|
||||||
if(angle<338 && angle>219){
|
|
||||||
if(angle<245 && angle>219){
|
|
||||||
this.doordirecttou = "rotate(305deg)";
|
|
||||||
}else if(angle<295 && angle>245){
|
|
||||||
this.doordirecttou = "rotate(359deg)";
|
|
||||||
}else if(angle<338 && angle>295){
|
|
||||||
this.doordirecttou = "rotate(412deg)";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doordirecttouchend:function(e){
|
|
||||||
this.touchcontrol = false;
|
|
||||||
},
|
},
|
||||||
sgclink: function (e){
|
sgclink: function (e){
|
||||||
//console.log("升弓");
|
//console.log("升弓");
|
||||||
@ -441,7 +503,7 @@
|
|||||||
};
|
};
|
||||||
trainSimulationDoorControl(this.group,data).then(netdata => {
|
trainSimulationDoorControl(this.group,data).then(netdata => {
|
||||||
// console.log(netdata);
|
// console.log(netdata);
|
||||||
this.doorleftimg = this.greenimg;
|
// this.doorleftimg = this.greenimg;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -463,7 +525,7 @@
|
|||||||
};
|
};
|
||||||
trainSimulationDoorControl(this.group,data).then(netdata => {
|
trainSimulationDoorControl(this.group,data).then(netdata => {
|
||||||
// console.log(netdata);
|
// console.log(netdata);
|
||||||
this.doorrightimg = this.greenimg;
|
// this.doorrightimg = this.greenimg;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
atoaclick: function (e){
|
atoaclick: function (e){
|
||||||
@ -485,6 +547,7 @@
|
|||||||
// console.log(netdata);
|
// console.log(netdata);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updatabuttonlight: function (data){
|
updatabuttonlight: function (data){
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// if(data.runLevel){
|
// if(data.runLevel){
|
||||||
@ -495,6 +558,7 @@
|
|||||||
// this.cbtcbuttonimg = this.greenimg;
|
// this.cbtcbuttonimg = this.greenimg;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
// console.log(data);
|
||||||
if(data.driveMode){
|
if(data.driveMode){
|
||||||
|
|
||||||
// this.driveMode = data.driveMode;
|
// this.driveMode = data.driveMode;
|
||||||
@ -524,6 +588,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data.doorMode){
|
||||||
|
this.oldDoorMode = data.doorMode;
|
||||||
|
if(data.doorMode == "AA"){
|
||||||
|
this.doormodetou = "rotate(305deg)";
|
||||||
|
}
|
||||||
|
if(data.doorMode == "AM"){
|
||||||
|
this.doormodetou = "rotate(359deg)";
|
||||||
|
}
|
||||||
|
if(data.doorMode == "MM"){
|
||||||
|
this.doormodetou = "rotate(50deg)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data.doorSelection){
|
||||||
|
this.oldDoorSelection = data.doorSelection;
|
||||||
|
if(data.doorSelection == "R"){
|
||||||
|
this.doordirecttou = "rotate(50deg)";
|
||||||
|
}
|
||||||
|
if(data.doorSelection == "Z"){
|
||||||
|
this.doordirecttou = "rotate(359deg)";
|
||||||
|
}
|
||||||
|
if(data.doorSelection == "L"){
|
||||||
|
this.doordirecttou = "rotate(305deg)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -237,6 +237,10 @@ export default {
|
|||||||
// this.updatemmidrivemode(newdata.driveMode);
|
// this.updatemmidrivemode(newdata.driveMode);
|
||||||
//
|
//
|
||||||
// this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
|
// this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
|
||||||
|
if(newdata.doorMode){
|
||||||
|
this.updateM7(newdata.doorMode);
|
||||||
|
}
|
||||||
|
|
||||||
if(newdata.nextStation){
|
if(newdata.nextStation){
|
||||||
this.updateMmiNextStation(newdata.nextStation);
|
this.updateMmiNextStation(newdata.nextStation);
|
||||||
}
|
}
|
||||||
@ -359,6 +363,17 @@ export default {
|
|||||||
this.m4image = this.images.m4['none'];
|
this.m4image = this.images.m4['none'];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updateM7(newdata){
|
||||||
|
if(newdata == "AA"){
|
||||||
|
this.m7image = this.images.m7['aoac'];
|
||||||
|
}
|
||||||
|
if(newdata == "AM"){
|
||||||
|
this.m7image = this.images.m7['aomc'];
|
||||||
|
}
|
||||||
|
if(newdata == "MM"){
|
||||||
|
this.m7image = this.images.m7['momc'];
|
||||||
|
}
|
||||||
|
},
|
||||||
updateTiaoting(newdata){
|
updateTiaoting(newdata){
|
||||||
|
|
||||||
if(newdata.jump != undefined){
|
if(newdata.jump != undefined){
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
|
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
|
||||||
<el-tab-pane label="课程场景" name="progresslist" >
|
<el-tab-pane label="课程场景" name="progresslist" >
|
||||||
<draggable v-model="lessonData.lessonData.lessonProgress" group="people" @start="drag=true" @end="drag=false" >
|
<draggable v-model="lessonData.lessonData.lessonProgress" group="people" @start="drag=true" @end="drag=false" >
|
||||||
<div class="progressdiv" v-for="(element,index) in lessonData.lessonData.lessonProgress">
|
<div class="progressdiv" :class="{active:index==isActive}" v-for="(element,index) in lessonData.lessonData.lessonProgress">
|
||||||
<div class="changeprogressdiv" @click="changeProgressView(index)">{{element.progressName}}</div>
|
<div class="changeprogressdiv" @click="changeProgressView(index)">{{element.progressName}}</div>
|
||||||
<div class="progressdivimg"
|
<div class="progressdivimg"
|
||||||
:style="{'background-image': 'url('+localstatic+'/lesson3d/sc.png)'}"/>
|
:style="{'background-image': 'url('+localstatic+'/lesson3d/sc.png)'}"/>
|
||||||
@ -28,6 +28,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="场景特效管理" name="accidentlist" >
|
||||||
|
<div class="progressdiv"
|
||||||
|
v-for="(elementaccident,indexaccident) in accidentlist" :key="elementaccident.label">
|
||||||
|
|
||||||
|
<div class="progressdivtext" >{{elementaccident.label}}</div>
|
||||||
|
<div class="progressassetimg"
|
||||||
|
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
|
||||||
|
<div class="delprogressdiv" @click="deleteAccident(elementaccident)" >删除</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -44,12 +56,13 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LessonProgress',
|
name: 'LessonProgress',
|
||||||
props:['lessonData','triggerList'],
|
props:['lessonData','triggerList','accidentlist'],
|
||||||
components: {
|
components: {
|
||||||
draggable
|
draggable
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isActive:-1,
|
||||||
localstatic:JL3D_LOCAL_STATIC,
|
localstatic:JL3D_LOCAL_STATIC,
|
||||||
activeName: 'progresslist',
|
activeName: 'progresslist',
|
||||||
progressList:[
|
progressList:[
|
||||||
@ -84,6 +97,7 @@
|
|||||||
this.$emit('addProgress');
|
this.$emit('addProgress');
|
||||||
},
|
},
|
||||||
changeProgressView(viewIndex){
|
changeProgressView(viewIndex){
|
||||||
|
this.isActive=viewIndex;
|
||||||
this.$emit('changeProgressView',viewIndex);
|
this.$emit('changeProgressView',viewIndex);
|
||||||
console.log(viewIndex);
|
console.log(viewIndex);
|
||||||
},
|
},
|
||||||
@ -97,6 +111,9 @@
|
|||||||
deleteModel(selectedModel){
|
deleteModel(selectedModel){
|
||||||
this.$emit('deleteModel',selectedModel);
|
this.$emit('deleteModel',selectedModel);
|
||||||
},
|
},
|
||||||
|
deleteAccident(selectAccident){
|
||||||
|
this.$emit('deleteAccident',selectAccident);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -107,7 +124,9 @@
|
|||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
|
.active{
|
||||||
|
background-color:#409EFF;
|
||||||
|
}
|
||||||
.lessonprogressdiv {
|
.lessonprogressdiv {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
|
@ -27,6 +27,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</draggable>
|
</draggable>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
|
||||||
|
<el-tab-pane label="特效资源" name="spritTrigger">
|
||||||
|
<draggable v-model="accidentDataList" group="accidentDataList" @start="drag=true" @end="drag=false" >
|
||||||
|
<div class="progressdiv" v-for="(item,index) in accidentDataList"@dragend="createAccident($event,item,index)">
|
||||||
|
<div class="progressdivimg"
|
||||||
|
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
|
||||||
|
<div class="progressdivtext">{{item.name}}</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="图片资源列表" name="picasset">
|
<el-tab-pane label="图片资源列表" name="picasset">
|
||||||
|
|
||||||
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick" >
|
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick" >
|
||||||
@ -82,6 +95,7 @@
|
|||||||
activeName: 'lessoncomponent',
|
activeName: 'lessoncomponent',
|
||||||
lessonAssetList:[],
|
lessonAssetList:[],
|
||||||
picAssetList:[],
|
picAssetList:[],
|
||||||
|
accidentDataList:[],
|
||||||
triggerList:[
|
triggerList:[
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
@ -98,6 +112,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
window.jl3dUpdateAccidentData = this.jl3dUpdateAccidentData;
|
||||||
this.localstatic = JL3D_LOCAL_STATIC;
|
this.localstatic = JL3D_LOCAL_STATIC;
|
||||||
console.log(this.localstatic);
|
console.log(this.localstatic);
|
||||||
getMap3dModelData("三维课程").then(netdata => {
|
getMap3dModelData("三维课程").then(netdata => {
|
||||||
@ -147,7 +162,13 @@
|
|||||||
// console.log(event);
|
// console.log(event);
|
||||||
this.$emit('createModel',item,{x:event.clientX,y:event.clientY});
|
this.$emit('createModel',item,{x:event.clientX,y:event.clientY});
|
||||||
},
|
},
|
||||||
|
createAccident(event,item, index){
|
||||||
|
|
||||||
|
this.$emit('createAccident',item.type,{x:event.clientX,y:event.clientY});
|
||||||
|
},
|
||||||
|
jl3dUpdateAccidentData(accidentData){
|
||||||
|
this.accidentDataList = accidentData;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<LessonTools-Manager
|
<LessonTools-Manager
|
||||||
@createModel='createModel'
|
@createModel='createModel'
|
||||||
|
@createAccident='createAccident'
|
||||||
:lessonTools='lessonTools'
|
:lessonTools='lessonTools'
|
||||||
></LessonTools-Manager>
|
></LessonTools-Manager>
|
||||||
|
|
||||||
@ -62,11 +63,13 @@
|
|||||||
<Lesson-Progress
|
<Lesson-Progress
|
||||||
:lessonData='lessonData'
|
:lessonData='lessonData'
|
||||||
:triggerList='triggerList'
|
:triggerList='triggerList'
|
||||||
|
:accidentlist='accidentlist'
|
||||||
@addProgress="addProgress"
|
@addProgress="addProgress"
|
||||||
@changeProgressView="changeProgressView"
|
@changeProgressView="changeProgressView"
|
||||||
@removeProgress="removeProgress"
|
@removeProgress="removeProgress"
|
||||||
@selectModel="selectModel"
|
@selectModel="selectModel"
|
||||||
@deleteModel="deleteModel"
|
@deleteModel="deleteModel"
|
||||||
|
@deleteAccident="deleteAccident"
|
||||||
>
|
>
|
||||||
</Lesson-Progress>
|
</Lesson-Progress>
|
||||||
|
|
||||||
@ -163,6 +166,7 @@
|
|||||||
data:{},
|
data:{},
|
||||||
},
|
},
|
||||||
triggerList:[],
|
triggerList:[],
|
||||||
|
accidentlist:[],
|
||||||
lessonData:{
|
lessonData:{
|
||||||
lessonData:{
|
lessonData:{
|
||||||
lessonProgress:[
|
lessonProgress:[
|
||||||
@ -209,6 +213,7 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.updateTriggerList = this.updateTriggerList;
|
window.updateTriggerList = this.updateTriggerList;
|
||||||
|
window.jl3dUpdateAccidentlist = this.jl3dUpdateAccidentlist;
|
||||||
window.editAction = this.editAction;
|
window.editAction = this.editAction;
|
||||||
|
|
||||||
this.init(this.$route.query.lessonId);
|
this.init(this.$route.query.lessonId);
|
||||||
@ -257,6 +262,11 @@
|
|||||||
let assetModelData = this.jl3d.saveAssetModel();
|
let assetModelData = this.jl3d.saveAssetModel();
|
||||||
saveData.assetList = assetModelData.assetList;
|
saveData.assetList = assetModelData.assetList;
|
||||||
saveData.modelList = assetModelData.modelList;
|
saveData.modelList = assetModelData.modelList;
|
||||||
|
|
||||||
|
let accidentData = this.jl3d.saveAccidentModel();
|
||||||
|
|
||||||
|
saveData.accidentList = accidentData;
|
||||||
|
|
||||||
saveData.setup.examMode = this.examMode;
|
saveData.setup.examMode = this.examMode;
|
||||||
saveData.setup.checkedRole = this.checkedRole;
|
saveData.setup.checkedRole = this.checkedRole;
|
||||||
this.netData.data = JSON.stringify(saveData);
|
this.netData.data = JSON.stringify(saveData);
|
||||||
@ -291,6 +301,9 @@
|
|||||||
deleteModel(selectedModel){
|
deleteModel(selectedModel){
|
||||||
this.jl3d.deleteModel(selectedModel);
|
this.jl3d.deleteModel(selectedModel);
|
||||||
},
|
},
|
||||||
|
deleteAccident(selectedAccident){
|
||||||
|
this.jl3d.deleteAccident(selectedAccident);
|
||||||
|
},
|
||||||
setupclick(){
|
setupclick(){
|
||||||
|
|
||||||
this.showSetup = true;
|
this.showSetup = true;
|
||||||
@ -298,11 +311,16 @@
|
|||||||
createModel(assetData,mousePos){
|
createModel(assetData,mousePos){
|
||||||
this.jl3d.createModelTrigger(assetData,mousePos);
|
this.jl3d.createModelTrigger(assetData,mousePos);
|
||||||
},
|
},
|
||||||
|
createAccident(accidentData,mousePos){
|
||||||
|
this.jl3d.createAccident(accidentData,mousePos);
|
||||||
|
},
|
||||||
updateTriggerList(newTriggerList){
|
updateTriggerList(newTriggerList){
|
||||||
this.triggerList = newTriggerList;
|
this.triggerList = newTriggerList;
|
||||||
console.log(this.triggerList);
|
console.log(this.triggerList);
|
||||||
},
|
},
|
||||||
|
jl3dUpdateAccidentlist(newAccidentlist){
|
||||||
|
this.accidentlist = newAccidentlist;
|
||||||
|
},
|
||||||
editAction(type,value1,value2){
|
editAction(type,value1,value2){
|
||||||
this.jl3d.editActionManager(type,value1,value2);
|
this.jl3d.editActionManager(type,value1,value2);
|
||||||
},
|
},
|
||||||
|
@ -267,14 +267,17 @@
|
|||||||
userJob:"",
|
userJob:"",
|
||||||
};
|
};
|
||||||
loadData = JSON.parse(data.data.data);
|
loadData = JSON.parse(data.data.data);
|
||||||
this.examMode = loadData.setup.examMode;
|
if(this.$route.query.examMode == 1){
|
||||||
|
this.examMode = true;
|
||||||
|
}else{
|
||||||
|
this.examMode = loadData.setup.examMode;
|
||||||
|
}
|
||||||
if(loadData.setup.checkedRole.length == 0){
|
if(loadData.setup.checkedRole.length == 0){
|
||||||
this.showSelectJob = false;
|
this.showSelectJob = false;
|
||||||
}
|
}
|
||||||
this.selectJobList = loadData.setup.checkedRole;
|
this.selectJobList = loadData.setup.checkedRole;
|
||||||
this.jobPaneData.dataList = loadData.toolJobPane;
|
this.jobPaneData.dataList = loadData.toolJobPane;
|
||||||
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
|
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
|
||||||
console.log(loadData.lessonTools);
|
|
||||||
this.lessonTools = loadData.lessonTools;
|
this.lessonTools = loadData.lessonTools;
|
||||||
this.lessonData.loadLessonProgress(loadData.lessonProgress);
|
this.lessonData.loadLessonProgress(loadData.lessonProgress);
|
||||||
|
|
||||||
@ -295,13 +298,12 @@
|
|||||||
this.examStatus = newExamStatus;
|
this.examStatus = newExamStatus;
|
||||||
},
|
},
|
||||||
lessonEnd(){
|
lessonEnd(){
|
||||||
|
|
||||||
if(this.examMode == true){
|
if(this.examMode == true){
|
||||||
this.endExam = true;
|
this.endExam = true;
|
||||||
this.showResult();
|
this.showResult();
|
||||||
this.examStatus.time = this.lastPlayTime;
|
this.examStatus.time = this.lastPlayTime;
|
||||||
|
this.stopTime();
|
||||||
}
|
}
|
||||||
this.stopTime();
|
|
||||||
},
|
},
|
||||||
showResult(){
|
showResult(){
|
||||||
this.$refs.rtui.showdiv();
|
this.$refs.rtui.showdiv();
|
||||||
@ -311,7 +313,7 @@
|
|||||||
for(let i=0;i<this.jobPaneData.dataList.length;i++){
|
for(let i=0;i<this.jobPaneData.dataList.length;i++){
|
||||||
if(job == this.jobPaneData.dataList[i].name){
|
if(job == this.jobPaneData.dataList[i].name){
|
||||||
this.nowRole = this.jobPaneData.dataList[i].value;
|
this.nowRole = this.jobPaneData.dataList[i].value;
|
||||||
console.log(this.nowRole);
|
|
||||||
this.lessonMsg.userJob = job;
|
this.lessonMsg.userJob = job;
|
||||||
this.jl3d.initNowRole(this.nowRole);
|
this.jl3d.initNowRole(this.nowRole);
|
||||||
this.timeStart();
|
this.timeStart();
|
||||||
|
126
src/views/jlmap3d/lesson3dplayer/lesson3dselect.vue
Normal file
126
src/views/jlmap3d/lesson3dplayer/lesson3dselect.vue
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="jl3dmap3dMaintainer">
|
||||||
|
<div class="jl3dmap3dMaintainerSelect" :style="{'background-image': 'url('+localStatic+'/texture/bg.jpg)'}">
|
||||||
|
|
||||||
|
<div style="position:absolute;left:40%;top:20%;font-size:30px">
|
||||||
|
<el-row>
|
||||||
|
考试模式:
|
||||||
|
<el-switch
|
||||||
|
v-model="examMode"
|
||||||
|
active-text="开启考试模式"
|
||||||
|
inactive-text="关闭考试模式">
|
||||||
|
</el-switch>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="lesson3dSelectButton"
|
||||||
|
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
|
||||||
|
style="left:20%;top:40%;" @click="enterPlayer">单对屏蔽门无法开启</div>
|
||||||
|
|
||||||
|
<div class="lesson3dSelectButton"
|
||||||
|
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
|
||||||
|
style="left:60%;top:40%;" >单对屏蔽门无法关闭</div>
|
||||||
|
|
||||||
|
<div class="lesson3dSelectButton"
|
||||||
|
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
|
||||||
|
style="left:20%;top:70%;" >整列屏蔽门无法开启</div>
|
||||||
|
|
||||||
|
<div class="lesson3dSelectButton"
|
||||||
|
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
|
||||||
|
style="left:60%;top:70%;" >整列屏蔽门无法关闭</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||||
|
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
import bgPsdImg from '@/assets/bg_psd.png';
|
||||||
|
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
|
||||||
|
|
||||||
|
var train;
|
||||||
|
export default {
|
||||||
|
name: 'LessondSelect',
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
localStatic:JL3D_LOCAL_STATIC,
|
||||||
|
normalShow:false,
|
||||||
|
vrShow:false,
|
||||||
|
trainRescueShow:false,
|
||||||
|
examMode:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
// console.log("");
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
enterPlayer:function ( ) {
|
||||||
|
let examcode = 0;
|
||||||
|
if(this.examMode == true){
|
||||||
|
examcode = 1;
|
||||||
|
}
|
||||||
|
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'34',examMode:examcode} });
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@import "src/styles/mixin.scss";
|
||||||
|
|
||||||
|
|
||||||
|
.jl3dmap3dMaintainer {
|
||||||
|
position:absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 35;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jl3dmap3dMaintainerSelect{
|
||||||
|
position:absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 350;
|
||||||
|
top:0;
|
||||||
|
left:0;
|
||||||
|
// background-repeat:no-repeat;
|
||||||
|
z-index: 350;
|
||||||
|
background-size:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson3dSelectButton{
|
||||||
|
position:absolute;
|
||||||
|
width: 20%;
|
||||||
|
height: 20%;
|
||||||
|
position:absolute;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 25px;
|
||||||
|
line-height:100px;
|
||||||
|
background-size: 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
color:#FFF;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
@ -54,7 +54,7 @@
|
|||||||
handler: function (newVal, oldVal) {
|
handler: function (newVal, oldVal) {
|
||||||
|
|
||||||
if (newVal != oldVal) {
|
if (newVal != oldVal) {
|
||||||
console.log(this.lessonData.lessonData.lessonProgress[oldVal]);
|
// console.log(this.lessonData.lessonData.lessonProgress[oldVal]);
|
||||||
this.logTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
|
this.logTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
|
||||||
this.processTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
|
this.processTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
|
||||||
this.nowProcessText = this.lessonData.lessonData.lessonProgress[newVal].explainPane.text;
|
this.nowProcessText = this.lessonData.lessonData.lessonProgress[newVal].explainPane.text;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div class="resultMsgDiv">
|
<div class="resultMsgDiv">
|
||||||
<div v-for="(examItem,index) in examStatus.trueStep" style="width:100%;height:10%">
|
<div v-for="(examItem,index) in examStatus.trueStep" style="width:100%;height:10%">
|
||||||
<div>
|
<div>
|
||||||
{{examItem.explainPane.tittle}}
|
{{examItem.explainPane.text}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
得分:10分
|
得分:10分
|
||||||
@ -56,6 +56,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
showdiv(){
|
showdiv(){
|
||||||
this.divshow = true;
|
this.divshow = true;
|
||||||
|
console.log(this.divshow);
|
||||||
},
|
},
|
||||||
closediv(){
|
closediv(){
|
||||||
this.divshow = false;
|
this.divshow = false;
|
||||||
@ -79,7 +80,7 @@
|
|||||||
border-radius:10px;
|
border-radius:10px;
|
||||||
border:solid 2px #000;
|
border:solid 2px #000;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
z-index:1;
|
z-index:10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -482,14 +482,27 @@ export default {
|
|||||||
projectDevice: this.$route.query.projectDevice,
|
projectDevice: this.$route.query.projectDevice,
|
||||||
type: this.$route.query.type} });
|
type: this.$route.query.type} });
|
||||||
} else if (this.$route.query.type == 'CCTV') {
|
} else if (this.$route.query.type == 'CCTV') {
|
||||||
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
|
if (this.project == 'richorjoint') {
|
||||||
mapid:resp.data.map.id,
|
this.$router.push({
|
||||||
group:res.data.group,
|
path:'/jointTrainingNewCCTV',
|
||||||
lineCode: resp.data.map.lineCode,
|
query:{
|
||||||
project: getSessionStorage('project'),
|
mapid:resp.data.map.id,
|
||||||
projectDevice: this.$route.query.projectDevice,
|
group:res.data.group,
|
||||||
type: this.$route.query.type
|
project: getSessionStorage('project'),
|
||||||
} });
|
projectDevice: this.$route.query.projectDevice,
|
||||||
|
type: this.$route.query.type
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
|
||||||
|
mapid:resp.data.map.id,
|
||||||
|
group:res.data.group,
|
||||||
|
lineCode: resp.data.map.lineCode,
|
||||||
|
project: getSessionStorage('project'),
|
||||||
|
projectDevice: this.$route.query.projectDevice,
|
||||||
|
type: this.$route.query.type
|
||||||
|
} });
|
||||||
|
}
|
||||||
} else if (this.$route.query.type === 'DEPOT') {
|
} else if (this.$route.query.type === 'DEPOT') {
|
||||||
this.$router.push({ path: `/displayNew/demon`, query: {
|
this.$router.push({ path: `/displayNew/demon`, query: {
|
||||||
group: res.data.group,
|
group: res.data.group,
|
||||||
@ -567,8 +580,10 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else if(this.project === 'zzwwtest'){
|
} else if (this.project === 'zzwwtest') {
|
||||||
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} });
|
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} });
|
||||||
|
} else if (this.project === 'richorlesson3d') {
|
||||||
|
this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} });
|
||||||
} else {
|
} else {
|
||||||
if (this.teacherLogin) {
|
if (this.teacherLogin) {
|
||||||
this.$router.push({ path: '/info/organization/classManage?enter=teacher' });
|
this.$router.push({ path: '/info/organization/classManage?enter=teacher' });
|
||||||
|
90
src/views/newMap/jointTrainingNew/realCCTV.vue
Normal file
90
src/views/newMap/jointTrainingNew/realCCTV.vue
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<template>
|
||||||
|
<div class="jl3dpassflow">
|
||||||
|
<div id="jlReal3d" class="jlReal3d">
|
||||||
|
<div class="realCctv1">
|
||||||
|
<video id="myvideo0" class="video-js">
|
||||||
|
<source src="http://192.168.1.254/hls/cctv1.m3u8" type="application/x-mpegURL">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
<div class="realCctv2">
|
||||||
|
<video id="myvideo1" class="video-js">
|
||||||
|
<source src="http://192.168.1.254/hls/cctv2.m3u8" type="application/x-mpegURL">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="menudown">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button type="primary" @click="back">退出</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import Video from 'video.js';
|
||||||
|
import 'video.js/dist/video-js.css';
|
||||||
|
export default {
|
||||||
|
name:'RealCCTV',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
videoList:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
for (var i = 0; i < 2; i++) {
|
||||||
|
const videoPlay = new Video('myvideo' + i, {
|
||||||
|
controls: false,
|
||||||
|
autoplay: 'muted',
|
||||||
|
loop:true,
|
||||||
|
preload: 'auto',
|
||||||
|
width: window.innerWidth / 2 + 'px',
|
||||||
|
height: window.innerHeight + 'px',
|
||||||
|
hls: {
|
||||||
|
withCredentials: true
|
||||||
|
}
|
||||||
|
}, function () { console.log('videojs播放器初始化成功'); });
|
||||||
|
this.videoList.push(videoPlay);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
back() {
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.jl3dpassflow{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.jlReal3d{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 0;
|
||||||
|
font-size:0;
|
||||||
|
}
|
||||||
|
.realCctv1{
|
||||||
|
position: absolute;
|
||||||
|
width:50%;
|
||||||
|
height:50%;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
.realCctv2{
|
||||||
|
position: absolute;
|
||||||
|
width:50%;
|
||||||
|
height:50%;
|
||||||
|
left:50%;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
.menudown{
|
||||||
|
bottom:0;
|
||||||
|
right:0;
|
||||||
|
position:absolute;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.video-js video{
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -77,7 +77,8 @@ export default {
|
|||||||
x: skew.x,
|
x: skew.x,
|
||||||
y: skew.y
|
y: skew.y
|
||||||
},
|
},
|
||||||
normalPosition: 1 // 默认状态定位
|
pos: 'N' // 默认状态定位
|
||||||
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
};
|
};
|
||||||
const model = Object.assign(switchModel, data);
|
const model = Object.assign(switchModel, data);
|
||||||
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
||||||
@ -135,7 +136,8 @@ export default {
|
|||||||
x: skew.x,
|
x: skew.x,
|
||||||
y: skew.y
|
y: skew.y
|
||||||
},
|
},
|
||||||
normalPosition: 1 // 默认状态定位
|
pos: 'N' // 默认状态定位
|
||||||
|
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||||
};
|
};
|
||||||
const model = Object.assign(switchModel, data);
|
const model = Object.assign(switchModel, data);
|
||||||
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user