Merge branch 'test'

# Conflicts:
#	src/views/newMap/displayNew/demonMenu.vue
This commit is contained in:
zyy 2020-11-19 18:46:23 +08:00
commit 23bbc97985
47 changed files with 1530 additions and 1196 deletions

View File

@ -29,6 +29,7 @@
"path-to-regexp": "2.4.0", "path-to-regexp": "2.4.0",
"qrcode.vue": "^1.6.2", "qrcode.vue": "^1.6.2",
"qs": "^6.9.3", "qs": "^6.9.3",
"quill-emoji": "^0.1.8",
"quill-image-extend-module": "^1.1.2", "quill-image-extend-module": "^1.1.2",
"recordrtc": "^5.5.9", "recordrtc": "^5.5.9",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",

View File

@ -243,3 +243,11 @@ export function generateAncillaryData(mapId) {
method: 'post' method: 'post'
}); });
} }
/** 查询历史客流量 */
export function getPassengerHistoryList(group) {
return request({
url: `/api/passenger/${group}/history`,
method: 'get'
});
}

View File

@ -1,9 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
// 分页查询帖子回复 // 根据postId帖子ID分页查询留言列表
export function queryPostPaging(postId, params) { export function queryMessagePagingByPostId(postId, params) {
return request({ return request({
url: `/api/learn/${postId}/message/query/paged`, url: `/api/learn/${postId}/message/pagedQuery/postId`,
method: 'get',
params: params
});
}
// 根据项目分页查询留言列表
export function queryMessagePagingByProjectCode(projectCode, params) {
return request({
url: `/api/learn/${projectCode}/message/pagedQuery/project`,
method: 'get', method: 'get',
params: params params: params
}); });
@ -67,3 +75,10 @@ export function deleteCommentBySelf(commentId) {
method: 'delete' method: 'delete'
}); });
} }
// 根据项目获取项目关联的帖子
export function getPostByProjectCode(projectCode) {
return request({
url: `/api/learn/${projectCode}/post`,
method: 'get'
});
}

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div :class="className">
<quill-editor <quill-editor
ref="editor" ref="editor"
v-model="content" v-model="content"
@ -16,8 +16,11 @@
<script> <script>
import { quillEditor, Quill } from 'vue-quill-editor'; import { quillEditor, Quill } from 'vue-quill-editor';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import QuillEmoji from 'quill-emoji';
import 'quill-emoji/dist/quill-emoji.css';
import { ImageExtend, QuillWatch} from 'quill-image-extend-module'; import { ImageExtend, QuillWatch} from 'quill-image-extend-module';
Quill.register('modules/ImageExtend', ImageExtend); Quill.register('modules/ImageExtend', ImageExtend);
Quill.register('modules/quillEmoji', QuillEmoji);
export default { export default {
components: { components: {
quillEditor quillEditor
@ -39,13 +42,17 @@ export default {
type: Number, type: Number,
default: 80 default: 80
}, },
unloadImg: {
type: Boolean,
default: false
},
noHandleP: { noHandleP: {
type: Boolean, type: Boolean,
defalut: false defalut: false
},
editorType: {
type: String,
default: 'default'
},
className: {
type: String,
default: 'commonClass'
} }
}, },
data() { data() {
@ -59,21 +66,66 @@ export default {
}, },
options() { options() {
const that = this; const that = this;
return this.unloadImg ? { let optionValue = {};
modules: { switch (this.editorType) {
ImageExtend: { case 'imgEmoji':
loading: true, optionValue = {
name: 'file', modules: {
size: 3, ImageExtend: {
action: `https://test.joylink.club/jlfile/api/upload/PICTURE?appId=00001&appSecret=joylink00001`, loading: true,
response: (res) => { name: 'file',
return `https://test.joylink.club/oss/joylink${res.data}`; size: 3,
action: `https://test.joylink.club/jlfile/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
response: (res) => {
return `https://test.joylink.club/oss/joylink${res.data}`;
},
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
sizeError: () => { that.$message.error('图片上传失败图片大小限制3MB'); } //
}, },
error: () => { that.$message.error('图片上传失败,请检查网络状态'); }, 'emoji-toolbar': true,
sizeError: () => { that.$message.error('图片上传失败图片大小限制3MB'); } // 'emoji-shortname': true,
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
[],
[],
[{'list': 'ordered'}, {'list': 'bullet'}],
[{'script': 'sub'}, {'script': 'super'}],
[{'indent': '-1'}, {'indent': '+1'}],
[{'direction': 'rtl'}],
[{'size': ['small', 'large', 'huge']}],
[{'color': [], 'background': []}],
[{'font': []}],
[{'align': []}],
['clean'],
['image', 'emoji']
],
handlers: {
'image': function () {
QuillWatch.emit(this.quill.id);
}
}
}
}, },
toolbar: { placeholder: '请输入'
container: [ };
break;
case 'onlyEmoji':
optionValue = {
modules: {
'emoji-toolbar': true,
'emoji-shortname': true,
toolbar: {
container: [['emoji']]
}
},
placeholder: this.placeholder
};
break;
case 'default':
optionValue = {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], ['bold', 'italic', 'underline', 'strike'],
[], [],
[], [],
@ -85,35 +137,13 @@ export default {
[{'color': [], 'background': []}], [{'color': [], 'background': []}],
[{'font': []}], [{'font': []}],
[{'align': []}], [{'align': []}],
['clean'], ['clean']
['image'] ]
],
handlers: {
'image': function () {
QuillWatch.emit(this.quill.id);
}
}
} }
}, };
placeholder: '请输入' break;
} : { }
modules: { return optionValue;
toolbar: [
['bold', 'italic', 'underline', 'strike'],
[],
[],
[{'list': 'ordered'}, {'list': 'bullet'}],
[{'script': 'sub'}, {'script': 'super'}],
[{'indent': '-1'}, {'indent': '+1'}],
[{'direction': 'rtl'}],
[{'size': ['small', 'large', 'huge']}],
[{'color': [], 'background': []}],
[{'font': []}],
[{'align': []}],
['clean']
]
}
};
}, },
titleConfig () { titleConfig () {
return { return {
@ -161,7 +191,7 @@ export default {
}, },
methods: { methods: {
onChange(e) { onChange(e) {
if (!this.noHandleP) { if (!this.noHandleP) {
this.$emit('input', this.$escapeHTML(this.content)); this.$emit('input', this.$escapeHTML(this.content));
} else { } else {
this.$emit('input', this.content); this.$emit('input', this.content);
@ -173,7 +203,29 @@ export default {
}, },
getFocus() { getFocus() {
this.$refs.editor.quill.focus(); this.$refs.editor.quill.focus();
},
getText() {
return this.$refs.editor.quill.getText();
},
setContents(val) {
this.$refs.editor.quill.setContents(val);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped>
.answer_input{
/deep/ .ql-toolbar.ql-snow{
padding: 0;
border: 0;
border-top: 1px solid #c0c0c0;
height: 0;
text-align: left;
.ql-emoji{
position: relative;
left: -30px;
}
}
}
</style>

View File

@ -143,7 +143,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
scene.add(controls3.getObject()); scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50); let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
cameracctv.position.set( -3, 0,1.5 ); cameracctv.position.set( -3, 0,4.5 );
cameracctv.rotation.y = -Math.PI/2; cameracctv.rotation.y = -Math.PI/2;
cameracctv.rotation.x = Math.PI/2; cameracctv.rotation.x = Math.PI/2;
@ -220,7 +220,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
if (drivingcode) { if (drivingcode) {
controls3.getObject().position.x = trainlisttest.list[drivingcode].matrixWorld.elements[12]-27; controls3.getObject().position.x = trainlisttest.list[drivingcode].matrixWorld.elements[12]-27;
controls3.getObject().position.y=5; controls3.getObject().position.y=5;
controls3.getObject().position.z = trainlisttest.list[drivingcode].children[0].matrixWorld.elements[14]; controls3.getObject().position.z = trainlisttest.list[drivingcode].children[0].matrixWorld.elements[14]+5;
} }
} }
@ -274,7 +274,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
trainlisttest.group.children[0].children[0].add(controls3.getObject()); trainlisttest.group.children[0].children[0].add(controls3.getObject());
controls3.getObject().position.x = 10; controls3.getObject().position.x = 10;
controls3.getObject().position.y = 0; controls3.getObject().position.y = 0;
controls3.getObject().position.z = 1.5; controls3.getObject().position.z = 4.5;
controls3.getObject().rotation.x = Math.PI/2; controls3.getObject().rotation.x = Math.PI/2;
controls3.getObject().rotation.y = -Math.PI/2; controls3.getObject().rotation.y = -Math.PI/2;
}; };
@ -284,7 +284,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
trainlisttest.group.children[0].children[0].add(controls3.getObject()); trainlisttest.group.children[0].children[0].add(controls3.getObject());
controls3.getObject().position.x = 10; controls3.getObject().position.x = 10;
controls3.getObject().position.y = 0; controls3.getObject().position.y = 0;
controls3.getObject().position.z = 1.5; controls3.getObject().position.z = 4.5;
controls3.getObject().rotation.x = Math.PI/2; controls3.getObject().rotation.x = Math.PI/2;
controls3.getObject().rotation.y = -Math.PI/2; controls3.getObject().rotation.y = -Math.PI/2;
}; };
@ -385,7 +385,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
rails = loadrails; rails = loadrails;
console.log(trainlisttest.group.children[0]); console.log(trainlisttest.group.children[0]);
trainlisttest.group.children[0].getObjectByName("c3").add(cameracctv); trainlisttest.group.children[0].getObjectByName("C3").add(cameracctv);
} }
this.eventon = function() { this.eventon = function() {

View File

@ -165,7 +165,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].children[0].position.z = parseFloat(-point.z); trainlisttest.list[code].children[0].position.z = parseFloat(-point.z);
for (let tl=1; tl<6; tl++) { for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
trainlisttest.list[code].children[tl].rotalist = []; trainlisttest.list[code].children[tl].rotalist = [];
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z; trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
} }
@ -205,7 +205,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].position.x = point.x; trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].children[0].rotalist = []; trainlisttest.list[code].children[0].rotalist = [];
trainlisttest.list[code].children[0].position.z = parseFloat(point.z); trainlisttest.list[code].children[0].position.z = parseFloat(point.z);
for (let tl=1; tl<6; tl++) { for (let tl=1; tl<trainlisttest.list[code].children.length; tl++) {
trainlisttest.list[code].children[tl].rotalist = []; trainlisttest.list[code].children[tl].rotalist = [];
trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z; trainlisttest.list[code].children[tl].position.z = trainlisttest.list[code].children[0].position.z;
} }
@ -253,7 +253,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].position.x = point.x; trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
// for (let tl=0; tl<6; tl++) { // for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z); // trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
// } // }
@ -293,8 +293,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y); let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
trainlisttest.list[code].children[0].position.y += offsety; trainlisttest.list[code].children[0].position.y += offsety;
} }
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){ // if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){ for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
//console.log(rs); //console.log(rs);
if(trainlisttest.list[code].children[rs].rotalist[0]){ if(trainlisttest.list[code].children[rs].rotalist[0]){
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]); let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
@ -309,7 +309,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]); // console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x); // console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
// } // }
if(rs != 5){ if(rs != (trainlisttest.list[code].children.length-1)){
let asd = trainlisttest.list[code].children[rs].rotalist[0]; let asd = trainlisttest.list[code].children[rs].rotalist[0];
trainlisttest.list[code].children[rs+1].rotalist.push(asd); trainlisttest.list[code].children[rs+1].rotalist.push(asd);
@ -326,7 +326,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
//console.log(trainlisttest.list[code].children[rs].rotalist.length); //console.log(trainlisttest.list[code].children[rs].rotalist.length);
} }
} }
} // }
@ -344,7 +344,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].position.x = point.x; trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
// for (let tl=0; tl<6; tl++) { // for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z); // trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
// } // }
@ -384,9 +384,9 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
// trainlisttest.list[code].position.z = point.z; // trainlisttest.list[code].position.z = point.z;
} }
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){ // if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){ for(let rs = 1;rs<trainlisttest.list[code].children.length;rs++){
//console.log(rs); //console.log(rs);
if(trainlisttest.list[code].children[rs].rotalist[0]){ if(trainlisttest.list[code].children[rs].rotalist[0]){
@ -398,7 +398,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){ for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){ if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
if(rs != 5){ if(rs != (trainlisttest.list[code].children.length-1)){
let asd = trainlisttest.list[code].children[rs].rotalist[0]; let asd = trainlisttest.list[code].children[rs].rotalist[0];
trainlisttest.list[code].children[rs+1].rotalist.push(asd); trainlisttest.list[code].children[rs+1].rotalist.push(asd);
} }
@ -418,7 +418,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
// console.log(trainlisttest.list[code].rotalist); // console.log(trainlisttest.list[code].rotalist);
} // }
} }
@ -440,7 +440,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].rotation.y = 0; trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].position.x = point.x; trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) { for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
trainlisttest.list[code].children[tl].position.z = parseFloat(point.z); trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
} }
@ -467,7 +467,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].position.x = point.x; trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) { for (let tl=0; tl<trainlisttest.list[code].children.length; tl++) {
trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z); trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
} }
@ -765,6 +765,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
function standupdate(data) { function standupdate(data) {
code = data.code; code = data.code;
if ( actions[code]) { if ( actions[code]) {
if (data.open == '1') { if (data.open == '1') {
actions[code].status = '1'; actions[code].status = '1';

View File

@ -71,11 +71,9 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
open:0, open:0,
text:"", text:"",
}; };
if(data.body[i].num == "0"){
train.text = data.body[i].code+"(无人)"; train.text = data.body[i].code+"(现有乘客"+data.body[i].num+"人)";
}else{
train.text = data.body[i].code+"(现有乘客"+data.body[i].num+"人)";
}
trafficTrain.trainList[train.code] = train; trafficTrain.trainList[train.code] = train;
} }
} }

View File

@ -41,7 +41,7 @@ var Staticmodel = [
name: "列车", name: "列车",
deviceType: "cctvTrain", deviceType: "cctvTrain",
type: "cctvTrain", type: "cctvTrain",
url: "/cbtc/static/trafficplan/train.FBX" url: "/cbtc/static/trafficplan/normaltrain.FBX"
},{ },{
id: "8", id: "8",
name: "区段", name: "区段",

View File

@ -239,7 +239,7 @@ export function AssetLoader(){
let modeldata = JSON.parse(data); let modeldata = JSON.parse(data);
console.log(modeldata);
for(let j=0;j<modeldata.assets.length;j++){ for(let j=0;j<modeldata.assets.length;j++){
let had = false; let had = false;
for(let i=0;i<scope.modellist.length;i++){ for(let i=0;i<scope.modellist.length;i++){
@ -265,10 +265,12 @@ export function AssetLoader(){
this.assetPromiseOver = function (scene){ this.assetPromiseOver = function (scene){
let initlist = []; let initlist = [];
for(let i=0;i<scope.modellist.length;i++){ for(let i=0;i<scope.modellist.length;i++){
initlist.push(fbxPromiseOver(scope.modellist[i])); initlist.push(fbxPromiseOver(scope.modellist[i]));
} }
return new Promise(function(resolve, reject){ return new Promise(function(resolve, reject){
@ -329,7 +331,6 @@ export function AssetLoader(){
let autoswitchs = new AssetModel(autoswitch); let autoswitchs = new AssetModel(autoswitch);
scope.modellist.push(autoswitchs); scope.modellist.push(autoswitchs);
console.log(signal);
fbxpromise(signal) fbxpromise(signal)
.then(function(data){ .then(function(data){
////console.log(data); ////console.log(data);
@ -587,11 +588,12 @@ export function AssetLoader(){
//object.traverse(function (node) {//获取其中对象 //object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true; // node.frustumCulled = true;
//}); //});
if(asset.deviceType == "train"){ if(asset.deviceType == "train"){
let realtrain = new THREE.Group(); let realtrain = new THREE.Group();
for(let j=6;j>0;j--){ for(let j=6;j>0;j--){
let name = "c"+j; let name = "C"+j;
for(let i=0;i<object.children.length;i++){ for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){ if(object.children[i].name == name){
@ -664,11 +666,12 @@ export function AssetLoader(){
//object.traverse(function (node) {//获取其中对象 //object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true; // node.frustumCulled = true;
//}); //});
if(asset.type == "train"){ if(asset.type == "train"){
console.log(scope.trainoffset);
let realtrain = new THREE.Group(); let realtrain = new THREE.Group();
for(let j=6;j>0;j--){ let j = object.children.length;
let name = "c"+j; for(j;j>0;j--){
let name = "C"+j;
for(let i=0;i<object.children.length;i++){ for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){ if(object.children[i].name == name){

View File

@ -172,42 +172,41 @@ export function StationStandListN() {
} }
} ); } );
selectmesh3.traverse( function ( child ) { // selectmesh3.traverse( function ( child ) {
if ( child.isMesh ) {
child.renderOrder = 9;
}
} );
//新车门动画获取待定
// let allClear = 0;
// for(let j=0;j<standsdata.length;j++){
// //
// allClear = 0; // if ( child.isMesh ) {
// for(let i=0;i<psddata.length;i++){ // child.renderOrder = 9;
//
// for(let n=0;n<standsdata[j].stands.length;n++){
// if(psddata[i].standCode == standsdata[j].stands[n].code){
// allClear++;
// standsdata[j].stands[n].position = psddata[i].position;
// }
// }
//
// if(allClear == standsdata[j].stands.length){
// standsdata[j].stands.sort(compare);
// i = psddata.length;
// }
// } // }
// } //
// } );
//新车门动画获取待定
let allClear = 0;
for(let j=0;j<standsdata.length;j++){
allClear = 0;
for(let i=0;i<psddata.length;i++){
for(let n=0;n<standsdata[j].stands.length;n++){
if(psddata[i].standCode == standsdata[j].stands[n].code){
allClear++;
standsdata[j].stands[n].position = psddata[i].position;
}
}
if(allClear == standsdata[j].stands.length){
standsdata[j].stands.sort(compare);
i = psddata.length;
}
}
}
// //
// //
// console.log(standsdata); // console.log(standsdata);
// console.log(psddata); // console.log(psddata);
for(let i=0;i<standsdata.length;i++){ for(let i=0;i<standsdata.length;i++){
let newstationstand = new StationStandModel(standsdata[i]); let newstationstand = new StationStandModel(standsdata[i]);
// console.log(standsdata[i]);
if(standsdata[i].code != "Station96090"){
console.log("3");
newstationstand.code = standsdata[i].code; newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name; newstationstand.name = standsdata[i].name;
newstationstand.type = "station"; newstationstand.type = "station";
@ -221,12 +220,22 @@ export function StationStandListN() {
// newstationstand.direction2.name = standsdata[i].direction2.name; // newstationstand.direction2.name = standsdata[i].direction2.name;
// newstationstand.direction2.screenDoorOpenStatus = "01"; // newstationstand.direction2.screenDoorOpenStatus = "01";
let newstationmesh = null; let newstationmesh = null;
if(standsdata[i].inside == undefined){ let newclip =null;
newstationmesh = selectmesh1.clone(true);
}else if(standsdata[i].inside == true){ if(standsdata[i].stands.length<=2){
newstationmesh = selectmesh1.clone(true); if(standsdata[i].inside == undefined){
newstationmesh = selectmesh1.clone(true);
newclip = selectmesh1.animations[ 0 ];
}else if(standsdata[i].inside == true){
newstationmesh = selectmesh1.clone(true);
newclip = selectmesh1.animations[ 0 ];
}else{
newstationmesh = selectmesh2.clone(true);
newclip = selectmesh2.animations[ 0 ];
}
}else{ }else{
newstationmesh = selectmesh2.clone(true); newstationmesh = selectmesh3.clone(true);
newclip = selectmesh3.animations[ 0 ];
} }
newstationmesh.code = standsdata[i].code; newstationmesh.code = standsdata[i].code;
@ -244,71 +253,93 @@ export function StationStandListN() {
// //
scope.list[standsdata[i].code] = newstationstand; scope.list[standsdata[i].code] = newstationstand;
// //
let newclip =null; for(let j=0;j<standsdata[i].stands.length;j++){
if(standsdata[i].inside == true){ let num = j+1;
newclip = selectmesh1.animations[ 0 ];
}else{
newclip = selectmesh2.animations[ 0 ];
}
for(let j=0;j<newstationmesh.children.length;j++){ let addAnimaMesh = newstationmesh.getObjectByName('door'+num);
if(newstationmesh.children[j].name == "top"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
if(addAnimaMesh){
newstationmesh.getObjectByName('door'+num).animations = [];
newstationmesh.getObjectByName('door'+num).animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.getObjectByName('door'+num) );
for(let n=0;n<psddata.length;n++){ for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){ if(psddata[n].standCode == standsdata[i].stands[j].code){
let key = psddata[n].code;
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){ actionss[key] = {
status:"01",
let key = psddata[n].code; action:mixer.clipAction( newstationmesh.getObjectByName('door'+num).animations[0])
actionss[key] = { };
status:"01", actionss[key].action.setLoop(THREE.LoopOnce);
action:mixer.clipAction( newstationmesh.children[j].animations[0]) actionss[key].action.clampWhenFinished = true;
}; //actionss[key].play();
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
}
}
if(newstationmesh.children[j].name == "down"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
n = psddata.length;
} }
} }
mixers.push(mixer);
} }
} }
// for(let j=0;j<newstationmesh.children.length;j++){
//
// if(newstationmesh.children[j].name == "top"){
// newstationmesh.children[j].animations = [];
// newstationmesh.children[j].animations.push(newclip.clone());
//
// let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
//
//
// for(let n=0;n<psddata.length;n++){
// for(let m=0;m<newstationstand.stands.length;m++){
//
// if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){
//
// let key = psddata[n].code;
// actionss[key] = {
// status:"01",
// action:mixer.clipAction( newstationmesh.children[j].animations[0])
// };
// actionss[key].action.setLoop(THREE.LoopOnce);
// actionss[key].action.clampWhenFinished = true;
// //actionss[key].play();
// mixers.push(mixer);
// n = psddata.length;
// m = newstationstand.stands.length;
// }
// }
//
//
// }
//
// }
// if(newstationmesh.children[j].name == "down"){
// newstationmesh.children[j].animations = [];
// newstationmesh.children[j].animations.push(newclip.clone());
//
// let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
// for(let n=0;n<psddata.length;n++){
// for(let m=0;m<newstationstand.stands.length;m++){
//
// if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
// let key = psddata[n].code;
// actionss[key] = {
// status:"01",
// action:mixer.clipAction( newstationmesh.children[j].animations[0])
// };
// actionss[key].action.setLoop(THREE.LoopOnce);
// actionss[key].action.clampWhenFinished = true;
// //actionss[key].play();
// mixers.push(mixer);
// n = psddata.length;
// m = newstationstand.stands.length;
// }
//
// }
// }
// }
// }
if(mode){ if(mode){
if(mode == "02"){ if(mode == "02"){
@ -328,116 +359,7 @@ export function StationStandListN() {
textt.dispose(); textt.dispose();
} }
} }
}else{
newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name;
newstationstand.type = "station";
newstationstand.num = i;
newstationstand.stand = [];
// newstationstand.direction1.code = standsdata[i].direction1.code;
// newstationstand.direction1.name = standsdata[i].direction1.name;
// newstationstand.direction1.screenDoorOpenStatus = "01";
//
// newstationstand.direction2.code = standsdata[i].direction2.code;
// newstationstand.direction2.name = standsdata[i].direction2.name;
// newstationstand.direction2.screenDoorOpenStatus = "01";
let newstationmesh = null;
newstationmesh = selectmesh3.clone(true);
newstationmesh.code = standsdata[i].code;
newstationmesh.name = standsdata[i].code;
newstationmesh.position.x = standsdata[i].position.x;
newstationmesh.position.y = standsdata[i].position.y;
newstationmesh.position.z = standsdata[i].position.z;
// newstationmesh.rotation.x = standsdata[i].rotation._x;
// newstationmesh.rotation.y = standsdata[i].rotation._y;
// newstationmesh.rotation.z = standsdata[i].rotation._z;
newstationstand.mesh = newstationmesh;
scope.group.add(newstationmesh);
//
scope.list[standsdata[i].code] = newstationstand;
//
let newclip =null;
newclip = selectmesh3.animations[ 0 ];
for(let j=0;j<newstationmesh.children.length;j++){
if(newstationmesh.children[j].name == "top"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
}
}
if(newstationmesh.children[j].name == "down"){
newstationmesh.children[j].animations = [];
newstationmesh.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
for(let n=0;n<psddata.length;n++){
for(let m=0;m<newstationstand.stands.length;m++){
console.log("====================");
console.log(newstationstand.stands[m]);
console.log(psddata[n]);
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
let key = psddata[n].code;
actionss[key] = {
status:"01",
action:mixer.clipAction( newstationmesh.children[j].animations[0])
};
actionss[key].action.setLoop(THREE.LoopOnce);
actionss[key].action.clampWhenFinished = true;
//actionss[key].play();
mixers.push(mixer);
n = psddata.length;
m = newstationstand.stands.length;
}
}
}
}
}
if(mode){
if(mode == "02"){
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(standsdata[i]));
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
let textplane = new THREE.Mesh( textgeometry, textmaterial );
textplane.name = standsdata[i].code;
textplane.position.y = 70;
textplane.rotation.x = Math.PI/2;
textplane.position.z = 50;
scope.textlist.push(textplane);
newstationmesh.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
}
} }
// scene.add(scope.textlist); // scene.add(scope.textlist);

View File

@ -77,13 +77,13 @@ export function TrainListN() {
// //
// fclip = new THREE.AnimationClip("four",2,ntracks2); // fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks2 = assetloader.modellist[n].animations.slice(6,14); // ntracks2 = assetloader.modellist[n].animations.slice(6,14);
//
// fclip = new THREE.AnimationClip("four",2,ntracks2);
//
// ntracks1 = assetloader.modellist[n].animations.slice(0,6);
fclip = new THREE.AnimationClip("four",2,ntracks2); tclip = new THREE.AnimationClip("three",2,assetloader.modellist[n].animations);
ntracks1 = assetloader.modellist[n].animations.slice(0,6);
tclip = new THREE.AnimationClip("three",2,ntracks1);
n = 0; n = 0;
} }
@ -97,8 +97,6 @@ export function TrainListN() {
newmesh.mixer = []; newmesh.mixer = [];
for(let j=0;j<newmesh.children.length;j++){ for(let j=0;j<newmesh.children.length;j++){
if(newmesh.children[j].name == "c1" || newmesh.children[j].name == "c6"){
// console.log("==================="); // console.log("===================");
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){ for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
@ -135,37 +133,7 @@ export function TrainListN() {
mixers.push(mixer); mixers.push(mixer);
} }
} }
}else{
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
if(newmesh.children[j].children[n].name == "top"){
newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer);
newmesh.mixerpush = false;
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play();
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
actionss["traindoor"].top.push(action);
mixers.push(mixer);
}
if(newmesh.children[j].children[n].name == "down"){
newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer);
newmesh.mixerpush = false;
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play();
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
actionss["traindoor"].down.push(action);
mixers.push(mixer);
}
}
}
newmesh.children[j].axis = new THREE.Vector3(); newmesh.children[j].axis = new THREE.Vector3();
newmesh.children[j].up = new THREE.Vector3(1, 0, 0); newmesh.children[j].up = new THREE.Vector3(1, 0, 0);
@ -208,8 +176,7 @@ export function TrainListN() {
for(let n=assetloader.modellist.length-1;n>=0;n--){ for(let n=assetloader.modellist.length-1;n>=0;n--){
if(assetloader.modellist[n].type == "train"){ if(assetloader.modellist[n].type == "train"){
selectmesh = assetloader.modellist[n].mesh selectmesh = assetloader.modellist[n].mesh;
// ntracks1 = assetloader.modellist[n].animations.slice(16,27); // ntracks1 = assetloader.modellist[n].animations.slice(16,27);
// //
// tclip = new THREE.AnimationClip("three",2,ntracks1); // tclip = new THREE.AnimationClip("three",2,ntracks1);
@ -218,13 +185,12 @@ export function TrainListN() {
// //
// fclip = new THREE.AnimationClip("four",2,ntracks2); // fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks2 = assetloader.modellist[n].animations.slice(6,14); // ntracks2 = assetloader.modellist[n].animations.slice(6,14);
//
fclip = new THREE.AnimationClip("four",2,ntracks2); // fclip = new THREE.AnimationClip("four",2,ntracks2);
//
ntracks1 = assetloader.modellist[n].animations.slice(0,6); // ntracks1 = assetloader.modellist[n].animations.slice(0,6);
tclip = new THREE.AnimationClip("three",2,assetloader.modellist[n].animations);
tclip = new THREE.AnimationClip("three",2,ntracks1);
n = 0; n = 0;
} }
} }
@ -252,7 +218,6 @@ export function TrainListN() {
// console.log(data[i]); // console.log(data[i]);
for(let j=0;j<newmesh.children.length;j++){ for(let j=0;j<newmesh.children.length;j++){
if(newmesh.children[j].name == "c1" || newmesh.children[j].name == "c6"){
// console.log("==================="); // console.log("===================");
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){ for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
@ -288,37 +253,7 @@ export function TrainListN() {
actionss[data[i].groupNumber].down.push(action); actionss[data[i].groupNumber].down.push(action);
} }
} }
}else{
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
if(newmesh.children[j].children[n].name == "top"){
newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer);
newmesh.mixerpush = false;
// mixers.push(mixer);
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play();
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
actionss[data[i].groupNumber].top.push(action);
}
if(newmesh.children[j].children[n].name == "down"){
newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer);
newmesh.mixerpush = false;
// mixers.push(mixer);
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play();
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
actionss[data[i].groupNumber].down.push(action);
}
}
}
//newmesh.children[j].name = data[i].code; //newmesh.children[j].name = data[i].code;
newmesh.children[j].groupNumber = data[i].groupNumber; newmesh.children[j].groupNumber = data[i].groupNumber;
newmesh.children[j].axis = new THREE.Vector3(); newmesh.children[j].axis = new THREE.Vector3();
@ -331,6 +266,7 @@ export function TrainListN() {
newmesh.children[j].rotalist = []; newmesh.children[j].rotalist = [];
// console.log(newmesh); // console.log(newmesh);
} }
// //
// // newmesh.children[4].add(newmesh.children[5]); // // newmesh.children[4].add(newmesh.children[5]);
// // newmesh.children[3].add(newmesh.children[4]); // // newmesh.children[3].add(newmesh.children[4]);

View File

@ -2,11 +2,11 @@ import { createSeriesModel, createMarkLineModels, createRectArea, createMartPoin
import { toTimeStamp } from '@/utils/date'; import { toTimeStamp } from '@/utils/date';
export default { export default {
/** 最小时间*/ /** 最小时间*/
MinTime: 0, MinTime: 0,
/** 最大时间*/ /** 最大时间*/
MaxTime: 3600*24-1, MaxTime: 3600 * 24 - 1,
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600,
@ -15,143 +15,143 @@ export default {
CoordMultiple: 1, CoordMultiple: 1,
/** 偏移时间*/ /** 偏移时间*/
TranslationTime: 0, TranslationTime: 0,
/** 转换model为Rect数据*/ /** 转换model为Rect数据*/
calcAreaArgsByModel(chart, model) { calcAreaArgsByModel(chart, model) {
const fartherKmRange = model.fartherKmRange; const fartherKmRange = model.fartherKmRange;
const closerKmRange = model.closerKmRange; const closerKmRange = model.closerKmRange;
const startTime = model.startTime; const startTime = model.startTime;
const endTime = model.endTime; const endTime = model.endTime;
const point1 = [ startTime, this.getCoordinateYByKmRange(fartherKmRange)]; const point1 = [startTime, this.getCoordinateYByKmRange(fartherKmRange)];
const point2 = [ endTime, this.getCoordinateYByKmRange(closerKmRange)] const point2 = [endTime, this.getCoordinateYByKmRange(closerKmRange)];
const position1 = chart.convertToPixel('grid', point1); const position1 = chart.convertToPixel('grid', point1);
const position2 = chart.convertToPixel('grid', point2); const position2 = chart.convertToPixel('grid', point2);
const position = position1; const position = position1;
const width = Math.abs(position1[0] - position2[0]); const width = Math.abs(position1[0] - position2[0]);
const height = Math.abs(position1[1] - position2[1]); const height = Math.abs(position1[1] - position2[1]);
return { return {
model, model,
position, position,
point1, point1,
point2, point2,
width, width,
height height
} };
}, },
/** 将后台数据解析成图形*/ /** 将后台数据解析成图形*/
parseDataToGraph(chart, planData) { parseDataToGraph(chart, planData) {
const graphs = []; const graphs = [];
if (planData && if (planData &&
planData.areaList && planData.areaList &&
planData.areaList.length) { planData.areaList.length) {
planData.areaList.forEach(model => { planData.areaList.forEach(model => {
if (typeof model.startTime == 'string') model.startTime = toTimeStamp(model.startTime); if (typeof model.startTime == 'string') model.startTime = toTimeStamp(model.startTime);
if (typeof model.endTime == 'string') model.endTime = toTimeStamp(model.endTime); if (typeof model.endTime == 'string') model.endTime = toTimeStamp(model.endTime);
graphs.push(createRectArea(this.calcAreaArgsByModel(chart, model))); graphs.push(createRectArea(this.calcAreaArgsByModel(chart, model)));
}) });
} }
return graphs; return graphs;
}, },
/** 将后台数据解析成折线*/ /** 将后台数据解析成折线*/
parseDataToSeries(chart, planData, stations) { parseDataToSeries(chart, planData, stations) {
const models = []; const models = [];
if (planData && if (planData &&
planData.serviceList && planData.serviceList &&
planData.serviceList.length) { planData.serviceList.length) {
planData.serviceList.forEach((service,i) => { planData.serviceList.forEach((service, i) => {
if (service.tripList && if (service.tripList &&
service.tripList.length) { service.tripList.length) {
const opt = { const opt = {
name: `service${service.serviceNo}`, name: `service${service.serviceNo}`,
type: 'line', type: 'line',
symbolSize: 1, symbolSize: 1,
showAllSymbol: true, showAllSymbol: true,
markPoint: { data: [] }, markPoint: { data: [] },
data: [] data: []
}; };
service.tripList.forEach((trip,j) => { service.tripList.forEach((trip, j) => {
var lastPoint = null; var lastPoint = null;
var nextPoint = null; var nextPoint = null;
var pointData = { var pointData = {
name: `${service.serviceNo}-${trip.tripNo}`, name: `${service.serviceNo}-${trip.tripNo}`,
color: '#000', color: '#000',
direction: trip.direction, direction: trip.direction,
coord: [trip.stationTimeList[0].departureTime, this.getCoordinateYByStationId(stations, trip.stationTimeList[0].stationId)], coord: [trip.stationTimeList[0].departureTime, this.getCoordinateYByStationId(stations, trip.stationTimeList[0].stationId)]
}; };
opt.markPoint.data.push(createMartPoint(pointData)); opt.markPoint.data.push(createMartPoint(pointData));
trip.stationTimeList.forEach(elem => { trip.stationTimeList.forEach(elem => {
if (elem.arrivalTime) { if (elem.arrivalTime) {
opt.data.push([elem.arrivalTime, this.getCoordinateYByStationId(stations, elem.stationId), { opt.data.push([elem.arrivalTime, this.getCoordinateYByStationId(stations, elem.stationId), {
stationId: elem.stationId, stationId: elem.stationId,
serviceNo: service.serviceNo, serviceNo: service.serviceNo,
tripNo: trip.tripNo, tripNo: trip.tripNo,
direction: trip.direction, direction: trip.direction,
silent: false silent: false
}]); }]);
} }
if (elem.departureTime) { if (elem.departureTime) {
opt.data.push([elem.departureTime, this.getCoordinateYByStationId(stations, elem.stationId), { opt.data.push([elem.departureTime, this.getCoordinateYByStationId(stations, elem.stationId), {
stationId: elem.stationId, stationId: elem.stationId,
serviceNo: service.serviceNo, serviceNo: service.serviceNo,
tripNo: trip.tripNo, tripNo: trip.tripNo,
direction: trip.direction, direction: trip.direction,
silent: false silent: false
}]); }]);
} }
}); });
if (service.tripList[j + 1] && if (service.tripList[j + 1] &&
service.tripList[j + 1].stationTimeList) { service.tripList[j + 1].stationTimeList) {
lastPoint = trip.stationTimeList[trip.stationTimeList.length-1]; lastPoint = trip.stationTimeList[trip.stationTimeList.length - 1];
nextPoint = service.tripList[j + 1].stationTimeList[0]; nextPoint = service.tripList[j + 1].stationTimeList[0];
opt.data.push({ opt.data.push({
value: [lastPoint.arrivalTime, this.getCoordinateYByStationId(stations, lastPoint.stationId, true, trip.direction), { value: [lastPoint.arrivalTime, this.getCoordinateYByStationId(stations, lastPoint.stationId, true, trip.direction), {
stationId: lastPoint.stationId, stationId: lastPoint.stationId,
serviceNo: service.serviceNo, serviceNo: service.serviceNo,
tripNo: trip.tripNo, tripNo: trip.tripNo,
direction: trip.direction, direction: trip.direction,
silent: true silent: true
}], }],
symbol: 'none', symbol: 'none',
symbolSize: 1, symbolSize: 1
}); });
opt.data.push({ opt.data.push({
value: [nextPoint.departureTime, this.getCoordinateYByStationId(stations, lastPoint.stationId, true, trip.direction), { value: [nextPoint.departureTime, this.getCoordinateYByStationId(stations, lastPoint.stationId, true, trip.direction), {
stationId: lastPoint.stationId, stationId: lastPoint.stationId,
serviceNo: service.serviceNo, serviceNo: service.serviceNo,
tripNo: trip.tripNo, tripNo: trip.tripNo,
direction: trip.direction, direction: trip.direction,
silent: true silent: true
}], }],
symbol: 'none', symbol: 'none',
symbolSize: 1, symbolSize: 1
}); });
} }
}); });
const model = createSeriesModel(opt, const model = createSeriesModel(opt,
{ color: '#000', width: 1 }, { color: '#000', width: 1 },
{ color: '#000', fill: '#000'} { color: '#000', fill: '#000'}
); );
models.push(model); models.push(model);
} }
}) });
} }
return models; return models;
}, },
/** 更新数据并解析成折线*/ /** 更新数据并解析成折线*/
updateDataToModels(chart, planData, stations, series) { updateDataToModels(chart, planData, stations, series) {
@ -188,98 +188,98 @@ export default {
}); });
return yText; return yText;
}, },
/** 根据方向计算y折返偏移量*/ /** 根据方向计算y折返偏移量*/
getOffsetY(isSpecial, direction) { getOffsetY(isSpecial, direction) {
if (isSpecial) { if (isSpecial) {
if (direction === '1') { if (direction === '1') {
return -this.EdgeHeight / 2; return -this.EdgeHeight / 2;
} else if (direction === '2') { } else if (direction === '2') {
return +this.EdgeHeight / 2; return +this.EdgeHeight / 2;
} }
} }
return 0; return 0;
}, },
/** 通过y坐标获取车站公里表*/ /** 通过y坐标获取车站公里表*/
getKmRangeByCoordinateY(y) { getKmRangeByCoordinateY(y) {
return parseInt(y/this.CoordMultiple); return parseInt(y / this.CoordMultiple);
}, },
/** 通过公里表获取坐标值*/ /** 通过公里表获取坐标值*/
getCoordinateYByKmRange(k) { getCoordinateYByKmRange(k) {
return k * this.CoordMultiple return k * this.CoordMultiple;
}, },
/** 通过站信息获取y坐标*/ /** 通过站信息获取y坐标*/
getCoordinateYByStationId(stations, stationId, isSpecial=false, direction='01') { getCoordinateYByStationId(stations, stationId, isSpecial = false, direction = '01') {
var value = 0; var value = 0;
var station = stations.find(it => { return it.id == stationId; }); var station = stations.find(it => { return it.id == stationId; });
if (station) { if (station) {
value = this.getCoordinateYByKmRange(station.kmRange) + this.getOffsetY(isSpecial, direction); value = this.getCoordinateYByKmRange(station.kmRange) + this.getOffsetY(isSpecial, direction);
} }
return value; return value;
}, },
/** 通过y坐标获取站信息 */ /** 通过y坐标获取站信息 */
getStationByCoordinateY(stations, y) { getStationByCoordinateY(stations, y) {
for(var i = stations.length-1; i >= 0; i--) { for (var i = stations.length - 1; i >= 0; i--) {
const station = stations[i]; const station = stations[i];
const edge = this.EdgeHeight/2; const edge = this.EdgeHeight / 2;
const preKm = i == 0? edge*2: Math.abs(station.kmRange-stations[i-1].kmRange)/2; const preKm = i == 0 ? edge * 2 : Math.abs(station.kmRange - stations[i - 1].kmRange) / 2;
const nxtKm = i == stations.length-1? edge: Math.abs(station.kmRange-stations[i+1].kmRange)/2; const nxtKm = i == stations.length - 1 ? edge : Math.abs(station.kmRange - stations[i + 1].kmRange) / 2;
const min = edge + station.kmRange - preKm; const min = edge + station.kmRange - preKm;
const max = edge + station.kmRange + nxtKm; const max = edge + station.kmRange + nxtKm;
if (y >= min && y <= max) { if (y >= min && y <= max) {
return station; return station;
} }
} }
return null; return null;
}, },
/**限制区域范围 */ /** 限制区域范围 */
limitAreaTime(model) { limitAreaTime(model) {
if (model) { if (model) {
model.startTime = model.startTime < this.MinTime model.startTime = model.startTime < this.MinTime
? this.MinTime ? this.MinTime
: model.startTime > this.MaxTime : model.startTime > this.MaxTime
? this.MaxTime ? this.MaxTime
: model.startTime; : model.startTime;
model.endTime = model.endTime < this.MinTime model.endTime = model.endTime < this.MinTime
? this.MinTime ? this.MinTime
: model.endTime > this.MaxTime : model.endTime > this.MaxTime
? this.MaxTime ? this.MaxTime
: model.endTime; : model.endTime;
} }
return model; return model;
}, },
/** 检查公里表是否超出范围*/ /** 检查公里表是否超出范围*/
limitAreaKmRange(stations, model) { limitAreaKmRange(stations, model) {
const closerKmRange = model.closerKmRange; const closerKmRange = model.closerKmRange;
const fartherKmRange = model.fartherKmRange; const fartherKmRange = model.fartherKmRange;
const length = stations.length; const length = stations.length;
const first = stations[0]||{}; const first = stations[0] || {};
const last = stations[length-1]||{}; const last = stations[length - 1] || {};
const minRange = first.kmRange-this.EdgeHeight; const minRange = first.kmRange - this.EdgeHeight;
const maxRange = last.kmRange; const maxRange = last.kmRange;
const tolerant = 0; const tolerant = 0;
if (closerKmRange < minRange - tolerant) { if (closerKmRange < minRange - tolerant) {
const offset = closerKmRange - minRange; const offset = closerKmRange - minRange;
model.closerKmRange = minRange; model.closerKmRange = minRange;
model.fartherKmRange -= offset; model.fartherKmRange -= offset;
return true; return true;
} else if (fartherKmRange > maxRange + tolerant) { } else if (fartherKmRange > maxRange + tolerant) {
const offset = fartherKmRange - maxRange; const offset = fartherKmRange - maxRange;
model.fartherKmRange = maxRange; model.fartherKmRange = maxRange;
model.closerKmRange -= offset; model.closerKmRange -= offset;
return true; return true;
} }
return false; return false;
} }
}; };

View File

@ -261,12 +261,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -261,12 +261,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -236,12 +236,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -246,6 +246,10 @@ export default {
return series; return series;
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 初始化Y轴*/ /** 初始化Y轴*/
initializeYaxis(stations) { initializeYaxis(stations) {
return createMarkLineModels(stations, (elem) => { return createMarkLineModels(stations, (elem) => {
@ -257,8 +261,8 @@ export default {
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -2,10 +2,10 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, pre
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 3, EdgeHeight: 180,
/** 间隔高度*/ /** 间隔高度*/
CoordMultiple: 3, CoordMultiple: 180,
/** 偏移时间*/ /** 偏移时间*/
TranslationTime: 60 * 60 * 2, TranslationTime: 60 * 60 * 2,
@ -430,17 +430,6 @@ export default {
return series; return series;
}, },
/** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) {
var map = {};
if (stations && stations.length) {
stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
});
}
return map;
},
/** 初始化Y轴*/ /** 初始化Y轴*/
initializeYaxis(stations) { initializeYaxis(stations) {
return createMarkLineModels(stations, (elem, index) => { return createMarkLineModels(stations, (elem, index) => {
@ -448,6 +437,22 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + index * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) {
var map = {};
if (stations && stations.length) {
stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
});
}
return map;
},
/** 计算y轴最小值*/ /** 计算y轴最小值*/
computedYaxisMinValue() { computedYaxisMinValue() {
return 0; return 0;

View File

@ -311,12 +311,16 @@ export default {
return series; return series;
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + index * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem, index) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -280,12 +280,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -263,12 +263,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -2,10 +2,10 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, con
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
EdgeHeight: 600, EdgeHeight: 600 / 3,
/** 间隔高度*/ /** 间隔高度*/
CoordMultiple: 1, CoordMultiple: 1 / 3,
/** 偏移时间*/ /** 偏移时间*/
TranslationTime: 60 * 60 * 2, TranslationTime: 60 * 60 * 2,
@ -131,7 +131,6 @@ export default {
if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode ||
index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime ||
index > 0 && index < train.stationTimeList.length - 1) { index > 0 && index < train.stationTimeList.length - 1) {
// ${train.directionCode}
const aa = `${train.tripNumber}`; const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.right, false), elem.stationCode, aa]); opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.right, false), elem.stationCode, aa]);
} }
@ -142,7 +141,6 @@ export default {
lastPoint = train.stationTimeList[idx - 1]; lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber); num = this.computedReentryNumber(train.tripNumber);
// ${train.directionCode}
const aa = `${train.tripNumber}`; const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.right, true, num), lastPoint.stationCode, aa]); opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.right, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.right, true, num), nextPoint.stationCode, aa]); opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.right, true, num), nextPoint.stationCode, aa]);
@ -259,15 +257,19 @@ export default {
initializeYaxis(stations) { initializeYaxis(stations) {
return createMarkLineModels(stations, (elem) => { return createMarkLineModels(stations, (elem) => {
return this.EdgeHeight + elem.kmRange * this.CoordMultiple; return this.EdgeHeight + elem.kmRange * this.CoordMultiple;
}); }, {yAxisIndex:0});
},
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
}, },
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -271,12 +271,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -326,12 +326,16 @@ export default {
}); });
}, },
getYaxisValueByStation(station, index) {
return this.EdgeHeight + station.kmRange * this.CoordMultiple;
},
/** 将后台数据转换为试图序列模型*/ /** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) { convertStationsToMap(stations) {
var map = {}; var map = {};
if (stations && stations.length) { if (stations && stations.length) {
stations.forEach((elem) => { stations.forEach((elem, index) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; map[`${elem.kmRange}`] = this.getYaxisValueByStation(elem, index);
}); });
} }

View File

@ -27,6 +27,7 @@ const Jlmap3dOtherVR = () => import('@/views/jlmap3d/maintainer/jl3dothervr');
const DisplayNew = () => import('@/views/newMap/displayNew/index'); const DisplayNew = () => import('@/views/newMap/displayNew/index');
const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index'); const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index');
const PracticeDisplay = () => import('@/views/newMap/displayNew/practiceDisplay');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
@ -397,6 +398,12 @@ export const publicAsyncRoute = [
path: '/design/runPlan/testRunplan', path: '/design/runPlan/testRunplan',
component: TestRunplan, component: TestRunplan,
hidden: true hidden: true
},
{
// 北京交大使用 客流视图
path: '/practiceDisplay',
component: PracticeDisplay,
hidden: true
} }
]; ];
// 城市轨道项目 // 城市轨道项目

View File

@ -150,11 +150,10 @@ export const SimulationType = {
MAINTAINER: '通号' MAINTAINER: '通号'
}; };
export const UrlConfig = { export const UrlConfig = {
display: '/display',
displayNew: '/displayNew', displayNew: '/displayNew',
scriptDisplay: '/scriptDisplay',
scriptDisplayNew:'/scriptDisplayNew', scriptDisplayNew:'/scriptDisplayNew',
practiceDisplayNew:'/practiceDisplayNew', practiceDisplayNew:'/practiceDisplayNew',
passengerDisplay:'/passengerDisplay',
examRuleDraft: '/examRule/draft', examRuleDraft: '/examRule/draft',
examRuleManage: '/examRule/manage', examRuleManage: '/examRule/manage',
examDetail: '/exam', examDetail: '/exam',

View File

@ -447,7 +447,3 @@ export const ProjectList = [
{value: 'bjd', label: '北交大'}, {value: 'bjd', label: '北交大'},
{value: 'urtss', label: '陪标项目'} {value: 'urtss', label: '陪标项目'}
]; ];
export const ProjectPostIdMap = {
drts: 1,
bjd: 2
};

View File

@ -141,6 +141,9 @@ function handle(state, data) {
case 'Simulation_Alarm': case 'Simulation_Alarm':
state.simulationAlarmInfo = msg; state.simulationAlarmInfo = msg;
break; break;
case 'STATION_PFI_NUM':
state.stationPfiNum = msg;
break;
case 'Simulation_Scenes_Reload': case 'Simulation_Scenes_Reload':
if (msg) { if (msg) {
store.dispatch('training/start'); store.dispatch('training/start');
@ -282,6 +285,7 @@ const socket = {
roomInvite: {}, roomInvite: {},
simulationTimeSync: '', // 仿真时间 simulationTimeSync: '', // 仿真时间
simulationIbpStatus: null, simulationIbpStatus: null,
stationPfiNum: null, // 客流消息列表
competitionPracticeFinish:0, // 竞赛场景结束标识 competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: []// 仿真报警信息 simulationAlarmInfo: []// 仿真报警信息
}, },
@ -292,6 +296,10 @@ const socket = {
state.jointRoomInfo = jointRoomInfo; state.jointRoomInfo = jointRoomInfo;
}, },
setStationPfiNum: (state, stationPfiNum) => {
state.stationPfiNum = stationPfiNum;
},
setChatContent: (state, chatContent) => { setChatContent: (state, chatContent) => {
state.chatContent = chatContent; state.chatContent = chatContent;
}, },
@ -355,6 +363,10 @@ const socket = {
commit('setJointRoomInfo', {}); commit('setJointRoomInfo', {});
}, },
setStationPfiNum: ({ commit }) => {
commit('setStationPfiNum', null);
},
setEquipmentStatus: ({ commit }) => { setEquipmentStatus: ({ commit }) => {
commit('setEquipmentStatus', []); commit('setEquipmentStatus', []);
}, },

View File

@ -60,7 +60,7 @@ export function createSeriesModel(opt, lineStyle) {
} }
/** 创建标记横线*/ /** 创建标记横线*/
export function createMarkLineModels(stations, computedYaxis) { export function createMarkLineModels(stations, computedYaxis, opt = {}) {
const markLineModel = {}; const markLineModel = {};
if (stations && stations.length) { if (stations && stations.length) {
markLineModel.type = 'line'; markLineModel.type = 'line';
@ -71,6 +71,7 @@ export function createMarkLineModels(stations, computedYaxis) {
markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 }; markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 };
markLineModel.markLine.symbol = 'none'; markLineModel.markLine.symbol = 'none';
markLineModel.elements = []; markLineModel.elements = [];
Object.assign(markLineModel, opt);
stations.forEach((elem, index) => { stations.forEach((elem, index) => {
markLineModel.markLine.data.push( markLineModel.markLine.data.push(
{ {

View File

@ -3,22 +3,15 @@
<div class="menuTrainListBtn" @click="clickBtn"> <div class="menuTrainListBtn" @click="clickBtn">
<div v-if="userRole == 'DISPATCHER'"> <div v-if="userRole == 'DISPATCHER'">
<div id="teleName" /> <div id="teleName" />
<p style="margin: 0;"></p> <div class="teleNameIn">调度电话</div>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</div> </div>
<div v-if="userRole != 'AUDIENCE' && userRole != 'DISPATCHER'"> <div v-if="userRole != 'AUDIENCE' && userRole != 'DISPATCHER'">
<div id="teleName" /> <div id="teleName" />
<p style="margin: 0;"></p> <div class="teleNameIn">电话</div>
<p style="margin: 0;"></p> </div>
<div v-if="userRole == 'AUDIENCE'">
<div class="teleNameIn">通话记录</div>
</div> </div>
<template v-if="userRole == 'AUDIENCE'">
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</template>
</div> </div>
<div class="chat-box-main"> <div class="chat-box-main">
<!-- v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" --> <!-- v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" -->
@ -123,9 +116,9 @@
</div> --> </div> -->
</div> </div>
<div class="chat-box-content chat-box-content_audience"> <div class="chat-box-content chat-box-content_audience">
<!-- :project="project" -->
<chat-content <chat-content
ref="chatContent" ref="chatContent"
:project="project"
:is-answering="IsAnswering" :is-answering="IsAnswering"
:conversition-id="conversitionId" :conversition-id="conversitionId"
:conversition-member-list="conversitionMemberList" :conversition-member-list="conversitionMemberList"
@ -1398,4 +1391,8 @@ export default {
50%{opacity:0;} 50%{opacity:0;}
100% {opacity: 1;} 100% {opacity: 1;}
} }
.teleNameIn{
width: 16px;
white-space: pre-wrap;
}
</style> </style>

View File

@ -29,7 +29,7 @@
<template v-for="(elem,j) in allCommentList"> <template v-for="(elem,j) in allCommentList">
<div :key="j" style="font-size: 14px;margin-top: 10px;"> <div :key="j" style="font-size: 14px;margin-top: 10px;">
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span> <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
<span style="margin-right: 15px;">{{ elem.content }}</span> <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
<span style="margin-right: 10px;">{{ elem.commentTime }}</span> <span style="margin-right: 10px;">{{ elem.commentTime }}</span>
<span style="color:#409EFF;cursor: pointer;margin-right: 10px;" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span> <span style="color:#409EFF;cursor: pointer;margin-right: 10px;" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span> <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
@ -40,7 +40,7 @@
<template v-for="(elem,j) in item.comments.list"> <template v-for="(elem,j) in item.comments.list">
<div :key="j" style="font-size: 14px;margin-top: 18px;"> <div :key="j" style="font-size: 14px;margin-top: 18px;">
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span> <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
<span style="margin-right: 15px;">{{ elem.content }}</span> <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
<span style="margin-right: 10px;">{{ elem.commentTime }}</span> <span style="margin-right: 10px;">{{ elem.commentTime }}</span>
<span style="color:#409EFF;cursor: pointer;margin-right: 10px;" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span> <span style="color:#409EFF;cursor: pointer;margin-right: 10px;" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span> <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
@ -52,8 +52,18 @@
</div> </div>
</div> </div>
<div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;"> <div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;">
<el-input :id="'answerInput' + item.id" v-model="commentContent" type="textarea" placeholder="请输入内容" maxlength="300" style="margin-top: 10px;" :autosize="{ minRows: 2, maxRows: 4}" show-word-limit @input="changeCommentContent" /> <quill-editor
<div style="margin-top: 10px;"> :ref="'answerInput' + item.id"
v-model="commentContent"
style="width: 80%;margin-left: 10%;margin-top: 10px;"
class-name="answer_input"
:margin-bottom="20"
editor-type="onlyEmoji"
:no-handle-p="true"
:height="100"
:placeholder="replyUserName"
/>
<div>
<el-button type="danger" size="small" @click="commentMessage">回复</el-button> <el-button type="danger" size="small" @click="commentMessage">回复</el-button>
<el-button size="small" @click="cancelComment">取消</el-button> <el-button size="small" @click="cancelComment">取消</el-button>
</div> </div>
@ -74,11 +84,10 @@
/> />
</div> </div>
</el-card> </el-card>
<quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" placeholder="请输入内容" :margin-bottom="20" :unload-img="true" :no-handle-p="true" /> <quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" :margin-bottom="20" editor-type="imgEmoji" :no-handle-p="true" />
<span id="boardBottom" class="dialog-footer"> <span id="boardBottom" class="dialog-footer">
<el-button @click="handleClear">清空</el-button> <el-button @click="handleClear">清空</el-button>
<el-button type="danger" @click="commitComment">留言</el-button> <el-button type="danger" @click="commitComment">留言</el-button>
<!--<el-button type="danger" @click="dialogVisible = false">返回</el-button>-->
</span> </span>
<el-button size="mini" type="danger" style="position: fixed; right: 100px;top: 80px;width: 90px;" @click="goSlide">我要留言</el-button> <el-button size="mini" type="danger" style="position: fixed; right: 100px;top: 80px;width: 90px;" @click="goSlide">我要留言</el-button>
<el-button size="mini" style="position: fixed; right: 100px;top: 120px;width: 90px;" @click="dialogVisible = false">退出留言板</el-button> <el-button size="mini" style="position: fixed; right: 100px;top: 120px;width: 90px;" @click="dialogVisible = false">退出留言板</el-button>
@ -89,14 +98,15 @@
</template> </template>
<script> <script>
import { answerPost, queryPostPaging, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents, queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf } from '@/api/learn'; import { answerPost, queryMessagePagingByProjectCode, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents,
queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf, getPostByProjectCode } from '@/api/learn';
import lick_icon from '@/assets/like.png'; import lick_icon from '@/assets/like.png';
import unlike_icon from '@/assets/unlike.png'; import unlike_icon from '@/assets/unlike.png';
import reply_icon from '@/assets/reply.png'; import reply_icon from '@/assets/reply.png';
import delete_icon from '@/assets/delete.png'; import delete_icon from '@/assets/delete.png';
import { superAdmin } from '@/router/index_APP_TARGET'; import { superAdmin } from '@/router/index_APP_TARGET';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import { ProjectPostIdMap } from '@/scripts/ProjectConfig'; import { ProjectCode } from '@/scripts/ProjectConfig';
export default { export default {
name: 'MessageBoard', name: 'MessageBoard',
data() { data() {
@ -119,7 +129,7 @@ export default {
allCommentList: [], allCommentList: [],
moreMessageId: '', moreMessageId: '',
replyUserName: '', replyUserName: '',
commentContentNoName: '' postId: ''
}; };
}, },
computed: { computed: {
@ -129,9 +139,9 @@ export default {
superAdmin() { superAdmin() {
return this.$store.state.user.roles.includes(superAdmin); return this.$store.state.user.roles.includes(superAdmin);
}, },
postId() { projectCode() {
const project = getSessionStorage('project'); const project = getSessionStorage('project');
return ProjectPostIdMap[project]; return ProjectCode[project];
} }
}, },
created() { created() {
@ -141,6 +151,13 @@ export default {
document.getElementById('targetImg').src = event.target.currentSrc; document.getElementById('targetImg').src = event.target.currentSrc;
}; };
}, },
mounted() {
if (this.projectCode === 'DRTS' || this.projectCode === 'BJD') {
getPostByProjectCode(this.projectCode).then(resp => {
this.postId = resp.data.id;
});
}
},
methods: { methods: {
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
@ -151,20 +168,21 @@ export default {
}, },
commitComment() { commitComment() {
const images = this.content.match(/<img/g); const images = this.content.match(/<img/g);
const answerContent = this.handleEmojiContent(this.content);
if (images && images.length > 3) { if (images && images.length > 3) {
this.$message.error('留言内容使用图片应小于三张!'); this.$message.error('留言内容使用图片应小于三张!');
return; return;
} }
if (this.content.length > 1000) { if (answerContent.length > 1000) {
this.$message.error('留言内容超出最大长度!'); this.$message.error('留言内容超出最大长度!');
return; return;
} }
if (!this.content) { if (!answerContent) {
this.$message.error('留言内容不能为空!'); this.$message.error('留言内容不能为空!');
return; return;
} }
answerPost({postId: this.postId, content: this.content}).then(resp => { answerPost({postId: this.postId, content: answerContent}).then(resp => {
this.pageNum = Math.ceil(resp.data / this.pageSize); this.pageNum = 1;
this.handleCurrentChange(); this.handleCurrentChange();
this.content = ''; this.content = '';
}).catch(error => { }).catch(error => {
@ -173,16 +191,28 @@ export default {
}); });
}, },
handleCurrentChange() { handleCurrentChange() {
queryPostPaging(this.postId, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => { queryMessagePagingByProjectCode(this.projectCode, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => {
this.postCommentList = []; this.postCommentList = [];
(resp.data.list || []).forEach(item => { (resp.data.list || []).forEach(item => {
const value = item.content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"'); item.content = this.replaceEmoji(item.content);
item.content = value; item.comments && item.comments.list && item.comments.list.forEach(elem => {
elem.content = this.replaceEmoji(elem.content);
});
this.postCommentList.push(item); this.postCommentList.push(item);
}); });
this.total = resp.data.total; this.total = resp.data.total;
}); });
}, },
replaceEmoji(content) {
let value = content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"');
const list = value.match(/<<<([^>]*)>>>/g);
(list || []).forEach(elem => {
const targetValue = elem.substring(3, elem.length - 3);
value = value.replace(elem, `<span class="ql-emojiblot" data-name="${targetValue}"><span contenteditable="false"><span class="ap ap-${targetValue}">ss</span></span></span>`);
});
console.log(content, list, list);
return value;
},
goSlide() { goSlide() {
const bottom = document.getElementById('boardBottom'); const bottom = document.getElementById('boardBottom');
const element = document.getElementById('elDialog').childNodes[0]; const element = document.getElementById('elDialog').childNodes[0];
@ -211,10 +241,10 @@ export default {
this.replyMessageIndex = messageIndex; this.replyMessageIndex = messageIndex;
if (commentId) { if (commentId) {
this.replyUserName = '@' + userNickname + ' '; this.replyUserName = '@' + userNickname + ' ';
this.commentContent = this.replyUserName + this.commentContentNoName; this.commentContent = '';
} }
this.$nextTick(()=>{ this.$nextTick(()=>{
document.getElementById('answerInput' + messageId).focus(); this.$refs['answerInput' + messageId][0].getFocus();
}); });
}, },
cancelComment() { cancelComment() {
@ -223,38 +253,47 @@ export default {
this.replyCommentId = ''; this.replyCommentId = '';
this.replyMessageIndex = ''; this.replyMessageIndex = '';
this.replyUserName = ''; this.replyUserName = '';
this.commentContentNoName = '';
}, },
commentMessage() { commentMessage() {
const contentValue = this.handleEmojiContent(this.commentContent);
if (contentValue.length > 300) {
this.$message.error('回复内容超出最大长度!');
return;
}
if (this.replyCommentId) { if (this.replyCommentId) {
commentComents(this.replyMessageId, this.replyCommentId, {content:this.commentContentNoName}).then(resp => { commentComents(this.replyMessageId, this.replyCommentId, {content:contentValue}).then(resp => {
this.getCommentList(this.replyMessageId, this.replyMessageIndex); this.getCommentList(this.replyMessageId, this.replyMessageIndex);
this.cancelComment(); this.cancelComment();
}).catch(error => { }).catch(error => {
this.$message.error('评论留言失败!'); this.$message.error('评论回复失败!');
console.error(error); console.error(error);
}); });
} else { } else {
commentLevelMessage(this.replyMessageId, {content:this.commentContentNoName}).then(resp => { commentLevelMessage(this.replyMessageId, {content:contentValue}).then(resp => {
this.getCommentList(this.replyMessageId, this.replyMessageIndex); this.getCommentList(this.replyMessageId, this.replyMessageIndex);
this.cancelComment(); this.cancelComment();
}).catch(error => { }).catch(error => {
this.$message.error('评论留言失败!'); this.$message.error('评论回复失败!');
console.error(error); console.error(error);
}); });
} }
}, },
getCommentList(messageId, messageIndex) { getCommentList(messageId, messageIndex) {
queryMessageCommentList(messageId).then(resp => { queryMessageCommentList(messageId).then(resp => {
const replaceValue = [];
resp.data && resp.data.forEach(item => {
item.content = this.replaceEmoji(item.content);
replaceValue.push(item);
});
if (this.moreMessageId == messageId) { if (this.moreMessageId == messageId) {
this.allCommentList = resp.data; this.allCommentList = replaceValue;
} }
if (resp.data.length > 3) { if (replaceValue.length > 3) {
this.postCommentList[messageIndex].comments.list = resp.data.slice(0, 3); this.postCommentList[messageIndex].comments.list = replaceValue.slice(0, 3);
this.postCommentList[messageIndex].comments.total = resp.data.length; this.postCommentList[messageIndex].comments.total = replaceValue.length;
} else { } else {
this.postCommentList[messageIndex].comments.list = resp.data; this.postCommentList[messageIndex].comments.list = replaceValue;
this.postCommentList[messageIndex].comments.total = resp.data.length; this.postCommentList[messageIndex].comments.total = replaceValue.length;
} }
}).catch(error => { }).catch(error => {
this.$message.error('更新回复失败!'); this.$message.error('更新回复失败!');
@ -306,20 +345,24 @@ export default {
}, },
viewMoreComment(data) { viewMoreComment(data) {
queryMessageCommentList(data.id).then(resp => { queryMessageCommentList(data.id).then(resp => {
this.allCommentList = resp.data; this.allCommentList = [];
resp.data && resp.data.forEach(item => {
item.content = this.replaceEmoji(item.content);
this.allCommentList.push(item);
});
this.moreMessageId = data.id; this.moreMessageId = data.id;
}).catch(error => { }).catch(error => {
console.error(error); console.error(error);
}); });
}, },
changeCommentContent(val) { handleEmojiContent(content) {
if (this.replyUserName && val.startsWith(this.replyUserName)) { const list = content.match(/<span class="ql-emojiblot" data-name="(\S*)"><span contenteditable="false"><span class="ap ap-(\S*)<\/span><\/span><\/span>/g);
this.commentContentNoName = val.slice(this.replyUserName.length); (list || []).forEach(item => {
} else if (this.replyUserName) { let targetValue = item.split(' ')[2];
this.commentContent = this.replyUserName + this.commentContentNoName; targetValue = targetValue.substring(11, targetValue.length - 8);
} else { content = content.replace(item, '<<<' + targetValue + '>>>');
this.commentContentNoName = this.commentContent; });
} return content;
} }
} }
}; };

View File

@ -1,6 +1,7 @@
<template> <template>
<div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}"> <div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}">
<el-button size="small" style="position: fixed; top: 5px;right: 5px;" type="primary" plain @click="quit">退出</el-button> <el-button size="small" style="position: fixed; top: 5px;right: 5px;" type="primary" plain @click="quit">退出</el-button>
<el-button size="small" style="position: fixed; top: 5px;right: 5px;" type="primary" plain @click="handlePfiNum">{{ pfiNumFlag ? '隐藏客流量' : '显示客流量' }}</el-button>
<div class="left"> <div class="left">
<div :id="runPlanId" /> <div :id="runPlanId" />
</div> </div>
@ -31,6 +32,7 @@ import echarts from 'echarts';
import {toTimeStamp, formatDuring} from '@/utils/date'; import {toTimeStamp, formatDuring} from '@/utils/date';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
// getPassengerHistoryList //
import { getByGroupStationList } from '@/api/jmap/map'; import { getByGroupStationList } from '@/api/jmap/map';
import { getEveryDayRunPlanNew } from '@/api/simulation'; import { getEveryDayRunPlanNew } from '@/api/simulation';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp'; import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
@ -88,7 +90,9 @@ export default {
staticSeries: [], staticSeries: [],
runSeries: [], runSeries: [],
selectSeries: [], selectSeries: [],
runPlanData: {} runPlanData: {},
pfiNumFlag: true,
pfiNumList: [] //
}; };
}, },
computed: { computed: {
@ -137,6 +141,12 @@ export default {
this.updateRunPlanData(val); this.updateRunPlanData(val);
} }
}, },
'$store.state.socket.stationPfiNum': function (data) {
if (data) {
this.updateRunPlanData(data, true);
this.$store.dispatch('socket/setStationPfiNum');
}
},
'$store.state.socket.simulationOver':function(val) { '$store.state.socket.simulationOver':function(val) {
this.quit(); this.quit();
} }
@ -216,12 +226,13 @@ export default {
}, },
async analyticalServiceNumber(data) { async analyticalServiceNumber(data) {
this.serviceNumberConfig.data = Object.keys(data || {}) this.serviceNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) // .sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.sort((a, b) => { return parseInt(data[a].serviceNumber) - parseInt(data[b].serviceNumber); })
.map(serviceNumber => { return { serviceNumber }; }); .map(serviceNumber => { return { serviceNumber }; });
}, },
async analyticalTripNumber(data) { async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {}) this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.map(tripNumber => { return { tripNumber }; }); .map(tripNumber => { return { tripNumber }; });
}, },
async setPosition() { async setPosition() {
@ -242,25 +253,88 @@ export default {
} }
}); });
}, },
updateRunPlanData(data) { updateRunPlanData(data, pfiNum = false) {
const stations = this.$store.state.runPlan.stations; const stations = this.$store.state.runPlan.stations;
const initialPlanData = this.$store.state.runPlan.initialPlanData; const initialPlanData = this.$store.state.runPlan.initialPlanData;
data.forEach(item => { if (!pfiNum) {
if (item && initialPlanData[item.serviceNumber]) { data.forEach(item => {
Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => { if (item && initialPlanData[item.serviceNumber]) {
if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) { Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => {
item.directionCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].directionCode; if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) {
} item.directionCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].directionCode;
}); }
item.secondTime = item.second; });
item.secondTime = item.second;
}
});
}
if (pfiNum) { //
// const option = this.myChart.getOption();
// let series = option.series;
// this.handleStationNum(data);
// if (this.pfiNumFlag) {
// series = [...series, ...this.pfiNumList];
// this.myChart && this.myChart.setOption({series: series});
// }
} else {
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 }
);
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries];
this.myChart && this.myChart.setOption({series: series});
}
},
handleStationNum(data) {
const timeDate = (data.systemTime).split(' ')[0];
const time = ((+new Date(data.systemTime) - (+new Date(`${timeDate} 00:00:00`))) / 1000) - this.PlanConvert.TranslationTime;
let index = 1;
this.stations.forEach((station, ii) => {
if (station.visible) {
const stationObj = data.data.find(ele => ele.stationCode == station.code);
const judge = this.pfiNumList.find(ele => ele.code == station.code);
if (!judge) {
this.pfiNumList.push({
name: '客流量',
type: 'bar',
code: station.code,
barGap: '-100%',
yAxisIndex: index++,
barWidth: '3000%',
itemStyle: {
color: '#3BAAF7'
},
z: 10,
data: [[time, stationObj.passengerQuantity]]
});
} else {
judge.data.push([time, stationObj.passengerQuantity]);
}
} }
}); });
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations); },
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap, handlePfiNum() {
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 } const option = this.myChart.getOption();
); const series = option.series;
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries]; if (this.pfiNumFlag) {
series.forEach(item => {
if (item.type == 'bar') {
item.itemStyle = {
color: 'rgba(0,0,0,0)'
};
}
});
} else {
series.forEach(item => {
if (item.type == 'bar') {
item.itemStyle = {
color: '#3BAAF7'
};
}
});
}
this.myChart && this.myChart.setOption({series: series}); this.myChart && this.myChart.setOption({series: series});
this.pfiNumFlag = !this.pfiNumFlag;
}, },
async loadChartPage() { async loadChartPage() {
try { try {
@ -275,7 +349,19 @@ export default {
this.seriesMap[item.name] = item; this.seriesMap[item.name] = item;
}); });
await this.analyticalServiceNumber(this.$store.state.runPlan.editData); await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
//
// const res = await getPassengerHistoryList(this.$route.query.group);
// if (res.code == 200) {
// res.data.forEach(item => {
// this.handleStationNum(item);
// });
// }
// const option = this.myChart.getOption();
// const series = option.series;
// series = [...series, ...this.pfiNumList];
// this.myChart && this.myChart.setOption({series: series});
} catch (error) { } catch (error) {
console.log(error, '====');
this.$messageBox(`加载运行图数据失败`); this.$messageBox(`加载运行图数据失败`);
} }
}, },
@ -283,20 +369,6 @@ export default {
async loadInitData() { async loadInitData() {
this.myChart && this.myChart.showLoading(); this.myChart && this.myChart.showLoading();
const option = { const option = {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '40px',
bottom: '65px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
},
tooltip: { tooltip: {
axisPointer: { axisPointer: {
trigger: 'item', trigger: 'item',
@ -305,10 +377,16 @@ export default {
formatter: this.axisTooltip, formatter: this.axisTooltip,
borderWidth: 1 borderWidth: 1
}, },
grid: [
{
right: '40px',
left: '120px',
height: '85%'
}
],
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false,
data: [], data: [],
axisLine: { axisLine: {
onZero: false, onZero: false,
@ -333,55 +411,53 @@ export default {
} }
} }
], ],
yAxis: { yAxis: [
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{ {
type: 'inside' type: 'value',
}, splitLine: {
{ show: false
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}, },
bottom: '20px' axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
}
} }
] ],
dataZoom: [{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '20px'
}],
series: []
}; };
await this.xAxisInit(option); await this.xAxisInit(option);
await this.yAxisInit(option); await this.yAxisInit(option);
@ -452,18 +528,39 @@ export default {
}, },
yAxisInit(option) { yAxisInit(option) {
if (Object.keys(this.PlanConvert).length) { if (Object.keys(this.PlanConvert).length) {
option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations); option.yAxis[0].min = this.PlanConvert.computedYaxisMinValue(this.stations);
option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations); option.yAxis[0].max = this.PlanConvert.computedYaxisMaxValue(this.stations);
let index = 1;
this.stations.forEach((station, ii) => {
if (station.visible) {
option.yAxis.push({
type: 'value',
min: Math.floor(option.yAxis[0].min - this.PlanConvert.getYaxisValueByStation(station, ii)),
max: Math.floor(option.yAxis[0].max - this.PlanConvert.getYaxisValueByStation(station, ii)),
show: false,
yAxisIndex : index++
});
}
});
} }
}, },
axisTooltip(param) { axisTooltip(param) {
const station = (this.$store.getters['map/getDeviceByCode'](param.data[2])) || { name: '', kmRange: '' }; if (param.seriesType == 'bar') {
return [ return [
`Point Data <hr size=1 style=" margin: 3px 0">`, `Point Data <hr size=1 style=" margin: 3px 0">`,
`车站名称: ${station.name}<br>`, `车站客流量: ${param.data[1]} 人 <br>`,
`车站公里标: ${station.kmRange} km <br>`, `当前时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)}<br>`
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>` ].join('');
].join(''); } else {
const station = (this.$store.getters['map/getDeviceByCode'](param.data[2])) || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style=" margin: 3px 0">`,
`车站名称: ${station.name}<br>`,
`车站公里标: ${station.kmRange} km <br>`,
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
}
}, },
renderTripNumber(params) { renderTripNumber(params) {
const tripNumber = params.tripNumber; // const tripNumber = params.tripNumber; //

View File

@ -206,7 +206,7 @@ export default {
}, },
async analyticalTripNumber(data) { async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {}) this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.map(tripNumber => { return { tripNumber }; }); .map(tripNumber => { return { tripNumber }; });
}, },
async setPosition() { async setPosition() {
@ -245,6 +245,22 @@ export default {
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 } this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 }
); );
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries]; const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries];
// let index = 0;
// this.stations.forEach((station, ii) => {
// if (station.visible) {
// index++;
// series.push({
// type: 'bar',
// barGap: '-100%',
// yAxisIndex: index,
// barWidth: '3000%',
// itemStyle: {
// color: 'red'
// },
// data: [[29030, 50], [29060, 60], [29090, 20], [29120, 60], [29150, 80], [29180, 160], [29210, 50], [29240, 80], [29270, 30]]
// });
// }
// });
this.myChart && this.myChart.setOption({series: series}); this.myChart && this.myChart.setOption({series: series});
}, },
async loadChartPage() { async loadChartPage() {
@ -268,20 +284,6 @@ export default {
async loadInitData() { async loadInitData() {
this.myChart && this.myChart.showLoading(); this.myChart && this.myChart.showLoading();
const option = { const option = {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '40px',
bottom: '65px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
},
tooltip: { tooltip: {
axisPointer: { axisPointer: {
trigger: 'item', trigger: 'item',
@ -290,10 +292,14 @@ export default {
formatter: this.axisTooltip, formatter: this.axisTooltip,
borderWidth: 1 borderWidth: 1
}, },
grid: {
right: '40px',
left: '120px',
height: '85%'
},
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false,
data: [], data: [],
axisLine: { axisLine: {
onZero: false, onZero: false,
@ -318,54 +324,55 @@ export default {
} }
} }
], ],
yAxis: { yAxis: [
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{ {
type: 'inside' type: 'value',
}, yAxisIndex: 0,
{ splitLine: {
fiterMode: 'filter', show: false
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}, },
bottom: '20px' axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
}
} }
],
dataZoom: [{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '20px'
}],
series: [
] ]
}; };
await this.xAxisInit(option); await this.xAxisInit(option);
@ -394,6 +401,23 @@ export default {
option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime; option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime;
option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime; option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime;
option.series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries]; option.series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
// let index = 0;
// this.stations.forEach((station, ii) => {
// if (station.visible) {
// index++;
// option.series.push({
// type: 'bar',
// barGap: '-100%',
// yAxisIndex: index,
// barWidth: '3000%',
// itemStyle: {
// color: 'red'
// },
// data: [[29030, 50], [29060, 60], [29090, 20], [29120, 60], [29150, 80], [29180, 160], [29210, 50], [29240, 80], [29270, 30]]
// });
// }
// });
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);
@ -440,8 +464,20 @@ export default {
}, },
yAxisInit(option) { yAxisInit(option) {
if (Object.keys(this.PlanConvert).length) { if (Object.keys(this.PlanConvert).length) {
option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations); option.yAxis[0].min = this.PlanConvert.computedYaxisMinValue(this.stations);
option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations); option.yAxis[0].max = this.PlanConvert.computedYaxisMaxValue(this.stations);
// let index = 1;
// this.stations.forEach((station, ii) => {
// if (station.visible) {
// option.yAxis.push({
// type: 'value',
// min: Math.floor(option.yAxis[0].min - this.PlanConvert.getYaxisValueByStation(station, ii)),
// max: Math.floor(option.yAxis[0].max - this.PlanConvert.getYaxisValueByStation(station, ii)),
// show: false,
// yAxisIndex : index++
// });
// }
// });
} }
}, },
axisTooltip(param) { axisTooltip(param) {

View File

@ -32,6 +32,7 @@
<el-button v-if="project === 'bjd'" size="small" @click="distribute">权限分发</el-button> <el-button v-if="project === 'bjd'" size="small" @click="distribute">权限分发</el-button>
<el-button v-if="isContest || project === 'bjd'" size="small" @click="messageBoardShow">留言板</el-button> <el-button v-if="isContest || project === 'bjd'" size="small" @click="messageBoardShow">留言板</el-button>
<el-button v-if="isContest || project === 'bjd'" size="small" @click="contectUs">联系方式</el-button> <el-button v-if="isContest || project === 'bjd'" size="small" @click="contectUs">联系方式</el-button>
<el-button v-if="project === 'bjd'" size="small" @click="passengersView">客流视图</el-button>
</el-button-group> </el-button-group>
</div> </div>
<Jl3d-Device <Jl3d-Device
@ -135,7 +136,8 @@ export default {
jl3dtraffictrain:this.$t('display.demon.traffictraintext'), jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
jl3dpassflow:this.$t('display.demon.passengerflow'), jl3dpassflow:this.$t('display.demon.passengerflow'),
jl3dname: this.$t('display.demon.threeDimensionalView'), jl3dname: this.$t('display.demon.threeDimensionalView'),
jl3dmodel: this.$t('display.demon.deviceView') jl3dmodel: this.$t('display.demon.deviceView'),
openWindow:null
}; };
}, },
computed:{ computed:{
@ -247,8 +249,7 @@ export default {
noPreLogout: true noPreLogout: true
} }
}); });
this.openWindow = window.open(routeData.href); window.open(routeData.href);
}, },
jumpjlmap3dDriver() { jumpjlmap3dDriver() {
this.drivingShow = true; this.drivingShow = true;
@ -284,6 +285,24 @@ export default {
}); });
window.open(routeData.href, '_blank', 'noopener noreferrer'); window.open(routeData.href, '_blank', 'noopener noreferrer');
}, },
passengersView() {
if (this.openWindow) {
this.openWindow.close();
}
const routeData = this.$router.resolve({
path:'/practiceDisplay',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
lineCode: this.$route.query.lineCode,
project: this.$route.query.project,
noPreLogout: true
// initTime: this.$store.state.training.initTime
}
});
// this.openWindow = window.open(routeData.href, '_blank', 'noopener noreferrer');
this.openWindow = window.open(routeData.href);
},
loadRunPlan() { loadRunPlan() {
this.$emit('runPlanLoadShow'); this.$emit('runPlanLoadShow');
}, },

View File

@ -11,8 +11,8 @@
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.result"> <div v-if="scope.row.result">
<template v-for="(each,index) in scope.row.result"> <template v-for="(each, index) in scope.row.result">
<el-button type="primary" size="small" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button> <el-button :key="index" type="primary" size="small" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button>
</template> </template>
</div> </div>
</template> </template>

View File

@ -59,7 +59,7 @@ import DemonChat from './demonChat';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import MenuSchema from '@/views/newMap/displayNew/menuSchema'; import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import { getGoodsTryUse } from '@/api/management/goods'; import { getGoodsTryUse } from '@/api/management/goods';
import {getSimulationInfoNew } from '@/api/simulation'; import {getSimulationInfoNew, clearSimulation } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index'; import { getCountTime } from '@/utils/index';
import { TrainingMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
@ -343,10 +343,14 @@ export default {
}, },
async back() { async back() {
this.isGoback = true; this.isGoback = true;
if (this.projectDevice) { if (this.projectDevice || this.project === 'bjd') {
this.$store.dispatch('training/over').then(() => { clearSimulation(this.group).then(res=>{
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('training/over').then(() => {
location.reload(); this.$store.dispatch('LogOut').then(() => {
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
location.reload();
});
}); });
}); });
} else { } else {

View File

@ -19,7 +19,7 @@
</div> </div>
<fault-choose ref="faultChoose" :group="group" :offset="offset" /> <fault-choose ref="faultChoose" :group="group" :offset="offset" />
<run-plan-Load ref="runPlanLoad" :group="group" /> <run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" /> <run-plan-view v-if="project!== 'bjd'" ref="runPlanView" :group="group" />
<!-- 加载剧本列表弹窗 --> <!-- 加载剧本列表弹窗 -->
<add-quest ref="addQuest" @selectQuest="selectQuest" /> <add-quest ref="addQuest" @selectQuest="selectQuest" />
<run-plan-edit v-if="isScheduling && isDepot" ref="runPlanEdit" /> <run-plan-edit v-if="isScheduling && isDepot" ref="runPlanEdit" />

View File

@ -0,0 +1,153 @@
<template>
<div class="map-view" :style="{width: canvasWidth+'px',height:'100%',position:'absolute',overflow:'hidden'}">
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
<jlmap-visual ref="jlmapVisual" />
<div class="display-draft">
<el-button-group>
<el-button type="small" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group>
</div>
<menu-system-time ref="menuSystemTime" :offset="15" :group="group" />
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { Notification } from 'element-ui';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { getToken } from '@/utils/auth';
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
export default {
name:'PracticeDisplay',
components: {
JlmapVisual,
MenuSystemTime
},
data() {
return {
maskOpen: false,
maskWidth: '100%',
group:''
};
},
computed:{
...mapGetters([
'canvasWidth'
]),
// group() {
// return this.$route.query.group;
// },
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
},
watch:{
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
// this.$jlmap.off('zoom');
if (this.group) {
this.subscribe();
}
},
'$store.state.app.windowSizeCount': function() { //
this.setWindowSize();
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length && this.$route.query.group) {
this.statusMessage(val);
}
},
'$store.state.socket.simulationStart': function(val) {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}
},
beforeDestroy() {
this.$store.dispatch('map/mapClear');
if (this.group) {
clearSimulation(this.group);
this.clearSubscribe();
}
},
mounted() {
this.group = this.$route.query.group;
this.setWindowSize();
this.initLoadData();
},
methods:{
async initLoadData() { //
if (this.group) {
this.loadSimulationInfo();
await loadNewMapDataByGroup(this.group);
}
},
//
setWindowSize() {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
},
async back() {
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
// this.$store.dispatch('map/setShowCentralizedStationCode', '');
// history.go(-1);
// await this.$store.dispatch('map/mapClear');
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
window.close();
// Notification.closeAll();
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);
},
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data) {
if (!resp.data.dataError) {
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/countTime');
this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
} else {
this.$messageBox('此地图数据正在维护中,无法运行!');
}
this.dataError = resp.data.dataError;
}
}
}
};
</script>
<style lang="scss" scoped>
.display-draft {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
}
</style>

View File

@ -507,8 +507,8 @@ export default {
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
this.oldPoint = JSON.parse(JSON.stringify(model.points)); this.oldPoint = JSON.parse(JSON.stringify(model.points));
this.oldLeftSectionCode = model.leftSectionCode; this.oldLeftSectionCode = model.leftSectionCode;
this.oldRightSectionCode = model.rightSectionCode; this.oldRightSectionCode = model.rightSectionCode;
this.field = ''; this.field = '';
} else { } else {
this.$message('还有属性未填写,修改未生效!'); this.$message('还有属性未填写,修改未生效!');
} }

View File

@ -306,9 +306,10 @@ export default {
handlePreview(row) { handlePreview(row) {
previewRunPlan(row.id).then(resp => { previewRunPlan(row.id).then(resp => {
const query = { const query = {
prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:'' prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id
}; };
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query }); // this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
this.$router.push({ path: UrlConfig.design.testRunPlan, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message); this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);

View File

@ -16,9 +16,9 @@
:plan-convert="PlanConvert" :plan-convert="PlanConvert"
:load-run-plan-id="loadRunPlanId" :load-run-plan-id="loadRunPlanId"
:load-run-plan-name="loadRunPlanName" :load-run-plan-name="loadRunPlanName"
:max-height="height"
:max-width="width"
/> />
<!-- :max-height="height" -->
<!-- :max-width="width" -->
<status-bar ref="statusBar" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @showTrain="showTrain" /> <status-bar ref="statusBar" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @showTrain="showTrain" />
<!-- <open-run-plan ref="openRunPlan" :skin-code="skinCode" @dispatchDialog="dispatchDialog" /> --> <!-- <open-run-plan ref="openRunPlan" :skin-code="skinCode" @dispatchDialog="dispatchDialog" /> -->
@ -32,8 +32,8 @@
@dispatchOperate="dispatchOperate" @dispatchOperate="dispatchOperate"
@refresh="refresh" @refresh="refresh"
/> />
<edit-smooth-run-time ref="editSmoothRunTime" @dispatchDialog="dispatchDialog" /> <!-- <edit-smooth-run-time ref="editSmoothRunTime" @dispatchDialog="dispatchDialog" /> -->
<add-smooth-run-time ref="addSmoothRunTime" @dispatchDialog="dispatchDialog" /> <!-- <add-smooth-run-time ref="addSmoothRunTime" @dispatchDialog="dispatchDialog" /> -->
<duplicate-train ref="duplicateTrain" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" /> <duplicate-train ref="duplicateTrain" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
<modifying-routing ref="modifyingRouting" @dispatchDialog="dispatchDialog" /> <modifying-routing ref="modifyingRouting" @dispatchDialog="dispatchDialog" />
<modifying-begin-time ref="modifyingBeginTime" /> <modifying-begin-time ref="modifyingBeginTime" />
@ -69,8 +69,8 @@ import ModifyingTask from './menus/modifyingTask';
import ModifyingRouting from './menus/modifyingRouting'; import ModifyingRouting from './menus/modifyingRouting';
import ModifyingBeginTime from './menus/modifyingBeginTime'; import ModifyingBeginTime from './menus/modifyingBeginTime';
import EditStationBetweenTime from './menus/editStationBetweenTime'; import EditStationBetweenTime from './menus/editStationBetweenTime';
import AddSmoothRunTime from './menus/addSmoothRunTime'; // import AddSmoothRunTime from './menus/addSmoothRunTime';
import EditSmoothRunTime from './menus/editSmoothRunTime'; // import EditSmoothRunTime from './menus/editSmoothRunTime';
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime'; import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
import PopulatingGenericData from './menus/populatingGenericData'; import PopulatingGenericData from './menus/populatingGenericData';
import CreateEmptyPlan from './menus/createEmptyPlan'; import CreateEmptyPlan from './menus/createEmptyPlan';
@ -99,8 +99,8 @@ export default {
ModifyingRouting, ModifyingRouting,
ModifyingBeginTime, ModifyingBeginTime,
EditStationBetweenTime, EditStationBetweenTime,
AddSmoothRunTime, // AddSmoothRunTime,
EditSmoothRunTime, // EditSmoothRunTime,
ModifyingStationIntervalTime, ModifyingStationIntervalTime,
CreateEmptyPlan, CreateEmptyPlan,
EditPlanName EditPlanName
@ -117,12 +117,6 @@ export default {
computed: { computed: {
lineCode() { lineCode() {
return this.$route.query.lineCode || '02'; return this.$route.query.lineCode || '02';
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
} }
}, },
created() { created() {

View File

@ -164,11 +164,11 @@ export default {
title: '填充通用数据', title: '填充通用数据',
click: this.populatingGenericData click: this.populatingGenericData
// disabledCallback: () => { return !this.$route.query.planId }, // disabledCallback: () => { return !this.$route.query.planId },
},
{
title: '创建运行图',
click: this.newRunPlan
} }
// {
// title: '',
// click: this.newRunPlan
// }
] ]
}, },
{ {
@ -429,9 +429,9 @@ export default {
populatingGenericData() { populatingGenericData() {
this.$emit('dispatchDialog', { name: 'populatingGenericData', params: {} }); this.$emit('dispatchDialog', { name: 'populatingGenericData', params: {} });
}, },
newRunPlan() { // newRunPlan() {
this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {}}); // this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {}});
}, // },
// //
handleAutoGenerate() { handleAutoGenerate() {
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} }); this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="PlanSchedule"> <div id="PlanSchedule" v-loading="runplanLoading">
<div class="left"> <div class="left">
<div :id="runPlanId" /> <div :id="runPlanId" />
</div> </div>
@ -8,15 +8,15 @@
ref="serviceTable" ref="serviceTable"
class="data_table_box" class="data_table_box"
:config="serviceNumberConfig" :config="serviceNumberConfig"
@touch="scheduleTouch"
/> />
<!-- @touch="scheduleTouch" -->
<data-table <data-table
ref="tripTable" ref="tripTable"
style="margin-top: 3px;" style="margin-top: 3px;"
class="data_table_box" class="data_table_box"
:config="tripNumberConfig" :config="tripNumberConfig"
@touch="trainNumTouch"
/> />
<!-- @touch="trainNumTouch" -->
</div> </div>
<modify-service ref="modifyService" /> <modify-service ref="modifyService" />
</div> </div>
@ -45,14 +45,6 @@ export default {
type: Object, type: Object,
required: true required: true
}, },
maxWidth: {
type: Number,
required: true
},
maxHeight: {
type: Number,
required: true
},
loadRunPlanId: { loadRunPlanId: {
type: String, type: String,
default() { default() {
@ -74,6 +66,7 @@ export default {
runPlanId: 'plan-tool', runPlanId: 'plan-tool',
myChart: null, myChart: null,
showTrain: false, showTrain: false,
runplanLoading:false,
serviceNumberConfig: { serviceNumberConfig: {
data: [], data: [],
title: this.$t('planMonitor.serviceNumber'), title: this.$t('planMonitor.serviceNumber'),
@ -106,8 +99,8 @@ export default {
} }
] ]
}, },
realData: {}, // realData: {},
kmRangeCoordMap: {}, // kmRangeCoordMap: {},
option: { option: {
title: { // title: { //
text: '', text: '',
@ -227,8 +220,8 @@ export default {
} }
] ]
}, },
absoluteTime: 2 * 3600, // absoluteTime: 2 * 3600,
indexKmRangeMap: {}, // indexKmRangeMap: {},
stationsObj: {} stationsObj: {}
}; };
}, },
@ -238,33 +231,39 @@ export default {
]), ]),
planId() { planId() {
return this.$route.query.planId; return this.$route.query.planId;
},
maxWidth() {
return this.$store.state.app.width;
},
maxHeight() {
return this.$store.state.app.height;
} }
}, },
watch: { watch: {
maxWidth() {
this.setPosition();
},
maxHeight() {
this.setPosition();
},
'$store.state.runPlan.planSizeCount': function () { '$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
}, },
'$store.state.runPlan.refreshCount': function() { '$store.state.runPlan.refreshCount': function() {
this.loadChartPage(); this.loadChartPage();
}, },
$route() { // $route() {
this.$nextTick(() => { // this.$nextTick(() => {
this.loadChartPage(); // this.loadChartPage();
}); // });
}, // },
loadRunPlanId() { loadRunPlanId() {
this.loadChartPage(); this.loadChartPage();
},
'maxWidth':function () {
this.setPosition();
},
'maxHeight':function () {
this.setPosition();
} }
}, },
mounted() { mounted() {
this.setPosition(); this.setPosition();
this.loadChartPage(); // this.loadChartPage();
}, },
beforeDestroy() { beforeDestroy() {
this.destroy(); this.destroy();
@ -363,13 +362,12 @@ export default {
}, },
async analyticalTripNumber(data) { async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {}) this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.map(tripNumber => { return { tripNumber }; }); .map(tripNumber => { return { tripNumber }; });
}, },
async setPosition() { async setPosition() {
this.$nextTick(() => { this.$nextTick(() => {
let top = 3; let top = 3;
const width = this.maxWidth;
let height = this.maxHeight; let height = this.maxHeight;
const titleBar = document.getElementById('PlanTitleBar'); const titleBar = document.getElementById('PlanTitleBar');
@ -394,8 +392,7 @@ export default {
} }
height = height - top; height = height - top;
this.$store.dispatch('runPlan/resize', { width, height }); this.$store.dispatch('runPlan/resize', { width:this.maxWidth, height });
if (this.top != top) { if (this.top != top) {
this.top = top; this.top = top;
} }
@ -418,97 +415,95 @@ export default {
} }
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
this.loadInitChart().then(() => { if (this.$route.query.mapId) {
if (this.$route.query.mapId) { if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
if (/^\/plan\/usertool/.test(this.$route.fullPath)) { this.runplanLoading = true;
this.myChart && this.myChart.showLoading(); getMapDetail(this.$route.query.mapId).then(response => {
getMapDetail(this.$route.query.mapId).then(response => { const res = response.data;
const res = response.data; // this.$store.dispatch('map/setMapData', response.data).then(()=>{
this.$store.dispatch('map/setMapData', response.data).then(()=>{ const stationList = res.stationList.sort((a, b)=>{ return a.kmRange - b.kmRange; });
const stationList = res.stationList.sort((a, b)=>{ return a.kmRange - b.kmRange; }); this.$store.dispatch('runPlan/setStations', stationList).then(() => {
this.$store.dispatch('runPlan/setStations', stationList).then(() => { this.loadInitData();
this.loadInitData(); if (this.planId || this.loadRunPlanId) {
if (this.planId || this.loadRunPlanId) { getRpDetailByUserMapId(this.planId || this.loadRunPlanId).then(rest => {
getRpDetailByUserMapId(this.planId || this.loadRunPlanId).then(rest => { this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => { this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.analyticalServiceNumber(this.$store.state.runPlan.editData); this.loadChartData();
this.loadChartData(); this.runplanLoading = false;
this.myChart && this.myChart.hideLoading();
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}
});
});
});
} else {
loadMapDataById(this.$route.query.mapId);
getStationList(this.$route.query.mapId).then(resp => {
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
this.loadInitData();
if (this.planId || this.loadRunPlanId) {
this.myChart && this.myChart.showLoading();
queryRunPlan(this.planId || this.loadRunPlanId).then(rest => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.loadChartData();
this.myChart && this.myChart.hideLoading();
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
}); });
}).catch(() => {
} else { this.runplanLoading = false;
this.clearCanvas(); this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
} });
}); }
}).catch(() => {
this.$messageBox(this.$t('tip.requestingStationDataFailed'));
this.$store.dispatch('runPlan/setStations', []);
}); });
} // });
// getStationList(this.$route.query.mapId).then(resp => { });
// this.$store.dispatch('runPlan/setStations', resp.data).then(() => { } else {
// this.loadInitData(); this.runplanLoading = true;
// if (this.planId) { // loadMapDataById(this.$route.query.mapId);
// this.myChart && this.myChart.showLoading(); getStationList(this.$route.query.mapId).then(resp => {
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) { this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
// getRpDetailByUserMapId(this.planId).then(rest => { this.loadInitData();
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => { if (this.planId || this.loadRunPlanId) {
// this.analyticalServiceNumber(this.$store.state.runPlan.editData); queryRunPlan(this.planId || this.loadRunPlanId).then(rest => {
// this.loadChartData(); this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
// this.myChart && this.myChart.hideLoading(); this.analyticalServiceNumber(this.$store.state.runPlan.editData);
// }); this.loadChartData();
// }).catch(() => { this.runplanLoading = false;
// this.myChart && this.myChart.hideLoading(); });
// this.$messageBox(this.$t('error.obtainOperationGraphFailed')); }).catch(() => {
// }); this.runplanLoading = false;
// } else { this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
// queryRunPlan(this.planId).then(rest => { });
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
// this.analyticalServiceNumber(this.$store.state.runPlan.editData);
// this.loadChartData();
// this.myChart && this.myChart.hideLoading();
// });
// }).catch(() => {
// this.myChart && this.myChart.hideLoading();
// this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
// });
// }
// } else { } else {
// this.clearCanvas(); this.clearCanvas();
// } }
// }); });
// }).catch(() => { }).catch(() => {
// this.$messageBox(this.$t('tip.requestingStationDataFailed')); this.$messageBox(this.$t('tip.requestingStationDataFailed'));
// this.$store.dispatch('runPlan/setStations', []); this.$store.dispatch('runPlan/setStations', []);
// }); });
} }
}); // getStationList(this.$route.query.mapId).then(resp => {
// this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
// this.loadInitData();
// if (this.planId) {
// this.myChart && this.myChart.showLoading();
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
// getRpDetailByUserMapId(this.planId).then(rest => {
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
// this.analyticalServiceNumber(this.$store.state.runPlan.editData);
// this.loadChartData();
// this.myChart && this.myChart.hideLoading();
// });
// }).catch(() => {
// this.myChart && this.myChart.hideLoading();
// this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
// });
// } else {
// queryRunPlan(this.planId).then(rest => {
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
// this.analyticalServiceNumber(this.$store.state.runPlan.editData);
// this.loadChartData();
// this.myChart && this.myChart.hideLoading();
// });
// }).catch(() => {
// this.myChart && this.myChart.hideLoading();
// this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
// });
// }
// } else {
// this.clearCanvas();
// }
// });
// }).catch(() => {
// this.$messageBox(this.$t('tip.requestingStationDataFailed'));
// this.$store.dispatch('runPlan/setStations', []);
// });
}
}); });
} catch (error) { } catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed')); this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
@ -516,6 +511,7 @@ export default {
}, },
async loadChartData() { async loadChartData() {
try { try {
// let option={};
const stations = this.$store.state.runPlan.stations; const stations = this.$store.state.runPlan.stations;
const planData = this.$store.state.runPlan.planData; const planData = this.$store.state.runPlan.planData;
this.stationsObj = {}; this.stationsObj = {};
@ -526,9 +522,9 @@ export default {
this.viewDisabled = true; this.viewDisabled = true;
this.option.series = []; this.option.series = [];
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations); const kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]); this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' })); this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, kmRangeCoordMap, { width: 0.5, color: '#000' }));
await this.loadInitChart(); await this.loadInitChart();
this.viewDisabled = false; this.viewDisabled = false;
@ -540,7 +536,7 @@ export default {
async loadInitData() { async loadInitData() {
await this.xAxisInit(); await this.xAxisInit();
await this.yAxisInit(); await this.yAxisInit();
await this.loadInitChart(); // await this.loadInitChart();
}, },
pushModels(series, models) { pushModels(series, models) {
if (models && models.length) { if (models && models.length) {
@ -575,6 +571,8 @@ export default {
this.option.title.text = this.mapName; this.option.title.text = this.mapName;
} }
this.myChart = echarts.init(document.getElementById(this.runPlanId)); this.myChart = echarts.init(document.getElementById(this.runPlanId));
// debugger;
// this.option;
this.myChart.setOption(this.option); this.myChart.setOption(this.option);
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
resolve(true); resolve(true);
@ -704,13 +702,13 @@ export default {
this.myChart.dispose(); this.myChart.dispose();
this.myChart = null; this.myChart = null;
} }
},
scheduleTouch() {
},
trainNumTouch() {
} }
// scheduleTouch() {
// },
// trainNumTouch() {
// }
} }
}; };
</script> </script>

View File

@ -24,10 +24,12 @@
</div> </div>
<stations :list="stationList" @select="onSelectStation"> <stations :list="stationList" @select="onSelectStation">
<template slot-scope="{data}"> <template slot-scope="{data}">
<div class="line">公里标{{data.kmRange}}m</div> <article style="font-style:italic;">
<div class="line">中转站{{data.transferable? '是': '否'}}</div> <p class="line">公里标{{data.kmRange}}m</p>
<div class="line">上行容量{{data.upReception}}</div> <p class="line">中转站{{data.transferable? '是': '否'}}</p>
<div class="line">下行容量{{data.downReception}}</div> <p class="line">上行容量{{data.upReception}}</p>
<p class="line">下行容量{{data.downReception}}</p>
</article>
</template> </template>
</stations> </stations>
</el-card> </el-card>

View File

@ -15,6 +15,85 @@ import * as utils from '../../utils'
import echarts from 'echarts'; import echarts from 'echarts';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
const option = {
title: {
text: '',
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '60px',
containLabel: true,
backgroundColor: 'floralwhite'
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: (value, index) => { return timeFormat(value); },
textStyle: {
color: '#333'
}
}
}
],
yAxis: [{
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show:true,
inside:true,
formatter: (value, index) => { return '' }
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
}],
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
show: false,
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}
]
}
export default { export default {
props: { props: {
planUtil: { planUtil: {
@ -45,88 +124,6 @@ export default {
show: false show: false
} }
}, },
computed: {
option() {
return {
title: {
text: this.title,
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '60px',
containLabel: true,
backgroundColor: 'floralwhite'
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: (value, index) => { return timeFormat(value); },
textStyle: {
color: '#333'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show:true,
inside:true,
formatter: (value, index) => { return '' }
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
},
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
show: false,
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}
]
}
}
},
methods: { methods: {
loadInitChart() { loadInitChart() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -136,7 +133,7 @@ export default {
} }
this.myChart = echarts.init(document.getElementById(this.canvasId)); this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, true); this.myChart.setOption(option, true);
this.reSize({ width: this.width, height: this.height }); this.reSize({ width: this.width, height: this.height });
resolve(true); resolve(true);
} catch (error) { } catch (error) {
@ -148,10 +145,12 @@ export default {
try { try {
if (this.myChart) { if (this.myChart) {
this.stations = stations; this.stations = stations;
this.xAxisInit(stations);
this.yAxisInit(stations);
this.myChart.setOption(this.option, true); option.title.text = this.title;
this.xAxisInit(stations, option);
this.yAxisInit(stations, option);
this.myChart.setOption(option, true);
} }
} catch (error) { } catch (error) {
this.$message.info(error.message); this.$message.info(error.message);
@ -176,8 +175,7 @@ export default {
this.$messageBox(error.message); this.$messageBox(error.message);
} }
}, },
xAxisInit(stations) { xAxisInit(stations, option) {
const option = this.option;
const startValue = this.planUtil.MinTime + this.planUtil.TranslationTime; const startValue = this.planUtil.MinTime + this.planUtil.TranslationTime;
const endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime; const endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime;
const list = []; const list = [];
@ -190,13 +188,12 @@ export default {
option.dataZoom[0].startValue = this.planUtil.MinTime + this.planUtil.TranslationTime; option.dataZoom[0].startValue = this.planUtil.MinTime + this.planUtil.TranslationTime;
option.dataZoom[0].endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime; option.dataZoom[0].endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime;
}, },
yAxisInit(stations) { yAxisInit(stations, option) {
const option = this.option;
if (Object.keys(this.planUtil).length) { if (Object.keys(this.planUtil).length) {
this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]); this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]);
option.yAxis.min = this.planUtil.computedYaxisMinValue(stations); option.yAxis[0].min = this.planUtil.computedYaxisMinValue(stations);
option.yAxis.max = this.planUtil.computedYaxisMaxValue(stations); option.yAxis[0].max = this.planUtil.computedYaxisMaxValue(stations);
} }
}, },
reSize({width, height}) { reSize({width, height}) {

View File

@ -16,6 +16,120 @@ import echarts from 'echarts';
import Monitor from './monitor.js'; import Monitor from './monitor.js';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
const option = {
title: {
text: '',
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'cross',
snap: true,
axis: 'x'
},
formatter: null,
borderWidth: 1,
position: function (pt) {
const data = pt[0] + 10;
return [data, '20%'];
}
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: null,
textStyle: {
color: '#333'
}
},
axisPointer: {
label: {
formatter: null,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}],
yAxis: [{
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show: true,
inside: true,
formatter: null
},
axisPointer: {
label: {
formatter: null,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
}],
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
type: 'inside',
zoomOnMouseWheel : true,
moveOnMouseMove : 'ctrl',
},
{
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
rangeMode: 'percent',
labelFormatter: value => { return timeFormat(value); },
bottom: '20px'
}
]
}
export default { export default {
mixins: [Monitor], mixins: [Monitor],
props: { props: {
@ -51,125 +165,6 @@ export default {
planData: [], planData: [],
}; };
}, },
computed: {
option() {
return {
title: {
text: this.title,
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'cross',
snap: true,
axis: 'x'
},
formatter: this.axisTooltip,
borderWidth: 1,
position: function (pt) {
const data = pt[0] + 10;
return [data, '20%'];
}
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: this.xAxisLabelFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show:true,
inside:true,
formatter: this.yAxisLabelFormat
},
axisPointer: {
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
},
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
type: 'inside',
zoomOnMouseWheel : true,
moveOnMouseMove : 'ctrl',
},
{
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
rangeMode: 'percent',
labelFormatter: this.dataZoomFormat,
bottom: '20px'
}
]
}
}
},
watch: { watch: {
width() { width() {
this.reSize({width: this.width, height: this.height}) this.reSize({width: this.width, height: this.height})
@ -197,9 +192,6 @@ export default {
yAxisLabelFormat(value, index) { yAxisLabelFormat(value, index) {
return ''; return '';
}, },
dataZoomFormat(value) {
return timeFormat(value);
},
axisTooltip(param) { axisTooltip(param) {
let data = ''; let data = '';
@ -228,8 +220,15 @@ export default {
this.myChart.clear(); this.myChart.clear();
} }
option.title.text = this.title;
option.tooltip.formatter = this.axisTooltip;
option.xAxis[0].axisLabel.formatter = this.xAxisLabelFormat;
option.xAxis[0].axisPointer.formatter = this.xAxisPointFormat;
option.yAxis[0].axisLabel.formatter = this.yAxisLabelFormat;
option.yAxis[0].axisPointer.formatter = this.yAxisPointFormat;
this.myChart = echarts.init(document.getElementById(this.canvasId)); this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, true); this.myChart.setOption(option, true);
this.reSize({ width: this.width, height: this.height }); this.reSize({ width: this.width, height: this.height });
resolve(true); resolve(true);
} catch (error) { } catch (error) {
@ -240,13 +239,14 @@ export default {
loadChartPage(stations) { loadChartPage(stations) {
try { try {
if (this.myChart) { if (this.myChart) {
this.stations = stations;
this.myChart.showLoading(); this.myChart.showLoading();
this.stations = stations; this.xAxisInit(stations, option);
this.xAxisInit(stations); this.yAxisInit(stations, option);
this.yAxisInit(stations);
this.myChart.setOption(this.option, true); this.myChart.setOption(option, true);
this.myChart.hideLoading(); this.myChart.hideLoading();
} }
} catch (error) { } catch (error) {
@ -307,8 +307,7 @@ export default {
this.$messageBox(error.message); this.$messageBox(error.message);
} }
}, },
xAxisInit(stations) { xAxisInit(stations, option) {
const option = this.option;
const startValue = this.planUtil.MinTime + this.planUtil.TranslationTime; const startValue = this.planUtil.MinTime + this.planUtil.TranslationTime;
const endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime; const endValue = this.planUtil.MaxTime + this.planUtil.TranslationTime;
const list = []; const list = [];
@ -326,13 +325,12 @@ export default {
option.dataZoom[0].endValue = option.dataZoom[1].endValue = endValue; option.dataZoom[0].endValue = option.dataZoom[1].endValue = endValue;
} }
}, },
yAxisInit(stations) { yAxisInit(stations, option) {
const option = this.option;
if (Object.keys(this.planUtil).length) { if (Object.keys(this.planUtil).length) {
this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]); this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]);
option.yAxis.min = this.planUtil.computedYaxisMinValue(stations); option.yAxis[0].min = this.planUtil.computedYaxisMinValue(stations);
option.yAxis.max = this.planUtil.computedYaxisMaxValue(stations); option.yAxis[0].max = this.planUtil.computedYaxisMaxValue(stations);
} }
}, },
reSize({width, height}) { reSize({width, height}) {

View File

@ -120,7 +120,7 @@ export default {
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode); this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
}, },
beforeDestroy() { beforeDestroy() {
this.destroy(); this.destroy(true);
}, },
methods: { methods: {
serviceNumberChange(row) { serviceNumberChange(row) {
@ -146,7 +146,7 @@ export default {
}, },
async analyticalTripNumber(data) { async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {}) this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.map(tripNumber => { return { tripNumber }; }); .map(tripNumber => { return { tripNumber }; });
}, },
async setPosition() { async setPosition() {
@ -334,7 +334,7 @@ export default {
loadInitChart(series, option) { loadInitChart(series, option) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
this.destroy(); this.destroy(false);
let startValue = 3600 + this.PlanConvert.TranslationTime; let startValue = 3600 + this.PlanConvert.TranslationTime;
const offsetTime = 3600; const offsetTime = 3600;
const initTime = toTimeStamp(formatDuring(this.$store.state.training.initTime)); const initTime = toTimeStamp(formatDuring(this.$store.state.training.initTime));
@ -467,7 +467,8 @@ export default {
}); });
} }
}, },
destroy() { destroy(isQuit) {
if (isQuit) { this.PlanConvert = null; }
if (this.myChart && this.myChart.isDisposed) { if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose(); this.myChart.dispose();
this.myChart = null; this.myChart = null;

Binary file not shown.