diff --git a/src/api/cbc/cbe.ts b/src/api/cbc/cbe.ts index 7fb82137..a7da9b29 100644 --- a/src/api/cbc/cbe.ts +++ b/src/api/cbc/cbe.ts @@ -9,7 +9,7 @@ import { request } from '@/plugins/http-fetch'; */ export function listCBC(query: Record) { return request({ - url: `/psap/v1/cbc/001/message/list`, + url: `/psap/v1/cbc/${query.neId}/message/list`, method: 'get', params: query, timeout: 30_000, diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index c5027753..63f86e09 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -370,6 +370,36 @@ export default { agentName: 'Agent Name', } }, + cbc:{ + cbe:{ + title: ' CBC Event', + delTip: 'Confirm deletion of the event data item numbered [{num}]?', + eventName: 'Event Name', + startTime: 'Start Time', + endTime: 'End Time', + repetitionPeriod: 'Repetition Period', + numOfBcast: 'Number of Broadcasts', + msgPWSType: 'Message Type', + messageId: 'Message ID', + displayMode: 'Display Mode', + geoScope:' Geographic Scope', + emergencyUserAlert: 'Emergency User Alert', + activatePopup: 'Activate Popup', + warningType: 'Warning Type', + language:' Language', + warningMessageText:' Broadcast Content', + status: 'Status', + warningAreaType: 'Warning Area Type', + taiListTip:'TAI List cannot be empty', + taiSonTip:'TAI List each item MCC, MNC, TAC cannot be empty', + eutraListTip:'EUTRA CellId List cannot be empty', + eutraSonTip:'EUTRA CellId List each item MCC, MNC, CellId cannot be empty', + nrTip:'NR CellId List cannot be empty', + nrSonTip:'NR CellId List each item MCC, MNC, CellId cannot be empty', + areaTip:'Area ID List cannot be empty', + areaSonTip:'Area ID List each item AreaID cannot be empty', + } + }, dashboard: { overview:{ title: "Core Network Dashboard", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 8d5019f8..155ab677 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1,3 +1,7 @@ +import { language } from "@/plugins/http-fetch"; +import { eventData } from "@/views/dashboard/overview/hooks/useUserActivity"; +import { start, status } from "nprogress"; + export default { // 语言 i18n: '中文', @@ -370,6 +374,36 @@ export default { agentName: '座席名称', } }, + cbc:{ + cbe:{ + title: '广播事件', + delTip: '确认删除编号为【{num}】的CBC事件吗?', + eventName: '事件名称', + startTime: '开始时间', + endTime: '结束时间', + repetitionPeriod: '广播周期', + numOfBcast: '广播次数', + msgPWSType: '广播消息类型', + messageId: '广播消息编号', + displayMode: '显示模式', + geoScope:'广播覆盖范围', + emergencyUserAlert: '紧急用户提示', + activatePopup: '弹窗提示', + warningType: '预警类型标识', + language:'语言', + warningMessageText:'广播内容', + status: '状态', + warningAreaType: '预警区域类型', + taiListTip:'TAI List 不能为空', + taiSonTip:'TAI List 每项的 MCC、MNC、TAC 都不能为空', + eutraListTip:'EUTRA CellId List 不能为空', + eutraSonTip:'EUTRA CellId List 每项的 MCC、MNC、CellId 都不能为空', + nrTip:'NR CellId List 不能为空', + nrSonTip:'NR CellId List 每项的 MCC、MNC、CellId 都不能为空', + areaTip:'Area ID List 不能为空', + areaSonTip:'Area ID List 每项的 AreaID 都不能为空', + } + }, dashboard: { overview:{ title: "核心网系统看板", diff --git a/src/views/cbc/cbe/index.vue b/src/views/cbc/cbe/index.vue index 68089559..e99f2786 100644 --- a/src/views/cbc/cbe/index.vue +++ b/src/views/cbc/cbe/index.vue @@ -87,7 +87,7 @@ let tableColumns: ColumnsType = [ width: 100, }, { - title: 'eventName', + title: t('views.cbc.cbe.eventName'), dataIndex: 'messageJson', align: 'left', width: 150, @@ -97,7 +97,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: 'Start Time', + title: t('views.cbc.cbe.startTime'), dataIndex: 'messageJson', align: 'left', width: 150, @@ -107,7 +107,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: 'Repetition Period', + title: t('views.cbc.cbe.repetitionPeriod'), dataIndex: 'messageJson', align: 'left', width: 150, @@ -117,7 +117,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: 'Num Of Bcast', + title: t('views.cbc.cbe.numOfBcast'), dataIndex: 'messageJson', align: 'left', width: 150, @@ -127,18 +127,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: 'Concurrent Warning Message Ind', - dataIndex: 'messageJson', - align: 'left', - width: 200, - customRender(opt) { - const messageJson = opt.value; - console.log('messageJson', messageJson); - return '' + messageJson.concurrentWarningMessageInd; - }, - }, - { - title: t('common.status'), + title: t('views.cbc.cbe.status'), dataIndex: 'status', key: 'status', align: 'left', @@ -296,10 +285,6 @@ type ModalStateType = { openByView: boolean; /**新增框或修改框是否显示 */ openByEdit: boolean; - /**批量新增否显示 */ - openByBatch: boolean; - /**批量删除否显示 */ - openByBatchDel: boolean; /**标题 */ title: string; /**表单数据 */ @@ -314,32 +299,39 @@ type ModalStateType = { let modalState: ModalStateType = reactive({ openByView: false, openByEdit: false, - openByBatch: false, - openByBatchDel: false, title: 'CBC CBE', from: { id: undefined, - eventName: '', + eventName: 'cmas_', startTime: '', repetitionPeriod: '', neId: '', // amDat numOfBcast: '', - concurrentWarningMessageInd: true, //messageIdProfile - msgPWSType: 'CAMS', // - messageId: '', + messageIdProfile: { + msgPWSType: 'CAMS', // + messageId: 4370, + }, //serialNumProfile - displayMode: '', - geoScope: '', // 0x00:EPC和5GC 0x01:5GC 0x02:EPC 0x03:EPC+5GC - messageCode: '', + serialNumProfile: { + displayMode: 'normal', + geoScope: 'PLMNwide', + messageCode: '', + }, //warningTypeProfile - warningType: '', - emergencyUserAlert: true, - activatePopup: false, + warningTypeProfile: { + warningType: '', + emergencyUserAlert: 'false', + activatePopup: 'true', + }, + warningMessageProfile: { + language: 'English', + warningMessageText: 'it is CMAS message', + }, warningAreaType: 'tai', // 'tai' | 'eutra' | 'nr' |areaID warningAreaList: { taiList: [ @@ -417,11 +409,21 @@ function delArea(idx: number) { * 对话框弹出显示为 新增或者修改 * @param noticeId 网元id, 不传为新增 */ -function fnModalVisibleByEdit(id?: string) { - if (!id) { +function fnModalVisibleByEdit(record?: any) { + if (!record) { modalStateFrom.resetFields(); - modalState.title = t('common.addText') + t('views.neUser.sub.subInfo'); + modalState.title = t('common.addText') + t('views.cbc.cbe.title'); modalState.openByEdit = true; + } else { + modalStateFrom.resetFields(); + modalState.title = t('common.addText') + t('views.cbc.cbe.title'); + modalState.openByEdit = true; + console.log('record', record); + modalState.from = Object.assign(modalState.from, record.messageJson, { + id: record.id, + status: record.status, + neId: record.neId, + }); } } @@ -432,43 +434,43 @@ const modalStateFrom = Form.useForm( eventName: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.eventName') + t('common.unableNull'), }, ], repetitionPeriod: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.repetitionPeriod') + t('common.unableNull'), }, ], numOfBcast: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.numOfBcast') + t('common.unableNull'), }, ], msgPWSType: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.msgPWSType') + t('common.unableNull'), }, ], messageId: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.messageId') + t('common.unableNull'), }, ], emergencyUserAlert: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.emergencyUserAlert') + t('common.unableNull'), }, ], activatePopup: [ { required: true, - //message: t('views.neUser.sub.numAdd') + t('common.unableNull'), + message: t('views.cbc.cbe.activatePopup') + t('common.unableNull'), }, ], // ['warningAreaList.taiList']: [ @@ -494,8 +496,74 @@ const modalStateFrom = Form.useForm( * 进行表达规则校验 */ function fnModalOk() { + // 区域列表必填校验 + const areaType = modalState.from.warningAreaType; + const areaList = modalState.from.warningAreaList; + let valid = true; + let errMsg = ''; + if (areaType === 'tai') { + if (!areaList.taiList || areaList.taiList.length === 0) { + valid = false; + errMsg = t('views.cbc.cbe.taiListTip'); + } else { + for (const item of areaList.taiList) { + if (!item.plmnId.mcc || !item.plmnId.mnc || !item.tac) { + valid = false; + errMsg = t('views.cbc.cbe.taiSonTip'); + break; + } + } + } + } else if (areaType === 'eutra') { + if (!areaList.eutraCellIdList || areaList.eutraCellIdList.length === 0) { + valid = false; + errMsg = t('views.cbc.cbe.eutraListTip'); + } else { + for (const item of areaList.eutraCellIdList) { + if (!item.plmnId.mcc || !item.plmnId.mnc || !item.cellId) { + valid = false; + errMsg = t('views.cbc.cbe.eutraSonTip'); + break; + } + } + } + } else if (areaType === 'nr') { + if (!areaList.nrCellIdList || areaList.nrCellIdList.length === 0) { + valid = false; + errMsg = t('views.cbc.cbe.nrTip'); + } else { + for (const item of areaList.nrCellIdList) { + if (!item.plmnId.mcc || !item.plmnId.mnc || !item.cellId) { + valid = false; + errMsg = t('views.cbc.cbe.nrSonTip'); + break; + } + } + } + } else if (areaType === 'area') { + if ( + !areaList.emergencyAreaIDList || + areaList.emergencyAreaIDList.length === 0 + ) { + valid = false; + errMsg = t('views.cbc.cbe.areaTip'); + } else { + for (const item of areaList.emergencyAreaIDList) { + if (!item.areaId) { + valid = false; + errMsg = t('views.cbc.cbe.areaSonTip'); + break; + } + } + } + } + if (!valid) { + message.error(errMsg, 3); + return; + } + const from = Object.assign({}, toRaw(modalState.from)); - from.neId = queryParams.neId; + from.neId = queryParams.neId; //return; @@ -508,44 +576,12 @@ function fnModalOk() { addCBC(from) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { - // if (from.num === 1) { - // message.success({ - // content: t('common.msgSuccess', { msg: modalState.title }), - // duration: 3, - // }); - // fnGetList(1); - // } else { - // const timerS = Math.max( - // Math.ceil(+from.num / 500), - // `${from.num}`.length * 5 - // ); - // notification.success({ - // message: modalState.title, - // description: t('common.operateOk'), - // duration: timerS, - // }); - // setTimeout(() => { - // fnGetList(1); - // }, timerS * 1000); - // } message.success({ content: t('common.msgSuccess', { msg: modalState.title }), duration: 3, }); fnGetList(1); } else { - // if (from.num === 1) { - // message.error({ - // content: `${res.msg}`, - // duration: 3, - // }); - // } else { - // notification.error({ - // message: modalState.title, - // description: res.msg, - // duration: 3, - // }); - // } message.error({ content: `${res.msg}`, duration: 3, @@ -611,7 +647,7 @@ function fnRecordDelete(id: string) { Modal.confirm({ title: t('common.tipTitle'), - content: t('views.neUser.auth.delSure', {}), + content: t('views.cbc.cbe.delTip', { num: id }), onOk() { modalState.loadDataLoading = true; const hide = message.loading(t('common.loading'), 0); @@ -681,7 +717,6 @@ function fnGetList(pageNum?: number) { } function fnModalChange(event: any) { - console.log(event); modalState.from.warningAreaList = { taiList: [ { @@ -709,6 +744,22 @@ function fnModalChange(event: any) { }; } +function pwsTypeChange(value: any) { + if (value === 'ETWS') { + modalState.from.warningTypeProfile.warningType = 'TEST'; + modalState.from.eventName = 'etws_'; + modalState.from.serialNumProfile.displayMode = 'immediate'; + modalState.from.warningTypeProfile.emergencyUserAlert = 'true'; + modalState.from.warningTypeProfile.activatePopup = 'true'; + } else if (value === 'CAMS') { + modalState.from.warningTypeProfile.warningType = ''; + modalState.from.eventName = 'cmas_'; + modalState.from.serialNumProfile.displayMode = 'normal'; + modalState.from.warningTypeProfile.emergencyUserAlert = 'false'; + modalState.from.warningTypeProfile.activatePopup = 'true'; + } +} + onMounted(() => { // 获取网元网元列表 useNeInfoStore() @@ -763,7 +814,7 @@ onMounted(() => { - + {