调整数据模型过滤空置,调整成都3号线实操

This commit is contained in:
zyy 2020-06-28 16:03:59 +08:00
parent 621a077e86
commit 7873917d43
6 changed files with 59 additions and 37 deletions

View File

@ -101,6 +101,7 @@ export default {
tableStyle: { tableStyle: {
'border-bottom': 'none' 'border-bottom': 'none'
}, },
commitDisabled:true,
controlTypeNameMap: { controlTypeNameMap: {
'01': '折返', '01': '折返',
'02': '直通' '02': '直通'
@ -119,18 +120,11 @@ export default {
return this.dialogShow ? OperationEvent.Signal.guide.choose.domId : ''; return this.dialogShow ? OperationEvent.Signal.guide.choose.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.guide.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.guide.confirm.domId : '';
}, },
title() { title() {
return '办理引导进路'; return '办理引导进路';
}, },
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
},
...mapGetters('map', [ ...mapGetters('map', [
'signalList', 'signalList',
'mapConfig' 'mapConfig'
@ -177,6 +171,7 @@ export default {
}, },
doShow(operate, selected, tempData) { doShow(operate, selected, tempData) {
this.selected = selected; this.selected = selected;
this.commitDisabled = true;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.signalName = ''; this.signalName = '';
@ -204,11 +199,12 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
clickEvent(row, event, column) { clickEvent(row, event, column) {
this.computedCommitDisabled(row); this.commitDisabled = false;
this.row = row; this.row = row;
if (row) { if (row) {
const operate = { const operate = {
operation: OperationEvent.Signal.guide.choose.operation operation: OperationEvent.Signal.guide.choose.operation,
val: row.code
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
@ -219,12 +215,11 @@ export default {
}, },
// //
commit() { commit() {
if (this.row && this.row.canSetting) { if (this.row && this.row.code) {
const operate = { const operate = {
over: true, over: true,
operation: OperationEvent.Signal.guide.confirm.operation, operation: OperationEvent.Signal.guide.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
val: this.row.code,
param: { param: {
routeCode: this.row.code routeCode: this.row.code
} }
@ -234,7 +229,6 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose(); this.doClose();
} else { } else {
this.doClose(); this.doClose();
@ -259,9 +253,6 @@ export default {
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
},
computedCommitDisabled(row) {
this.commitDisabled = !row.canSetting;
} }
} }
}; };

View File

@ -2,12 +2,12 @@
<div> <div>
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<route-selection ref="routeSelection" /> <route-selection ref="routeSelection" />
<route-control ref="routeControl" :pop-class="'chengdou-03__systerm'" /> <route-control ref="routeControl" pop-class="chengdou-03__systerm" />
<route-detail ref="routeDetail" /> <route-detail ref="routeDetail" />
<route-guide ref="routeGuide" /> <route-guide ref="routeGuide" />
<route-hand-control ref="routeHandControl" /> <route-hand-control ref="routeHandControl" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" /> <notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
<password-box ref="passwordBox" pop-class="'chengdou-03__systerm'" @checkOver="passWordCommit" /> <password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
<set-fault ref="setFault" pop-class="chengdou-03__systerm" /> <set-fault ref="setFault" pop-class="chengdou-03__systerm" />
</div> </div>
</template> </template>
@ -277,7 +277,6 @@ export default {
start: true, start: true,
code: `${this.selected.code}`, code: `${this.selected.code}`,
operation: OperationEvent.Signal.guide.menu.operation, operation: OperationEvent.Signal.guide.menu.operation,
operateNext: OperationEvent.Signal.guide.confirm.operation,
param: { param: {
signalCode: `${this.selected.code}` signalCode: `${this.selected.code}`
} }
@ -291,7 +290,7 @@ export default {
routes.push(elem); routes.push(elem);
} }
}); });
this.$refs.passwordBox.doShow({step: step, selected: this.selected, routesList: routes}); this.$refs.passwordBox.doShow({...step, ...{selected: this.selected}, ...{routesList: routes}});
} }
}); });
}, },
@ -325,7 +324,7 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) { if (valid) {
this.$refs.passwordBox.doShow({step: step, selected: this.selected}); this.$refs.passwordBox.doShow({...step, ...{selected: this.selected}});
} }
}); });
}, },
@ -452,11 +451,20 @@ export default {
}); });
}, },
passWordCommit(data) { passWordCommit(data) {
if (data.step.operation === OperationEvent.Signal.guide.menu.operation) { const step = {
this.$refs.routeGuide.doShow(data.step.operation, data.selected, data.routesList); operation: data.operation
} else if (data.step.operation === OperationEvent.Signal.humanTrainRoute.menu.operation) { };
this.$refs.routeControl.doShow(data.step, data.selected); this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
} if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (data.operation === OperationEvent.Signal.guide.menu.operation) {
this.$refs.routeGuide.doShow(data, data.selected, data.routesList);
} else if (data.operation === OperationEvent.Signal.humanTrainRoute.menu.operation) {
this.$refs.routeControl.doShow(data, data.selected);
}
}
});
} }
} }
}; };

View File

@ -44,8 +44,9 @@ export default {
productTypes: ['02'], productTypes: ['02'],
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '308', tip: '鼠标右键菜单选择【办理引导进路】' }, { deviceType: '04', orderNum: 1, operateCode: '308', tip: '鼠标右键菜单选择【办理引导进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3086', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' }, // 进路编号值不正确 { deviceType: '04', orderNum: 2, operateCode: '308', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '308', tip: '鼠标左键点击【确认】按钮' } { deviceType: '04', orderNum: 3, operateCode: '3086', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' },
{ deviceType: '04', orderNum: 4, operateCode: '3082', tip: '鼠标左键点击【确认】按钮' }
] ]
}, },
{ {
@ -93,10 +94,10 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '3030', tip: '鼠标左键点击【{5}】按钮', val: '{6}' } { deviceType: '04', orderNum: 3, operateCode: '3030', tip: '鼠标左键点击【{5}】按钮', val: '{6}' }
] ]
}, },
{ { // 不生成实训
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE.value, // 新增数据字典code operateType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE.value,
skinCode: '04', skinCode: '04',
trainingName: '总人解({3})', trainingName: '总人解({3})',
trainingRemark: '总人解', trainingRemark: '总人解',
@ -108,10 +109,10 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '3051', tip: '输入密码123456点击【确定】按钮' } { deviceType: '04', orderNum: 3, operateCode: '3051', tip: '输入密码123456点击【确定】按钮' }
] ]
}, },
{ { // 不生成实训
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE.value, // 新增数据字典code operateType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE.value,
skinCode: '04', skinCode: '04',
trainingName: '总人解({3})', trainingName: '总人解({3})',
trainingRemark: '总人解', trainingRemark: '总人解',

View File

@ -78,6 +78,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
export default { export default {
name: 'PasswordBox', name: 'PasswordBox',
@ -91,7 +92,7 @@ export default {
return { return {
correctPassword: '123', // correctPassword: '123', //
dialogShow: false, dialogShow: false,
operation: null, operation: '',
checkHasInput: false, checkHasInput: false,
passwordCheck: '', // passwordCheck: '', //
encryptionPassword: '', // encryptionPassword: '', //
@ -111,7 +112,7 @@ export default {
} }
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.password.domId : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
} }
}, },
mounted() { mounted() {
@ -123,6 +124,8 @@ export default {
doShow(operate) { doShow(operate) {
this.operate = operate || {}; this.operate = operate || {};
this.dialogShow = true; this.dialogShow = true;
this.operation = operate.operation;
console.log(this.operation, operate);
this.checkHasInput = false; this.checkHasInput = false;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -136,9 +139,9 @@ export default {
}, },
commit() { // commit() { //
if (this.passwordCheck === this.correctPassword) { if (this.passwordCheck === this.correctPassword) {
this.$emit('checkOver', this.operate);
this.doClose(); this.doClose();
this.inputClear(); this.inputClear();
this.$emit('checkOver', this.operate);
} else { } else {
this.showMistake = true; this.showMistake = true;
} }

View File

@ -172,6 +172,22 @@ function recover(state, models) {
} }
} }
function filtrationModel(models) {
models.forEach(model => {
for (const key in model) {
if (typeof model[key] == 'string') {
if (!model[key]) {
delete model[key];
}
}
if (model[key] == null || model[key] == undefined) {
delete model[key];
}
}
});
return models;
}
/** /**
* 实训状态数据 * 实训状态数据
*/ */
@ -927,10 +943,13 @@ const map = {
if (!(models instanceof Array)) { if (!(models instanceof Array)) {
models = [models]; models = [models];
} }
// 过滤 空/null/undefined value 值
const dictList = filtrationModel(models);
console.log(dictList);
// 查找向上关联需要一起删除的设备 // 查找向上关联需要一起删除的设备
const dict = {}; const dict = {};
models.forEach((model) => { dictList.forEach((model) => {
if (model['_dispose']) { if (model['_dispose']) {
queryDeleteModels(state, model, dict); queryDeleteModels(state, model, dict);
} else { } else {

View File

@ -286,7 +286,7 @@ export default {
switchType: '', switchType: '',
stationStandType:'', stationStandType:'',
psdType: '', psdType: '',
controlType: '', controlType: '',
ViewMode: ViewMode, ViewMode: ViewMode,
enabledTab: 'Section', enabledTab: 'Section',
autoSaveTask: null, autoSaveTask: null,