This commit is contained in:
zyy 2020-06-17 17:48:33 +08:00
commit b39f278a5d
14 changed files with 111 additions and 1224 deletions

View File

@ -40,6 +40,7 @@ class Jlmap {
// 显示集中站
this.stationCode = '';
this.isUpdateShowTrainList = false;
}
// 初始化属性有鼠标事件 缩放等
@ -421,8 +422,9 @@ class Jlmap {
}
} else {
if (elem.deviceType === 'TRAIN') {
store.dispatch('map/updateTrainState', elem);
store.dispatch('map/setActiveTrainList', elem);
this.isUpdateShowTrainList = true;
store.dispatch('map/updateTrainList', elem);
// store.dispatch('map/updateTrainState', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);
}
@ -436,6 +438,10 @@ class Jlmap {
}
}
});
if (this.isUpdateShowTrainList) {
store.dispatch('map/setActiveTrainList');
this.isUpdateShowTrainList = false;
}
this.handleRouteSignalStatus(signalDeviceList);
// 状态后处理
this.postHandle(list || []);

View File

@ -1,344 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-run-level"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>站台状态</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
<el-table-column prop="name" :width="180" label="下一站台" />
<el-table-column prop="level" label="运行等级">
<template slot-scope="scope">
<el-select
:id="chooseLevelId"
v-model="scope.row.level"
size="mini"
@change="levelSelectChange(scope.row)"
>
<el-option
v-for="item in levelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="time" label="区间运行时间">
<template slot-scope="scope">
<el-select
:id="domIdChoose"
v-model="scope.row.time"
size="mini"
:disabled="scope.row.level == 0"
@change="timeSelectChange"
>
<el-option
v-for="item in timeList[scope.row.level]"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="check" label="一直有效">
<template slot-scope="scope">
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
</template>
</el-table-column>
</el-table>
</div>
<!-- <el-row class="button-group">
<span v-if="isSelect && tempData.length">提示: 未选中要设置运行等级的下一站台</span>
<span v-if="isConfirm && tempData.length">提示: 选中要设置运行等级的下一站台为{{tempData[0].name}}</span>
</el-row> -->
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StandRunLevel',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
maxRunLevel: 300,
stationName: '',
standName: '',
selection: [],
levelList: [
{
value: '0',
label: '自动'
},
{
value: '1',
label: '1'
},
{
value: '2',
label: '2'
},
{
value: '3',
label: '3'
},
{
value: '4',
label: '4'
}
],
isSelect: true,
isConfirm: false,
time: ''
};
},
computed: {
...mapGetters('map', [
'stationList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
chooseLevelId() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.chooseLevel.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
},
domIdCheck() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
},
title() {
return '设置运行等级';
},
timeList() {
const list = {
'0': [{ value: 0, label: '0' }],
'1': [], // 120 - 110
'2': [], // 100 - 90
'3': [], // 80 - 70
'4': [] // 60 - 50
};
for (let i = 110; i <= 120; i++) {
list['1'].push({ value: i, label: `${i}` });
}
for (let i = 90; i <= 100; i++) {
list['2'].push({ value: i, label: `${i}` });
}
for (let i = 70; i <= 80; i++) {
list['3'].push({ value: i, label: `${i}` });
}
for (let i = 50; i <= 60; i++) {
list['4'].push({ value: i, label: `${i}` });
}
return list;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getLevelByTime(time) {
return Object.keys(this.timeList).findIndex(key => {
return this.timeList[key].findIndex(obj => {
return obj.value === time;
}) >= 0;
}).toString();
},
loadInitData(selected, opts) {
this.tempData = [];
// const stationList = this.stationList.slice();
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { //
//
if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus ? opts.intervalRunTimeValidStatus : true });
}
} else {
//
if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus ? opts.intervalRunTimeValidStatus : true });
}
}
},
doShow(operate, selected, opts) {
this.selected = selected;
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.loadInitData(selected, opts);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
},
timeSelectChange(time) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
val: time.toString()
};
this.time = time.toString();
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
levelSelectChange(row) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation,
val: row.level.toString()
};
this.time = row.time = this.timeList[row.level][0].value;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkChange(check) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.check.operation,
val: check.toString()
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
if (this.isConfirm) {
this.loading = true;
commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: Number(this.time), runLevelTimeForever: !!this.tempData[0].check}, 2).then(({ valid })=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
} else {
this.doClose();
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,11 +1,11 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<stand-control ref="standControl" system-name="beijing-01__systerm" />
<stand-jump-stop-control ref="standJumpStopControl" system-name="beijing-01__systerm" />
<stand-control ref="standControl" :system-name="systemName" />
<stand-jump-stop-control ref="standJumpStopControl" :system-name="systemName" />
<stand-detail ref="standDetail" />
<stand-run-level ref="standRunLevel" />
<stand-stop-time ref="standStopTime" />
<stand-run-level ref="standRunLevel" :system-name="systemName" />
<stand-stop-time ref="standStopTime" :system-name="systemName" />
<notice-info ref="noticeInfo" />
<stand-back-strategy ref="standBackStrategy" />
</div>
@ -17,8 +17,8 @@ import StandControl from '@/jmapNew/theme/components/menus/dialog/standControl';
import StandJumpStopControl from '@/jmapNew/theme/components/menus/dialog/standJumpStopControl';
import StandBackStrategy from './dialog/standBackStrategy';
import StandDetail from './dialog/standDetail';
import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime';
import StandRunLevel from '@/jmapNew/theme/components/menus/dialog/standRunLevel';
import StandStopTime from '@/jmapNew/theme/components/menus/dialog/standStopTime';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
@ -51,6 +51,7 @@ export default {
data() {
return {
menu: [],
systemName:'beijing-01__systerm',
menuNormal: {
Local: [
],

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag :z-index="2000" :class="systemName+' stand-run-level'" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
@ -68,15 +68,21 @@
<script>
import { mapGetters } from 'vuex';
import ConfirmControl from './childDialog/confirmControl';
import ConfirmControl from '../childDialog/confirmControl';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'StandRunLevel',
components: {
ConfirmControl
},
props:{
systemName:{
type:String,
required:true
}
},
data() {
return {
dialogShow: false,

View File

@ -1,7 +1,7 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:class="systemName+' stand-stop-time'"
:title="title"
:visible.sync="show"
width="340px"
@ -68,16 +68,22 @@
</template>
<script>
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
// import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from '../childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'StandStopTime',
components: {
NoticeInfo
},
props:{
systemName:{
type:String,
required:true
}
},
data() {
return {
dialogShow: false,
@ -151,7 +157,7 @@ export default {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
// mouseCancelState(this.selected);
},
chooseControl(control) {
/** 自动时的默认时间*/

View File

@ -1,341 +0,0 @@
<template>
<el-dialog v-dialogDrag :z-index="2000" class="foshan-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>站台状态</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
<el-table-column prop="name" :width="180" label="下一站台" />
<el-table-column prop="level" label="运行等级">
<template slot-scope="scope">
<el-select :id="chooseLevelId" v-model="scope.row.level" size="mini" @change="levelSelectChange(scope.row)">
<el-option
v-for="item in levelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="time" label="区间运行时间">
<template slot-scope="scope">
<el-select
:id="domIdChoose"
v-model="scope.row.time"
size="mini"
:disabled="scope.row.level == 0"
@change="timeSelectChange"
>
<el-option
v-for="item in timeList[scope.row.level]"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="check" label="一直有效">
<template slot-scope="scope">
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
</template>
</el-table-column>
</el-table>
</div>
<!-- <el-row class="button-group">
<span v-if="isSelect && tempData.length">提示: 未选中要设置运行等级的下一站台</span>
<span v-if="isConfirm && tempData.length">提示: 选中要设置运行等级的下一站台为{{tempData[0].name}}</span>
</el-row> -->
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import ConfirmControl from './childDialog/confirmControl';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandRunLevel',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
maxRunLevel: 300,
stationName: '',
standName: '',
selection: [],
levelList: [
{
value: '0',
label: '自动'
},
{
value: '1',
label: '1'
},
{
value: '2',
label: '2'
},
{
value: '3',
label: '3'
},
{
value: '4',
label: '4'
}
],
isSelect: true,
isConfirm: false,
time: ''
};
},
computed: {
...mapGetters('map', [
'stationList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
chooseLevelId() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.chooseLevel.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
},
domIdCheck() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
},
title() {
return '设置运行等级';
},
timeList() {
const list = {
'0': [{ value: 0, label: '0' }],
'1': [], // 120 - 110
'2': [], // 100 - 90
'3': [], // 80 - 70
'4': [] // 60 - 50
};
for (let i = 110; i <= 120; i++) {
list['1'].push({ value: i, label: `${i}` });
}
for (let i = 90; i <= 100; i++) {
list['2'].push({ value: i, label: `${i}` });
}
for (let i = 70; i <= 80; i++) {
list['3'].push({ value: i, label: `${i}` });
}
for (let i = 50; i <= 60; i++) {
list['4'].push({ value: i, label: `${i}` });
}
return list;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getLevelByTime(time) {
const times = Object.keys(this.timeList).findIndex(key => {
return this.timeList[key].findIndex(obj => {
return obj.value == time;
}) >= 0;
}).toString();
return times == -1 ? '0' : times;
},
loadInitData(selected) {
this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { //
//
if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(selected.runLevelTime), time: selected.runLevelTime ? selected.runLevelTime : 0, check: !!selected.runLevelTimeForever });
}
} else {
//
if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(selected.runLevelTime), time: selected.runLevelTime ? selected.runLevelTime : 0, check: !!selected.runLevelTimeForever });
}
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.loadInitData(selected);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
checkTableDataSelction(data) { //
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
},
timeSelectChange(time) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
val: this.time
};
this.time = time;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
levelSelectChange(row) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation,
val: row.level
};
this.time = row.time = this.timeList[row.level][0].value;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkChange(check) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.check.operation,
val: check
};
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.isConfirm) {
const operate = {
over: true,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
param: {
runLevelTime: Number(this.time),
runLevelTimeForever: !!this.tempData[0].check
}
};
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, [error.message]);
});
} else {
this.doClose();
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,241 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="title" class="foshan-01__systerm stand-stop-time" :visible.sync="show" width="340px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>站台名称</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 73px;">
<span class="base-label" style="left: -9px;">模式</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="control" style="width: 40%;float: left;" @change="chooseControl">
<div style="margin-bottom: 10px;">
<el-radio :id="control === '01'? '': domIdChoose1" label="01">自动</el-radio>
</div>
<el-radio :id="control === '02'? '': domIdChoose1" label="02">全人工</el-radio>
</el-radio-group>
<el-input-number
:id="domIdInput"
v-model="time"
:disabled="disabledInput"
controls-position="right"
:min="0"
size="mini"
style="width: 130px; padding-left:30px;display: block; float: left; margin-top: 15px;"
@change="inputTime"
/>
<div style="float: left;margin-top: 22px; margin-left: 5px;"></div>
</div>
</div>
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
<span class="base-label" style="left: -9px;">有效次数</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
<el-radio :id="effective == '0'? '': domIdChoose2" label="0" name="effective">一次有效</el-radio>
<el-radio :id="effective == '1'? '': domIdChoose2" label="1" name="effective">一直有效</el-radio>
</el-radio-group>
</div>
</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>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandStopTime',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
time: 0,
control: '01',
direction: '01',
effective: '0',
selected: null,
standName: '',
stationName: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
},
domIdChoose1() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
},
domIdChoose2() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
},
domIdInput() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
},
disabledUp() {
if (this.selected) {
return this.selected.direction !== '02';
}
return true;
},
disabledDown() {
if (this.selected) {
return this.selected.direction !== '01';
}
return true;
},
disabledInput() {
return this.control === '01'; //
},
disabledTime() {
return this.control === '01'; //
},
title() {
return '停站时间';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected || {};
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.control = Number(selected.parkingTime) == -1 ? '01' : '02';
this.effective = selected.parkingAlwaysValid ? '1' : '0';
this.direction = selected.direction;
this.time = Number(selected.parkingTime) == -1 ? 15 : Number(selected.parkingTime);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
chooseControl(control) {
/** 自动时的默认时间*/
if (control == '01') {
this.time = 15;
this.effective = '1';
}
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
val: this.control
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
chooseEffective() {
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
val: this.effective
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
inputTime() {
const operate = {
repeat: true,
operation: OperationEvent.StationStand.setStopTime.input.operation,
val: this.time
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
param: {
parkingTime: this.control == '01' ? -1 : this.time,
parkingAlwaysValid: this.effective == '1'
}
};
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, [error.message]);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -1,11 +1,11 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<stand-control ref="standControl" system-name="foshan-01__systerm" />
<stand-jump-stop-control ref="standJumpStopControl" system-name="foshan-01__systerm" />
<stand-control ref="standControl" :system-name="systemName" />
<stand-jump-stop-control ref="standJumpStopControl" :system-name="systemName" />
<stand-detail ref="standDetail" />
<stand-run-level ref="standRunLevel" />
<stand-stop-time ref="standStopTime" />
<stand-run-level ref="standRunLevel" :system-name="systemName" />
<stand-stop-time ref="standStopTime" :system-name="systemName" />
<stand-back-strategy ref="standBackStrategy" />
<stand-detain-train-all ref="standDetainTrainAll" />
<notice-info ref="noticeInfo" />
@ -18,12 +18,12 @@ import StandControl from '@/jmapNew/theme/components/menus/dialog/standControl';
import StandJumpStopControl from '@/jmapNew/theme/components/menus/dialog/standJumpStopControl';
import StandBackStrategy from './dialog/standBackStrategy';
import StandDetail from './dialog/standDetail';
import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime';
import StandRunLevel from '@/jmapNew/theme/components/menus/dialog/standRunLevel';
import StandStopTime from '@/jmapNew/theme/components/menus/dialog/standStopTime';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import StandDetainTrainAll from './dialog/standDetainTrainAll';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
@ -53,6 +53,7 @@ export default {
data() {
return {
menu: [],
systemName:'foshan-01__systerm',
menuNormal: {
Local: [
{

View File

@ -1,228 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="title" class="ningbo-01__systerm stand-stop-time" :visible.sync="show" width="340px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>站台名称</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 73px;">
<span class="base-label" style="left: -9px;">模式</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="control" style="width: 40%;float: left;" @change="chooseControl">
<div style="margin-bottom: 10px;">
<el-radio :id="control === '01'? '': domIdChoose1" label="01">自动</el-radio>
</div>
<el-radio :id="control === '02'? '': domIdChoose1" label="02">全人工</el-radio>
</el-radio-group>
<el-input-number
:id="domIdInput"
v-model="time"
:disabled="disabledInput"
controls-position="right"
:min="0"
size="mini"
style="width: 130px; padding-left:30px;display: block; float: left; margin-top: 15px;"
@change="inputTime"
/>
<div style="float: left;margin-top: 22px; margin-left: 5px;"></div>
</div>
</div>
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
<span class="base-label" style="left: -9px;">有效次数</span>
<div style=" position: relative; top:-10px;">
<el-radio-group :id="domIdChoose2" v-model="effective" :disabled="disabledTime" @change="chooseEffective">
<el-radio :label="false" name="effective">一次有效</el-radio>
<el-radio :label="true" name="effective">一直有效</el-radio>
</el-radio-group>
</div>
</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>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'StandStopTime',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
time: 30,
control: '01',
direction: '01',
effective: true,
selected: null,
standName: '',
stationName: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
},
domIdChoose1() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
},
domIdChoose2() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
},
domIdInput() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
},
disabledUp() {
if (this.selected) {
return this.selected.direction !== '02';
}
return true;
},
disabledDown() {
if (this.selected) {
return this.selected.direction !== '01';
}
return true;
},
disabledInput() {
return this.control === '01'; //
},
disabledTime() {
return this.control === '01'; //
},
title() {
return '停站时间';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected || {};
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.control = selected.parkingTime == 0 ? '01' : '02';
this.time = selected.parkingTime ? Number(selected.parkingTime) : 30;
this.effective = selected.parkingAlwaysValid == '1';
this.direction = selected.direction;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
chooseControl(control) {
/** 自动时的默认时间*/
if (control == '01') {
this.time = 30;
this.effective = true;
}
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
val: `${control}`
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
chooseEffective(effective) {
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
val: `${effective}`
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
inputTime(time) {
const operate = {
operation: OperationEvent.StationStand.setStopTime.input.operation,
val: `${time}`
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
this.loading = true;
commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.time, parkingAlwaysValid: this.effective}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -1,11 +1,11 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<stand-control ref="standControl" system-name="ningbo-01__systerm" />
<stand-jump-stop-control ref="standJumpStopControl" system-name="ningbo-01__systerm" />
<stand-control ref="standControl" :system-name="systemName" />
<stand-jump-stop-control ref="standJumpStopControl" :system-name="systemName" />
<stand-detail ref="standDetail" />
<stand-run-level ref="standRunLevel" />
<stand-stop-time ref="standStopTime" />
<stand-run-level ref="standRunLevel" :system-name="systemName" />
<stand-stop-time ref="standStopTime" :system-name="systemName" />
<StandBulkBuckleTrain ref="standBulkBuckleTrain" />
<notice-info ref="noticeInfo" />
</div>
@ -16,8 +16,8 @@ import PopMenu from '@/components/PopMenu';
import StandControl from '@/jmapNew/theme/components/menus/dialog/standControl';
import StandJumpStopControl from '@/jmapNew/theme/components/menus/dialog/standJumpStopControl';
import StandDetail from './dialog/standDetail';
import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime';
import StandRunLevel from '@/jmapNew/theme/components/menus/dialog/standRunLevel';
import StandStopTime from '@/jmapNew/theme/components/menus/dialog/standStopTime';
import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from './utils/menuOperate';
@ -49,6 +49,7 @@ export default {
data() {
return {
menu: [],
systemName:'ningbo-01__systerm',
menuNormal: {
Local: [
{

View File

@ -205,7 +205,6 @@ const map = {
updateCount: 0, // 绘图快捷修改标识
mousemove: 0, // 实训战场图移动标识
version: '', // 地图版本,
activeTrainList:{}, // 当前按计划行车的列车列表,
activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识
runPlanStatus:false, // 是否正处于按计划行车
showCentralizedStationCode: '', // 现地分集中站显示(集中站code)
@ -727,12 +726,10 @@ const map = {
}
});
},
setActiveTrainList:(state, data) => {
state.activeTrainList[data.code] = data;
setActiveTrainList:(state) => {
state.activeTrainListUpdate++;
},
resetActiveTrainList:(state, data) => {
state.activeTrainList = {};
resetActiveTrainList:(state) => {
state.activeTrainListUpdate = 0;
},
setDeleteCount: (state) => {
@ -790,11 +787,11 @@ const map = {
updateAutoReentryState: (state, status) => {
state.autoReentryData[status.code] = deepAssign(state.autoReentryData[status.code], status);
},
updateTrainState:(state, status) =>{
if (state.map.trainList) {
state.map.trainList[parseInt(status.code) - 1] = deepAssign(state.map.trainList[parseInt(status.code) - 1] || {}, status);
}
},
// updateTrainState:(state, status) =>{
// if (state.map.trainList) {
// state.map.trainList[parseInt(status.code) - 1] = deepAssign(state.map.trainList[parseInt(status.code) - 1] || {}, status);
// }
// },
updateStationStand: (state, status) => {
const holdIndex = state.holdStandList.indexOf(status.code);
const jumpIndex = state.jumpStandList.indexOf(status.code);
@ -832,6 +829,14 @@ const map = {
state.flankProtectList.splice(index, 1);
}
});
},
updateTrainList: (state, data)=>{
const trainList = state.map.trainList;
trainList.forEach(elem => {
if (elem.code == data.code) {
elem = deepAssign(elem || {}, data);
}
});
}
},
@ -876,9 +881,9 @@ const map = {
updateAutoReentryState: ({ commit }, status) => {
commit('updateAutoReentryState', status);
},
updateTrainState:({ commit }, status) => {
commit('updateTrainState', status);
},
// updateTrainState:({ commit }, status) => {
// commit('updateTrainState', status);
// },
updateStationStand: ({ commit }, status) => {
commit('updateStationStand', status);
},
@ -906,6 +911,11 @@ const map = {
}
},
// 更新列车信息
updateTrainList:({ commit }, train) => {
commit('updateTrainList', train);
},
setMapDataIdList: ({ state }, data) => {
state.mapIdList[`mapDate_${data.mapId}`] = data.mapData;
},
@ -993,8 +1003,8 @@ const map = {
setDeleteCount: ({ commit }) => {
commit('setDeleteCount');
},
setActiveTrainList: ({ commit }, data) => {
commit('setActiveTrainList', data);
setActiveTrainList: ({ commit }) => {
commit('setActiveTrainList');
},
resetActiveTrainList: ({ commit }) => {
commit('resetActiveTrainList');

View File

@ -182,8 +182,8 @@ export default {
if (res.code == 200) {
if (res.data.memberList && res.data.memberList.length > 0) {
const lastData = JSON.stringify(res.data.memberList);
newMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
// newMemberList = playerList.filter(item => item.hasPlay === true);
const playerList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
newMemberList = playerList.filter(item => item.hasPlay === true);
}
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;

View File

@ -70,20 +70,25 @@ export default {
},
watch:{
'$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
if (val) {
const trainList = this.$store.state.map.map.trainList;
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
}
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
this.topTrainList = [];
this.bottomTrainList = [];
this.trainList = [];
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {

View File

@ -70,20 +70,25 @@ export default {
},
watch:{
'$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
if (val) {
const trainList = this.$store.state.map.map.trainList;
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
});
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
}
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
});
this.topTrainList = [];
this.bottomTrainList = [];
this.trainList = [];
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {