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

View File

@ -54,7 +54,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/sta
//老版本临时ai控制 //老版本临时ai控制
let olddataai = false; let olddataai = false;
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap) { export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// let stats = new Stats(); // let stats = new Stats();
// dom.appendChild( stats.dom ); // dom.appendChild( stats.dom );
@ -158,6 +158,16 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap) {
passerWebWork.postMessage("on"); passerWebWork.postMessage("on");
animate(); animate();
},1000); },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 = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
} }
updatestationlist(scope.stationlist); // updatestationlist(scope.stationlist);
}else{ }else{
olddataai = true; olddataai = true;
} }
@ -168,6 +168,21 @@ export function PasserStation() {
this.loadMaterial = function(netdata3d){ this.loadMaterial = function(netdata3d){
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]); 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){ this.changestation = function(stationname){
for(let i=0,leni=scope.stationlist.length;i<leni;i++){ 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` }); router.push({ path: `/authorization` });
} }
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了; // 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 // eslint-disable-next-line no-undef
EventBus.$emit('stop'); EventBus.$emit('stop');
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<template> <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> <div>
<el-form <el-form
ref="form" ref="form"
@ -9,8 +9,8 @@
label-width="140px" label-width="140px"
@submit.native.prevent @submit.native.prevent
> >
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name"> <el-form-item :label="$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease" /> <el-input v-model="editModel.name" :disabled="!hasRelease" />
</el-form-item> </el-form-item>
<el-form-item v-if="isProject" label="课程所属班级:" prop="classIdList"> <el-form-item v-if="isProject" label="课程所属班级:" prop="classIdList">
<el-select v-model="editModel.classIdList" multiple placeholder="请选择"> <el-select v-model="editModel.classIdList" multiple placeholder="请选择">

View File

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

View File

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

View File

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

View File

@ -385,7 +385,45 @@ export default {
}, },
// //
onSelected(em) { 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) { onContextMenu(em) {