调整剧本内容判断

This commit is contained in:
zyy 2020-11-04 18:27:24 +08:00
parent 04c51b0aca
commit a6a91bfcff
2 changed files with 87 additions and 74 deletions

View File

@ -159,29 +159,42 @@ export default {
// const command = CommandHandler.getScriptDefinition(element.operationType); // const command = CommandHandler.getScriptDefinition(element.operationType);
const commandName = element.operationType; const commandName = element.operationType;
if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) { if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
const list = ['Train_Update_Type', // const list = ['Train_Update_Type',
'Train_Add_Train_Trace', // 'Train_Add_Train_Trace',
'Train_Remove_Train_Trace', // 'Train_Remove_Train_Trace',
'Train_Move_Train_Trace', // 'Train_Move_Train_Trace',
'Train_Set_Plan', // 'Train_Set_Plan',
'Train_Set_Head', // 'Train_Set_Head',
'Train_Set_Manual', // 'Train_Set_Manual',
'Train_Set_Crew_Number', // 'Train_Set_Crew_Number',
'Train_Tag_Atp_Cut', // 'Train_Tag_Atp_Cut',
'Train_Tag_Atp_Recover', // 'Train_Tag_Atp_Recover',
'Train_Allow_Pass', // 'Train_Allow_Pass',
'Train_Info']; // 'Train_Info'];
let operateType = commandName.split('_')[0]; // let operateType = commandName.split('_')[0];
if (list.includes(commandName)) { // if (list.includes(commandName)) {
operateType = 'TrainWindow'; // 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 { } else {
// deviceFaultType // deviceFaultType
// element.operationParamMap.faultType; // element.operationParamMap.faultType;

View File

@ -24,28 +24,28 @@
</div> </div>
</div> </div>
</div> </div>
<el-button-group class="button-group" v-if="!isReplaceBg"> <el-button-group v-if="!isReplaceBg" class="button-group">
<el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button> <el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button> <el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button>
<el-button size="small" type="danger" :disabled="!backDisabled" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button> <el-button size="small" type="danger" :disabled="!backDisabled" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button>
<el-button size="small" type="primary" v-if="backDisabled" @click="startReplaceBg">{{ $t('scriptRecord.startReplaceBg') }}</el-button> <el-button v-if="backDisabled" size="small" type="primary" @click="startReplaceBg">{{ $t('scriptRecord.startReplaceBg') }}</el-button>
<el-button size="small" type="primary" v-else :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button> <el-button v-else size="small" type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button size="small" type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button> <el-button size="small" type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<div class="scriptPanelRight"> <div class="scriptPanelRight">
<get-action-new ref="getAction" :group="group" :size="size" :member-list="memberList" @showConditionManage="showConditionManage" /> <get-action-new ref="getAction" :group="group" :size="size" :member-list="memberList" @showConditionManage="showConditionManage" />
</div> </div>
</div> </div>
<template v-if="isReplaceBg"> <template v-if="isReplaceBg">
<div class="mask"/> <div class="mask" />
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button> <el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button> <el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button>
<el-button size="small" type="primary" @click="confirmReplaceBg">{{ $t('scriptRecord.confirmReplaceBg') }}</el-button> <el-button size="small" type="primary" @click="confirmReplaceBg">{{ $t('scriptRecord.confirmReplaceBg') }}</el-button>
<el-button size="small" type="info" @click="cancelReplaceBg">{{ $t('scriptRecord.cancelReplaceBg') }}</el-button> <el-button size="small" type="info" @click="cancelReplaceBg">{{ $t('scriptRecord.cancelReplaceBg') }}</el-button>
</el-button-group> </el-button-group>
</template> </template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="所有成员"> <el-tab-pane label="所有成员">
<div class="eachScriptPanel"> <div class="eachScriptPanel">
@ -60,10 +60,10 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div class="scriptRecordNewTitle" @click="minisize"> <div class="scriptRecordNewTitle" @click="minisize">
<span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span> <span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
</div> </div>
</div> </div>
<add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" /> <add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" />
<condition-manage ref="conditionManage" /> <condition-manage ref="conditionManage" />
@ -102,10 +102,10 @@ export default {
type: Number, type: Number,
required: true required: true
}, },
isReplaceBg: { isReplaceBg: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data() { data() {
return { return {
@ -140,7 +140,7 @@ export default {
}, },
orignalUserRoleId() { orignalUserRoleId() {
return this.$store.state.training.orignalUserRoleId; return this.$store.state.training.orignalUserRoleId;
} }
}, },
watch:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
@ -535,32 +535,32 @@ export default {
); );
this.oldMember = Object.assign({}, role); this.oldMember = Object.assign({}, role);
this.$refs.allScriptRole.updateLoading(); this.$refs.allScriptRole.updateLoading();
}, },
startReplaceBg() { startReplaceBg() {
startReplaceBg(this.group).then(resp => { startReplaceBg(this.group).then(resp => {
this.$emit('setReplace', true); this.$emit('setReplace', true);
}).catch(error => { }).catch(error => {
this.$messageBox(error.message); this.$messageBox(error.message);
}) });
}, },
confirmReplaceBg() { confirmReplaceBg() {
confirmReplaceBg(this.group).then(resp => { confirmReplaceBg(this.group).then(resp => {
this.$message.success('替换成功'); this.$message.success('替换成功');
this.$emit('setReplace', false); this.$emit('setReplace', false);
}).catch(error => { }).catch(error => {
this.$messageBox(error.message); this.$messageBox(error.message);
}) });
}, },
cancelReplaceBg() { cancelReplaceBg() {
cancelReplaceBg(this.group).then(resp => { cancelReplaceBg(this.group).then(resp => {
this.$emit('setReplace', false); this.$emit('setReplace', false);
}).catch(error => { }).catch(error => {
this.$messageBox(error.message); this.$messageBox(error.message);
}) });
}, },
showConditionManage(actionInfo) { showConditionManage(actionInfo) {
this.$refs.conditionManage.doShow(actionInfo); this.$refs.conditionManage.doShow(actionInfo);
} }
} }
}; };
</script> </script>