线路:宁波3

问题:优化初始化操作的事件模型
This commit is contained in:
ival 2021-03-10 15:09:15 +08:00
parent 1aa009075f
commit 90bdb12e57
28 changed files with 389 additions and 327 deletions

View File

@ -10,6 +10,7 @@ export default {
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dialogHeaderEl.onmousedown = (e) => {
e.stopPropagation();
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
@ -30,6 +31,7 @@ export default {
}
document.onmousemove = function (e) {
e.stopPropagation();
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
@ -46,6 +48,7 @@ export default {
};
document.onmouseup = function () {
e.stopPropagation();
document.onmousemove = null;
document.onmouseup = null;
};

View File

@ -80,9 +80,6 @@ class MouseController extends Eventful {
}
mousedown(e) {
// if (eventTool.notLeftMouse(e)) {
// return;
// }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) {
var x = e.offsetX;
@ -100,29 +97,23 @@ class MouseController extends Eventful {
}
mousemove(e) {
// if (eventTool.notLeftMouse(e) ||
// !this._moveOnMouseMove ||
// !this._dragging
// ) {
// return;
// }
if (this._dragging) {
const oldX = this._x;
const oldY = this._y;
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this._x = e.offsetX;
this._y = e.offsetY;
this._x = e.offsetX;
this._y = e.offsetY;
if (e.which == 1) {
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
}
if (e.which == 1) {
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
}
}
}
mouseup(e) {

View File

@ -104,7 +104,7 @@ export default {
$menuItemPadding: 5px;
#menuBar {
z-index: 36;
z-index: 2008;
position: absolute;
width: inherit;
height: $height;

View File

@ -37,26 +37,26 @@
<route-detail ref="routeDetail" />
<route-command ref="routeCommand" />
<switch-block-init ref="switchBlockInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<switch-block-sure ref="switchBlockSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect" />
<switch-block-init ref="switchBlockInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<switch-block-sure ref="switchBlockSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<signal-guide-init ref="signalGuideInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<signal-guide-sure ref="signalGuideSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<signal-guide-init ref="signalGuideInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<signal-guide-sure ref="signalGuideSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<signal-can-block-init ref="signalCanBlockInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<signal-can-block-sure ref="signalCanBlockSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<signal-can-block-init ref="signalCanBlockInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<signal-can-block-sure ref="signalCanBlockSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<signal-block-init ref="signalBlockInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<signal-block-sure ref="signalBlockSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect" />
<signal-block-init ref="signalBlockInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<signal-block-sure ref="signalBlockSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<section-open-init ref="sectionOpenInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect" />
<section-open-sure ref="sectionOpenSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<section-open-init ref="sectionOpenInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
<section-open-sure ref="sectionOpenSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<signal-mode-init ref="signalModeInit" :initCodeListMap="initCodeListMap" :initSelect="initSelect" @initSelect="onChangeInitSelect"/>
<signal-mode-sure ref="signalModeSure" :initCodeListMap="initCodeListMap" :initSelect="initSelect"/>
<signal-mode-init ref="signalModeInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<signal-mode-sure ref="signalModeSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
<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"/>
<section-limit-speed-init ref="sectionLimitSpeedInit" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo"/>
<section-limit-speed-sure ref="sectionLimitSpeedSure" :initCacheMap="initCacheMap" :initInfo="initInfo" :updateDone="updateDone" @updateDone="onUpdateDone"/>
</div>
</template>
<script>
@ -165,9 +165,9 @@ export default {
},
data() {
return {
initCodeListMap: {},
initSelect: {},
initParams: {},
initCacheMap: {},
initInfo: {},
updateDone: 0,
beCentralizedStation:{},
menuNormal: {
Local: [
@ -1777,9 +1777,7 @@ export default {
},
watch: {
'$store.state.training.changeRoleInfo':function(newval, oldval) {
// if (list && list.length) {
this.checkRoleChange(oldval, newval);
// }
},
'$store.state.menuOperation.leftClickCount': function (val) {
this.selectedChange();
@ -1795,31 +1793,36 @@ export default {
});
}
});
this.$root.$on('iniCaches', (cmd, caches) => {
this.initCodeListMap[cmd] = caches;
this.$root.$on('iniCacheMap', (cmd, cacheMap) => {
this.initCacheMap[cmd] = cacheMap;
})
this.$root.$on('appendCache', (cmd, cache) => {
if (!this.initCodeListMap[cmd]) {
this.initCodeListMap[cmd] = [];
this.$root.$on('appendCache', (cmd, code, cache) => {
if (!this.initCacheMap[cmd]) {
this.initCacheMap[cmd] = {};
}
this.initCodeListMap[cmd].push(cache);
this.initCacheMap[cmd][code] = 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)
this.$root.$on('removeCache', (cmd, code) => {
if (this.initCacheMap[cmd]) {
delete this.initCacheMap[cmd][code]
}
})
},
beforeDestroy() {
this.$root.$off('iniCaches');
this.$root.$off('iniCacheMap');
this.$root.$off('appendCache');
this.$root.$off('removeCache');
},
methods: {
onChangeInitSelect(val, params) {
this.initSelect = val;
this.initParams = params;
onUpdateDone() {
this.updateDone++;
},
onChangeInitInfo(initSelect, initParams) {
this.initInfo = {
initSelect,
initParams
}
this.updateDone++;
},
selectedChange() {
const model = this.$store.state.menuOperation.selected;
@ -2605,7 +2608,6 @@ export default {
$menuItemPadding: 5px;
#menuBar {
z-index: 36;
position: absolute;
width: inherit;
height: $height;

View File

@ -223,7 +223,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -135,7 +135,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -69,23 +69,21 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
type: Object,
default() {
return null
}
},
initParams: {
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -122,9 +120,9 @@ export default {
{ name: '80', value: 80 }
],
sure: false,
disabled: true,
speedLimitValue: 0,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -137,9 +135,18 @@ export default {
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
initSelect() {
return this.initInfo.initSelect||{};
},
initParams() {
return this.initInfo.initParams||{};
},
cmdType() {
return this.speedLimitValue ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED;
},
disabled() {
return !this.currentSelect || !this.speedLimitValue || this.noInit;
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
},
@ -155,16 +162,25 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure ? '确认/取消设置临时限速区域' : '初始化设置临时限速区域'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.speedLimitValue = this.initParams.value;
this.dialogShow = true;
this.$nextTick(function () {
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');
@ -173,28 +189,21 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && (this.speedLimitValue = 0);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.initSelect &&
this.currentSelect &&
if (this.currentSelect &&
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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
@ -206,12 +215,11 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -231,10 +239,10 @@ export default {
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = !this.speedLimitValue || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
}
}).catch(() => {
@ -249,11 +257,11 @@ export default {
};
this.speedLimitValue = val.value;
this.$emit('updateDone')
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 });
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
@ -272,13 +280,13 @@ export default {
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getProcess(code) {
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? '确认设置限速完成' : '等待确认/取消';
return cache.done == 'two' ? '确认设置限速完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';

View File

@ -101,7 +101,6 @@ export default {
},
methods: {
doShow(operate) {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -120,7 +119,6 @@ export default {
commit() {
},
handleClick() {
},
cancel() {
const operate = {

View File

@ -60,17 +60,21 @@ export default {
NoticeInfo
},
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
@ -87,8 +91,8 @@ export default {
operate: null,
command: true,
sure: false,
disabled: true,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -101,6 +105,12 @@ export default {
cmdType() {
return this.isBlock ? CMD.Section.CMD_SECTION_BLOCK : CMD.Section.CMD_SECTION_UNBLOCK
},
initSelect() {
return this.initInfo.initSelect||{};
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -125,9 +135,17 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
@ -138,6 +156,7 @@ export default {
this.title = `${this.isBlock ? '初始化关闭轨道': '初始化开放轨道'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -147,26 +166,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
@ -178,12 +189,11 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -204,10 +214,10 @@ export default {
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
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.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -215,13 +225,13 @@ export default {
});
},
getProcess(code) {
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? this.needBlock ? '确认关闭轨道完成' : '确认开放轨道完成' : '等待确认/取消';
return cache.done == 'two' ? this.needBlock ? '确认关闭轨道完成' : '确认开放轨道完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';

View File

@ -62,17 +62,21 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -88,8 +92,8 @@ export default {
loading: false,
operate: {},
sure: false,
disabled: true,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -105,9 +109,15 @@ export default {
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
cmdType() {
return this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
},
@ -123,9 +133,17 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
@ -136,6 +154,7 @@ export default {
this.title = `${this.isBlock ? '初始化信号机封锁': '初始化信号机解除封锁'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -145,26 +164,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
@ -176,12 +187,11 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -202,10 +212,10 @@ export default {
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
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.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -218,14 +228,14 @@ export default {
},
getProcess(code, type) {
const blockType = this.isBlock ? 'lock': 'unlock';
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (blockType==type) {
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
return cache.done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
}
@ -266,7 +276,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -57,17 +57,21 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -84,8 +88,8 @@ export default {
operate: '',
command: true,
sure: false,
disabled: true,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -98,9 +102,15 @@ export default {
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
cmdType() {
return CMD.Signal.CMD_SIGNAL_UNBLOCK;
},
disabled() {
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
@ -116,13 +126,23 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure? '确认/取消允许锁闭': '初始化允许锁闭'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -132,26 +152,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: this.command ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
@ -163,12 +175,11 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -189,10 +200,10 @@ export default {
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.command&&this.currentSelect.blockade || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
@ -204,13 +215,13 @@ export default {
return elem.blockade? '关闭': '开启';
},
getProcess(code) {
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? '确认允许锁闭完成' : '等待确认/取消';
return cache.done == 'two' ? '确认允许锁闭完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
@ -251,7 +262,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 105px;
text-align: center;
color: #000;
width: 40px;

View File

@ -171,7 +171,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -62,17 +62,21 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -88,8 +92,8 @@ export default {
loading: false,
command: true,
sure: false,
disabled: true,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -102,9 +106,15 @@ export default {
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
cmdType() {
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
disabled() {
return !this.currentSelect || !this.currentSelect.callOn || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : ''
},
@ -123,13 +133,23 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure? '确认/取消引导': '初始化引导'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -139,26 +159,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: this.command
@ -172,12 +184,11 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -198,10 +209,10 @@ export default {
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.command&&!this.currentSelect.callOn || this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
@ -227,13 +238,13 @@ export default {
return elem.callOn ? '是': '否';
},
getProcess(code) {
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? '确认引导完成' : '等待确认/取消';
return cache.done == 'two' ? '确认引导完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
@ -275,7 +286,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 105px;
text-align: center;
color: #000;
width: 40px;

View File

@ -53,17 +53,21 @@ import { mapGetters } from 'vuex';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -77,11 +81,10 @@ export default {
allChecked: false,
dialogShow: false,
loading: false,
disabled:false,
operate: {},
sure: false,
disabled: true,
currentSelect: null
currentSelect: null,
noInit: true
};
},
computed: {
@ -94,12 +97,18 @@ export default {
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
isCbtc() {
return this.operate.operation === OperationEvent.Command.mBar.cbtcMode.operation;
},
cmdType() {
return this.isCbtc ? CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING : CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING;
},
disabled() {
return !this.currentSelect || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
@ -118,9 +127,17 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
@ -131,6 +148,7 @@ export default {
this.title = `${this.isCbtc ? '初始化CBTC模式' : '初始化后备模式'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -140,16 +158,10 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
@ -165,7 +177,6 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.disabled = this.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
@ -173,12 +184,10 @@ export default {
});
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const step = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
@ -190,11 +199,9 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
@ -241,7 +248,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -30,10 +30,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" :loading="loading" :disabled="!selected" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" :loading="loading" :disabled="disabled" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -77,6 +77,9 @@ export default {
selected() {
return this.$store.state.menuOperation.selected;
},
disabled() {
return !this.selected
},
filterSignalList() {
return this.signalList.map(el => {
return this.$store.getters['map/getDeviceByCode'](el.code);
@ -137,7 +140,6 @@ export default {
},
doShow(operate) {
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
@ -205,7 +207,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 105px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -224,7 +224,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 105px;
left: 20px;
color: #000;
width: 60px;

View File

@ -253,7 +253,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 105px;
left: 20px;
color: #000;
width: 60px;

View File

@ -254,7 +254,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 105px;
left: 20px;
color: #000;
width: 60px;

View File

@ -254,7 +254,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 105px;
left: 20px;
color: #000;
width: 60px;

View File

@ -202,7 +202,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 105px;
text-align: center;
color: #000;
width: 60px;

View File

@ -62,17 +62,21 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
props: {
initCodeListMap: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initSelect: {
initInfo: {
type: Object,
default() {
return null
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
@ -88,9 +92,9 @@ export default {
loading: false,
command: true,
sure: false,
disabled: true,
operate: {},
currentSelect: null
currentSelect: null,
noInit: true,
};
},
computed: {
@ -103,12 +107,18 @@ export default {
tempList() {
return this.switchList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Command.commandNingBo3.line_switch_block.operation;
},
cmdType() {
return this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK;
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
@ -127,9 +137,17 @@ export default {
if (this.show) {
this.commit();
}
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
@ -140,6 +158,7 @@ export default {
this.title = `${this.isBlock ? '初始化道岔封锁': '初始化解除封锁'}`;
}
this.currentSelect = sure? this.$store.getters['map/getDeviceByCode'](this.initSelect.code): null
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
@ -149,26 +168,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
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.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.initSelect &&
this.currentSelect &&
if (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 cacheMap= this.getCacheMap()
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
@ -180,12 +191,12 @@ export default {
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});
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, {done: this.sure? 'two': 'one'});
} else {
elem.__done = null;
this.$root.$emit('removeCache', this.cmdType.value, {code: elem.code});
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
@ -205,12 +216,11 @@ export default {
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
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.sure&&this.currentSelect.__done != 'one';
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
@ -223,14 +233,14 @@ export default {
},
getProcess(code, type) {
const blockType = this.isBlock ? 'block': 'unblock';
const codeList = (this.initCodeListMap[this.cmdType.value]||[]).map(el => el.code);
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (blockType==type) {
if (codeList.includes(code)) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (cache) {
if (this.sure) {
return elem.__done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
return cache.done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
} else {
return elem.__done == 'one' ? '已初始化' : ''
return cache.done == 'one' ? '已初始化' : ''
}
}
}
@ -272,7 +282,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 105px;
text-align: center;
color: #000;
width: 40px;

View File

@ -1,5 +1,5 @@
<template>
<div id="jl3d" class="jl3ddraw">
<div id="jl3d" style="z-index: 2010" class="jl3ddraw">
<Jl3ddevice-Msg v-show="isswitch">
</Jl3ddevice-Msg>
<Jl3ddevice-List v-show="isswitch" :devicelist="devicelist" @sdevice="sdevice">
@ -230,9 +230,10 @@
} */
.jl3ddraw {
position: absolute;
z-index: 3001;
position: absolute;
float: right;
top:25%;
top:25%;
/* left: 0; */
width: 50%;
height: 50%;

View File

@ -188,18 +188,19 @@ export default {
height: 100%;
}
.jl3ddraw1{
position: absolute;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 100%;
height: 100%;
z-index: 0;
}
.jl3ddraw {
position: absolute;
z-index: 3001;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 50%;
height: 100%;

View File

@ -1,8 +1,6 @@
<template>
<div class="jl3dstationmanager">
<div id="jl3d" class="jl3dstationmanagerdraw">
</div>
<div id="jl3d" style="z-index: 2010" class="jl3dstationmanagerdraw" />
</div>
</template>
<script>
@ -53,9 +51,10 @@
height: 100%;
}
.jl3dstationmanagerdraw {
position: absolute;
z-index: 3001;
position: absolute;
float: right;
/* top:25%; */
/* top:25%; */
/* left: 0; */
width: 100%;
height: 100%;

View File

@ -14,8 +14,7 @@
</el-row>
<Draw-Type @changeDrawType=changeDrawType ></Draw-Type>
<Pro-Perty></Pro-Perty>
<div id="jl3d" class="jl3dstationmanagerdraw">
</div>
<div id="jl3d" class="jl3dstationmanagerdraw" />
</div>
</template>
<script>
@ -90,9 +89,10 @@
height: 100%;
}
.jl3dstationmanagerdraw {
position: absolute;
z-index: 3001;
position: absolute;
float: right;
/* top:25%; */
/* top:25%; */
/* left: 0; */
width: 100%;
height: 100%;

View File

@ -1,8 +1,7 @@
<template>
<div id="jl3d" class="jl3ddraw">
<div id="jl3d" style="z-index: 2010" class="jl3ddraw">
<Jl3d-TextUi :selectmodel='selectmodel' ref="jl3dtextui" ></Jl3d-TextUi>
<canvas id="canvastexture" ></canvas>
<canvas id="canvastexture" />
</div>
</template>
<script>
@ -65,9 +64,10 @@
<style scoped>
.jl3ddraw {
position: absolute;
z-index: 3001;
position: absolute;
float: right;
/* top:25%; */
/* top:25%; */
/* left: 0; */
width: 50%;
height: 50%;

View File

@ -13,8 +13,7 @@
/>
</el-select>
</div>
<Station-Data>
</Station-Data>
<Station-Data />
<!-- <div class="menutop">
<el-button-group>
@ -173,18 +172,18 @@ export default {
height: 100%;
}
.jl3ddraw1{
position: absolute;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 100%;
height: 100%;
z-index: 0;
}
.jl3ddraw {
position: absolute;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 50%;
height: 100%;

View File

@ -1,7 +1,6 @@
<template>
<div class="jl3dtrafficplan">
<div id="jl3d" :class="lineCode=='07'?'jl3ddraw':'jl3ddraw1'" />
<div id="testjlmap3d" class="jlmap3ddraw">
<canvas id="canvastexture" />
</div>
@ -289,18 +288,18 @@ export default {
height: 100%;
}
.jl3ddraw1{
position: absolute;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 100%;
height: 100%;
z-index: 0;
}
.jl3ddraw {
position: absolute;
position: absolute;
float: right;
top:0%;
top:0%;
/* left: 0; */
width: 50%;
height: 100%;
@ -308,12 +307,12 @@ export default {
}
.jlReal3d{
position: absolute;
top:0%;
top:0%;
left: 50%;
width: 50%;
height: 100%;
z-index: 0;
font-size:0;
font-size:0;
}
.station{