线路:宁波3

任务:修改带初始化的界面操作
This commit is contained in:
ival 2021-03-09 18:37:20 +08:00
parent c28be4acd7
commit 0c98c06440
17 changed files with 356 additions and 225 deletions

View File

@ -52,12 +52,11 @@
<section-open-init ref="sectionOpenInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect" />
<section-open-sure ref="sectionOpenSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<section-limit-speed-init ref="sectionLimitSpeedInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<section-limit-speed-sure ref="sectionLimitSpeedSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<signal-mode-init ref="signalModeInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<signal-mode-sure ref="signalModeSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<section-limit-speed-init ref="sectionLimitSpeedInit" :initCodeListMap="initCodeListMap" :initParams="initParams" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<section-limit-speed-sure ref="sectionLimitSpeedSure" :initCodeListMap="initCodeListMap" :initParams="initParams" :initSelect="initSelect"/>
</div>
</template>
<script>
@ -168,6 +167,7 @@ export default {
return {
initCodeListMap: {},
initSelect: {},
initParams: {},
beCentralizedStation:{},
menuNormal: {
Local: [
@ -1787,7 +1787,6 @@ export default {
},
mounted() {
// this.initMenu();
//
this.stationList.forEach(data=>{
if (data.centralized) {
@ -1796,19 +1795,31 @@ export default {
});
}
});
this.$root.$on('initCodes', (cmd, code) => {
this.$root.$on('iniCaches', (cmd, caches) => {
this.initCodeListMap[cmd] = caches;
})
this.$root.$on('appendCache', (cmd, cache) => {
if (!this.initCodeListMap[cmd]) {
this.initCodeListMap[cmd] = [];
}
this.initCodeListMap[cmd].push(code);
this.initCodeListMap[cmd].push(cache);
})
this.$root.$on('removeCache', (cmd, cache) => {
const index = (this.initCodeListMap[cmd]||[]).findIndex(el => el.code == cache.code);
if (index >= 0) {
this.initCodeListMap[cmd].splice(index, 1)
}
})
},
beforeDestroy() {
this.$root.$off('initCodes');
this.$root.$off('iniCaches');
this.$root.$off('appendCache');
this.$root.$off('removeCache');
},
methods: {
onChangeInitSelect(val) {
onChangeInitSelect(val, params) {
this.initSelect = val;
this.initParams = params;
},
selectedChange() {
const model = this.$store.state.menuOperation.selected;

View File

@ -176,8 +176,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
// const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
// this.speedLimitValue = sectionEle.speedUpLimit;
// const elem = this.$store.getters['map/getDeviceByCode'](val.code);
// this.speedLimitValue = elem.speedUpLimit;
// if (this.speedLimitValue > 0) {
// this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
// } else {
@ -218,15 +218,15 @@ export default {
if (this.commandEleCode === code) {
return this.speedLimitValue > 0 ? '开启' : '关闭';
}
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? '开启' : '关闭';
},
getLimitSpeed(code) {
if (this.commandEleCode === code) {
return this.speedLimitValue > 0 ? this.speedLimitValue : 0;
}
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getProcess(code) {
if (this.commandEleCode && this.commandEleCode === code) {

View File

@ -165,13 +165,13 @@ export default {
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode && this.commandEleCode === code && this.isBlock) {
return '关闭双向:所有列车';
} else if (this.commandEleCode && this.commandEleCode === code && !this.isBlock) {
return '打开';
}
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
return elem.blockade ? '关闭双向:所有列车' : '打开';
},
commit(isClose = true) {
const step = {

View File

@ -167,8 +167,8 @@ export default {
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未设锁闭';

View File

@ -162,11 +162,11 @@ export default {
});
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode === code) {
return this.isBlock ? '锁闭的' : '未锁闭的';
}
if (switchEle.blockade) {
if (elem.blockade) {
return '锁闭的';
} else {
return '未锁闭的';

View File

@ -478,8 +478,8 @@ export default {
},
getRouteDirection(route) {
const signalEle = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
if (signalEle.right) {
const elem = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
if (elem.right) {
return '0';
} else {
return '1';

View File

@ -68,7 +68,6 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
props: {
initCodeListMap: {
type: Object,
@ -81,6 +80,12 @@ export default {
default() {
return null
}
},
initParams: {
type: Object,
default() {
return {}
}
}
},
components: {
@ -98,7 +103,6 @@ export default {
command: true,
activeName: 'first',
operate: null,
speedLimitValue: 0,
limitList: [
{ name: '5', value: 5 },
{ name: '10', value: 10 },
@ -118,7 +122,8 @@ export default {
{ name: '80', value: 80 }
],
sure: false,
disabled: false,
disabled: true,
speedLimitValue: 0,
currentSelect: null
};
},
@ -153,15 +158,15 @@ export default {
}
},
methods: {
doShow(operate, sure, value=0) {
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure ? '确认/取消设置临时限速区域' : '初始化设置临时限速区域'}`;
this.speedLimitValue = value;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable1.setCurrentRow(sure? this.initSelect: null);
this.$refs.singleTable2.setCurrentRow(this.limitList[value / 5 - 1]);
this.speedLimitValue = this.initParams.value;
this.$refs.singleTable1.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$refs.singleTable2.setCurrentRow(this.limitList[this.initParams.value / 5 - 1]);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -170,27 +175,45 @@ export default {
this.dialogShow = false;
this.sure && this.$refs.singleTable1.setCurrentRow();
this.sure && this.$refs.singleTable2.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
this.currentSelect.code == this.initSelect.code &&
this.speedLimitValue == this.initParams.value) {
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure ? this.cmdType : null,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code, speedLimitValue:this.speedLimitValue}
};
const sectionEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, sectionEle.code);
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
sectionEle.__done = this.sure? 'two': 'one';
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
@ -211,50 +234,51 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
this.disabled = !this.speedLimitValue || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
// this.$refs.singleTable1.setCurrentRow(this.currentSelect);
},
selectLine2(val) {
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose1.operation,
val: val.code
val: val.value
};
this.speedLimitValue = val.value;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.disabled = !this.currentSelect || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
// this.$refs.singleTable2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getIsLimit(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? '开启' : '关闭';
},
getLimitSpeed(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getProcess(code) {
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return sectionEle.__done == 'two' ? '确认设置限速完成' : '等待确认/取消';
return elem.__done == 'two' ? '确认设置限速完成' : '等待确认/取消';
} else {
return sectionEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
return '';

View File

@ -56,7 +56,6 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
components: {
NoticeInfo
},
@ -141,7 +140,7 @@ export default {
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -149,34 +148,49 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
if (this.command) {
const operate = {
cmdType: this.sure ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
const sectionEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, sectionEle.code);
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
sectionEle.__done = this.sure? 'two': 'one';
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
@ -193,7 +207,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade;
this.disabled = (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -201,13 +215,13 @@ export default {
});
},
getProcess(code) {
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return sectionEle.__done == 'two' ? this.needBlock ? '确认关闭轨道完成' : '确认开放轨道完成' : '等待确认/取消';
return elem.__done == 'two' ? this.needBlock ? '确认关闭轨道完成' : '确认开放轨道完成' : '等待确认/取消';
} else {
return sectionEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
return '';
@ -217,8 +231,8 @@ export default {
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade ? '关闭双向:所有列车' : '打开';
},
cancel() {
const operate = {

View File

@ -128,16 +128,16 @@ export default {
return stationElm.name;
},
getLimitSpeed(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getSectionStatus(val) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
return sectionEle.blockade ? '关闭双向:所有列车' : '打开';
const elem = this.$store.getters['map/getDeviceByCode'](val.code);
return elem.blockade ? '关闭双向:所有列车' : '打开';
},
getIsLimit(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? '开启' : '关闭';
},
cancel() {
const operate = {

View File

@ -61,7 +61,6 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalBlock',
props: {
initCodeListMap: {
type: Object,
@ -97,8 +96,8 @@ export default {
...mapGetters('map', [
'signalList'
]),
needBlock() {
return this.operate && this.operate.needBlock;
isBlock() {
return this.operate && this.operate.operation == OperationEvent.Command.commandNingBo3.line_signal_block.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -107,7 +106,7 @@ export default {
return this.signalList;
},
cmdType() {
return this.needBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
return this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
@ -132,14 +131,14 @@ export default {
this.sure = sure;
if (sure) {
this.title = `${this.needBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
this.title = `${this.isBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
} else {
this.title = `${this.needBlock ? '初始化信号机封锁': '初始化信号机解除封锁'}`;
this.title = `${this.isBlock ? '初始化信号机封锁': '初始化信号机解除封锁'}`;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -147,34 +146,49 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
if (this.command) {
const operate = {
cmdType: this.sure ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
const signalEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, signalEle.code);
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
signalEle.__done = this.sure? 'two': 'one';
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
}).catch(() => {
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
}
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
@ -191,7 +205,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.needBlock? this.currentSelect.blockade: !this.currentSelect.blockade;
this.disabled = (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -199,19 +213,19 @@ export default {
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
return signalEle.blockade? '锁闭的': '未设锁闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade? '锁闭的': '未设锁闭';
},
getProcess(code, type) {
const blockType = this.needBlock ? 'lock': 'unlock';
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const blockType = this.isBlock ? 'lock': 'unlock';
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (blockType==type) {
if (codeList.includes(code)) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return signalEle.__done == 'two' ? this.needBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
return elem.__done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
} else {
return signalEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
}

View File

@ -26,8 +26,8 @@
<el-col :span="6" v-if="sure">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="needBlock" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="needBlock" :label="false" style="display: block;">取消</el-radio>
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" :label="false" style="display: block;">取消</el-radio>
</div>
</el-col>
</el-row>
@ -56,7 +56,6 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalCanBlock',
props: {
initCodeListMap: {
type: Object,
@ -83,7 +82,7 @@ export default {
dialogShow: false,
loading: false,
operate: '',
needBlock: true,
command: true,
sure: false,
disabled: true,
currentSelect: null
@ -100,7 +99,7 @@ export default {
return this.signalList;
},
cmdType() {
return this.needBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
return CMD.Signal.CMD_SIGNAL_UNBLOCK;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
@ -126,7 +125,7 @@ export default {
this.title = `${sure? '确认/取消允许锁闭': '初始化允许锁闭'}`;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -134,27 +133,44 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure? this.cmdType: null,
operation: this.needBlock ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: this.command ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
const signalEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, this.currentSelect.code);
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
signalEle.__done = this.sure? 'two': 'one';
}
}).catch(() => {
isClose && this.doClose();
@ -176,7 +192,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.currentSelect.blockade;
this.disabled = this.command&&this.currentSelect.blockade || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
@ -184,17 +200,17 @@ export default {
});
},
getSignalBlock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
return signalEle.blockade? '关闭': '开启';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade? '关闭': '开启';
},
getProcess(code) {
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return signalEle.__done == 'two' ? '确认允许锁闭完成' : '等待确认/取消';
return elem.__done == 'two' ? '确认允许锁闭完成' : '等待确认/取消';
} else {
return signalEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
return '';

View File

@ -114,22 +114,22 @@ export default {
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
} else {
return '';

View File

@ -61,7 +61,6 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalGuide',
props: {
initCodeListMap: {
type: Object,
@ -104,9 +103,7 @@ export default {
return this.signalList;
},
cmdType() {
return this.command
? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : ''
@ -135,7 +132,7 @@ export default {
this.title = `${sure? '确认/取消引导': '初始化引导'}`;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -143,14 +140,27 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure? this.cmdType: null,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: this.command
? OperationEvent.Command.common.confirm1.operation
: OperationEvent.Command.common.apply1.operation,
@ -158,14 +168,18 @@ export default {
param: {signalCode: this.currentSelect.code}
};
const signalEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, signalEle.code);
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
signalEle.__done = this.sure? 'two': 'one';
}
}).catch(() => {
isClose && this.doClose();
@ -187,7 +201,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.currentSelect.callOn;
this.disabled = this.command&&!this.currentSelect.callOn || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
@ -195,31 +209,31 @@ export default {
});
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
}
return '';
},
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
return signalEle.callOn ? '是': '否';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.callOn ? '是': '否';
},
getProcess(code) {
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return signalEle.__done == 'two' ? '确认引导完成' : '等待确认/取消';
return elem.__done == 'two' ? '确认引导完成' : '等待确认/取消';
} else {
return signalEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
return '';
@ -230,7 +244,6 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
// this.$emit('cancelCommand');
this.initEle = null;
this.doClose();
}

View File

@ -52,7 +52,6 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
export default {
name: 'SignalBlock',
props: {
initCodeListMap: {
type: Object,
@ -112,9 +111,6 @@ export default {
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
title() {
return this.isCbtc ? '确认/取消CBTC模式' : '确认/取消后备模式';
}
},
watch: {
@ -137,7 +133,7 @@ export default {
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -145,6 +141,16 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
handleCurrentChange(val) {
@ -154,33 +160,52 @@ export default {
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
this.$refs.table.setCurrentRow(this.currentSelect);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
}).catch(_ => {
this.$refs.noticeInfo.doShow();
});
},
commit(isClose = false) {
const step = {
cmdType: this.sure? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: this.sure,
param: { signalCode: this.currentSelect.code }
};
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const step = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: this.sure,
param: { signalCode: this.currentSelect.code }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
isClose && this.doClose();
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
cancel() {
const operate = {

View File

@ -61,7 +61,6 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetain',
props: {
initCodeListMap: {
type: Object,
@ -143,7 +142,7 @@ export default {
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.initSelect: null);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -151,34 +150,49 @@ export default {
this.loading = false;
this.dialogShow = false;
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCaches', this.cmdType.value,
((this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code)).filter(el => {
const elem = this.$store.getters['map/getDeviceByCode'](el.code);
if (elem) {
if(elem.__done == 'two') { elem.__done = null; }
if(elem.__done == 'one') { return true; }
}
return false
})
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
if (this.command) {
const operate = {
cmdType: this.sure ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: this.sure,
param: { switchCode: this.currentSelect.code }
};
const elem = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const isOK = this.command&&(!this.sure || this.sure&&codeList.includes(this.currentSelect.code))
const operate = {
cmdType: this.sure&&isOK ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: this.sure,
param: { switchCode: this.currentSelect.code }
};
const switchEle = this.$store.getters['map/getDeviceByCode'](this.currentSelect.code);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$root.$emit('initCodes', this.cmdType.value, switchEle.code);
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
switchEle.__done = this.sure? 'two': 'one';
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
elem.__done = this.sure? 'two': 'one';
this.$root.$emit('appendCache', this.cmdType.value, {code: elem.code});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
}
}).catch(e => {
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
}
}
}).catch(_ => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
@ -196,7 +210,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade;
this.disabled = (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -204,19 +218,19 @@ export default {
});
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
return switchEle.blockade? '锁闭的': '未锁闭的';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade? '锁闭的': '未锁闭的';
},
getProcess(code, type) {
const blockType = this.isBlock ? 'block': 'unblock';
const codeList = this.initCodeListMap[this.cmdType.value]||[];
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (blockType==type) {
if (codeList.includes(code)) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (this.sure) {
return switchEle.__done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
return elem.__done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
} else {
return switchEle.__done == 'one' ? '已初始化' : ''
return elem.__done == 'one' ? '已初始化' : ''
}
}
}

View File

@ -174,18 +174,18 @@ export default {
});
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
} else if (elem.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未锁闭的';

View File

@ -100,18 +100,18 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
} else if (elem.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未锁闭的';