产品分化运行图接口调整

This commit is contained in:
joylink_cuiweidong 2019-10-08 18:35:02 +08:00
parent ec4e78548f
commit 2d1f13299e
7 changed files with 112 additions and 36 deletions

View File

@ -38,3 +38,19 @@ export function getRpDetailByUserMapId(planId) {
method: 'get'
});
}
/** 获取用户自己创建的草稿地图详情*/
export function getUserMapDetailByMapId(mapId) {
return request({
url: `/api/mapBuild/findById/${mapId}`,
method: 'get'
});
}
/** 用户自己的运行图仿真测试*/
export function runUserPlanNotify({ planId }) {
return request({
url: `/api/draftMap/runPlan/simulationCheck/${planId}`,
method: 'get'
});
}

View File

@ -43,7 +43,7 @@ function getRouteInfo(to) {
// loginPath = loginPlanPage;
// getTokenInfo = getToken;
// clientId = LoginParams.LianJiHua.clientId;
else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath)) {
else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
loginPath = loginDesignPage;
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;

View File

@ -1148,11 +1148,13 @@ router.beforeEach((to, from, next) => {
const name = to.fullPath;
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else if (name.includes('/trainingPlatform/')) {
}
// else if (name.includes('/plan/') || name.includes('/planEdit/')) {
// document.title = '琏计划';
// }
else if (name.includes('/trainingPlatform/')) {
document.title = '城市轨道交通实训平台';
} else if (name.includes('/design/')) {
} else if (name.includes('/design/') || name.includes('/scriptDisplay/') || name.includes('/plan/') || name.includes('/publish/') || name.includes('/orderauthor/') || name.includes('/system/') || name.includes('/display/plan/')) {
document.title = '城市轨道交通设计平台';
} else {
document.title = '琏课堂';

View File

@ -67,7 +67,7 @@ export function handleToken() {
const path = window.location.href;
if (path.includes('/dp/') || path.includes('/display/dp')) {
return getScreenToken();
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan')) {
return getDesignToken();
}
// else if (path.includes('/plan') || path.includes('/display/plan')) {
@ -87,7 +87,7 @@ export function handleRemoveToken() {
// else if (path.includes('/plan') || path.includes('/display/plan')) {
// return removePlanToken();
// }
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan')) {
return removeDesignToken();
} else {
return removeToken();
@ -104,7 +104,7 @@ export function gainClientId() {
// else if (path.includes('/plan') || path.includes('/display/plan')) {
// clientId = LoginParams.LianJiHua.clientId;
// }
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan')) {
clientId = LoginParams.Design.clientId;
}

View File

@ -22,6 +22,7 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import {getRpDetailByUserMapId} from '@/api/designPlatform';
export default {
name: 'MenuSchema',
@ -84,20 +85,35 @@ export default {
},
methods: {
loadRunData(opt) {
debugger;
this.$store.dispatch('runPlan/clear').then(() => {
if (opt && opt.skinCode) {
this.viewDisabled = true;
getStationListBySkinCode(opt.skinCode).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
if (this.$route.params.mode == 'plan') {
//
queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
// debugger;
if(this.$route.query.from=="user"){
//
getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
}else{
//
queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
}
} else {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);

View File

@ -26,6 +26,7 @@
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan';
import {getRpDetailByUserMapId,getUserMapDetailByMapId} from '@/api/designPlatform';
import { loadMapData } from '@/utils/loaddata';
import { getPublishMapInfo } from '@/api/jmap/map';
import DataTable from './menus/components/dataTable';
@ -351,9 +352,16 @@ export default {
},
async loadChartPage() {
try {
getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
});
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
getUserMapDetailByMapId(this.$route.query.mapId).then(resp => {
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
});
}
else{
getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
});
}
this.planConvert = this.$theme.loadPlanConvert(this.skinCode);
this.$store.dispatch('runPlan/clear').then(() => {
this.loadInitChart().then(() => {
@ -364,16 +372,32 @@ export default {
this.loadInitData();
if (this.planId) {
this.myChart && this.myChart.showLoading();
queryRunPlan(this.planId).then(rest => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.loadChartData();
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
getRpDetailByUserMapId(this.planId).then(rest => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.loadChartData();
this.myChart && this.myChart.hideLoading();
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}else{
queryRunPlan(this.planId).then(rest => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.loadChartData();
this.myChart && this.myChart.hideLoading();
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
}
} else {
this.clearCanvas();
}

View File

@ -22,6 +22,8 @@
import { planEffectiveCheck, runPlanNotify } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
import {runUserPlanNotify } from '@/api/designPlatform';
export default {
name: 'PlanStatusBar',
@ -131,15 +133,31 @@ export default {
//
async handleTestRunPlan() {
const data = { planId: this.$route.query.planId };
runPlanNotify(data).then(resp => {
const query = {
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
});
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
runUserPlanNotify(data).then(resp => {
const query = {
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId,from:'user'
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
});
}else{
runPlanNotify(data).then(resp => {
const query = {
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId,from:'public'
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
});
}
}
}
};