This commit is contained in:
joylink_cuiweidong 2020-11-05 15:50:51 +08:00
commit 341ed08db2
3 changed files with 32 additions and 19 deletions

View File

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

View File

@ -43,7 +43,7 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <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" 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" :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> <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, modifyTextLoading:false,
deleteLoading:false, deleteLoading:false,
// behaviorName:"", // behaviorName:"",
memberName: '' memberName: '',
conditionActionId: ''
}; };
}, },
watch: { watch: {
@ -114,7 +115,12 @@ export default {
this.loadOtherData(this.$route.query); this.loadOtherData(this.$route.query);
}, },
handleCondition(actionInfo) { 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) { covertData(memberList, element) {
const member = memberList.find(elem=>{ return elem.id == element.memberId; }); const member = memberList.find(elem=>{ return elem.id == element.memberId; });

View File

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