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
|
||||
*/
|
||||
export function updateConfirm(data: Record<string, any>) {
|
||||
var time = new Date();
|
||||
const userName = useUserStore().userName;
|
||||
let finalData = {
|
||||
alarm: {
|
||||
ack_time: parseDateToStr(time),
|
||||
ack_user: userName,
|
||||
ack_state: '1',
|
||||
},
|
||||
};
|
||||
|
||||
export function ackAlarm(ids: number[], state: boolean) {
|
||||
return request({
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
||||
url: `/neData/alarm/ack'`,
|
||||
method: 'PUT',
|
||||
data: finalData,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消确认告警
|
||||
* @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',
|
||||
data: {
|
||||
ids: ids,
|
||||
ackState: state,
|
||||
},
|
||||
};
|
||||
|
||||
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
|
||||
*/
|
||||
export function clearAlarm(data: Record<string, any>) {
|
||||
var time = new Date();
|
||||
const userName = useUserStore().userName;
|
||||
let finalData = {
|
||||
data: {
|
||||
clear_time: parseDateToStr(time),
|
||||
clear_type: '2',
|
||||
alarm_status: '0',
|
||||
clear_user: userName,
|
||||
},
|
||||
};
|
||||
|
||||
export function clearAlarm(ids: number[]) {
|
||||
return request({
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
','
|
||||
)})`,
|
||||
url: `/neData/alarm/clear`,
|
||||
method: 'PUT',
|
||||
data: finalData,
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ export function refreshCache() {
|
||||
*/
|
||||
export function changeValue(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/system/config/changeValue',
|
||||
url: '/system/config/change-value',
|
||||
method: 'PUT',
|
||||
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 {
|
||||
listAct,
|
||||
updateConfirm,
|
||||
cancelConfirm,
|
||||
ackAlarm,
|
||||
listSync,
|
||||
clearAlarm,
|
||||
showPass,
|
||||
@@ -436,7 +435,7 @@ function fnModalVisibleBy(code: string) {
|
||||
function fnModalOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const from = toRaw(modalState.from);
|
||||
if (from.ackState === '1') {
|
||||
if (from.ackState == '1') {
|
||||
message.error({
|
||||
content: t('views.faultManage.activeAlarm.ackError'),
|
||||
duration: 3,
|
||||
@@ -445,9 +444,8 @@ function fnModalOk() {
|
||||
modalState.openByView = false;
|
||||
return false;
|
||||
}
|
||||
const result = updateConfirm(from);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
result
|
||||
ackAlarm([from.id], true)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -527,7 +525,8 @@ function fnCancelConfirm() {
|
||||
content: t('views.faultManage.activeAlarm.cancelSure'),
|
||||
onOk() {
|
||||
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();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -577,7 +576,8 @@ function fnClear() {
|
||||
content: t('views.faultManage.activeAlarm.delSure'),
|
||||
onOk() {
|
||||
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();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -928,6 +928,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
@click.prevent="fnCancelConfirm()"
|
||||
:disabled="state.selectedRowKeys.length <= 0"
|
||||
v-if="false"
|
||||
>
|
||||
<template #icon>
|
||||
<CloseOutlined />
|
||||
@@ -935,7 +936,7 @@ onMounted(() => {
|
||||
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
||||
</a-button>
|
||||
|
||||
<a-button type="primary" @click.prevent="fnSync()">
|
||||
<a-button type="primary" @click.prevent="fnSync()" v-if="false">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
@@ -954,7 +955,7 @@ onMounted(() => {
|
||||
{{ t('views.faultManage.activeAlarm.clear') }}
|
||||
</a-button>
|
||||
|
||||
<a-button type="primary" @click.prevent="fnShowSet()">
|
||||
<a-button type="primary" @click.prevent="fnShowSet()" v-if="false">
|
||||
<template #icon> <SettingOutlined /> </template>
|
||||
{{ t('views.faultManage.activeAlarm.disPlayFilfter') }}
|
||||
</a-button>
|
||||
@@ -1289,7 +1290,15 @@ onMounted(() => {
|
||||
{{ modalState.from.specificProblem }}
|
||||
</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-form-item
|
||||
:label="t('views.faultManage.activeAlarm.ackUser')"
|
||||
@@ -1303,26 +1312,18 @@ onMounted(() => {
|
||||
:label="t('views.faultManage.activeAlarm.ackState')"
|
||||
name="ackState"
|
||||
>
|
||||
{{ modalState.from.ackState }}
|
||||
<DictTag
|
||||
:options="dict.activeAckState"
|
||||
:value="modalState.from.ackState"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.ackTime')"
|
||||
name="ackTime"
|
||||
>
|
||||
{{ 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 }}
|
||||
{{ parseDateToStr(modalState.from.ackTime) }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@@ -742,6 +742,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
@click.prevent="fnCancelConfirm()"
|
||||
:disabled="state.selectedRowKeys.length <= 0"
|
||||
v-if="false"
|
||||
>
|
||||
<template #icon>
|
||||
<CloseOutlined />
|
||||
@@ -877,6 +878,7 @@ onMounted(() => {
|
||||
@ok="fnModalOk"
|
||||
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
||||
@cancel="fnModalCancel"
|
||||
:footer="false"
|
||||
>
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
@@ -974,7 +976,10 @@ onMounted(() => {
|
||||
:label="t('views.faultManage.activeAlarm.alarmType')"
|
||||
name="alarmType"
|
||||
>
|
||||
{{ modalState.from.alarmType }}
|
||||
<DictTag
|
||||
:options="dict.activeAlarmType"
|
||||
:value="modalState.from.alarmType"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -1000,7 +1005,10 @@ onMounted(() => {
|
||||
:label="t('views.faultManage.activeAlarm.origLevel')"
|
||||
name="origSeverity"
|
||||
>
|
||||
{{ modalState.from.origSeverity }}
|
||||
<DictTag
|
||||
:options="dict.activeAlarmSeverity"
|
||||
:value="modalState.from.origSeverity"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -1027,13 +1035,24 @@ onMounted(() => {
|
||||
>
|
||||
{{ modalState.from.specificProblem }}
|
||||
</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-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.clearType')"
|
||||
name="clearType"
|
||||
>
|
||||
{{ modalState.from.clearType }}
|
||||
<DictTag
|
||||
:options="dict.activeClearType"
|
||||
:value="modalState.from.clearType"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
@@ -1041,12 +1060,12 @@ onMounted(() => {
|
||||
:label="t('views.faultManage.activeAlarm.clearTime')"
|
||||
name="clearTime"
|
||||
>
|
||||
{{ modalState.from.clearTime }}
|
||||
{{ parseDateToStr(modalState.from.clearTime) }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-row v-show="modalState.from.ackUser != ''">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.ackUser')"
|
||||
@@ -1060,26 +1079,18 @@ onMounted(() => {
|
||||
:label="t('views.faultManage.activeAlarm.ackState')"
|
||||
name="ackState"
|
||||
>
|
||||
{{ modalState.from.ackState }}
|
||||
<DictTag
|
||||
:options="dict.activeAckState"
|
||||
:value="modalState.from.ackState"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.ackTime')"
|
||||
name="ackTime"
|
||||
>
|
||||
{{ 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 }}
|
||||
{{ parseDateToStr(modalState.from.ackTime) }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
Reference in New Issue
Block a user