This commit is contained in:
zyy 2020-12-16 15:37:22 +08:00
commit 34bff76eb5
79 changed files with 373 additions and 291 deletions

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
bind(el) { bind(el) {

View File

@ -1,7 +1,7 @@
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// import * as Event from 'zrender/src/core/event'; // import * as Event from 'zrender/src/core/event';
class EventModel { class EventModel {

View File

@ -2,7 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix'; import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType'; import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender'; import deviceRender from '../constant/deviceRender';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export function createTransform(opts) { export function createTransform(opts) {
let transform = matrix.create(); let transform = matrix.create();

View File

@ -7,7 +7,7 @@ import deviceType from './constant/deviceType';
import KeyboardController from './keyboardController'; import KeyboardController from './keyboardController';
import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser'; import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser';
import { updateIscsData } from './utils/parser'; import { updateIscsData } from './utils/parser';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { selectLineCode } from './constant/deviceStyle'; import { selectLineCode } from './constant/deviceStyle';
const renderer = 'canvas'; const renderer = 'canvas';

View File

@ -1,7 +1,7 @@
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class EventModel { class EventModel {
constructor(e) { constructor(e) {

View File

@ -1,7 +1,7 @@
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class EventModel { class EventModel {
constructor(e) { constructor(e) {

View File

@ -2,7 +2,6 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix'; import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType'; import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender'; import deviceRender from '../constant/deviceRender';
// import store from '@/store/index_APP_TARGET';
// import { deepClone } from '@/utils/index'; // import { deepClone } from '@/utils/index';
export function createTransform(opts) { export function createTransform(opts) {

View File

@ -15,7 +15,7 @@ import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3dda
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
var clock = new THREE.Clock(); var clock = new THREE.Clock();
export function Jl3ddeviceNew(dom,group,token,skinCode) { export function Jl3ddeviceNew(dom,group,token,skinCode) {

View File

@ -6,7 +6,7 @@ import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN';
import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN'; import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN';
import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN'; import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN';
import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js'; import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js'; import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';

View File

@ -1,7 +1,7 @@
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl' import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// 定于仿真socket接口 // 定于仿真socket接口
export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi) { export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi) {

View File

@ -29,7 +29,7 @@ import { PathFinder } from '@/jlmap3d/jl3dpassflow/passerai/pathfinder.js';
import { PassflowConnect } from '@/jlmap3d/jl3dpassflow/connect/passflowconnect.js'; import { PassflowConnect } from '@/jlmap3d/jl3dpassflow/connect/passflowconnect.js';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// import { Loading } from 'element-ui'; // import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; import {Stats} from '@/jlmap3d/main/lib/stats.min.js';

View File

@ -1,7 +1,7 @@
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl' import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// 定于仿真socket接口 // 定于仿真socket接口
export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,jl3d) { export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,jl3d) {
@ -30,9 +30,8 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
// 仿真socket接口回调函数 // 仿真socket接口回调函数
function callback(Response) { function callback(Response) {
const data = JSON.parse(Response.body); const data = JSON.parse(Response.body);
if(data.type == "PFV"){ if(data.type == "PFV"){
console.log(data);
for(let i=0;i<passerStation.stationlist.length;i++){ for(let i=0;i<passerStation.stationlist.length;i++){
if(passerStation.stationlist[i].code == data.body){ if(passerStation.stationlist[i].code == data.body){
jl3d.changestation(passerStation.stationlist[i].name); jl3d.changestation(passerStation.stationlist[i].name);
@ -44,7 +43,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
} }
/** 站台客流当前人数信息 */ /** 站台客流当前人数信息 */
if(data.type == "STAND_PFI"){ if(data.type == "STAND_PFI"){
// console.log(data);
let newStandData = data.body; let newStandData = data.body;
let count = 0; let count = 0;
for(let j=0;j<passerStation.stationlist.length;j++){ for(let j=0;j<passerStation.stationlist.length;j++){
@ -199,6 +198,13 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
} }
} }
} }
if(data.type == 'Device_Load_Destroy_3D'){
start = true;
console.log("仿真重开=====================");
}
if(data.type == 'Simulation_Over') { if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.reload(); location.reload();

View File

@ -1,7 +1,7 @@
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl' import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// 定于仿真socket接口 // 定于仿真socket接口
export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passerAi) { export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passerAi) {
@ -10,7 +10,7 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
let topic = '/user/queue/simulation/jl3d/'+routegroup; let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() }; let header = {'X-Token': getToken() };
let restart = false;
socketon(topic); socketon(topic);
function socketon(topic) { function socketon(topic) {
@ -35,7 +35,9 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
// console.log(trafficTrain.trainList); // console.log(trafficTrain.trainList);
for(let k in trafficTrain.trainList){ for(let k in trafficTrain.trainList){
if(trafficTrain.trainList[k].code == data.body){ if(trafficTrain.trainList[k].code == data.body){
updateValue(data.body); console.log( trafficTrain.trainList[k].code);
console.log( data.body);
updateTrafficTrainValue(data.body);
trafficTrain.updateNowTrainCode(data.body); trafficTrain.updateNowTrainCode(data.body);
trafficTrain.updateNowTrunk(0+''); trafficTrain.updateNowTrunk(0+'');
break; break;
@ -62,7 +64,10 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
// console.log(data); // console.log(data);
trafficTrain.updateTrainData(data.body); trafficTrain.updateTrainData(data.body);
if(restart == true){
restart = false;
trafficTrain.restart();
}
// if(toptrain.nowcode == data.body.code){ // if(toptrain.nowcode == data.body.code){
// console.log(data); // console.log(data);
// //根据上下车人数创建人 // //根据上下车人数创建人
@ -131,7 +136,10 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
} }
} }
if(data.type == 'Device_Load_Destroy_3D'){
restart = true;
}
if(data.type == 'Simulation_Over') { if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.reload(); location.reload();

View File

@ -30,7 +30,7 @@ import { PathFinder } from '@/jlmap3d/jl3dtrafficplan/passerai/pathfinder.js';
import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js'; import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// import { Loading } from 'element-ui'; // import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
@ -192,11 +192,11 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap,initCode) {
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);
scope.resetscene();
} }
this.changestation = function(stationname){ this.changestation = function(stationname){
passerStation.changestation(stationname); passerStation.changestation(stationname);
console.log(passerStation.nowStation);
scope.humanWaitTop = passerStation.nowStation.toppassers; scope.humanWaitTop = passerStation.nowStation.toppassers;
scope.humanWaitDown = passerStation.nowStation.downpassers; scope.humanWaitDown = passerStation.nowStation.downpassers;
passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed; passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed;

View File

@ -31,7 +31,7 @@ import { PathFinder } from '@/jlmap3d/jl3dpassflow/passerai/pathfinder.js';
import { TrainConnect } from '@/jlmap3d/jl3dtrafficplan/connect/trainconnect.js'; import { TrainConnect } from '@/jlmap3d/jl3dtrafficplan/connect/trainconnect.js';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// import { Loading } from 'element-ui'; // import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
@ -343,6 +343,11 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
} }
} }
} }
this.restart = function(){
updateTrafficTrainValue(passerTrain.toptrain.nowcode);
scope.updateNowTrainCode(passerTrain.toptrain.nowcode);
scope.updateNowTrunk(0+'');
};
this.updateNowTrainCode = function(newCode){ this.updateNowTrainCode = function(newCode){
passerTrain.toptrain.nowcode = newCode; passerTrain.toptrain.nowcode = newCode;

View File

@ -1,5 +1,5 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js'; import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
//模型管理器 //模型管理器
let mode = "0"; let mode = "0";
export function ModelManager(){ export function ModelManager(){

View File

@ -1,8 +1,5 @@
export function PasserHuman() { export function PasserHuman() {
let scope = this; let scope = this;
//初始人物模型和动画 //初始人物模型和动画
let originhuman1 = null; let originhuman1 = null;
let originhuman2 = null; let originhuman2 = null;

View File

@ -11,7 +11,7 @@ let defaultsignal = {
deviceType:"signal", deviceType:"signal",
type:"low", type:"low",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/signal/d3d.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/13-42231.FBX"
} }
let defaulttrain = { let defaulttrain = {
@ -20,7 +20,7 @@ let defaulttrain = {
deviceType:"train", deviceType:"train",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/train/train.FBX" url:BASE_ASSET_API+"/MODEL/2020-11-16/57-53841.FBX"
} }
@ -30,7 +30,7 @@ let defaultstation = {
deviceType:"stand", deviceType:"stand",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/station/fuzhou.FBX" url:BASE_ASSET_API+"/MODEL/2020-11-16/52-60478.FBX"
} }
let waicestation = { let waicestation = {
id:"10", id:"10",
@ -38,7 +38,7 @@ let waicestation = {
deviceType:"standwaice", deviceType:"standwaice",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/station/waicestation.FBX" url:BASE_ASSET_API+"/MODEL/2020-11-16/53-61736.FBX"
} }
let defaultswitch = { let defaultswitch = {
@ -47,7 +47,7 @@ let defaultswitch = {
deviceType:"switch", deviceType:"switch",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/daocha/daocha.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
} }
@ -57,7 +57,7 @@ let defaultsuidao = {
deviceType:"suidao", deviceType:"suidao",
type:"suidao", type:"suidao",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/suidao/suidao.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/21-35677.FBX"
} }
@ -68,7 +68,7 @@ let defaultbackground = {
deviceType:"background", deviceType:"background",
type:"background", type:"background",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/suidao/background.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/21-35677.FBX"
} }
let defaultautorail = { let defaultautorail = {
@ -86,7 +86,7 @@ let autoswitch = {
deviceType:"autoswitch", deviceType:"autoswitch",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/auto/autoswitch.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
} }
let autoswitch1 = { let autoswitch1 = {
@ -95,7 +95,7 @@ let autoswitch1 = {
deviceType:"autoswitch1", deviceType:"autoswitch1",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/auto/switch1.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
} }
let autoswitch2 = { let autoswitch2 = {
@ -104,7 +104,7 @@ let autoswitch2 = {
deviceType:"autoswitch2", deviceType:"autoswitch2",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:BASE_ASSET_API+"/MODEL/auto/switch2.FBX" url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
} }
export function AssetLoader(){ export function AssetLoader(){
@ -305,34 +305,40 @@ export function AssetLoader(){
fbxpromise(signal) fbxpromise(signal)
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
console.log("test");
return fbxpromise(train); return fbxpromise(train);
}) })
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
console.log("test");
return fbxpromise(station); return fbxpromise(station);
}) })
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
console.log("test");
return fbxpromise(wstation); return fbxpromise(wstation);
}) })
.then(function(data){ // .then(function(data){
////console.log(data); // ////console.log(data);
return fbxpromise(autorail); // return fbxpromise(autorail);
}) // })
// .then(function(data){ // .then(function(data){
// ////console.log(data); // ////console.log(data);
// return fbxpromise(autosuidao); // return fbxpromise(autosuidao);
// }) // })
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
console.log("defaultswitch1");
return fbxpromise(defaultswitch1); return fbxpromise(defaultswitch1);
}) })
.then(function(data){ .then(function(data){
console.log("defaultswitch2");
////console.log(data); ////console.log(data);
return fbxpromise(defaultswitch2); return fbxpromise(defaultswitch2);
}) })
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
console.log("autoswitchs");
return fbxpromise(autoswitchs); return fbxpromise(autoswitchs);
}) })
.then(function(data){ .then(function(data){
@ -637,9 +643,9 @@ export function AssetLoader(){
//object.traverse(function (node) {//获取其中对象 //object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true; // node.frustumCulled = true;
//}); //});
if(asset.type == "train"){
console.log(asset); console.log(asset);
if(asset.type == "train"){
let realtrain = new THREE.Group(); let realtrain = new THREE.Group();
let j = object.children.length; let j = object.children.length;
for(j;j>0;j--){ for(j;j>0;j--){

View File

@ -10,7 +10,7 @@ import {TdtList} from '@/jlmap3d/main/newmodel/TdtList.js';
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js'; import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
// import { Loading } from 'element-ui'; // import { Loading } from 'element-ui';
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js'; // import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';

View File

@ -10,7 +10,7 @@ import deviceType from './constant/deviceType';
import { selectLineCode } from './config/deviceStyle'; import { selectLineCode } from './config/deviceStyle';
import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import Vue from 'vue'; import Vue from 'vue';
const renderer = 'canvas'; const renderer = 'canvas';

View File

@ -1,7 +1,7 @@
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class EventModel { class EventModel {
constructor(e) { constructor(e) {

View File

@ -1,6 +1,6 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class EVertical2Door extends Group { class EVertical2Door extends Group {
constructor(model) { constructor(model) {

View File

@ -2,7 +2,7 @@ import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import JTriangle from '../../utils/JTriangle'; import JTriangle from '../../utils/JTriangle';
class EMouse extends Group { class EMouse extends Group {
constructor(device, code) { constructor(device, code) {

View File

@ -12,7 +12,7 @@ import ELimitName from './ELimitName'; // 成都三号线 限速名称
// import JTriangle from '../../utils/JTriangle'; // import JTriangle from '../../utils/JTriangle';
import { drawSectionStyle } from '../../config/defaultStyle'; import { drawSectionStyle } from '../../config/defaultStyle';
import EStopRouteImg from './EStopRouteImg'; import EStopRouteImg from './EStopRouteImg';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import Vue from 'vue'; import Vue from 'vue';
/** 区段*/ /** 区段*/

View File

@ -10,7 +10,7 @@ import EArrow from './EArrow';
import { arrow } from '../utils/ShapePoints'; import { arrow } from '../utils/ShapePoints';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import EStationText from './EStationText'; import EStationText from './EStationText';
import { traverseLineElements } from '../utils/ShapeStatusCovert'; import { traverseLineElements } from '../utils/ShapeStatusCovert';

View File

@ -1,6 +1,6 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class EMouse extends Group { class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();

View File

@ -10,7 +10,7 @@ import ELockArc from './ELockArc';
import EMouse from './EMouse'; import EMouse from './EMouse';
import EHighlight from '../element/EHighlight'; import EHighlight from '../element/EHighlight';
import ETriangle from './ETriangle'; import ETriangle from './ETriangle';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import Vue from 'vue'; import Vue from 'vue';
export default class Switch extends Group { export default class Switch extends Group {

View File

@ -2,7 +2,7 @@ import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import LangStorage from '@/utils/lang'; import LangStorage from '@/utils/lang';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import Vue from 'vue'; import Vue from 'vue';
class EMouse extends Group { class EMouse extends Group {

View File

@ -3,7 +3,7 @@ import TrainBodyBox from './TrainBodyBox';
// import '../StationStand/EDetain'; // import '../StationStand/EDetain';
import ETextName from '../element/ETextName'; // 名称文字 (共有) import ETextName from '../element/ETextName'; // 名称文字 (共有)
import EMouse from './EMouse'; import EMouse from './EMouse';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import Circle from 'zrender/src/graphic/shape/Circle'; import Circle from 'zrender/src/graphic/shape/Circle';
import BoundingRect from 'zrender/src/core/BoundingRect'; import BoundingRect from 'zrender/src/core/BoundingRect';
import Vue from 'vue'; import Vue from 'vue';

View File

@ -3,7 +3,7 @@ import TrainHead from './TrainHead';
import TrainBody from './TrainBody'; import TrainBody from './TrainBody';
import BoundingRect from 'zrender/src/core/BoundingRect'; import BoundingRect from 'zrender/src/core/BoundingRect';
import ETriangle from '../Train/ETriangle'; import ETriangle from '../Train/ETriangle';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import EDirection from './EDirection'; import EDirection from './EDirection';
/** 列车 */ /** 列车 */

View File

@ -2,7 +2,7 @@
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import EMouse from './EMouse'; import EMouse from './EMouse';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
class TrainWindow extends Group { class TrainWindow extends Group {
constructor(model, style) { constructor(model, style) {

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
/** 创建一个车次数据点*/ /** 创建一个车次数据点*/

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -1,5 +1,5 @@
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { sendCommandTrain } from '@/api/jmap/training'; import { sendCommandTrain } from '@/api/jmap/training';

View File

@ -1,5 +1,5 @@
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -1,11 +1,11 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 180, EdgeHeight: 180,
/** 间隔高度*/ /** 间隔高度*/
CoordMultiple: 180, CoordMultiple: 900,
/** 偏移时间*/ /** 偏移时间*/
TranslationTime: 60 * 60 * 2, TranslationTime: 60 * 60 * 2,

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 3, EdgeHeight: 3,

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -149,6 +149,9 @@ export default {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
}); });
}, },
handleCurrentChange(val) { handleCurrentChange(val) {

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600 / 3, EdgeHeight: 600 / 3,

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
const StationMap = { const StationMap = {
YARD1: '潏河停车场', YARD1: '潏河停车场',
YARD2: '潏河停车场', YARD2: '潏河停车场',

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
const { body } = document; const { body } = document;
const WIDTH = 1024; const WIDTH = 1024;

View File

@ -10,7 +10,7 @@ import LangStorage from '@/utils/lang';
import App from './App'; import App from './App';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import store from './store/index_APP_TARGET'; import store from './store/index';
import router from './router/index_APP_TARGET'; import router from './router/index_APP_TARGET';
import CancelMouseState from '@/mixin/CancelMouseState.js'; import CancelMouseState from '@/mixin/CancelMouseState.js';
Vue.mixin(CancelMouseState); Vue.mixin(CancelMouseState);

View File

@ -1,5 +1,5 @@
import Vue from 'vue'; import Vue from 'vue';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import router from './router/index_APP_TARGET'; import router from './router/index_APP_TARGET';
import {loginInfo} from '@/scripts/ProjectConfig'; import {loginInfo} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress'; import NProgress from 'nprogress';

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import router from '@/router/index_APP_TARGET'; import router from '@/router/index_APP_TARGET';
import CommandHandler from './CommandHandler.js'; import CommandHandler from './CommandHandler.js';
import ValidateHandler from './ValidateHandler.js'; import ValidateHandler from './ValidateHandler.js';

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import CommandHandler from './CommandHandler'; import CommandHandler from './CommandHandler';
import { State2SimulationMap, State2ControlMap } from './Config'; import { State2SimulationMap, State2ControlMap } from './Config';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';

View File

@ -1,48 +0,0 @@
import Vuex from 'vuex';
import Vue from 'vue';
import app from './modules/app';
import settings from './modules/settings';
import user from './modules/user';
import config from './modules/config';
import permission from './modules/permission';
import map from './modules/map';
import menuOperation from './modules/menuoperation';
import training from './modules/training';
import trainingList from './modules/trainingList';
import exam from './modules/exam';
import runPlan from './modules/runplan';
import socket from './modules/socket';
import scriptRecord from './modules/scriptRecord';
import ibp from './modules/ibp';
import order from './modules/order';
import iscs from './modules/iscs';
import race from './modules/race';
import getters from './getters';
Vue.use(Vuex);
const store = new Vuex.Store({
modules: {
app,
settings,
user,
permission,
config,
map,
menuOperation,
training,
trainingList,
exam,
runPlan,
socket,
scriptRecord,
ibp,
order,
iscs,
race
},
getters
});
export default store;

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
const exam = { const exam = {
namespaced: true, namespaced: true,

View File

@ -14,7 +14,9 @@ const runPlan = {
refreshCount: 0, // 刷新页面重新加载 refreshCount: 0, // 刷新页面重新加载
initialPlanData: {}, // 运行图原始数据 initialPlanData: {}, // 运行图原始数据
draftSelected: {}, // 草稿运行图选中对象 draftSelected: {}, // 草稿运行图选中对象
draftStations: [] // 草稿运行图车站列表 draftStations: [], // 草稿运行图车站列表
runPlanMap: {}, // 运行图数据map以id和version 为标识)
runPlanInfo: {} // 运行图信息
}, },
getters: { getters: {
stations: (state) => { stations: (state) => {
@ -22,6 +24,13 @@ const runPlan = {
}, },
draftStations: (state) => { draftStations: (state) => {
return state.draftStations || []; return state.draftStations || [];
},
getRunPlanData: (state) => {
if (!state.runPlanInfo || !state.runPlanInfo.templateId) {
return '';
} else {
return state.runPlanMap[`runPlan_${state.runPlanInfo.templateId}_${state.runPlanInfo.version}`];
}
} }
}, },
mutations: { mutations: {
@ -110,6 +119,14 @@ const runPlan = {
}, },
refresh: (state) => { refresh: (state) => {
state.refreshCount++; state.refreshCount++;
},
setRunPlanMap: ( state, data) => {
if (state.runPlanInfo && state.runPlanInfo.templateId) {
state.runPlanMap[`runPlan_${state.runPlanInfo.templateId}_${state.runPlanInfo.version}`] = data;
}
},
setRunPlanInfo: (state, data) => {
state.runPlanInfo = data;
} }
}, },
actions: { actions: {
@ -186,6 +203,12 @@ const runPlan = {
/** 刷新页面*/ /** 刷新页面*/
refresh: ({commit}) => { refresh: ({commit}) => {
commit('refresh'); commit('refresh');
},
setRunPlanInfo: ({commit}, data) => {
commit('setRunPlanInfo', data);
},
setRunPlanMap: ({commit}, data) => {
commit('setRunPlanMap', data);
} }
} }
}; };

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
function handle(state, data) { function handle(state, data) {

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// 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://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强 // BASE_API = 'http://192.168.8.129:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛 // BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.110:9000'; // 杜康 BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map'; import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
// getNewMapDataByMapId // getNewMapDataByMapId
// import { getNewMapDataByGroup } from '@/api/simulation'; // import { getNewMapDataByGroup } from '@/api/simulation';

View File

@ -1,5 +1,5 @@
import axios from 'axios'; import axios from 'axios';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import qs from 'qs'; import qs from 'qs';
import { i18n } from '@/main.js'; import { i18n } from '@/main.js';
import { MessageBox } from 'element-ui'; import { MessageBox } from 'element-ui';

View File

@ -1,4 +1,4 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
/** 创建一个车次数据点*/ /** 创建一个车次数据点*/

View File

@ -2,7 +2,7 @@ import { getToken } from '@/utils/auth';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { getBaseUrl } from '@/utils/baseUrl'; import { getBaseUrl } from '@/utils/baseUrl';
import { MessageBox } from 'element-ui'; import { MessageBox } from 'element-ui';
import store from '@/store/index_APP_TARGET'; 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';

View File

@ -1,6 +1,6 @@
import Vue from 'vue'; import Vue from 'vue';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export const displayTopic = '/user/queue/simulation'; // 其他仿真topic export const displayTopic = '/user/queue/simulation'; // 其他仿真topic
export const perpetualTopic = '/user/topic/message'; // 公用topic export const perpetualTopic = '/user/topic/message'; // 公用topic

View File

@ -5,7 +5,8 @@
</div> </div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" /> <drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition> <transition>
<router-view :product-list="productList" :width-left="widthLeft" /> <!-- :product-list="productList" -->
<router-view :width-left="widthLeft" />
</transition> </transition>
</div> </div>
</template> </template>

View File

@ -200,7 +200,6 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
// import store from '@/store/index_APP_TARGET';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import {getScriptByIdNew} from '@/api/script'; import {getScriptByIdNew} from '@/api/script';

View File

@ -43,7 +43,7 @@
import Vue from 'vue'; import Vue from 'vue';
import localStore from 'storejs'; import localStore from 'storejs';
import axios from 'axios'; import axios from 'axios';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';

View File

@ -6,7 +6,9 @@
<el-tab-pane label="资源" name="models"> <el-tab-pane label="资源" name="models">
<el-scrollbar style="margin-bottom:1px"> <el-scrollbar style="margin-bottom:1px">
<el-form ref="form" label-width="130px" size="mini"> <el-form ref="form" label-width="130px" size="mini">
<div class="modellist" v-for="(asset,index) in nowAssetList" @click="modelSelect(index)"> <div class="modellist" v-for="(asset,index) in nowAssetList" @click="modelSelect(index)">
<div > <div >
<img class="modelpic" <img class="modelpic"
:style="{'background-image': 'url('+localStatic+'/texture/modelfile.png)'}" :style="{'background-image': 'url('+localStatic+'/texture/modelfile.png)'}"
@ -18,7 +20,8 @@
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="清空当前选项内容" name="delet">
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>

View File

@ -178,7 +178,7 @@ export default {
if (this.$route.query.type == 'CCTV') { if (this.$route.query.type == 'CCTV') {
this.isCctv = false; this.isCctv = false;
} }
window.updateValue = this.updateValue; window.updateTrafficTrainValue = this.updateTrafficTrainValue;
window.updateTrainNum = this.updateTrainNum; window.updateTrainNum = this.updateTrainNum;
}, },
@ -215,7 +215,8 @@ export default {
this.isActive=index; this.isActive=index;
this.jl3d.switchcamera(index+''); this.jl3d.switchcamera(index+'');
}, },
updateValue(newcode){ updateTrafficTrainValue(newcode){
this.nowCode = newcode;
this.value = newcode; this.value = newcode;
}, },
@ -252,6 +253,7 @@ export default {
for(let i = 0;i<this.takelist.length;i++){ for(let i = 0;i<this.takelist.length;i++){
this.allPassers = this.allPassers + this.takelist[i].num; this.allPassers = this.allPassers + this.takelist[i].num;
} }
this.value = this.nowCode+"(现有乘客"+this.allPassers+"人)"; this.value = this.nowCode+"(现有乘客"+this.allPassers+"人)";
}, },
getnum(num,pnum){ getnum(num,pnum){

View File

@ -181,23 +181,34 @@ export default {
if (this.$route.query.group) { if (this.$route.query.group) {
// //
getByGroupStationList(this.$route.query.group).then(response => { getByGroupStationList(this.$route.query.group).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => { this.$store.dispatch('runPlan/setStations', response.data).then(async() => {
getEveryDayRunPlanNew(this.$route.query.group).then(async resp => { // 仿 if (this.$store.getters['runPlan/getRunPlanData']) {
await this.$store.dispatch('runPlan/setPlanData', resp.data); await this.$store.dispatch('runPlan/setPlanData', this.$store.getters['runPlan/getRunPlanData']);
await this.$store.dispatch('runPlan/setInitialPlanData', resp.data); await this.$store.dispatch('runPlan/setInitialPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.loadChartPage(); this.loadChartPage();
this.setPosition(); this.setPosition();
this.loadInitData(); this.loadInitData();
this.inter && clearInterval(this.inter); this.inter && clearInterval(this.inter);
this.subscribe(); this.subscribe();
}).catch(error => { } else {
this.$store.dispatch('runPlan/setPlanData', []); getEveryDayRunPlanNew(this.$route.query.group).then(async resp => { // 仿
if (error.code == 30001) { await this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad')); await this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
} else { this.$store.dispatch('runPlan/setRunPlanMap', resp.data);
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.loadChartPage();
} this.setPosition();
}); this.loadInitData();
this.inter && clearInterval(this.inter);
this.subscribe();
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail')); this.$messageBox(this.$t('display.schema.getStationListFail'));

View File

@ -6,7 +6,7 @@
<script> <script>
import PlanSchedule from '@/views/planSchedule/index'; import PlanSchedule from '@/views/planSchedule/index';
import { getEveryDayRunPlanNew } from '@/api/simulation'; import { getEveryDayRunPlanNew, getSimulationInfoNew } from '@/api/simulation';
// //
export default { export default {
@ -39,16 +39,24 @@ export default {
}, },
watch: { watch: {
'$store.state.socket.runPlanReloadCount': function (val) { '$store.state.socket.runPlanReloadCount': function (val) {
getEveryDayRunPlanNew(this.group).then(resp => { getSimulationInfoNew(this.group).then(res => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data); if (this.$store.getters['runPlan/getRunPlanData']) {
this.viewDisabled = false; this.$store.dispatch('runPlan/setPlanData', this.$store.getters['runPlan/getRunPlanData']);
}).catch(error => { this.$store.dispatch('runPlan/setInitialPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else { } else {
this.$messageBox(this.$t('display.schema.getRunDiagramFail')); getEveryDayRunPlanNew(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
this.$store.dispatch('runPlan/setRunPlanMap', resp.data);
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
} }
}); });
} }

View File

@ -208,6 +208,7 @@ export default {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime'); this.$store.dispatch('training/countTime');
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
this.planRunning = resp.data.planRunning; this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) { if (resp.data.planRunning) {
this.$store.commit('training/start'); this.$store.commit('training/start');

View File

@ -4,6 +4,7 @@
<select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" /> <select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<template v-if="!dataError&& project !== 'bjd'"> <template v-if="!dataError&& project !== 'bjd'">
<el-button-group> <el-button-group>
<el-button v-if="isLocalStation" size="small" @click="goIbp">IBP盘</el-button>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button> <el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button>
<!-- 加载剧本 --> <!-- 加载剧本 -->
<el-button v-if="isDemon && !isScheduling && !isContest" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button> <el-button v-if="isDemon && !isScheduling && !isContest" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
@ -37,6 +38,7 @@ import { getByGroupStationList } from '@/api/jmap/map';
import { getEveryDayRunPlanNew } from '@/api/simulation'; import { getEveryDayRunPlanNew } from '@/api/simulation';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { getIbpInfoByStation } from '@/api/ibp';
// //
export default { export default {
@ -142,18 +144,25 @@ export default {
// //
getByGroupStationList(this.group).then(response => { getByGroupStationList(this.group).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => { this.$store.dispatch('runPlan/setStations', response.data).then(() => {
getEveryDayRunPlanNew(this.group).then(resp => { // 仿 if (this.$store.getters['runPlan/getRunPlanData']) {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data); this.$store.dispatch('runPlan/setInitialPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.viewDisabled = false; this.viewDisabled = false;
}).catch(error => { } else {
this.$store.dispatch('runPlan/setPlanData', []); getEveryDayRunPlanNew(this.group).then(resp => { // 仿
if (error.code == 30001) { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad')); this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
} else { this.$store.dispatch('runPlan/setRunPlanMap', resp.data);
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.viewDisabled = false;
} }).catch(error => {
}); this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail')); this.$messageBox(this.$t('display.schema.getStationListFail'));
@ -231,6 +240,34 @@ export default {
} }
}); });
window.open(routeData.href, '_blank', 'noopener noreferrer'); window.open(routeData.href, '_blank', 'noopener noreferrer');
},
goIbp() {
const deviceCode = this.$refs.selectStation.showStation;
getIbpInfoByStation(this.$route.query.mapId, deviceCode).then(resp => {
if (resp.data) {
const routeData = this.$router.resolve({
path:`/ibpShow`,
query:{
lineCode: this.$route.query.lineCode,
mapId: this.$route.query.mapId,
group: this.$route.query.group,
stationCode: deviceCode,
loadAll: true,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
} else {
this.$messageBox('本车站暂无IBP盘数据');
}
}).catch((error) => {
if (error.code == '10007') {
this.$messageBox('本车站暂无IBP盘数据');
} else {
this.$message.error('获取IBP盘数据异常');
}
});
} }
} }
}; };

View File

@ -62,7 +62,7 @@
<el-dialog <el-dialog
title="切换客流数据" title="切换客流数据"
:visible.sync="flowDataShow" :visible.sync="flowDataShow"
top="50px" top="150px"
width="400px" width="400px"
:before-do-close="flowDataClose" :before-do-close="flowDataClose"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -75,7 +75,7 @@
<el-option <el-option
v-for="item in flowDataList" v-for="item in flowDataList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name==currentFlowDataName?item.name+' [运行中]':item.name"
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
@ -177,29 +177,37 @@ export default {
}); });
}, },
'$store.state.socket.standPfiNum':function(val) { '$store.state.socket.standPfiNum':function(val) {
const stationNumList = val; if (val) {
stationNumList.forEach(stationNum=>{ // console.log(val, 'standPfiNum');
stationNum.deviceType = 'STAND'; const stationNumList = val;
stationNum.code = stationNum.standCode; stationNumList.forEach(stationNum=>{
}); stationNum.deviceType = 'STAND';
this.$store.dispatch('training/updateMapState', stationNumList); stationNum.code = stationNum.standCode;
});
this.$store.dispatch('training/updateMapState', stationNumList);
}
}, },
'$store.state.socket.trainPfiNum':function(val) { '$store.state.socket.trainPfiNum':function(val) {
const trainNumList = this.$store.state.socket.trainPfiNum; if (val) {
trainNumList.forEach(stationNum=>{ // console.log(val, 'trainPfiNum');
stationNum.deviceType = 'TRAIN'; const trainNumList = this.$store.state.socket.trainPfiNum;
console.log(stationNum.num, 'inital'); trainNumList.forEach(stationNum=>{
}); stationNum.deviceType = 'TRAIN';
this.$store.dispatch('training/updateMapState', trainNumList); console.log(stationNum.num, 'inital');
});
this.$store.dispatch('training/updateMapState', trainNumList);
}
}, },
'$store.state.socket.trainPfiBL':function(val) { '$store.state.socket.trainPfiBL':function(val) {
const trainNum = this.$store.state.socket.trainPfiBL; if (val) {
const device = this.$store.getters['map/getDeviceByCode'](trainNum.code); const trainNum = this.$store.state.socket.trainPfiBL;
trainNum.deviceType = 'TRAIN'; const device = this.$store.getters['map/getDeviceByCode'](trainNum.code);
// console.log(trainNum, device, device.num, trainNum.in, trainNum.out, 'changed'); trainNum.deviceType = 'TRAIN';
trainNum.num = device.num + trainNum.in - trainNum.out; // console.log(trainNum, device, device.num, trainNum.in, trainNum.out, 'changed');
// console.log(trainNum.num, 'changeder'); trainNum.num = device.num + trainNum.in - trainNum.out;
this.$store.dispatch('training/updateMapState', [trainNum]); // console.log(trainNum.num, 'changeder');
this.$store.dispatch('training/updateMapState', [trainNum]);
}
}, },
'$store.state.socket.isFirst':function(val) { '$store.state.socket.isFirst':function(val) {
if (val) { if (val) {
@ -269,6 +277,7 @@ export default {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime'); this.$store.dispatch('training/countTime');
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
this.planRunning = resp.data.planRunning; this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) { if (resp.data.planRunning) {
this.$store.commit('training/start'); this.$store.commit('training/start');
@ -293,9 +302,13 @@ export default {
this.flowDataShow = false; this.flowDataShow = false;
}, },
confirmFlowData() { confirmFlowData() {
if (this.passengerFlowId) { if (this.currentFlowDataId) {
changePassengerFlowData(this.group, this.passengerFlowId).then(res=>{ changePassengerFlowData(this.group, this.currentFlowDataId).then(res=>{
this.$store.dispatch('map/mapClear'); this.$store.dispatch('socket/resetTrainPassagerNum');
// this.$store.dispatch('map/mapClear');
this.flowDataShow = false;
const currentFlowData = this.flowDataList.find(each=>{ return each.id == this.currentFlowDataId; });
if (currentFlowData) { this.currentFlowDataName = currentFlowData.name; }
}).catch(error=>{ }).catch(error=>{
this.$messageBox('切换客流数据失败'); this.$messageBox('切换客流数据失败');
console.log(error.message); console.log(error.message);
@ -359,6 +372,8 @@ export default {
}, },
changeFlowData() { changeFlowData() {
this.flowDataShow = true; this.flowDataShow = true;
const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; });
if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; }
}, },
end() { end() {
exitRunPlan(this.group).then(() => { exitRunPlan(this.group).then(() => {

View File

@ -1,5 +1,5 @@
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config'; import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
// 操作 // 操作
export const operateEnum = { export const operateEnum = {

View File

@ -156,6 +156,7 @@ export default {
const resp = await getSimulationInfoNew(this.group); const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) { if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
if (resp.data.planRunning) { if (resp.data.planRunning) {
this.$store.dispatch('training/start');// 仿 this.$store.dispatch('training/start');// 仿
} else { } else {
@ -302,18 +303,25 @@ export default {
// //
getByGroupStationList(this.group).then(response => { getByGroupStationList(this.group).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => { this.$store.dispatch('runPlan/setStations', response.data).then(() => {
getEveryDayRunPlanNew(this.group).then(resp => { // 仿 if (this.$store.getters['runPlan/getRunPlanData']) {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data); this.$store.dispatch('runPlan/setInitialPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.viewDisabled = false; this.viewDisabled = false;
}).catch(error => { } else {
this.$store.dispatch('runPlan/setPlanData', []); getEveryDayRunPlanNew(this.group).then(resp => { // 仿
if (error.code == 30001) { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad')); this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
} else { this.$store.dispatch('runPlan/setRunPlanMap', resp.data);
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.viewDisabled = false;
} }).catch(error => {
}); this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail')); this.$messageBox(this.$t('display.schema.getStationListFail'));

View File

@ -1,10 +1,11 @@
<template> <template>
<el-select v-if="showSelectStation" v-model="showStation" :style="styleCss" size="small" @change="switchStationMode"> <el-select v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode">
<el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" /> <el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
export default { export default {
name:'SelectStation', name:'SelectStation',
props:{ props:{
@ -16,8 +17,10 @@ export default {
data() { data() {
return { return {
stationListMode: [], // stationListMode: [], //
showStation: '', // showMemberId: '', // memberId
showSelectStation: false // select oldShowMemberId: '',
stationCentralizedMap: {},
showStation: ''
}; };
}, },
computed:{ computed:{
@ -27,45 +30,42 @@ export default {
]) ])
}, },
watch:{ watch:{
'stationList': function () { '$store.state.training.memberData': function (val) {
this.setStationList(); this.$store.state.training.memberList.forEach(item => {
}, if (item.type === 'STATION_SUPERVISOR') {
'$store.state.map.mapViewLoadedCount': function (val) { // const station = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
this.setMode(); this.stationListMode.push({value:item.id, name: station.name});
this.setStationList();
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
}
},
'$store.state.training.prdType': function (val) { //
this.setMode();
},
'$store.state.socket.simulationStart':function(val) {
if (val) {
if (this.$route.query.lineCode == '06') {
this.switchStationMode(this.showStation);// 线
} }
} });
},
'$store.state.training.simulationUserList': function(val) {
this.$store.state.training.simulationUserList.forEach(item => {
if (item.userId == this.$store.state.user.id) {
this.showMemberId = item.memberId;
this.oldShowMemberId = item.memberId;
}
});
this.stationList.forEach(item => {
if (item.centralized) {
this.stationCentralizedMap[item.code] = item.code;
item.chargeStationCodeList.forEach(ele => {
this.stationCentralizedMap[ele] = item.code;
});
}
});
this.switchStationMode( this.showMemberId);
} }
}, },
methods:{ methods:{
setMode() {
if (this.map) {
this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
}
},
switchStationMode(val) { switchStationMode(val) {
if (this.stationListMode.length > 0) { assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: val}], this.$route.query.group).then(resp => {
if (val == null) { this.showMemberId = val;
this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
const nameList = Object.keys(this.$store.state.map.map); const nameList = Object.keys(this.$store.state.map.map);
let list = []; let list = [];
const member = this.$store.state.training.memberData[val];
const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
this.showStation = station.code;
const showStationCode = this.stationCentralizedMap[station.code];
nameList.forEach(item => { nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) { if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
if (item === 'trainList') { if (item === 'trainList') {
@ -77,25 +77,15 @@ export default {
} }
} }
}); });
this.$jlmap.updateShowStation(list, this.showStation); this.$jlmap.updateShowStation(list, showStationCode);
this.setCenter(this.showStation); this.setCenter(showStationCode);
// this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation); }).catch(() => {
// this.$store.dispatch('map/setShowCentralizedStationNum'); this.showMemberId = this.oldShowMemberId;
} this.$message.error('调整角色成员失败!');
});
}, },
setCenter(code) { setCenter(code) {
this.$jlmap.setCenter(code); this.$jlmap.setCenter(code);
},
setStationList() {
this.stationListMode = [];
(this.stationList || []).forEach(item => {
if (item.centralized) {
this.stationListMode.push({value: item.code, name: item.name});
}
});
if (this.stationListMode.length && this.showSelectStation) {
this.showStation = this.stationListMode[0].value;
}
} }
} }
}; };

View File

@ -1,6 +1,6 @@
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index';
export function covertMemberData (activeTrainList, resp) { export function covertMemberData (activeTrainList, resp) {
let lastData = JSON.stringify(resp); let lastData = JSON.stringify(resp);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;

View File

@ -160,10 +160,10 @@ export default {
}, },
'$store.state.training.prdType': function (prdType) { '$store.state.training.prdType': function (prdType) {
this.setPosition(); this.setPosition();
if (prdType == '01' && this.$route.query.lineCode == '06') { if (prdType == '01') {
this.showSelectStation = true; this.showSelectStation = true;
this.cancelBigScreenMode(); this.cancelBigScreenMode();
} else if (prdType == '02' && this.$route.query.lineCode == '06') { } else if (prdType == '02') {
this.showSelectStation = false; this.showSelectStation = false;
this.cancelBigScreenMode(); this.cancelBigScreenMode();
} else if (prdType == '07') { // } else if (prdType == '07') { //
@ -313,6 +313,7 @@ export default {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);// this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);//
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));// 仿 this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));// 仿
this.$store.dispatch('training/countTime');// 仿 this.$store.dispatch('training/countTime');// 仿
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
if (resp.data.planRunning) { if (resp.data.planRunning) {
this.$store.dispatch('training/start');// 仿 this.$store.dispatch('training/start');// 仿
} else { } else {
@ -367,18 +368,14 @@ export default {
this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.hideIbp(); this.hideIbp();
this.drivingShow = false; this.drivingShow = false;
if (this.lineCode === '07' || this.lineCode === '06') { this.mapViewLoadedOver && this.setShowStation('');
this.mapViewLoadedOver && this.setShowStation('');
}
this.jl3dmaintainershow = false; this.jl3dmaintainershow = false;
break; break;
case 'STATION_SUPERVISOR': case 'STATION_SUPERVISOR':
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setPrdType', '01');
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
if (this.lineCode === '06' && deviceCode) { this.$refs.menuSchema.chiShowStation = deviceCode;
this.$refs.menuSchema.chiShowStation = deviceCode; this.mapViewLoadedOver && this.switchStationMode(deviceCode);
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
}
this.jl3dmaintainershow = false; this.jl3dmaintainershow = false;
this.drivingShow = false; this.drivingShow = false;
break; break;

View File

@ -1,9 +1,9 @@
<template> <template>
<div style="height:100%"> <div style="height:100%">
<div class="schema" :style="{top: offset+'px'}"> <div class="schema" :style="{top: offset+'px'}">
<el-select v-if="showSelectStation" v-model="chiShowStation" style="width: 100px;" size="small" @change="switchStationMode"> <!--<el-select v-if="showSelectStation" v-model="chiShowStation" style="width: 100px;" size="small" @change="switchStationMode">-->
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" /> <!--<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />-->
</el-select> <!--</el-select>-->
<el-button-group> <el-button-group>
<el-button v-if="userRole=== 'STATION_SUPERVISOR' && !$route.query.projectDevice" size="small" @click="goIbp">IBP盘</el-button> <el-button v-if="userRole=== 'STATION_SUPERVISOR' && !$route.query.projectDevice" size="small" @click="goIbp">IBP盘</el-button>
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goBigScreen">大屏</el-button> <el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goBigScreen">大屏</el-button>
@ -143,19 +143,28 @@ export default {
getByGroupStationList(this.$route.query.group).then(response => { getByGroupStationList(this.$route.query.group).then(response => {
const stations = response.data; const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanNew(this.group).then(resp => { if (this.$store.getters['runPlan/getRunPlanData']) {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data); this.$store.dispatch('runPlan/setInitialPlanData', this.$store.getters['runPlan/getRunPlanData']);
this.viewDisabled = false; this.viewDisabled = false;
this.firstLoad = false; this.firstLoad = false;
}).catch(error => { } else {
this.$store.dispatch('runPlan/setPlanData', []); getEveryDayRunPlanNew(this.group).then(resp => {
if (error.code == 30001) { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$messageBox(this.$t('error.runGraphIsNotLoaded')); this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
} else { this.$store.dispatch('runPlan/setRunPlanMap', resp.data);
!this.dataError && this.$messageBox(this.$t('error.obtainOperationGraphFailed')); this.viewDisabled = false;
} this.firstLoad = false;
}); }).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('error.runGraphIsNotLoaded'));
} else {
!this.dataError && this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
}
});
}
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.obtainStationListFailed')); this.$messageBox(this.$t('error.obtainStationListFailed'));
@ -231,7 +240,7 @@ export default {
this.$messageBox('本车站暂无IBP盘数据'); this.$messageBox('本车站暂无IBP盘数据');
} }
}).catch((error) => { }).catch((error) => {
if (error.code == '30001') { if (error.code == '10007') {
this.$messageBox('本车站暂无IBP盘数据'); this.$messageBox('本车站暂无IBP盘数据');
} else { } else {
this.$message.error('获取IBP盘数据异常'); this.$message.error('获取IBP盘数据异常');
@ -244,7 +253,7 @@ export default {
</script> </script>
<style> <style>
.schema { .schema {
z-index: 8; z-index: 18;
display: inline; display: inline;
position: absolute; position: absolute;
right: 5px; right: 5px;

View File

@ -139,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.loadInitData(); // this.loadInitData();
}, },
methods: { methods: {
formatName(code) { formatName(code) {

View File

@ -64,7 +64,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.loadInitData(); // this.loadInitData();
}, },
methods: { methods: {
formatName(code) { formatName(code) {

View File

@ -68,10 +68,12 @@ export default {
}, },
watch: { watch: {
'$store.state.runPlan.planLoadedCount': function() { '$store.state.runPlan.planLoadedCount': function() {
this.currentPlanId = this.$store.state.runPlan.planData.id; if (this.$store.state.runPlan.runPlanInfo && this.$store.state.runPlan.runPlanInfo.id) {
this.tableData.forEach(item => { this.currentPlanId = this.$store.state.runPlan.runPlanInfo.id;
item.$loading = item.id === this.currentPlanId; this.tableData.forEach(item => {
}); item.$loading = item.id === this.currentPlanId;
});
}
} }
}, },
methods: { methods: {
@ -85,7 +87,7 @@ export default {
}, },
initPageData() { initPageData() {
this.tableData = []; this.tableData = [];
this.currentPlanId = this.$store.state.runPlan.planData.id; this.currentPlanId = this.$store.state.runPlan.runPlanInfo.id;
queryRunPlanList(this.$route.query.mapId).then(resp =>{ queryRunPlanList(this.$route.query.mapId).then(resp =>{
if (resp.data && resp.data.length) { if (resp.data && resp.data.length) {
resp.data.forEach(item => { resp.data.forEach(item => {