diff --git a/src/api/configManage/neManage.ts b/src/api/configManage/neManage.ts index 0a38019b..d455f146 100644 --- a/src/api/configManage/neManage.ts +++ b/src/api/configManage/neManage.ts @@ -8,8 +8,8 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listNeInfo(query: Record) { - let totalSQL = 'select count(*) as total from ne_info where status=0 '; - let rowsSQL = 'select * from ne_info where status=0 '; + let totalSQL = 'select count(*) as total from ne_info where (status=0 or status=3)'; + let rowsSQL = 'select * from ne_info where (status=0 or status=3) '; // 系统特定顺序 const specificOrder = [ @@ -91,7 +91,7 @@ export async function getNeInfo(id: string | number) { url: `/api/rest/databaseManagement/v1/select/omc_db/ne_info`, method: 'get', params: { - SQL: `select * from ne_info where status=0 and id = ${id}`, + SQL: `select * from ne_info where (status=0 or status=3) and id = ${id}`, }, }); // 解析数据 @@ -112,7 +112,7 @@ export async function getNeInfo(id: string | number) { export function addNeInfo(data: Record) { data.port = `${data.port}`; return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`, + url: `/api/rest/systemManagement/v1/elementType/${data.neType.toLowerCase()}/objectType/neInfo?sync2ne=${data.sync}`, method: 'post', data: data, }); @@ -126,7 +126,7 @@ export function addNeInfo(data: Record) { export function updateNeInfo(data: Record) { data.port = `${data.port}`; return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`, + url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo?sync2ne=${data.sync}`, method: 'put', data: data, }); diff --git a/src/api/index.ts b/src/api/index.ts index ae576f49..666154e6 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -37,6 +37,8 @@ export async function listMain() { const ipAddress = (value as any).ipAddress; const systemState = (value as any).systemState; const serialNum = (value as any).serialNum; + const version = (value as any).version; + const errCode = systemState && systemState['errorCode']; var time = new Date(); @@ -52,10 +54,10 @@ export async function listMain() { }; } else { mergedObj = { - version: '-', + version, refresh: parseDateToStr(time), - ipAddress: ipAddress, - serialNum: serialNum, + ipAddress, + serialNum, name: key.split('/').join('_'), status: 'Abnormal', }; diff --git a/src/api/perfManage/goldTarget.ts b/src/api/perfManage/goldTarget.ts index a2cf1242..d8bf1c56 100644 --- a/src/api/perfManage/goldTarget.ts +++ b/src/api/perfManage/goldTarget.ts @@ -91,6 +91,8 @@ export async function goldData(query: Record) { startTime: query.beginTime, endTime: query.endTime, interval: query.particle, + sortField:query.sortField, + sortOrder:query.sortOrder }, timeout: 60_000, }); diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index dbf99ac5..754f93ae 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -354,6 +354,9 @@ export default { server:'Server File', local:'Local File', fileSelect:'Please select the current import file', + sync:'Synchronize to NE', + open:'Open', + close:'Close', }, backupManage: { setBackupTask: 'Set automatic backup time', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index e41a6973..7c72027a 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -354,6 +354,9 @@ export default { server:'服务器文件', local:'本地文件', fileSelect:'请选择当前导入文件', + sync:'同步到网元', + open:'开', + close:'关', }, backupManage: { setBackupTask: '设置自动备份时间', diff --git a/src/views/configManage/neManage/index.vue b/src/views/configManage/neManage/index.vue index 7111c32d..5bd2ac83 100644 --- a/src/views/configManage/neManage/index.vue +++ b/src/views/configManage/neManage/index.vue @@ -221,6 +221,7 @@ let modalState: ModalStateType = reactive({ pvFlag: '', rmUid: '', vendorName: '', + sync: true, }, importFrom: { neId: '', @@ -1110,6 +1111,18 @@ onMounted(() => { > + + + + + diff --git a/src/views/perfManage/goldTarget/index.vue b/src/views/perfManage/goldTarget/index.vue index 10909215..5cc52fbb 100644 --- a/src/views/perfManage/goldTarget/index.vue +++ b/src/views/perfManage/goldTarget/index.vue @@ -92,8 +92,24 @@ let queryParams: any = reactive({ particle: '15', beginTime: '', endTime: '', + /**排序字段 */ + sortField: 'timeGroup', + /**排序方式 */ + sortOrder: 'asc', }); +/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */ +function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) { + const { columnKey, order } = sorter; + if (order) { + queryParams.sortField = columnKey; + queryParams.sortOrder = order.replace('end', ''); + } else { + queryParams.sortOrder = 'asc'; + } + fnMakeTable(1); +} + /**图表显示数据 */ const chartsOption = reactive({ /**性能指标 */ @@ -196,6 +212,8 @@ function fnDesign() { dataIndex: 'timeGroup', align: 'center', fixed: 'right', + key: 'timeGroup', + sorter: true, }); if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; @@ -216,7 +234,7 @@ function fnDesign() { .filter(key => !['timeGroup', 'neName', 'startIndex'].includes(key)) .map(key => { const title: any = findTitleByKey(key); - hideAll[title]=false; + hideAll[title] = false; return { name: title, data: res.data.map((item: any) => parseInt(item[key])), @@ -260,7 +278,7 @@ function fnDesign() { color: '#646A73', }, icon: 'circle', - selected:hideAll, + selected: hideAll, }, grid: { left: '10%', @@ -293,52 +311,50 @@ function fnDesign() { onMounted(() => { // 获取网元网元列表 - neInfoStore - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - if (res.data.length > 0) { - // 过滤不可用的网元 - neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( - (item: any) => { - return !['OMC'].includes(item.value); - } - ); - if (neCascaderOptions.value.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - return; + neInfoStore.fnNelist().then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.data.length > 0) { + // 过滤不可用的网元 + neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( + (item: any) => { + return !['OMC'].includes(item.value); } - // 默认选择AMF - const item = neCascaderOptions.value.find(s => s.value === 'UPF'); - if (item && item.children) { - const info = item.children[0]; - queryParams.neType = [info.neType, info.neId]; - } else { - const info = neCascaderOptions.value[0].children[0]; - queryParams.neType = [info.neType, info.neId]; - } - const initTime: Date = new Date(); - const startTime: Date = new Date(initTime); - startTime.setHours(0, 0, 0, 0); // 设置为今天的0点 - const endTime: Date = new Date(initTime); - endTime.setHours(23, 59, 59, 59); // 设置为今天的12点 - - queryRangePicker.value = [ - parseDateToStr(startTime), - parseDateToStr(endTime), - ]; - fnGetList(); + ); + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + return; } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); + // 默认选择AMF + const item = neCascaderOptions.value.find(s => s.value === 'UPF'); + if (item && item.children) { + const info = item.children[0]; + queryParams.neType = [info.neType, info.neId]; + } else { + const info = neCascaderOptions.value[0].children[0]; + queryParams.neType = [info.neType, info.neId]; + } + const initTime: Date = new Date(); + const startTime: Date = new Date(initTime); + startTime.setHours(0, 0, 0, 0); // 设置为今天的0点 + const endTime: Date = new Date(initTime); + endTime.setHours(23, 59, 59, 59); // 设置为今天的12点 + + queryRangePicker.value = [ + parseDateToStr(startTime), + parseDateToStr(endTime), + ]; + fnGetList(); } - }); + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + }); }); @@ -481,6 +497,7 @@ onMounted(() => { :scroll="{ x: tableColumnsDnd.length * 200, y: 450 }" @resizeColumn="(w:number, col:any) => (col.width = w)" :show-expand-column="false" + @change="fnTableChange" >