ATP重启 由故障 变为操作

This commit is contained in:
joylink_cuiweidong 2021-11-24 13:58:14 +08:00
parent cdb907819f
commit 68d85d3dc6

View File

@ -34,6 +34,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import CommandHandler from '@/scripts/cmdPlugin/CommandHandler.js';
export default { export default {
name: 'Menus', name: 'Menus',
@ -153,28 +154,34 @@ export default {
}); });
}, },
atpRestart() { atpRestart() {
const step = { CommandHandler.execute('Server_ATP_Restart', {}).then(resp => {
over: true,
operation: menuOperate.Common.setFault.operation,
cmdType: menuOperate.Common.setFault.cmdType,
param: {
code: 'Server',
faultType: 'Server_ATP_Restart'
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
} else {
this.doClose();
this.$messageBox('设置或取消故障操作失败!');
}
}).catch((error) => {
this.loading = false;
this.doClose(); this.doClose();
this.$messageBox(error.message || '设置或取消故障操作失败!'); }).catch(error => {
this.doClose();
this.$messageBox(error.message || 'ATP重启失败');
}); });
// const step = {
// over: true,
// operation: menuOperate.Server.atpRestart.operation,
// cmdType: menuOperate.Server.atpRestart.cmdType
// // param: {
// // code: 'Server',
// // faultType: 'Server_ATP_Restart'
// // }
// };
// this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.doClose();
// } else {
// this.doClose();
// this.$messageBox('ATP');
// }
// }).catch((error) => {
// this.loading = false;
// this.doClose();
// this.$messageBox(error.message || 'ATP');
// });
}, },
doClose() { doClose() {
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {