Merge remote-tracking branch 'origin/test'
# Conflicts: # .env.production
This commit is contained in:
commit
5bf48a83f0
@ -5,10 +5,10 @@ NODE_ENV = 'development'
|
|||||||
# base api
|
# base api
|
||||||
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
|
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
|
||||||
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
# VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
||||||
VUE_APP_VOICE_API = 'http://119.3.163.89/oss/joylink'
|
# VUE_APP_VOICE_API = 'http://119.3.163.89/oss/joylink'
|
||||||
VUE_APP_UPLOAD_API = 'http://joylink.club/jlfile'
|
# VUE_APP_UPLOAD_API = 'http://joylink.club/jlfile'
|
||||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
# VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||||
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
|
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
|
||||||
|
|
||||||
|
|
||||||
|
8
.env.heb
8
.env.heb
@ -3,7 +3,7 @@ NODE_ENV = 'production'
|
|||||||
VUE_APP_PRO = 'local'
|
VUE_APP_PRO = 'local'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://160.20.60.15:9000'
|
# VUE_APP_BASE_API = 'http://160.20.60.15:9000'
|
||||||
VUE_APP_VOICE_API = 'http://160.20.60.15/oss/joylink'
|
# VUE_APP_VOICE_API = 'http://160.20.60.15/oss/joylink'
|
||||||
VUE_APP_UPLOAD_API = 'http://160.20.60.15'
|
# VUE_APP_UPLOAD_API = 'http://160.20.60.15'
|
||||||
VUE_APP_BASE_SITE='http://160.20.60.15'
|
# VUE_APP_BASE_SITE='http://160.20.60.15'
|
||||||
|
@ -3,7 +3,7 @@ NODE_ENV = 'production'
|
|||||||
VUE_APP_PRO = 'ntyl'
|
VUE_APP_PRO = 'ntyl'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
# VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
# VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
# VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
# VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||||
VUE_APP_UPLOAD_API = 'https://joylink.club/jlfile/'
|
# VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
# VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
NODE_ENV = 'test'
|
NODE_ENV = 'test'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
# VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
# VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
# VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
# VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||||
|
@ -309,3 +309,10 @@ export function getUserDuration(params) {
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/** 获取单位二维码 */
|
||||||
|
export function getCompanyQrCode(orgId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/company/${orgId}/qrCode`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
import store from '@/store/index';
|
||||||
const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
|
const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
|
||||||
|
|
||||||
export const JL3D_LOCAL_STATIC = publicPath+"/static";
|
export const JL3D_LOCAL_STATIC = publicPath+"/static";
|
||||||
const BASE_UPLOAD_API = process.env.VUE_APP_UPLOAD_API;
|
const BASE_UPLOAD_API = store.state.user.uploadUrl;
|
||||||
export const BASE_ASSET_API = process.env.VUE_APP_VOICE_API;
|
export const BASE_ASSET_API = store.state.user.resourcesUrl;
|
||||||
// console.log(JL3D_LOCAL_STATIC);
|
// console.log(JL3D_LOCAL_STATIC);
|
||||||
// console.log(BASE_UPLOAD_API);
|
// console.log(BASE_UPLOAD_API);
|
||||||
// console.log(BASE_ASSET_API);
|
// console.log(BASE_ASSET_API);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
//获取三维课程草稿列表
|
||||||
export function getLesson3dDrftList(params) {
|
export function getLesson3dDrftList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/draft3dLesson/paging`,
|
url: `/api/draft3dLesson/paging`,
|
||||||
@ -7,7 +7,7 @@ export function getLesson3dDrftList(params) {
|
|||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//获取三维课程草稿数据
|
||||||
export function getLesson3dData(lessonId) {
|
export function getLesson3dData(lessonId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/draft3dLesson/${lessonId}`,
|
url: `/api/draft3dLesson/${lessonId}`,
|
||||||
@ -15,13 +15,47 @@ export function getLesson3dData(lessonId) {
|
|||||||
params: ''
|
params: ''
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//获取三维课程发布数据
|
||||||
|
export function getPublishLesson3dData(lessonId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/lesson3d/${lessonId}`,
|
||||||
|
method: 'get',
|
||||||
|
params: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//上架课程
|
||||||
|
export function onlineLesson3d(lessonId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/lesson3d/${lessonId}/online`,
|
||||||
|
method: 'put',
|
||||||
|
params: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//下架课程
|
||||||
|
export function offlineLesson3d(lessonId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/lesson3d/${lessonId}/offline`,
|
||||||
|
method: 'put',
|
||||||
|
params: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSelectLesson3dList(params) {
|
||||||
|
return request({
|
||||||
|
url: `/api/lesson3d/list`,
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查询发布课程
|
//查询发布课程
|
||||||
export function publishedLesson3d() {
|
export function publishedLesson3d(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/lesson3d/paging`,
|
url: `/api/lesson3d/paging`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: ''
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +73,7 @@ export function publishLesson3d(lessonId) {
|
|||||||
return request({
|
return request({
|
||||||
url: `/api/draft3dLesson/${lessonId}/publish`,
|
url: `/api/draft3dLesson/${lessonId}/publish`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ""
|
data: ''
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export const meansUrl = `/api/upload/MEANS?appId=${productIdentify}`;
|
|||||||
// export const regulationUrl = `/api/upload/regulation?appId=${productIdentify}`;
|
// export const regulationUrl = `/api/upload/regulation?appId=${productIdentify}`;
|
||||||
|
|
||||||
export function getUrl(relatedUrl) {
|
export function getUrl(relatedUrl) {
|
||||||
return `${process.env.VUE_APP_UPLOAD_API}${relatedUrl}`;
|
return `${this.$store.state.user.uploadUrl}${relatedUrl}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function uploadFile(url, data) {
|
export function uploadFile(url, data) {
|
||||||
|
@ -75,9 +75,9 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
size: 3,
|
size: 3,
|
||||||
action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
action: `${this.$store.state.user.uploadUrl}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
||||||
response: (res) => {
|
response: (res) => {
|
||||||
return `${process.env.VUE_APP_VOICE_API}${res.data}`;
|
return `${this.$store.state.user.resourcesUrl}${res.data}`;
|
||||||
},
|
},
|
||||||
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
|
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
|
||||||
sizeError: () => { that.$message.error('图片上传失败,图片大小限制3MB'); } // 图片超过大小的回调
|
sizeError: () => { that.$message.error('图片上传失败,图片大小限制3MB'); } // 图片超过大小的回调
|
||||||
|
@ -74,7 +74,9 @@ export default {
|
|||||||
courseDescription: 'Course description',
|
courseDescription: 'Course description',
|
||||||
editCourse: 'Edit course',
|
editCourse: 'Edit course',
|
||||||
createCourse: 'Create course',
|
createCourse: 'Create course',
|
||||||
courseRelease: 'Course release',
|
courseRelease: 'Course offonline',
|
||||||
|
courseOnline: 'Course online',
|
||||||
|
courseOffline: 'Course offonline',
|
||||||
releaseAssociatedCity: 'Release associated city:',
|
releaseAssociatedCity: 'Release associated city:',
|
||||||
releaseAssociatedMap: 'Release associated map:',
|
releaseAssociatedMap: 'Release associated map:',
|
||||||
trainingSequence: 'Training sequence',
|
trainingSequence: 'Training sequence',
|
||||||
|
@ -123,6 +123,8 @@ export default {
|
|||||||
|
|
||||||
coursePublishSuccessful: 'Successful course release',
|
coursePublishSuccessful: 'Successful course release',
|
||||||
coursePublishFailed: 'Course launch failed',
|
coursePublishFailed: 'Course launch failed',
|
||||||
|
offlineSuccessful: 'Successful offline',
|
||||||
|
offlineFailed: 'Course offline',
|
||||||
startOperationHint: 'This operation will start the task. Do you want to continue?',
|
startOperationHint: 'This operation will start the task. Do you want to continue?',
|
||||||
cancelsTaskHint: 'This action cancels the task. Do you want to continue?',
|
cancelsTaskHint: 'This action cancels the task. Do you want to continue?',
|
||||||
automaticGenerationTrainingSuccess: 'Automatic generation of training success',
|
automaticGenerationTrainingSuccess: 'Automatic generation of training success',
|
||||||
|
@ -74,6 +74,8 @@ export default {
|
|||||||
editCourse: '编辑课程',
|
editCourse: '编辑课程',
|
||||||
createCourse: '创建课程',
|
createCourse: '创建课程',
|
||||||
courseRelease: '课程发布',
|
courseRelease: '课程发布',
|
||||||
|
courseOnline: '课程上架',
|
||||||
|
courseOffline: '课程下架',
|
||||||
releaseAssociatedCity: '发布关联城市:',
|
releaseAssociatedCity: '发布关联城市:',
|
||||||
releaseAssociatedMap: '发布关联地图:',
|
releaseAssociatedMap: '发布关联地图:',
|
||||||
trainingSequence: '实训排序',
|
trainingSequence: '实训排序',
|
||||||
@ -124,4 +126,3 @@ export default {
|
|||||||
copy: '复制',
|
copy: '复制',
|
||||||
prdType:'产品类型'
|
prdType:'产品类型'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,6 +123,8 @@ export default {
|
|||||||
trainModelNameRepeat: '列车模型数据重复',
|
trainModelNameRepeat: '列车模型数据重复',
|
||||||
coursePublishSuccessful: '课程发布成功',
|
coursePublishSuccessful: '课程发布成功',
|
||||||
coursePublishFailed: '课程发布失败',
|
coursePublishFailed: '课程发布失败',
|
||||||
|
offlineSuccessful: '课程下架成功',
|
||||||
|
offlineFailed: '课程下架失败',
|
||||||
startOperationHint: '此操作将开始任务, 是否继续?',
|
startOperationHint: '此操作将开始任务, 是否继续?',
|
||||||
cancelsTaskHint: '此操作将取消任务, 是否继续?',
|
cancelsTaskHint: '此操作将取消任务, 是否继续?',
|
||||||
automaticGenerationTrainingSuccess: '自动生成实训成功',
|
automaticGenerationTrainingSuccess: '自动生成实训成功',
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
|
import store from '@/store/index';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
// 定于仿真socket接口
|
// 定于仿真socket接口
|
||||||
@ -43,7 +42,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
let header = {'X-Token': getToken() };
|
let header = {'X-Token': getToken() };
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:this.topic,
|
topic:this.topic,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
@ -364,7 +363,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
// if(data.code = "336"){
|
// if(data.code = "336"){
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// }
|
// }
|
||||||
|
if(rails.sectionrail[data.section]){
|
||||||
if(data.section != updateTrainModel.nowsection){
|
if(data.section != updateTrainModel.nowsection){
|
||||||
updateTrainModel.nowsection = data.section;
|
updateTrainModel.nowsection = data.section;
|
||||||
updateTrainModel.curve = rails.sectionrail[data.section].lineleft;
|
updateTrainModel.curve = rails.sectionrail[data.section].lineleft;
|
||||||
@ -522,6 +521,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
updateTrainModel.position.x = -100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,203 +540,168 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
trainmodel.code = data.code;
|
trainmodel.code = data.code;
|
||||||
trainmodel.nowcode = data.code;
|
trainmodel.nowcode = data.code;
|
||||||
}
|
}
|
||||||
|
if(rails.sectionrail[data.section]){
|
||||||
|
//改变当前列车行驶的区段code
|
||||||
|
if(data.section != trainmodel.nowsection){
|
||||||
|
trainmodel.nowsection = data.section;
|
||||||
|
trainmodel.curve = rails.sectionrail[data.section].lineleft;
|
||||||
|
}
|
||||||
|
|
||||||
//改变当前列车行驶的区段code
|
//判断转向
|
||||||
if(data.section != trainmodel.nowsection){
|
if(trainmodel.right != data.right){
|
||||||
trainmodel.nowsection = data.section;
|
|
||||||
trainmodel.curve = rails.sectionrail[data.section].lineleft;
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断转向
|
if(data.right == "0"){
|
||||||
if(trainmodel.right != data.right){
|
trainmodel.right = "0";
|
||||||
|
trainmodel.rotation.y = Math.PI;
|
||||||
|
let point = trainmodel.curve.getPointAt(data.offset);
|
||||||
|
trainmodel.position.x = point.x;
|
||||||
|
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
||||||
|
trainmodel.children[tl].position.z = point.z;
|
||||||
|
}
|
||||||
|
|
||||||
if(data.right == "0"){
|
if(trainmodel.openleft == "1"){
|
||||||
trainmodel.right = "0";
|
trainmodel.openleft = "0";
|
||||||
trainmodel.rotation.y = Math.PI;
|
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||||
let point = trainmodel.curve.getPointAt(data.offset);
|
actions["traindoor"].top[an].stop();
|
||||||
trainmodel.position.x = point.x;
|
}
|
||||||
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
trainmodel.openright = "1";
|
||||||
trainmodel.children[tl].position.z = point.z;
|
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||||
}
|
actions["traindoor"].down[an].reset();
|
||||||
|
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
|
||||||
|
actions["traindoor"].down[an].timeScale = 1;
|
||||||
|
actions["traindoor"].down[an].play();
|
||||||
|
}
|
||||||
|
}else if(trainmodel.openright == "1"){
|
||||||
|
trainmodel.openright = "0";
|
||||||
|
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||||
|
actions["traindoor"].down[an].stop();
|
||||||
|
}
|
||||||
|
trainmodel.openleft = "1";
|
||||||
|
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||||
|
actions["traindoor"].top[an].reset();
|
||||||
|
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||||
|
actions["traindoor"].top[an].timeScale = 1;
|
||||||
|
actions["traindoor"].top[an].play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(trainmodel.openleft == "1"){
|
}else{
|
||||||
trainmodel.openleft = "0";
|
trainmodel.right = "1";
|
||||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
trainmodel.rotation.y = 0;
|
||||||
actions["traindoor"].top[an].stop();
|
let point = trainmodel.curve.getPointAt(data.offset);
|
||||||
|
trainmodel.position.x = point.x;
|
||||||
|
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
||||||
|
trainmodel.children[tl].position.z = point.z;
|
||||||
}
|
}
|
||||||
trainmodel.openright = "1";
|
|
||||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].down[an].reset();
|
|
||||||
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
|
|
||||||
actions["traindoor"].down[an].timeScale = 1;
|
|
||||||
actions["traindoor"].down[an].play();
|
|
||||||
}
|
|
||||||
}else if(trainmodel.openright == "1"){
|
|
||||||
trainmodel.openright = "0";
|
|
||||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].down[an].stop();
|
|
||||||
}
|
|
||||||
trainmodel.openleft = "1";
|
|
||||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].top[an].reset();
|
|
||||||
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
|
||||||
actions["traindoor"].top[an].timeScale = 1;
|
|
||||||
actions["traindoor"].top[an].play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
if(trainmodel.openleft == "1"){
|
||||||
trainmodel.right = "1";
|
trainmodel.openleft = "0";
|
||||||
trainmodel.rotation.y = 0;
|
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||||
let point = trainmodel.curve.getPointAt(data.offset);
|
actions["traindoor"].top[an].stop();
|
||||||
trainmodel.position.x = point.x;
|
}
|
||||||
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
trainmodel.openright = "1";
|
||||||
trainmodel.children[tl].position.z = point.z;
|
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||||
}
|
actions["traindoor"].down[an].reset();
|
||||||
|
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
|
||||||
|
actions["traindoor"].down[an].timeScale = 1;
|
||||||
|
actions["traindoor"].down[an].play();
|
||||||
|
}
|
||||||
|
}else if(trainmodel.openright == "1"){
|
||||||
|
trainmodel.openright = "0";
|
||||||
|
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||||
|
actions["traindoor"].down[an].stop();
|
||||||
|
}
|
||||||
|
trainmodel.openleft = "1";
|
||||||
|
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||||
|
actions["traindoor"].top[an].reset();
|
||||||
|
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||||
|
actions["traindoor"].top[an].timeScale = 1;
|
||||||
|
actions["traindoor"].top[an].play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(trainmodel.openleft == "1"){
|
|
||||||
trainmodel.openleft = "0";
|
|
||||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].top[an].stop();
|
|
||||||
}
|
|
||||||
trainmodel.openright = "1";
|
|
||||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].down[an].reset();
|
|
||||||
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
|
|
||||||
actions["traindoor"].down[an].timeScale = 1;
|
|
||||||
actions["traindoor"].down[an].play();
|
|
||||||
}
|
|
||||||
}else if(trainmodel.openright == "1"){
|
|
||||||
trainmodel.openright = "0";
|
|
||||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].down[an].stop();
|
|
||||||
}
|
|
||||||
trainmodel.openleft = "1";
|
|
||||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
|
||||||
actions["traindoor"].top[an].reset();
|
|
||||||
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
|
||||||
actions["traindoor"].top[an].timeScale = 1;
|
|
||||||
actions["traindoor"].top[an].play();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
if(trainmodel.curve && trainmodel.offset != data.offset){
|
||||||
|
trainmodel.offset = data.offset;
|
||||||
if(trainmodel.curve && trainmodel.offset != data.offset){
|
let pos = trainmodel.curve.getPointAt(data.offset);
|
||||||
trainmodel.offset = data.offset;
|
trainmodel.position.x = pos.x;
|
||||||
let pos = trainmodel.curve.getPointAt(data.offset);
|
// trainmodel.children[0].position.z = pos.z;
|
||||||
trainmodel.position.x = pos.x;
|
if(data.right == "0"){
|
||||||
// trainmodel.children[0].position.z = pos.z;
|
if(-trainmodel.children[0].position.z != pos.z || trainmodel.children[0].position.y != pos.y){
|
||||||
if(data.right == "0"){
|
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||||
if(-trainmodel.children[0].position.z != pos.z || trainmodel.children[0].position.y != pos.y){
|
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
||||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||||
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
||||||
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
trainmodel.children[0].rotation.x = -Math.PI/2;
|
||||||
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
let newRotationZ = trainmodel.children[0].rotation.z;
|
||||||
trainmodel.children[0].rotation.x = -Math.PI/2;
|
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
||||||
let newRotationZ = trainmodel.children[0].rotation.z;
|
trainmodel.children[0].rotation.y = -newRotationZ;
|
||||||
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
|
||||||
trainmodel.children[0].rotation.y = -newRotationZ;
|
|
||||||
|
|
||||||
let rotas = {
|
|
||||||
posr:pos,
|
|
||||||
roty:trainmodel.children[0].rotation.y,
|
|
||||||
rotz:trainmodel.children[0].rotation.z
|
|
||||||
}
|
|
||||||
trainmodel.children[1].rotalist.push(rotas);
|
|
||||||
let offsetz = pos.z + trainmodel.children[0].position.z;
|
|
||||||
trainmodel.children[0].position.z -= offsetz;
|
|
||||||
|
|
||||||
// let offsety = pos.y - trainmodel.children[0].position.y;
|
|
||||||
// trainmodel.children[0].position.y += offsetz;
|
|
||||||
// trainmodel.position.z = point.z;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
|
||||||
|
|
||||||
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
|
||||||
//console.log(rs);
|
|
||||||
if(trainmodel.children[rs].rotalist[0]){
|
|
||||||
|
|
||||||
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) + parseFloat(trainmodel.children[rs].position.z);
|
|
||||||
trainmodel.children[rs].position.z -= offsetz;
|
|
||||||
|
|
||||||
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].position.y);
|
|
||||||
trainmodel.children[rs].position.y += offsety;
|
|
||||||
|
|
||||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
|
||||||
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
|
|
||||||
|
|
||||||
if(rs != trainmodel.children.length-1){
|
|
||||||
let asd = trainmodel.children[rs].rotalist[0];
|
|
||||||
trainmodel.children[rs+1].rotalist.push(asd);
|
|
||||||
|
|
||||||
}
|
|
||||||
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
|
|
||||||
|
|
||||||
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
|
|
||||||
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
|
|
||||||
trainmodel.children[rs].rotalist.splice(0,1)
|
|
||||||
xh--;
|
|
||||||
}else{
|
|
||||||
xh = trainmodel.children[rs].rotalist.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//console.log(trainmodel.children[rs].rotalist.length);
|
|
||||||
|
|
||||||
|
let rotas = {
|
||||||
|
posr:pos,
|
||||||
|
roty:trainmodel.children[0].rotation.y,
|
||||||
|
rotz:trainmodel.children[0].rotation.z
|
||||||
}
|
}
|
||||||
|
trainmodel.children[1].rotalist.push(rotas);
|
||||||
|
let offsetz = pos.z + trainmodel.children[0].position.z;
|
||||||
|
trainmodel.children[0].position.z -= offsetz;
|
||||||
|
|
||||||
|
// let offsety = pos.y - trainmodel.children[0].position.y;
|
||||||
|
// trainmodel.children[0].position.y += offsetz;
|
||||||
|
// trainmodel.position.z = point.z;
|
||||||
|
|
||||||
}
|
}
|
||||||
// console.log(trainmodel.rotalist);
|
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
||||||
//
|
//console.log(rs);
|
||||||
let rotas = {
|
if(trainmodel.children[rs].rotalist[0]){
|
||||||
posr:null,
|
|
||||||
roty:null,
|
|
||||||
rotz:null,
|
|
||||||
};
|
|
||||||
if(trainmodel.children[0].position.z < pos.z ){
|
|
||||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
|
||||||
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
|
||||||
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
|
||||||
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
|
||||||
trainmodel.children[0].rotation.x = -Math.PI/2;
|
|
||||||
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
|
||||||
trainmodel.children[0].rotation.y = 0;
|
|
||||||
|
|
||||||
rotas.posr = pos;
|
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) + parseFloat(trainmodel.children[rs].position.z);
|
||||||
// rotas.roty = trainmodel.children[0].rotation.y;
|
trainmodel.children[rs].position.z -= offsetz;
|
||||||
rotas.rotz = trainmodel.children[0].rotation.z;
|
|
||||||
|
|
||||||
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].position.y);
|
||||||
trainmodel.children[0].position.z += offsetz;
|
trainmodel.children[rs].position.y += offsety;
|
||||||
}else if(trainmodel.children[0].position.z > pos.z){
|
|
||||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
|
||||||
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
|
||||||
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
|
||||||
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
|
||||||
trainmodel.children[0].rotation.x = -Math.PI/2;
|
|
||||||
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
|
||||||
trainmodel.children[0].rotation.y = 0;
|
|
||||||
|
|
||||||
rotas.posr = pos;
|
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||||
// rotas.roty = trainmodel.children[0].rotation.y;
|
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
|
||||||
rotas.rotz = trainmodel.children[0].rotation.z;
|
|
||||||
|
|
||||||
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
if(rs != trainmodel.children.length-1){
|
||||||
trainmodel.children[0].position.z += offsetz;
|
let asd = trainmodel.children[rs].rotalist[0];
|
||||||
}
|
trainmodel.children[rs+1].rotalist.push(asd);
|
||||||
|
|
||||||
if(trainmodel.children[0].position.y != pos.y){
|
}
|
||||||
if(rotas.posr == null){
|
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
|
||||||
|
|
||||||
|
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
|
||||||
|
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
|
||||||
|
trainmodel.children[rs].rotalist.splice(0,1)
|
||||||
|
xh--;
|
||||||
|
}else{
|
||||||
|
xh = trainmodel.children[rs].rotalist.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log(trainmodel.children[rs].rotalist.length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// console.log(trainmodel.rotalist);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
//
|
||||||
|
let rotas = {
|
||||||
|
posr:null,
|
||||||
|
roty:null,
|
||||||
|
rotz:null,
|
||||||
|
};
|
||||||
|
if(trainmodel.children[0].position.z < pos.z ){
|
||||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||||
@ -744,64 +712,96 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
trainmodel.children[0].rotation.y = 0;
|
trainmodel.children[0].rotation.y = 0;
|
||||||
|
|
||||||
rotas.posr = pos;
|
rotas.posr = pos;
|
||||||
rotas.roty = trainmodel.children[0].rotation.y;
|
// rotas.roty = trainmodel.children[0].rotation.y;
|
||||||
|
rotas.rotz = trainmodel.children[0].rotation.z;
|
||||||
|
|
||||||
|
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
||||||
|
trainmodel.children[0].position.z += offsetz;
|
||||||
|
}else if(trainmodel.children[0].position.z > pos.z){
|
||||||
|
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||||
|
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
||||||
|
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||||
|
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
||||||
|
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
||||||
|
trainmodel.children[0].rotation.x = -Math.PI/2;
|
||||||
|
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
||||||
|
trainmodel.children[0].rotation.y = 0;
|
||||||
|
|
||||||
|
rotas.posr = pos;
|
||||||
|
// rotas.roty = trainmodel.children[0].rotation.y;
|
||||||
rotas.rotz = trainmodel.children[0].rotation.z;
|
rotas.rotz = trainmodel.children[0].rotation.z;
|
||||||
|
|
||||||
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
||||||
trainmodel.children[0].position.z += offsetz;
|
trainmodel.children[0].position.z += offsetz;
|
||||||
let offsety = parseFloat(pos.y) - parseFloat(trainmodel.children[0].position.y);
|
|
||||||
trainmodel.children[0].position.y += offsety;
|
|
||||||
}else{
|
|
||||||
rotas.roty = trainmodel.children[0].rotation.y;
|
|
||||||
let offsety = parseFloat(rotas.posr.y) - parseFloat(trainmodel.children[0].position.y);
|
|
||||||
trainmodel.children[0].position.y += offsety;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(rotas.posr!= null){
|
if(trainmodel.children[0].position.y != pos.y){
|
||||||
trainmodel.children[1].rotalist.push(rotas);
|
if(rotas.posr == null){
|
||||||
}
|
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
|
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
|
||||||
|
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||||
|
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
|
||||||
|
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
|
||||||
|
trainmodel.children[0].rotation.x = -Math.PI/2;
|
||||||
|
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
|
||||||
|
trainmodel.children[0].rotation.y = 0;
|
||||||
|
|
||||||
|
rotas.posr = pos;
|
||||||
|
rotas.roty = trainmodel.children[0].rotation.y;
|
||||||
|
rotas.rotz = trainmodel.children[0].rotation.z;
|
||||||
|
|
||||||
|
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
|
||||||
|
trainmodel.children[0].position.z += offsetz;
|
||||||
|
let offsety = parseFloat(pos.y) - parseFloat(trainmodel.children[0].position.y);
|
||||||
|
trainmodel.children[0].position.y += offsety;
|
||||||
|
}else{
|
||||||
|
rotas.roty = trainmodel.children[0].rotation.y;
|
||||||
|
let offsety = parseFloat(rotas.posr.y) - parseFloat(trainmodel.children[0].position.y);
|
||||||
|
trainmodel.children[0].position.y += offsety;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rotas.posr!= null){
|
||||||
|
trainmodel.children[1].rotalist.push(rotas);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||||
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
||||||
//console.log(rs);
|
//console.log(rs);
|
||||||
if(trainmodel.children[rs].rotalist[0]){
|
if(trainmodel.children[rs].rotalist[0]){
|
||||||
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
|
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
|
||||||
trainmodel.children[rs].position.z += offsetz;
|
trainmodel.children[rs].position.z += offsetz;
|
||||||
|
|
||||||
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].matrixWorld.elements[13]);
|
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].matrixWorld.elements[13]);
|
||||||
trainmodel.children[rs].position.y += offsety;
|
trainmodel.children[rs].position.y += offsety;
|
||||||
|
|
||||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||||
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
|
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||||
|
|
||||||
if(rs != trainmodel.children.length-1){
|
if(rs != trainmodel.children.length-1){
|
||||||
let asd = trainmodel.children[rs].rotalist[0];
|
let asd = trainmodel.children[rs].rotalist[0];
|
||||||
trainmodel.children[rs+1].rotalist.push(asd);
|
trainmodel.children[rs+1].rotalist.push(asd);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(trainmodel.children[rs].rotalist[0].roty != null){
|
||||||
|
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
|
||||||
|
}
|
||||||
|
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
|
||||||
|
trainmodel.children[rs].rotalist.splice(0,1)
|
||||||
|
xh--;
|
||||||
|
}else{
|
||||||
|
xh = trainmodel.children[rs].rotalist.length;
|
||||||
}
|
}
|
||||||
if(trainmodel.children[rs].rotalist[0].roty != null){
|
|
||||||
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
|
|
||||||
}
|
|
||||||
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
|
|
||||||
trainmodel.children[rs].rotalist.splice(0,1)
|
|
||||||
xh--;
|
|
||||||
}else{
|
|
||||||
xh = trainmodel.children[rs].rotalist.length;
|
|
||||||
}
|
}
|
||||||
|
//console.log(trainmodel.children[rs].rotalist.length);
|
||||||
}
|
}
|
||||||
//console.log(trainmodel.children[rs].rotalist.length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// let pos = ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initall(data){
|
function initall(data){
|
||||||
@ -1006,94 +1006,98 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
}
|
}
|
||||||
function signalupdate(data) {
|
function signalupdate(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
|
if(signallist.list[code]){
|
||||||
|
if(data.command == 'No'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 红 */
|
||||||
|
if(data.command == 'R'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 绿 */
|
||||||
|
if(data.command == 'G'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 黄 */
|
||||||
|
if(data.command == 'Y'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 月白 */
|
||||||
|
if(data.command == 'W'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 蓝 */
|
||||||
|
if(data.command == 'B'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 红黄 */
|
||||||
|
if(data.command == 'RY'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(data.command == 'No'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 红 */
|
|
||||||
if(data.command == 'R'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 绿 */
|
|
||||||
if(data.command == 'G'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 黄 */
|
|
||||||
if(data.command == 'Y'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 月白 */
|
|
||||||
if(data.command == 'W'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 蓝 */
|
|
||||||
if(data.command == 'B'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 红黄 */
|
|
||||||
if(data.command == 'RY'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initswitch(data) {
|
function initswitch(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
if (data.command == 'NP') {
|
if(actions[code]){
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
if (data.command == 'NP') {
|
||||||
actions[code].action.reset();
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
actions[code].action.time = 0;
|
actions[code].action.reset();
|
||||||
actions[code].action.timeScale = 1;
|
actions[code].action.time = 0;
|
||||||
actions[code].action.play();
|
actions[code].action.timeScale = 1;
|
||||||
actions[code].command = data.command;
|
actions[code].action.play();
|
||||||
} else if (data.command == 'RP') {
|
actions[code].command = data.command;
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
} else if (data.command == 'RP') {
|
||||||
actions[code].action.reset();
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
actions[code].action.time = actions[code].action._clip.duration;
|
actions[code].action.reset();
|
||||||
actions[code].action.timeScale = -1;
|
actions[code].action.time = actions[code].action._clip.duration;
|
||||||
actions[code].action.play();
|
actions[code].action.timeScale = -1;
|
||||||
actions[code].command = data.command;
|
actions[code].action.play();
|
||||||
|
actions[code].command = data.command;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchupdate(data) {
|
function switchupdate(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
if (actions[code].command != data.command) {
|
if (actions[code].command != data.command && actions[code]) {
|
||||||
if (data.command == 'NP') {
|
if (data.command == 'NP') {
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
actions[code].action.reset();
|
actions[code].action.reset();
|
||||||
|
@ -20,9 +20,9 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
|||||||
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||||
|
|
||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { sendCommandNew } from '@/api/jmap/training';
|
import { sendCommandNew } from '@/api/jmap/training';
|
||||||
|
import store from '@/store/index';
|
||||||
|
|
||||||
var clock = new THREE.Clock();
|
var clock = new THREE.Clock();
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
|
|||||||
|
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:'/user/queue/simulation/jl3d/'+group,
|
topic:'/user/queue/simulation/jl3d/'+group,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
|||||||
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||||
|
|
||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
import store from '@/store/index';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { sendCommandNew } from '@/api/jmap/training';
|
import { sendCommandNew } from '@/api/jmap/training';
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ export function Jl3dOtherVR(dom,group,skinCode) {
|
|||||||
|
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:'/user/queue/simulation/jl3d/'+group,
|
topic:'/user/queue/simulation/jl3d/'+group,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
|
@ -10,9 +10,9 @@ import { ModelManagerVR } from '@/jlmap3d/jl3dmaintainer/jl3dTrainRescue/trainre
|
|||||||
import { VRButton } from '@/jlmap3d/jl3dmaintainer/jl3dFaultDeviceVr/utils/VRButton.js';
|
import { VRButton } from '@/jlmap3d/jl3dmaintainer/jl3dFaultDeviceVr/utils/VRButton.js';
|
||||||
|
|
||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { sendCommandNew } from '@/api/jmap/training';
|
import { sendCommandNew } from '@/api/jmap/training';
|
||||||
|
import store from '@/store/index';
|
||||||
|
|
||||||
var clock = new THREE.Clock();
|
var clock = new THREE.Clock();
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
|
|||||||
|
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:'/user/queue/simulation/jl3d/'+group,
|
topic:'/user/queue/simulation/jl3d/'+group,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,8 @@ import StompClient from '@/utils/sock';
|
|||||||
|
|
||||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
import store from '@/store/index';
|
||||||
|
|
||||||
// 定于仿真socket接口
|
// 定于仿真socket接口
|
||||||
export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||||
@ -45,7 +45,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
|||||||
let header = {'X-Token': getToken() };
|
let header = {'X-Token': getToken() };
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:this.topic,
|
topic:this.topic,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
@ -325,175 +325,96 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
|||||||
function trainrunnew(data){
|
function trainrunnew(data){
|
||||||
let code = data.code;
|
let code = data.code;
|
||||||
|
|
||||||
if(trainlisttest.list[code].right != data.right){
|
if(rails.sectionrail[data.section]){
|
||||||
|
if(trainlisttest.list[code].right != data.right){
|
||||||
|
|
||||||
if(data.right == "0"){
|
if(data.right == "0"){
|
||||||
trainlisttest.list[code].right = "0";
|
trainlisttest.list[code].right = "0";
|
||||||
trainlisttest.list[code].rotation.y = Math.PI;
|
trainlisttest.list[code].rotation.y = Math.PI;
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
||||||
trainlisttest.list[code].position.x = point.x;
|
trainlisttest.list[code].position.x = point.x;
|
||||||
for (let tl=0; tl<6; tl++) {
|
for (let tl=0; tl<6; tl++) {
|
||||||
trainlisttest.list[code].children[tl].position.z = point.z;
|
trainlisttest.list[code].children[tl].position.z = point.z;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
trainlisttest.list[code].right = "1";
|
trainlisttest.list[code].right = "1";
|
||||||
trainlisttest.list[code].rotation.y = 0;
|
trainlisttest.list[code].rotation.y = 0;
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
||||||
trainlisttest.list[code].position.x = point.x;
|
trainlisttest.list[code].position.x = point.x;
|
||||||
for (let tl=0; tl<6; tl++) {
|
for (let tl=0; tl<6; tl++) {
|
||||||
trainlisttest.list[code].children[tl].position.z = point.z;
|
trainlisttest.list[code].children[tl].position.z = point.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
|
|
||||||
if(trainlisttest.list[code].dispose == "0"){
|
if(trainlisttest.list[code].dispose == "0"){
|
||||||
if (data.right == '1') { // 向右
|
if (data.right == '1') { // 向右
|
||||||
trainlisttest.list[code].right = '1';
|
trainlisttest.list[code].right = '1';
|
||||||
trainlisttest.list[code].progress = data.offset;
|
trainlisttest.list[code].progress = data.offset;
|
||||||
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||||
// if(rails.sectionrail[data.section].standTrack){
|
// if(rails.sectionrail[data.section].standTrack){
|
||||||
// trainlisttest.list[code].statsstop = 0;
|
// trainlisttest.list[code].statsstop = 0;
|
||||||
// }
|
// }
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||||
trainlisttest.list[code].rotation.y = 0;
|
trainlisttest.list[code].rotation.y = 0;
|
||||||
trainlisttest.list[code].position.x = point.x;
|
trainlisttest.list[code].position.x = point.x;
|
||||||
trainlisttest.list[code].position.y = 0;
|
trainlisttest.list[code].position.y = 0;
|
||||||
|
|
||||||
// for (let tl=0; tl<6; tl++) {
|
// for (let tl=0; tl<6; tl++) {
|
||||||
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
|
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
||||||
|
|
||||||
// if(data.next){
|
// if(data.next){
|
||||||
// trainlisttest.list[code].nextcode = data.next;
|
// trainlisttest.list[code].nextcode = data.next;
|
||||||
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
||||||
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||||
// }
|
// }
|
||||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||||
trainlisttest.list[code].status = '1';
|
trainlisttest.list[code].status = '1';
|
||||||
|
|
||||||
if(trainlisttest.list[code].children[0].position.z != point.z){
|
if(trainlisttest.list[code].children[0].position.z != point.z){
|
||||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
|
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
|
||||||
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
|
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
|
||||||
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
|
||||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
|
||||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
|
||||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
|
||||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
|
||||||
trainlisttest.list[code].children[0].rotation.y = 0;
|
|
||||||
let rotas = {
|
|
||||||
posr:point,
|
|
||||||
rota:trainlisttest.list[code].children[0].rotation.z
|
|
||||||
}
|
|
||||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
|
||||||
|
|
||||||
|
|
||||||
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
|
|
||||||
trainlisttest.list[code].children[0].position.z += offsetz;
|
|
||||||
}
|
|
||||||
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
|
||||||
for(let rs = 1;rs<6;rs++){
|
|
||||||
//console.log(rs);
|
|
||||||
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
|
||||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[rs].position.z += offsetz;
|
|
||||||
|
|
||||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
|
||||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
|
||||||
// if(trainlisttest.list[code].groupNumber == "005"){
|
|
||||||
// console.log("rs:"+rs);
|
|
||||||
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
|
|
||||||
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
|
|
||||||
// }
|
|
||||||
if(rs != 5){
|
|
||||||
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
|
||||||
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
|
||||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
|
||||||
xh--;
|
|
||||||
}else{
|
|
||||||
xh = trainlisttest.list[code].children[rs].rotalist.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if (data.right == '0') { // 向左
|
|
||||||
trainlisttest.list[code].right = '0';
|
|
||||||
trainlisttest.list[code].progress = 1-data.offset;
|
|
||||||
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
|
||||||
// if(rails.sectionrail[data.section].standTrack){
|
|
||||||
// trainlisttest.list[code].statsstop = 0;
|
|
||||||
// }
|
|
||||||
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
|
|
||||||
|
|
||||||
trainlisttest.list[code].rotation.y = Math.PI;
|
|
||||||
trainlisttest.list[code].position.x = point.x;
|
|
||||||
trainlisttest.list[code].position.y = 0;
|
|
||||||
|
|
||||||
// for (let tl=0; tl<6; tl++) {
|
|
||||||
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
|
||||||
// if(data.next){
|
|
||||||
// trainlisttest.list[code].nextcode = data.next;
|
|
||||||
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
|
||||||
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
|
||||||
// }
|
|
||||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
|
||||||
trainlisttest.list[code].status = '0';
|
|
||||||
if(-trainlisttest.list[code].children[0].position.z != point.z){
|
|
||||||
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
|
|
||||||
let tangent = rails.sectionrail[data.section].lineright.getTangentAt(data.offset).normalize();
|
|
||||||
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
||||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||||
trainlisttest.list[code].children[0].rotation.y = 0;
|
trainlisttest.list[code].children[0].rotation.y = 0;
|
||||||
|
|
||||||
let rotas = {
|
let rotas = {
|
||||||
posr:point,
|
posr:point,
|
||||||
rota:trainlisttest.list[code].children[0].rotation.z
|
rota:trainlisttest.list[code].children[0].rotation.z
|
||||||
}
|
}
|
||||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||||
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
|
|
||||||
trainlisttest.list[code].children[0].position.z -= offsetz;
|
|
||||||
// trainlisttest.list[code].position.z = point.z;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
|
||||||
|
|
||||||
for(let rs = 1;rs<6;rs++){
|
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
|
||||||
|
trainlisttest.list[code].children[0].position.z += offsetz;
|
||||||
|
}
|
||||||
|
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
||||||
|
for(let rs = 1;rs<6;rs++){
|
||||||
//console.log(rs);
|
//console.log(rs);
|
||||||
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
||||||
|
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
|
||||||
|
|
||||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
|
trainlisttest.list[code].children[rs].position.z += offsetz;
|
||||||
trainlisttest.list[code].children[rs].position.z -= offsetz;
|
|
||||||
|
|
||||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||||
|
// if(trainlisttest.list[code].groupNumber == "005"){
|
||||||
|
// console.log("rs:"+rs);
|
||||||
|
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
|
||||||
|
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
|
||||||
|
// }
|
||||||
if(rs != 5){
|
if(rs != 5){
|
||||||
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
||||||
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
||||||
|
|
||||||
}
|
}
|
||||||
//let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
||||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||||
@ -503,17 +424,101 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (data.right == '0') { // 向左
|
||||||
|
trainlisttest.list[code].right = '0';
|
||||||
|
trainlisttest.list[code].progress = 1-data.offset;
|
||||||
|
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||||
|
// if(rails.sectionrail[data.section].standTrack){
|
||||||
|
// trainlisttest.list[code].statsstop = 0;
|
||||||
|
// }
|
||||||
|
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
|
||||||
|
|
||||||
|
trainlisttest.list[code].rotation.y = Math.PI;
|
||||||
|
trainlisttest.list[code].position.x = point.x;
|
||||||
|
trainlisttest.list[code].position.y = 0;
|
||||||
|
|
||||||
|
// for (let tl=0; tl<6; tl++) {
|
||||||
|
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
||||||
|
// if(data.next){
|
||||||
|
// trainlisttest.list[code].nextcode = data.next;
|
||||||
|
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
||||||
|
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||||
|
// }
|
||||||
|
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||||
|
trainlisttest.list[code].status = '0';
|
||||||
|
if(-trainlisttest.list[code].children[0].position.z != point.z){
|
||||||
|
|
||||||
|
|
||||||
|
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
|
let tangent = rails.sectionrail[data.section].lineright.getTangentAt(data.offset).normalize();
|
||||||
|
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
||||||
|
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||||
|
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||||
|
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||||
|
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||||
|
trainlisttest.list[code].children[0].rotation.y = 0;
|
||||||
|
|
||||||
|
let rotas = {
|
||||||
|
posr:point,
|
||||||
|
rota:trainlisttest.list[code].children[0].rotation.z
|
||||||
|
}
|
||||||
|
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||||
|
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
|
||||||
|
trainlisttest.list[code].children[0].position.z -= offsetz;
|
||||||
|
// trainlisttest.list[code].position.z = point.z;
|
||||||
|
|
||||||
}
|
}
|
||||||
// console.log(trainlisttest.list[code].rotalist);
|
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
||||||
|
|
||||||
|
for(let rs = 1;rs<6;rs++){
|
||||||
|
//console.log(rs);
|
||||||
|
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
||||||
|
|
||||||
|
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
|
||||||
|
trainlisttest.list[code].children[rs].position.z -= offsetz;
|
||||||
|
|
||||||
|
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||||
|
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||||
|
|
||||||
|
if(rs != 5){
|
||||||
|
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
||||||
|
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
||||||
|
|
||||||
|
}
|
||||||
|
//let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
|
||||||
|
|
||||||
|
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
||||||
|
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||||
|
xh--;
|
||||||
|
}else{
|
||||||
|
xh = trainlisttest.list[code].children[rs].rotalist.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// console.log(trainlisttest.list[code].rotalist);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
trainlisttest.list[code].position.x = -100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function trainrun(data){
|
function trainrun(data){
|
||||||
let code = data.code;
|
let code = data.code;
|
||||||
@ -871,95 +876,75 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
|||||||
|
|
||||||
function signalupdate(data) {
|
function signalupdate(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
if(data.command == 'No'){
|
if(signallist.list[code]){
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
if(data.command == 'No'){
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 红 */
|
||||||
|
if(data.command == 'R'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 绿 */
|
||||||
|
if(data.command == 'G'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 黄 */
|
||||||
|
if(data.command == 'Y'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 月白 */
|
||||||
|
if(data.command == 'W'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 蓝 */
|
||||||
|
if(data.command == 'B'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
|
/** 红黄 */
|
||||||
|
if(data.command == 'RY'){
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||||
|
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/** 红 */
|
|
||||||
if(data.command == 'R'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 绿 */
|
|
||||||
if(data.command == 'G'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 黄 */
|
|
||||||
if(data.command == 'Y'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 月白 */
|
|
||||||
if(data.command == 'W'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 蓝 */
|
|
||||||
if(data.command == 'B'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
/** 红黄 */
|
|
||||||
if(data.command == 'RY'){
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
|
||||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initswitch(data) {
|
function initswitch(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
if (data.command == 'NP') {
|
if(actions[code]){
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
|
||||||
actions[code].action.reset();
|
|
||||||
actions[code].action.time = 0;
|
|
||||||
actions[code].action.timeScale = 1;
|
|
||||||
actions[code].action.play();
|
|
||||||
actions[code].command = data.command;
|
|
||||||
} else if (data.command == 'RP') {
|
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
|
||||||
actions[code].action.reset();
|
|
||||||
actions[code].action.time = actions[code].action._clip.duration;
|
|
||||||
actions[code].action.timeScale = -1;
|
|
||||||
actions[code].action.play();
|
|
||||||
actions[code].command = data.command;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchupdate(data) {
|
|
||||||
code = data.code;
|
|
||||||
|
|
||||||
if (actions[code].command != data.command) {
|
|
||||||
if (data.command == 'NP') {
|
if (data.command == 'NP') {
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
actions[code].action.reset();
|
actions[code].action.reset();
|
||||||
@ -976,6 +961,32 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
|||||||
actions[code].command = data.command;
|
actions[code].command = data.command;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchupdate(data) {
|
||||||
|
code = data.code;
|
||||||
|
if(actions[code]){
|
||||||
|
if (actions[code].command != data.command) {
|
||||||
|
if (data.command == 'NP') {
|
||||||
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
|
actions[code].action.reset();
|
||||||
|
actions[code].action.time = 0;
|
||||||
|
actions[code].action.timeScale = 1;
|
||||||
|
actions[code].action.play();
|
||||||
|
actions[code].command = data.command;
|
||||||
|
} else if (data.command == 'RP') {
|
||||||
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
|
actions[code].action.reset();
|
||||||
|
actions[code].action.time = actions[code].action._clip.duration;
|
||||||
|
actions[code].action.timeScale = -1;
|
||||||
|
actions[code].action.play();
|
||||||
|
actions[code].command = data.command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function simulationreset(data){
|
function simulationreset(data){
|
||||||
for(let i=0;i<trainlisttest.group.children.length;i++){
|
for(let i=0;i<trainlisttest.group.children.length;i++){
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { AssetModel } from '@/jlmap3d/main/loaders/model/Assetmodel';
|
import { AssetModel } from '@/jlmap3d/main/loaders/model/Assetmodel';
|
||||||
import { Assetmaterial } from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
import { Assetmaterial } from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
import store from '@/store/index';
|
||||||
import { Loading } from 'element-ui';
|
import { Loading } from 'element-ui';
|
||||||
const BASE_API = getBaseUrl();
|
const BASE_API = store.state.user.baseUrl;
|
||||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
|
||||||
let signal5 = {
|
let signal5 = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
|
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
import store from '@/store/index';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
// 定于仿真socket接口
|
// 定于仿真socket接口
|
||||||
@ -45,7 +45,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
|||||||
let header = {'X-Token': getToken() };
|
let header = {'X-Token': getToken() };
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:this.topic,
|
topic:this.topic,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ import StompClient from '@/utils/sock';
|
|||||||
|
|
||||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
import store from '@/store/index';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
// 定于仿真socket接口
|
// 定于仿真socket接口
|
||||||
@ -46,7 +46,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
|||||||
let header = {'X-Token': getToken() };
|
let header = {'X-Token': getToken() };
|
||||||
let connectmsg = {
|
let connectmsg = {
|
||||||
type:'init',
|
type:'init',
|
||||||
baseurl:getBaseUrl(),
|
baseurl:store.state.user.baseUrl,
|
||||||
topic:this.topic,
|
topic:this.topic,
|
||||||
token:getToken(),
|
token:getToken(),
|
||||||
};
|
};
|
||||||
@ -165,256 +165,169 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
|||||||
|
|
||||||
function trainRunNew(data){
|
function trainRunNew(data){
|
||||||
let code = data.code;
|
let code = data.code;
|
||||||
if(trainlisttest.list[code].right != data.right){
|
if(rails.sectionrail[data.section]){
|
||||||
if(data.right == "0"){
|
if(trainlisttest.list[code].right != data.right){
|
||||||
|
if(data.right == "0"){
|
||||||
|
|
||||||
trainlisttest.list[code].right = "0";
|
trainlisttest.list[code].right = "0";
|
||||||
trainlisttest.list[code].rotation.y = Math.PI;
|
trainlisttest.list[code].rotation.y = Math.PI;
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
||||||
trainlisttest.list[code].children[0].rotalist = [];
|
trainlisttest.list[code].children[0].rotalist = [];
|
||||||
|
|
||||||
trainlisttest.list[code].children[0].position.z = parseFloat(-point.z);
|
trainlisttest.list[code].children[0].position.z = parseFloat(-point.z);
|
||||||
|
|
||||||
for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
|
for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
|
||||||
trainlisttest.list[code].children[tl].rotalist = [];
|
trainlisttest.list[code].children[tl].rotalist = [];
|
||||||
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
|
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
|
||||||
}
|
|
||||||
|
|
||||||
if(trainlisttest.list[code].openleft == "1"){
|
|
||||||
trainlisttest.list[code].openleft = "0";
|
|
||||||
for(let an=actions[code].top.length-1;an>=0;an--){
|
|
||||||
actions[code].top[an].stop();
|
|
||||||
}
|
}
|
||||||
trainlisttest.list[code].openright = "1";
|
|
||||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
|
||||||
actions[code].down[an].reset();
|
|
||||||
actions[code].down[an].time = actions[code].down[an]._clip.duration;
|
|
||||||
actions[code].down[an].timeScale = 1;
|
|
||||||
actions[code].down[an].play();
|
|
||||||
}
|
|
||||||
}else if(trainlisttest.list[code].openright == "1"){
|
|
||||||
trainlisttest.list[code].openright = "0";
|
|
||||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
|
||||||
actions[code].down[an].stop();
|
|
||||||
}
|
|
||||||
trainlisttest.list[code].openleft = "1";
|
|
||||||
for(let an=actions[code].top.length-1;an>=0;an--){
|
|
||||||
actions[code].top[an].reset();
|
|
||||||
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
|
||||||
actions[code].top[an].timeScale = 1;
|
|
||||||
actions[code].top[an].play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(trainlisttest.list[code].openleft == "1"){
|
||||||
}
|
trainlisttest.list[code].openleft = "0";
|
||||||
if(data.right == "1"){
|
for(let an=actions[code].top.length-1;an>=0;an--){
|
||||||
trainlisttest.list[code].right = "1";
|
actions[code].top[an].stop();
|
||||||
trainlisttest.list[code].rotation.y = 0;
|
}
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
trainlisttest.list[code].openright = "1";
|
||||||
trainlisttest.list[code].position.x = point.x;
|
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||||
trainlisttest.list[code].children[0].rotalist = [];
|
actions[code].down[an].reset();
|
||||||
trainlisttest.list[code].children[0].position.z = parseFloat(point.z);
|
actions[code].down[an].time = actions[code].down[an]._clip.duration;
|
||||||
for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
|
actions[code].down[an].timeScale = 1;
|
||||||
trainlisttest.list[code].children[tl].rotalist = [];
|
actions[code].down[an].play();
|
||||||
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
|
}
|
||||||
}
|
}else if(trainlisttest.list[code].openright == "1"){
|
||||||
|
trainlisttest.list[code].openright = "0";
|
||||||
if(trainlisttest.list[code].openleft == "1"){
|
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||||
trainlisttest.list[code].openleft = "0";
|
actions[code].down[an].stop();
|
||||||
for(let an=actions[code].top.length-1;an>=0;an--){
|
}
|
||||||
actions[code].top[an].stop();
|
trainlisttest.list[code].openleft = "1";
|
||||||
}
|
for(let an=actions[code].top.length-1;an>=0;an--){
|
||||||
trainlisttest.list[code].openright = "1";
|
actions[code].top[an].reset();
|
||||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
||||||
actions[code].down[an].reset();
|
actions[code].top[an].timeScale = 1;
|
||||||
actions[code].down[an].time = actions[code].down[an]._clip.duration;
|
actions[code].top[an].play();
|
||||||
actions[code].down[an].timeScale = 1;
|
|
||||||
actions[code].down[an].play();
|
|
||||||
}
|
|
||||||
}else if(trainlisttest.list[code].openright == "1"){
|
|
||||||
trainlisttest.list[code].openright = "0";
|
|
||||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
|
||||||
actions[code].down[an].stop();
|
|
||||||
}
|
|
||||||
trainlisttest.list[code].openleft = "1";
|
|
||||||
for(let an=actions[code].top.length-1;an>=0;an--){
|
|
||||||
actions[code].top[an].reset();
|
|
||||||
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
|
||||||
actions[code].top[an].timeScale = 1;
|
|
||||||
actions[code].top[an].play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.log(data);
|
|
||||||
|
|
||||||
if(trainlisttest.list[code].dispose == "0"){
|
|
||||||
if (data.right == '1') { // 向右
|
|
||||||
trainlisttest.list[code].right = '1';
|
|
||||||
trainlisttest.list[code].progress = data.offset;
|
|
||||||
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
|
||||||
// if(rails.sectionrail[data.section].standTrack){
|
|
||||||
// trainlisttest.list[code].statsstop = 0;
|
|
||||||
// }
|
|
||||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
|
|
||||||
trainlisttest.list[code].rotation.y = 0;
|
|
||||||
trainlisttest.list[code].position.x = point.x;
|
|
||||||
trainlisttest.list[code].position.y = 0;
|
|
||||||
|
|
||||||
// for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
|
|
||||||
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
|
||||||
|
|
||||||
// if(data.next){
|
|
||||||
// trainlisttest.list[code].nextcode = data.next;
|
|
||||||
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
|
||||||
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
|
||||||
// }
|
|
||||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
|
||||||
trainlisttest.list[code].status = '1';
|
|
||||||
if(trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
|
|
||||||
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
|
|
||||||
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
|
||||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
|
||||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
|
||||||
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
|
||||||
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
|
||||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
|
||||||
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
|
||||||
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
|
||||||
let rotas = {
|
|
||||||
posr:point,
|
|
||||||
roty:trainlisttest.list[code].children[0].rotation.y,
|
|
||||||
rotz:trainlisttest.list[code].children[0].rotation.z
|
|
||||||
}
|
|
||||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
|
||||||
|
|
||||||
|
|
||||||
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
|
|
||||||
trainlisttest.list[code].children[0].position.z += offsetz;
|
|
||||||
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
|
||||||
trainlisttest.list[code].children[0].position.y += offsety;
|
|
||||||
}
|
|
||||||
// if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
|
||||||
for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
|
|
||||||
//console.log(rs);
|
|
||||||
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
|
||||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
|
|
||||||
trainlisttest.list[code].children[rs].position.z += offsetz;
|
|
||||||
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
|
||||||
trainlisttest.list[code].children[rs].position.y += offsety;
|
|
||||||
|
|
||||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
|
||||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
|
||||||
// if(trainlisttest.list[code].groupNumber == "005"){
|
|
||||||
// console.log("rs:"+rs);
|
|
||||||
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
|
|
||||||
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
|
|
||||||
// }
|
|
||||||
if(rs != (trainlisttest.list[code].children.length-1)){
|
|
||||||
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
|
||||||
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
|
||||||
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
|
||||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
|
||||||
xh--;
|
|
||||||
}else{
|
|
||||||
xh = trainlisttest.list[code].children[rs].rotalist.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if(data.right == "1"){
|
||||||
|
trainlisttest.list[code].right = "1";
|
||||||
|
trainlisttest.list[code].rotation.y = 0;
|
||||||
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
|
||||||
|
trainlisttest.list[code].position.x = point.x;
|
||||||
|
trainlisttest.list[code].children[0].rotalist = [];
|
||||||
|
trainlisttest.list[code].children[0].position.z = parseFloat(point.z);
|
||||||
|
for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
|
||||||
|
trainlisttest.list[code].children[tl].rotalist = [];
|
||||||
|
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (data.right == '0') { // 向左
|
if(trainlisttest.list[code].openleft == "1"){
|
||||||
|
trainlisttest.list[code].openleft = "0";
|
||||||
|
for(let an=actions[code].top.length-1;an>=0;an--){
|
||||||
|
actions[code].top[an].stop();
|
||||||
|
}
|
||||||
|
trainlisttest.list[code].openright = "1";
|
||||||
|
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||||
|
actions[code].down[an].reset();
|
||||||
|
actions[code].down[an].time = actions[code].down[an]._clip.duration;
|
||||||
|
actions[code].down[an].timeScale = 1;
|
||||||
|
actions[code].down[an].play();
|
||||||
|
}
|
||||||
|
}else if(trainlisttest.list[code].openright == "1"){
|
||||||
|
trainlisttest.list[code].openright = "0";
|
||||||
|
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||||
|
actions[code].down[an].stop();
|
||||||
|
}
|
||||||
|
trainlisttest.list[code].openleft = "1";
|
||||||
|
for(let an=actions[code].top.length-1;an>=0;an--){
|
||||||
|
actions[code].top[an].reset();
|
||||||
|
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
||||||
|
actions[code].top[an].timeScale = 1;
|
||||||
|
actions[code].top[an].play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
trainlisttest.list[code].right = '0';
|
// console.log(data);
|
||||||
trainlisttest.list[code].progress = 1-data.offset;
|
|
||||||
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
|
||||||
// if(rails.sectionrail[data.section].standTrack){
|
|
||||||
// trainlisttest.list[code].statsstop = 0;
|
|
||||||
// }
|
|
||||||
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
|
|
||||||
|
|
||||||
trainlisttest.list[code].rotation.y = Math.PI;
|
if(trainlisttest.list[code].dispose == "0"){
|
||||||
trainlisttest.list[code].position.x = point.x;
|
if (data.right == '1') { // 向右
|
||||||
trainlisttest.list[code].position.y = 0;
|
trainlisttest.list[code].right = '1';
|
||||||
|
trainlisttest.list[code].progress = data.offset;
|
||||||
|
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||||
|
// if(rails.sectionrail[data.section].standTrack){
|
||||||
|
// trainlisttest.list[code].statsstop = 0;
|
||||||
|
// }
|
||||||
|
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||||
|
trainlisttest.list[code].rotation.y = 0;
|
||||||
|
trainlisttest.list[code].position.x = point.x;
|
||||||
|
trainlisttest.list[code].position.y = 0;
|
||||||
|
|
||||||
// for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
|
// for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
|
||||||
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
|
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
||||||
// if(data.next){
|
|
||||||
// trainlisttest.list[code].nextcode = data.next;
|
|
||||||
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
|
||||||
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
|
||||||
// }
|
|
||||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
|
||||||
trainlisttest.list[code].status = '0';
|
|
||||||
|
|
||||||
if(-trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
// if(data.next){
|
||||||
|
// trainlisttest.list[code].nextcode = data.next;
|
||||||
|
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
||||||
|
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||||
|
// }
|
||||||
|
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||||
|
trainlisttest.list[code].status = '1';
|
||||||
|
if(trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
||||||
|
|
||||||
|
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
|
||||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
|
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
|
||||||
let tangent = rails.sectionrail[data.section].lineright.getTangentAt(data.offset).normalize();
|
|
||||||
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
||||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||||
|
|
||||||
|
|
||||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||||
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
||||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||||
trainlisttest.list[code].children[0].rotation.y = 0;
|
|
||||||
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
||||||
|
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
||||||
let rotas = {
|
let rotas = {
|
||||||
posr:point,
|
posr:point,
|
||||||
roty:trainlisttest.list[code].children[0].rotation.y,
|
roty:trainlisttest.list[code].children[0].rotation.y,
|
||||||
rotz:trainlisttest.list[code].children[0].rotation.z
|
rotz:trainlisttest.list[code].children[0].rotation.z
|
||||||
}
|
}
|
||||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||||
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
|
|
||||||
trainlisttest.list[code].children[0].position.z -= offsetz;
|
|
||||||
|
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
|
||||||
|
trainlisttest.list[code].children[0].position.z += offsetz;
|
||||||
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
||||||
trainlisttest.list[code].children[0].position.y += offsety;
|
trainlisttest.list[code].children[0].position.y += offsety;
|
||||||
// trainlisttest.list[code].position.z = point.z;
|
}
|
||||||
|
// if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
||||||
}
|
for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
|
||||||
// if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
|
||||||
|
|
||||||
for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
|
|
||||||
//console.log(rs);
|
//console.log(rs);
|
||||||
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
||||||
|
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
|
||||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
|
trainlisttest.list[code].children[rs].position.z += offsetz;
|
||||||
trainlisttest.list[code].children[rs].position.z -= offsetz;
|
|
||||||
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
||||||
trainlisttest.list[code].children[rs].position.y += offsety;
|
trainlisttest.list[code].children[rs].position.y += offsety;
|
||||||
|
|
||||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||||
|
// if(trainlisttest.list[code].groupNumber == "005"){
|
||||||
|
// console.log("rs:"+rs);
|
||||||
|
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
|
||||||
|
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
|
||||||
|
// }
|
||||||
if(rs != (trainlisttest.list[code].children.length-1)){
|
if(rs != (trainlisttest.list[code].children.length-1)){
|
||||||
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
||||||
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
||||||
|
|
||||||
}
|
}
|
||||||
let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
|
|
||||||
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
|
||||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
||||||
|
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
||||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||||
xh--;
|
xh--;
|
||||||
}else{
|
}else{
|
||||||
@ -422,17 +335,109 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (data.right == '0') { // 向左
|
||||||
|
|
||||||
|
trainlisttest.list[code].right = '0';
|
||||||
|
trainlisttest.list[code].progress = 1-data.offset;
|
||||||
|
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||||
|
// if(rails.sectionrail[data.section].standTrack){
|
||||||
|
// trainlisttest.list[code].statsstop = 0;
|
||||||
|
// }
|
||||||
|
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
|
||||||
|
|
||||||
|
trainlisttest.list[code].rotation.y = Math.PI;
|
||||||
|
trainlisttest.list[code].position.x = point.x;
|
||||||
|
trainlisttest.list[code].position.y = 0;
|
||||||
|
|
||||||
|
// for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
|
||||||
|
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
||||||
|
// if(data.next){
|
||||||
|
// trainlisttest.list[code].nextcode = data.next;
|
||||||
|
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
||||||
|
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||||
|
// }
|
||||||
|
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||||
|
trainlisttest.list[code].status = '0';
|
||||||
|
|
||||||
|
if(-trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
||||||
|
|
||||||
|
|
||||||
|
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
|
let tangent = rails.sectionrail[data.section].lineright.getTangentAt(data.offset).normalize();
|
||||||
|
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
||||||
|
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||||
|
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||||
|
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||||
|
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
||||||
|
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||||
|
trainlisttest.list[code].children[0].rotation.y = 0;
|
||||||
|
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
||||||
|
|
||||||
|
let rotas = {
|
||||||
|
posr:point,
|
||||||
|
roty:trainlisttest.list[code].children[0].rotation.y,
|
||||||
|
rotz:trainlisttest.list[code].children[0].rotation.z
|
||||||
|
}
|
||||||
|
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||||
|
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
|
||||||
|
trainlisttest.list[code].children[0].position.z -= offsetz;
|
||||||
|
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
||||||
|
trainlisttest.list[code].children[0].position.y += offsety;
|
||||||
|
// trainlisttest.list[code].position.z = point.z;
|
||||||
|
|
||||||
}
|
}
|
||||||
// console.log(trainlisttest.list[code].rotalist);
|
// if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
||||||
// }
|
|
||||||
|
for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
|
||||||
|
//console.log(rs);
|
||||||
|
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
||||||
|
|
||||||
|
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
|
||||||
|
trainlisttest.list[code].children[rs].position.z -= offsetz;
|
||||||
|
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
||||||
|
trainlisttest.list[code].children[rs].position.y += offsety;
|
||||||
|
|
||||||
|
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||||
|
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||||
|
|
||||||
|
if(rs != (trainlisttest.list[code].children.length-1)){
|
||||||
|
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
||||||
|
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
||||||
|
}
|
||||||
|
let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
|
||||||
|
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
||||||
|
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
||||||
|
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||||
|
xh--;
|
||||||
|
}else{
|
||||||
|
xh = trainlisttest.list[code].children[rs].rotalist.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// console.log(trainlisttest.list[code].rotalist);
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
trainlisttest.list[code].position.x = -1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function trainrun(data){
|
function trainrun(data){
|
||||||
let code = data.code;
|
let code = data.code;
|
||||||
@ -868,26 +873,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
|||||||
|
|
||||||
function initswitch(data) {
|
function initswitch(data) {
|
||||||
code = data.code;
|
code = data.code;
|
||||||
if (data.command == 'NP') {
|
if(actions[code]){
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
|
||||||
actions[code].action.reset();
|
|
||||||
actions[code].action.time = 0;
|
|
||||||
actions[code].action.timeScale = 1;
|
|
||||||
actions[code].action.play();
|
|
||||||
actions[code].command = data.command;
|
|
||||||
} else if (data.command == 'RP') {
|
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
|
||||||
actions[code].action.reset();
|
|
||||||
actions[code].action.time = actions[code].action._clip.duration;
|
|
||||||
actions[code].action.timeScale = -1;
|
|
||||||
actions[code].action.play();
|
|
||||||
actions[code].command = data.command;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchupdate(data) {
|
|
||||||
code = data.code;
|
|
||||||
if (actions[code].command != data.command) {
|
|
||||||
if (data.command == 'NP') {
|
if (data.command == 'NP') {
|
||||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
actions[code].action.reset();
|
actions[code].action.reset();
|
||||||
@ -905,6 +891,30 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switchupdate(data) {
|
||||||
|
code = data.code;
|
||||||
|
if(actions[code]){
|
||||||
|
if (actions[code].command != data.command) {
|
||||||
|
if (data.command == 'NP') {
|
||||||
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
|
actions[code].action.reset();
|
||||||
|
actions[code].action.time = 0;
|
||||||
|
actions[code].action.timeScale = 1;
|
||||||
|
actions[code].action.play();
|
||||||
|
actions[code].command = data.command;
|
||||||
|
} else if (data.command == 'RP') {
|
||||||
|
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||||
|
actions[code].action.reset();
|
||||||
|
actions[code].action.time = actions[code].action._clip.duration;
|
||||||
|
actions[code].action.timeScale = -1;
|
||||||
|
actions[code].action.play();
|
||||||
|
actions[code].command = data.command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
function simulationreset(data){
|
function simulationreset(data){
|
||||||
for(let i=0;i<trainlisttest.group.children.length;i++){
|
for(let i=0;i<trainlisttest.group.children.length;i++){
|
||||||
trainlisttest.group.children[i].dispose = true;
|
trainlisttest.group.children[i].dispose = true;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl'
|
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
|
|
||||||
// let stats = new Stats();
|
// let stats = new Stats();
|
||||||
// dom.appendChild( stats.dom );
|
// dom.appendChild( stats.dom );
|
||||||
|
|
||||||
let scope = this;
|
let scope = this;
|
||||||
this.dom = dom;
|
this.dom = dom;
|
||||||
this.nowSceneType = "";
|
this.nowSceneType = "";
|
||||||
@ -65,6 +64,8 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
|||||||
|
|
||||||
let loadingInstance = Loading.service({ fullscreen: true });
|
let loadingInstance = Loading.service({ fullscreen: true });
|
||||||
let assetModelManager = new AssetModelManager(scope,scene,controlManager);
|
let assetModelManager = new AssetModelManager(scope,scene,controlManager);
|
||||||
|
|
||||||
|
console.log(lessonData);
|
||||||
assetModelManager.lessonAssetsLoader(lessonData).then((result) => {
|
assetModelManager.lessonAssetsLoader(lessonData).then((result) => {
|
||||||
scope.nowSceneType = lessonData.lessonProgress[0].progressScene;
|
scope.nowSceneType = lessonData.lessonProgress[0].progressScene;
|
||||||
animateManager.initAnimation(assetModelManager);
|
animateManager.initAnimation(assetModelManager);
|
||||||
|
@ -4,13 +4,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
Assetmaterial
|
Assetmaterial
|
||||||
} from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
} from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
||||||
import {
|
|
||||||
getBaseUrl
|
|
||||||
} from '@/utils/baseUrl';
|
|
||||||
import {
|
import {
|
||||||
Loading
|
Loading
|
||||||
} from 'element-ui';
|
} from 'element-ui';
|
||||||
const BASE_API = getBaseUrl();
|
|
||||||
import {
|
import {
|
||||||
JL3D_LOCAL_STATIC,
|
JL3D_LOCAL_STATIC,
|
||||||
BASE_ASSET_API
|
BASE_ASSET_API
|
||||||
|
@ -142,7 +142,7 @@ export default {
|
|||||||
// } else {
|
// } else {
|
||||||
// href = 'https://joylink.club/docs';
|
// href = 'https://joylink.club/docs';
|
||||||
// }
|
// }
|
||||||
href = process.env.VUE_APP_BASE_SITE + '/docs/';
|
href = this.$store.state.user.baseSite + '/docs/';
|
||||||
window.open(href, '_blank');
|
window.open(href, '_blank');
|
||||||
},
|
},
|
||||||
goEmpty() {},
|
goEmpty() {},
|
||||||
|
@ -7,7 +7,7 @@ import 'nprogress/nprogress.css';
|
|||||||
import { setToken, getToken, removeToken, getSessionStorage } from '@/utils/auth';
|
import { setToken, getToken, removeToken, getSessionStorage } from '@/utils/auth';
|
||||||
import { getBaseUrlByProject } from '@/api/projectServer';
|
import { getBaseUrlByProject } from '@/api/projectServer';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
import { handlerUrl } from '@/utils/baseUrl';
|
||||||
|
|
||||||
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
|
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
|
||||||
|
|
||||||
@ -90,13 +90,13 @@ router.beforeEach( async (to, from, next) => {
|
|||||||
if (!store.state.user.baseUrl && project && loginInfo[project]) {
|
if (!store.state.user.baseUrl && project && loginInfo[project]) {
|
||||||
try {
|
try {
|
||||||
const resp = await getBaseUrlByProject(ProjectCode[project]);
|
const resp = await getBaseUrlByProject(ProjectCode[project]);
|
||||||
if (resp && resp.data && resp.data.domainName) {
|
const urlData = handlerUrl(resp.data);
|
||||||
store.dispatch('setBaseUrl', resp.data.domainName);
|
store.dispatch('setBaseUrl', urlData.BASE_API);
|
||||||
} else {
|
store.dispatch('setResourcesUrl', urlData.VOICE_API);
|
||||||
store.dispatch('setBaseUrl', getBaseUrl());
|
store.dispatch('setUploadUrl', urlData.UPLOAD_API);
|
||||||
}
|
store.dispatch('setBaseSite', urlData.BASE_SITE);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
store.dispatch('setBaseUrl', getBaseUrl());
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.title = loginInfo[project || 'login'] ? loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title : '';
|
document.title = loginInfo[project || 'login'] ? loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title : '';
|
||||||
|
@ -60,7 +60,7 @@ export const loginInfo = {
|
|||||||
xzexam:{
|
xzexam:{
|
||||||
title: '城市轨道交通标准化培训软件',
|
title: '城市轨道交通标准化培训软件',
|
||||||
loginPath: '/login?project=xzexam',
|
loginPath: '/login?project=xzexam',
|
||||||
loginParam: 'DEFAULT',
|
loginParam: 'SAY',
|
||||||
loginTitle: '空串',
|
loginTitle: '空串',
|
||||||
logoWidth: '140px',
|
logoWidth: '140px',
|
||||||
navigationLogoWidth: '120px',
|
navigationLogoWidth: '120px',
|
||||||
@ -729,7 +729,8 @@ export const ProjectCode = {
|
|||||||
hls: 'DEFAULT',
|
hls: 'DEFAULT',
|
||||||
designhls: 'DEFAULT',
|
designhls: 'DEFAULT',
|
||||||
say: 'SAY',
|
say: 'SAY',
|
||||||
designsay: 'SAY'
|
designsay: 'SAY',
|
||||||
|
xzexam:'SAY',
|
||||||
};
|
};
|
||||||
/** 嵌入第三方平台 导航栏右上角 清空 */
|
/** 嵌入第三方平台 导航栏右上角 清空 */
|
||||||
export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy'];
|
export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy'];
|
||||||
|
@ -21,7 +21,10 @@ const user = {
|
|||||||
companyAdmin: false,
|
companyAdmin: false,
|
||||||
companyName: '',
|
companyName: '',
|
||||||
companyProjectList: [],
|
companyProjectList: [],
|
||||||
baseUrl:''
|
baseUrl:'',
|
||||||
|
resourcesUrl: '',
|
||||||
|
uploadUrl: '',
|
||||||
|
baseSite: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
@ -81,6 +84,15 @@ const user = {
|
|||||||
},
|
},
|
||||||
setBaseUrl: (state, baseUrl) => {
|
setBaseUrl: (state, baseUrl) => {
|
||||||
state.baseUrl = baseUrl;
|
state.baseUrl = baseUrl;
|
||||||
|
},
|
||||||
|
setResourcesUrl: (state, resourcesUrl) => {
|
||||||
|
state.resourcesUrl = resourcesUrl;
|
||||||
|
},
|
||||||
|
setUploadUrl: (state, uploadUrl) => {
|
||||||
|
state.uploadUrl = uploadUrl;
|
||||||
|
},
|
||||||
|
setBaseSite: (state, baseSite) => {
|
||||||
|
state.baseSite = baseSite;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -213,6 +225,15 @@ const user = {
|
|||||||
setBaseUrl ({commit}, baseUrl) {
|
setBaseUrl ({commit}, baseUrl) {
|
||||||
commit('setBaseUrl', baseUrl);
|
commit('setBaseUrl', baseUrl);
|
||||||
},
|
},
|
||||||
|
setResourcesUrl({commit}, resourcesUrl) {
|
||||||
|
commit('setResourcesUrl', resourcesUrl);
|
||||||
|
},
|
||||||
|
setUploadUrl({commit}, uploadUrl) {
|
||||||
|
commit('setUploadUrl', uploadUrl);
|
||||||
|
},
|
||||||
|
setBaseSite({commit}, baseSite) {
|
||||||
|
commit('setBaseSite', baseSite);
|
||||||
|
},
|
||||||
setToken({commit}, token) {
|
setToken({commit}, token) {
|
||||||
commit('SET_TOKEN', token);
|
commit('SET_TOKEN', token);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,29 @@
|
|||||||
export function getBaseUrl() {
|
import store from '@/store/index';
|
||||||
|
// export function getBaseUrl() {
|
||||||
|
// let BASE_API;
|
||||||
|
// if (process.env.NODE_ENV === 'development') {
|
||||||
|
// // BASE_API = 'https://joylink.club/jlcloud';
|
||||||
|
// // BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
|
// // BASE_API = 'http://114.116.51.125/jlcloud';
|
||||||
|
// // BASE_API = 'http://192.168.8.152:9000'; // 袁琪
|
||||||
|
// // BASE_API = 'http://192.168.8.172:9200'; // 旭强
|
||||||
|
// // BASE_API = 'http://192.168.8.109:9000'; // 张赛
|
||||||
|
// // BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||||
|
// // BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
|
// // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
|
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||||
|
// } else {
|
||||||
|
// BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
|
// }
|
||||||
|
// return BASE_API;
|
||||||
|
// }
|
||||||
|
export function handlerUrl(data) {
|
||||||
let BASE_API;
|
let BASE_API;
|
||||||
|
let VOICE_API;
|
||||||
|
let UPLOAD_API;
|
||||||
|
let BASE_SITE;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
// const data = null;
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||||
@ -11,8 +34,31 @@ export function getBaseUrl() {
|
|||||||
// 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 {
|
// BASE_API = data && data.domainName ? 'https://' + data.domainName : BASE_API;
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = data && data.domainName ? 'http://' + data.domainName : BASE_API;
|
||||||
|
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||||
|
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||||
|
BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||||
|
} else if (process.env.NODE_ENV === 'test') {
|
||||||
|
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
|
||||||
|
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||||
|
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||||
|
BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||||
|
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
|
||||||
|
BASE_API = 'http://160.20.60.15:9000';
|
||||||
|
VOICE_API = 'http://160.20.60.15/oss/joylink';
|
||||||
|
UPLOAD_API = 'http://160.20.60.15';
|
||||||
|
BASE_SITE = 'http://160.20.60.15';
|
||||||
|
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'ntyl') {
|
||||||
|
BASE_API = 'https://joylink.club/jlcloud';
|
||||||
|
VOICE_API = 'https://joylink.club/oss/joylink';
|
||||||
|
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||||
|
BASE_SITE = 'https://joylink.club/cbtc';
|
||||||
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
|
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://joylink.club/jlcloud';
|
||||||
|
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||||
|
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||||
|
BASE_SITE = 'https://joylink.club/cbtc';
|
||||||
}
|
}
|
||||||
return BASE_API;
|
return {BASE_API, VOICE_API, UPLOAD_API, BASE_SITE};
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
import store from '@/store/index';
|
||||||
|
|
||||||
// 创建或者打开数据库
|
// 创建或者打开数据库
|
||||||
export function openIndexedDB() {
|
export function openIndexedDB() {
|
||||||
const baseUrl = getBaseUrl();
|
const baseUrl = store.state.user.baseUrl;
|
||||||
const indexedDBName = baseUrl.replace(/http.?:\/\/(.*)[\/|:].*/, '$1');
|
const indexedDBName = baseUrl.replace(/http.?:\/\/(.*)[\/|:].*/, '$1');
|
||||||
const request = window.indexedDB.open(indexedDBName, 1);
|
const request = window.indexedDB.open(indexedDBName, 1);
|
||||||
request.onerror = function (event) {
|
request.onerror = function (event) {
|
||||||
|
@ -4,17 +4,17 @@ import qs from 'qs';
|
|||||||
import { i18n } from '@/main.js';
|
import { i18n } from '@/main.js';
|
||||||
import { MessageBox } from 'element-ui';
|
import { MessageBox } from 'element-ui';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
import { handlerUrl } from '@/utils/baseUrl';
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
import ConstConfig from '@/scripts/ConstConfig';
|
import ConstConfig from '@/scripts/ConstConfig';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import router from '../router/index';
|
import router from '../router/index';
|
||||||
|
|
||||||
const BASE_API = getBaseUrl();
|
const urlData = handlerUrl();
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: BASE_API, // api的base_url
|
baseURL: urlData.BASE_API, // api的base_url
|
||||||
withCredentials: true, // 跨域请求时是否需要使用凭证
|
withCredentials: true, // 跨域请求时是否需要使用凭证
|
||||||
timeout: 600000 // 请求超时时间
|
timeout: 600000 // 请求超时时间
|
||||||
});
|
});
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { checkLoginLine } from '@/api/login';
|
import { checkLoginLine } from '@/api/login';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
import { MessageBox } from 'element-ui';
|
import { MessageBox } from 'element-ui';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
import Stomp from 'stompjs';
|
import Stomp from 'stompjs';
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
const isTest = process.env.NODE_ENV === 'test';
|
const isTest = process.env.NODE_ENV === 'test';
|
||||||
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;
|
|
||||||
const reconnectInterval = [1000, 3000, 5000, 10000, 30000, 60000];
|
const reconnectInterval = [1000, 3000, 5000, 10000, 30000, 60000];
|
||||||
|
|
||||||
var StompClient = function (headers) {
|
var StompClient = function (headers) {
|
||||||
|
const websocketUrl = `${store.state.user.baseUrl}/joylink-websocket?token=`;
|
||||||
this.url = websocketUrl + getToken();
|
this.url = websocketUrl + getToken();
|
||||||
this.headers = headers || {};
|
this.headers = headers || {};
|
||||||
this.subscribeMap = new Map(); // 已订阅,对象{dest:'', handler:function, sub: Object}
|
this.subscribeMap = new Map(); // 已订阅,对象{dest:'', handler:function, sub: Object}
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
|||||||
resultMap: {},
|
resultMap: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
audioPlayId: '',
|
audioPlayId: '',
|
||||||
baseUrl:process.env.VUE_APP_VOICE_API
|
baseUrl:this.$store.state.user.resourcesUrl
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -84,7 +84,7 @@ export default {
|
|||||||
recordSendingId: null,
|
recordSendingId: null,
|
||||||
audioDataMap: {},
|
audioDataMap: {},
|
||||||
audioPlayId: '',
|
audioPlayId: '',
|
||||||
baseUrl:process.env.VUE_APP_VOICE_API
|
baseUrl:this.$store.state.user.resourcesUrl
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -26,7 +26,7 @@ export default {
|
|||||||
}, // 接收父组件的方法
|
}, // 接收父组件的方法
|
||||||
computed: {
|
computed: {
|
||||||
action() {
|
action() {
|
||||||
return `${process.env.VUE_APP_UPLOAD_API}${pictureUrl}`;
|
return `${this.$store.state.user.uploadUrl}${pictureUrl}`;
|
||||||
},
|
},
|
||||||
draft() {
|
draft() {
|
||||||
return this.$route.query.draft;
|
return this.$route.query.draft;
|
||||||
@ -56,7 +56,7 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
uploadFile(action, that.formData).then(resp => {
|
uploadFile(action, that.formData).then(resp => {
|
||||||
const imgUrl = process.env.VUE_APP_VOICE_API + resp.data;
|
const imgUrl = this.$store.state.user.resourcesUrl + resp.data;
|
||||||
insertImgFn(imgUrl);
|
insertImgFn(imgUrl);
|
||||||
}).catch(error => { console.log(error); });
|
}).catch(error => { console.log(error); });
|
||||||
};
|
};
|
||||||
|
@ -590,6 +590,7 @@ export default {
|
|||||||
},
|
},
|
||||||
updatetrainlist(){
|
updatetrainlist(){
|
||||||
getSimulationTrainlistNew(this.group).then(netdata => {
|
getSimulationTrainlistNew(this.group).then(netdata => {
|
||||||
|
console.log(netdata);
|
||||||
this.options = [];
|
this.options = [];
|
||||||
this.trainlist = netdata.data;
|
this.trainlist = netdata.data;
|
||||||
for(let i=0;i<netdata.data.length;i++){
|
for(let i=0;i<netdata.data.length;i++){
|
||||||
|
85
src/views/jlmap3d/lesson3dedit/component/lessondelete.vue
Normal file
85
src/views/jlmap3d/lesson3dedit/component/lessondelete.vue
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div id="" class="lessondeletediv" v-show="showDelete">
|
||||||
|
<div style="text-align:center;top:10%;font-size:30px">确认是否删除</div>
|
||||||
|
<el-form ref="form" >
|
||||||
|
<el-form-item style="text-align:center;margin-left: 0px;margin-top: 5%;" >
|
||||||
|
<el-button type="primary" @click="onSubmit">删除</el-button>
|
||||||
|
<el-button @click="unSubmit" >取消</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import Vue from 'vue';
|
||||||
|
import localStore from 'storejs';
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LessonDelete',
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
showDelete:false,
|
||||||
|
deleteId:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
deleteView(id){
|
||||||
|
if(this.showDelete == false){
|
||||||
|
this.showDelete = true;
|
||||||
|
this.deleteId = id;
|
||||||
|
}else{
|
||||||
|
this.showDelete = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.showDelete = false;
|
||||||
|
this.$emit('lessonDelete',this.deleteId);
|
||||||
|
},
|
||||||
|
unSubmit(){
|
||||||
|
this.showDelete = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@import "src/styles/mixin.scss";
|
||||||
|
|
||||||
|
.lessondeletediv {
|
||||||
|
position: absolute;
|
||||||
|
width: 20%;
|
||||||
|
height: 10%;
|
||||||
|
top:45%;
|
||||||
|
left:40%;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 18px;
|
||||||
|
border:solid 2px #000;
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
@ -71,9 +71,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
console.log(this.form.scene);
|
|
||||||
console.log(this.form.role);
|
|
||||||
console.log('submit!');
|
|
||||||
this.showSetup = false;
|
this.showSetup = false;
|
||||||
this.$emit('lessonCreate', { name: this.form.name, type: this.form.type });
|
this.$emit('lessonCreate', { name: this.form.name, type: this.form.type });
|
||||||
},
|
},
|
||||||
|
@ -302,6 +302,7 @@
|
|||||||
|
|
||||||
saveData.setup.examMode = this.examMode;
|
saveData.setup.examMode = this.examMode;
|
||||||
saveData.setup.checkedRole = this.checkedRole;
|
saveData.setup.checkedRole = this.checkedRole;
|
||||||
|
console.log(saveData);
|
||||||
this.netData.data = JSON.stringify(saveData);
|
this.netData.data = JSON.stringify(saveData);
|
||||||
// console.log();
|
// console.log();
|
||||||
updateLesson3dData(this.$route.query.lessonId,this.netData).then(data => {
|
updateLesson3dData(this.$route.query.lessonId,this.netData).then(data => {
|
||||||
|
@ -144,7 +144,7 @@
|
|||||||
import { JobPaneData } from '@/jlmap3d/lesson3d/toolsmodel/jobpanedata.js';
|
import { JobPaneData } from '@/jlmap3d/lesson3d/toolsmodel/jobpanedata.js';
|
||||||
import { ZzwwTrain } from '@/jlmap3d/lesson3dedit/toolsmodel/zzwwtrain.js';
|
import { ZzwwTrain } from '@/jlmap3d/lesson3dedit/toolsmodel/zzwwtrain.js';
|
||||||
|
|
||||||
import { getLesson3dData,updateLesson3dData } from '@/api/jmap/lesson3d';
|
import { getLesson3dData,updateLesson3dData,getPublishLesson3dData} from '@/api/jmap/lesson3d';
|
||||||
|
|
||||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||||
|
|
||||||
@ -248,15 +248,77 @@
|
|||||||
window.startLesson = this.startLesson;
|
window.startLesson = this.startLesson;
|
||||||
window.updataExamStatus = this.updataExamStatus;
|
window.updataExamStatus = this.updataExamStatus;
|
||||||
window.lessonEnd = this.lessonEnd;
|
window.lessonEnd = this.lessonEnd;
|
||||||
this.init(this.$route.query.lessonId);
|
console.log(this.$route.query.lessonType);
|
||||||
|
if(this.$route.query.lessonType == "publish"){
|
||||||
|
this.initPublish(this.$route.query.lessonId);
|
||||||
|
}else{
|
||||||
|
this.initDraft(this.$route.query.lessonId);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(lessonId){
|
initDraft(lessonId){
|
||||||
|
|
||||||
getLesson3dData(lessonId).then(data => {
|
getLesson3dData(lessonId).then(data => {
|
||||||
|
console.log(data);
|
||||||
|
this.netData.name = data.data.name;
|
||||||
|
this.netData.type = data.data.type;
|
||||||
|
|
||||||
|
let dom = document.getElementById('lesson3ddraw');
|
||||||
|
|
||||||
|
this.lessonData = new LessonData();
|
||||||
|
this.jobPaneData = new JobPaneData();
|
||||||
|
this.trainDeviceData = new ZzwwTrain();
|
||||||
|
let loadData;
|
||||||
|
|
||||||
|
|
||||||
|
if(data.data.data){
|
||||||
|
this.lessonMsg = {
|
||||||
|
lessonTittle:data.data.name,
|
||||||
|
userId:data.data.userId,
|
||||||
|
userJob:"",
|
||||||
|
};
|
||||||
|
loadData = JSON.parse(data.data.data);
|
||||||
|
if(this.$route.query.examMode == 1){
|
||||||
|
this.examMode = true;
|
||||||
|
}else{
|
||||||
|
this.examMode = loadData.setup.examMode;
|
||||||
|
}
|
||||||
|
if(loadData.setup.checkedRole.length == 0){
|
||||||
|
this.showSelectJob = false;
|
||||||
|
}
|
||||||
|
this.selectJobList = loadData.setup.checkedRole;
|
||||||
|
this.jobPaneData.dataList = loadData.toolJobPane;
|
||||||
|
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
|
||||||
|
this.lessonTools = loadData.lessonTools;
|
||||||
|
this.lessonData.loadLessonProgress(loadData.lessonProgress);
|
||||||
|
if(this.lessonTools[5]){
|
||||||
|
loadData.trainDeviceData = this.trainDeviceData.deviceList;
|
||||||
|
}else{
|
||||||
|
this.lessonTools[5] = {
|
||||||
|
name:"大铁车检组件",
|
||||||
|
type:"",
|
||||||
|
isShow:false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
|
||||||
|
this.lessonData.initLessonProgress();
|
||||||
|
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
|
||||||
|
this.jl3d.initNowRole();
|
||||||
|
}
|
||||||
|
// console.log("loaddata----------------");
|
||||||
|
// console.log(loadData);
|
||||||
|
// console.log(this.lessonMsg);
|
||||||
|
this.jl3d = new Lesson3dPlayer(dom,loadData,this.lessonPlayIndex);
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
initPublish(lessonId){
|
||||||
|
getPublishLesson3dData(lessonId).then(data => {
|
||||||
|
console.log(data);
|
||||||
this.netData.name = data.data.name;
|
this.netData.name = data.data.name;
|
||||||
this.netData.type = data.data.type;
|
this.netData.type = data.data.type;
|
||||||
|
|
||||||
@ -400,7 +462,7 @@
|
|||||||
if(type == "jump"){
|
if(type == "jump"){
|
||||||
this.lessonPlayIndex = action.nextNode;
|
this.lessonPlayIndex = action.nextNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.jl3d.changeIndex(this.lessonPlayIndex);
|
this.jl3d.changeIndex(this.lessonPlayIndex);
|
||||||
},
|
},
|
||||||
actionEvent(type,action,mesh){
|
actionEvent(type,action,mesh){
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="explainpanediv"
|
<div class="explainpanediv"
|
||||||
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]"
|
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex] && lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.text != ''"
|
||||||
|
|
||||||
:style="{'background-image': 'url('+lessonbg+')'}">
|
:style="{'background-image': 'url('+lessonbg+')'}">
|
||||||
<div class="explainpanetittle" >
|
<div class="explainpanetittle" >
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="stepstipsdiv"
|
<div class="stepstipsdiv"
|
||||||
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]"
|
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]"
|
||||||
:style="{'background-image': 'url('+lessonbg+')'}">
|
:style="{'background-image': 'url('+lessonbg+')'}">
|
||||||
<div class="stepstipstittle" >
|
<div class="stepstipstittle" v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.text != ''">
|
||||||
当前情况
|
当前情况
|
||||||
<!-- {{lessonData.lessonData.lessonProgress[lessonPlayIndex].stepTipsData.tittle}} -->
|
<!-- {{lessonData.lessonData.lessonProgress[lessonPlayIndex].stepTipsData.tittle}} -->
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,46 +2,56 @@
|
|||||||
|
|
||||||
<div class="jl3dmap3dMaintainer">
|
<div class="jl3dmap3dMaintainer">
|
||||||
<div class="jl3dmap3dMaintainerSelect" :style="{'background-color': '#e4eaea'}">
|
<div class="jl3dmap3dMaintainerSelect" :style="{'background-color': '#e4eaea'}">
|
||||||
|
<div style="position:absolute;width:50%;left:25%;top:10%;text-align:center;font-size:80px;">
|
||||||
<div style="position:absolute;left:25%;top:10%;font-size:80px;">
|
|
||||||
<el-row>
|
<el-row>
|
||||||
城市轨道交通标准化培训软件
|
城市轨道交通标准化培训软件
|
||||||
|
</el-row>
|
||||||
|
<el-row style="font-size:40px;">
|
||||||
|
课程模式选择:
|
||||||
|
<el-switch
|
||||||
|
v-model="examMode"
|
||||||
|
active-text="考试模式"
|
||||||
|
inactive-text="教学模式">
|
||||||
|
</el-switch>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="width:40%;height:70%;position:absolute;left:30%;top:25%;font-size:30px">
|
||||||
|
<el-table
|
||||||
|
:data="lessonData"
|
||||||
|
style="width: 100%;"
|
||||||
|
highlight-current-row
|
||||||
|
max-height="700"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="课程名称"
|
||||||
|
prop="name">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="right">
|
||||||
|
|
||||||
<div class="lesson3dSelectButton"
|
<template slot-scope="scope">
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/ck.png)'}"
|
<el-button
|
||||||
style="left:15%;top:25%;" @click=""></div>
|
size="mini"
|
||||||
|
@click="goDetail(scope.row)">进入课程</el-button>
|
||||||
<div class="lesson3dSelectButton"
|
</template>
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/hk.png)'}"
|
</el-table-column>
|
||||||
style="left:40%;top:25%;" @click=""></div>
|
</el-table>
|
||||||
|
|
||||||
<div class="lesson3dSelectButton"
|
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/jy.png)'}"
|
|
||||||
style="left:65%;top:25%;" @click="enterPlayer(32)"></div>
|
|
||||||
|
|
||||||
<div class="lesson3dSelectButton"
|
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/yx.png)'}"
|
|
||||||
style="left:15%;top:60%;" @click=""></div>
|
|
||||||
|
|
||||||
<div class="lesson3dSelectButton"
|
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/zf.png)'}"
|
|
||||||
style="left:40%;top:60%;" @click=""></div>
|
|
||||||
|
|
||||||
<div class="lesson3dSelectButton"
|
|
||||||
:style="{'background-image': 'url('+localStatic+'/other/xr51.png)'}"
|
|
||||||
style="left:65%;top:60%;" @click=""></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="display-draft">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button style="width:200px"type="primary" @click="quit">退出</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import { getSelectLesson3dList } from '@/api/jmap/lesson3d';
|
||||||
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||||
import bgPsdImg from '@/assets/bg_psd.png';
|
import bgPsdImg from '@/assets/bg_psd.png';
|
||||||
@ -57,7 +67,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
localStatic:JL3D_LOCAL_STATIC,
|
localStatic:JL3D_LOCAL_STATIC,
|
||||||
|
examMode:false,
|
||||||
|
lessonType:'publish',
|
||||||
|
lessonData:[],
|
||||||
|
search: '',
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|
||||||
@ -66,17 +83,20 @@ export default {
|
|||||||
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
getSelectLesson3dList().then(response => {
|
||||||
|
console.log(response);
|
||||||
|
this.lessonData = response.data;
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
// console.log("");
|
// console.log("");
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
goDetail( row) {
|
||||||
enterPlayer:function (id) {
|
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId: row.id,lineCode: this.$route.query.lineCode,examMode:this.examMode,lessonType:this.lessonType} });
|
||||||
// this.$router.push({ path: '/jlmap3d/lcjy', query: {} });
|
},
|
||||||
|
quit() {
|
||||||
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:id} });
|
history.go(-1);
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -106,22 +126,15 @@ export default {
|
|||||||
background-size:100%;
|
background-size:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lesson3dSelectButton{
|
|
||||||
position:absolute;
|
.display-draft {
|
||||||
width: 20%;
|
/* z-index: 1000; */
|
||||||
height: 30%;
|
position: absolute;
|
||||||
position:absolute;
|
width:100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 50px;
|
bottom: 50px;
|
||||||
line-height:150px;
|
|
||||||
background-size: 100%;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
color:#FFF;
|
|
||||||
cursor:pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,24 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="joylink-card">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="lesson-header">
|
<div class="lesson-header">
|
||||||
<div class="lesson-list">草稿{{ $t('lesson.courseList') }}</div>
|
<div class="joylink-card">
|
||||||
<div class="but-group">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
<el-button size="mini" type="primary" @click="lessonSetupCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
|
||||||
</div>
|
<el-tab-pane label="草稿数据管理" name="first">
|
||||||
|
<div class="but-group">
|
||||||
|
<el-button size="mini" type="primary" @click="lessonSetupCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
||||||
|
</div>
|
||||||
|
<QueryListPage ref="queryListPageCourse" :card-padding="50" :query-form="queryFormCourse" :pager-config="pagerConfigCourse" :query-list="queryListCourse" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="发布数据管理" name="second">
|
||||||
|
<QueryListPage ref="queryListPage" :card-padding="50" :query-form="queryFormPublish" :pager-config="pagerConfigPublish" :query-list="queryListPublish" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<QueryListPage ref="queryListPage" :card-padding="50" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
|
||||||
|
|
||||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||||
<lesson-detail ref="lessonDetail" />
|
<lesson-detail ref="lessonDetail" />
|
||||||
|
|
||||||
<Lesson-Setup ref="lessonsetup" @lessonCreate="lessonCreate"></Lesson-Setup>
|
<Lesson-Setup ref="lessonsetup" @lessonCreate="lessonCreate"></Lesson-Setup>
|
||||||
|
<Lesson-Delete ref="lessondelete" @lessonDelete="lessonDelete"></Lesson-Delete>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { releaseOrCancel } from '@/api/lesson3d';
|
// import { releaseOrCancel } from '@/api/lesson3d';
|
||||||
|
|
||||||
import { getLesson3dDrftList,createLesson3d,updateLesson3dBasic,delLesson3d,publishLesson3d } from '@/api/jmap/lesson3d';
|
import { getLesson3dDrftList,createLesson3d,updateLesson3dBasic,delLesson3d,publishedLesson3d,publishLesson3d,onlineLesson3d,offlineLesson3d } from '@/api/jmap/lesson3d';
|
||||||
// import { delLesson } from '@/api/jmap/lesson3d';
|
// import { delLesson } from '@/api/jmap/lesson3d';
|
||||||
|
|
||||||
|
|
||||||
@ -30,26 +46,37 @@ import ConstConfig from '@/scripts/ConstConfig';
|
|||||||
|
|
||||||
import LessonSetup from '@/views/jlmap3d/lesson3dedit/component/lessonsetup';
|
import LessonSetup from '@/views/jlmap3d/lesson3dedit/component/lessonsetup';
|
||||||
|
|
||||||
|
import LessonDelete from '@/views/jlmap3d/lesson3dedit/component/lessondelete';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Lesson3d',
|
name: 'Lesson3d',
|
||||||
components: {
|
components: {
|
||||||
PublishCreate,
|
PublishCreate,
|
||||||
PublishLesson,
|
PublishLesson,
|
||||||
LessonDetail,
|
LessonDetail,
|
||||||
LessonSetup
|
LessonSetup,
|
||||||
|
LessonDelete
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
pagerConfig: {
|
activeName: 'first',
|
||||||
|
pagerConfigCourse: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
pagerConfigPublish: {
|
||||||
|
pageSize: 'pageSize',
|
||||||
|
pageIndex: 'pageNum'
|
||||||
|
},
|
||||||
|
queryFormCourse: {
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
queryList: {
|
queryFormPublish: {
|
||||||
query: this.queryFunction,
|
show: false
|
||||||
|
},
|
||||||
|
queryListCourse: {
|
||||||
|
query: this.queryFunctionCourse,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
@ -84,14 +111,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('lesson.notRelease'),
|
name: this.$t('lesson.courseRelease'),
|
||||||
handleClick: this.release,
|
handleClick: this.release,
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
showControl: (row) => {
|
showControl: (row) => {
|
||||||
return row.status !== '1';
|
return row.status !== '1';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: this.$t('global.delete'),
|
name: this.$t('global.delete'),
|
||||||
handleClick: this.deleteLesson,
|
handleClick: this.deleteLesson,
|
||||||
@ -104,7 +130,56 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
queryListPublish: {
|
||||||
|
query: this.queryFunctionPublish,
|
||||||
|
selectCheckShow: false,
|
||||||
|
indexShow: true,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '三维课程名称',
|
||||||
|
prop: 'name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '三维课程类型',
|
||||||
|
prop: 'type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建人',
|
||||||
|
prop: 'userId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
prop: 'createTime'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
title: this.$t('global.operate'),
|
||||||
|
width: '400',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: this.$t('lesson.courseOnline'),
|
||||||
|
handleClick: this.online,
|
||||||
|
type: 'primary',
|
||||||
|
showControl: (row) => {
|
||||||
|
return row.status !== '1';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: this.$t('lesson.courseOffline'),
|
||||||
|
handleClick: this.offonline,
|
||||||
|
type: 'primary',
|
||||||
|
showControl: (row) => {
|
||||||
|
return row.status !== '1';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -128,9 +203,12 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
queryFunction(params) {
|
queryFunctionCourse(params) {
|
||||||
return getLesson3dDrftList(params);
|
return getLesson3dDrftList(params);
|
||||||
},
|
},
|
||||||
|
queryFunctionPublish(params) {
|
||||||
|
return publishedLesson3d(params);
|
||||||
|
},
|
||||||
handlerStatus(row) {
|
handlerStatus(row) {
|
||||||
let lessonStatus = '';
|
let lessonStatus = '';
|
||||||
switch (row.status) {
|
switch (row.status) {
|
||||||
@ -149,8 +227,11 @@ export default {
|
|||||||
}
|
}
|
||||||
return lessonStatus;
|
return lessonStatus;
|
||||||
},
|
},
|
||||||
|
handleClick(tab, event) {
|
||||||
|
// console.log(tab, event);
|
||||||
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$refs.queryListPage.refresh(true);
|
this.$refs.queryListPageCourse.refresh(true);
|
||||||
},
|
},
|
||||||
lessonSetupCreate() {
|
lessonSetupCreate() {
|
||||||
this.$refs.lessonsetup.setupView();
|
this.$refs.lessonsetup.setupView();
|
||||||
@ -168,27 +249,56 @@ export default {
|
|||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
lessonDelete(deleteId){
|
||||||
|
delLesson3d(deleteId).then(response => {
|
||||||
|
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||||
|
this.loading = true;
|
||||||
|
this.refresh();
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.failDelete'));
|
||||||
|
});
|
||||||
|
},
|
||||||
publish(index, row) {
|
publish(index, row) {
|
||||||
row.mapId = this.$route.params.mapId;
|
row.mapId = this.$route.params.mapId;
|
||||||
row.cityCode = this.$route.query.cityCode;
|
row.cityCode = this.$route.query.cityCode;
|
||||||
this.$refs.publishLesson.doShow(row);
|
this.$refs.publishLesson.doShow(row);
|
||||||
},
|
},
|
||||||
deleteLesson(index, row) {
|
deleteLesson(index, row) {
|
||||||
|
this.$refs.lessondelete.deleteView(row.id);
|
||||||
// console.log(row);
|
// console.log(row);
|
||||||
delLesson3d(row.id).then(response => {
|
|
||||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
|
||||||
this.loading = true;
|
|
||||||
this.refresh();
|
|
||||||
this.loading = false;
|
|
||||||
}).catch(() => {
|
|
||||||
this.$messageBox(this.$t('tip.failDelete'));
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
release(){
|
release(index, row){
|
||||||
|
publishLesson3d(row.id).then(response => {
|
||||||
|
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||||
|
this.loading = true;
|
||||||
|
this.refresh();
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
online(index, row){
|
||||||
|
onlineLesson3d(row.id).then(response => {
|
||||||
|
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||||
|
this.loading = true;
|
||||||
|
this.refresh();
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
offonline(index, row){
|
||||||
|
offlineLesson3d(row.id).then(response => {
|
||||||
|
this.$message.success(this.$t('tip.offlineSuccessful'));
|
||||||
|
this.loading = true;
|
||||||
|
this.refresh();
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.offlineFailed'));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
goDetail(index, row) {
|
goDetail(index, row) {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
|
@ -204,7 +204,7 @@ export default {
|
|||||||
},
|
},
|
||||||
avatarUrl(val) {
|
avatarUrl(val) {
|
||||||
if (val && val.creatorAvatarPath) {
|
if (val && val.creatorAvatarPath) {
|
||||||
return process.env.VUE_APP_VOICE_API + val.creatorAvatarPath;
|
return this.$store.state.user.resourcesUrl + val.creatorAvatarPath;
|
||||||
} else {
|
} else {
|
||||||
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
|
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ export default {
|
|||||||
// yuyin:yuyin,
|
// yuyin:yuyin,
|
||||||
currentAudioIndex:0,
|
currentAudioIndex:0,
|
||||||
isPlay:false,
|
isPlay:false,
|
||||||
baseUrl:process.env.VUE_APP_VOICE_API
|
baseUrl: this.$store.state.user.resourcesUrl
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCompanyListPaging, deleteCompany } from '@/api/company';
|
import { getCompanyListPaging, deleteCompany, getCompanyQrCode } from '@/api/company';
|
||||||
import EditCompany from './add';
|
import EditCompany from './add';
|
||||||
import QrCode from '@/components/QrCode';
|
import QrCode from '@/components/QrCode';
|
||||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||||
@ -126,15 +126,20 @@ export default {
|
|||||||
this.$router.push({ path: `/system/companyManage/orgDetail`, query: { orgId: row.id } });
|
this.$router.push({ path: `/system/companyManage/orgDetail`, query: { orgId: row.id } });
|
||||||
},
|
},
|
||||||
handleGenerateQrCode(index, row) {
|
handleGenerateQrCode(index, row) {
|
||||||
let state = 2;
|
// let state = 2;
|
||||||
if (process.env.NODE_ENV === 'production') {
|
// if (process.env.NODE_ENV === 'production') {
|
||||||
state = 3;
|
// state = 3;
|
||||||
}
|
// }
|
||||||
const param = {
|
getCompanyQrCode(row.id).then(resp => {
|
||||||
url: `https://joylink.club/oss/joylink/company?state=${state}_${row.id}`,
|
const param = {
|
||||||
title: '单位二维码'
|
url: resp.data,
|
||||||
};
|
title: '单位二维码'
|
||||||
this.$refs.qrCode.doShow(param);
|
};
|
||||||
|
this.$refs.qrCode.doShow(param);
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.error('获取单位二维码失败!');
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -94,7 +94,7 @@ export default {
|
|||||||
return this.projectMap[getSessionStorage('project')];
|
return this.projectMap[getSessionStorage('project')];
|
||||||
},
|
},
|
||||||
projectList() {
|
projectList() {
|
||||||
return [{value: 'default', label: '默认'}, ...ProjectList];
|
return [{value: 'default', label: '默认'}, { value: 'test', label: '测试' }, ...ProjectList];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -57,7 +57,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
action() {
|
action() {
|
||||||
return `${process.env.VUE_APP_UPLOAD_API}${meansUrl}`;
|
return `${this.$store.state.user.uploadUrl}${meansUrl}`;
|
||||||
},
|
},
|
||||||
form() {
|
form() {
|
||||||
const form = {
|
const form = {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// importScripts('sockjs.js');
|
// importScripts('sockjs.js');
|
||||||
// import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
// import { getBaseUrl } from '@/utils/baseUrl';
|
|
||||||
// import SockJS from 'sockjs-client';
|
// import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
// const websocketUrl = 'ws://test.joylink.club/jlcloud/joylink-websocket?token=';
|
||||||
|
Loading…
Reference in New Issue
Block a user