Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
@ -343,11 +343,12 @@ export function competitionPracticalSceneExit(group) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 退出场景 */
|
||||
export function competitionPracticalSceneFinish(group) {
|
||||
/** 结束场景 */
|
||||
export function competitionPracticalSceneFinish(group, data) {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/finish/${group}`,
|
||||
method: 'PUT'
|
||||
method: 'PUT',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
@ -359,12 +360,3 @@ export function getEmptyOperationalStatistics(group) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交运营数据 */
|
||||
export function submitOperationalStatistics(group, data) {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/detail/os/${group}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
67
src/api/rpTools.js
Normal file
@ -0,0 +1,67 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取运行图数据
|
||||
*/
|
||||
export function getRpTools() {
|
||||
return request({
|
||||
url: '/api/rpTools',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加车次
|
||||
*/
|
||||
export function addRpTrip(data) {
|
||||
return request({
|
||||
url: '/api/rpTools/trip',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改到站时间
|
||||
*/
|
||||
export function justTripNoArrival(tripNo, data) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/arrival`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改发车时间
|
||||
*/
|
||||
export function justTripNoDeparture(tripNo, data) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/departure`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 平移车次
|
||||
*/
|
||||
export function translateTripNo(tripNo, data) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/trip`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除车次
|
||||
*/
|
||||
export function deleteTripNo(tripNo) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/trip`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.4 KiB |
BIN
src/assets/yuyin.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
@ -333,8 +333,13 @@ export function JLmap3dEdit(dom, data, mapid) {
|
||||
plane2.stopType = "right";
|
||||
plane1.rotation.y = Math.PI/2;
|
||||
plane2.rotation.y = Math.PI/2;
|
||||
plane1.position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].leftStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||
plane2.position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].rightStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||
let leftpos = scope.mapdata.sectionlist.sections.datalist[k].leftStopPercent*(scope.mapdata.sectionlist.sections.datalist[k].railpoint[2].x -scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x)+scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x;
|
||||
let rightpos = scope.mapdata.sectionlist.sections.datalist[k].rightStopPercent*(scope.mapdata.sectionlist.sections.datalist[k].railpoint[2].x -scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x)+scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x;
|
||||
console.log("==========");
|
||||
console.log(scope.mapdata.sectionlist.sections.datalist[k].leftStopPercent);
|
||||
console.log(scope.mapdata.sectionlist.sections.datalist[k].rightStopPercent);
|
||||
plane1.position.set(leftpos,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||
plane2.position.set(rightpos,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||
stationStopGroup.add(plane1);
|
||||
stationStopGroup.add(plane2);
|
||||
}
|
||||
|
@ -989,7 +989,7 @@ export function SectionList() {
|
||||
|
||||
|
||||
}
|
||||
console.log(scope.sections.datalist);
|
||||
|
||||
for(let i=0;i<section2d.length;i++){
|
||||
if(section2d[i].type == "01" || section2d[i].type == "03"){
|
||||
if(scope.sections.datalist[section2d[i].code]){
|
||||
@ -1003,9 +1003,11 @@ export function SectionList() {
|
||||
scope.sections.datalist[section2d[i].code].standLeftY = section2d[i].points[0].y;
|
||||
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
|
||||
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
|
||||
|
||||
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
|
||||
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+120;
|
||||
|
||||
scope.sections.datalist[section2d[i].code].leftStopPercent = section2d[i].leftStopPointOffset/section2d[i].lengthFact;
|
||||
scope.sections.datalist[section2d[i].code].rightStopPercent = section2d[i].rightStopPointOffset/section2d[i].lengthFact;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
||||
|
||||
renderer.setClearColor(new THREE.Color(0x000000));
|
||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
|
||||
renderer.sortObjects = true;
|
||||
windowWidth = dom.offsetWidth ;
|
||||
windowHeight = dom.offsetHeight;
|
||||
|
||||
@ -1307,6 +1307,13 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
||||
|
||||
fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
|
||||
object.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 8;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
toptrain = object.clone(true);
|
||||
@ -1452,6 +1459,13 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
||||
}
|
||||
}
|
||||
station = object;
|
||||
object.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
// console.log(deviceaction);
|
||||
scene.add(object);
|
||||
|
||||
|
@ -84,7 +84,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
}
|
||||
}
|
||||
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,3);
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,1.3);
|
||||
// assetloader.setmodellistnew(netdata.assets);
|
||||
|
||||
|
||||
|
@ -504,7 +504,9 @@ class Jlmap {
|
||||
} else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) {
|
||||
store.state.map.map.directionRodList.forEach(item => {
|
||||
if (elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) {
|
||||
this.$painter.update(elem);
|
||||
const updateRod = this.mapDevice[item.code];
|
||||
updateRod.reversed = elem.reversed;
|
||||
this.$painter.update(updateRod);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ export default class DirectionRod extends Group {
|
||||
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
if (!stationCode || this.model.deviceStationCode === stationCode) {
|
||||
this.isShowShape = true;
|
||||
this.showMode();
|
||||
} else {
|
||||
|
@ -23,34 +23,34 @@ export default class ELimitLines extends Group {
|
||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||
if (x == Infinity) { x = 0; }
|
||||
if (y == Infinity) { y = 0; }
|
||||
if (model.switch) {
|
||||
// 上侧临时限速线
|
||||
const speedLimitLeft = this.createLimit({
|
||||
position: [x, -y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
// if (model.switch) {
|
||||
// 上侧临时限速线
|
||||
const speedLimitLeft = this.createLimit({
|
||||
position: [x, -y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
// 下侧临时限速线
|
||||
const speedLimitRight = this.createLimit({
|
||||
position: [-x, y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
speedLimitLeft.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
speedLimitRight.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
}
|
||||
const speedLimitRight = this.createLimit({
|
||||
position: [-x, y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
speedLimitLeft.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
speedLimitRight.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
129
src/jmapNew/theme/aus_00/planConvert.js
Normal file
@ -0,0 +1,129 @@
|
||||
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
/** 边缘高度*/
|
||||
EdgeHeight: 600,
|
||||
|
||||
/** 间隔高度*/
|
||||
CoordMultiple: 1,
|
||||
|
||||
/** 偏移时间*/
|
||||
TranslationTime: 0,
|
||||
|
||||
/** 将后台数据解析成图表*/
|
||||
convertDataToModels(tripList, stations, kmRangeCoordMap, lineStyle) {
|
||||
var models = [];
|
||||
/** 按车次遍历数据*/
|
||||
if (tripList && tripList.length) {
|
||||
tripList.forEach(trip => {
|
||||
const opt = { name: `run-${trip.tripNo}`, type: 'line', markPoint: { data: [] }, data: []};
|
||||
|
||||
if (trip.tripNo &&
|
||||
trip.stationTimeList.length) {
|
||||
opt.markPoint.data.push(createMartPointReverse({
|
||||
name: `${trip.tripNo}`,
|
||||
color: '#000' || lineStyle.color,
|
||||
coord: [
|
||||
trip.stationTimeList[0].arrivalTime,
|
||||
this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
|
||||
]
|
||||
}));
|
||||
}
|
||||
|
||||
/** 计算停站点坐标集合*/
|
||||
trip.stationTimeList.forEach(elem => {
|
||||
if (elem.arrivalTime) {
|
||||
opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
|
||||
}
|
||||
|
||||
if (elem.departureTime) {
|
||||
opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
|
||||
}
|
||||
});
|
||||
|
||||
models.push(opt);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(models);
|
||||
|
||||
return models;
|
||||
},
|
||||
|
||||
/** 更新数据并解析成图表*/
|
||||
updateDataToModels(tripList, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||
if (tripList && tripList.length) {
|
||||
}
|
||||
return series;
|
||||
},
|
||||
|
||||
/** 初始化Y轴*/
|
||||
initializeYaxis(stations) {
|
||||
return createMarkLineModels(stations, (elem) => {
|
||||
return this.EdgeHeight + elem.kmRange * this.CoordMultiple;
|
||||
});
|
||||
},
|
||||
|
||||
/** 将后台数据转换为试图序列模型*/
|
||||
convertStationsToMap(stations) {
|
||||
var map = {};
|
||||
if (stations && stations.length) {
|
||||
stations.forEach((elem) => {
|
||||
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple;
|
||||
});
|
||||
}
|
||||
|
||||
return map;
|
||||
},
|
||||
|
||||
/** 计算y轴最小值*/
|
||||
computedYaxisMinValue(stations) {
|
||||
return stations[0].kmRange * this.CoordMultiple;
|
||||
},
|
||||
|
||||
/** 计算y轴最大值*/
|
||||
computedYaxisMaxValue(stations) {
|
||||
return stations[stations.length - 1].kmRange * this.CoordMultiple + this.EdgeHeight * 2;
|
||||
},
|
||||
|
||||
/** 格式化y轴数据*/
|
||||
computedFormatYAxis(stations, params) {
|
||||
var yText = '0m';
|
||||
|
||||
stations.forEach(elem => {
|
||||
if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) {
|
||||
yText = Math.floor(elem.kmRange) + 'm';
|
||||
}
|
||||
});
|
||||
|
||||
return yText;
|
||||
},
|
||||
|
||||
/** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/
|
||||
computedReentryNumber(code) {
|
||||
// return parseInt(code || 1) % 2 ? 1 : 2;
|
||||
return 1;
|
||||
},
|
||||
|
||||
/** 根据方向计算y折返偏移量*/
|
||||
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
|
||||
if (directionCode === '1') {
|
||||
defaultVlue += this.EdgeHeight / 2 * num;
|
||||
} else if (directionCode === '2') {
|
||||
defaultVlue -= this.EdgeHeight / 2 * num;
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
},
|
||||
|
||||
/** 根据elem计算y值*/
|
||||
getCoordYByElem(stations, kmRangeCoordMap, elem) {
|
||||
var defaultVlue = 0;
|
||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||
if (station) {
|
||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
}
|
||||
};
|
@ -2,6 +2,7 @@ class Theme {
|
||||
constructor(code) {
|
||||
this._code = '02';
|
||||
this._mapMenu = {
|
||||
'00': 'aus_00',
|
||||
'01': 'chengdu_01',
|
||||
'02': 'fuzhou_01',
|
||||
'03': 'beijing_01',
|
||||
|
@ -86,6 +86,7 @@ const DemonstrationDetail = () => import('@/views/demonstration/detail/index');
|
||||
|
||||
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
|
||||
const PlanMonitorEditUserTool = () => import('@/views/planMonitor/editTool/userindex');
|
||||
const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/index');
|
||||
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
|
||||
|
||||
const DesignPlatformHome = () => import('@/views/designPlatform/home');
|
||||
@ -369,12 +370,17 @@ export const publicAsyncRoute = [
|
||||
path: '/plan/usertool',
|
||||
component: PlanMonitorEditUserTool,
|
||||
hidden: true
|
||||
},
|
||||
{ // 运行图编辑
|
||||
path: '/plan/AUStool',
|
||||
component: PlanMonitorEditAUSTool,
|
||||
hidden: true
|
||||
},
|
||||
{ // 运行图编辑
|
||||
path: '/plan/tool',
|
||||
component: PlanMonitorEditTool,
|
||||
hidden: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/displayIscs/system',
|
||||
component: IscsSystem,
|
||||
|
@ -128,7 +128,9 @@ export const DeviceMenu = {
|
||||
SetDriver: '106',
|
||||
Script: '107',
|
||||
IscsSystem: '108',
|
||||
IscsInterface: '109'
|
||||
IscsInterface: '109',
|
||||
|
||||
planAusContextMenu: '200'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -16,6 +16,7 @@ import scriptRecord from './modules/scriptRecord';
|
||||
import ibp from './modules/ibp';
|
||||
import order from './modules/order';
|
||||
import iscs from './modules/iscs';
|
||||
import rpTools from './modules/rpTools';
|
||||
|
||||
import getters from './getters';
|
||||
|
||||
@ -38,7 +39,8 @@ const store = new Vuex.Store({
|
||||
scriptRecord,
|
||||
ibp,
|
||||
order,
|
||||
iscs
|
||||
iscs,
|
||||
rpTools
|
||||
},
|
||||
getters
|
||||
});
|
||||
|
93
src/store/modules/rpTools.js
Normal file
@ -0,0 +1,93 @@
|
||||
const runPlan = {
|
||||
namespaced: true,
|
||||
|
||||
state: {
|
||||
stations: [], // 车站列表
|
||||
planData: {}, // 运行图原始数据
|
||||
editData: {}, // 运行图编辑数据
|
||||
planSizeCount: 0, // 运行图canvas 大小变更标识
|
||||
planLoadedCount: 0, // 运行图数据更新
|
||||
planUpdateCount: 0, // 运行图更新标识
|
||||
selected: {}, // 选择的对象
|
||||
refreshCount: 0, // 刷新页面重新加载
|
||||
width: 800, // 运行图canvas 容器 宽度
|
||||
height: 600, // 运行图canvas 容器 高度
|
||||
},
|
||||
getters: {
|
||||
stations: (state) => {
|
||||
return state.stations || [];
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
setWidth: (state, width) => {
|
||||
state.width = width;
|
||||
state.planSizeCount += 1;
|
||||
},
|
||||
setHeight: (state, height) => {
|
||||
state.height = height;
|
||||
state.planSizeCount += 1;
|
||||
},
|
||||
setStations: (state, stations) => {
|
||||
state.stations = stations;
|
||||
},
|
||||
setPlanData: (state, data) => {
|
||||
state.planData = data;
|
||||
state.editData = {};
|
||||
state.planLoadedCount++;
|
||||
},
|
||||
setSelected: (state, selected) => {
|
||||
state.selected = selected;
|
||||
},
|
||||
clear: (state) => {
|
||||
state.planData = {};
|
||||
state.editData = {};
|
||||
state.selected = {};
|
||||
},
|
||||
refresh: (state) => {
|
||||
state.refreshCount++;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/** 设置运行图大小*/
|
||||
resize({ commit }, opt) {
|
||||
if (opt.width) {
|
||||
commit('setWidth', opt.width);
|
||||
}
|
||||
if (opt.height) {
|
||||
commit('setHeight', opt.height);
|
||||
}
|
||||
},
|
||||
/** 设置stations数据 */
|
||||
setStations: ({ commit }, mapModel) => {
|
||||
return new Promise((resolve) => {
|
||||
commit('setStations', mapModel);
|
||||
resolve(mapModel);
|
||||
});
|
||||
},
|
||||
/** 设置运行图数据 */
|
||||
setPlanData: ({ commit }, data) => {
|
||||
commit('setPlanData', data);
|
||||
},
|
||||
/** 选择车次*/
|
||||
setSelected: ({ commit }, selected) => {
|
||||
commit('setSelected', selected);
|
||||
},
|
||||
/** 更新数据*/
|
||||
updateRunPlanData: ({ commit }, data) => {
|
||||
commit('updateRunPlanData', data);
|
||||
},
|
||||
/** 清空数据*/
|
||||
clear: ({ commit }) => {
|
||||
return new Promise((resolve) => {
|
||||
commit('clear');
|
||||
resolve();
|
||||
});
|
||||
},
|
||||
/** 刷新页面*/
|
||||
refresh: ({commit}) => {
|
||||
commit('refresh');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default runPlan;
|
@ -2,8 +2,8 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
|
@ -62,7 +62,7 @@ export default {
|
||||
this.height = 900;
|
||||
} else if (this.mode == 'environmentSix') {
|
||||
this.title = this.stationName + ' 冷水系统 原理图';
|
||||
this.scaleRate = window.innerWidth / 1920;
|
||||
this.scaleRate = window.innerWidth / 2000;
|
||||
this.height = 900;
|
||||
} else if (this.mode == 'environmentSeven') {
|
||||
this.title = this.stationName + ' 多联空调 原理图';
|
||||
|
@ -46,10 +46,10 @@
|
||||
<div v-for="(item, index) in treeData" :key="index" class="proper_box">
|
||||
<div class="proper_title">{{ item.label }}</div>
|
||||
<div v-for="(data, i) in item.children" :key="i" style="position: relative; width: 73px; heigth: 73px; margin-left: 5px; float: left;">
|
||||
<div v-if="data.show && item.id == 'driver'" class="proper_content_box" :class="{'active': data.active,'isInviting':data.isInviting}" @click="handleCheckChange(data)">
|
||||
<div v-if="data.show && item.id == 'driver'" :id="'proper_content_box'+data.id" class="proper_content_box" :class="{'active': data.active,'isInviting':data.isInviting}" @click="handleCheckChange(data)">
|
||||
<span class="proper_content_box_text">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</span>
|
||||
</div>
|
||||
<div v-if="item.id != 'driver'" class="proper_content_box" :class="{'active':data.active,'isInviting':data.isInviting}" @click="handleCheckChange(data)">
|
||||
<div v-if="item.id != 'driver'" :id="'proper_content_box'+data.id" class="proper_content_box" :class="{'active':data.active,'isInviting':data.isInviting}" @click="handleCheckChange(data)">
|
||||
<span class="proper_content_box_text">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</span>
|
||||
</div>
|
||||
<div v-if="data.loading" class="mask_loading">
|
||||
@ -284,6 +284,8 @@ export default {
|
||||
// && item.children.length
|
||||
if (item.children && item.children[val.creatorId]) {
|
||||
item.children[val.creatorId].isInviting = true;
|
||||
const offsetTop = document.getElementById('proper_content_box' + val.creatorId).parentNode.offsetTop;
|
||||
document.querySelector('.chat-box-content').scrollTop = (offsetTop - 40) > 0 ? (offsetTop - 80) : 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -298,17 +300,6 @@ export default {
|
||||
this.filterNode();
|
||||
if (activeTrainList.length <= 0) {
|
||||
this.resetCoversition();
|
||||
this.treeData.forEach(item => {
|
||||
if (item.children) {
|
||||
const memberList = Object.values(item.children);
|
||||
memberList.forEach(data =>{
|
||||
data.active = false;
|
||||
data.isConnect = false;
|
||||
data.loading = false;
|
||||
data.disabled = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// if (this.$refs.tree) {
|
||||
// this.$refs.tree.filter(this.queryMember);
|
||||
@ -939,6 +930,18 @@ export default {
|
||||
this.commonMessageList = [];
|
||||
this.conversitionStateMap = {};
|
||||
this.messageList = this.commonMessageList;
|
||||
this.treeData.forEach(item => {
|
||||
if (item.children) {
|
||||
const memberList = Object.values(item.children);
|
||||
memberList.forEach(data =>{
|
||||
data.active = false;
|
||||
data.isConnect = false;
|
||||
data.loading = false;
|
||||
data.disabled = false;
|
||||
data.isInviting = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -9,8 +9,9 @@
|
||||
</div>
|
||||
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
||||
<div class="userMessage">
|
||||
<span class="el-icon-video-play playicon" />
|
||||
<span class="messageText">{{ chatContent.content }}</span>
|
||||
<!-- <span class="el-icon-video-play playicon" /> -->
|
||||
<img :src="yuyin" alt="playicon1">
|
||||
<!-- <span class="messageText">{{ chatContent.content }}</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<audio id="audioPlay" style="display:none" />
|
||||
@ -20,7 +21,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import yuyin from '@/assets/yuyin.png';
|
||||
export default {
|
||||
props:{
|
||||
messageList:{
|
||||
@ -68,6 +69,7 @@ export default {
|
||||
return {
|
||||
chatContentList:[],
|
||||
currentAudioList:[],
|
||||
yuyin:yuyin,
|
||||
currentAudioIndex:0,
|
||||
isPlay:false,
|
||||
baseUrl:process.env.VUE_APP_VOICE_API
|
||||
@ -176,9 +178,11 @@ export default {
|
||||
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
|
||||
.userChatTime{font-size: 12px;display:inline-block;}
|
||||
.userBubble{
|
||||
max-width: 200px;
|
||||
font-size: 12px;
|
||||
padding: 10px;
|
||||
// max-width: 200px;
|
||||
// padding: 10px;
|
||||
padding: 5px 10px 6px 10px;
|
||||
width: 140px;
|
||||
background: #ccc;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
@ -188,6 +192,9 @@ export default {
|
||||
font-size: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.playicon1{
|
||||
width:17px;
|
||||
}
|
||||
.textRight{text-align: right;}
|
||||
.userMessage{}
|
||||
.messageText{line-height: 20px;}
|
||||
|
@ -73,7 +73,7 @@
|
||||
<throry-result ref="theoryResult" @restart="goTheoryQuiz" /> -->
|
||||
<select-role ref="selectRole" :member-list="currentPlayList" @selectRole="selectRole" />
|
||||
|
||||
<operational-statistic ref="operationalStatistic" />
|
||||
<operational-statistic ref="operationalStatistic" @finishTraining="finishTraining" />
|
||||
|
||||
</div>
|
||||
|
||||
@ -395,6 +395,7 @@ export default {
|
||||
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {});
|
||||
this.quitQuest();
|
||||
// this.initLoadPage();
|
||||
this.isScriptRun = false;
|
||||
this.clearAllData();
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||
}).catch(()=>{
|
||||
@ -462,8 +463,11 @@ export default {
|
||||
(this.$store.state.training.memberData[role.id] || {}).disabled = true;
|
||||
this.runScriptMode(memberId);
|
||||
},
|
||||
finishTraining() {
|
||||
this.isScriptRun = false;
|
||||
},
|
||||
endTraining() {
|
||||
competitionPracticalSceneFinish(this.group).then(res=>{
|
||||
competitionPracticalSceneFinish(this.group, {operationStatisticVO:{}}).then(res=>{
|
||||
this.isScriptRun = false;
|
||||
// if (this.scriptMode == ScriptMode.TEST) {
|
||||
this.formatScore = res.data;
|
||||
|
@ -3,23 +3,22 @@
|
||||
title="提交运营统计数据"
|
||||
:visible.sync="dialogShow"
|
||||
top="50px"
|
||||
width="400px"
|
||||
width="500px"
|
||||
:before-do-close="roleDoClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-for="(item,index) in resultData.itemVOS" :key="index" style="margin-top:10px;">
|
||||
<span style="margin-left: 20px;">{{ item.description+':' }}</span>
|
||||
<span class="itemDescription">{{ item.description+':' }}</span>
|
||||
<el-time-picker
|
||||
v-if="item.type=='Time'"
|
||||
v-model="dataList[index]"
|
||||
value-format="HH:mm"
|
||||
format="HH:mm"
|
||||
size="small"
|
||||
style="width:200px;display:inline-block;"
|
||||
:placeholder="item.description"
|
||||
class="itemFormItem"
|
||||
@change="((val)=>{changeData(val,index)}) "
|
||||
/>
|
||||
<el-input v-if="item.type=='Non_Time'" v-model="dataList[index]" type="text" :style="{width: '125px'}" size="small" :maxlength="100" @change="((val)=>{changeNoTimeData(val,index)}) " />
|
||||
<el-input v-if="item.type=='Non_Time'" v-model="dataList[index]" type="text" class="itemFormItem" size="small" :maxlength="100" @change="((val)=>{changeNoTimeData(val,index)}) " />
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@ -29,7 +28,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { submitOperationalStatistics} from '@/api/competition';
|
||||
import { competitionPracticalSceneFinish} from '@/api/competition';
|
||||
export default {
|
||||
name:'OperationalStatistics',
|
||||
data() {
|
||||
@ -77,8 +76,11 @@ export default {
|
||||
if (!result) {
|
||||
this.$messageBox('请填写表单');
|
||||
} else {
|
||||
submitOperationalStatistics(this.$route.query.group, this.resultData).then(res=>{
|
||||
competitionPracticalSceneFinish(this.$route.query.group, this.resultData).then(res=>{
|
||||
this.$message.success('运营统计数据提交成功');
|
||||
this.formatScore = res.data;
|
||||
this.$messageBox('得分:' + this.formatScore);
|
||||
this.$emit('finishTraining');
|
||||
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS);
|
||||
this.dialogShow = false;
|
||||
}).catch(error=>{
|
||||
@ -95,3 +97,17 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.itemDescription{
|
||||
margin-left: 20px;
|
||||
width:180px;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.itemFormItem{
|
||||
width:200px;
|
||||
display:inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="800px" center>
|
||||
<el-tabs v-model="activeName" type="card" style="height: 450px;">
|
||||
<el-tabs v-model="activeName" type="card" style="height: 500px;">
|
||||
<el-tab-pane label="主场景列表" name="first">
|
||||
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" stripe :cell-style="{padding: '8px 0'}">
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
|
@ -246,6 +246,8 @@ function covertOperation(deviceType, operationParamMap, operationType) {
|
||||
if (device.parentCode && device.type == '02') {
|
||||
const parentSection = store.getters['map/getDeviceByCode'](device.parentCode);
|
||||
deviceName += '【' + operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name + '】';
|
||||
} else {
|
||||
deviceName += '【' + operateEnum[deviceType].type + device.name + '】';
|
||||
}
|
||||
} else {
|
||||
let deviceNameIn = '';
|
||||
|
90
src/views/planMonitor/editToolAUS/contextMenu.vue
Normal file
@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="popMenuClass" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { Notification } from 'element-ui';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { deleteTripNo, justTripNoArrival, justTripNoDeparture} from '@/api/rpTools';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
tripNo: {
|
||||
type: [String, Number]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [
|
||||
{
|
||||
label: '调整起始时间',
|
||||
handler: this.doJustBeginTime,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: '调整停站时间',
|
||||
handler: this.doJustStopTime,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
handler: this.doDeleteTrip,
|
||||
disabled: false
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planAusContextMenu)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
doDeleteTrip() {
|
||||
if (this.tripNo) {
|
||||
deleteTripNo(this.tripNo).then(resp => {
|
||||
this.$emit('reload')
|
||||
}).catch(error => {
|
||||
this.$message.error('delete error');
|
||||
})
|
||||
}
|
||||
},
|
||||
doJustBeginTime() {
|
||||
},
|
||||
doJustStopTime() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.popMenuClass{
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
392
src/views/planMonitor/editToolAUS/index.vue
Normal file
@ -0,0 +1,392 @@
|
||||
<template>
|
||||
<div class="plan-tool">
|
||||
<schedule
|
||||
ref="schedule"
|
||||
:line-code="lineCode"
|
||||
:plan-convert="PlanConvert"
|
||||
:max-height="height"
|
||||
:max-width="width"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Schedule from './schedule';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Schedule
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
PlanConvert: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
lineCode() {
|
||||
return '00';
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 60;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
|
||||
},
|
||||
methods: {
|
||||
setPosition() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.schedule.setPosition();
|
||||
});
|
||||
},
|
||||
dispatchDialog(dialogObj) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs[dialogObj.name]) {
|
||||
this.$refs[dialogObj.name].doShow(dialogObj.params);
|
||||
}
|
||||
});
|
||||
},
|
||||
dispatchOperate(operateObj) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs[operateObj.dialogName]) {
|
||||
this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.plan-tool {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.plan-tool .pop-menu {
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.plan-tool .pop-menu span {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.plan-tool .system-close {
|
||||
cursor: pointer;
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid white;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.plan-tool .system-close::before {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
.planEdit__tool {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* .planEdit__tool .el-dialog {
|
||||
overflow: hidden !important;
|
||||
background: rgba(202, 221, 253, 0.88);;
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
border: 2px solid #727375;
|
||||
border-radius: 4px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__header {
|
||||
height: 30px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__footer {
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin: 0px 3px 3px 3px;
|
||||
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn {
|
||||
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid white;
|
||||
border-radius: 4px;
|
||||
top: 0px;
|
||||
right: 3px;
|
||||
line-height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--top {
|
||||
border: 2px outset #FEFEFD;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs__item {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
color: #000 !important;
|
||||
border-right: 2px outset #fff;
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tab-pane {
|
||||
margin: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
||||
border-bottom: none
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item:not(.is-active) {
|
||||
border-bottom: 2px inset #fff
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-card {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0px;
|
||||
width: 80px;
|
||||
border: 2px outset #E2E2E2;
|
||||
border-radius: 0px !important;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .expand {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:focus span {
|
||||
border: 1px dashed gray;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:active {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled span {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input {
|
||||
border: 2px inset #E9E9E9;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input .el-input__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input.is-disabled .el-input__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea {
|
||||
border: 2px inset #E9E9E9;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea .el-textarea__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea.is-disabled .el-textarea__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table {
|
||||
border: 2px inset #E9E9E9;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .cell {
|
||||
line-height: unset !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table th.is-leaf {
|
||||
background: #ECE9D8 !important;
|
||||
border-right: 1px solid #BDBDBD !important;
|
||||
border-bottom: 1px solid #BDBDBD !important;
|
||||
color: #000 !important;
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table tr td {
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .el-table__empty-text {
|
||||
top: 15px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .current-row>td {
|
||||
background: #316AC5 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
||||
position: absolute;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
content: "";
|
||||
border: 1px solid #000;
|
||||
border-left: 0;
|
||||
border-top: 0;
|
||||
height: 7px;
|
||||
left: 4px;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 100%;
|
||||
background-color: #000 !important;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -15px;
|
||||
top: -18px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form-item label {
|
||||
font-weight: normal !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .context {
|
||||
height: 100px;
|
||||
border: 2px inset #E2E2E2;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .notice {
|
||||
margin-left: 62px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tree__empty-block {
|
||||
background: #E9E9E9 !important;
|
||||
color: #000 !important;
|
||||
} */
|
||||
</style>
|
160
src/views/planMonitor/editToolAUS/monitor.js
Normal file
@ -0,0 +1,160 @@
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isDragging: false,
|
||||
createModel: {
|
||||
endStationCode: '',
|
||||
startStationCode: '',
|
||||
startTime: {
|
||||
hour: '',
|
||||
minute: '',
|
||||
second: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
myChart: function() {
|
||||
this.listenersBind();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.listenersOff();
|
||||
},
|
||||
methods: {
|
||||
getStationByCoord(stations, y) {
|
||||
for(var i = stations.length-1; i >= 0; i--) {
|
||||
const station = stations[i];
|
||||
if (station.kmRange <= y) {
|
||||
return station;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
pixelExecCb(e, cb) {
|
||||
let myChart = this.myChart;
|
||||
let pointInPixel= [e.offsetX, e.offsetY];
|
||||
if (myChart.containPixel('grid', pointInPixel) && this.planConvert) {
|
||||
let pointInGrid = myChart.convertFromPixel({seriesIndex:0},pointInPixel);
|
||||
let xIndex = pointInGrid[0];
|
||||
let yIndex = pointInGrid[1];
|
||||
let op = myChart.getOption();
|
||||
let minY = op.yAxis[0].min;
|
||||
let xVal = op.xAxis[0].data[xIndex];
|
||||
let edgeOffset = this.planConvert.EdgeHeight/6;
|
||||
let yObj = this.getStationByCoord(this.stations, yIndex-minY-edgeOffset);
|
||||
if (yObj && cb) {
|
||||
cb(yObj, xVal, pointInPixel);
|
||||
}
|
||||
}
|
||||
},
|
||||
listenersBind() {
|
||||
if (this.myChart) {
|
||||
const zr = this.myChart.getZr();
|
||||
zr.on('click', this.onClick, this)
|
||||
zr.on('contextmenu', this.onContextMenu, this);
|
||||
this.myChart.on('mousedown', this.onDragStart);
|
||||
this.myChart.on('mouseup', this.onDragEnd);
|
||||
this.myChart.on('click', 'series', this.onSelect);
|
||||
this.myChart.on('datazoom', this.onClearMarks);
|
||||
}
|
||||
},
|
||||
listenersOff() {
|
||||
if (this.myChart) {
|
||||
const zr = this.myChart.getZr();
|
||||
zr.off('click', this.onClick);
|
||||
zr.off('contextmenu', this.onContextMenu);
|
||||
this.myChart.off('mousedown', this.onDragStart);
|
||||
this.myChart.off('mouseup', this.onDragEnd);
|
||||
this.myChart.off('click', 'series', this.onSelect);
|
||||
this.myChart.off('datazoom', this.onClearMarks);
|
||||
}
|
||||
},
|
||||
onClick(e) {
|
||||
this.pixelExecCb(e, this.handleMarkPoint)
|
||||
},
|
||||
onContextMenu(e) {
|
||||
console.log(e, 'onContextMenu');
|
||||
this.onClearMarks();
|
||||
if(e.target) {
|
||||
const event = e.event;
|
||||
const point = {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
}
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planAusContextMenu });
|
||||
} else {
|
||||
this.$message.info('No train number selected')
|
||||
}
|
||||
},
|
||||
onClearMarks() {
|
||||
if (this.myChart) {
|
||||
let op = this.myChart.getOption();
|
||||
op.graphic[0].elements = [];
|
||||
this.myChart.setOption(op, {notMerge: true})
|
||||
}
|
||||
},
|
||||
onSelect(e) {
|
||||
console.log(e, 'select')
|
||||
},
|
||||
onDragStart(e) {
|
||||
console.log(e, 'dragStart');
|
||||
},
|
||||
onDragEnd(e) {
|
||||
console.log(e, 'dragEnd');
|
||||
},
|
||||
createMarkPoint(point, text) {
|
||||
return {
|
||||
type: 'group',
|
||||
z: 100,
|
||||
children: [
|
||||
{
|
||||
type: 'circle',
|
||||
z: 100,
|
||||
shape: {
|
||||
cx: point[0],
|
||||
cy: point[1],
|
||||
r: 5
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0,0,0,0.3)'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'circle',
|
||||
z: 100,
|
||||
shape: {
|
||||
cx: point[0],
|
||||
cy: point[1],
|
||||
r: 10
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0,0,0,0.3)'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
handleMarkPoint(yObj, xVal, pointInPixel) {
|
||||
let myChart = this.myChart;
|
||||
if (myChart) {
|
||||
let op = myChart.getOption();
|
||||
let graphic = op.graphic[0];
|
||||
if (graphic) {
|
||||
graphic.elements.push(this.createMarkPoint(pointInPixel, 'hello world'))
|
||||
myChart.setOption(op);
|
||||
if (graphic.elements.length == 1) {
|
||||
this.createModel.startStationCode = yObj.code;
|
||||
this.createModel.startTime = timeFormat(xVal);
|
||||
} else if (graphic.elements.length >= 2) {
|
||||
this.createModel.endStationCode = yObj.code;
|
||||
this.createRpTrip(this.createModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
599
src/views/planMonitor/editToolAUS/schedule.vue
Normal file
@ -0,0 +1,599 @@
|
||||
<template>
|
||||
<div id="PlanSchedule">
|
||||
<div class="left">
|
||||
<div :id="runPlanId" />
|
||||
<context-menu :tripNo="tripNo" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Monitor from './monitor.js';
|
||||
import ContextMenu from './contextMenu.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getRpTools, addRpTrip } from '@/api/rpTools';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
planConvert: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
maxWidth: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
maxHeight: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
loadRunPlanName: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins: [Monitor],
|
||||
components: {
|
||||
ContextMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
top: 0,
|
||||
height: 0,
|
||||
mapName: 'XXX',
|
||||
runPlanId: 'plan-tool',
|
||||
myChart: null,
|
||||
showTrain: false,
|
||||
tripNo: '',
|
||||
serviceNumberConfig: {
|
||||
data: [],
|
||||
title: this.$t('planMonitor.serviceNumber'),
|
||||
showHeader: false,
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.serviceNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'serviceNumber',
|
||||
label: this.$t('planMonitor.serviceNumber')
|
||||
}
|
||||
]
|
||||
},
|
||||
tripNumberConfig: {
|
||||
data: [],
|
||||
title: this.$t('planMonitor.tripNumber'),
|
||||
showHeader: false,
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.tripNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'tripNumber',
|
||||
label: this.$t('planMonitor.tripNumber')
|
||||
}
|
||||
]
|
||||
},
|
||||
realData: {},
|
||||
kmRangeCoordMap: {},
|
||||
option: {
|
||||
title: {
|
||||
text: '',
|
||||
left: 'center',
|
||||
top: '10px'
|
||||
},
|
||||
grid: {
|
||||
top: '60px',
|
||||
left: '160px',
|
||||
right: '100px',
|
||||
bottom: '80px',
|
||||
containLabel: true,
|
||||
backgroundColor: 'floralwhite'
|
||||
},
|
||||
toolbox: {
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
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.xAxisLableFormat,
|
||||
textStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
axisPointer: {
|
||||
snap: true,
|
||||
label: {
|
||||
formatter: this.xAxisPointFormat,
|
||||
backgroundColor: 'rgb(255,0,0,0.5)',
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
onZero: false,
|
||||
lineStyle: {
|
||||
width: 1
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
graphic: [{
|
||||
id: 'static',
|
||||
elements: []
|
||||
}],
|
||||
markPoint: [{
|
||||
id: 'mark',
|
||||
data: []
|
||||
}],
|
||||
series: [],
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
zoomOnMouseWheel : 'ctrl',
|
||||
moveOnMouseMove : 'ctrl',
|
||||
moveOnMouseWheel: 'ctrl'
|
||||
},
|
||||
{
|
||||
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'
|
||||
}
|
||||
]
|
||||
},
|
||||
absoluteTime: 2 * 3600,
|
||||
indexKmRangeMap: {},
|
||||
stationsObj: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('rpTools', [
|
||||
'stations'
|
||||
]),
|
||||
planId() {
|
||||
return this.$route.query.planId;
|
||||
},
|
||||
mapId() {
|
||||
return 9;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
maxWidth() {
|
||||
this.setPosition();
|
||||
},
|
||||
maxHeight() {
|
||||
this.setPosition();
|
||||
},
|
||||
'$store.state.rpTools.planSizeCount': function () {
|
||||
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||
},
|
||||
'$store.state.rpTools.refreshCount': function() {
|
||||
this.loadChartPage();
|
||||
},
|
||||
$route() {
|
||||
this.$nextTick(() => {
|
||||
this.loadChartPage();
|
||||
});
|
||||
},
|
||||
loadRunPlanId() {
|
||||
this.loadChartPage();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setPosition();
|
||||
this.loadChartPage();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroy();
|
||||
},
|
||||
methods: {
|
||||
displayTrain() {
|
||||
this.showTrain = !this.showTrain;
|
||||
},
|
||||
serviceNumberChange(row) {
|
||||
let serviceNumber = null;
|
||||
let serviceObj = {};
|
||||
if (row) {
|
||||
serviceNumber = row.serviceNumber;
|
||||
serviceObj = this.$store.state.rpTools.editData[row.serviceNumber] || {};
|
||||
|
||||
const op = this.myChart.getOption();
|
||||
op.series.forEach((item, index) => {
|
||||
item.lineStyle.color = '#000';
|
||||
switch (item.name) {
|
||||
case serviceNumber: {
|
||||
item.lineStyle.color = 'red';
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
op.series.pop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.myChart.setOption(op, true);
|
||||
}
|
||||
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: null });
|
||||
this.analyticalTripNumber(serviceObj.trainMap || {});
|
||||
},
|
||||
tripNumberChange(row) {
|
||||
const serviceNumber = this.$store.state.rpTools.selected.serviceNumber;
|
||||
let tripNumber = null;
|
||||
if (row) {
|
||||
const data = [];
|
||||
tripNumber = row.tripNumber;
|
||||
const op = this.myChart.getOption();
|
||||
op.series.forEach((item, index) => {
|
||||
switch (item.name) {
|
||||
case serviceNumber: {
|
||||
item.data.forEach(nor => {
|
||||
if (nor[3] == tripNumber) {
|
||||
data.push(nor);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
op.series.pop();
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
op.series.push({
|
||||
name: 'trainLabel',
|
||||
lineStyle: {
|
||||
color: 'green'
|
||||
},
|
||||
type: 'line',
|
||||
data: data
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
}, 50);
|
||||
|
||||
}
|
||||
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
|
||||
},
|
||||
async analyticalServiceNumber(data) {
|
||||
this.serviceNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.map(serviceNumber => { return { serviceNumber }; });
|
||||
},
|
||||
async analyticalTripNumber(data) {
|
||||
this.tripNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.map(tripNumber => { return { tripNumber }; });
|
||||
},
|
||||
async setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let top = 3;
|
||||
const width = this.maxWidth;
|
||||
let height = this.maxHeight;
|
||||
|
||||
const titleBar = document.getElementById('PlanTitleBar');
|
||||
const menuBar = document.getElementById('PlanMenuBar');
|
||||
const menuTool = document.getElementById('PlanMenuTool');
|
||||
const statusBar = document.getElementById('PlanStatusBar');
|
||||
|
||||
if (titleBar) {
|
||||
top += (titleBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (menuBar) {
|
||||
top += (menuBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (menuTool) {
|
||||
top += (menuTool.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (statusBar) {
|
||||
height -= (statusBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
height = height - top;
|
||||
this.$store.dispatch('rpTools/resize', { width, height });
|
||||
|
||||
if (this.top != top) {
|
||||
this.top = top;
|
||||
}
|
||||
|
||||
if (this.height != height) {
|
||||
this.height = height - 20 * 2;
|
||||
}
|
||||
});
|
||||
},
|
||||
async loadChartPage() {
|
||||
try {
|
||||
this.$store.dispatch('rpTools/clear').then(() => {
|
||||
this.loadInitChart().then(() => {
|
||||
if (this.mapId) {
|
||||
loadMapDataById(this.mapId);
|
||||
getStationList(this.mapId).then(resp => {
|
||||
const stations = resp.data.filter(el => {
|
||||
return ['车辆段', '停车场'].findIndex(it => {
|
||||
return el.name.includes(it)
|
||||
}) < 0;
|
||||
});
|
||||
this.$store.dispatch('rpTools/setStations', stations).then(() => {
|
||||
this.loadInitData();
|
||||
this.myChart && this.myChart.showLoading();
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.rpTools.editData);
|
||||
this.loadChartData();
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.requestingStationDataFailed'));
|
||||
this.$store.dispatch('rpTools/setStations', []);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
|
||||
}
|
||||
},
|
||||
async loadChartData() {
|
||||
try {
|
||||
const stations = this.$store.state.rpTools.stations;
|
||||
const planData = this.$store.state.rpTools.planData;
|
||||
this.stationsObj = {};
|
||||
stations.forEach(item => {
|
||||
this.stationsObj[Math.floor(item.kmRange)] = item;
|
||||
});
|
||||
|
||||
this.viewDisabled = true;
|
||||
|
||||
this.option.series = [];
|
||||
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(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' }));
|
||||
await this.loadInitChart();
|
||||
|
||||
this.viewDisabled = false;
|
||||
} catch (error) {
|
||||
this.viewDisabled = false;
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
await this.xAxisInit();
|
||||
await this.yAxisInit();
|
||||
await this.loadInitChart();
|
||||
},
|
||||
pushModels(series, models) {
|
||||
if (models && models.length) {
|
||||
models.forEach(elem => {
|
||||
if (elem) {
|
||||
series.push(elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
popModels(series, models) {
|
||||
if (models && models.length) {
|
||||
models.forEach(elem => {
|
||||
const index = series.indexOf(elem);
|
||||
if (index >= 0) {
|
||||
series.split(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
loadInitChart() {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
if (this.$route.query.planName || this.$route.query.prdType === '05') {
|
||||
this.option.title.text = this.mapName;
|
||||
}
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
this.myChart.setOption(this.option, {notMerge: true});
|
||||
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
destroy() {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.dispose();
|
||||
this.myChart = null;
|
||||
}
|
||||
},
|
||||
clearCanvas() {
|
||||
this.option.series = [];
|
||||
this.option.title.text = '';
|
||||
if (this.myChart) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
xAxisPointFormat(params) {
|
||||
return timeFormat(params.value);
|
||||
},
|
||||
yAxisPointFormat(params) {
|
||||
return this.planConvert.computedFormatYAxis(this.stations, params);
|
||||
},
|
||||
xAxisLableFormat(value, index) {
|
||||
if (value % 60 === 0) {
|
||||
return timeFormat(value);
|
||||
}
|
||||
},
|
||||
yAxisLableFormat(value, index) {
|
||||
return '';
|
||||
},
|
||||
xAxisInit() {
|
||||
const list = [];
|
||||
for (var time = 0 + this.planConvert.TranslationTime; time < 3600 * 24 + this.planConvert.TranslationTime; time++) {
|
||||
list.push(time);
|
||||
}
|
||||
|
||||
const startValue = 3600 * 6;
|
||||
const offsetTime = 3600 * 1;
|
||||
|
||||
this.option.xAxis[0].data = list;
|
||||
if (!this.option.dataZoom[0].startValue) {
|
||||
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = startValue - offsetTime;
|
||||
}
|
||||
|
||||
if (!this.option.dataZoom[0].endValue) {
|
||||
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = startValue + offsetTime;
|
||||
}
|
||||
},
|
||||
yAxisInit() {
|
||||
if (Object.keys(this.planConvert).length) {
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.stations);
|
||||
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.stations);
|
||||
}
|
||||
},
|
||||
axisTooltip(param) {
|
||||
let data = '';
|
||||
const arr = [];
|
||||
param.forEach(item => {
|
||||
const station = this.stationsObj[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
|
||||
if (!arr.includes(`${item.data[0]}${item.data[1]}`)) {
|
||||
arr.push(`${item.data[0]}${item.data[1]}`);
|
||||
const list = [
|
||||
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
|
||||
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m <br>`,
|
||||
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
|
||||
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}(${item.data[3][0] == '2' ? 'Up' : 'Down'})`,
|
||||
`<hr size=1 style="margin: 3px 0">`
|
||||
];
|
||||
data += list.join('');
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
reSize(opt) {
|
||||
if (this.myChart) {
|
||||
this.myChart.resize({
|
||||
width: opt.width,
|
||||
height: opt.height,
|
||||
silent: false
|
||||
});
|
||||
}
|
||||
},
|
||||
createRpTrip(data) {
|
||||
addRpTrip(data).then(resp => {
|
||||
this.loadChartData();
|
||||
}).catch(error => {
|
||||
if (this.myChart) {
|
||||
const op = this.myChart.getOption();
|
||||
op.graphic[0].elements = [];
|
||||
this.myChart.setOption(op, {notMerge: true});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
#PlanSchedule {
|
||||
z-index: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - 45px);
|
||||
position: relative;
|
||||
margin-top: 45px;
|
||||
|
||||
.left {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.position {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 50px;
|
||||
width: 220px;
|
||||
height: calc(100% - 45px);
|
||||
}
|
||||
.data_table_box{
|
||||
height: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|