skinCode调整

This commit is contained in:
joylink_cuiweidong 2019-11-11 15:54:04 +08:00
parent b3a4e6ca8c
commit e8c8e491f5
46 changed files with 972 additions and 1131 deletions

View File

@ -1,11 +1,11 @@
const mapDeviceStyle = { const mapDeviceStyle = {
'01': 'chengdu_04', '01': 'chengdu_04',
'02': 'fuzhou_01', '02': 'fuzhou_01',
'03': 'bejing_01', '03': 'bejing_01',
'04': 'chengdu_03', '04': 'chengdu_03',
'05': 'batong_01' // 暂时没有画北京八通线 '05': 'batong_01' // 暂时没有画北京八通线
}; };
export function selectSkinCode(code) { export function selectLineCode(code) {
return Object.assign({}, require(`./skinCode/${mapDeviceStyle[code || '02']}`).default); return Object.assign({}, require(`./skinCode/${mapDeviceStyle[code || '02']}`).default);
} }

View File

@ -7,7 +7,7 @@ import MouseController from './mouseController';
import KeyboardController from './keyboardController'; import KeyboardController from './keyboardController';
import deviceState from './constant/deviceState'; import deviceState from './constant/deviceState';
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import { selectSkinCode } from './config/deviceStyle'; import { selectLineCode } from './config/deviceStyle';
import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
@ -22,8 +22,8 @@ class Jlmap {
// 鼠标事件 // 鼠标事件
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom', Keyboard: 'keyboard'}; this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom', Keyboard: 'keyboard'};
// 皮肤参数 // 线路参数
this.skinCode = ''; this.lineCode = '';
// 皮肤风格 // 皮肤风格
this.style = {}; this.style = {};
@ -62,9 +62,9 @@ class Jlmap {
this.$keyboardController.enable(); this.$keyboardController.enable();
} }
loadStyle(skinCode) { loadStyle(lineCode) {
return selectSkinCode(skinCode); return selectLineCode(lineCode);
} }ine
loadDefaultState() { loadDefaultState() {
const defaultStateDict = {}; const defaultStateDict = {};
@ -82,7 +82,7 @@ class Jlmap {
setMap(map, mapDevice) { setMap(map, mapDevice) {
// 保存皮肤类型 // 保存皮肤类型
if (map.skinVO) { if (map.skinVO) {
this.skinCode = map.skinVO.code; this.lineCode = map.skinVO.code;
this.$options.scaleRate = map.skinVO.scaling || 1; this.$options.scaleRate = map.skinVO.scaling || 1;
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0; this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0; this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0;
@ -95,7 +95,7 @@ class Jlmap {
this.mapDevice = mapDevice; this.mapDevice = mapDevice;
// 加载对应皮肤 // 加载对应皮肤
this.style = this.loadStyle(this.skinCode); this.style = this.loadStyle(this.lineCode);
// 数据加载完成 回调 // 数据加载完成 回调
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); } if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); }
@ -315,7 +315,7 @@ class Jlmap {
} }
clear() { clear() {
this.skinCode = ''; this.lineCode = '';
this.style = {}; this.style = {};
this.mapDevice = {}; this.mapDevice = {};
this.$painter.clear(); this.$painter.clear();

View File

@ -88,7 +88,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -90,7 +90,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -88,7 +88,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -90,7 +90,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -88,7 +88,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -90,7 +90,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -88,7 +88,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -90,7 +90,7 @@ export default {
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/lineCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },

View File

@ -315,7 +315,7 @@ const map = {
map: (state) => { map: (state) => {
return state.map; return state.map;
}, },
skinCode: (state) => { lineCode: (state) => {
if (state.map && state.map.skinVO) { if (state.map && state.map.skinVO) {
return state.map.skinVO.code; return state.map.skinVO.code;
} }

View File

@ -47,6 +47,12 @@ export default {
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.setWindowSize(); this.setWindowSize();
} }
// '$store.state.socket.simulationReset': function (val) {
// debugger;
// // if (val) {
// // this.simulationReset(val);
// // }
// }
}, },
async beforeDestroy() { async beforeDestroy() {
await this.$store.dispatch('map/mapClear'); await this.$store.dispatch('map/mapClear');
@ -67,11 +73,12 @@ export default {
async loadMapDataById(mapId) { async loadMapDataById(mapId) {
try { try {
await this.$store.dispatch('training/changeMode', { mode: null }); await this.$store.dispatch('training/changeMode', { mode: null });
await loadMapDataById(mapId); loadMapDataById(mapId).then(()=>{
await this.$store.dispatch('training/over'); this.$store.dispatch('training/over');
await this.$store.dispatch('training/setMapDefaultState'); this.$store.dispatch('training/setMapDefaultState');
await this.$store.dispatch('map/clearJlmapTrainView'); this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
});
} catch (error) { } catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`); this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading(); this.endViewLoading();

View File

@ -119,7 +119,7 @@ export default {
} }
}, },
'$store.state.map.mapDataLoadedCount': function () { '$store.state.map.mapDataLoadedCount': function () {
if (this.$jlmap.skinCode) { if (this.$jlmap.lineCode) {
this.isUpdate = true; this.isUpdate = true;
} }
} }

View File

@ -16,337 +16,341 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { runDiagramGetTime } from '@/api/simulation'; import { runDiagramGetTime } from '@/api/simulation';
import { getPublishMapInfo } from '@/api/jmap/map';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
export default { export default {
name: 'RunPlanView', name: 'RunPlanView',
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
runPlanId: 'run-plan-view', runPlanId: 'run-plan-view',
myChart: null, myChart: null,
PlanConvert: {}, PlanConvert: {},
series: [], series: [],
option: { option: {
title: { title: {
text: '', text: '',
left: 'center' left: 'center'
}, },
grid: { grid: {
top: '30px', top: '30px',
left: '120px', left: '120px',
right: '40px', right: '40px',
bottom: '80px', bottom: '80px',
containLabel: true, containLabel: true,
backgroundColor: 'floralwhite' backgroundColor: 'floralwhite'
}, },
toolbox: { toolbox: {
right: '20px', right: '20px',
feature: { feature: {
dataZoom: { dataZoom: {
yAxisIndex: 'none' yAxisIndex: 'none'
}, },
restore: {}, restore: {},
saveAsImage: {} saveAsImage: {}
} }
}, },
tooltip: { tooltip: {
axisPointer: { axisPointer: {
trigger: 'item', trigger: 'item',
type: 'cross' type: 'cross'
}, },
formatter: this.axisTooltip, formatter: this.axisTooltip,
borderWidth: 1 borderWidth: 1
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: [], data: [],
axisLine: { axisLine: {
onZero: false, onZero: false,
lineStyle: { lineStyle: {
width: 2, width: 2,
color: '#d14a61' color: '#d14a61'
} }
}, },
axisLabel: { axisLabel: {
formatter: this.xAxisLableFormat, formatter: this.xAxisLableFormat,
textStyle: { textStyle: {
color: '#333' color: '#333'
} }
}, },
axisPointer: { axisPointer: {
snap: true, snap: true,
label: { label: {
formatter: this.xAxisPointFormat, formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)', backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white' color: 'white'
} }
} }
} }
], ],
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: { splitLine: {
show: false show: false
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLine: { axisLine: {
onZero: false, onZero: false,
lineStyle: { lineStyle: {
width: 2, width: 2,
color: '#d14a61' color: '#d14a61'
} }
}, },
axisLabel: { axisLabel: {
interval: 'auto', interval: 'auto',
formatter: this.yAxisLableFormat formatter: this.yAxisLableFormat
}, },
axisPointer: { axisPointer: {
xAxisIndex: 'all', xAxisIndex: 'all',
label: { label: {
formatter: this.yAxisPointFormat, formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)', backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white' color: 'white'
} }
}, },
min: 0, min: 0,
max: 0 max: 0
}, },
// graphic: { // graphic: {
// type: 'line', // type: 'line',
// progressive: true // progressive: true
// }, // },
series: [], series: [],
dataZoom: [ dataZoom: [
{ {
type: 'inside' type: 'inside'
}, },
{ {
fiterMode: 'filter', 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', 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%', handleSize: '80%',
handleStyle: { handleStyle: {
color: '#fff', color: '#fff',
shadowBlur: 3, shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)', shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2, shadowOffsetX: 2,
shadowOffsetY: 2 shadowOffsetY: 2
}, },
bottom: '25px' bottom: '25px'
} }
] ]
}, },
absoluteTime: 2 * 3600, absoluteTime: 2 * 3600,
indexKmRangeMap: {}, indexKmRangeMap: {},
runPlanData: {} runPlanData: {}
}; };
}, },
computed: { computed: {
...mapGetters('runPlan', [ ...mapGetters('runPlan', [
'stations' 'stations'
]), ]),
title() { title() {
return this.$t('display.runPlan.previewRunDiagram'); return this.$t('display.runPlan.previewRunDiagram');
} }
}, },
watch: { watch: {
'$store.state.runPlan.planLoadedCount': function () { '$store.state.runPlan.planLoadedCount': function () {
this.loadChartPage(); this.loadChartPage();
if (this.dialogShow) { if (this.dialogShow) {
this.loadInitData(this.series); this.loadInitData(this.series);
} }
}, },
'$store.state.runPlan.planUpdateCount': function () { '$store.state.runPlan.planUpdateCount': function () {
this.updateRunPlanData(this.$store.state.runPlan.updateData); this.updateRunPlanData(this.$store.state.runPlan.updateData);
}, },
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.reSize({ width: this.$store.state.app.width, height: this.$store.state.app.height - 55 }); this.reSize({ width: this.$store.state.app.width, height: this.$store.state.app.height - 55 });
} }
}, },
mounted() { mounted() {
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode); getPublishMapInfo(this.$route.query.mapId).then(res=>{
this.loadChartPage(); // this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
}, this.PlanConvert = this.$theme.loadPlanConvert(res.data.lineCode);
beforeDestroy() { this.loadChartPage();
if (this.myChart && this.myChart.isDisposed) { });
this.myChart.dispose(); },
this.myChart = null; beforeDestroy() {
} if (this.myChart && this.myChart.isDisposed) {
}, this.myChart.dispose();
methods: { this.myChart = null;
doShow() { }
this.dialogShow = true; },
this.loadInitData(this.series); methods: {
}, doShow() {
doClose() { this.dialogShow = true;
this.dialogShow = false; this.loadInitData(this.series);
}, },
loadChartPage() { doClose() {
const stations = this.$store.state.runPlan.stations; this.dialogShow = false;
const planData = this.$store.state.runPlan.planData; },
this.series = []; loadChartPage() {
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations); const stations = this.$store.state.runPlan.stations;
this.pushModels(this.series, [this.PlanConvert.initializeYaxis(stations)]); const planData = this.$store.state.runPlan.planData;
this.pushModels(this.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 1, color: '#000' })); this.series = [];
}, this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
async loadInitData(series) { this.pushModels(this.series, [this.PlanConvert.initializeYaxis(stations)]);
this.myChart && this.myChart.showLoading(); this.pushModels(this.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 1, color: '#000' }));
await this.xAxisInit(); },
await this.yAxisInit(); async loadInitData(series) {
await this.loadInitChart(series); this.myChart && this.myChart.showLoading();
this.myChart && this.myChart.hideLoading(); await this.xAxisInit();
}, await this.yAxisInit();
loadInitChart(series) { await this.loadInitChart(series);
return new Promise((resolve, reject) => { this.myChart && this.myChart.hideLoading();
try { },
const that = this; loadInitChart(series) {
// echart return new Promise((resolve, reject) => {
require.config( try {
{ const that = this;
paths: { // echart
echarts: './js/dist' require.config(
} {
} paths: {
); echarts: './js/dist'
// }
require( }
[ );
'echarts', //
'echarts/lib/chart/line' require(
], [
function (ec) { 'echarts',
if (that.myChart && that.myChart.isDisposed) { 'echarts/lib/chart/line'
that.myChart.clear(); ],
} function (ec) {
if (that.myChart && that.myChart.isDisposed) {
that.myChart.clear();
}
let startValue = 3600 + that.PlanConvert.TranslationTime; let startValue = 3600 + that.PlanConvert.TranslationTime;
const offsetTime = 3600; const offsetTime = 3600;
runDiagramGetTime(that.group).then(resp => { runDiagramGetTime(that.group).then(resp => {
startValue = resp.data - that.PlanConvert.TranslationTime; startValue = resp.data - that.PlanConvert.TranslationTime;
that.option.dataZoom[0].startValue = that.option.dataZoom[1].startValue = startValue - offsetTime; that.option.dataZoom[0].startValue = that.option.dataZoom[1].startValue = startValue - offsetTime;
that.option.dataZoom[0].endValue = that.option.dataZoom[1].endValue = startValue + offsetTime; that.option.dataZoom[0].endValue = that.option.dataZoom[1].endValue = startValue + offsetTime;
that.option.series = series; that.option.series = series;
that.myChart = ec.init(document.getElementById(that.runPlanId)); that.myChart = ec.init(document.getElementById(that.runPlanId));
if (that.myChart) { if (that.myChart) {
that.myChart.setOption(that.option); that.myChart.setOption(that.option);
that.reSize({ width: document.documentElement.clientWidth, height: document.documentElement.clientHeight - 55 }); that.reSize({ width: document.documentElement.clientWidth, height: document.documentElement.clientHeight - 55 });
} }
resolve(true); resolve(true);
}); });
} }
); );
} catch (error) { } catch (error) {
reject(error); reject(error);
} }
}); });
}, },
updateRunPlanData(data) { updateRunPlanData(data) {
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.series = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap, this.series = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
planData, this.series, { color: '#FF00DE', width: 0.5 } planData, this.series, { color: '#FF00DE', width: 0.5 }
); );
this.myChart && this.myChart.setOption({ series: this.series }); this.myChart && this.myChart.setOption({ series: this.series });
}, },
pushModels(series, models) { pushModels(series, models) {
if (models && models.length) { if (models && models.length) {
models.forEach(elem => { models.forEach(elem => {
if (elem) { if (elem) {
series.push(elem); series.push(elem);
} }
}); });
} }
return series; return series;
}, },
popModels(series, models) { popModels(series, models) {
if (models && models.length) { if (models && models.length) {
models.forEach(elem => { models.forEach(elem => {
const index = series.indexOf(elem); const index = series.indexOf(elem);
if (index >= 0) { if (index >= 0) {
series.split(index, 1); series.split(index, 1);
} }
}); });
} }
return series; return series;
}, },
xAxisPointFormat(params) { xAxisPointFormat(params) {
return timeFormat(params.value); return timeFormat(params.value);
}, },
yAxisPointFormat(params) { yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params); return this.PlanConvert.computedFormatYAxis(this.stations, params);
}, },
xAxisLableFormat(value, index) { xAxisLableFormat(value, index) {
if (value % 60 === 0) { if (value % 60 === 0) {
return timeFormat(value); return timeFormat(value);
} }
}, },
yAxisLableFormat(value, index) { yAxisLableFormat(value, index) {
return ''; return '';
}, },
xAxisInit() { xAxisInit() {
const list = []; const list = [];
for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) { for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time); list.push(time);
} }
this.option.xAxis[0].data = list; this.option.xAxis[0].data = list;
}, },
yAxisInit() { yAxisInit() {
if (Object.keys(this.PlanConvert).length) { if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations); this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations); this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
} }
}, },
axisTooltip(param) { axisTooltip(param) {
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' }; const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [ return [
`Point Data <hr size=1 style="margin: 3px 0">`, `Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('display.runPlan.stationName')}: ${station.name}<br>`, `${this.$t('display.runPlan.stationName')}: ${station.name}<br>`,
`${this.$t('display.runPlan.stationMark')}: ${station.kmRange} km <br>`, `${this.$t('display.runPlan.stationMark')}: ${station.kmRange} km <br>`,
`${this.$t('display.runPlan.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>` `${this.$t('display.runPlan.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join(''); ].join('');
}, },
settingExac(data) { settingExac(data) {
this.absoluteTime = Math.abs(parseInt(data.endValue) - parseInt(data.startValue)) / 1000; this.absoluteTime = Math.abs(parseInt(data.endValue) - parseInt(data.startValue)) / 1000;
this.myChart && this.myChart.setOption({ this.myChart && this.myChart.setOption({
xAxis: this.option.xAxis, xAxis: this.option.xAxis,
yAxis: this.option.yAxis yAxis: this.option.yAxis
}); });
this.myChart && this.myChart.dispatchAction({ this.myChart && this.myChart.dispatchAction({
type: 'dataZoom', type: 'dataZoom',
dataZoomIndex: [0, 1], dataZoomIndex: [0, 1],
startValue: parseInt(data.startValue / 1000), startValue: parseInt(data.startValue / 1000),
endValue: parseInt(data.endValue / 1000) endValue: parseInt(data.endValue / 1000)
}); });
}, },
run(start) { run(start) {
this.myChart && this.myChart.dispatchAction({ this.myChart && this.myChart.dispatchAction({
type: 'dataZoom', type: 'dataZoom',
dataZoomIndex: [0, 1], dataZoomIndex: [0, 1],
startValue: parseInt(start - this.absoluteTime / 2), startValue: parseInt(start - this.absoluteTime / 2),
endValue: parseInt(start + this.absoluteTime / 2) endValue: parseInt(start + this.absoluteTime / 2)
}); });
this.loadInitData(this.series); this.loadInitData(this.series);
}, },
reSize(opt) { reSize(opt) {
if (this.myChart) { if (this.myChart) {
this.myChart.resize({ width: opt.width, height: opt.height, silent: false }); this.myChart.resize({ width: opt.width, height: opt.height, silent: false });
} }
} }
} }
}; };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss"> <style scoped rel="stylesheet/scss" lang="scss">

View File

@ -31,7 +31,6 @@ import { Notification } from 'element-ui';
import { getGoodsTryUse } from '@/api/management/goods'; import { getGoodsTryUse } from '@/api/management/goods';
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation'; import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { getCountTime } from '@/utils/index'; import { getCountTime } from '@/utils/index';
import { runDiagramIsStart, quitScript } from '@/api/simulation'; import { runDiagramIsStart, quitScript } from '@/api/simulation';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
@ -191,7 +190,6 @@ export default {
EventBus.$emit('chatSubscribeStop'); EventBus.$emit('chatSubscribeStop');
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
// exitFullscreen();
}); });
}, },
jumpjlmap3d() { jumpjlmap3d() {

View File

@ -7,9 +7,9 @@
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
</el-button-group> --> </el-button-group> -->
<el-button-group> <el-button-group>
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{$t('scriptRecord.drivingByPlan')}}</el-button> <el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<!-- <el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> --> <!-- <el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> -->
<el-button type="primary" @click="back">{{$t('scriptRecord.scriptBack')}}</el-button> <el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />
@ -23,7 +23,6 @@ import SetTime from './demon/setTime';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation'; import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
// import { OperateMode, PermissionType } from '@/scripts/ConstDic'; // import { OperateMode, PermissionType } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
// import { getCountTime } from '@/utils/index'; // import { getCountTime } from '@/utils/index';
// import { loadMapData } from '@/utils/loaddata'; // import { loadMapData } from '@/utils/loaddata';
import { runDiagramIsStart } from '@/api/simulation'; import { runDiagramIsStart } from '@/api/simulation';
@ -31,122 +30,121 @@ import { timeFormat } from '@/utils/date';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'MenuTask', name: 'MenuTask',
components: { components: {
SetTime SetTime
}, },
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
offset: { offset: {
type: Number, type: Number,
required: true required: true
} }
}, },
data() { data() {
return { return {
isDisable: false, isDisable: false,
tryTime: 0, // tryTime: 0, //
timeNow: 0, // timeNow: 0, //
time: null, // time: null, //
countTime: 0, // countTime: 0, //
remainingTime: 0, remainingTime: 0,
goodsId: this.$route.query.goodsId, goodsId: this.$route.query.goodsId,
// isSaveStage: true, // isSaveStage: true,
training: { training: {
id: '', id: '',
name: '', name: '',
remarks: '' remarks: ''
} }
}; };
}, },
computed: { computed: {
scriptId() { scriptId() {
return this.$route.query.scriptId; return this.$route.query.scriptId;
} }
}, },
watch: { watch: {
'$store.state.training.subscribeCount': function () { '$store.state.training.subscribeCount': function () {
this.group && this.initLoadPage(); this.group && this.initLoadPage();
} }
}, },
beforeDestroy() { beforeDestroy() {
if (this.time) { if (this.time) {
this.setTryTime(); this.setTryTime();
clearTimeout(this.time); clearTimeout(this.time);
} }
}, },
methods: { methods: {
async initLoadPage() { async initLoadPage() {
try { try {
const resp = await runDiagramIsStart(this.group); const resp = await runDiagramIsStart(this.group);
if (resp && resp.data) { if (resp && resp.data) {
this.isDisable = true; this.isDisable = true;
this.$store.dispatch('training/simulationStart'); this.$store.dispatch('training/simulationStart');
} else { } else {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/over'); this.$store.dispatch('training/over');
} }
await this.loadSystemTime(); await this.loadSystemTime();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
}, },
selectBeginTime() { selectBeginTime() {
this.$refs.setTime.doShow(); this.$refs.setTime.doShow();
}, },
resetBeginTime() { resetBeginTime() {
this.isDisable = false; this.isDisable = false;
}, },
start(model) { start(model) {
this.isDisable = true; this.isDisable = true;
runDiagramStart(model, this.group).then(res => { runDiagramStart(model, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => { this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`)); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
}); });
}).catch(() => { }).catch(() => {
this.isDisable = false; this.isDisable = false;
this.$messageBox('开始仿真失败,请返回重试'); this.$messageBox('开始仿真失败,请返回重试');
}); });
}, },
end() { end() {
this.isDisable = false; this.isDisable = false;
runDiagramOver(this.group).then(() => { runDiagramOver(this.group).then(() => {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView'); this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}); });
}); });
}).catch(() => { }).catch(() => {
this.isDisable = true; this.isDisable = true;
this.$messageBox('结束仿真失败,请返回'); this.$messageBox('结束仿真失败,请返回');
}); });
}, },
setTryTime() { setTryTime() {
if (this.try) { if (this.try) {
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId }); this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
} }
}, },
back() { back() {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop'); EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop'); EventBus.$emit('chatSubscribeStop');
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
// exitFullscreen(); });
}); },
}, async loadSystemTime() {
async loadSystemTime() { const rest = await runDiagramGetTime(this.group);
const rest = await runDiagramGetTime(this.group); if (rest && rest.code == 200) {
if (rest && rest.code == 200) { this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`)); }
} }
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,155 +0,0 @@
<template>
<el-card>
<div slot="header" style="text-align: center;">
<span class="title">{{ this.$t('exam.trainingName') }} {{ courseModel.name }}</span>
</div>
<div style="margin:50px" :style="{ height: height - 150 +'px' }">
<p class="time-item">
<span class="time-label">{{ this.$t('exam.examinationTiming') }}</span>
<span class="time-elem">{{ formatExamUsedTime }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ this.$t('exam.maximumTimeToCompleteThisQuestion') }}</span>
<span class="list-elem">{{ courseModel.maxDuration | setTime }}{{ this.$t('global.second') }} </span>
</p>
<p class="list-item">
<span class="list-label">{{ this.$t('exam.theBestTimeToCompleteTheQuestion') }}</span>
<span class="list-elem">{{ courseModel.minDuration | setTime }}{{ this.$t('global.second') }}</span>
</p>
<p class="list-item">
<span class="list-label"> {{ this.$t('exam.trainingNotes') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span>
</p>
<p>
<span class="list-label" />
<el-button :loading="loading" type="primary" @click="start">{{ this.$t('exam.startTheExam') }}</el-button>
<el-button :loading="loading" type="danger" @click="back">{{ this.$t('exam.giveUpTheExam') }}</el-button>
</p>
</div>
</el-card>
</template>
<script>
import { setExamGive } from '@/api/management/userexam';
import { getTrainingDetail } from '@/api/jmap/training';
import { launchFullscreen } from '@/utils/screen';
import { timeFormat } from '@/utils/date';
export default {
name: 'ExamDetailList',
filters: {
setTime(val) {
return val;
}
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: '',
skinCode: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
}
};
},
computed: {
formatExamUsedTime() {
return timeFormat(this.$store.state.exam.usedTime);
},
height() {
return this.$store.state.app.height;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
const trainingId = this.$route.query.trainingId;
if (parseInt(trainingId)) {
getTrainingDetail(trainingId).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
skinCode: res.data.skinCode,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
}).catch(error => {
this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message);
});
}
},
start() {
this.loading = true;
const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId };
this.$router.push({ path: '/display/exam', query: query });
launchFullscreen();
},
back() {
this.loading = true;
this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
//
setExamGive(this.$route.query.userExamId).then(() => {
this.$router.back();
});
}).catch(() => {
this.loading = false;
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.title {
font-weight: bold
}
.time-item {
font-size: 24px;
color: black !important;
}
.time-label {
display: -moz-inline-box;
display: inline-block;
text-align: right;
margin-left: 14px;
}
.time-elem {
color: rgb(90, 89, 89) !important;
}
.list-item {
font-size: 16px;
margin-bottom: 20px;
}
.list-label {
display: -moz-inline-box;
display: inline-block;
text-align: right;
width: 160px;
}
.list-elem {
color: #808080 !important;
}
</style>

View File

@ -231,16 +231,16 @@ export default {
this.dataZoom.offsetY = dataZoom.offsetY.toFixed(1) + ''; this.dataZoom.offsetY = dataZoom.offsetY.toFixed(1) + '';
this.dataZoom.scaleRate = dataZoom.scaleRate + ''; this.dataZoom.scaleRate = dataZoom.scaleRate + '';
const skinCode = this.$store.getters['map/skinCode']; const lineCode = this.$store.getters['map/lineCode'];
if (skinCode) { if (lineCode) {
const param = { const param = {
scaleRate: this.dataZoom.scaleRate, scaleRate: this.dataZoom.scaleRate,
offsetY: this.dataZoom.offsetY, offsetY: this.dataZoom.offsetY,
offsetX: this.dataZoom.offsetX, offsetX: this.dataZoom.offsetX,
skinCode: skinCode lineCode: lineCode
}; };
this.$store.dispatch('map/updateZoom', this.dataZoom); this.$store.dispatch('map/updateZoom', this.dataZoom);
localStore.set(`scaleRate_${skinCode}`, JSON.stringify(param)); // localStore.set(`scaleRate_${lineCode}`, JSON.stringify(param)); //
} }
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');

View File

@ -73,7 +73,7 @@ export default {
deviceCode: '', deviceCode: '',
group: '', group: '',
mapId: '', mapId: '',
skinCode: '', lineCode: '',
simulationShow: false, simulationShow: false,
drivingShow: false, drivingShow: false,
ibpShow: false, ibpShow: false,
@ -153,7 +153,7 @@ export default {
async created() { async created() {
this.group = this.$route.query.group; this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId; this.mapId = this.$route.query.mapId;
this.skinCode = this.$route.query.skinCode; this.lineCode = this.$route.query.lineCode;
this.subSystem = this.$route.query.subSystem; this.subSystem = this.$route.query.subSystem;
Message.closeAll(); Message.closeAll();
}, },
@ -302,7 +302,7 @@ export default {
this.$store.dispatch('training/end', TrainingMode.NORMAL); this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.skinCode) { if (this.lineCode) {
// 01 02 '' // 01 02 ''
const resp = await this.getUserRole(); const resp = await this.getUserRole();
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
@ -367,7 +367,7 @@ export default {
this.panelShow = false; this.panelShow = false;
this.drivingShow = true; this.drivingShow = true;
this.ibpShow = false; this.ibpShow = false;
this.$refs.Jl3dDrive.show(this.skinCode); this.$refs.Jl3dDrive.show(this.mapId);
}, },
hideIbp() { hideIbp() {
Message.closeAll(); Message.closeAll();

View File

@ -298,7 +298,7 @@ export default {
back() { back() {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => { putJointTrainingSimulationUser(this.group).then(() => {
this.$router.replace({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } }); this.$router.replace({ path: `/trainroom`, query: { lineCode: this.$route.query.lineCode, group: this.group, subSystem: this.$route.query.subSystem } });
exitFullscreen(); exitFullscreen();
}); });
}); });

View File

@ -97,7 +97,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'counterList', 'counterList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]), ]),
createRules: function () { createRules: function () {
return { return {

View File

@ -82,7 +82,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'delayShowList', 'delayShowList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]), ]),
createRules: function () { createRules: function () {
return { return {

View File

@ -111,7 +111,7 @@ export default {
'sectionList', 'sectionList',
'trainModelList', 'trainModelList',
'lcList', 'lcList',
'skinCode' 'lineCode'
]), ]),
createRules: function () { createRules: function () {
return { return {

View File

@ -90,7 +90,7 @@ export default {
'sectionList', 'sectionList',
'trainModelList', 'trainModelList',
'tempSpeedLimitList', 'tempSpeedLimitList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -143,7 +143,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'lineList', 'lineList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -320,7 +320,7 @@ export default {
'switchList', 'switchList',
'stationList', 'stationList',
'stationStandList', 'stationStandList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -192,7 +192,7 @@ export default {
'signalList', 'signalList',
'sectionList', 'sectionList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]), ]),
PhysicalSectionList() { PhysicalSectionList() {
let list = []; let list = [];

View File

@ -104,7 +104,7 @@ export default {
'stationList', 'stationList',
'sectionList', 'sectionList',
'zcList', 'zcList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
return { return {

View File

@ -90,7 +90,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList',
'stationControlList', 'stationControlList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -119,7 +119,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList',
'stationStandList', 'stationStandList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -139,7 +139,7 @@ export default {
'sectionList', 'sectionList',
'switchList', 'switchList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]) ])
}, },
watch: { watch: {

View File

@ -132,7 +132,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'textList', 'textList',
'stationList', 'stationList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -75,7 +75,7 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'trainList', 'trainList',
'trainModelList', 'trainModelList',
'skinCode' 'lineCode'
]) ])
}, },
watch: { watch: {

View File

@ -95,7 +95,7 @@ export default {
'sectionList', 'sectionList',
'trainModelList', 'trainModelList',
'zcList', 'zcList',
'skinCode' 'lineCode'
]), ]),
form() { form() {
const form = { const form = {

View File

@ -46,9 +46,9 @@ export default {
}, },
watch: { watch: {
'$store.state.map.mapDataLoadedCount': function () { '$store.state.map.mapDataLoadedCount': function () {
const skinCode = this.$jlmap.skinCode; const lineCode = this.$jlmap.lineCode;
if (skinCode) { if (lineCode) {
this.menus = this.$theme.loadMenuComponent(skinCode); this.menus = this.$theme.loadMenuComponent(lineCode);
} }
} }
}, },
@ -67,10 +67,10 @@ export default {
return device; return device;
}, },
// //
getSelectedBySkinCode(device) { getSelectedByLineCode(device) {
const switchSectionIsWitchSkinCodeList = ['03']; const switchSectionIsWitchLineCodeList = ['03'];
const skinCode = this.$store.getters['map/skinCode']; const lineCode = this.$store.getters['map/lineCode'];
if (switchSectionIsWitchSkinCodeList.includes(skinCode) && device._type == deviceType.Section) { if (switchSectionIsWitchLineCodeList.includes(lineCode) && device._type == deviceType.Section) {
const section = this.$store.getters['map/getDeviceByCode'](device._code); const section = this.$store.getters['map/getDeviceByCode'](device._code);
if (section) { if (section) {
device = this.$store.getters['map/getDeviceByCode'](section.relSwitchCode); device = this.$store.getters['map/getDeviceByCode'](section.relSwitchCode);
@ -117,7 +117,7 @@ export default {
} }
if (device) { if (device) {
this.selected = device = this.getSelectedBySkinCode(device); this.selected = device = this.getSelectedByLineCode(device);
if (!this.buttonOperation) { if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', device); this.$store.dispatch('menuOperation/setSelected', device);
if (!this.checkShouldPop(device)) { if (!this.checkShouldPop(device)) {
@ -134,10 +134,10 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
checkShouldPop(device) { checkShouldPop(device) {
const skinCode = this.$store.getters['map/skinCode']; const lineCode = this.$store.getters['map/lineCode'];
if (device._type === 'Signal') { if (device._type === 'Signal') {
return device._viewVal === '3'; return device._viewVal === '3';
} else if (device._type === 'StationControl' && skinCode == '01') { // } else if (device._type === 'StationControl' && lineCode == '01') { //
return device._viewVal === '1'; return device._viewVal === '1';
} else { } else {
return true; return true;

View File

@ -253,12 +253,7 @@ export default {
}).then(() => { }).then(() => {
deleteRunPlan(row.id).then(Response => { deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess')); this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh(); this.refresh();
// this.doClose();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
}); });

View File

@ -3,7 +3,7 @@
<menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" /> <menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" />
<schedule <schedule
ref="schedule" ref="schedule"
:skin-code="skinCode" :line-code="lineCode"
:plan-convert="PlanConvert" :plan-convert="PlanConvert"
:max-height="height" :max-height="height"
:max-width="width" :max-width="width"
@ -91,8 +91,8 @@ export default {
}; };
}, },
computed: { computed: {
skinCode() { lineCode() {
return this.$route.query.skinCode || '02'; return this.$route.query.lineCode || '02';
}, },
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
@ -102,7 +102,7 @@ export default {
} }
}, },
created() { created() {
this.PlanConvert = this.$theme.loadPlanConvert(this.skinCode); this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
}, },
mounted() { mounted() {

View File

@ -144,188 +144,188 @@ import { formatTime, formatName } from '@/utils/runPlan';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
export default { export default {
name: 'AddTask', name: 'AddTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
isPlan: false, isPlan: false,
showDefault: true, showDefault: true,
stopStationMap: {}, stopStationMap: {},
params: {}, params: {},
addModel: { addModel: {
taskIndex: '', taskIndex: '',
addToFront: false, addToFront: false,
routingCode: '', routingCode: '',
endStationCode: '', endStationCode: '',
startStationCode: '', startStationCode: '',
endSectionCode: '', endSectionCode: '',
startSectionCode: '', startSectionCode: '',
startTime: '00:00:00', startTime: '00:00:00',
endTime: '', endTime: '',
planId: '', planId: '',
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
defaultStopTime: '30', defaultStopTime: '30',
defaultSpeedLevel: 'level3', defaultSpeedLevel: 'level3',
routingList: [], routingList: [],
arriveConfigList: [] arriveConfigList: []
}, },
tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }], tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }],
defaultStopTimeList: [{ value: '30', label: this.$t('planMonitor.default') }, { value: '0', label: '0' }], defaultStopTimeList: [{ value: '30', label: this.$t('planMonitor.default') }, { value: '0', label: '0' }],
defaultSpeedLevelList: [{ value: 'level3', label: this.$t('planMonitor.default') }] defaultSpeedLevelList: [{ value: 'level3', label: this.$t('planMonitor.default') }]
}; };
}, },
computed: { computed: {
title() { title() {
return this.$t('planMonitor.addTask'); return this.$t('planMonitor.addTask');
} }
}, },
watch: { watch: {
'addModel.routingCode': function () { 'addModel.routingCode': function () {
this.computedDetailList(); this.computedDetailList();
}, },
'addModel.startTime': function () { 'addModel.startTime': function () {
this.computedDetailList(); this.computedDetailList();
}, },
'addModel.defaultStopTime': function () { 'addModel.defaultStopTime': function () {
this.computedDetailList(); this.computedDetailList();
}, },
'addModel.defaultSpeedLevel': function () { 'addModel.defaultSpeedLevel': function () {
this.computedDetailList(); this.computedDetailList();
} }
}, },
methods: { methods: {
loadInitData(params) { loadInitData(params) {
this.isPlan = params.isPlan; this.isPlan = params.isPlan;
this.addModel.taskIndex = getUID('task_'); this.addModel.taskIndex = getUID('task_');
this.addModel.serviceNumber = params.serviceNumber; this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId; this.addModel.planId = this.$route.query.planId;
const planId = this.$route.query.planId; const planId = this.$route.query.planId;
if (planId) { if (planId) {
getRoutingList(planId).then(resp => { getRoutingList(planId).then(resp => {
this.addModel.routingList = resp.data; this.addModel.routingList = resp.data;
}); });
} }
const mapId = this.$route.query.mapId; const mapId = this.$route.query.mapId;
if (skinCode) { if (mapId) {
getStationRunning(mapId).then(resp => { // getStationRunning(mapId).then(resp => { //
const list = resp.data; const list = resp.data;
list.forEach(elem => { list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem; this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
}); });
if (list && list.length) { if (list && list.length) {
list.forEach(elem => { list.forEach(elem => {
if (!elem.runPlanLevelVO) { if (!elem.runPlanLevelVO) {
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, { this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
callback: action => { callback: action => {
this.doClose(); this.doClose();
} }
}); });
} }
}); });
} }
}); });
} }
}, },
doShow(params) { doShow(params) {
this.loadInitData(params); this.loadInitData(params);
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
computedTimeByString(timeStr) { computedTimeByString(timeStr) {
const bTime = +new Date(`2019-01-01 00:00:00`); const bTime = +new Date(`2019-01-01 00:00:00`);
const eTime = +new Date(`2019-01-01 ${timeStr}`); const eTime = +new Date(`2019-01-01 ${timeStr}`);
return Number(eTime) - Number(bTime); return Number(eTime) - Number(bTime);
}, },
compuntedRunTime(list, index, runLevel) { compuntedRunTime(list, index, runLevel) {
let runTime = 0; let runTime = 0;
if (index < list.length - 1) { if (index < list.length - 1) {
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()]; const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
if (stopStationObj) { if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) { if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]); runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else { } else {
this.$messageBox(this.$t('planMonitor.addTaskHint1')+stopStationObj.startSectionCode+this.$t('planMonitor.addTaskHint2')+stopStationObj.endSectionCode+this.$t('planMonitor.addTaskHint3')); this.$messageBox(this.$t('planMonitor.addTaskHint1') + stopStationObj.startSectionCode + this.$t('planMonitor.addTaskHint2') + stopStationObj.endSectionCode + this.$t('planMonitor.addTaskHint3'));
} }
} }
} }
return runTime; return runTime;
}, },
changeStopTime(indexs, time) { changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30; let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30;
const runLevel = this.addModel.defaultSpeedLevel || 'level3'; // const runLevel = this.addModel.defaultSpeedLevel || 'level3'; //
this.addModel.arriveConfigList.forEach((elem, index) => { this.addModel.arriveConfigList.forEach((elem, index) => {
if (indexs == index) { if (indexs == index) {
elem.stopTime = time ? Number(time) : 0; elem.stopTime = time ? Number(time) : 0;
} }
elem.arriveTime = index ? formatTime(tempTime) : ''; elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == this.addModel.arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime); elem.departureTime = index == this.addModel.arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : ''; elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : '';
tempTime = tempTime + elem.stopTime + this.compuntedRunTime(this.addModel.arriveConfigList, index, runLevel); tempTime = tempTime + elem.stopTime + this.compuntedRunTime(this.addModel.arriveConfigList, index, runLevel);
}); });
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime); this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
}, },
computedDetailList() { computedDetailList() {
if (this.addModel.routingCode) { if (this.addModel.routingCode) {
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.addModel.routingCode }).then(resp => { querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.addModel.routingCode }).then(resp => {
const list = resp.data; const list = resp.data;
const waitTime = Number(this.addModel.defaultStopTime) || 0; // const waitTime = Number(this.addModel.defaultStopTime) || 0; //
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30; let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30;
const runLevel = this.addModel.defaultSpeedLevel || 'level3'; // const runLevel = this.addModel.defaultSpeedLevel || 'level3'; //
list.forEach((elem, index) => { list.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : ''; elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime); elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : ''; elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : '';
elem.stopTime = this.addModel.defaultStopTime != '0' ? 30 : 0; elem.stopTime = this.addModel.defaultStopTime != '0' ? 30 : 0;
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel); tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
}); });
this.addModel.arriveConfigList = list; this.addModel.arriveConfigList = list;
this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime); this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
}); });
} }
}, },
handleClick(row, column, event) { handleClick(row, column, event) {
this.addModel.startStationCode = row.startStationCode; this.addModel.startStationCode = row.startStationCode;
this.addModel.endStationCode = row.endStationCode; this.addModel.endStationCode = row.endStationCode;
this.addModel.startSectionCode = row.startSectionCode; this.addModel.startSectionCode = row.startSectionCode;
this.addModel.endSectionCode = row.endSectionCode; this.addModel.endSectionCode = row.endSectionCode;
this.addModel.routingCode = row.code; this.addModel.routingCode = row.code;
}, },
handleCommit() { handleCommit() {
if (this.isPlan) { if (this.isPlan) {
// //
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) }); this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) });
} else { } else {
// //
addPlanTrip(this.addModel).then(resp => { addPlanTrip(this.addModel).then(resp => {
// this.$emit('dispatchOperate', { // this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query) // dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// }); // });
this.$emit('refresh'); this.$emit('refresh');
this.$message.success(this.$t('tip.addTaskSuccessfully')); this.$message.success(this.$t('tip.addTaskSuccessfully'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.addTaskFailed')); this.$messageBox(this.$t('tip.addTaskFailed'));
}); });
} }
this.doClose(); this.doClose();
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -65,7 +65,6 @@
<script> <script>
import { createEmptyPlan, queryRunPlanList, postCreatePlan, importRunPlan } from '@/api/runplan'; import { createEmptyPlan, queryRunPlanList, postCreatePlan, importRunPlan } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import XLSX from 'xlsx'; import XLSX from 'xlsx';
export default { export default {
@ -168,7 +167,6 @@ export default {
this.loading = true; this.loading = true;
postCreatePlan(this.pullModel).then(resp => { postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully')); this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
// this.jump(resp.data, this.pullModel.name);
this.$emit('refresh'); this.$emit('refresh');
this.doClose(); this.doClose();
}).catch((error) => { }).catch((error) => {
@ -251,10 +249,6 @@ export default {
}, 200); }, 200);
} }
this.doClose(); this.doClose();
},
jump(planId, planName) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
} }
} }
}; };

View File

@ -30,75 +30,75 @@
import { putRunPlanDetail } from '@/api/runplan'; import { putRunPlanDetail } from '@/api/runplan';
export default { export default {
name: 'CreateEmptyPlan', name: 'CreateEmptyPlan',
components: { components: {
}, },
data() { data() {
return { return {
activeTab: 'first', activeTab: 'first',
dialogShow: false, dialogShow: false,
loading: false, loading: false,
publishMapList: [], publishMapList: [],
editModel: { editModel: {
planId: '', planId: '',
name: '' name: ''
} }
}; };
}, },
computed: { computed: {
title() { title() {
return this.$t('planMonitor.modifyRunningDiagramName'); return this.$t('planMonitor.modifyRunningDiagramName');
}, },
rules() { rules() {
return { return {
name: [ name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
] ]
}; };
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(data) { doShow(data) {
this.dialogShow = true; this.dialogShow = true;
if (data && data.name) { if (data && data.name) {
this.editModel.name = data.name; this.editModel.name = data.name;
this.editModel.planId = data.id; this.editModel.planId = data.id;
} }
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.editModel.name = ''; this.editModel.name = '';
if (this.$refs.form) { if (this.$refs.form) {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
} }
}, },
handleEdit() { handleEdit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
putRunPlanDetail(this.editModel).then(resp => { putRunPlanDetail(this.editModel).then(resp => {
const params = { const params = {
dialogName: 'openRunPlan', dialogName: 'openRunPlan',
operate: 'loadRunPlanData', operate: 'loadRunPlanData',
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.editModel.name, refresh: true } params: { planId: resp.data, lineCode: this.$route.query.lineCode, planName: this.editModel.name, refresh: true }
}; };
this.$emit('dispatchOperate', params); this.$emit('dispatchOperate', params);
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully')); this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
this.$emit('renewal'); this.$emit('renewal');
this.doClose(); this.doClose();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed')); this.$messageBox(this.$t('tip.modifyRunGraphNameFailed'));
this.doClose(); this.doClose();
}); });
} }
}); });
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -102,97 +102,97 @@ import { getStationRunning, setStationRunning } from '@/api/runplan';
import UpdateStationIntervalTime from './updateStationIntervalTime'; import UpdateStationIntervalTime from './updateStationIntervalTime';
export default { export default {
name: 'ModifyingStationIntervalTime', name: 'ModifyingStationIntervalTime',
components: { components: {
UpdateStationIntervalTime UpdateStationIntervalTime
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
DirectionCodeMap: {}, DirectionCodeMap: {},
stationIntervalData: [], stationIntervalData: [],
params: {}, params: {},
runSpeedLevels: { runSpeedLevels: {
level1: 42, level1: 42,
level2: 37, level2: 37,
level3: 32, level3: 32,
level4: 27, level4: 27,
level5: 22 level5: 22
} }
}; };
}, },
computed: { computed: {
title() { title() {
return this.$t('planMonitor.modifying.modifyRunLevel'); return this.$t('planMonitor.modifying.modifyRunLevel');
} }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
loadInitData() { loadInitData() {
this.DirectionCodeMap = {}; this.DirectionCodeMap = {};
this.$ConstSelect.DirectionCodeList.forEach(elem => { this.$ConstSelect.DirectionCodeList.forEach(elem => {
this.DirectionCodeMap[elem.value] = elem.label; this.DirectionCodeMap[elem.value] = elem.label;
}); });
this.stationIntervalData = []; this.stationIntervalData = [];
if (this.$route.query.skinCode) { if (this.$route.query.lineCode) {
getStationRunning(this.$route.query.mapId).then(resp => { getStationRunning(this.$route.query.mapId).then(resp => {
const list = resp.data; const list = resp.data;
list.forEach(elem => { list.forEach(elem => {
elem.isEditStatus = false; elem.isEditStatus = false;
if (!elem.runPlanLevelVO || elem.runPlanLevelVO.length <= 0) { if (!elem.runPlanLevelVO || elem.runPlanLevelVO.length <= 0) {
elem.runPlanLevelVO = { stationRunningId: elem.id }; elem.runPlanLevelVO = { stationRunningId: elem.id };
Object.keys(this.runSpeedLevels).forEach(key => { Object.keys(this.runSpeedLevels).forEach(key => {
elem.runPlanLevelVO[key] = parseInt((elem.distance / 100) / (this.runSpeedLevels[key] / 3.6)); elem.runPlanLevelVO[key] = parseInt((elem.distance / 100) / (this.runSpeedLevels[key] / 3.6));
elem.isEditStatus = true; elem.isEditStatus = true;
}); });
} }
}); });
this.stationIntervalData = list; this.stationIntervalData = list;
}); });
} }
}, },
doShow(params) { doShow(params) {
this.params = params || {}; this.params = params || {};
this.loadInitData(); this.loadInitData();
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleUpdate(row) { handleUpdate(row) {
this.$refs.updateStationIntervalTime.doShow(row); this.$refs.updateStationIntervalTime.doShow(row);
}, },
handleConfirm(model) { handleConfirm(model) {
this.stationIntervalData.forEach(elem => { this.stationIntervalData.forEach(elem => {
if (elem.id == model.stationRunningId) { if (elem.id == model.stationRunningId) {
elem.isEditStatus = true; elem.isEditStatus = true;
elem.runPlanLevelVO = model; elem.runPlanLevelVO = model;
} }
}); });
}, },
handleSave() { handleSave() {
const data = []; const data = [];
this.stationIntervalData.forEach(elem => { this.stationIntervalData.forEach(elem => {
data.push(elem.runPlanLevelVO); data.push(elem.runPlanLevelVO);
}); });
setStationRunning(this.$route.query.mapId, data).then(resp => { setStationRunning(this.$route.query.mapId, data).then(resp => {
this.stationIntervalData.forEach(elem => { this.stationIntervalData.forEach(elem => {
elem.isEditStatus = false; elem.isEditStatus = false;
}); });
this.$message.success(this.$t('planMonitor.modifying.modifySuccess')); this.$message.success(this.$t('planMonitor.modifying.modifySuccess'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('planMonitor.modifying.modifyFailed')); this.$messageBox(this.$t('planMonitor.modifying.modifyFailed'));
}); });
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -347,13 +347,13 @@ export default {
} }
}, },
loadInitData(params) { loadInitData(params) {
const skinCode = this.$route.query.skinCode; const lineCode = this.$route.query.lineCode;
const mapId = this.$route.query.mapId; const mapId = this.$route.query.mapId;
this.isPlan = params.isPlan; this.isPlan = params.isPlan;
this.editModel.taskIndex = params.taskIndex; this.editModel.taskIndex = params.taskIndex;
this.editModel.serviceNumber = params.serviceNumber; this.editModel.serviceNumber = params.serviceNumber;
this.editModel.tripNumber = params.tripNumber; this.editModel.tripNumber = params.tripNumber;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber]; const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
if (editData) { if (editData) {

View File

@ -50,117 +50,117 @@ import { UrlConfig } from '@/router/index';
import EditPlanName from './editPlanName'; import EditPlanName from './editPlanName';
export default { export default {
name: 'OpenRunPlan', name: 'OpenRunPlan',
components: { components: {
EditPlanName EditPlanName
}, },
props: { props: {
skinCode: { skinCode: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
height: 260, height: 260,
// planId: '', // planId: '',
// planName: '', // planName: '',
type: 'add', type: 'add',
// defaultShowKeys: [], // defaultShowKeys: [],
runPlanList: [], runPlanList: [],
runPlanDict: {} runPlanDict: {}
// defaultProps: { // defaultProps: {
// label: 'name' // label: 'name'
// } // }
}; };
}, },
computed: { computed: {
show() { show() {
return this.dialogShow; return this.dialogShow;
}, },
title() { title() {
return this.$t('planMonitor.openRunPlan.runPlanList'); return this.$t('planMonitor.openRunPlan.runPlanList');
} }
}, },
mounted() { mounted() {
this.loadRunPlanData({ this.loadRunPlanData({
planId: this.$route.query.planId, planId: this.$route.query.planId,
skinCode: this.$route.query.skinCode, skinCode: this.$route.query.skinCode,
planName: this.$route.query.planName planName: this.$route.query.planName
}); });
}, },
methods: { methods: {
// handleNodeClick(data) { // handleNodeClick(data) {
// this.planId = data.id; // this.planId = data.id;
// this.planName = data.name; // this.planName = data.name;
// }, // },
loadRunPlanData({ refresh, planId, skinCode, planName }) { loadRunPlanData({ refresh, planId, skinCode, planName }) {
if (refresh) { if (refresh) {
this.$store.dispatch('runPlan/refresh'); this.$store.dispatch('runPlan/refresh');
} else { } else {
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName }; const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
} }
}, },
getRunPlanList() { getRunPlanList() {
getRpListByMapId(this.$route.query.mapId).then((resp) => { getRpListByMapId(this.$route.query.mapId).then((resp) => {
this.runPlanList = resp.data; this.runPlanList = resp.data;
this.runPlanList.forEach(elem => { this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name; this.runPlanDict[elem.id] = elem.name;
}); });
this.dialogShow = true; this.dialogShow = true;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail')); this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
}); });
}, },
doShow(data) { doShow(data) {
this.type = data.type || 'add'; this.type = data.type || 'add';
this.getRunPlanList(); this.getRunPlanList();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
// this.planId = ''; // this.planId = '';
// this.planName = ''; // this.planName = '';
}, },
// //
handleConfirm(row) { handleConfirm(row) {
this.loadRunPlanData({ this.loadRunPlanData({
planId: row.id, planId: row.id,
skinCode: this.$route.query.skinCode, skinCode: this.$route.query.skinCode,
planName: row.name planName: row.name
}); });
this.doClose(); this.doClose();
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), { this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'), cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlan(row.id).then(Response => { deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess')); this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
if (row.id === this.$route.query.planId) { if (row.id === this.$route.query.planId) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId }; const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
} }
this.doClose(); this.doClose();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
}); });
}).catch(() => { }); }).catch(() => { });
}, },
// //
handleEdit(row) { handleEdit(row) {
if (row.id && row.name) { if (row.id && row.name) {
this.$refs.editPlan.doShow({id: row.id, name: row.name}); this.$refs.editPlan.doShow({id: row.id, name: row.name});
} else { } else {
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan')); this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
} }
} }
} }
}; };
</script> </script>

View File

@ -37,7 +37,7 @@ export default {
DataTable DataTable
}, },
props: { props: {
skinCode: { lineCode: {
type: String, type: String,
required: true required: true
}, },
@ -367,7 +367,7 @@ export default {
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`; this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
}); });
} }
this.planConvert = this.$theme.loadPlanConvert(this.skinCode); this.planConvert = this.$theme.loadPlanConvert(this.lineCode);
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
this.loadInitChart().then(() => { this.loadInitChart().then(() => {
if (this.$route.query.mapId) { if (this.$route.query.mapId) {

View File

@ -3,7 +3,7 @@
<menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" /> <menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" />
<schedule <schedule
ref="schedule" ref="schedule"
:skin-code="skinCode" :line-code="lineCode"
:plan-convert="PlanConvert" :plan-convert="PlanConvert"
:max-height="height" :max-height="height"
:max-width="width" :max-width="width"
@ -91,8 +91,8 @@ export default {
}; };
}, },
computed: { computed: {
skinCode() { lineCode() {
return this.$route.query.skinCode || '02'; return this.$route.query.lineCode || '02';
}, },
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
@ -102,7 +102,7 @@ export default {
} }
}, },
created() { created() {
this.PlanConvert = this.$theme.loadPlanConvert(this.skinCode); this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
}, },
methods: { methods: {
setPosition() { setPosition() {

View File

@ -237,7 +237,7 @@ export default {
const room = this.room; const room = this.room;
await putJointTrainingSimulationEntrance(room.group); await putJointTrainingSimulationEntrance(room.group);
const rest = await getPublishMapInfo(room.mapId); const rest = await getPublishMapInfo(room.mapId);
const query = { skinCode: rest.data.lineCode, mapId: room.mapId, group: room.group, subSystem: this.$route.query.subSystem }; const query = { lineCode: rest.data.lineCode, mapId: room.mapId, group: room.group, subSystem: this.$route.query.subSystem };
this.$router.replace({ path: `/jointTraining`, query: query }); this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen(); launchFullscreen();
// //