2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
2019-08-02 10:36:17 +08:00
|
|
|
<div id="PlanMenuBar">
|
2019-10-08 14:12:53 +08:00
|
|
|
<div class="nav" style="height:45px;">
|
2019-08-02 10:36:17 +08:00
|
|
|
<template v-for="(item,i) in menus">
|
|
|
|
<template v-if="noShowingChildren(item.children)">
|
2019-11-08 14:35:58 +08:00
|
|
|
<li v-if="isNotUser" :key="i" class="nav-li" @click="hookClick(item)">
|
2019-08-02 10:36:17 +08:00
|
|
|
<span class="nav-li-text">{{ item.title }}</span>
|
|
|
|
</li>
|
|
|
|
</template>
|
2019-11-08 14:35:58 +08:00
|
|
|
<template v-else>
|
2019-11-08 15:17:04 +08:00
|
|
|
<li v-if="isNotUser" :key="i" class="nav-li" :class="{'menu_active' :i==classA}" @click.stop="popupMenuA(item, i)">
|
2019-08-02 10:36:17 +08:00
|
|
|
<span class="nav-li-text">{{ item.title }}</span>
|
|
|
|
<ul class="nav-ul" :class="{'active' :i==classA}">
|
|
|
|
<template v-for="(child,j) in item.children">
|
|
|
|
<template
|
|
|
|
v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)"
|
|
|
|
>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-if="child.type === 'separator'" :key="j" class="menu-separator">
|
2019-08-02 10:36:17 +08:00
|
|
|
<span class="separator"> </span>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else-if="child.type === 'file'" :key="j" class="menu-li">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="child.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<el-button type="text" class="button" :disabled="child.disabled">
|
|
|
|
<input
|
|
|
|
:ref="child.label"
|
|
|
|
type="file"
|
|
|
|
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
|
@change="openLoadFile(child)"
|
|
|
|
>
|
|
|
|
<span> {{ child.title }}</span>
|
|
|
|
</el-button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else :key="j" class="menu-li" @click.stop="popupMenuB(child, j)">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="child.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<span class="label">{{ child.title }}</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<ul class="menu-ul" :class="{'active' :j==classB}">
|
|
|
|
<template v-for="(grandchild,k) in child.children">
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator">
|
2019-08-02 10:36:17 +08:00
|
|
|
<span class="separator"> </span>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else-if="grandchild.type === 'file'" :key="k" class="menu-li">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="grandchild.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<el-button
|
|
|
|
type="text"
|
|
|
|
class="button"
|
|
|
|
:disabled="grandchild.disabled"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
:ref="grandchild.label"
|
|
|
|
type="file"
|
|
|
|
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
|
@change="openLoadFile(grandchild)"
|
|
|
|
>
|
|
|
|
<span> {{ grandchild.title }}</span>
|
|
|
|
</el-button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else :key="k" class="menu-li" @click.stop="hookClick(grandchild)">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="grandchild.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<span class="label">{{ grandchild.title }}</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</template>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
<template v-else>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-if="child.type === 'separator'" :key="j" class="menu-separator">
|
2019-08-02 10:36:17 +08:00
|
|
|
<span class="separator"> </span>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else-if="child.type === 'file'" :key="j" class="menu-li">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="child.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<el-button type="text" class="button" :disabled="child.disabled">
|
|
|
|
<input
|
|
|
|
:ref="child.title"
|
|
|
|
type="file"
|
|
|
|
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
|
@change="openLoadFile(child)"
|
|
|
|
>
|
|
|
|
<span> {{ child.title }}</span>
|
|
|
|
</el-button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-08-08 13:36:53 +08:00
|
|
|
<li v-else :key="j" class="menu-li" @click.stop="hookClick(child)">
|
2019-08-02 10:36:17 +08:00
|
|
|
<div class="menu-li-block" :disabled="child.disabled">
|
|
|
|
<span class="menu-li-text">
|
|
|
|
<span class="label">{{ child.title }}</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
2019-08-02 10:36:17 +08:00
|
|
|
</template>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</template>
|
|
|
|
</template>
|
2019-08-13 15:54:26 +08:00
|
|
|
<div class="nav-li" style="position: absolute; right: 10px;" @click="back">
|
2020-08-14 10:55:32 +08:00
|
|
|
<span class="nav-li-text">{{ dispaly?'关闭':$t('global.back') }}</span>
|
2019-08-13 15:54:26 +08:00
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</div>
|
2019-08-02 10:36:17 +08:00
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
2019-08-02 10:36:17 +08:00
|
|
|
import { mapGetters } from 'vuex';
|
2019-10-30 14:00:50 +08:00
|
|
|
import { planEffectiveCheck, runPlanNotify } from '@/api/runplan';
|
2019-08-02 10:36:17 +08:00
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
2020-03-30 13:07:11 +08:00
|
|
|
import { UrlConfig } from '@/scripts/ConstDic';
|
2019-08-02 10:58:28 +08:00
|
|
|
import { EventBus } from '@/scripts/event-bus';
|
2020-08-14 10:55:32 +08:00
|
|
|
import { publishRunPlan, deleteRunPlan } from '@/api/designPlatform';
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-02 10:36:17 +08:00
|
|
|
export default {
|
2019-11-08 14:35:58 +08:00
|
|
|
name: 'PlanMenuBar',
|
|
|
|
props: {
|
|
|
|
planConvert: {
|
|
|
|
type: Object,
|
|
|
|
default: function() {
|
|
|
|
return { };
|
|
|
|
}
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
runPlanList: {
|
|
|
|
type: Array,
|
|
|
|
default: function() {
|
|
|
|
return [];
|
|
|
|
}
|
2020-08-14 18:30:04 +08:00
|
|
|
},
|
|
|
|
loadRunPlanId: {
|
|
|
|
type: String,
|
|
|
|
default: function() {
|
|
|
|
return '';
|
|
|
|
}
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
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 },
|
2020-02-10 16:27:43 +08:00
|
|
|
},
|
|
|
|
{
|
2020-08-14 10:55:32 +08:00
|
|
|
title: '填充通用数据',
|
|
|
|
click: this.populatingGenericData
|
2020-02-10 16:27:43 +08:00
|
|
|
// disabledCallback: () => { return !this.$route.query.planId },
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '创建运行图',
|
|
|
|
click: this.newRunPlan
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '修改名称',
|
|
|
|
click: this.modifyRunPlanName
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
// {
|
|
|
|
// type: 'separator'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: '修改交路',
|
|
|
|
// click: this.handleModifyingRouting,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: '修改开始时间',
|
|
|
|
// click: this.handleModifyingStartTime,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: '快速增加任务',
|
|
|
|
// click: this.undeveloped,
|
|
|
|
// }
|
|
|
|
]
|
|
|
|
}
|
2020-08-14 10:55:32 +08:00
|
|
|
// {
|
|
|
|
// title: this.$t('planMonitor.option'),
|
|
|
|
// children: [
|
|
|
|
// ]
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: this.$t('planMonitor.help'),
|
|
|
|
// children: [
|
|
|
|
// ]
|
|
|
|
// }
|
2019-11-08 14:35:58 +08:00
|
|
|
]
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters('training', [
|
|
|
|
'mode'
|
|
|
|
]),
|
|
|
|
...mapGetters('map', [
|
|
|
|
'stationList'
|
2020-08-14 10:55:32 +08:00
|
|
|
]),
|
|
|
|
dispaly() {
|
|
|
|
return this.$route.path.includes('display');
|
|
|
|
}
|
2019-11-08 14:35:58 +08:00
|
|
|
},
|
|
|
|
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);
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
runPlanList() {
|
|
|
|
this.initMenu();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
|
|
|
this.isNotUser = false;
|
|
|
|
} else {
|
|
|
|
this.isNotUser = true;
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.initMenu();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
back() {
|
|
|
|
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
2020-08-14 10:55:32 +08:00
|
|
|
if (this.dispaly) {
|
|
|
|
this.$emit('doClose');
|
|
|
|
} else {
|
|
|
|
this.$router.go(-1);
|
|
|
|
}
|
2019-11-08 14:35:58 +08:00
|
|
|
},
|
|
|
|
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);
|
|
|
|
});
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-11-08 14:35:58 +08:00
|
|
|
return menus;
|
|
|
|
},
|
|
|
|
initMenu() {
|
2020-08-17 18:12:51 +08:00
|
|
|
this.menus = this.menuConvert(this.menuBase);
|
2019-11-08 14:35:58 +08:00
|
|
|
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();
|
|
|
|
if (!item.disabled) {
|
|
|
|
setTimeout(() => {
|
|
|
|
if (item && typeof item.click == 'function') {
|
2020-08-14 10:55:32 +08:00
|
|
|
item.click(item);
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
}, 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: {} });
|
|
|
|
},
|
2020-08-14 10:55:32 +08:00
|
|
|
// 填充计划运行图
|
|
|
|
populatingGenericData() {
|
|
|
|
this.$emit('dispatchDialog', { name: 'populatingGenericData', params: {} });
|
|
|
|
},
|
|
|
|
newRunPlan() {
|
|
|
|
this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {}});
|
2020-02-10 16:27:43 +08:00
|
|
|
},
|
2019-11-08 14:35:58 +08:00
|
|
|
// 自动生成
|
|
|
|
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,
|
2019-11-14 15:54:58 +08:00
|
|
|
contextList: resp.data.length > 0 ? resp.data : ['检查成功']
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 测试运行图
|
|
|
|
async handleTestRunPlan() {
|
2020-08-14 18:30:04 +08:00
|
|
|
const data = { planId: this.$route.query.planId || this.loadRunPlanId };
|
2019-11-08 14:35:58 +08:00
|
|
|
runPlanNotify(data).then(resp => {
|
|
|
|
const query = {
|
|
|
|
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
|
|
|
};
|
2020-11-12 19:04:57 +08:00
|
|
|
// this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
|
|
|
this.$router.push({ path: `${UrlConfig.displayNew}/plan`, query: query });
|
2019-11-08 14:35:58 +08:00
|
|
|
launchFullscreen();
|
|
|
|
}).catch(error => {
|
|
|
|
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 计划参数
|
|
|
|
handleParameter() {
|
|
|
|
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
|
|
|
},
|
|
|
|
// 添加计划
|
|
|
|
handleAddPlanningTrain() {
|
2020-08-14 18:30:04 +08:00
|
|
|
const planId = this.$route.query.planId || this.loadRunPlanId;
|
2019-11-08 14:35:58 +08:00
|
|
|
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'));
|
|
|
|
}
|
|
|
|
},
|
2020-08-14 10:55:32 +08:00
|
|
|
modifyRunPlanName() {
|
|
|
|
this.$emit('modifyRunPlanName');
|
|
|
|
},
|
2019-11-08 14:35:58 +08:00
|
|
|
// 修改交路
|
|
|
|
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 });
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
loadingRunPlan(param) {
|
|
|
|
this.$emit('loadingRunPlan', param);
|
|
|
|
},
|
|
|
|
deleteRunPlanOperate(param) {
|
|
|
|
// 删除运行图
|
|
|
|
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
|
|
|
|
confirmButtonText: this.$t('tip.confirm'),
|
|
|
|
cancelButtonText: this.$t('tip.cancel'),
|
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
deleteRunPlan(param.planId).then(Response => {
|
|
|
|
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
|
|
|
|
this.$emit('checkIsLoadRunPlan', param.planId);
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
|
|
|
});
|
2020-08-17 18:12:51 +08:00
|
|
|
}).catch(() => {
|
|
|
|
this.$message.error('删除运行图失败!');
|
|
|
|
});
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
publishRunPlan(param) {
|
|
|
|
this.$confirm(this.$t('tip.publishRunPlanTips'), this.$t('tip.hint'), {
|
|
|
|
confirmButtonText: this.$t('tip.confirm'),
|
|
|
|
cancelButtonText: this.$t('tip.cancel'),
|
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
publishRunPlan(param.planId, {runPlanName: param.planName}).then(resp => {
|
|
|
|
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('tip.publishRunPlanFail'));
|
|
|
|
});
|
|
|
|
});
|
2019-11-08 14:35:58 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-02 10:36:17 +08:00
|
|
|
};
|
2019-07-26 13:32:43 +08:00
|
|
|
</script>
|
|
|
|
|
2019-08-02 10:36:17 +08:00
|
|
|
<style scoped rel="stylesheet/scss" lang="scss">
|
2019-07-26 13:32:43 +08:00
|
|
|
@import "src/styles/mixin.scss";
|
2019-08-13 15:54:26 +08:00
|
|
|
$top: 0px;
|
2019-07-26 13:32:43 +08:00
|
|
|
$width: 30px;
|
2019-08-13 15:54:26 +08:00
|
|
|
$height: 40px;
|
|
|
|
$menuPadding: 15px;
|
2019-07-26 13:32:43 +08:00
|
|
|
$menuItemHeight: 30px;
|
|
|
|
$menuItemWidth: 160px;
|
|
|
|
$menuItemPadding: 5px;
|
|
|
|
|
|
|
|
#PlanMenuBar {
|
|
|
|
width: 100%;
|
|
|
|
line-height: $height;
|
2019-11-15 15:45:40 +08:00
|
|
|
position: absolute;
|
|
|
|
z-index: 2;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav {
|
|
|
|
display: block;
|
|
|
|
cursor: pointer;
|
|
|
|
list-style: none;
|
2019-08-13 15:54:26 +08:00
|
|
|
// border: 1px solid #B6BCCC !important;
|
|
|
|
background-color: #293c55;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding-left: 20px;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-li {
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2019-08-13 15:54:26 +08:00
|
|
|
padding: 0 $menuPadding;
|
|
|
|
color: rgba(255,255,255,0.45);
|
|
|
|
border-top: 4px solid #293c55;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-li.menu_active {
|
|
|
|
border-top: 4px solid #a9334c;
|
|
|
|
background-color: #0e151f;
|
|
|
|
transition: 0.5s all;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-li:hover {
|
|
|
|
border-top: 4px solid #a9334c;
|
|
|
|
background-color: #0e151f;
|
|
|
|
transition: 0.5s all;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
2019-08-13 15:54:26 +08:00
|
|
|
.nav-li:hover .nav-li-text{
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-li.menu_active .nav-li-text {
|
|
|
|
color: #fff;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-li-text {
|
|
|
|
font-size: 13px;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-ul {
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
list-style: none;
|
|
|
|
border: 1px solid gray;
|
|
|
|
width: $menuItemWidth;
|
|
|
|
padding: 0px;
|
|
|
|
margin: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-ul {
|
|
|
|
display: none;
|
|
|
|
list-style: none;
|
|
|
|
background: #F0F0F0;
|
|
|
|
line-height: $menuItemHeight;
|
|
|
|
width: $menuItemWidth;
|
|
|
|
bottom: $menuItemHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
.active {
|
|
|
|
position: absolute;
|
2019-08-13 15:54:26 +08:00
|
|
|
left: 0;
|
2019-07-26 13:32:43 +08:00
|
|
|
display: block !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-ul-text {
|
|
|
|
font-size: 14px;
|
|
|
|
letter-spacing: 0;
|
|
|
|
height: $menuItemHeight;
|
|
|
|
line-height: $menuItemHeight;
|
|
|
|
border-left: 1px solid #000;
|
|
|
|
border-right: 1px solid #000;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-separator {
|
|
|
|
text-align: left;
|
|
|
|
background: #F0F0F0;
|
|
|
|
height: 2px;
|
|
|
|
line-height: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-separator .status {
|
|
|
|
display: inline-block;
|
|
|
|
border-right: 1px inset #CACACA;
|
|
|
|
width: $width;
|
|
|
|
height: 100%;
|
|
|
|
background: #EFECDE;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-separator .separator {
|
|
|
|
display: inline-block;
|
2019-08-13 15:54:26 +08:00
|
|
|
background: #293c55;
|
|
|
|
// margin-left: 5px;
|
2019-07-26 13:32:43 +08:00
|
|
|
height: 2px;
|
2019-08-13 15:54:26 +08:00
|
|
|
width: 100%;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li {
|
|
|
|
text-align: left;
|
2019-08-13 15:54:26 +08:00
|
|
|
background: #162436;
|
2019-07-26 13:32:43 +08:00
|
|
|
height: $menuItemHeight;
|
|
|
|
line-height: $menuItemHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li-block {
|
|
|
|
letter-spacing: 0;
|
|
|
|
height: $menuItemHeight;
|
|
|
|
line-height: $menuItemHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li-text {
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li-text .label {
|
|
|
|
display: inline-block;
|
|
|
|
margin-left: 5px;
|
2019-08-13 15:54:26 +08:00
|
|
|
padding-left: 12px;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li-text .button {
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
line-height: 0px;
|
2019-08-13 15:54:26 +08:00
|
|
|
width: 100%;
|
|
|
|
top: 0;
|
|
|
|
color:rgba(255,255,255,0.45);
|
2019-07-26 13:32:43 +08:00
|
|
|
cursor: pointer;
|
2019-08-13 15:54:26 +08:00
|
|
|
padding-left: 16px;
|
|
|
|
text-align: left;
|
2019-07-26 13:32:43 +08:00
|
|
|
|
|
|
|
input {
|
|
|
|
opacity: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
width: $menuItemWidth - $width - 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.menu-li-block:hover {
|
|
|
|
background: #C9DEF7;
|
2019-08-13 15:54:26 +08:00
|
|
|
color: #000;
|
2019-07-26 13:32:43 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
-moz-box-sizing: border-box;
|
|
|
|
-webkit-box-sizing: border-box;
|
|
|
|
}
|
2019-08-13 15:54:26 +08:00
|
|
|
|
|
|
|
.menu-li-text .button:hover{
|
|
|
|
color: #000;
|
|
|
|
}
|
2019-08-02 10:36:17 +08:00
|
|
|
</style>
|