This commit is contained in:
joylink_cuiweidong 2020-11-24 18:07:45 +08:00
commit 8388bf42b3
13 changed files with 149 additions and 63 deletions

View File

@ -59,7 +59,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/traffi
//老版本临时ai控制
let olddataai = false;
export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) {
export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap,initCode) {
// let stats = new Stats();
// dom.appendChild( stats.dom );
@ -185,7 +185,7 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) {
});
this.initTrafficStart = function(){
passerStation.initCodeStation(initCode);
scope.humanWaitTop = passerStation.nowStation.toppassers;
scope.humanWaitDown = passerStation.nowStation.downpassers;
scope.humanInSpeed = 0;
@ -194,6 +194,8 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) {
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
}
this.changestation = function(stationname){
@ -229,7 +231,7 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) {
this.updateNowLeaveData = function(direct,outNum){
if(direct == "top"){
waitForCreatOutTop = getnum(outNum,17);
console.log(waitForCreatOutTop);
// console.log(waitForCreatOutTop);
for(let i=0;i<waitForCreatOutTop.length;i++){
for(let j=0;j<waitForCreatOutTop[i];j++){
setTimeout(function(){

View File

@ -54,7 +54,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/sta
//老版本临时ai控制
let olddataai = false;
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap) {
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// let stats = new Stats();
// dom.appendChild( stats.dom );
@ -158,6 +158,16 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap) {
passerWebWork.postMessage("on");
animate();
},1000);
let checkInitCode = setInterval(function(){
// console.log(scope.trainList[initCode]);
if(scope.trainList[initCode]){
scope.updateNowTrainCode(initCode);
clearInterval(checkInitCode);
}
},1000);
});

View File

@ -159,7 +159,7 @@ export function PasserStation() {
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
updatestationlist(scope.stationlist);
// updatestationlist(scope.stationlist);
}else{
olddataai = true;
}
@ -168,6 +168,21 @@ export function PasserStation() {
this.loadMaterial = function(netdata3d){
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]);
}
this.initCodeStation = function(initCode){
for(let i=0,leni=scope.stationlist.length;i<leni;i++){
// console.log(scope.stationlist[i]);
if(scope.stationlist[i].downstand == initCode || scope.stationlist[i].topstand == initCode){
scope.nowStation = scope.stationlist[i];
if(scope.stationtexture["stationlist"]){
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
updatestationlist(scope.stationlist,scope.stationlist[i].name);
i=leni;
}
}
}
//更换场景车站
this.changestation = function(stationname){
for(let i=0,leni=scope.stationlist.length;i<leni;i++){

View File

@ -49,7 +49,7 @@ service.interceptors.response.use(
router.push({ path: `/authorization` });
}
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
if (res.code == 40004 || res.code == 40005 || res.code == 40003) {
if (res.code == 40004 || res.code == 40005) {
// eslint-disable-next-line no-undef
EventBus.$emit('stop');
// eslint-disable-next-line no-undef

View File

@ -1,6 +1,6 @@
<template>
<div style="width: 100%; height: 100%;">
<div :id="iscsId" v-loading="loading" :style="{ width: widthCanvas +'px', height: canvasHeight +'px' }" class="iscs-canvas" />
<div :id="iscsId" :style="{ width: widthCanvas +'px', height: canvasHeight +'px' }" class="iscs-canvas" />
</div>
</template>
@ -8,7 +8,8 @@
import Vue from 'vue';
import Iscs from '@/iscs/iscs';
import { parser } from '@/iscs/utils/parser';
import {getIscsData} from '@/iscs/constant/iscsData';
// import { getIscsData } from '@/iscs/constant/iscsData';
import { getIscsData } from '@/api/iscs';
export default {
name: 'Iscs',
@ -45,7 +46,6 @@ export default {
showBackButton: true,
initTime: '',
started: false,
loading: false,
stationCode: '',
banUpOpenScreenDoor: false,
banDownOpenScreenDoor: false
@ -78,7 +78,20 @@ export default {
this.iscsDestroy();
},
methods: {
show (mode, system, part) {
async getDetail(mode, system, part) {
const params = {
lineCode: this.$route.query.lineCode,
totalSystem: mode,
system: system,
userInterface : part
};
const resp = await getIscsData(params);
if (resp.data) {
const data = JSON.parse(resp.data.graphData);
return data;
}
},
async show (mode, system, part) {
if (!mode || !system || !part) {
return;
}
@ -86,8 +99,8 @@ export default {
return false;
};
this.iscsDestroy();
this.loading = true;
const data = parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight});
const dataIscs = await this.getDetail(mode, system, part);
const data = parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight});
this.$iscs = new Iscs({
dom: document.getElementById(this.iscsId),
config: {
@ -109,8 +122,8 @@ export default {
if (this.$route.params.mode) {
this.$iscs.on('selected', this.onSelected, this);
}
this.setIscs(data, getIscsData(mode, system, part));
this.$store.dispatch('iscs/setIscsData', getIscsData(mode, system, part));
this.setIscs(data, dataIscs);
this.$store.dispatch('iscs/setIscsData', dataIscs);
window.document.oncontextmenu = function () {
return false;
};
@ -118,8 +131,9 @@ export default {
setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);
},
iscsLoadData(mode, system, part) {
this.$iscs.loadData(parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight}));
async iscsLoadData(mode, system, part) {
const dataIscs = await this.getDetail(mode, system, part);
this.$iscs.loadData(parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight}));
},
//
onSelected(em) {
@ -147,7 +161,7 @@ export default {
}
},
handleViewLoaded() {
this.loading = false;
},
statusMessage(val) {
this.$iscs && this.$iscs.setDeviceStatus(val);

View File

@ -26,7 +26,6 @@ export default {
this.$nextTick(() => {
this.$refs.iscsPlate.iscsLoadData('fas', 'stand', 'standPublicArea');
});
console.log(this.width);
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
this.width = 1100;
this.$nextTick(() => {

View File

@ -47,6 +47,7 @@ export default {
},
data() {
return {
initCode:null,
localStatic:JL3D_LOCAL_STATIC,
jl3d: null,
rendermode:'监控视角',
@ -81,7 +82,8 @@ export default {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
this.lineCode = this.$route.query.lineCode;
this.init();
this.initCode = this.$route.query.deviceCode;
this.init(this.initCode);
window.updatestationlist = this.updatestationlist;
if (this.$route.query.type == 'CCTV') {
this.isCctv = false;
@ -91,10 +93,10 @@ export default {
beforeDestroy() {
},
methods: {
init: function () {
init: function (code) {
// let mapdata = this.$store.state.socket.device;
const dom = document.getElementById('jl3d');
this.jl3d = new Jl3dTrafficPlan(dom, this.$route.query.mapid, this.$route.query.group, 'normal');
this.jl3d = new Jl3dTrafficPlan(dom, this.$route.query.mapid, this.$route.query.group, 'normal',code);
},
switchrender() {
if (this.renderswitch == true) {
@ -108,9 +110,14 @@ export default {
}
},
updatestationlist(list) {
updatestationlist(list,nowname) {
// console.log(list);
this.value = list[0].name;
if(nowname){
this.value = nowname;
}else{
this.value = list[0].name;
}
this.stationlist = list;
},
currentsel(selVal) {

View File

@ -15,6 +15,7 @@
</div>
<div class="trunklist">
<div class="trunk" :class="{active:index==isActive}"
v-model="value"
:style="{'background-image': 'url('+localStatic+trunkAsse+')'}"
v-for="(trunkAsse,index) in trunkAssetList" @click="assetSelect(index)" >
</div>
@ -114,7 +115,7 @@ export default {
},
data() {
return {
initCode:null,
isActive:0,
localStatic:JL3D_LOCAL_STATIC,
openeds:['2','3','4','5','6','7'],
@ -159,8 +160,8 @@ export default {
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
},
mounted() {
this.init();
this.initCode = this.$route.query.deviceCode;
this.init(this.initCode);
this.takelist = this.getnum(this.allPassers,6);
// console.log(this.takelist);
if (this.$route.query.type == 'CCTV') {
@ -173,10 +174,11 @@ export default {
beforeDestroy() {
},
methods: {
init: function () {
init: function (code) {
// let mapdata = this.$store.state.socket.device;
this.value = code;
const dom = document.getElementById('jl3d');
this.jl3d = new Jl3dTrafficTrain(dom, this.$route.query.mapid, this.$route.query.group, 'normal');
this.jl3d = new Jl3dTrafficTrain(dom, this.$route.query.mapid, this.$route.query.group, 'normal',code);
},
assetSelect(index){
// console.log(index);
@ -213,6 +215,7 @@ export default {
// }
// // console.log(this.trainlist);
},
updateTrainCode(selVal) {
// console.log(selVal);
// this.jl3d.changeTrain(selVal);

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose">
<el-dialog v-dialogDrag :title="$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose">
<div>
<el-form
ref="form"
@ -9,8 +9,8 @@
label-width="140px"
@submit.native.prevent
>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease" />
<el-form-item :label="$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!hasRelease" />
</el-form-item>
<el-form-item v-if="isProject" label="课程所属班级:" prop="classIdList">
<el-select v-model="editModel.classIdList" multiple placeholder="请选择">

View File

@ -450,7 +450,7 @@ export default {
this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute();
}).catch(error => {
if (error.code === '30001') {
if (error.code == '40003') {
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
} else if (error.code == '10001') {
this.tipsMsg = '教员机尚未登录,请稍后重试!';

View File

@ -280,7 +280,6 @@ export default {
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 }
);
// console.log(this.runSeries);
const series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
this.myChart && this.myChart.setOption({series: series});
},
@ -486,7 +485,6 @@ export default {
} else {
option.series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
}
// console.log('');
this.myChart = echarts.init(document.getElementById(this.runPlanId));
if (this.myChart) {
this.myChart.setOption(option);

View File

@ -16,8 +16,8 @@
<!-- cctv视图 -->
<el-button v-if="cctvShow && !isContest && project !== 'bjd'" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- 客流规划视图 -->
<el-button v-if="trafficplanShow && project == 'bjd' && !isContest" size="small" @click="jumpjl3dtrafficplan">{{ jl3dtrafficplan }}</el-button>
<el-button v-if="trafficplanShow && project == 'bjd' && !isContest" size="small" @click="jumpjl3dtraffictrain">{{ $t('display.demon.traffictraintext') }}</el-button>
<!-- <el-button v-if="trafficplanShow && project == 'bjd' && !isContest" size="small" @click="jumpjl3dtrafficplan">{{ jl3dtrafficplan }}</el-button>
<el-button v-if="trafficplanShow && project == 'bjd' && !isContest" size="small" @click="jumpjl3dtraffictrain">{{ $t('display.demon.traffictraintext') }}</el-button> -->
<!-- 故障设备视图 -->
<el-button v-if="jlmap3dFaultShow" size="small" @click="jumpjlmap3dFault">故障设备</el-button>
@ -213,32 +213,32 @@ export default {
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
jumpjl3dtrafficplan() {
const routeData = this.$router.resolve({
path:'/jlmap3d/trafficplan',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true,
lineCode:this.lineCode
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
jumpjl3dtraffictrain() {
const routeData = this.$router.resolve({
path:'/jlmap3d/traffictrain',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true,
lineCode:this.lineCode
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
// jumpjl3dtrafficplan() {
// const routeData = this.$router.resolve({
// path:'/jlmap3d/trafficplan',
// query:{
// mapid:this.mapId,
// group:this.group,
// project: this.project,
// noPreLogout: true,
// lineCode:this.lineCode
// }
// });
// window.open(routeData.href, '_blank', 'noopener noreferrer');
// },
// jumpjl3dtraffictrain() {
// const routeData = this.$router.resolve({
// path:'/jlmap3d/traffictrain',
// query:{
// mapid:this.mapId,
// group:this.group,
// project: this.project,
// noPreLogout: true,
// lineCode:this.lineCode
// }
// });
// window.open(routeData.href, '_blank', 'noopener noreferrer');
// },
jumpjlmap3dFault() {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',

View File

@ -385,7 +385,45 @@ export default {
},
//
onSelected(em) {
this.$emit('onSelect', em);
console.log(em);
const path = window.location.href;
if (path.includes("/practiceDisplay")){
if(em.deviceType == "StationStand"){
// console.log(em.deviceType );
const routeData = this.$router.resolve({
path:'/jlmap3d/trafficplan',
query:{
mapid:this.$route.query.mapId,
group:this.$route.query.group,
project: this.$route.query.project,
noPreLogout: true,
lineCode:this.$route.query.lineCode,
deviceCode:em.deviceCode,
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
if(em.deviceType == "Train"){
// console.log(em.deviceType );
const routeData = this.$router.resolve({
path:'/jlmap3d/traffictrain',
query:{
mapid:this.$route.query.mapId,
group:this.$route.query.group,
project: this.$route.query.project,
noPreLogout: true,
lineCode:this.$route.query.lineCode,
deviceCode:em.deviceCode,
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
}else{
this.$emit('onSelect', em);
}
},
//
onContextMenu(em) {