fix: 告警关闭非必要的操作
This commit is contained in:
@@ -113,49 +113,18 @@ export async function listAct(query: Record<string, any>, filterSQl: string) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认告警信息
|
* 确认告警信息
|
||||||
* @param data 鉴权对象
|
* @param ids 记录ID
|
||||||
|
* @param state 状态 true确认 false取消确认
|
||||||
* @returns object
|
* @returns object
|
||||||
*/
|
*/
|
||||||
export function updateConfirm(data: Record<string, any>) {
|
export function ackAlarm(ids: number[], state: boolean) {
|
||||||
var time = new Date();
|
|
||||||
const userName = useUserStore().userName;
|
|
||||||
let finalData = {
|
|
||||||
alarm: {
|
|
||||||
ack_time: parseDateToStr(time),
|
|
||||||
ack_user: userName,
|
|
||||||
ack_state: '1',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return request({
|
return request({
|
||||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
url: `/neData/alarm/ack'`,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: finalData,
|
data: {
|
||||||
});
|
ids: ids,
|
||||||
}
|
ackState: state,
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消确认告警
|
|
||||||
* @param data 鉴权对象
|
|
||||||
* @returns object
|
|
||||||
*/
|
|
||||||
export function cancelConfirm(data: (string | number)[]) {
|
|
||||||
var time = new Date();
|
|
||||||
const userName = useUserStore().userName;
|
|
||||||
let finalData = {
|
|
||||||
alarm: {
|
|
||||||
ack_time: parseDateToStr(time),
|
|
||||||
ack_user: '',
|
|
||||||
ack_state: '0',
|
|
||||||
},
|
},
|
||||||
};
|
|
||||||
|
|
||||||
return request({
|
|
||||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
|
||||||
','
|
|
||||||
)})`,
|
|
||||||
method: 'PUT',
|
|
||||||
data: finalData,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,27 +176,14 @@ export function getPass() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除告警信息
|
* 清除告警信息
|
||||||
* @param data 鉴权对象
|
* @param ids 记录ID
|
||||||
* @returns object
|
* @returns object
|
||||||
*/
|
*/
|
||||||
export function clearAlarm(data: Record<string, any>) {
|
export function clearAlarm(ids: number[]) {
|
||||||
var time = new Date();
|
|
||||||
const userName = useUserStore().userName;
|
|
||||||
let finalData = {
|
|
||||||
data: {
|
|
||||||
clear_time: parseDateToStr(time),
|
|
||||||
clear_type: '2',
|
|
||||||
alarm_status: '0',
|
|
||||||
clear_user: userName,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return request({
|
return request({
|
||||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
url: `/neData/alarm/clear`,
|
||||||
','
|
|
||||||
)})`,
|
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: finalData,
|
data: { ids },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export function refreshCache() {
|
|||||||
*/
|
*/
|
||||||
export function changeValue(data: Record<string, string>) {
|
export function changeValue(data: Record<string, string>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/config/changeValue',
|
url: '/system/config/change-value',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
|
|||||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
import {
|
import {
|
||||||
listAct,
|
listAct,
|
||||||
updateConfirm,
|
ackAlarm,
|
||||||
cancelConfirm,
|
|
||||||
listSync,
|
listSync,
|
||||||
clearAlarm,
|
clearAlarm,
|
||||||
showPass,
|
showPass,
|
||||||
@@ -436,7 +435,7 @@ function fnModalVisibleBy(code: string) {
|
|||||||
function fnModalOk() {
|
function fnModalOk() {
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const from = toRaw(modalState.from);
|
const from = toRaw(modalState.from);
|
||||||
if (from.ackState === '1') {
|
if (from.ackState == '1') {
|
||||||
message.error({
|
message.error({
|
||||||
content: t('views.faultManage.activeAlarm.ackError'),
|
content: t('views.faultManage.activeAlarm.ackError'),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
@@ -445,9 +444,8 @@ function fnModalOk() {
|
|||||||
modalState.openByView = false;
|
modalState.openByView = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const result = updateConfirm(from);
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
result
|
ackAlarm([from.id], true)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
@@ -527,7 +525,8 @@ function fnCancelConfirm() {
|
|||||||
content: t('views.faultManage.activeAlarm.cancelSure'),
|
content: t('views.faultManage.activeAlarm.cancelSure'),
|
||||||
onOk() {
|
onOk() {
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
cancelConfirm(state.selectedRowKeys).then(res => {
|
const ids = state.selectedRowKeys.map(v => Number(v));
|
||||||
|
ackAlarm(ids, false).then(res => {
|
||||||
hide();
|
hide();
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
@@ -577,7 +576,8 @@ function fnClear() {
|
|||||||
content: t('views.faultManage.activeAlarm.delSure'),
|
content: t('views.faultManage.activeAlarm.delSure'),
|
||||||
onOk() {
|
onOk() {
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
clearAlarm(state.selectedRowKeys).then(res => {
|
const ids = state.selectedRowKeys.map(v => Number(v));
|
||||||
|
clearAlarm(ids).then(res => {
|
||||||
hide();
|
hide();
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
@@ -928,6 +928,7 @@ onMounted(() => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
@click.prevent="fnCancelConfirm()"
|
@click.prevent="fnCancelConfirm()"
|
||||||
:disabled="state.selectedRowKeys.length <= 0"
|
:disabled="state.selectedRowKeys.length <= 0"
|
||||||
|
v-if="false"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<CloseOutlined />
|
<CloseOutlined />
|
||||||
@@ -935,7 +936,7 @@ onMounted(() => {
|
|||||||
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-button type="primary" @click.prevent="fnSync()">
|
<a-button type="primary" @click.prevent="fnSync()" v-if="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ReloadOutlined />
|
<ReloadOutlined />
|
||||||
</template>
|
</template>
|
||||||
@@ -954,7 +955,7 @@ onMounted(() => {
|
|||||||
{{ t('views.faultManage.activeAlarm.clear') }}
|
{{ t('views.faultManage.activeAlarm.clear') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-button type="primary" @click.prevent="fnShowSet()">
|
<a-button type="primary" @click.prevent="fnShowSet()" v-if="false">
|
||||||
<template #icon> <SettingOutlined /> </template>
|
<template #icon> <SettingOutlined /> </template>
|
||||||
{{ t('views.faultManage.activeAlarm.disPlayFilfter') }}
|
{{ t('views.faultManage.activeAlarm.disPlayFilfter') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -1289,7 +1290,15 @@ onMounted(() => {
|
|||||||
{{ modalState.from.specificProblem }}
|
{{ modalState.from.specificProblem }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-row>
|
<a-form-item
|
||||||
|
:label="t('views.faultManage.activeAlarm.objectName')"
|
||||||
|
name="objectName"
|
||||||
|
:label-col="{ span: 4 }"
|
||||||
|
>
|
||||||
|
{{ modalState.from.objectName }}
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-row v-show="modalState.from.ackUser != ''">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.ackUser')"
|
:label="t('views.faultManage.activeAlarm.ackUser')"
|
||||||
@@ -1303,26 +1312,18 @@ onMounted(() => {
|
|||||||
:label="t('views.faultManage.activeAlarm.ackState')"
|
:label="t('views.faultManage.activeAlarm.ackState')"
|
||||||
name="ackState"
|
name="ackState"
|
||||||
>
|
>
|
||||||
{{ modalState.from.ackState }}
|
<DictTag
|
||||||
|
:options="dict.activeAckState"
|
||||||
|
:value="modalState.from.ackState"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
|
||||||
|
|
||||||
<a-row>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.ackTime')"
|
:label="t('views.faultManage.activeAlarm.ackTime')"
|
||||||
name="ackTime"
|
name="ackTime"
|
||||||
>
|
>
|
||||||
{{ modalState.from.ackTime }}
|
{{ parseDateToStr(modalState.from.ackTime) }}
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
|
||||||
<a-form-item
|
|
||||||
:label="t('views.faultManage.activeAlarm.objectName')"
|
|
||||||
name="objectName"
|
|
||||||
>
|
|
||||||
{{ modalState.from.objectName }}
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
@@ -742,6 +742,7 @@ onMounted(() => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
@click.prevent="fnCancelConfirm()"
|
@click.prevent="fnCancelConfirm()"
|
||||||
:disabled="state.selectedRowKeys.length <= 0"
|
:disabled="state.selectedRowKeys.length <= 0"
|
||||||
|
v-if="false"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<CloseOutlined />
|
<CloseOutlined />
|
||||||
@@ -877,6 +878,7 @@ onMounted(() => {
|
|||||||
@ok="fnModalOk"
|
@ok="fnModalOk"
|
||||||
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
||||||
@cancel="fnModalCancel"
|
@cancel="fnModalCancel"
|
||||||
|
:footer="false"
|
||||||
>
|
>
|
||||||
<a-form
|
<a-form
|
||||||
name="modalStateFrom"
|
name="modalStateFrom"
|
||||||
@@ -974,7 +976,10 @@ onMounted(() => {
|
|||||||
:label="t('views.faultManage.activeAlarm.alarmType')"
|
:label="t('views.faultManage.activeAlarm.alarmType')"
|
||||||
name="alarmType"
|
name="alarmType"
|
||||||
>
|
>
|
||||||
{{ modalState.from.alarmType }}
|
<DictTag
|
||||||
|
:options="dict.activeAlarmType"
|
||||||
|
:value="modalState.from.alarmType"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -1000,7 +1005,10 @@ onMounted(() => {
|
|||||||
:label="t('views.faultManage.activeAlarm.origLevel')"
|
:label="t('views.faultManage.activeAlarm.origLevel')"
|
||||||
name="origSeverity"
|
name="origSeverity"
|
||||||
>
|
>
|
||||||
{{ modalState.from.origSeverity }}
|
<DictTag
|
||||||
|
:options="dict.activeAlarmSeverity"
|
||||||
|
:value="modalState.from.origSeverity"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -1027,13 +1035,24 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
{{ modalState.from.specificProblem }}
|
{{ modalState.from.specificProblem }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
:label="t('views.faultManage.activeAlarm.objectName')"
|
||||||
|
name="objectName"
|
||||||
|
:label-col="{ span: 4 }"
|
||||||
|
>
|
||||||
|
{{ modalState.from.objectName }}
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.clearType')"
|
:label="t('views.faultManage.activeAlarm.clearType')"
|
||||||
name="clearType"
|
name="clearType"
|
||||||
>
|
>
|
||||||
{{ modalState.from.clearType }}
|
<DictTag
|
||||||
|
:options="dict.activeClearType"
|
||||||
|
:value="modalState.from.clearType"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
@@ -1041,12 +1060,12 @@ onMounted(() => {
|
|||||||
:label="t('views.faultManage.activeAlarm.clearTime')"
|
:label="t('views.faultManage.activeAlarm.clearTime')"
|
||||||
name="clearTime"
|
name="clearTime"
|
||||||
>
|
>
|
||||||
{{ modalState.from.clearTime }}
|
{{ parseDateToStr(modalState.from.clearTime) }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-row>
|
<a-row v-show="modalState.from.ackUser != ''">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.ackUser')"
|
:label="t('views.faultManage.activeAlarm.ackUser')"
|
||||||
@@ -1060,26 +1079,18 @@ onMounted(() => {
|
|||||||
:label="t('views.faultManage.activeAlarm.ackState')"
|
:label="t('views.faultManage.activeAlarm.ackState')"
|
||||||
name="ackState"
|
name="ackState"
|
||||||
>
|
>
|
||||||
{{ modalState.from.ackState }}
|
<DictTag
|
||||||
|
:options="dict.activeAckState"
|
||||||
|
:value="modalState.from.ackState"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
|
||||||
|
|
||||||
<a-row>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.ackTime')"
|
:label="t('views.faultManage.activeAlarm.ackTime')"
|
||||||
name="ackTime"
|
name="ackTime"
|
||||||
>
|
>
|
||||||
{{ modalState.from.ackTime }}
|
{{ parseDateToStr(modalState.from.ackTime) }}
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
|
||||||
<a-form-item
|
|
||||||
:label="t('views.faultManage.activeAlarm.objectName')"
|
|
||||||
name="objectName"
|
|
||||||
>
|
|
||||||
{{ modalState.from.objectName }}
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
Reference in New Issue
Block a user