From 571bc840adf2066d6dd7796db1690d7fe4f2f6da Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 9 May 2025 19:13:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80FTP=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=9C=AC=E5=9C=B0=E5=A4=87=E4=BB=BD=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=8F=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neData/backup.ts | 38 ++ src/api/tool/file.ts | 69 ++- src/i18n/locales/en-US.ts | 50 +- src/i18n/locales/zh-CN.ts | 52 +- src/plugins/http-fetch.ts | 2 +- src/views/logManage/exportFile/index.vue | 444 +++++------------- .../neConfigBackup/components/BackupModal.vue | 230 +++++++++ src/views/ne/neConfigBackup/index.vue | 42 ++ 8 files changed, 594 insertions(+), 333 deletions(-) create mode 100644 src/api/neData/backup.ts create mode 100644 src/views/ne/neConfigBackup/components/BackupModal.vue diff --git a/src/api/neData/backup.ts b/src/api/neData/backup.ts new file mode 100644 index 00000000..eeb3781c --- /dev/null +++ b/src/api/neData/backup.ts @@ -0,0 +1,38 @@ +import { request } from '@/plugins/http-fetch'; + +/** + * 备份文件-获取FTP配置 + * @returns object + */ +export function getBackupFTP() { + return request({ + url: '/neData/backup/ftp', + method: 'GET', + }); +} + +/** + * 备份文件-文件FTP发送 + * @param data 对象 + * @returns object + */ +export function pushBackupFTP(data: Record) { + return request({ + url: '/neData/backup/ftp', + method: 'POST', + data, + }); +} + +/** + * 备份文件-更新FTP配置 + * @param data 对象 + * @returns object + */ +export function updateBackupFTP(data: Record) { + return request({ + url: '/neData/backup/ftp', + method: 'PUT', + data, + }); +} diff --git a/src/api/tool/file.ts b/src/api/tool/file.ts index 928be1be..ecbcfd1c 100644 --- a/src/api/tool/file.ts +++ b/src/api/tool/file.ts @@ -15,7 +15,7 @@ import { encode } from 'js-base64'; export async function downloadFile(filePath: string, range?: string) { return request({ url: `/file/download/${encode(filePath)}`, - method: 'get', + method: 'GET', headers: range ? { range } : {}, responseType: 'blob', timeout: 60_000, @@ -77,7 +77,7 @@ export async function downloadFileChunk( export function uploadFile(data: FormData) { return request({ url: '/file/upload', - method: 'post', + method: 'POST', data, dataType: 'form-data', timeout: 180_000, @@ -168,8 +168,8 @@ export async function uploadFileChunk( */ export function chunkCheck(identifier: string, fileName: string) { return request({ - url: '/file/chunkCheck', - method: 'post', + url: '/file/chunk-check', + method: 'POST', data: { identifier, fileName }, timeout: 60_000, }); @@ -188,8 +188,8 @@ export function chunkMerge( subPath: string = 'default' ) { return request({ - url: '/file/chunkMerge', - method: 'post', + url: '/file/chunk-merge', + method: 'POST', data: { identifier, fileName, subPath }, timeout: 60_000, }); @@ -202,22 +202,66 @@ export function chunkMerge( */ export function chunkUpload(data: FormData) { return request({ - url: '/file/chunkUpload', - method: 'post', + url: '/file/chunk-upload', + method: 'POST', data, dataType: 'form-data', timeout: 60_000, }); } +/** + * 本地文件列表 + * @param path 文件路径 + * @param search search prefix + * @returns object + */ +export async function listFile(query: Record) { + return request({ + url: `/file/list`, + method: 'GET', + params: query, + }); +} + +/** + * 本地文件获取下载 + * @param path 文件路径 + * @param fileName 文件名 + * @returns object + */ +export async function getFile(path: string, fileName: string) { + return request({ + url: `/file`, + method: 'GET', + params: { path, fileName }, + responseType: 'blob', + timeout: 60_000, + }); +} + +/** + * 本地文件删除 + * @param path 文件路径 + * @param fileName 文件名 + * @returns object + */ +export async function delFile(path: string, fileName: string) { + return request({ + url: `/file`, + method: 'DELETE', + params: { path, fileName }, + }); +} + /** * 转存上传文件到静态资源 * @returns object */ export function transferStaticFile(data: Record) { return request({ - url: `/file/transferStaticFile`, - method: 'post', + url: `/file/transfer-static-file`, + method: 'POST', data, timeout: 60_000, }); @@ -241,11 +285,12 @@ export async function uploadFileToNE( if (uploadChunkRes.code === RESULT_CODE_SUCCESS) { const transferToNeFileRes = await request({ url: `/ne/action/pushFile`, - method: 'post', + method: 'POST', data: { - uploadPath: uploadChunkRes.data.fileName, + uploadPath: uploadChunkRes.data.filePath, neType, neId, + delTemp: true, }, timeout: 60_000, }); diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 132313d1..cf2c12d3 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -660,6 +660,19 @@ export default { name: "Name", downTip: 'Confirmed to download the backup file [{txt}]?', title: "Modify Backup {txt}", + backupModal: { + pushFileOper: "Send Current File To Remote Backup", + title: "Setting Remote Backup Service", + enable: "Enable", + toIp: "Service IP", + toIpPleace: "Please input the remote backup server IP address", + toPort: "Service Port", + username: "UserName", + usernamePleace: 'Please enter the service login username', + password: "Password", + dir: "Save Dir", + dirPleace: 'Please enter the service address target file directory', + } }, neQuickSetup: { reloadPara5G: 'Reload', @@ -711,6 +724,27 @@ export default { }, }, neData: { + common: { + startIMSI: 'Starting IMSI', + imsi: 'IMSI', + imsiTip: 'IMSI=MCC+MNC+MSIN', + imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.', + imsiTip2: 'MNC = Mobile Network Number, consisting of two digits', + imsiTip3: 'MSIN = Mobile Subscriber Identification Number, consisting of 10 equal digits.', + imsiPlease: "Please enter IMSI correctly", + msisdn: 'Mobile Customer Identification Number', + msisdnPlease: "Please enter the Mobile Customer Identification Number correctly", + loadDataConfirm: 'Confirmed to reload data?', + loadData: 'Load Data', + loadDataTip: 'Successfully fetched loaded data: {num} items, the system is internally updating the data, it will take about {timer} seconds, please wait!!!!!.', + batchOper: 'Batch Operation', + batchAddText: 'Batch Addition', + batchDelText: 'Batch Deletion', + batchUpdateText: 'Batch Update', + batchNum: 'Number of releases', + checkDel:'Check Delete', + importTemplate: 'Download Template', + }, baseStation: { list: "List", topology: "Topology", @@ -733,6 +767,12 @@ export default { exportTip: "Confirm exporting xlsx table files based on search criteria?", importDataEmpty: "Imported data is empty", }, + backupData: { + auth: "UDM Authentication", + sub: "UDM Subscribers", + voip: "VoIP Authentication", + volte: "IMS Subscribers", + } }, neUser: { auth: { @@ -1212,12 +1252,18 @@ export default { tailLines: 'End Lines', }, exportFile:{ - fileName:'File Source', + fileSource:'File Source', + fileSourcePlease:'Please select the source of the document', downTip: "Confirm the download file name is [{fileName}] File?", downTipErr: "Failed to get file", deleteTip: "Confirm the delete file name is [{fileName}] File?", deleteTipErr: "Failed to delete file", - selectTip:"Please select File Name", + sysloginLog:'System Login Log', + sysOperateLog:'System Operation Log', + cdrIMS:'CDR Voice', + cdrSMF:'CDR Data', + cdrSMSC:'CDR SMS', + cdrSGWC:'CDR Roaming Data', } }, monitor: { diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 3d769131..e3aa6aec 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -660,6 +660,19 @@ export default { name: "名称", downTip: '确认要下载备份文件【{txt}】吗?', title: "修改备份信息 {txt}", + backupModal: { + pushFileOper: "将当前文件发送到远程备份", + title: "设置远程备份服务", + enable: "启用", + toIp: "服务IP", + toIpPleace: "请输入远程备份服务器 IP 地址", + toPort: "服务端口", + username: "登录用户名", + usernamePleace: '请输入服务登录用户名', + password: "登录密码", + dir: "保存目录", + dirPleace: '请输入服务地址目标文件目录', + } }, neQuickSetup: { reloadPara5G: '刷新', @@ -711,6 +724,27 @@ export default { }, }, neData: { + common: { + startIMSI: '起始IMSI', + imsi: 'IMSI', + imsiTip: 'IMSI=MCC+MNC+MSIN', + imsiTip1: 'MCC=移动国家号码, 由三位数字组成', + imsiTip2: 'MNC=移动网络号,由两位数字组成', + imsiTip3: 'MSIN=移动客户识别码,采用等长10位数字构成', + imsiPlease: "请正确输入IMSI", + msisdn: '移动客户识别码', + msisdnPlease: "请正确输入移动客户识别码", + loadDataConfirm: '确认要重新加载数据吗?', + loadData: '加载数据', + loadDataTip: '成功获取加载数据:{num}条,系统内部正在进行数据更新,大约需要{timer}秒,请稍候!!!', + batchOper: '批量操作', + batchAddText: '批量新增', + batchDelText: '批量删除', + batchUpdateText: '批量更新', + batchNum: '批量个数', + checkDel:'勾选删除', + importTemplate: '导入模板', + }, baseStation: { list: "列表", topology: "拓扑图", @@ -733,6 +767,12 @@ export default { exportTip: "确认根据搜索条件导出xlsx表格文件吗?", importDataEmpty: "导入数据为空", }, + backupData: { + auth: "UDM鉴权用户", + sub: "UDM签约用户", + voip: "VOIP鉴权用户", + volte: "IMS签约用户", + } }, neUser: { auth: { @@ -862,7 +902,7 @@ export default { }, nssf:{ neType: 'NSSF网元对象', - }, + } }, perfManage: { taskManage:{ @@ -1212,12 +1252,18 @@ export default { tailLines: '末尾行数', }, exportFile:{ - fileName:'文件来源', + fileSource:'文件来源', + fileSourcePlease:'请选择文件来源', downTip: "确认下载文件名为 【{fileName}】 文件?", downTipErr: "文件获取失败", deleteTip: "确认删除文件名为 【{fileName}】 文件?", deleteTipErr: "文件删除失败", - selectTip:"请选择文件名", + sysloginLog:'系统登录日志', + sysOperateLog:'系统操作日志', + cdrIMS:'语音话单', + cdrSMF:'数据话单', + cdrSMSC:'短信话单', + cdrSGWC:'漫游数据话单', } }, monitor: { diff --git a/src/plugins/http-fetch.ts b/src/plugins/http-fetch.ts index 7a4a8849..8266be46 100644 --- a/src/plugins/http-fetch.ts +++ b/src/plugins/http-fetch.ts @@ -61,7 +61,7 @@ type OptionsType = { /**请求地址 */ url: string; /**请求方法 */ - method: 'get' | 'post' | 'put' | 'delete' | 'PATCH'; + method: 'get' | 'post' | 'put' | 'delete' | 'PATCH' | 'GET' | 'POST' | 'PUT' | 'DELETE'; /**请求头 */ headers?: HeadersInit; /**地址栏参数 */ diff --git a/src/views/logManage/exportFile/index.vue b/src/views/logManage/exportFile/index.vue index b1965ebb..6016e2b6 100644 --- a/src/views/logManage/exportFile/index.vue +++ b/src/views/logManage/exportFile/index.vue @@ -1,38 +1,62 @@