剧本代码调整

This commit is contained in:
joylink_cuiweidong 2019-11-08 10:59:56 +08:00
parent 7e13f98167
commit 84562c94dc
4 changed files with 29 additions and 3 deletions

View File

@ -161,6 +161,7 @@ export default {
this.$refs['getAction'].loadInitData(); this.$refs['getAction'].loadInitData();
this.$refs['addRole'].initData(); this.$refs['addRole'].initData();
this.$refs['addAction'].initData(); this.$refs['addAction'].initData();
this.$refs['addAction'].resetData();
this.initAutoSaveScript(); this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateBgSet', false); this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$message.success(this.$t('scriptRecord.resetDataSuccess')); this.$message.success(this.$t('scriptRecord.resetDataSuccess'));

View File

@ -95,7 +95,10 @@ export default {
}, },
param:{ param:{
startStation:'', startStation:'',
endStation:'' endStation:'',
drivingMode:'',
speed:'',
signal:''
} }
}, },
isPause:false, isPause:false,
@ -254,6 +257,7 @@ export default {
this.adding = false; this.adding = false;
this.$message.success(this.$t('scriptRecord.addCommandSucess')); this.$message.success(this.$t('scriptRecord.addCommandSucess'));
this.$emit('create'); this.$emit('create');
this.$refs.command.resetButton();
// this.$emit('create',[this.commandData.action.memberId]); // this.$emit('create',[this.commandData.action.memberId]);
// this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]); // this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
// this.initCommandActionData(); // this.initCommandActionData();
@ -385,6 +389,9 @@ export default {
this.modalData.actionVO.reply = data.reply; this.modalData.actionVO.reply = data.reply;
} }
} }
},
resetData() {
this.$refs.command.resetData();
} }
} }
}; };

View File

@ -20,6 +20,7 @@
</el-form-item> </el-form-item>
<el-form-item v-if="commandData.param.drivingMode=='NRM'" :label="$t('scriptRecord.speed')" class="conditionVO" prop="param.speed"> <el-form-item v-if="commandData.param.drivingMode=='NRM'" :label="$t('scriptRecord.speed')" class="conditionVO" prop="param.speed">
<el-input-number v-model="commandData.param.speed" :min="0" /> <el-input-number v-model="commandData.param.speed" :min="0" />
<span> km/h</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal"> <el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal">
<el-input v-model="commandData.param.signal" disabled="disabled" style="width:130px" /> <el-input v-model="commandData.param.signal" disabled="disabled" style="width:130px" />
@ -81,13 +82,30 @@ export default {
}); });
}, },
deviceSelect(em) { deviceSelect(em) {
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase()) { if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.commandData.param.signal = em.code; this.commandData.param.signal = em.code;
this.field = ''; this.field = '';
} }
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
},
resetButton() {
this.field = '';
},
resetData() {
switch (this.type) {
case 'isJinLu': {
this.commandData.param.startStation = '';
this.commandData.param.endStation = '';
break;
}
case 'signal': {
this.commandData.param.signal = '';
this.commandData.param.speed = '';
this.commandData.param.drivingMode = '';
}
}
} }
} }
}; };