道岔钩锁都走操作

This commit is contained in:
fan 2022-07-25 11:11:31 +08:00
parent e9785184dd
commit dc287775e8

View File

@ -45,7 +45,7 @@
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
// import { commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'SwitchHookLock',
@ -125,37 +125,37 @@ export default {
},
commit() {
this.loading = true;
if (this.operation) {
commitOperate(menuOperate.Switch.hookLock, {normal: this.normal}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
// if (this.operation) {
commitOperate(menuOperate.Switch.hookLock, {normal: this.normal}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
console.error(error);
this.$refs.noticeInfo.doShow();
});
} else {
const group = this.$route.query.group;
const param = {
commandType: 'Switch_Hook_Lock',
// Switch_Hook_Lock
targetMemberId: this.targetMemberId,
params: {
switchCode: this.selected.code,
normal: this.normal
}
};
commitTrainSend(group, param).then(({valid, operate})=>{
this.doClose();
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
this.doClose();
});
}
}
}).catch((error) => {
this.loading = false;
this.doClose();
console.error(error);
this.$refs.noticeInfo.doShow();
});
// } else {
// const group = this.$route.query.group;
// const param = {
// commandType: 'Switch_Hook_Lock',
// // Switch_Hook_Lock
// targetMemberId: this.targetMemberId,
// params: {
// switchCode: this.selected.code,
// normal: this.normal
// }
// };
// commitTrainSend(group, param).then(({valid, operate})=>{
// this.doClose();
// }).catch((error) => {
// console.error(error);
// this.$refs.noticeInfo.doShow();
// this.doClose();
// });
// }
}
}