运行图设计代码调整
This commit is contained in:
parent
713f411ffc
commit
11226b84ab
@ -100,8 +100,7 @@ export default {
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
setSessionStorage('designType', 'runPlanDesign');
|
||||
// ?skinCode=${obj.skinCode}
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}` });
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
case 'map': {
|
||||
@ -152,7 +151,7 @@ export default {
|
||||
name: this.$t('designPlatform.runPlanDesign'),
|
||||
type: 'runPlanDesign',
|
||||
mapId: elem.id,
|
||||
skinCode: elem.skinCode,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
|
@ -117,7 +117,7 @@ export default {
|
||||
type: 'runPlanDesign',
|
||||
mapId: elem.id,
|
||||
mapName: elem.name,
|
||||
skinCode: elem.skinCode
|
||||
lineCode: elem.lineCode
|
||||
}
|
||||
];
|
||||
});
|
||||
@ -139,8 +139,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
// ?skinCode=${obj.skinCode}
|
||||
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}` });
|
||||
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -78,9 +78,6 @@ export default {
|
||||
height() {
|
||||
return this.$store.state.app.height - 60 - 30;
|
||||
},
|
||||
// skinCode() {
|
||||
// return this.$route.query.skinCode || '02';
|
||||
// },
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
@ -92,7 +89,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
|
||||
},
|
||||
mounted() {
|
||||
this.getRunPlanList();
|
||||
|
@ -3,12 +3,12 @@
|
||||
<div class="nav" style="height:45px;">
|
||||
<template v-for="(item,i) in menus">
|
||||
<template v-if="noShowingChildren(item.children)">
|
||||
<li :key="i" class="nav-li" @click="hookClick(item)" v-if="isNotUser">
|
||||
<li v-if="isNotUser" :key="i" class="nav-li" @click="hookClick(item)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else >
|
||||
<li :key="i" class="nav-li" :class="{'menu_active' :i==classA}" @click.stop="popupMenuA(item, i)" v-if="isNotUser">
|
||||
<template v-else>
|
||||
<li :key="i" v-if="isNotUser" class="nav-li" :class="{'menu_active' :i==classA}" @click.stop="popupMenuA(item, i)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
<ul class="nav-ul" :class="{'active' :i==classA}">
|
||||
<template v-for="(child,j) in item.children">
|
||||
@ -120,403 +120,405 @@ import { UrlConfig } from '@/router/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'PlanMenuBar',
|
||||
props: {
|
||||
// skinCode: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// },
|
||||
planConvert: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true,
|
||||
classA: -1,
|
||||
classB: -1,
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
menuBase: [
|
||||
{
|
||||
title: this.$t('planMonitor.file'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('planMonitor.modifyStationIntervalTime'),
|
||||
click: this.handleModifyingStationIntervalTime
|
||||
// disabledCallback: () => { return !this.$route.query.planId },
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.view'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.tool'),
|
||||
children: [
|
||||
// {
|
||||
// title: '自动生成',
|
||||
// click: this.handleAutoGenerate,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.validityCheck'),
|
||||
click: this.handlePlanEffectiveCheck
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.testRunningDiagram'),
|
||||
click: this.handleTestRunPlan
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modify'),
|
||||
children: [
|
||||
// {
|
||||
// title: '计划参数',
|
||||
// click: this.handleParameter,
|
||||
// },
|
||||
// {
|
||||
// title: '打印参数',
|
||||
// click: this.undeveloped,
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.addPlan'),
|
||||
click: this.handleAddPlanningTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deletePlan'),
|
||||
click: this.handleDeletePlanningTrain
|
||||
},
|
||||
// {
|
||||
// title: '修改计划',
|
||||
// click: this.handleEditPlanningTrain,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.duplicatePlan'),
|
||||
click: this.handleDuplicateTrain
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.addTask'),
|
||||
click: this.handleAddTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deleteTask'),
|
||||
click: this.handleDeleteTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modifyTask'),
|
||||
click: this.handleModifyingTask
|
||||
}
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// title: '修改交路',
|
||||
// click: this.handleModifyingRouting,
|
||||
// },
|
||||
// {
|
||||
// title: '修改开始时间',
|
||||
// click: this.handleModifyingStartTime,
|
||||
// },
|
||||
// {
|
||||
// title: '快速增加任务',
|
||||
// click: this.undeveloped,
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.option'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.help'),
|
||||
children: [
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
created(){
|
||||
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
|
||||
this.isNotUser=false;
|
||||
}else{
|
||||
this.isNotUser=true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
tempClassA() {
|
||||
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
|
||||
},
|
||||
tempClassB() {
|
||||
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
|
||||
},
|
||||
'$store.state.menuOperation.break': function (val) {
|
||||
if (val) {
|
||||
this.classA = this.classB = -1;
|
||||
} else {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$route.query.planId': function () {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
name: 'PlanMenuBar',
|
||||
props: {
|
||||
// skinCode: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// },
|
||||
planConvert: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true,
|
||||
classA: -1,
|
||||
classB: -1,
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
menuBase: [
|
||||
{
|
||||
title: this.$t('planMonitor.file'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('planMonitor.modifyStationIntervalTime'),
|
||||
click: this.handleModifyingStationIntervalTime
|
||||
// disabledCallback: () => { return !this.$route.query.planId },
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.view'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.tool'),
|
||||
children: [
|
||||
// {
|
||||
// title: '自动生成',
|
||||
// click: this.handleAutoGenerate,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.validityCheck'),
|
||||
click: this.handlePlanEffectiveCheck
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.testRunningDiagram'),
|
||||
click: this.handleTestRunPlan
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modify'),
|
||||
children: [
|
||||
// {
|
||||
// title: '计划参数',
|
||||
// click: this.handleParameter,
|
||||
// },
|
||||
// {
|
||||
// title: '打印参数',
|
||||
// click: this.undeveloped,
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.addPlan'),
|
||||
click: this.handleAddPlanningTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deletePlan'),
|
||||
click: this.handleDeletePlanningTrain
|
||||
},
|
||||
// {
|
||||
// title: '修改计划',
|
||||
// click: this.handleEditPlanningTrain,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.duplicatePlan'),
|
||||
click: this.handleDuplicateTrain
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.addTask'),
|
||||
click: this.handleAddTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deleteTask'),
|
||||
click: this.handleDeleteTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modifyTask'),
|
||||
click: this.handleModifyingTask
|
||||
}
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// title: '修改交路',
|
||||
// click: this.handleModifyingRouting,
|
||||
// },
|
||||
// {
|
||||
// title: '修改开始时间',
|
||||
// click: this.handleModifyingStartTime,
|
||||
// },
|
||||
// {
|
||||
// title: '快速增加任务',
|
||||
// click: this.undeveloped,
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.option'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.help'),
|
||||
children: [
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.isNotUser = false;
|
||||
} else {
|
||||
this.isNotUser = true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
tempClassA() {
|
||||
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
|
||||
},
|
||||
tempClassB() {
|
||||
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
|
||||
},
|
||||
'$store.state.menuOperation.break': function (val) {
|
||||
if (val) {
|
||||
this.classA = this.classB = -1;
|
||||
} else {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$route.query.planId': function () {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
this.$router.go(-1);
|
||||
},
|
||||
menuConvert(menuBase) {
|
||||
const menus = [];
|
||||
menuBase.forEach(elem => {
|
||||
const item = {};
|
||||
Object.keys(elem).forEach(key => {
|
||||
if (key == 'disabledCallback') {
|
||||
item['disabled'] = elem.disabledCallback();
|
||||
} else if (key != 'children') {
|
||||
item[key] = elem[key];
|
||||
} else {
|
||||
item.children = this.menuConvert(elem.children || []);
|
||||
}
|
||||
});
|
||||
menus.push(item);
|
||||
});
|
||||
},
|
||||
menuConvert(menuBase) {
|
||||
const menus = [];
|
||||
menuBase.forEach(elem => {
|
||||
const item = {};
|
||||
Object.keys(elem).forEach(key => {
|
||||
if (key == 'disabledCallback') {
|
||||
item['disabled'] = elem.disabledCallback();
|
||||
} else if (key != 'children') {
|
||||
item[key] = elem[key];
|
||||
} else {
|
||||
item.children = this.menuConvert(elem.children || []);
|
||||
}
|
||||
});
|
||||
menus.push(item);
|
||||
});
|
||||
|
||||
return menus;
|
||||
},
|
||||
initMenu() {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
this.clickEvent();
|
||||
this.closeMenu();
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.closeMenu(false);
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu() {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.closeMenu();
|
||||
// launchFullscreen();
|
||||
if (!item.disabled) {
|
||||
setTimeout(() => {
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
popupMenuA(item, index) {
|
||||
this.clickEvent();
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.tempClassB = index;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.title][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.click(file);
|
||||
obj.value = '';
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('closeMenu');
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert( this.$t('planMonitor.implemented'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
loadingScreen() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('tip.underImport'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 修改站间运行时间
|
||||
handleModifyingStationIntervalTime() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
},
|
||||
// 自动生成
|
||||
handleAutoGenerate() {
|
||||
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });
|
||||
},
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 计划参数
|
||||
handleParameter() {
|
||||
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint')+serviceNumber+'?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 修改计划
|
||||
handleEditPlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改交路
|
||||
handleModifyingRouting() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingRouting', params });
|
||||
},
|
||||
// 修改开始时间
|
||||
handleModifyingStartTime() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingBeginTime', params });
|
||||
}
|
||||
}
|
||||
return menus;
|
||||
},
|
||||
initMenu() {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
this.clickEvent();
|
||||
this.closeMenu();
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.closeMenu(false);
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu() {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.closeMenu();
|
||||
// launchFullscreen();
|
||||
if (!item.disabled) {
|
||||
setTimeout(() => {
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
popupMenuA(item, index) {
|
||||
this.clickEvent();
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.tempClassB = index;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.title][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.click(file);
|
||||
obj.value = '';
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('closeMenu');
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert( this.$t('planMonitor.implemented'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
loadingScreen() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('tip.underImport'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 修改站间运行时间
|
||||
handleModifyingStationIntervalTime() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
},
|
||||
// 自动生成
|
||||
handleAutoGenerate() {
|
||||
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });
|
||||
},
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
// skinCode: this.$route.query.skinCode,
|
||||
const query = {
|
||||
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
debugger;
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
});
|
||||
},
|
||||
// 计划参数
|
||||
handleParameter() {
|
||||
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint') + serviceNumber + '?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 修改计划
|
||||
handleEditPlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改交路
|
||||
handleModifyingRouting() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingRouting', params });
|
||||
},
|
||||
// 修改开始时间
|
||||
handleModifyingStartTime() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingBeginTime', params });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -222,6 +222,8 @@ export default {
|
||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
|
||||
console.log(jsonData);
|
||||
|
||||
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
|
||||
that.loadingDig.close();
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
|
@ -13,28 +13,28 @@ import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'PlanTitleBar',
|
||||
data() {
|
||||
return {
|
||||
mapName: '',
|
||||
logoImg: logo_
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
runPlanName() {
|
||||
return this.$route.query.planName || '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = resp.data.name;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
}
|
||||
}
|
||||
name: 'PlanTitleBar',
|
||||
data() {
|
||||
return {
|
||||
mapName: '',
|
||||
logoImg: logo_
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
runPlanName() {
|
||||
return this.$route.query.planName || '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = resp.data.name;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
|
@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.commandData.param.signal = em.code;
|
||||
this.commandData.param.signal = em.name;
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user