条件管理调整

This commit is contained in:
fan 2020-11-05 15:31:28 +08:00
parent d5371da85c
commit 3d03111631
3 changed files with 32 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<template>
<div v-if="dialogVisible" v-quickMenuDrag class="reminder-drag">
<div style="width: 100%;text-align: center;font-size: 18px;padding-top: 8px;">条件管理</div>
<i style="position: relative;top: -25px;right: -370px;" class="el-icon-close" @click="handleClose" />
<i style="position: relative;top: -25px;right: -370px;font-size: 20px;" class="el-icon-close" @click="handleClose" />
<el-tabs v-model="activeName">
<el-tab-pane label="列车触发" name="first">
<div>
@ -138,19 +138,23 @@ export default {
}
},
methods:{
doShow(actionInfo) {
this.tableData = [];
this.delay = 0;
this.actionId = actionInfo.id;
getActionCondition(this.$route.query.group, this.actionId).then(resp => {
if (resp.data) {
this.tableData = resp.data.trainStatuses;
this.delay = (resp.data.delay || 0) / 1000;
}
}).catch(()=> {
this.$message.error('获取条件失败');
});
this.dialogVisible = true;
doShow(actionId) {
if (this.actionId === actionId && this.dialogVisible) {
this.handleClose();
} else {
this.tableData = [];
this.delay = 0;
this.actionId = actionId;
getActionCondition(this.$route.query.group, this.actionId).then(resp => {
if (resp.data) {
this.tableData = resp.data.trainStatuses;
this.delay = (resp.data.delay || 0) / 1000;
}
}).catch(()=> {
this.$message.error('获取条件失败');
});
this.dialogVisible = true;
}
},
handleClose() {
this.dialogVisible = false;
@ -274,5 +278,6 @@ export default {
background: #FFF;
width: 400px;
height: 600px;
border-radius: 5px;
}
</style>

View File

@ -43,7 +43,7 @@
</span>
</div>
<div class="btnGroup">
<el-button type="primary" size="mini" @click="handleCondition(actionInfo)">触发条件</el-button>
<el-button :type="conditionActionId === actionInfo.id? 'danger':'primary'" size="mini" @click="handleCondition(actionInfo)">{{ conditionActionId === actionInfo.id? '关闭条件':'触发条件' }}</el-button>
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>
@ -86,7 +86,8 @@ export default {
modifyTextLoading:false,
deleteLoading:false,
// behaviorName:"",
memberName: ''
memberName: '',
conditionActionId: ''
};
},
watch: {
@ -114,7 +115,12 @@ export default {
this.loadOtherData(this.$route.query);
},
handleCondition(actionInfo) {
this.$emit('showConditionManage', actionInfo);
if (this.conditionActionId === actionInfo.id) {
this.conditionActionId = '';
} else {
this.conditionActionId = actionInfo.id;
}
this.$emit('showConditionManage', actionInfo.id);
},
covertData(memberList, element) {
const member = memberList.find(elem=>{ return elem.id == element.memberId; });

View File

@ -430,6 +430,8 @@ export default {
this.quickChangeMember.list = [new_member];
this.$emit('resetChat');
}
this.$refs.conditionManage && this.$refs.conditionManage.handleClose();
this.$refs.getAction.conditionActionId = '';
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('scriptRecord/updateRole', new_member.type + ':' + this.orignalUserRoleId);
@ -558,8 +560,8 @@ export default {
this.$messageBox(error.message);
});
},
showConditionManage(actionInfo) {
this.$refs.conditionManage.doShow(actionInfo);
showConditionManage(actionId) {
this.$refs.conditionManage.doShow(actionId);
}
}
};