This commit is contained in:
zyy 2020-02-13 12:14:49 +08:00
commit e5f78fd3e3
9 changed files with 539 additions and 265 deletions

View File

@ -485,3 +485,22 @@ export function querySignalStatus(group, params) {
params params
}); });
} }
/** 获取仿真运行图车次号列表 */
export function getTripNumberList(group) {
return request({
url: `/simulation/${group}/tripNumbers`,
method: 'get'
});
}
/** 根据车次号获取服务号 */
export function getServiceNumbersByTripNum(group, tripNumber) {
return request({
url: `/simulation/${group}/serviceNumber`,
method: 'get',
params: {
tripNumber: tripNumber
}
});
}

View File

@ -208,6 +208,10 @@ deviceState[deviceType.Train] = {
// State01: '01', /** 无报警 */ // State01: '01', /** 无报警 */
// State02: '02' /** 有报警 */ // State02: '02' /** 有报警 */
// }, // },
/** 是否停车 */
stop: true,
/** 所在区段code */
sectionCode: '',
/** 是否故障*/ /** 是否故障*/
fault: false /** 非故障*/ fault: false /** 非故障*/
}; };

View File

@ -106,13 +106,13 @@ class Painter {
var oldTrainWindowModel = null; var oldTrainWindowModel = null;
var instance = device.instance; var instance = device.instance;
var curModel = device; var curModel = device;
if (instance) { if (instance) {
oldTrainWindowModel = device.trainWindowModel; oldTrainWindowModel = device.trainWindowModel;
} }
if (curModel.sectionCode) { if (curModel.sectionCode) {
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode); curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
curModel.trainWindowCode = curModel.sectionModel.trainWindowCode;
} }
if (curModel.trainWindowCode) { if (curModel.trainWindowCode) {

View File

@ -1,16 +1,19 @@
<template> <template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose" <el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form"> <el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;display:flex;flex-dorection:row"> <div style="width: 96%;">
<!-- <el-form-item label="车 组 号:" label-width="95px" prop="tripNumber"> <el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.tripNumber" disabled></el-input> <el-input v-model="addModel.trainCode" />
</el-form-item> --> </el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="trainSource"> <el-form-item label="服 务 号:" label-width="95px" prop="serverNumber">
<el-input v-model="addModel.trainSource" :id="domIdTrainSource" @change="handerTrainSource"></el-input> <el-input v-model="addModel.serverNumber" />
</el-form-item> </el-form-item>
</div> <el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
</el-form> <el-input v-model="addModel.tripNumber" />
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
@ -24,8 +27,8 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
// name: 'TrainMove', // name: 'TrainMove',
@ -35,34 +38,26 @@
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
tripNumber: '', trainCode: '', //
trainSource: '', serverNumber: '', //
stationStandSource: '', tripNumber: '' //
trainGoal: '', },
stationStandGoal: '',
},
rules: { rules: {
// tripNumber: [ trainCode: [
// { required: true, message: '', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
// ], ],
trainSource: [ serverNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入服务号', trigger: 'change' }
], ],
// stationStandSource: [ tripNumber: [
// { required: true, message: '', trigger: 'change' } { required: true, message: '请输入车次号', trigger: 'blur' }
// ], ]
// trainGoal: [ },
// { required: true, message: '', trigger: 'blur' } dialogShow: false,
// ], loading: false
// stationStandGoal: [
// { required: true, message: '', trigger: 'change' }
// ],
},
dialogShow: false,
loading: false,
} }
}, },
computed: { computed: {
@ -78,12 +73,8 @@
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
}, },
domIdTrainSource() {
// return this.dialogShow ? OperationEvent.Train.trainSource.menu.domId : '';
return this.dialogShow ? OperationEvent.Train.setPlanTrainId.menu.domId : '';
},
title() { title() {
return '添加计划车' return '创建计划车'
} }
}, },
mounted() { mounted() {
@ -114,14 +105,18 @@
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { let operate = {
send: true, over: true,
type: MapDeviceType.Train.type, operation: OperationEvent.Train.createPlanTrain.menu.operation,
// operation: OperationEvent.Train.moveTrainId.menu.operation, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
operation: OperationEvent.Train.addPlanTrainId.menu.operation, param: {
trainCode: this.addModel.trainCode, //
serverNumber: this.addModel.serverNumber, //
tripNumber: this.addModel.tripNumber //
}
} }
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -21,7 +21,7 @@ import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MapDeviceType, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import TrainDelete from './dialog/trainDelete'; import TrainDelete from './dialog/trainDelete';
import TrainDefine from './dialog/trainDefine'; import TrainDefine from './dialog/trainDefine';
@ -35,6 +35,9 @@ import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork'; import TrainSetWork from './dialog/trainSetWork';
import TrainFlag from './dialog/trainFlag'; import TrainFlag from './dialog/trainFlag';
import { mouseCancelState } from './utils/menuItemStatus'; import { mouseCancelState } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'MenuTrain', name: 'MenuTrain',
@ -65,197 +68,207 @@ export default {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: {
local: [ Local: [
// {
// label: '',
// handler: this.addTrainId,
// disabledCallback: MenuDisabledState.Train.addTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.delTrainId,
// disabledCallback: MenuDisabledState.Train.delTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.editTrainId,
// disabledCallback: MenuDisabledState.Train.editTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.moveTrainId,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.setPlanTrain,
// disabledCallback: MenuDisabledState.Train.setPlanTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.setHeadTrain,
// disabledCallback: MenuDisabledState.Train.setHeadTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.setWorkTrain,
// disabledCallback: MenuDisabledState.Train.setWorkTrain,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.addPlanTrain,
// // disabledCallback: MenuDisabledState.Train.moveTrainId,
// disabledCallback: MenuDisabledState.Train.addPlanTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.deletePlanTrain,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.moveEventlyTrain,
// disabledCallback: MenuDisabledState.Train.moveEventlyTrain,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.trainToFlag,
// disabledCallback: MenuDisabledState.Train.trainToFlag,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.trainUnFlag,
// disabledCallback: MenuDisabledState.Train.trainUnFlag,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.undeveloped,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// }
{ {
label: '定义车组号', label: '新建计划车',
handler: this.addTrainId, handler: this.addPlanTrain,
disabledCallback: MenuDisabledState.Train.addTrainId, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
auth: { station: true, center: true } },
},
{
label: '删除车组号',
handler: this.delTrainId,
disabledCallback: MenuDisabledState.Train.delTrainId,
auth: { station: true, center: true }
},
{
label: '修改车组号',
handler: this.editTrainId,
disabledCallback: MenuDisabledState.Train.editTrainId,
auth: { station: true, center: true }
},
{
label: '移动车组号',
handler: this.moveTrainId,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '设置计划车',
handler: this.setPlanTrain,
disabledCallback: MenuDisabledState.Train.setPlanTrain,
auth: { station: true, center: true }
},
{
label: '设置头码车',
handler: this.setHeadTrain,
disabledCallback: MenuDisabledState.Train.setHeadTrain,
auth: { station: true, center: true }
},
{
label: '设置人工车',
handler: this.setWorkTrain,
disabledCallback: MenuDisabledState.Train.setWorkTrain,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '添加计划车',
// handler: this.undeveloped,
handler: this.addPlanTrain,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
disabledCallback: MenuDisabledState.Train.addPlanTrain,
auth: { station: true, center: true }
},
{
label: '删除计划车',
// handler: this.undeveloped,
handler: this.deletePlanTrain,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
label: '平移计划车',
// handler: this.undeveloped,
handler: this.moveEventlyTrain,
disabledCallback: MenuDisabledState.Train.moveEventlyTrain,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '标记重点列车',
handler: this.trainToFlag,
disabledCallback: MenuDisabledState.Train.trainToFlag,
auth: { station: true, center: true }
},
{
label: '取消标记重点列车',
handler: this.trainUnFlag,
disabledCallback: MenuDisabledState.Train.trainUnFlag,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '列车信息',
handler: this.undeveloped,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
}
], ],
central: [ Center: [
// {
// label: '',
// handler: this.addTrainId,
// disabledCallback: MenuDisabledState.Train.addTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.delTrainId,
// disabledCallback: MenuDisabledState.Train.delTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.editTrainId,
// disabledCallback: MenuDisabledState.Train.editTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.moveTrainId,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.setPlanTrain,
// disabledCallback: MenuDisabledState.Train.setPlanTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.setHeadTrain,
// disabledCallback: MenuDisabledState.Train.setHeadTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.setWorkTrain,
// disabledCallback: MenuDisabledState.Train.setWorkTrain,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.addPlanTrain,
// // disabledCallback: MenuDisabledState.Train.moveTrainId,
// disabledCallback: MenuDisabledState.Train.addPlanTrain,
// auth: { station: true, center: true }
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.deletePlanTrain,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
// {
// label: '',
// // handler: this.undeveloped,
// handler: this.moveEventlyTrain,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.trainToFlag,
// disabledCallback: MenuDisabledState.Train.trainToFlag,
// auth: { station: true, center: true }
// },
// {
// label: '',
// handler: this.trainUnFlag,
// disabledCallback: MenuDisabledState.Train.trainUnFlag,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.undeveloped,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
{ {
label: '定义车组号', label: '新建计划车',
handler: this.addTrainId, handler: this.addPlanTrain,
disabledCallback: MenuDisabledState.Train.addTrainId, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
auth: { station: true, center: true } },
},
{
label: '删除车组号',
handler: this.delTrainId,
disabledCallback: MenuDisabledState.Train.delTrainId,
auth: { station: true, center: true }
},
{
label: '修改车组号',
handler: this.editTrainId,
disabledCallback: MenuDisabledState.Train.editTrainId,
auth: { station: true, center: true }
},
{
label: '移动车组号',
handler: this.moveTrainId,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '设置计划车',
handler: this.setPlanTrain,
disabledCallback: MenuDisabledState.Train.setPlanTrain,
auth: { station: true, center: true }
},
{
label: '设置头码车',
handler: this.setHeadTrain,
disabledCallback: MenuDisabledState.Train.setHeadTrain,
auth: { station: true, center: true }
},
{
label: '设置人工车',
handler: this.setWorkTrain,
disabledCallback: MenuDisabledState.Train.setWorkTrain,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '添加计划车',
// handler: this.undeveloped,
handler: this.addPlanTrain,
// disabledCallback: MenuDisabledState.Train.moveTrainId,
disabledCallback: MenuDisabledState.Train.addPlanTrain,
auth: { station: true, center: true }
},
{
label: '删除计划车',
// handler: this.undeveloped,
handler: this.deletePlanTrain,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
label: '平移计划车',
// handler: this.undeveloped,
handler: this.moveEventlyTrain,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '标记重点列车',
handler: this.trainToFlag,
disabledCallback: MenuDisabledState.Train.trainToFlag,
auth: { station: true, center: true }
},
{
label: '取消标记重点列车',
handler: this.trainUnFlag,
disabledCallback: MenuDisabledState.Train.trainUnFlag,
auth: { station: true, center: true }
},
{
type: 'separator'
},
{
label: '列车信息',
handler: this.undeveloped,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
}
] ]
}, },
menuForce: [ menuForce: [
@ -306,17 +319,18 @@ export default {
}, },
initMenu() { initMenu() {
// //
this.menu = trainMenuFiltration(this.menuNormal); // this.menu = trainMenuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) { this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]; // if (this.operatemode === OperateMode.ADMIN) {
} // this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
// }
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed]; this.menu = [...this.menuForce, ...this.menuSpeed];
} }
this.menu = menuConvert(this.menu); // this.menu = menuConvert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -487,13 +501,14 @@ export default {
// //
addPlanTrain() { addPlanTrain() {
const operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, operation: OperationEvent.Train.createPlanTrain.menu.operation,
label: MapDeviceType.Train.label, param: {
operation: OperationEvent.Train.addPlanTrainId.menu.operation sectionCode: this.$store.state.map.trainWindowSectionCode
}; }
this.$store.dispatch('training/next', operate).then(({ valid }) => { };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(operate, this.selected); this.$refs.trainAddPlan.doShow(operate, this.selected);

View File

@ -0,0 +1,209 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="480px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
<el-form-item prop="trainCode" label="车组号:">
<!--<el-input v-model="addModel.trainCode"/>-->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-input v-model="serviceNumber" disabled="true"/>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default {
name: 'TrainCreateNumber',
mixins: [
CancelMouseState
],
data() {
return {
trainNoList: [],
selected: null,
sectionName: '',
tripNumberList: [],
serviceNumber: '',
addModel: {
trainCode:'',
tripNumber:''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'}
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '新建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) {
this.selected = selected;
//
this.serviceNumber = '';
this.addModel = {
trainCode:'',
tripNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
.el-dialog-div {
height: 300px;
overflow: auto;
}
</style>

View File

@ -8,6 +8,7 @@
<train-move-number ref="trainMoveNumber" /> <train-move-number ref="trainMoveNumber" />
<train-delete-number ref="trainDeleteNumber" /> <train-delete-number ref="trainDeleteNumber" />
<train-detail-info ref="trainDetailInfo" /> <train-detail-info ref="trainDetailInfo" />
<train-init-plan ref="trainInitPlan"/>
</div> </div>
</template> </template>
@ -15,16 +16,19 @@
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState } from './utils/menuItemStatus';
import TrainControl from './dialog/trainControl'; import TrainControl from './dialog/trainControl';
import TrainEditNumber from './dialog/trainEditNumber'; import TrainEditNumber from './dialog/trainEditNumber';
import TrainMoveNumber from './dialog/trainMoveNumber'; import TrainMoveNumber from './dialog/trainMoveNumber';
import TrainCreateNumber from './dialog/trainCreateNumber'; import TrainCreateNumber from './dialog/trainCreateNumber';
import TrainDeleteNumber from './dialog/trainDeleteNumber'; import TrainDeleteNumber from './dialog/trainDeleteNumber';
import TrainInitPlan from './dialog/trainInitPlan';
import TrainDetailInfo from './dialog/trainDetailInfo'; import TrainDetailInfo from './dialog/trainDetailInfo';
import CancelMouseState from '@/mixin/CancelMouseState'; import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default { export default {
name: 'MenuTrain', name: 'MenuTrain',
@ -36,7 +40,8 @@ export default {
TrainMoveNumber, TrainMoveNumber,
TrainCreateNumber, TrainCreateNumber,
TrainDeleteNumber, TrainDeleteNumber,
TrainDetailInfo TrainDetailInfo,
TrainInitPlan
}, },
mixins: [ mixins: [
CancelMouseState CancelMouseState
@ -53,8 +58,14 @@ export default {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: {
local: [], Local: [
central: [ {
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
],
Center: [
{ {
label: '新建车组号', label: '新建车组号',
handler: this.createTrainNo, handler: this.createTrainNo,
@ -114,8 +125,12 @@ export default {
handler: this.undeveloped, handler: this.undeveloped,
disabledCallback: MenuDisabledState.Train.moveTrainId, disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true} auth: { station: true, center: true}
},
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
} }
] ]
}, },
menuForce: [ menuForce: [
@ -166,14 +181,11 @@ export default {
}, },
initMenu() { initMenu() {
// //
this.menu = trainMenuFiltration(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed]; this.menu = this.menuForce;
} }
this.menu = menuConvert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -377,6 +389,23 @@ export default {
} }
}); });
}, },
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
undeveloped() { undeveloped() {
this.doClose(); this.doClose();
this.$alert('实现中......', '提示', { this.$alert('实现中......', '提示', {

View File

@ -203,6 +203,9 @@ const map = {
mapList: (state) => { mapList: (state) => {
return state.mapList; return state.mapList;
}, },
trainWindowSectionCode: (state) => {
return state.trainWindowSectionCode;
},
mapConfig: (state) => { mapConfig: (state) => {
return state.mapConfig; return state.mapConfig;
}, },
@ -467,8 +470,8 @@ const map = {
state.map && state.map &&
state.map.sectionList && state.map.sectionList.length) { state.map.sectionList && state.map.sectionList.length) {
state.map.sectionList.forEach(elem => { state.map.sectionList.forEach(elem => {
state.trainWindowSectionCode = elem.code;
if (elem.trainWindowCode == code) { if (elem.trainWindowCode == code) {
state.trainWindowSectionCode = elem.code;
if (state.map.stationList && state.map.stationList.length) { if (state.map.stationList && state.map.stationList.length) {
state.map.stationList.forEach(elems => { state.map.stationList.forEach(elems => {
if (elems.code == elem.stationCode) { if (elems.code == elem.stationCode) {

View File

@ -3,12 +3,12 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; BASE_API = 'http://b29z135112.zicp.vip';
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;
} }