From a6a91bfcff68df71346f0cd5940b3cc6a35a35f3 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 4 Nov 2020 18:27:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=89=A7=E6=9C=AC=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/scriptManage/getAction.vue | 57 ++++++----- src/views/scriptManage/tipScriptRecord.vue | 104 ++++++++++----------- 2 files changed, 87 insertions(+), 74 deletions(-) diff --git a/src/views/scriptManage/getAction.vue b/src/views/scriptManage/getAction.vue index f1864335a..f5916281a 100644 --- a/src/views/scriptManage/getAction.vue +++ b/src/views/scriptManage/getAction.vue @@ -159,29 +159,42 @@ export default { // const command = CommandHandler.getScriptDefinition(element.operationType); const commandName = element.operationType; if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) { - const list = ['Train_Update_Type', - 'Train_Add_Train_Trace', - 'Train_Remove_Train_Trace', - 'Train_Move_Train_Trace', - 'Train_Set_Plan', - 'Train_Set_Head', - 'Train_Set_Manual', - 'Train_Set_Crew_Number', - 'Train_Tag_Atp_Cut', - 'Train_Tag_Atp_Recover', - 'Train_Allow_Pass', - 'Train_Info']; - let operateType = commandName.split('_')[0]; - if (list.includes(commandName)) { - operateType = 'TrainWindow'; + // const list = ['Train_Update_Type', + // 'Train_Add_Train_Trace', + // 'Train_Remove_Train_Trace', + // 'Train_Move_Train_Trace', + // 'Train_Set_Plan', + // 'Train_Set_Head', + // 'Train_Set_Manual', + // 'Train_Set_Crew_Number', + // 'Train_Tag_Atp_Cut', + // 'Train_Tag_Atp_Recover', + // 'Train_Allow_Pass', + // 'Train_Info']; + // let operateType = commandName.split('_')[0]; + // if (list.includes(commandName)) { + // operateType = 'TrainWindow'; + // } + // if (operateType == 'CM') { + // operateType = 'ControlConvertMenu'; + // } + let operateName = null; + let operateType = ''; + Object.keys(CMD).forEach(key => { + Object.values(CMD[key]).forEach(el => { + if (el.value == commandName) { + operateType = key; + operateName = el; + return; + } + }); + }); + // const operateName = Object.values(CMD[operateType]).find(res=>{ return res.value == commandName; }); + if (operateName) { + const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', ControlConvertMenu:'控制模式', Driver:'司机', Train:'列车'}; + const operateTypeName = deviceTypeList[operateType]; + this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false}); } - if (operateType == 'CM') { - operateType = 'ControlConvertMenu'; - } - const operateName = Object.values(CMD[operateType]).find(res=>{ return res.value == commandName; }); - const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', ControlConvertMenu:'控制模式', Driver:'司机', Train:'列车'}; - const operateTypeName = deviceTypeList[operateType]; - this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false}); } else { // deviceFaultType // element.operationParamMap.faultType; diff --git a/src/views/scriptManage/tipScriptRecord.vue b/src/views/scriptManage/tipScriptRecord.vue index 474ae7996..c46217fa7 100644 --- a/src/views/scriptManage/tipScriptRecord.vue +++ b/src/views/scriptManage/tipScriptRecord.vue @@ -24,28 +24,28 @@ - - {{ $t('scriptRecord.drivingPause') }} - 恢复 - {{ $t('scriptRecord.resetScript') }} - {{ $t('scriptRecord.startReplaceBg') }} - {{ $t('scriptRecord.saveBackground') }} - {{ $t('scriptRecord.saveData') }} - + + {{ $t('scriptRecord.drivingPause') }} + 恢复 + {{ $t('scriptRecord.resetScript') }} + {{ $t('scriptRecord.startReplaceBg') }} + {{ $t('scriptRecord.saveBackground') }} + {{ $t('scriptRecord.saveData') }} +
- +
@@ -60,10 +60,10 @@
- -
- {{ $t('scriptRecord.scriptRecordTitle') }} -
+ +
+ {{ $t('scriptRecord.scriptRecordTitle') }} +
@@ -102,10 +102,10 @@ export default { type: Number, required: true }, - isReplaceBg: { - type: Boolean, - default: false - } + isReplaceBg: { + type: Boolean, + default: false + } }, data() { return { @@ -140,7 +140,7 @@ export default { }, orignalUserRoleId() { return this.$store.state.training.orignalUserRoleId; - } + } }, watch:{ '$store.state.map.mapViewLoadedCount': function (val) { @@ -535,32 +535,32 @@ export default { ); this.oldMember = Object.assign({}, role); this.$refs.allScriptRole.updateLoading(); - }, - startReplaceBg() { - startReplaceBg(this.group).then(resp => { - this.$emit('setReplace', true); - }).catch(error => { - this.$messageBox(error.message); - }) - }, - confirmReplaceBg() { - confirmReplaceBg(this.group).then(resp => { - this.$message.success('替换成功'); - this.$emit('setReplace', false); - }).catch(error => { - this.$messageBox(error.message); - }) - }, - cancelReplaceBg() { - cancelReplaceBg(this.group).then(resp => { - this.$emit('setReplace', false); - }).catch(error => { - this.$messageBox(error.message); - }) - }, - showConditionManage(actionInfo) { - this.$refs.conditionManage.doShow(actionInfo); - } + }, + startReplaceBg() { + startReplaceBg(this.group).then(resp => { + this.$emit('setReplace', true); + }).catch(error => { + this.$messageBox(error.message); + }); + }, + confirmReplaceBg() { + confirmReplaceBg(this.group).then(resp => { + this.$message.success('替换成功'); + this.$emit('setReplace', false); + }).catch(error => { + this.$messageBox(error.message); + }); + }, + cancelReplaceBg() { + cancelReplaceBg(this.group).then(resp => { + this.$emit('setReplace', false); + }).catch(error => { + this.$messageBox(error.message); + }); + }, + showConditionManage(actionInfo) { + this.$refs.conditionManage.doShow(actionInfo); + } } };