From 485fa89833a4814bde21a44087bb93037bcd3546 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 20 Feb 2025 10:47:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A1=B5=E9=9D=A2=E5=AD=97=E6=AE=B5/?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/account/components/base-info.vue | 57 +- src/views/account/components/reset-passwd.vue | 4 +- src/views/account/profile.vue | 10 +- src/views/dashboard/amfUE/index.vue | 50 +- src/views/dashboard/imsCDR/index.vue | 71 ++- src/views/dashboard/mmeUE/index.vue | 51 +- .../mocn/components/AlarnTypeBar/index.vue | 202 ------- .../dashboard/mocn/components/setting.vue | 92 --- src/views/dashboard/mocn/index.vue | 570 ------------------ .../overview/components/UPFFlow/index.vue | 2 +- src/views/dashboard/overview/index.vue | 33 +- src/views/dashboard/sgwcCDR/index.vue | 85 ++- src/views/dashboard/smfCDR/index.vue | 24 +- src/views/dashboard/smfCDRByIMSI/index.vue | 20 +- src/views/dashboard/smscCDR/index.vue | 16 +- src/views/faultManage/active-alarm/index.vue | 27 +- src/views/faultManage/event/index.vue | 46 +- src/views/faultManage/history-alarm/index.vue | 7 +- src/views/logManage/alarm/index.vue | 7 +- src/views/logManage/exportFile/index.vue | 9 +- src/views/logManage/forwarding/index.vue | 15 +- src/views/logManage/mml/index.vue | 7 +- src/views/logManage/neFile/index.vue | 9 +- src/views/mmlManage/neOperate/index.vue | 4 +- src/views/mmlManage/omcOperate/index.vue | 4 +- src/views/mmlManage/udmOperate/index.vue | 4 +- src/views/monitor/job/index.vue | 5 +- src/views/monitor/job/log.vue | 5 +- src/views/monitor/monitor/index.vue | 22 +- src/views/monitor/online/index.vue | 14 +- src/views/monitor/topologyBuild/index.vue | 2 +- .../base-station/components/history.vue | 7 +- src/views/ne-data/base-station/list.vue | 4 +- src/views/ne/neConfig/index.vue | 18 +- src/views/ne/neConfigBackup/index.vue | 9 +- src/views/ne/neHost/index.vue | 7 +- src/views/ne/neHostCommand/index.vue | 7 +- .../ne/neInfo/components/BackConfModal.vue | 4 +- src/views/ne/neInfo/index.vue | 7 +- src/views/ne/neLicense/index.vue | 9 +- .../components/NeInfoSoftwareInstall.vue | 8 +- src/views/ne/neSoftware/index.vue | 9 +- src/views/ne/neVersion/index.vue | 9 +- src/views/neUser/auth/index.vue | 15 +- src/views/neUser/base5G/index.vue | 70 ++- src/views/neUser/ims/index.vue | 17 +- src/views/neUser/n3iwf/index.vue | 16 +- src/views/neUser/nssf/index.vue | 5 +- src/views/neUser/nssfAmf/index.vue | 5 +- src/views/neUser/pcf/index.vue | 14 +- src/views/neUser/sub/index.vue | 15 +- src/views/neUser/ue/index.vue | 15 +- src/views/perfManage/customTarget/index.vue | 25 +- src/views/perfManage/goldTarget/index.vue | 73 ++- src/views/perfManage/kpiCReport/index.vue | 22 +- src/views/perfManage/kpiKeyTarget/index.vue | 19 +- src/views/perfManage/kpiOverView/index.vue | 31 +- src/views/perfManage/perfData/index.vue | 7 +- src/views/perfManage/perfThreshold/index.vue | 7 +- src/views/perfManage/taskManage/index.vue | 7 +- src/views/system/config/index.vue | 7 +- src/views/system/dept/index.vue | 61 +- src/views/system/dict/data.vue | 225 ++++--- src/views/system/dict/index.vue | 33 +- src/views/system/log/login/index.vue | 39 +- src/views/system/log/operate/index.vue | 119 ++-- src/views/system/menu/index.vue | 101 ++-- src/views/system/post/index.vue | 35 +- .../quick-start/components/NeInfoConfig.vue | 2 +- .../components/NeInfoConfigPara5G.vue | 10 +- .../components/NeInfoSoftwareInstall.vue | 4 +- .../components/NeInfoSoftwareLicense.vue | 4 +- src/views/system/role/auth-user.vue | 21 +- .../role/components/auth-user-select.vue | 21 +- src/views/system/role/index.vue | 67 +- .../setting/components/change-home-index.vue | 4 +- src/views/system/user/index.vue | 164 ++--- src/views/tool/iperf/index.vue | 2 +- src/views/tool/ping/index.vue | 2 +- .../tool/terminal/components/hostList.vue | 7 +- src/views/tool/terminal/index.vue | 2 +- src/views/traceManage/analysis/index.vue | 15 +- src/views/traceManage/pcap/file.vue | 9 +- src/views/traceManage/task-hlr/index.vue | 11 +- src/views/traceManage/task/index.vue | 25 +- 85 files changed, 1133 insertions(+), 1792 deletions(-) delete mode 100644 src/views/dashboard/mocn/components/AlarnTypeBar/index.vue delete mode 100644 src/views/dashboard/mocn/components/setting.vue delete mode 100644 src/views/dashboard/mocn/index.vue diff --git a/src/views/account/components/base-info.vue b/src/views/account/components/base-info.vue index 77d99f9f..30a48c55 100644 --- a/src/views/account/components/base-info.vue +++ b/src/views/account/components/base-info.vue @@ -3,12 +3,13 @@ import { Modal, message } from 'ant-design-vue/es'; import { FileType } from 'ant-design-vue/es/upload/interface'; import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface'; import { onMounted, reactive, ref, toRaw } from 'vue'; -import { updateUserProfile, uploadAvatar } from '@/api/profile'; +import { updateUserProfile } from '@/api/profile'; import { regExpEmail, regExpMobile, regExpNick } from '@/utils/regular-utils'; import useUserStore from '@/store/modules/user'; import useDictStore from '@/store/modules/dict'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import useI18n from '@/hooks/useI18n'; +import { uploadFile } from '@/api/tool/file'; const { t } = useI18n(); const uerStore = useUserStore(); const { getDict } = useDictStore(); @@ -26,8 +27,9 @@ let stateForm = reactive({ form: { nickName: '', email: '', - phonenumber: '', - sex: '0', + phone: '', + sex: undefined, + avatar: '', }, /**表单提交点击状态 */ formClick: false, @@ -96,20 +98,37 @@ function fnUpload(up: UploadRequestOption) { content: t('views.account.settings.uploadTip'), onOk() { // 发送请求 - const hide = message.loading(t('common.loading'), 0); + const hide = message.loading('请稍等...', 0); upState.value = true; let formData = new FormData(); formData.append('file', up.file); - uploadAvatar(formData).then(res => { - upState.value = false; - hide(); - if (res.code === RESULT_CODE_SUCCESS) { - message.success(t('views.account.settings.uploadOk'), 3); - uerStore.setAvatar(res.data); - } else { - message.error(res.msg, 3); - } - }); + formData.append('subPath', 'avatar'); + uploadFile(formData) + .then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + return res.data.filePath; + } + return ''; + }) + .then(filePath => { + if (filePath === '') return undefined; + const form = toRaw(stateForm.form); + form.avatar = filePath; + return updateUserProfile(form); + }) + .then(res => { + if (res === undefined) return; + if (res.code === RESULT_CODE_SUCCESS) { + message.success(t('views.account.settings.uploadOk'), 3); + uerStore.setAvatar(res.data); + } else { + message.error(res.msg, 3); + } + }) + .finally(() => { + hide(); + upState.value = false; + }); }, }); } @@ -156,21 +175,21 @@ onMounted(() => { diff --git a/src/views/account/components/reset-passwd.vue b/src/views/account/components/reset-passwd.vue index 87e6ba0f..2d381cce 100644 --- a/src/views/account/components/reset-passwd.vue +++ b/src/views/account/components/reset-passwd.vue @@ -1,7 +1,7 @@ - - - - diff --git a/src/views/dashboard/mocn/components/setting.vue b/src/views/dashboard/mocn/components/setting.vue deleted file mode 100644 index f225a0bf..00000000 --- a/src/views/dashboard/mocn/components/setting.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - diff --git a/src/views/dashboard/mocn/index.vue b/src/views/dashboard/mocn/index.vue deleted file mode 100644 index d08e0fee..00000000 --- a/src/views/dashboard/mocn/index.vue +++ /dev/null @@ -1,570 +0,0 @@ - - - - - diff --git a/src/views/dashboard/overview/components/UPFFlow/index.vue b/src/views/dashboard/overview/components/UPFFlow/index.vue index 12694af7..437e1b03 100644 --- a/src/views/dashboard/overview/components/UPFFlow/index.vue +++ b/src/views/dashboard/overview/components/UPFFlow/index.vue @@ -216,7 +216,7 @@ function fnGetInitData() { sortOrder: 'asc', }) .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { for (const item of res.data) { upfFlowParse(item); } diff --git a/src/views/dashboard/overview/index.vue b/src/views/dashboard/overview/index.vue index a011e3ad..4f1f052a 100644 --- a/src/views/dashboard/overview/index.vue +++ b/src/views/dashboard/overview/index.vue @@ -10,9 +10,10 @@ import UserActivity from './components/UserActivity/index.vue'; import AlarnTypeBar from './components/AlarnTypeBar/index.vue'; import UPFFlow from './components/UPFFlow/index.vue'; import { listUDMSub } from '@/api/neData/udm_sub'; -import { listUENumBySMF } from '@/api/neUser/smf'; -import { listUENumByIMS } from '@/api/neUser/ims'; -import { listBase5G } from '@/api/neUser/base5G'; +import { listIMSSessionNum } from '@/api/neData/ims'; +import { listAMFNblist } from '@/api/neData/amf'; +import { listMMENblist } from '@/api/neData/mme'; +import { listSMFSubNum } from '@/api/neData/smf'; import { graphNodeClickID, graphState, @@ -110,13 +111,13 @@ async function fnGetSkim() { listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }), process: (res: any) => res.code === RESULT_CODE_SUCCESS && - (skimState.udmSubNum += res.total), + (skimState.udmSubNum += res.data.total), }, ], [ 'SMF', { - request: (neId: string) => listUENumBySMF(neId), + request: (neId: string) => listSMFSubNum(neId), process: (res: any) => res.code === RESULT_CODE_SUCCESS && (skimState.smfUeNum += res.data), }, @@ -124,7 +125,7 @@ async function fnGetSkim() { [ 'IMS', { - request: (neId: string) => listUENumByIMS(neId), + request: (neId: string) => listIMSSessionNum(neId), process: (res: any) => res.code === RESULT_CODE_SUCCESS && (skimState.imsUeNum += res.data), }, @@ -132,11 +133,11 @@ async function fnGetSkim() { [ 'AMF', { - request: (neId: string) => listBase5G({ neType: 'AMF', neId }), + request: (neId: string) => listAMFNblist({ neId }), process: (res: any) => { if (res.code === RESULT_CODE_SUCCESS) { - skimState.gnbNum += res.total; - skimState.gnbUeNum += res.rows.reduce( + skimState.gnbNum += res.data.length; + skimState.gnbUeNum += res.data.reduce( (sum: number, item: any) => sum + item.ueNum, 0 ); @@ -147,11 +148,11 @@ async function fnGetSkim() { [ 'MME', { - request: (neId: string) => listBase5G({ neType: 'MME', neId }), + request: (neId: string) => listMMENblist({ neId }), process: (res: any) => { if (res.code === RESULT_CODE_SUCCESS) { - skimState.enbNum += res.total; - skimState.enbUeNum += res.rows.reduce( + skimState.enbNum += res.data.length; + skimState.enbUeNum += res.data.reduce( (sum: number, item: any) => sum + item.ueNum, 0 ); @@ -267,12 +268,12 @@ onMounted(() => { neInfoStore .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'UPF') { - arr.push({ value: i.neId, label: i.neName, rmUid: i.rmUid }); + res.data.forEach((v: any) => { + if (v.neType === 'UPF') { + arr.push({ value: v.neId, label: v.neName, rmUid: v.rmUid }); } }); diff --git a/src/views/dashboard/sgwcCDR/index.vue b/src/views/dashboard/sgwcCDR/index.vue index b54704fd..218438d8 100644 --- a/src/views/dashboard/sgwcCDR/index.vue +++ b/src/views/dashboard/sgwcCDR/index.vue @@ -17,6 +17,7 @@ import { listSGWCDataCDR, } from '@/api/neData/sgwc'; import { OptionsType, WS } from '@/plugins/ws-websocket'; +import dayjs, { type Dayjs } from 'dayjs'; import PQueue from 'p-queue'; import saveAs from 'file-saver'; import { useClipboard } from '@vueuse/core'; @@ -29,7 +30,25 @@ const queue = new PQueue({ concurrency: 1, autoStart: true }); let neOtions = ref[]>([]); /**开始结束时间 */ -let queryRangePicker = ref<[string, string]>(['', '']); +let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([ + dayjs().startOf('hour'), + dayjs().endOf('hour'), +]); +/**时间范围 */ +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({ @@ -41,9 +60,9 @@ let queryParams = reactive({ sortField: 'timestamp', sortOrder: 'desc', /**开始时间 */ - startTime: '', + beginTime: undefined as undefined | number, /**结束时间 */ - endTime: '', + endTime: undefined as undefined | number, /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -55,12 +74,12 @@ function fnQueryReset() { queryParams = Object.assign(queryParams, { imsi: '', msisdn: '', - startTime: '', - endTime: '', + beginTime: undefined, + endTime: undefined, pageNum: 1, pageSize: 20, }); - queryRangePicker.value = ['', '']; + queryRangePicker.value = [dayjs().startOf('hour'), dayjs().endOf('hour')]; tablePagination.current = 1; tablePagination.pageSize = 20; fnGetList(); @@ -310,20 +329,30 @@ 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.startTime = queryRangePicker.value[0]; - queryParams.endTime = queryRangePicker.value[1]; + listSGWCDataCDR(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; + const { total, rows } = res.data; + tablePagination.total = total; + // tableState.data = rows; // 遍历处理cdr字符串数据 - tableState.data = res.rows.map(item => { + tableState.data = rows.map((item: any) => { let cdrJSON = item.cdrJSON; if (!cdrJSON) { Reflect.set(item, 'cdrJSON', {}); @@ -454,12 +483,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SGWC') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'SGWC') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; @@ -554,12 +583,12 @@ onBeforeUnmount(() => { > @@ -768,12 +797,18 @@ onBeforeUnmount(() => { {{ record.cdrJSON.servedMSISDN }}
- PGW Address Used: - {{ record.cdrJSON.pGWAddressUsed }} + GGSN Address: + + {{ + record.cdrJSON.pGWAddressUsed || record.cdrJSON.GGSNAddress + }} +
- SGW Address: - {{ record.cdrJSON.sGWAddress }} + SGSN Address: + + {{ record.cdrJSON.sGWAddress || record.cdrJSON.SGSNAddress }} +
RAT Type: diff --git a/src/views/dashboard/smfCDR/index.vue b/src/views/dashboard/smfCDR/index.vue index deb1731e..f1e3bf98 100644 --- a/src/views/dashboard/smfCDR/index.vue +++ b/src/views/dashboard/smfCDR/index.vue @@ -19,7 +19,7 @@ import { import { OptionsType, WS } from '@/plugins/ws-websocket'; import PQueue from 'p-queue'; import saveAs from 'file-saver'; -import dayjs, { Dayjs } from 'dayjs'; +import dayjs, { type Dayjs } from 'dayjs'; import { useClipboard } from '@vueuse/core'; const { copy } = useClipboard({ legacy: true }); const { t } = useI18n(); @@ -59,7 +59,7 @@ let queryParams = reactive({ sortField: 'timestamp', sortOrder: 'desc', /**开始时间 */ - startTime: undefined as undefined | number, + beginTime: undefined as undefined | number, /**结束时间 */ endTime: undefined as undefined | number, /**当前页数 */ @@ -362,22 +362,24 @@ function fnGetList(pageNum?: number) { Array.isArray(queryRangePicker.value) && queryRangePicker.value.length > 0 ) { - queryParams.startTime = queryRangePicker.value[0].valueOf(); + queryParams.beginTime = queryRangePicker.value[0].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf(); } else { - queryParams.startTime = undefined; + queryParams.beginTime = undefined; queryParams.endTime = undefined; } listSMFDataCDR(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; + const { total, rows } = res.data; + tablePagination.total = total; + // tableState.data = rows; // 遍历处理cdr字符串数据 - tableState.data = res.rows.map(item => { + tableState.data = rows.map((item: any) => { let cdrJSON = item.cdrJSON; if (!cdrJSON) { Reflect.set(item, 'cdrJSON', {}); @@ -508,12 +510,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SMF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'SMF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/dashboard/smfCDRByIMSI/index.vue b/src/views/dashboard/smfCDRByIMSI/index.vue index dea8bf0b..0e975023 100644 --- a/src/views/dashboard/smfCDRByIMSI/index.vue +++ b/src/views/dashboard/smfCDRByIMSI/index.vue @@ -229,7 +229,7 @@ function fnRanderChart() { // 创建 ResizeObserver 实例 监听图表容器大小变化,并在变化时调整图表大小 var observer = new ResizeObserver(entries => { - if (cdrChart) { + if (cdrChart && !cdrChart.isDisposed) { cdrChart.resize(); } }); @@ -271,7 +271,7 @@ let queryParams = reactive({ sortField: 'timestamp', sortOrder: 'desc', /**开始时间 */ - startTime: undefined as undefined | number, + beginTime: undefined as undefined | number, /**结束时间 */ endTime: undefined as undefined | number, /**当前页数 */ @@ -321,20 +321,20 @@ function fnGetList(pageNum?: number) { Array.isArray(queryRangePicker.value) && queryRangePicker.value.length > 0 ) { - queryParams.startTime = queryRangePicker.value[0].valueOf(); + queryParams.beginTime = queryRangePicker.value[0].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf(); } else { - queryParams.startTime = undefined; + queryParams.beginTime = undefined; queryParams.endTime = undefined; } listSMFDataCDR(toRaw(queryParams)) .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { state.total = res.total; // 遍历处理cdr字符串数据 state.data = res.rows - .map(item => { + .map((item: any) => { let cdrJSON = item.cdrJSON; if (!cdrJSON) { Reflect.set(item, 'cdrJSON', {}); @@ -546,12 +546,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SMF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'SMF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/dashboard/smscCDR/index.vue b/src/views/dashboard/smscCDR/index.vue index da009f54..2cf576da 100644 --- a/src/views/dashboard/smscCDR/index.vue +++ b/src/views/dashboard/smscCDR/index.vue @@ -310,14 +310,16 @@ function fnGetList(pageNum?: number) { queryParams.startTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listSMSCDataCDR(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; + const { total, rows } = res.data; + tablePagination.total = total; + // tableState.data = rows; // 遍历处理cdr字符串数据 - tableState.data = res.rows.map(item => { + tableState.data = rows.map((item:any) => { let cdrJSON = item.cdrJSON; if (!cdrJSON) { Reflect.set(item, 'cdrJSON', {}); @@ -454,12 +456,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SMSC') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v:any) => { + if (v.neType === 'SMSC') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index d2b8bd36..6456cd95 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -24,6 +24,7 @@ import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; 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'; const neInfoStore = useNeInfoStore(); const { getDict } = useDictStore(); const { t, currentLocale } = useI18n(); @@ -168,6 +169,12 @@ let tableColumns: ColumnsType = [ align: 'center', sorter: (a: any, b: any) => 1, width: 5, + customRender(opt) { + if (typeof opt.value === 'number') { + return parseDateToStr(+opt.value); + } + return opt.value; + }, }, { title: t('views.faultManage.activeAlarm.alarmCode'), @@ -734,14 +741,14 @@ function fnGetList(pageNum?: number) { filterState.sql = sql; } listAct(toRaw(queryParams), filterState.sql).then((res: any) => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (state.selectedRowKeys.length > 0) { state.selectedRowKeys = []; } - //// - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -1199,7 +1206,7 @@ onMounted(() => { :label="t('views.faultManage.activeAlarm.eventTime')" name="eventTime" > - {{ modalState.from.eventTime }} + {{ parseDateToStr(modalState.from.eventTime) }} @@ -1210,7 +1217,10 @@ onMounted(() => { :label="t('views.faultManage.activeAlarm.alarmType')" name="alarmType" > - {{ modalState.from.alarmType }} + @@ -1247,7 +1257,10 @@ onMounted(() => { :label="t('views.faultManage.activeAlarm.origLevel')" name="origSeverity" > - {{ modalState.from.origSeverity }} + diff --git a/src/views/faultManage/event/index.vue b/src/views/faultManage/event/index.vue index 5ab00d49..27395abd 100644 --- a/src/views/faultManage/event/index.vue +++ b/src/views/faultManage/event/index.vue @@ -130,12 +130,6 @@ let tableColumns: ColumnsType = [ align: 'center', width: 5, }, - { - title: t('views.faultManage.activeAlarm.neName'), - dataIndex: 'neName', - align: 'center', - width: 5, - }, { title: t('views.faultManage.activeAlarm.neType'), dataIndex: 'neType', @@ -161,12 +155,6 @@ let tableColumns: ColumnsType = [ sorter: (a: any, b: any) => 1, width: 5, }, - { - title: t('views.faultManage.activeAlarm.pvFlag'), - dataIndex: 'pvFlag', - align: 'center', - width: 5, - }, { title: t('common.operate'), key: 'alarm_id', @@ -403,14 +391,15 @@ function fnGetList(pageNum?: number) { queryParams.endTime = queryRangePicker.value[1]; listAct(toRaw(queryParams)).then((res: any) => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (state.selectedRowKeys.length > 0) { state.selectedRowKeys = []; } //// - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -735,14 +724,6 @@ onMounted(() => { {{ modalState.from.neId }} - - - {{ modalState.from.neName }} - - @@ -791,25 +772,6 @@ onMounted(() => { {{ modalState.from.locationInfo }} - - - - {{ modalState.from.province }} - - - - - {{ modalState.from.alarmType }} - - - - { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (state.selectedRowKeys.length > 0) { state.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/logManage/alarm/index.vue b/src/views/logManage/alarm/index.vue index 50079f63..5212d58a 100644 --- a/src/views/logManage/alarm/index.vue +++ b/src/views/logManage/alarm/index.vue @@ -179,9 +179,10 @@ function fnGetList(pageNum?: number) { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listAlarm(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + 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); diff --git a/src/views/logManage/exportFile/index.vue b/src/views/logManage/exportFile/index.vue index b43cafee..b39391db 100644 --- a/src/views/logManage/exportFile/index.vue +++ b/src/views/logManage/exportFile/index.vue @@ -238,9 +238,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } getBakFileList(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - tablePagination.total = res.total; - tableState.data = res.data; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -260,7 +261,7 @@ function fnGetList(pageNum?: number) { onMounted(() => { getBakFile().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { res.data.forEach((item: any) => { fileList.value.push({ value: item.tableName, diff --git a/src/views/logManage/forwarding/index.vue b/src/views/logManage/forwarding/index.vue index a0c04193..27737f56 100644 --- a/src/views/logManage/forwarding/index.vue +++ b/src/views/logManage/forwarding/index.vue @@ -82,19 +82,19 @@ let tableColumns: ColumnsType = [ }, { title: t('views.logManage.forwarding.alarmInter'), - dataIndex: 'interface', + dataIndex: 'type', align: 'center', width: 5, }, { title: t('views.logManage.forwarding.alarmObj'), - dataIndex: 'toUser', + dataIndex: 'target', align: 'center', width: 5, }, { title: t('views.logManage.forwarding.alarmInfo'), - dataIndex: 'operResult', + dataIndex: 'result', align: 'center', width: 6, }, @@ -140,7 +140,7 @@ let tableColumns: ColumnsType = [ }, { title: t('views.logManage.forwarding.logTime'), - dataIndex: 'logTime', + dataIndex: 'createdAt', align: 'center', customRender(opt) { if (!opt.value) return ''; @@ -196,9 +196,10 @@ function fnGetList(pageNum?: number) { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listForwarding(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + 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); diff --git a/src/views/logManage/mml/index.vue b/src/views/logManage/mml/index.vue index 89341948..5931820d 100644 --- a/src/views/logManage/mml/index.vue +++ b/src/views/logManage/mml/index.vue @@ -158,9 +158,10 @@ function fnGetList(pageNum?: number) { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listMML(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/logManage/neFile/index.vue b/src/views/logManage/neFile/index.vue index a65223d5..3f62684b 100644 --- a/src/views/logManage/neFile/index.vue +++ b/src/views/logManage/neFile/index.vue @@ -238,9 +238,10 @@ function fnGetList(pageNum?: number) { } queryParams.path = nePathArr.value.join('/'); listNeFiles(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -280,7 +281,7 @@ function fnDrawerOpen(row: Record) { onMounted(() => { // 获取网元网元列表 neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length === 0) { message.warning({ content: t('common.noData'), diff --git a/src/views/mmlManage/neOperate/index.vue b/src/views/mmlManage/neOperate/index.vue index eb179489..b09077b2 100644 --- a/src/views/mmlManage/neOperate/index.vue +++ b/src/views/mmlManage/neOperate/index.vue @@ -354,7 +354,7 @@ function fnGetList() { const neType = state.neType[0]; state.mmlNeType = neType; getMMLByNE(neType).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 构建自动完成筛选结构 const autoCompleteArr: Record[] = []; // 构建树结构 @@ -539,7 +539,7 @@ function fnAutoCompleteKeydown(evt: any) { onMounted(() => { // 获取网元网元列表 neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 过滤不可用的网元 neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( diff --git a/src/views/mmlManage/omcOperate/index.vue b/src/views/mmlManage/omcOperate/index.vue index c6f99365..7f094110 100644 --- a/src/views/mmlManage/omcOperate/index.vue +++ b/src/views/mmlManage/omcOperate/index.vue @@ -342,7 +342,7 @@ function ruleVerification( /**查询可选命令列表 */ function fnGetList() { getMMLByOMC().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 构建自动完成筛选结构 const autoCompleteArr: Record[] = []; // 构建树结构 @@ -508,7 +508,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 获取可用OMC const omcArr = useNeInfoStore().getNeSelectOtions.find( diff --git a/src/views/mmlManage/udmOperate/index.vue b/src/views/mmlManage/udmOperate/index.vue index 72a1c856..25645ed1 100644 --- a/src/views/mmlManage/udmOperate/index.vue +++ b/src/views/mmlManage/udmOperate/index.vue @@ -342,7 +342,7 @@ function ruleVerification( /**查询可选命令列表 */ function fnGetList() { getMMLByUDM().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 构建自动完成筛选结构 const autoCompleteArr: Record[] = []; // 构建树结构 @@ -508,7 +508,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 获取可用UDM const udmArr = useNeInfoStore().getNeSelectOtions.find( diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 0f13439c..da729e0f 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -550,8 +550,9 @@ function fnGetList(pageNum?: number) { if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue index 30089bc6..ac1edf9a 100644 --- a/src/views/monitor/job/log.vue +++ b/src/views/monitor/job/log.vue @@ -372,8 +372,9 @@ function fnGetList(pageNum?: number) { if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue index 71715741..da47edba 100644 --- a/src/views/monitor/monitor/index.vue +++ b/src/views/monitor/monitor/index.vue @@ -64,22 +64,22 @@ let rangePicker = reactive({ /**查询全部资源数据列表 */ function fnGetList() { - let startTime = null; + let beginTime = null; let endTime = null; const dateNumber = rangePicker.all; if (dateNumber[0]) { - startTime = dateNumber[0]; + beginTime = dateNumber[0]; endTime = dateNumber[1]; } else { const now = new Date(); now.setHours(0, 0, 0, 0); - startTime = `${now.getTime()}`; + beginTime = `${now.getTime()}`; endTime = `${new Date().getTime()}`; } getLoad({ type: 'all', - startTime: startTime, + beginTime: beginTime, endTime: endTime, neType: '#', neId: '#', @@ -94,7 +94,7 @@ function fnGetList() { }); // 设置初始时间段 - const initRangePicker: [string, string] = [startTime, endTime]; + const initRangePicker: [string, string] = [beginTime, endTime]; rangePicker.all = initRangePicker; rangePicker.load = initRangePicker; rangePicker.cpu = initRangePicker; @@ -357,11 +357,11 @@ function fnGetQuery( if (!dateString[0]) { return; } - const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); + const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); getLoad({ type: type, - startTime: startTime.getTime(), + beginTime: beginTime.getTime(), endTime: endTime.getTime(), neType: '#', neId: '#', @@ -385,11 +385,11 @@ function fnGetQueryIO(v: any, dateString: [string, string]) { if (!v) { return; } - const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); + const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); getLoad({ type: 'io', - startTime: startTime.getTime(), + beginTime: beginTime.getTime(), endTime: endTime.getTime(), neType: '#', neId: '#', @@ -405,11 +405,11 @@ function fnGetQueryNetwork(v: any, dateString: [string, string]) { if (!v) { return; } - const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); + const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); getLoad({ type: 'network', - startTime: startTime.getTime(), + beginTime: beginTime.getTime(), endTime: endTime.getTime(), neType: '#', neId: '#', diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue index 19f34301..73df7c3f 100644 --- a/src/views/monitor/online/index.vue +++ b/src/views/monitor/online/index.vue @@ -14,7 +14,7 @@ const { t } = useI18n(); /**查询参数 */ let queryParams = reactive({ /**登录主机 */ - ipaddr: '', + loginIp: '', /**登录账号 */ userName: '', }); @@ -63,7 +63,7 @@ let tableColumns: ColumnsType = [ }, { title: t('views.monitor.online.host'), - dataIndex: 'ipaddr', + dataIndex: 'loginIp', align: 'left', }, // { @@ -129,7 +129,7 @@ function fnTableSize({ key }: MenuInfo) { /**查询参数重置 */ function fnQueryReset() { - queryParams.ipaddr = ''; + queryParams.loginIp = ''; queryParams.userName = ''; tablePagination.current = 1; tablePagination.pageSize = 20; @@ -141,8 +141,10 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listOnline(queryParams).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; } tableState.loading = false; }); @@ -209,7 +211,7 @@ onMounted(() => { diff --git a/src/views/monitor/topologyBuild/index.vue b/src/views/monitor/topologyBuild/index.vue index f94a617e..b4046211 100644 --- a/src/views/monitor/topologyBuild/index.vue +++ b/src/views/monitor/topologyBuild/index.vue @@ -51,7 +51,7 @@ function fnGraphGroupChange(value: any) { function fnGraphDataGroups(reload: boolean = false) { getGraphGroups() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { graphState.groupOptions = res.data.map(str => { return { label: str, value: str }; }); diff --git a/src/views/ne-data/base-station/components/history.vue b/src/views/ne-data/base-station/components/history.vue index 42211893..4d8b453f 100644 --- a/src/views/ne-data/base-station/components/history.vue +++ b/src/views/ne-data/base-station/components/history.vue @@ -245,14 +245,15 @@ function fnGetList(pageNum?: number) { } listNBState(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/ne-data/base-station/list.vue b/src/views/ne-data/base-station/list.vue index 44b9c955..2fa1e01c 100644 --- a/src/views/ne-data/base-station/list.vue +++ b/src/views/ne-data/base-station/list.vue @@ -277,7 +277,7 @@ function fnGetList() { return; } req.then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; @@ -656,7 +656,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; useNeInfoStore().neCascaderOptions.forEach(item => { diff --git a/src/views/ne/neConfig/index.vue b/src/views/ne/neConfig/index.vue index 5ab607b0..7afd6fe6 100644 --- a/src/views/ne/neConfig/index.vue +++ b/src/views/ne/neConfig/index.vue @@ -66,7 +66,7 @@ async function fnSelectNeType(_: any, info: any) { neId: v.neId, paramName: `${treeState.data[0].key}`, }); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { ne.disabled = !res.data.length; } else { ne.disabled = true; @@ -227,7 +227,7 @@ async function fnGetNeConfig(neType: string) { treeState.loading = true; // 获取数据 const res = await getAllNeConfig(neType); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { const arr = []; for (const v of res.data) { const item = JSON.parse(JSON.stringify(v)); @@ -304,7 +304,7 @@ function fnGetNeConfigData( // 获取网元端的配置数据 getNeConfigData({ neType, neId, paramName }).then(res => { // 数据处理 - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { const ruleArr: Record[] = JSON.parse( JSON.stringify(param.paramData) ); @@ -478,12 +478,12 @@ watch( val => { // SMF需要选择配置的UPF id if (val && neTypeSelect.value[0] === 'SMF') { - if (neTypeSelect.value[1].startsWith('SYNC')) { - smfByUPFIdLoadData(neTypeSelect.value[1]); - return; - } else { - smfByUPFIdLoadData(neTypeSelect.value[1]); + let neId = neTypeSelect.value[1]; + // 无neId时取首个可连接的 + if (neId.startsWith('SYNC')) { + neId = neIdSelect.value[0]; } + smfByUPFIdLoadData(neId); } } ); @@ -537,7 +537,7 @@ const { onMounted(() => { // 获取网元网元列表 neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 过滤不可用的网元 neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter( diff --git a/src/views/ne/neConfigBackup/index.vue b/src/views/ne/neConfigBackup/index.vue index e45e50c0..66cd6865 100644 --- a/src/views/ne/neConfigBackup/index.vue +++ b/src/views/ne/neConfigBackup/index.vue @@ -179,9 +179,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeConfigBackup(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -372,7 +373,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { neOtions.value = useNeInfoStore().getNeSelectOtions; } else { message.warning({ diff --git a/src/views/ne/neHost/index.vue b/src/views/ne/neHost/index.vue index 98fbff28..e67f7722 100644 --- a/src/views/ne/neHost/index.vue +++ b/src/views/ne/neHost/index.vue @@ -188,9 +188,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeHost(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/ne/neHostCommand/index.vue b/src/views/ne/neHostCommand/index.vue index 954f0124..4b655a09 100644 --- a/src/views/ne/neHostCommand/index.vue +++ b/src/views/ne/neHostCommand/index.vue @@ -161,9 +161,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeHostCmd(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/ne/neInfo/components/BackConfModal.vue b/src/views/ne/neInfo/components/BackConfModal.vue index 367e76d9..5199a00e 100644 --- a/src/views/ne/neInfo/components/BackConfModal.vue +++ b/src/views/ne/neInfo/components/BackConfModal.vue @@ -50,9 +50,9 @@ function backupSearch(name?: string) { pageNum: 1, pageSize: 20, }).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { importState.backupData = []; - res.rows.forEach((item: any) => { + res.data.rows.forEach((item: any) => { importState.backupData.push({ label: item.name, value: item.path, diff --git a/src/views/ne/neInfo/index.vue b/src/views/ne/neInfo/index.vue index c24e2aa0..30bb0d41 100644 --- a/src/views/ne/neInfo/index.vue +++ b/src/views/ne/neInfo/index.vue @@ -364,14 +364,15 @@ function fnGetList(pageNum?: number) { } listNeInfo(toRaw(queryParams)) .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; + const { total, rows } = res.data; + tablePagination.total = total; // 遍历处理资源情况数值 - tableState.data = res.rows.map(item => { + tableState.data = rows.map((item:any) => { let resouresUsage = { sysDiskUsage: 0, sysMemUsage: 0, diff --git a/src/views/ne/neLicense/index.vue b/src/views/ne/neLicense/index.vue index 42d32688..068341bf 100644 --- a/src/views/ne/neLicense/index.vue +++ b/src/views/ne/neLicense/index.vue @@ -186,9 +186,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeLicense(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows.filter(s => s.neType !== 'OMC'); + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows.filter((s:any) => s.neType !== 'OMC'); if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -328,7 +329,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { neOtions.value = useNeInfoStore().getNeSelectOtions; } else { message.warning({ diff --git a/src/views/ne/neQuickSetup/components/NeInfoSoftwareInstall.vue b/src/views/ne/neQuickSetup/components/NeInfoSoftwareInstall.vue index 52cd89a8..d1890f6c 100644 --- a/src/views/ne/neQuickSetup/components/NeInfoSoftwareInstall.vue +++ b/src/views/ne/neQuickSetup/components/NeInfoSoftwareInstall.vue @@ -132,14 +132,14 @@ function fnGetList(pageNum?: number) { tableState.queryParams.pageNum = pageNum; } listNeSoftware(toRaw(tableState.queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - // 遍历处理资源情况数值 - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; } tableState.loading = false; }); diff --git a/src/views/ne/neSoftware/index.vue b/src/views/ne/neSoftware/index.vue index f919222e..bfefb2d3 100644 --- a/src/views/ne/neSoftware/index.vue +++ b/src/views/ne/neSoftware/index.vue @@ -191,9 +191,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeSoftware(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -342,7 +343,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { neOtions.value = useNeInfoStore().getNeSelectOtions; } else { message.warning({ diff --git a/src/views/ne/neVersion/index.vue b/src/views/ne/neVersion/index.vue index abe7fe3f..f8883469 100644 --- a/src/views/ne/neVersion/index.vue +++ b/src/views/ne/neVersion/index.vue @@ -214,13 +214,14 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeVersion(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -442,7 +443,7 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { neOtions.value = useNeInfoStore().getNeSelectOtions; } else { message.warning({ diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index f2524022..a1cea9db 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -563,13 +563,14 @@ function fnGetList(pageNum?: number) { tablePagination.current = pageNum; } listUDMAuth(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -721,12 +722,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'UDM') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'UDM') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/neUser/base5G/index.vue b/src/views/neUser/base5G/index.vue index 857a91cb..9843b1f5 100644 --- a/src/views/neUser/base5G/index.vue +++ b/src/views/neUser/base5G/index.vue @@ -4,11 +4,12 @@ import { PageContainer } from 'antdv-pro-layout'; import { TableColumnsType, message } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; -import { listBase5G } from '@/api/neUser/base5G'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import useNeInfoStore from '@/store/modules/neinfo'; import { useRoute } from 'vue-router'; +import { listAMFNblist } from '@/api/neData/amf'; +import { listMMENblist } from '@/api/neData/mme'; const neInfoStore = useNeInfoStore(); const route = useRoute(); const { t } = useI18n(); @@ -152,24 +153,34 @@ function fnGetList(pageNum?: number) { promises.value = []; //同时获取45G基站信息 且在每条信息中添加45G字段(原始数据没有) 已经筛选后的 neCascaderOptions.value.map((item: any) => { - item.children.forEach((child: any) => { - promises.value.push( - listBase5G({ - neId: child.neId, - neType: child.neType, - nbId: queryParams.id, - pageNum: queryParams.pageNum, - pageSize: 10000, - }).then(res => { - // 添加 neName 字段到每一项数据 - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - res.rows.forEach(row => { - row.neName = `${child.neType}_${child.neId}`; - }); - } - return res; - }) - ); + item.children.forEach((child: any) => { + let resq = null; + let s = { + neId: child.neId, + neType: child.neType, + nbId: queryParams.id, + pageNum: queryParams.pageNum, + pageSize: 10000, + }; + if (child.neType === '5G' || child.neType === 'AMF') { + resq = listAMFNblist(s); + } + if (child.neType === '4G' || child.neType === 'MME') { + resq = listMMENblist(s); + } + if (resq !== null) { + promises.value.push( + resq.then(res => { + // 添加 neName 字段到每一项数据 + if (res.code === RESULT_CODE_SUCCESS) { + res.data.forEach((row: any) => { + row.neName = `${child.neType}_${child.neId}`; + }); + } + return res; + }) + ); + } }); }); @@ -212,16 +223,25 @@ function fnGetList(pageNum?: number) { pageNum: queryParams.pageNum, pageSize: queryParams.pageSize, }; - listBase5G(toRaw(toBack)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + let resq = null; + if (queryParams.neType[0] === '5G' || queryParams.neType[0] === 'AMF') { + resq = listAMFNblist(toRaw(toBack)); + } + if (queryParams.neType[0] === '4G' || queryParams.neType[0] === 'MME') { + resq = listMMENblist(toRaw(toBack)); + } + if (resq === null) return; + resq.then(res => { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; - res.rows.forEach((item: any) => { + tablePagination.total = res.data.length; + tableState.data = res.data; + + res.data.forEach((item: any) => { item.neName = queryParams.neType.join('_'); }); @@ -247,7 +267,7 @@ onMounted(() => { neInfoStore .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 过滤不可用的网元 for (const item of neInfoStore.getNeCascaderOptions) { diff --git a/src/views/neUser/ims/index.vue b/src/views/neUser/ims/index.vue index 72643c0d..1a13dcef 100644 --- a/src/views/neUser/ims/index.vue +++ b/src/views/neUser/ims/index.vue @@ -9,6 +9,7 @@ import { listUEInfoByIMS } from '@/api/neUser/ims'; import useNeInfoStore from '@/store/modules/neinfo'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import { listIMSSessionList } from '@/api/neData/ims'; const { t } = useI18n(); /**网元参数 */ @@ -146,14 +147,14 @@ function fnGetList(pageNum?: number) { if (pageNum) { queryParams.pageNum = pageNum; } - listUEInfoByIMS(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + listIMSSessionList(toRaw(queryParams)).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + tablePagination.total = res.data.length; + tableState.data = res.data; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -175,12 +176,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'IMS') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'IMS') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/neUser/n3iwf/index.vue b/src/views/neUser/n3iwf/index.vue index f6e967b4..513bf7e9 100644 --- a/src/views/neUser/n3iwf/index.vue +++ b/src/views/neUser/n3iwf/index.vue @@ -92,8 +92,9 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listN3iwf(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tableState.data = rows; } else { tableState.data = []; } @@ -106,12 +107,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'N3IWF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'N3IWF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; @@ -246,5 +247,4 @@ onMounted(() => { - + diff --git a/src/views/neUser/nssf/index.vue b/src/views/neUser/nssf/index.vue index f2922252..f1a738af 100644 --- a/src/views/neUser/nssf/index.vue +++ b/src/views/neUser/nssf/index.vue @@ -69,12 +69,13 @@ function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; listNSSF().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tableState.data = res.rows; + const { total, rows } = res.data; + tableState.data = rows; } else { tableState.data = []; } diff --git a/src/views/neUser/nssfAmf/index.vue b/src/views/neUser/nssfAmf/index.vue index 9a32d73d..a8152998 100644 --- a/src/views/neUser/nssfAmf/index.vue +++ b/src/views/neUser/nssfAmf/index.vue @@ -58,12 +58,13 @@ function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; listNSSFAMF().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tableState.data = res.rows; + const { total, rows } = res.data; + tableState.data = rows; } else { tableState.data = []; } diff --git a/src/views/neUser/pcf/index.vue b/src/views/neUser/pcf/index.vue index 94771746..ff882e37 100644 --- a/src/views/neUser/pcf/index.vue +++ b/src/views/neUser/pcf/index.vue @@ -549,12 +549,14 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listRules(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; } else { tableState.data = []; } @@ -640,12 +642,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'PCF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'PCF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/neUser/sub/index.vue b/src/views/neUser/sub/index.vue index 69fc2855..f944fd96 100644 --- a/src/views/neUser/sub/index.vue +++ b/src/views/neUser/sub/index.vue @@ -942,14 +942,15 @@ function fnGetList(pageNum?: number) { tablePagination.current = pageNum; } listUDMSub(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -1115,12 +1116,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'UDM') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'UDM') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/neUser/ue/index.vue b/src/views/neUser/ue/index.vue index 61918cfe..00e81220 100644 --- a/src/views/neUser/ue/index.vue +++ b/src/views/neUser/ue/index.vue @@ -225,9 +225,10 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listSMFSubList(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -249,12 +250,12 @@ onMounted(() => { useNeInfoStore() .fnNelist() .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SMF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'SMF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; diff --git a/src/views/perfManage/customTarget/index.vue b/src/views/perfManage/customTarget/index.vue index 655b7490..84652f85 100644 --- a/src/views/perfManage/customTarget/index.vue +++ b/src/views/perfManage/customTarget/index.vue @@ -106,6 +106,12 @@ let tableColumns: ColumnsType = [ key: 'status', align: 'left', width: 100, + customRender: ({ text }) => { + if (text === '1') { + return 'Active'; + } + return 'Inactive'; + }, }, { title: t('common.operate'), @@ -190,13 +196,14 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listCustom(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.data; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= @@ -247,7 +254,7 @@ let modalState: ModalStateType = reactive({ neType: 'UDM', title: '', expression: '', - status: 'Active', + status: '1', unit: '', description: '', }, @@ -316,7 +323,7 @@ function fnSelectPerformanceInit(value: any) { if (language === 'zh') language = 'cn'; // 获取表头文字 getKPITitle(value).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { for (const item of res.data) { const kpiDisplay = item[`${language}Title`]; const kpiValue = item[`kpiId`]; @@ -622,12 +629,12 @@ onMounted(() => { :options="[ { label: t('views.perfManage.customTarget.active'), - value: 'Active', + value: '1', tagType: 'success', }, { label: t('views.perfManage.customTarget.inactive'), - value: 'Inactive', + value: '0', tagType: 'error', }, ]" @@ -685,11 +692,11 @@ onMounted(() => { :options="[ { label: t('views.perfManage.customTarget.active'), - value: 'Active', + value: '1', }, { label: t('views.perfManage.customTarget.inactive'), - value: 'Inactive', + value: '0', }, ]" :placeholder="t('common.selectPlease')" diff --git a/src/views/perfManage/goldTarget/index.vue b/src/views/perfManage/goldTarget/index.vue index f56dfd12..f84175c5 100644 --- a/src/views/perfManage/goldTarget/index.vue +++ b/src/views/perfManage/goldTarget/index.vue @@ -25,6 +25,7 @@ import { h, watch, } from 'vue'; +import dayjs, { Dayjs } from 'dayjs'; import { PageContainer } from 'antdv-pro-layout'; import { message, Modal, TableColumnType } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; @@ -61,14 +62,6 @@ echarts.use([ UniversalTransition, ]); -type EChartsOption = echarts.ComposeOption< - | TooltipComponentOption - | GridComponentOption - | LegendComponentOption - | DataZoomComponentOption - | LineSeriesOption ->; - /**图DOM节点实例对象 */ const kpiChartDom = ref(undefined); @@ -78,8 +71,26 @@ const kpiChart = ref(null); /**网元参数 */ let neCascaderOptions = ref[]>([]); -/**记录开始结束时间 */ -let queryRangePicker = ref<[string, string]>(['', '']); +/**开始结束时间 */ +let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([ + dayjs().startOf('hour'), + dayjs().endOf('hour'), +]); +/**时间范围 */ +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 tableColumns = ref([]); @@ -150,9 +161,9 @@ let queryParams: any = reactive({ /**颗粒度 */ interval: 900, /**开始时间 */ - startTime: '', + beginTime: undefined as undefined | number, /**结束时间 */ - endTime: '', + endTime: undefined as undefined | number, /**排序字段 */ sortField: 'timeGroup', /**排序方式 */ @@ -314,7 +325,7 @@ function fnGetListTitle() { getKPITitle(state.neType[0]) .then(res => { //处理getKPITitle返回的结果 - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { //检查值 tableColumns.value = []; //设为空数组 const columns: any[] = []; //初始化,构建新表头 @@ -374,12 +385,23 @@ function fnGetList() { tableState.loading = true; queryParams.neType = state.neType[0]; queryParams.neId = state.neType[1]; - queryParams.startTime = queryRangePicker.value[0]; - queryParams.endTime = queryRangePicker.value[1]; + + // 时间范围 + 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; + } + listKPIData(toRaw(queryParams)) .then(res => { tableState.loading = false; - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { tablePagination.total = res.data.length; tableState.data = res.data; @@ -804,7 +826,7 @@ onMounted(() => { // 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF // 获取网元网元列表 neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 过滤不可用的网元 neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( @@ -836,17 +858,6 @@ onMounted(() => { queryParams.neId = info.neId; } - // 查询当前小时 - const now = new Date(); - now.setMinutes(0, 0, 0); - // 设置起始时间为整点前一小时 - const startTime = new Date(now); - startTime.setHours(now.getHours() - 1); - queryRangePicker.value[0] = `${startTime.getTime()}`; - // 设置结束时间为整点 - const endTime = new Date(now); - endTime.setMinutes(59, 59, 59); - queryRangePicker.value[1] = `${endTime.getTime()}`; fnGetListTitle(); // 绘图 fnRanderChart(); @@ -892,12 +903,12 @@ onBeforeUnmount(() => { > diff --git a/src/views/perfManage/kpiCReport/index.vue b/src/views/perfManage/kpiCReport/index.vue index 7a321384..820fd15a 100644 --- a/src/views/perfManage/kpiCReport/index.vue +++ b/src/views/perfManage/kpiCReport/index.vue @@ -329,10 +329,10 @@ function fnGetListTitle() { if (!state.neType[0]) return false; // 获取表头文字 - listCustom({ neType: state.neType[0], status: 'Active' }) + listCustom({ neType: state.neType[0], status: '1' }) .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - if (res.data.length === 0) { + if (res.code === RESULT_CODE_SUCCESS) { + if (res.data.rows.length === 0) { message.error({ content: t('views.perfManage.customTarget.kpiIdTip'), duration: 2, @@ -346,7 +346,7 @@ function fnGetListTitle() { } tableColumns.value = []; const columns: any[] = []; - for (const item of res.data) { + for (const item of res.data.rows) { const kpiDisplay = item[`unit`] ? item[`title`] + `(${item['unit']})` : item[`title`]; @@ -407,7 +407,7 @@ function fnGetList() { listCustomData(toRaw(queryParams)) .then(res => { tableState.loading = false; - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { tablePagination.total = res.data.length; tableState.data = res.data; if (!res.data.length) { @@ -834,9 +834,9 @@ watch( onMounted(() => { // 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF // 获取网元网元列表 - listCustom({ status: 'Active' }).then((res: any) => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - if (!res.data.length) { + listCustom({ status: '1' }).then((res: any) => { + if (res.code === RESULT_CODE_SUCCESS) { + if (!res.data.rows.length) { message.warning({ content: '无可用的自定义指标,请先添加自定义指标', duration: 2, @@ -844,12 +844,12 @@ onMounted(() => { return false; } let typeArr: any = []; - res.data.forEach((item: any) => { + res.data.rows.forEach((item: any) => { typeArr.push(item.neType); }); typeArr = Array.from(new Set(typeArr)); - neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + neInfoStore.fnNelist().then(res => { + if (res.code === RESULT_CODE_SUCCESS) { if (res.data.length > 0) { // 过滤不可用的网元 neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( diff --git a/src/views/perfManage/kpiKeyTarget/index.vue b/src/views/perfManage/kpiKeyTarget/index.vue index 2b3931e2..fe50af51 100644 --- a/src/views/perfManage/kpiKeyTarget/index.vue +++ b/src/views/perfManage/kpiKeyTarget/index.vue @@ -301,14 +301,9 @@ const chartStates: Record< > = Object.fromEntries( networkElementTypes.value.map(type => [type, createChartState(type)]) ) as Record>; - -//期择器 -interface RangePicker extends Record { - placeholder: [string, string]; -} - + // 日期选择器状态 -const rangePicker = reactive({ +const rangePicker = reactive({ ...(Object.fromEntries( networkElementTypes.value.map(type => [ type, @@ -533,18 +528,18 @@ const fetchData = async (type: AllChartType) => { try { const dateRange = rangePicker[type] as [string, string]; - const [startTime, endTime] = dateRange; + const [beginTime, endTime] = dateRange; const res = await listKPIData({ neType: type.toUpperCase(), neId: '001', - startTime, + beginTime, endTime, sortField: 'timeGroup', sortOrder: 'desc', interval: 60 * 15, }); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { state.tableState.data = res.data; await renderChart(type); } @@ -810,7 +805,7 @@ const fetchKPITitle = async (type: AllChartType) => { : currentLocale.value.split('_')[0]; try { const res = await getKPITitle(type.toUpperCase()); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { // 保存现有的颜色映 const existingColors = new Map(chartStates[type].seriesColors); @@ -827,7 +822,7 @@ const fetchKPITitle = async (type: AllChartType) => { return dayjs(Number(text)).format('YYYY-MM-DD HH:mm:ss'); }, }, - ...res.data.map(item => { + ...res.data.map((item:any) => { const kpiId = item.kpiId; // 如果没有现有的颜色,生成新的颜色 if (!existingColors.has(kpiId)) { diff --git a/src/views/perfManage/kpiOverView/index.vue b/src/views/perfManage/kpiOverView/index.vue index 28f3b692..5c43a449 100644 --- a/src/views/perfManage/kpiOverView/index.vue +++ b/src/views/perfManage/kpiOverView/index.vue @@ -83,9 +83,9 @@ const ranges = ref([ }, ]); //日期范围响应式变量 -const dateRange = ref<[string, string]>([ - dayjs().subtract(1, 'hour').startOf('hour').valueOf().toString(), // 上一小时开始 - dayjs().startOf('hour').add(1, 'hour').valueOf().toString(), // 当前小时结束 +const dateRange = ref<[Dayjs, Dayjs] | undefined>([ + dayjs().subtract(1, 'hour').startOf('hour'), // 上一小时开始 + dayjs().startOf('hour').add(1, 'hour'), // 当前小时结束 ]); //实时数据状态 const isRealtime = ref(false); @@ -108,10 +108,7 @@ const handleDateChange = ( return; } - dateRange.value = [ - dayjs(dateStrings[0]).valueOf().toString(), - dayjs(dateStrings[1]).valueOf().toString(), - ]; + dateRange.value = [dayjs(dateStrings[0]), dayjs(dateStrings[1])]; fetchChartData(); }; @@ -226,8 +223,14 @@ const fetchChartData = async () => { tableLoading.value = true; rangeLoading.value = true; try { - const [startTime, endTime] = dateRange.value; - if (!startTime || !endTime) { + let beginTime = 0; + let endTime = 0; + // 时间范围 + if (Array.isArray(dateRange.value) && dateRange.value.length > 0) { + beginTime = dateRange.value[0].valueOf(); + endTime = dateRange.value[1].valueOf(); + } + if (beginTime == 0 || endTime == 0) { console.warn('Invalid date range:', dateRange.value); return; } @@ -237,8 +240,8 @@ const fetchChartData = async () => { const params = { neType, neId: '001', - startTime: String(startTime), - endTime: String(endTime), + beginTime: beginTime, + endTime: endTime, sortField: 'timeGroup', sortOrder: 'asc', interval: 60 * 15, @@ -247,7 +250,7 @@ const fetchChartData = async () => { try { const res = await listKPIData(params); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { return res.data; } return []; @@ -651,8 +654,8 @@ const fetchSpecificKPI = async () => { for (const neType of ALL_NE_TYPES) { const res = await getKPITitle(neType.toUpperCase()); - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - const formattedKPIs = res.data.map(item => ({ + if (res.code === RESULT_CODE_SUCCESS) { + const formattedKPIs = res.data.map((item: any) => ({ title: item[`${language}Title`], dataIndex: item.kpiId, key: item.kpiId, diff --git a/src/views/perfManage/perfData/index.vue b/src/views/perfManage/perfData/index.vue index 9d3ce85a..e46eb883 100644 --- a/src/views/perfManage/perfData/index.vue +++ b/src/views/perfManage/perfData/index.vue @@ -190,9 +190,10 @@ function fnGetList(pageNum?: number) { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listperfData(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { - tablePagination.total = res.total; - tableState.data = res.rows; + if (res.code === RESULT_CODE_SUCCESS) { + 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); diff --git a/src/views/perfManage/perfThreshold/index.vue b/src/views/perfManage/perfThreshold/index.vue index 30d13694..99c4ad7e 100644 --- a/src/views/perfManage/perfThreshold/index.vue +++ b/src/views/perfManage/perfThreshold/index.vue @@ -189,13 +189,14 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listPerfThreshold(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/perfManage/taskManage/index.vue b/src/views/perfManage/taskManage/index.vue index 9cebecc4..70b07665 100644 --- a/src/views/perfManage/taskManage/index.vue +++ b/src/views/perfManage/taskManage/index.vue @@ -222,13 +222,14 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listPerfTask(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 96f3159b..d2eba896 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -445,13 +445,14 @@ function fnGetList(pageNum?: number) { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listConfig(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.total; - tableState.data = res.rows; + const { total, rows } = res.data; + tablePagination.total = total; + tableState.data = rows; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index b51faeb4..762e3ecd 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -36,20 +36,20 @@ let queryParams = reactive({ /**部门名称 */ deptName: '', /**部门状态 */ - status: undefined, + statusFlag: undefined, }); /**查询参数重置 */ function fnQueryReset() { queryParams = Object.assign(queryParams, { deptName: '', - status: undefined, + statusFlag: undefined, }); fnGetList(); } /**表格全展开行key */ -let expandedRowKeys: string[] = []; +let expandedRowKeys: number[] = []; /**表格状态类型 */ type TabeStateType = { @@ -93,15 +93,15 @@ let tableColumns: ColumnsType = [ }, { title: t('views.system.dept.classSort'), - dataIndex: 'orderNum', + dataIndex: 'deptSort', align: 'left', width: 200, }, { title: t('views.system.dept.status'), - dataIndex: 'status', - key: 'status', - align: 'center', + dataIndex: 'statusFlag', + key: 'statusFlag', + align: 'left', width: 150, }, { @@ -165,12 +165,12 @@ let modalState: ModalStateType = reactive({ deptName: '', email: '', leader: '', - orderNum: 0, + deptSort: 0, parentId: '100', ancestors: '', parentName: null, phone: '', - status: '0', + statusFlag: '0', }, confirmLoading: false, treeData: [], @@ -386,14 +386,15 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listDept(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { const treeData = parseDataToTree(res.data, 'deptId'); // 初始上级部门和展开编号key if (treeDataAll.length <= 0) { // 转换树状数据 treeDataAll = treeData; // 展开编号key - expandedRowKeys = [...new Set(res.data.map(item => item.parentId))]; + const parentIds: number[] = res.data.map((item: any) => item.parentId); + expandedRowKeys = [...new Set(parentIds)]; fnTableExpandedRowsAll(tableState.expandedRowAll); } tableState.data = treeData; @@ -436,9 +437,12 @@ onMounted(() => { - + @@ -547,8 +551,11 @@ onMounted(() => { @expandedRowsChange="fnTableExpandedRowsChange" >