This commit is contained in:
sunzhenyu 2021-09-10 18:27:36 +08:00
commit 745a2439b7
16 changed files with 251 additions and 31 deletions

View File

@ -180,12 +180,61 @@ class Iscs {
update(list) {
(list || []).forEach(elem => {
const code = elem.code;
const oDevice = this.iscsDevice[code];
if (elem.dispose) {
this.$painter.delete(oDevice);
if (elem.deviceType === 'IBP') {
if (this.iscsDevice['IscsCircle_20']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_20']);
}
if (this.iscsDevice['IscsCircle_17']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_17']);
}
if (this.iscsDevice['IscsCircle_18']) {
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_18']);
}
if (this.iscsDevice['IscsCircle_19']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_19']);
}
} else if (elem.deviceType === 'PSL') {
if (this.iscsDevice['IscsCircle_12']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_12']);
}
if (this.iscsDevice['IscsCircle_9']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_9']);
}
if (this.iscsDevice['IscsCircle_35']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_35']);
}
if (this.iscsDevice['IscsCircle_37']) {
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_37']);
}
} else if (elem.deviceType === 'SAFETY_CIRCLE') {
if (this.iscsDevice['IscsCircle_26']) {
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_26']);
}
if (this.iscsDevice['IscsCircle_25']) {
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_25']);
}
if (this.iscsDevice['IscsCircle_27']) {
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_27']);
}
} else {
if (this.hookHandle(oDevice.model, elem)) {
this.$painter.update(oDevice);
const oDevice = this.iscsDevice[code];
if (oDevice && elem.dispose) {
this.$painter.delete(oDevice);
} else if (oDevice) {
if (this.hookHandle(oDevice.model, elem)) {
this.$painter.update(oDevice);
}
}
}
});

View File

@ -97,7 +97,7 @@ class Painter {
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
instance.setState(device.model);
}
}
}

View File

@ -68,15 +68,29 @@ export default class fuzhouPsd extends Group {
this.add(this.grouper);
}
setState(model) {
if (model.alarm) {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
}
if (model.noStatus) {
// if (model.alarm) {
// this.fuzhouPsdBorder.setStyle('lineWidth', 1);
// }
if (model.status === 'UNDEFINED') {
this.fuzhouPsdLeft.attr({shape:{x: 2}});
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
} else if (model.status === 'DCU_FAULT') {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
} else if (model.status === 'OPEN') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
} else if (model.status === 'CLOSE') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
}
}
setModel(dx, dy) {

View File

@ -17,7 +17,6 @@ const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3de
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
const Jlmap3dLesson3dSelect = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dselect');
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
@ -43,6 +42,7 @@ const PracticeDisplay = () => import('@/views/newMap/displayNew/practiceDisplay'
const BigLPFStrategy = () => import('@/views/newMap/displayNew/bigLPFStrategy');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
const jointTrainingNewCCTV = () => import('@/views/newMap/jointTrainingNew/realCCTV');
const Errpr404 = () => import('@/views/error-page/404');
@ -354,7 +354,7 @@ export const constantRoutes = [
component: Jl3dRailwayDrive,
hidden: true
},
{
path: '/jlmap3d/devicemodel',
component: Jlmap3dModel,
@ -451,6 +451,11 @@ export const publicAsyncRoute = [
component: JointTrainingNew,
hidden: true
},
{
path: '/jointTrainingNewCCTV',
component: jointTrainingNewCCTV,
hidden: true
},
{
path: '/jlmap3d',
component: Jlmap3d,

View File

@ -181,6 +181,9 @@ const iscs = {
},
setCloseMusic: (state, num) => {
state.closeMusicNum = num;
},
updateIscsState: (state, deviceStatus) => {
Vue.prototype.$iscs && Vue.prototype.$iscs.update(deviceStatus);
}
},
@ -188,6 +191,9 @@ const iscs = {
setIscsData: ({ commit }, iscs) => {
commit('setIscsData', iscs);
},
updateIscsState: ({ commit }, deviceStatus) => {
commit('updateIscsState', deviceStatus);
},
updateIscsDevices: ({ commit }, models) => {
return new Promise((resolve) => {
if (!(models instanceof Array)) {

View File

@ -340,6 +340,7 @@ const socket = {
competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: [], // 仿真报警信息
deviceStateMessages: null, // 新版订阅设备状态消息
iscsStateMessages: null, // iscs设备状态消息
simulationSpeed: 1, // 仿真倍速
simulationPause: false,
simulationPslStatus: [], // PSL面板按钮状态信息
@ -421,6 +422,9 @@ const socket = {
},
setSimulationSpeed: (state, speed) => {
state.simulationSpeed = speed;
},
setIscsStateMessages: (state, speed) => {
state.iscsStateMessages = speed;
}
},
@ -506,6 +510,9 @@ const socket = {
},
setSimulationTimeSync:({ commit }, time) => {
commit('setSimulationTimeSync', time);
},
handleIscsState:({ commit }, state) => {
commit('setIscsStateMessages', state);
}
}
};

View File

@ -2,7 +2,7 @@ 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 = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.167:9000'; // 旭强 无线
@ -10,7 +10,7 @@ export function getBaseUrl() {
// 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'; // 张赛
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -8,6 +8,7 @@ export const perpetualTopic = '/user/topic/message'; // 公用topic
export const roomTopic = '/user/queue/room'; // 房间topic
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
// export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
export function getTopic(type, group) {
let topic = '';
@ -24,6 +25,9 @@ export function getTopic(type, group) {
// topic = `/user/queue/simulation/${group}/state`;
topic = `/queue/simulation/${group}/state`;
break;
case 'ISCSPSD':
topic = `/queue/simulation/${group}/iscs/psd`;
break;
}
return topic;
}
@ -49,6 +53,8 @@ function callback(Response) {
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('state')) {
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('iscs')) {
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
} else {
const data = JSON.parse(Response.body);
store.dispatch('socket/setStomp', data);

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="编码:" prop="code">
<el-input v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
</el-form-item>

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="门高:" prop="height">
<el-input v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="门高:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
</el-form-item>

View File

@ -41,6 +41,8 @@ export default {
return this.$route.query.lineCode;
}
},
mounted() {
},
methods: {
}
};

View File

@ -173,6 +173,7 @@ export default {
}
});
}
this.$emit('viewLoaded');
},
setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);

View File

@ -58,6 +58,9 @@ export default {
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
loadRunPlanData(this.group);
});
},
'$store.state.socket.iscsStateMessages': function (list) {
this.$store.dispatch('iscs/updateIscsState', list);
}
},
mounted() {

View File

@ -2,7 +2,7 @@
<div class="psdSystem">
<div class="psdSystem_header">{{ stationName+' 屏蔽门系统' }}</div>
<div>
<iscsSystem ref="iscsPlate" />
<iscsSystem ref="iscsPlate" @viewLoaded="viewLoaded" />
<!-- :width-canvas="width" :canvas-height="height" -->
</div>
<!-- <div class="psdSystem_footer">
@ -14,6 +14,8 @@
<script>
import iscsSystem from '../canvas/iscsCanvas';
import {getIscsData} from '@/api/iscs';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, getTopic } from '@/utils/stomp';
export default {
name:'PsdSystem',
components:{
@ -49,9 +51,26 @@ export default {
const data = JSON.parse(resp.data.graphData);
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
} else {
this.loading = false;
}
this.loading = false;
}
});
},
beforeDestroy() {
},
methods: {
viewLoaded() {
this.subscribe();
},
subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(getTopic('ISCSPSD', this.$route.query.group), header);
this.$store.dispatch('app/animationsClose');
},
clearSubscribe() {
clearSubscribe(getTopic('ISCSPSD', this.$route.query.group));
}
}
};
</script>

View File

@ -482,14 +482,27 @@ export default {
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type} });
} else if (this.$route.query.type == 'CCTV') {
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
mapid:resp.data.map.id,
group:res.data.group,
lineCode: resp.data.map.lineCode,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
if (this.project == 'richorjoint') {
this.$router.push({
path:'/jointTrainingNewCCTV',
query:{
mapid:resp.data.map.id,
group:res.data.group,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
}
});
} else {
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
mapid:resp.data.map.id,
group:res.data.group,
lineCode: resp.data.map.lineCode,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
}
} else if (this.$route.query.type === 'DEPOT') {
this.$router.push({ path: `/displayNew/demon`, query: {
group: res.data.group,
@ -567,12 +580,11 @@ export default {
});
}
});
}else if(this.project === 'zzwwtest'){
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} });
}
else if(this.project === 'richorlesson3d'){
this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} });
}else {
} else if (this.project === 'zzwwtest') {
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} });
} else if (this.project === 'richorlesson3d') {
this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} });
} else {
if (this.teacherLogin) {
this.$router.push({ path: '/info/organization/classManage?enter=teacher' });
} else {

View File

@ -0,0 +1,90 @@
<template>
<div class="jl3dpassflow">
<div id="jlReal3d" class="jlReal3d">
<div class="realCctv1">
<video id="myvideo0" class="video-js">
<source src="http://192.168.1.254/hls/cctv1.m3u8" type="application/x-mpegURL">
</video>
</div>
<div class="realCctv2">
<video id="myvideo1" class="video-js">
<source src="http://192.168.1.254/hls/cctv2.m3u8" type="application/x-mpegURL">
</video>
</div>
</div>
<div class="menudown">
<el-button-group>
<el-button type="primary" @click="back">退出</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import Video from 'video.js';
import 'video.js/dist/video-js.css';
export default {
name:'RealCCTV',
data() {
return {
videoList:[]
};
},
mounted() {
for (var i = 0; i < 2; i++) {
const videoPlay = new Video('myvideo' + i, {
controls: false,
autoplay: 'muted',
loop:true,
preload: 'auto',
width: window.innerWidth / 2 + 'px',
height: window.innerHeight + 'px',
hls: {
withCredentials: true
}
}, function () { console.log('videojs播放器初始化成功'); });
this.videoList.push(videoPlay);
}
},
methods:{
back() {
window.close();
}
}
};
</script>
<style>
.jl3dpassflow{
width: 100%;
height: 100%;
}
.jlReal3d{
width: 100%;
height: 100%;
z-index: 0;
font-size:0;
}
.realCctv1{
position: absolute;
width:50%;
height:50%;
left:0;
top:0;
}
.realCctv2{
position: absolute;
width:50%;
height:50%;
left:50%;
top:0;
}
.menudown{
bottom:0;
right:0;
position:absolute;
z-index: 2;
}
.video-js video{
outline: none !important;
}
</style>