diff --git a/src/api/faultManage/actAlarm.ts b/src/api/faultManage/actAlarm.ts index a2f5929c..a53fda48 100644 --- a/src/api/faultManage/actAlarm.ts +++ b/src/api/faultManage/actAlarm.ts @@ -1,36 +1,30 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; import { parseObjLineToHump } from '@/utils/parse-utils'; -import { parseDateToStr } from '@/utils/date-utils'; -import useUserStore from '@/store/modules/user'; /** * 获取活动告警数 * @returns object */ export async function getActiveAlarmTotal() { - let totalSQL = `select count(*) as total from alarm where alarm_status='1'`; - // 发起请求 const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, + url: `/neData/alarm/list`, method: 'GET', params: { - SQL: totalSQL, + alarmStatus: '1', + sortField: 'event_time', + sortOrder: 'desc', + pageNum: 1, + pageSize: 1, }, }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const itemData = result.data.data; - if (Array.isArray(itemData)) { - const v = itemData[0]['alarm']; - if (Array.isArray(v)) { - result.data = v[0]['total']; - } - } - } - return result; + return { + code: result.code, + msg: result.msg, + data: result.data.total ?? 0, + }; } /** @@ -38,77 +32,12 @@ export async function getActiveAlarmTotal() { * @param query 查询参数 * @returns object */ -export async function listAct(query: Record, filterSQl: string) { - let totalSQL = `select count(*) as total from alarm where alarm_status='1' ${filterSQl} `; - let rowsSQL = `select * from alarm where alarm_status='1' ${filterSQl}`; - // 查询 - let querySQL = ''; - if (query.alarmCode) { - querySQL += ` and alarm_code = '${query.alarmCode}' `; - } - - if (query.alarmType) { - querySQL += ` and alarm_type = '${query.alarmType}' `; - } - - if (query.pvFlag) { - querySQL += ` and pv_flag = '${query.pvFlag}' `; - } - - if (query.origSeverity) { - querySQL += ` and orig_severity in('${query.origSeverity}' )`; - } - - if (query.neId) { - querySQL += ` and ne_id like '%${query.neId}%' `; - } - - if (query.neName) { - querySQL += ` and ne_name like '%${query.neName}%' `; - } - - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - - if (query.beginTime && query.endTime) { - querySQL += ` and event_time BETWEEN '${query.beginTime}' and ' ${query.endTime}'`; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by event_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, +export async function listAct(query: Record) { + return await request({ + url: `/neData/alarm/list`, method: 'GET', - params: { - SQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data = { - data: { total: 0, rows: [] as any }, - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['alarm']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.data.total = itemData[0]['total']; - } else { - data.data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } /** diff --git a/src/api/faultManage/eventAlarm.ts b/src/api/faultManage/eventAlarm.ts index 30c7256c..f0b0d1d7 100644 --- a/src/api/faultManage/eventAlarm.ts +++ b/src/api/faultManage/eventAlarm.ts @@ -8,72 +8,11 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listAct(query: Record) { - let totalSQL = `select count(*) as total from alarm_event where 1=1 `; - let rowsSQL = `select * from alarm_event where 1=1 `; - // 查询 - let querySQL = ''; - if (query.alarmCode) { - querySQL += ` and alarm_code = '${query.alarmCode}' `; - } - - if (query.alarmType) { - querySQL += ` and alarm_type = '${query.alarmType}' `; - } - - if (query.pvFlag) { - querySQL += ` and pv_flag = '${query.pvFlag}' `; - } - - if (query.neId) { - querySQL += ` and ne_id like '%${query.neId}%' `; - } - - if (query.neName) { - querySQL += ` and ne_name like '%${query.neName}%' `; - } - - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - - if (query.beginTime && query.endTime) { - querySQL += ` and event_time BETWEEN '${query.beginTime}' and ' ${query.endTime}'`; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by event_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_event`, + return await request({ + url: `/neData/alarm/log/event`, method: 'GET', - params: { - SQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data = { - data: { total: 0, rows: [] as any }, - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['alarm_event']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.data.total = itemData[0]['total']; - } else { - data.data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } /** diff --git a/src/api/faultManage/historyAlarm.ts b/src/api/faultManage/historyAlarm.ts index c789c237..f6648b36 100644 --- a/src/api/faultManage/historyAlarm.ts +++ b/src/api/faultManage/historyAlarm.ts @@ -10,62 +10,11 @@ import useUserStore from '@/store/modules/user'; * @returns object */ export async function listAct(query: Record) { - let totalSQL = `select count(*) as total from alarm where alarm_status='0'`; - let rowsSQL = `select * from alarm where alarm_status='0'`; - // 查询 - let querySQL = ''; - querySQL += query.alarm_code - ? ` and alarm_code = '${query.alarm_code}' ` - : ''; - querySQL += query.alarm_type - ? ` and alarm_type = '${query.alarm_type}' ` - : ''; - querySQL += query.pv_flag ? ` and pv_flag = '${query.pv_flag}' ` : ''; - querySQL += query.orig_severity - ? ` and orig_severity in('${query.orig_severity}' )` - : ''; - querySQL += query.ne_id ? ` and ne_id like '%${query.ne_id}%' ` : ''; - querySQL += query.ne_name ? ` and ne_name like '%${query.ne_name}%' ` : ''; - querySQL += query.ne_type ? ` and ne_type like '%${query.ne_type}%' ` : ''; - querySQL += - query.beginTime && query.endTime - ? ` and event_time BETWEEN '${query.beginTime}' and ' ${query.endTime}'` - : ''; - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by clear_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, + return await request({ + url: `/neData/alarm/list`, method: 'GET', - params: { - SQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data = { - data: { total: 0, rows: [] as any }, - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['alarm']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.data.total = itemData[0]['total']; - } else { - data.data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } /** diff --git a/src/api/logManage/alarm.ts b/src/api/logManage/alarm.ts index 69ecaae2..11f122a4 100644 --- a/src/api/logManage/alarm.ts +++ b/src/api/logManage/alarm.ts @@ -1,6 +1,4 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; /** * 查询日志列表 @@ -8,64 +6,9 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listAlarm(query: Record) { - let totalSQL = 'select count(*) as total from alarm_log where 1=1 '; - let rowsSQL = 'select * from alarm_log where 1=1 '; - - // 查询 - let querySQL = ''; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - if (query.status) { - querySQL += ` and alarm_status = '${query.status}' `; - } - if (query.beginTime) { - querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `; - } - if (query.endTime) { - querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `; - } - - // 排序 - let sortSql = ' order by event_time '; - if (query.sortOrder === 'asc') { - sortSql += ' asc '; - } else { - sortSql += ' desc '; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_log`, + return await request({ + url: `/neData/alarm/log/list`, method: 'GET', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + sortSql + limtSql, - }, + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data = { - data: { total: 0, rows: [] as any }, - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['alarm_log']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.data.total = itemData[0]['total']; - } else { - data.data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } diff --git a/src/api/logManage/forwarding.ts b/src/api/logManage/forwarding.ts index ee2a05e9..fd8d057c 100644 --- a/src/api/logManage/forwarding.ts +++ b/src/api/logManage/forwarding.ts @@ -1,6 +1,4 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; /** * 查询日志列表 @@ -8,61 +6,9 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listForwarding(query: Record) { - let totalSQL = 'select count(*) as total from alarm_forward_log where 1=1 '; - let rowsSQL = 'select * from alarm_forward_log where 1=1 '; - - // 查询 - let querySQL = ''; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - if (query.beginTime) { - querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `; - } - if (query.endTime) { - querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `; - } - - // 排序 - let sortSql = ' order by event_time '; - if (query.sortOrder === 'asc') { - sortSql += ' asc '; - } else { - sortSql += ' desc '; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_forward_log`, + return await request({ + url: `/neData/alarm/forward/log/list`, method: 'GET', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + sortSql + limtSql, - }, + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data = { - data: { total: 0, rows: [] as any }, - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['alarm_forward_log']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.data.total = itemData[0]['total']; - } else { - data.data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 757c6651..d09b6865 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1096,13 +1096,9 @@ export default { faultManage: { activeAlarm: { all:'All', - neType: 'NE Type', - neName: 'NE Name', - neId: 'NE UID', alarmCode: 'Alarm Code', origLevel: 'Severity', eventTime: 'Event Time', - pvFlag: 'PV Flag', alarmType: 'Alarm Type', confirm: 'Confirm', updateConfirm: 'Cancel Confirm', @@ -1111,7 +1107,7 @@ export default { mySelf: 'Personalization', exportAll: 'Export All', disPlayFilfter: 'Display Filters', - alarmId:'ID', + alarmId:'Alarm ID', alarmTitle:'Title', clearUser:'Clear User', clearType:'Clear Type', @@ -1160,12 +1156,13 @@ export default { }, logManage:{ alarm:{ - type:'NE Type', - neId:'NE UID', alarmId:'Alarm ID', alarmSeq:'Sequence Number', alarmCode:'Alarm Code', + alarmTitle: 'Alarm Time', alarmStatus:'Status', + alarmType:'Alarm Type', + origSeverity:'Severity', eventTime:'Event Time', logTime:'Recording Time', status:'Status', @@ -1179,14 +1176,16 @@ export default { logTime:'Log Time' }, forwarding:{ - type:'NE Type', - neId:'NE UID', alarmId:'Alarm ID', alarmSeq:'Sequence Number', + alarmCode:'Alarm Code', alarmObj:'Forward Users', alarmInter:'Forward Interface', alarmTitle:'Alarm Title', alarmInfo:'Operation Results', + alarmStatus:'Status', + alarmType:'Alarm Type', + origSeverity:'Severity', eventTime:'Event Time', logTime:'Log Time' }, diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index aecdfbe9..5bbaae68 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1096,13 +1096,9 @@ export default { faultManage: { activeAlarm: { all:'所有', - neType: '告警设备类型', - neName: '告警网元名称', - neId: '告警网元标识', alarmCode: '告警编号', origLevel: '告警级别', eventTime: '告警产生时间', - pvFlag: '虚拟化标识', alarmType: '告警类型', confirm: '确认', updateConfirm: '取消确认', @@ -1160,12 +1156,13 @@ export default { }, logManage:{ alarm:{ - type:'网元类型', - neId:'告警网元标识', alarmId:'告警唯一标识', - alarmSeq:'告警流水号', - alarmCode:'告警编号', + alarmSeq: '告警流水号', + alarmCode: '告警编号', + alarmTitle: '告警标题', alarmStatus:'告警状态', + alarmType:'告警类型', + origSeverity: '告警级别', eventTime:'告警产生时间', logTime:'记录时间', status:'告警状态' @@ -1179,14 +1176,16 @@ export default { logTime:'log Time' }, forwarding:{ - type:'网元类型', - neId:'告警网元标识', alarmId:'告警唯一标识', alarmSeq:'告警流水号', + alarmCode: '告警编号', alarmObj:'告警前转对象', alarmInter:'告警前转接口', alarmTitle:'告警标题', alarmInfo:'操作结果', + alarmStatus:'告警状态', + alarmType:'告警类型', + origSeverity: '告警级别', eventTime:'告警产生时间', logTime:'记录时间' }, diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index c46fec51..f68df70a 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -24,6 +24,7 @@ import { writeSheet } from '@/utils/execl-utils'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { readLoalXlsx } from '@/utils/execl-utils'; import { parseDateToStr } from '@/utils/date-utils'; +import dayjs, { type Dayjs } from 'dayjs'; const neInfoStore = useNeInfoStore(); const { getDict } = useDictStore(); const { t, currentLocale } = useI18n(); @@ -48,11 +49,29 @@ let dict: { /**表格字段列排序 */ let tableColumnsDnd = ref([]); -/**记录开始结束时间 */ -let queryRangePicker = ref<[string, string]>(['', '']); +/**开始结束时间 */ +let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>(undefined); +/**时间范围 */ +let rangePickerPresets = ref([ + { + label: 'Now hour', + value: [dayjs().startOf('hour'), dayjs().endOf('hour')], + }, + { label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] }, + { + label: 'Yesterday', + value: [ + dayjs().subtract(1, 'day').startOf('day'), + dayjs().subtract(1, 'day').endOf('day'), + ], + }, +]); /**查询参数 */ let queryParams = reactive({ + alarmStatus: 1, + sortField: 'event_time', + sortOrder: 'desc', /**告警设备类型 */ neType: '', /**告警网元名称 */ @@ -63,10 +82,10 @@ let queryParams = reactive({ alarmCode: '', /**告警级别 */ origSeverity: undefined, - beginTime: '', - endTime: '', - /**告警产生时间 */ - eventTime: '', + /**告警产生时间开始时间 */ + beginTime: undefined as undefined | number, + /**告警产生时间结束时间 */ + endTime: undefined as undefined | number, /**虚拟化标识 */ pvFlag: undefined, /**告警类型 */ @@ -75,11 +94,14 @@ let queryParams = reactive({ pageNum: 1, /**每页条数 */ pageSize: 20, + /**条件sql */ + sql: undefined, }); /**查询参数重置 */ function fnQueryReset() { queryParams = Object.assign(queryParams, { + alarmStatus: 1, /**告警设备类型 */ neType: '', /**告警网元名称 */ @@ -91,13 +113,15 @@ function fnQueryReset() { /**告警级别 */ origSeverity: undefined, /**告警产生时间 */ - eventTime: '', + beginTime: undefined, + endTime: undefined, /**虚拟化标识 */ pvFlag: undefined, /**告警类型 */ alarmType: undefined, /**当前页数 */ }); + queryRangePicker.value = undefined; tablePagination.current = 1; tablePagination.pageSize = 20; fnGetList(); @@ -143,31 +167,33 @@ let alarmTableState: TabeStateType = reactive({ /**表格字段列 */ let tableColumns: ColumnsType = [ + { + title: t('views.faultManage.activeAlarm.alarmType'), + dataIndex: 'alarmType', + key: 'alarmType', + align: 'left', + width: 150, + }, { title: t('views.faultManage.activeAlarm.origLevel'), - align: 'center', + align: 'left', key: 'origSeverity', dataIndex: 'origSeverity', - width: 5, + width: 100, }, { title: t('views.faultManage.activeAlarm.alarmTitle'), dataIndex: 'alarmTitle', align: 'left', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.neType'), - dataIndex: 'neType', - align: 'center', - width: 5, + width: 200, + ellipsis: true, }, + { title: t('views.faultManage.activeAlarm.eventTime'), dataIndex: 'eventTime', - align: 'center', - sorter: (a: any, b: any) => 1, - width: 5, + align: 'left', + width: 150, customRender(opt) { if (typeof opt.value === 'number') { return parseDateToStr(+opt.value); @@ -175,129 +201,118 @@ let tableColumns: ColumnsType = [ return opt.value; }, }, - { - title: t('views.faultManage.activeAlarm.alarmCode'), - dataIndex: 'alarmCode', - align: 'center', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.alarmType'), - dataIndex: 'alarmType', - key: 'alarmType', - align: 'left', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.neName'), - dataIndex: 'neName', - align: 'center', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.neId'), - dataIndex: 'neId', - align: 'center', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.pvFlag'), - dataIndex: 'pvFlag', - align: 'center', - width: 5, - }, { title: t('views.faultManage.activeAlarm.alarmId'), dataIndex: 'alarmId', - align: 'center', - width: 5, - }, - - { - title: t('views.faultManage.activeAlarm.ackState'), - dataIndex: 'ackState', - key: 'ackState', align: 'left', - width: 5, + width: 150, + ellipsis: true, }, { - title: t('views.faultManage.activeAlarm.ackUser'), - dataIndex: 'ackUser', + title: t('views.faultManage.activeAlarm.alarmCode'), + dataIndex: 'alarmCode', align: 'left', - width: 5, + width: 100, + }, + { + title: t('views.ne.common.neType'), + dataIndex: 'neType', + align: 'left', + width: 100, + }, + { + title: t('views.ne.common.neName'), + dataIndex: 'neName', + align: 'left', + width: 100, + }, + { + title: t('views.ne.common.neId'), + dataIndex: 'neId', + align: 'left', + width: 100, + }, + { + title: t('views.ne.neInfo.pvflag'), + dataIndex: 'pvFlag', + align: 'left', + width: 150, }, { title: t('common.operate'), - key: 'alarm_id', - align: 'center', + key: 'id', + align: 'left', fixed: 'right', - width: 5, + width: 100, }, ]; /**帮助文档表格字段列 */ -let alarmTableColumns: ColumnsType = [ +let alarmTableColumns = ref([ { - title: t('views.faultManage.activeAlarm.alarmTitle'), - dataIndex: 'alarmName', - align: 'center', - width: 3, - }, - { - title: t('views.faultManage.activeAlarm.locationInfo'), - dataIndex: 'alarmInfo', - align: 'center', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.addInfo'), - dataIndex: 'helpInfo', - align: 'center', - width: 8, + title: t('views.faultManage.activeAlarm.alarmCode'), + dataIndex: 'alarmCode', + align: 'left', + width: 100, }, { title: t('views.faultManage.activeAlarm.alarmType'), dataIndex: 'alarmType', - align: 'center', - width: 5, - }, - { - title: t('views.faultManage.activeAlarm.origLevel'), - dataIndex: 'alarmLevel', - align: 'center', - width: 3, - }, - { - title: t('views.faultManage.activeAlarm.alarmCode'), - dataIndex: 'alarmCode', - align: 'center', - width: 3, - }, - { - title: t('views.faultManage.activeAlarm.specificProblem'), - dataIndex: 'cause', - align: 'center', - width: 5, + align: 'left', + width: 150, }, { title: t('views.faultManage.activeAlarm.clearType'), dataIndex: 'clearType', - align: 'center', - width: 3, + align: 'left', + width: 100, + }, + { + title: t('views.faultManage.activeAlarm.origLevel'), + dataIndex: 'alarmLevel', + align: 'left', + width: 100, + }, + { + title: t('views.faultManage.activeAlarm.alarmTitle'), + dataIndex: 'alarmName', + align: 'left', + width: 150, }, { title: t('views.faultManage.activeAlarm.realTitle'), dataIndex: 'enTitle', - align: 'center', - width: 5, + align: 'left', + width: 150, + }, + { + title: t('views.faultManage.activeAlarm.locationInfo'), + dataIndex: 'alarmInfo', + align: 'left', + width: 150, }, { title: t('views.faultManage.activeAlarm.objectNf'), dataIndex: 'objNf', - align: 'center', - width: 2, + align: 'left', + width: 100, }, -]; + { + title: t('views.faultManage.activeAlarm.specificProblem'), + dataIndex: 'cause', + align: 'left', + width: 200, + }, + { + title: t('views.faultManage.activeAlarm.addInfo'), + dataIndex: 'helpInfo', + align: 'left', + width: 300, + resizable: true, + minWidth: 150, + maxWidth: 400, + }, +]); /**表格分页器参数 */ let tablePagination = reactive({ @@ -728,41 +743,53 @@ function fnGetList(pageNum?: number) { if (pageNum) { queryParams.pageNum = pageNum; } - if (!queryRangePicker.value) { - queryRangePicker.value = ['', '']; + + // 时间范围 + if ( + Array.isArray(queryRangePicker.value) && + queryRangePicker.value.length > 0 + ) { + queryParams.beginTime = queryRangePicker.value[0].valueOf(); + queryParams.endTime = queryRangePicker.value[1].valueOf(); + } else { + queryParams.beginTime = undefined; + queryParams.endTime = undefined; } - queryParams.beginTime = queryRangePicker.value[0]; - queryParams.endTime = queryRangePicker.value[1]; - getPass().then(res => { + + // getPass().then(res => { + // if (res.code === RESULT_CODE_SUCCESS) { + // let sql = res.data.data[0]['config'][0].value + // ? res.data.data[0]['config'][0].value + // : ''; + // filterState.sql = sql; + // } + + // }); + + const form = toRaw(queryParams); + form.sql = filterState.sql; + listAct(form).then((res: any) => { if (res.code === RESULT_CODE_SUCCESS) { - let sql = res.data.data[0]['config'][0].value - ? res.data.data[0]['config'][0].value - : ''; - filterState.sql = sql; - } - listAct(toRaw(queryParams), filterState.sql).then((res: any) => { - if (res.code === RESULT_CODE_SUCCESS) { - // 取消勾选 - if (state.selectedRowKeys.length > 0) { - state.selectedRowKeys = []; - } - const { total, rows } = res.data; - tablePagination.total = total; - tableState.data = rows; - if ( - tablePagination.total <= - (queryParams.pageNum - 1) * tablePagination.pageSize && - queryParams.pageNum !== 1 - ) { - tableState.loading = false; - fnGetList(queryParams.pageNum - 1); - } - } else { - tablePagination.total = 0; - tableState.data = []; + // 取消勾选 + if (state.selectedRowKeys.length > 0) { + state.selectedRowKeys = []; } - tableState.loading = false; - }); + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; + if ( + tablePagination.total <= + (queryParams.pageNum - 1) * tablePagination.pageSize && + queryParams.pageNum !== 1 + ) { + tableState.loading = false; + fnGetList(queryParams.pageNum - 1); + } + } else { + tablePagination.total = 0; + tableState.data = []; + } + tableState.loading = false; }); } @@ -788,8 +815,11 @@ onMounted(() => { } }); // 获取网元网元列表 - useNeInfoStore().fnNelist(); - fnGetList(); + useNeInfoStore() + .fnNelist() + .finally(() => { + fnGetList(); + }); }); @@ -804,62 +834,16 @@ onMounted(() => { - + - - - - - - - - - - - - - - - - {{ t('common.search') }} - - - - {{ t('common.reset') }} - - - - - - - - - - - { /> - - - - - - - - - - - - { /> + + + + + + + + + + + + + + + + + + {{ t('common.search') }} + + + + {{ t('common.reset') }} + + + + @@ -923,7 +920,7 @@ onMounted(() => {