diff --git a/src/api/configManage/backupManage.ts b/src/api/configManage/backupManage.ts deleted file mode 100644 index 43fcbe36..00000000 --- a/src/api/configManage/backupManage.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; - -/** - * 查询备份列表 - * @param query 查询参数 - * @returns object - */ -export async function listNeBackup(query: Record) { - let totalSQL = 'select count(id) as total from ne_backup '; - let rowsSQL = ' select * from ne_backup '; - - // 查询 - let querySQL = 'where 1=1'; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by create_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_backup`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_backup']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; -} - -/** - * 删除备份信息 - * @param noticeId 网元ID - * @returns object - */ -export async function delNeBackup(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`, - method: 'delete', - }); -} - -/** - * 获取备份信息文件 - * @param menuId 网元ID - * @returns object - */ -export async function downloadNeBackup(data: Record) { - return await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`, - method: 'get', - responseType: 'blob', - timeout: 180_000, - }); -} - - -/** - * 修改备份说明 - * @param menuId 网元ID - * @returns object - */ -export async function updateBackInfo(data:Record){ - return request({ - url: `/api/rest/databaseManagement/v1/omc_db/ne_backup?WHERE=id=${data.id}`, - method: 'put', - data: { data: { comment: data.backupInfo } }, - }); -} diff --git a/src/api/configManage/configParam.ts b/src/api/configManage/configParam.ts index 52c669e7..537b8190 100644 --- a/src/api/configManage/configParam.ts +++ b/src/api/configManage/configParam.ts @@ -15,7 +15,7 @@ export async function updateNeConfigReload(neType: string, neId: string) { // 发起请求 const result = await request({ url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`, - method: 'post', + method: 'POST', data: { mml: ['reload'] }, timeout: 180_000, }); @@ -53,7 +53,7 @@ export async function getPCCRule(neId: any) { request({ url: `/ne/config/data`, params: { neType: 'PCF', neId, paramName }, - method: 'get', + method: 'GET', }) ); } @@ -63,7 +63,7 @@ export async function getPCCRule(neId: any) { resArr.forEach((item, i: number) => { if (item.status === 'fulfilled') { const res = item.value; - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS) { const key = paramNameArr[i]; obj[key] = res.data.map((item: any) => { if ('qosTemplate' === key) { diff --git a/src/api/configManage/neManage.ts b/src/api/configManage/neManage.ts deleted file mode 100644 index aeb5d8d6..00000000 --- a/src/api/configManage/neManage.ts +++ /dev/null @@ -1,242 +0,0 @@ -import { - RESULT_CODE_ERROR, - RESULT_CODE_SUCCESS, - RESULT_MSG_ERROR, -} from '@/constants/result-constants'; -import { language, request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; -import { NE_TYPE_LIST } from '@/constants/ne-constants'; - -/** - * 查询网元列表 - * @param query 查询参数 - * @returns object - */ -export async function listNeInfo(query: Record) { - let totalSQL = 'select count(*) as total from ne_info where 1=1 '; - let rowsSQL = 'select * from ne_info where 1=1 '; - - // 查询 - let querySQL = ''; - if (query.neType) { - querySQL += ` and ne_type = '${query.neType}' `; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_info`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_info']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - //通过sort进行冒泡排序 - data.rows.sort((a: any, b: any) => { - const typeA = NE_TYPE_LIST.indexOf(a.neType); - const typeB = NE_TYPE_LIST.indexOf(b.neType); - if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面 - if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面 - return typeA - typeB; - }); - } - } - }); - return data; - } - return result; -} - -/** - * 查询网元详细 - * @param menuId 网元ID - * @returns object - */ -export async function getNeInfo(id: string | number) { - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_info`, - method: 'get', - params: { - SQL: `select * from ne_info where id = ${id}`, - }, - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { - let neInfo = result.data.data[0]['ne_info']; - if (neInfo) { - return Object.assign(result, { - data: parseObjLineToHump(neInfo[0]), - }); - } - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] }; - } - return result; -} - -/** - * 新增网元 - * @param data 网元对象 - * @returns object - */ -export function addNeInfo(data: Record) { - data.port = `${data.port}`; - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType.toLowerCase()}/objectType/neInfo?sync2ne=${ - data.sync - }`, - method: 'post', - data: data, - }); -} - -/** - * 修改网元 - * @param data 网元对象 - * @returns object - */ -export function updateNeInfo(data: Record) { - data.port = `${data.port}`; - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo?sync2ne=${data.sync}`, - method: 'put', - data: data, - }); -} - -/** - * 删除网元 - * @param noticeId 网元ID - * @returns object - */ -export async function delNeInfo(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo?ne_id=${data.neId}`, - method: 'delete', - timeout: 60 * 1000, - }); -} - -/** - * 导出网元配置文件 - * @param data data {neType neId} - * @returns bolb - */ -export function exportSet(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/cm?ne_id=${data.neId}`, - method: 'get', - responseType: 'blob', - headers: { - 'Content-Type': 'application/octet-stream', - }, - timeout: 180_000, - }); -} - -/** - * 导入网元配置文件 - * @param data 网元对象 - * @returns object - */ -export function importFile(data: Record) { - let dataType: 'json' | 'form-data' = 'json'; - let url = `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/cm?ne_id=${data.neId}`; - let obj: any = { fileName: data.fileName }; - if (data.importType === 'local') { - let formData = new FormData(); - formData.append('nfType', data.neType); - formData.append('nfId', data.neId); - formData.append('file', data.file); - obj = formData; - dataType = 'form-data'; - } - - // 处理FormData类型的data - return request({ - url, - method: 'post', - data: obj, - dataType, - timeout: 180_000, - }); -} - -/** - * 查询远程服务器上网元配置文件 - * @param data 网元对象 - * @returns object - */ -export async function listServerFile(data: Record) { - const result = await request({ - url: `/api/rest/databaseManagement/v1/omc_db/ne_backup?SQL= select * from ne_backup where ne_type ='${data.neType}'`, - method: 'get', - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { - let data = result.data.data[0]; - return Object.assign(result, { - data: parseObjLineToHump(data['ne_backup']), - }); - } - return result; -} - -/** - * 启动网元 - * @data {neType,neId} - * @returns bolb - */ -export function startNf(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/start?neId=${data.neId}`, - method: 'post', - timeout: 180_000, - }); -} - -/** - * 重启网元 - * @data {neType,neId} - * @returns bolb - */ -export function restartNf(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/restart?neId=${data.neId}`, - method: 'post', - timeout: 180_000, - }); -} - -/** - * 停止网元 - * @data {neType,neId} - * @returns bolb - */ -export function stopNf(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/stop?neId=${data.neId}`, - method: 'post', - timeout: 180_000, - }); -} diff --git a/src/api/configManage/softwareManage.ts b/src/api/configManage/softwareManage.ts deleted file mode 100644 index f7478dc4..00000000 --- a/src/api/configManage/softwareManage.ts +++ /dev/null @@ -1,220 +0,0 @@ -import { - RESULT_CODE_ERROR, - RESULT_CODE_SUCCESS, - RESULT_MSG_ERROR, -} from '@/constants/result-constants'; -import { language, request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; - -/** - * 查询软件列表 - * @param query 查询参数 - * @returns object - */ -export async function listNeSoftware(query: Record) { - let totalSQL = 'select count(id) as total from ne_software '; - let rowsSQL = ' select * from ne_software '; - - // 查询 - let querySQL = 'where 1=1'; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by update_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_software`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_software']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; -} - -/** - * 删除软件信息 - * @param noticeId 网元ID - * @returns object - */ -export async function delNeSoftware(data: Record) { - return request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`, - method: 'delete', - }); -} - -/** - * 获取软件信息文件 - * @param menuId 网元ID - * @returns object - */ -export async function downloadNeSoftware(data: Record) { - return await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`, - method: 'get', - responseType: 'blob', - timeout: 180_000, - }); -} - -/** - * 上传文件 - * @param data 表单数据对象 - * @returns object - */ -export function uploadNeSoftware(data: FormData) { - return request({ - url: `/api/rest/systemManagement/v1/${data.get('nf')}/software/${data.get( - 'version' - )}`, - method: 'post', - data, - dataType: 'form-data', - timeout: 180_000, - }); -} - -/** - * 下发文件 - * @param data 数据对象 - * @returns object - */ -export async function sendNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'post', - timeout: 180_000, - repeatSubmit: false, - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - delete result.data; - return result; - } - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] }; -} - -/** - * 激活文件 - * @param data 数据对象 - * @returns object - */ -export async function runNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'put', - timeout: 180_000, - repeatSubmit: false, - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - delete result.data; - return result; - } - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] }; -} - -/** - * 回退文件 - * @param data 数据对象 - * @returns object - */ -export async function backNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'PATCH', - timeout: 180_000, - repeatSubmit: false, - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - delete result.data; - return result; - } - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] }; -} - -/** - * 查询版本列表 - * @param query 查询参数 - * @returns object - */ -export async function listNeVersion(query: Record) { - let totalSQL = 'select count(id) as total from ne_version '; - let rowsSQL = 'select * from ne_version '; - - // 查询 - let querySQL = 'where 1=1'; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - if (query.status) { - querySQL += ` and status = '${query.status}' `; - } - if (query.beginTime && query.endTime) { - querySQL += ` and update_time BETWEEN '${query.beginTime}' AND '${query.endTime}' `; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` order by update_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_version`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_version']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; -} diff --git a/src/api/faultManage/actAlarm.ts b/src/api/faultManage/actAlarm.ts index 29c5466b..d61d8f77 100644 --- a/src/api/faultManage/actAlarm.ts +++ b/src/api/faultManage/actAlarm.ts @@ -14,7 +14,7 @@ export async function getActiveAlarmTotal() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { SQL: totalSQL, }, @@ -82,7 +82,7 @@ export async function listAct(query: Record, filterSQl: string) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { SQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + limtSql, @@ -91,9 +91,8 @@ export async function listAct(query: Record, filterSQl: string) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -101,9 +100,9 @@ export async function listAct(query: Record, filterSQl: string) { const itemData = item['alarm']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -130,7 +129,7 @@ export function updateConfirm(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`, - method: 'put', + method: 'PUT', data: finalData, }); } @@ -155,7 +154,7 @@ export function cancelConfirm(data: (string | number)[]) { url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join( ',' )})`, - method: 'put', + method: 'PUT', data: finalData, }); } @@ -187,7 +186,7 @@ export function showPass(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='displayFilter'`, - method: 'put', + method: 'PUT', data: toBackJson, }); } @@ -199,7 +198,7 @@ export function showPass(data: Record) { export function getPass() { return request({ url: `/api/rest/databaseManagement/v1/select/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: "SELECT value_json,value FROM config WHERE config_tag ='displayFilter'", }, @@ -227,7 +226,7 @@ export function clearAlarm(data: Record) { url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join( ',' )})`, - method: 'put', + method: 'PUT', data: finalData, }); } @@ -240,7 +239,7 @@ export function clearAlarm(data: Record) { export function listSync() { return request({ url: `/api/rest/faultManagement/v1/elementType/all/objectType/alarms`, - method: 'get', + method: 'GET', timeout: 180_000, }); } @@ -275,7 +274,7 @@ export async function exportAll(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { rowsSQL: rowsSQL + querySQL, }, @@ -300,7 +299,7 @@ export async function origGet() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { SQL: totalSQL, }, @@ -338,7 +337,7 @@ export async function top3Sel(filterFlag?: string) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { SQL: top3SQL, }, diff --git a/src/api/faultManage/eventAlarm.ts b/src/api/faultManage/eventAlarm.ts index e84dfca5..30c7256c 100644 --- a/src/api/faultManage/eventAlarm.ts +++ b/src/api/faultManage/eventAlarm.ts @@ -1,8 +1,6 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; import { parseObjLineToHump } from '@/utils/parse-utils'; -import { parseDateToStr } from '@/utils/date-utils'; -import useUserStore from '@/store/modules/user'; /** * 查询列表 @@ -49,7 +47,7 @@ export async function listAct(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_event`, - method: 'get', + method: 'GET', params: { SQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + limtSql, @@ -58,9 +56,8 @@ export async function listAct(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -68,9 +65,9 @@ export async function listAct(query: Record) { const itemData = item['alarm_event']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -109,7 +106,7 @@ export async function exportAll(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_event`, - method: 'get', + method: 'GET', params: { rowsSQL: rowsSQL + querySQL, }, diff --git a/src/api/faultManage/faultSetting.ts b/src/api/faultManage/faultSetting.ts index ce619808..2d848a29 100644 --- a/src/api/faultManage/faultSetting.ts +++ b/src/api/faultManage/faultSetting.ts @@ -18,7 +18,7 @@ export async function getAlarmSet() { // 历史告警保存时间 const logDurationResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'historyDuration'`, }, @@ -27,7 +27,7 @@ export async function getAlarmSet() { // 同步设置 const logCapacityResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'syncTaskPeriod'`, }, @@ -90,14 +90,14 @@ export async function updateAlarmSet(data: Record) { // 历史告警保存时间 const historyDurationResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='historyDuration'`, - method: 'put', + method: 'PUT', data: { data: { value: data.historyDuration.toString() } }, }); arr.push(historyDurationResult); // 同步设置 const syncTaskPeriodResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='syncTaskPeriod'`, - method: 'put', + method: 'PUT', data: { data: { value_json: JSON.stringify(syncTaskPeriodJson) } }, }); arr.push(syncTaskPeriodResult); @@ -145,7 +145,7 @@ export async function getForwardSet() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'forwardAlarm'`, }, @@ -180,7 +180,7 @@ export async function updateForwardSet(data: Record) { ]; const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='forwardAlarm'`, - method: 'put', + method: 'PUT', data: { data: { value_json: JSON.stringify(obj) } }, }); // 解析数据 diff --git a/src/api/faultManage/historyAlarm.ts b/src/api/faultManage/historyAlarm.ts index e7df7458..c789c237 100644 --- a/src/api/faultManage/historyAlarm.ts +++ b/src/api/faultManage/historyAlarm.ts @@ -39,7 +39,7 @@ export async function listAct(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { SQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + limtSql, @@ -48,9 +48,8 @@ export async function listAct(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -58,9 +57,9 @@ export async function listAct(query: Record) { const itemData = item['alarm']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -87,7 +86,7 @@ export function updateConfirm(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`, - method: 'put', + method: 'PUT', data: finalData, }); } @@ -111,7 +110,7 @@ export function cancelConfirm(data: (string | number)[]) { url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join( ',' )})`, - method: 'put', + method: 'PUT', data: finalData, }); } @@ -146,7 +145,7 @@ export async function exportAll(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`, - method: 'get', + method: 'GET', params: { rowsSQL: rowsSQL + querySQL, }, diff --git a/src/api/index.ts b/src/api/index.ts index a1ea8b3b..4806e43c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -11,7 +11,7 @@ import { NE_TYPE_LIST } from '@/constants/ne-constants'; export async function listMain() { const result = await request({ url: '/api/rest/systemManagement/v1/elementType/all/objectType/systemState', - method: 'get', + method: 'GET', timeout: 60_000, }); // console.log(result); @@ -69,7 +69,7 @@ export async function getServerTime() { // 发起请求 const result = await request({ url: `/api/rest/systemManagement/v1/elementType/OMC/objectType/time`, - method: 'get', + method: 'GET', }); // 解析数据 if (result.code === RESULT_CODE_SUCCESS && result.data) { @@ -87,7 +87,7 @@ export async function getServerTime() { export function getSysConf() { return request({ url: `/sys-conf`, - method: 'get', + method: 'GET', whithToken: false, }); } diff --git a/src/api/logManage/alarm.ts b/src/api/logManage/alarm.ts index aa7f82ae..69ecaae2 100644 --- a/src/api/logManage/alarm.ts +++ b/src/api/logManage/alarm.ts @@ -20,14 +20,14 @@ export async function listAlarm(query: Record) { querySQL += ` and alarm_status = '${query.status}' `; } if (query.beginTime) { - querySQL += ` and log_time >= '${query.beginTime}' `; + querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `; } if (query.endTime) { - querySQL += ` and log_time <= '${query.endTime}' `; + querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `; } // 排序 - let sortSql = ' order by log_time '; + let sortSql = ' order by event_time '; if (query.sortOrder === 'asc') { sortSql += ' asc '; } else { @@ -41,7 +41,7 @@ export async function listAlarm(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_log`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -50,9 +50,8 @@ export async function listAlarm(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -60,9 +59,9 @@ export async function listAlarm(query: Record) { const itemData = item['alarm_log']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/logManage/exportFile.ts b/src/api/logManage/exportFile.ts index 1136b642..19f7b068 100644 --- a/src/api/logManage/exportFile.ts +++ b/src/api/logManage/exportFile.ts @@ -9,7 +9,7 @@ import { request } from '@/plugins/http-fetch'; export function getBakFile() { return request({ url: '/lm/table/list', - method: 'get', + method: 'GET', }); } @@ -21,7 +21,7 @@ export function getBakFile() { export function getBakFileList(query: Record) { return request({ url: '/lm/file/list', - method: 'get', + method: 'GET', params: query, }); } @@ -34,7 +34,7 @@ export function getBakFileList(query: Record) { export function downFile(query: Record) { return request({ url: `/lm/file/${query.fileName}`, - method: 'get', + method: 'GET', params: query, responseType: 'blob', timeout: 180_000, @@ -49,7 +49,7 @@ export function downFile(query: Record) { export function delFile(query: Record) { return request({ url: `/lm/file/${query.fileName}`, - method: 'delete', + method: 'DELETE', params: query, }); } @@ -62,7 +62,7 @@ export function delFile(query: Record) { export function updateFTPInfo(data: Record) { return request({ url: `/lm/table/ftp`, - method: 'post', + method: 'POST', data: data, crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', }); @@ -76,7 +76,7 @@ export function updateFTPInfo(data: Record) { export function getFTPInfo() { return request({ url: `/lm/table/ftp`, - method: 'get', + method: 'GET', crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', }); } @@ -89,7 +89,7 @@ export function getFTPInfo() { export function putFTPInfo(filePath: string, fileName: string) { return request({ url: `/lm/table/ftp`, - method: 'put', + method: 'PUT', data: { filePath, fileName }, }); } diff --git a/src/api/logManage/forwarding.ts b/src/api/logManage/forwarding.ts index 2fe1b29f..ee2a05e9 100644 --- a/src/api/logManage/forwarding.ts +++ b/src/api/logManage/forwarding.ts @@ -17,14 +17,14 @@ export async function listForwarding(query: Record) { querySQL += ` and ne_type like '%${query.neType}%' `; } if (query.beginTime) { - querySQL += ` and log_time >= '${query.beginTime}' `; + querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `; } if (query.endTime) { - querySQL += ` and log_time <= '${query.endTime}' `; + querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `; } // 排序 - let sortSql = ' order by log_time '; + let sortSql = ' order by event_time '; if (query.sortOrder === 'asc') { sortSql += ' asc '; } else { @@ -38,7 +38,7 @@ export async function listForwarding(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_forward_log`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -47,9 +47,8 @@ export async function listForwarding(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -57,9 +56,9 @@ export async function listForwarding(query: Record) { const itemData = item['alarm_forward_log']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/logManage/logSet.ts b/src/api/logManage/logSet.ts index c75bb727..c5cb10cc 100644 --- a/src/api/logManage/logSet.ts +++ b/src/api/logManage/logSet.ts @@ -18,7 +18,7 @@ export async function getLogSet() { // 日志保存时间 const logDurationResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'logDuration'`, }, @@ -27,7 +27,7 @@ export async function getLogSet() { // 日志最大容量 const logCapacityResult = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'logCapacity'`, }, @@ -76,7 +76,7 @@ export async function updateLogSet(data: Record) { const value = `${data[key]}`; const result = request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='${key}'`, - method: 'put', + method: 'PUT', data: { data: { value } }, }); arr.push(result); @@ -120,7 +120,7 @@ export async function getFtpLogSet() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'ftpLogSet'`, }, @@ -151,7 +151,7 @@ export async function getFtpLogSet() { export async function updateFtpLogSet(data: Record) { const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='ftpLogSet'`, - method: 'put', + method: 'PUT', data: { data: { value_json: JSON.stringify(data) } }, }); // 解析数据 @@ -176,7 +176,7 @@ export async function getRemoteOut() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'remoteLogSet'`, }, @@ -206,7 +206,7 @@ export async function getRemoteOut() { export async function updateRemoteOut(data: Record) { const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='remoteLogSet'`, - method: 'put', + method: 'PUT', data: { data: { value_json: JSON.stringify(data) } }, }); // 解析数据 @@ -254,7 +254,7 @@ export async function exportLog(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/${query.logType}`, - method: 'get', + method: 'GET', params: { SQL: querySQL, }, @@ -277,7 +277,7 @@ export async function exportLog(query: Record) { export async function backupLog(logType: string) { const result = await request({ url: `/api/rest/dataManagement/v1/omc_db/${logType}/backup`, - method: 'post', + method: 'POST', }); // 解析数据 if (result.code === RESULT_CODE_SUCCESS && result.data.data) { @@ -300,7 +300,7 @@ export async function backupLog(logType: string) { export async function backupDownload(path: string) { return request({ url: `/api/rest/fileManagement/v1/path/file?path=${path}`, - method: 'get', + method: 'GET', responseType: 'blob', timeout: 180_000, }); @@ -314,7 +314,7 @@ export async function backupDownload(path: string) { export function backupFileList() { return request({ url: `/api/rest/fileManagement/v1/files/listFiles`, - method: 'post', + method: 'POST', data: { path: '/usr/local/omc/database', expand: true, diff --git a/src/api/logManage/mml.ts b/src/api/logManage/mml.ts index d9bcc5a6..c32452ed 100644 --- a/src/api/logManage/mml.ts +++ b/src/api/logManage/mml.ts @@ -38,7 +38,7 @@ export async function listMML(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/mml_log`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -47,9 +47,8 @@ export async function listMML(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -57,9 +56,9 @@ export async function listMML(query: Record) { const itemData = item['mml_log']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/logManage/operation.ts b/src/api/logManage/operation.ts index 7c114dbe..8449f260 100644 --- a/src/api/logManage/operation.ts +++ b/src/api/logManage/operation.ts @@ -41,7 +41,7 @@ export async function listOperationLog(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/operation_log`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -50,9 +50,8 @@ export async function listOperationLog(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -60,9 +59,9 @@ export async function listOperationLog(query: Record) { const itemData = item['operation_log']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/logManage/security.ts b/src/api/logManage/security.ts index 762a166c..4a1448b2 100644 --- a/src/api/logManage/security.ts +++ b/src/api/logManage/security.ts @@ -41,7 +41,7 @@ export async function listSecurityLog(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/security_log`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -50,9 +50,8 @@ export async function listSecurityLog(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -60,9 +59,9 @@ export async function listSecurityLog(query: Record) { const itemData = item['security_log']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/login.ts b/src/api/login.ts index ca521231..e66963c6 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -6,7 +6,7 @@ import { request } from '@/plugins/http-fetch'; export function login(data: Record) { return request({ url: '/login', - method: 'post', + method: 'POST', data: data, whithToken: false, crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', @@ -21,7 +21,7 @@ export function login(data: Record) { export function register(data: Record) { return request({ url: '/register', - method: 'post', + method: 'POST', data: data, whithToken: false, crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', @@ -34,8 +34,8 @@ export function register(data: Record) { */ export function getInfo() { return request({ - url: '/getInfo', - method: 'get', + url: '/me', + method: 'GET', }); } @@ -46,7 +46,8 @@ export function getInfo() { export function logout() { return request({ url: '/logout', - method: 'post', + method: 'POST', + repeatSubmit: false, }); } @@ -56,8 +57,8 @@ export function logout() { */ export function getCaptchaImage() { return request({ - url: '/captchaImage', - method: 'get', + url: '/captcha-image', + method: 'GET', whithToken: false, }); } diff --git a/src/api/mmlManage/mmlSet.ts b/src/api/mmlManage/mmlSet.ts index 9b3957c5..bb02a418 100644 --- a/src/api/mmlManage/mmlSet.ts +++ b/src/api/mmlManage/mmlSet.ts @@ -15,7 +15,7 @@ export async function getOperationSet() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM config WHERE config_tag = 'operationSet'`, }, @@ -45,7 +45,7 @@ export async function getOperationSet() { export async function updateOperationSet(data: Record) { const result = await request({ url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='operationSet'`, - method: 'put', + method: 'PUT', data: { data: { value_json: JSON.stringify(data) } }, }); // 解析数据 diff --git a/src/api/mmlManage/neOperate.ts b/src/api/mmlManage/neOperate.ts index a8fe280d..34cb3f2c 100644 --- a/src/api/mmlManage/neOperate.ts +++ b/src/api/mmlManage/neOperate.ts @@ -11,7 +11,7 @@ export async function getMMLByNE(neType: string) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_system`, - method: 'get', + method: 'GET', params: { SQL: `select * from mml_system where ne_type = '${neType}' and status = 'Active'`, }, @@ -43,7 +43,7 @@ export async function sendMMlByNE( // 发起请求 const result = await request({ url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/${objectType}?ne_id=${neId}`, - method: 'post', + method: 'POST', data: { mml: cmdArr }, timeout: 180_000, }); diff --git a/src/api/mmlManage/omcOperate.ts b/src/api/mmlManage/omcOperate.ts index e129391e..2cceb412 100644 --- a/src/api/mmlManage/omcOperate.ts +++ b/src/api/mmlManage/omcOperate.ts @@ -10,7 +10,7 @@ export async function getMMLByOMC() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_command`, - method: 'get', + method: 'GET', params: { SQL: `select * from mml_command where ne_type = 'OMC' and status = 'Active'`, }, @@ -35,7 +35,7 @@ export async function sendMMlByOMC(neId: string, cmdArr: string[]) { // 发起请求 const result = await request({ url: `/api/rest/operationManagement/v1/elementType/OMC/objectType/mml?ne_id=${neId}`, - method: 'post', + method: 'POST', data: { mml: cmdArr }, timeout: 180_000, }); diff --git a/src/api/mmlManage/udmOperate.ts b/src/api/mmlManage/udmOperate.ts index 56b8ab6b..31042eae 100644 --- a/src/api/mmlManage/udmOperate.ts +++ b/src/api/mmlManage/udmOperate.ts @@ -10,7 +10,7 @@ export async function getMMLByUDM() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_subscriber`, - method: 'get', + method: 'GET', params: { SQL: `select * from mml_subscriber where ne_type = 'UDM' and status = 'Active'`, }, @@ -35,7 +35,7 @@ export async function sendMMlByUDM(neId: string, cmdArr: string[]) { // 发起请求 const result = await request({ url: `/api/rest/operationManagement/v1/elementType/UDM/objectType/mml?ne_id=${neId}`, - method: 'post', + method: 'POST', data: { mml: cmdArr }, timeout: 180_000, }); diff --git a/src/api/monitor/cache.ts b/src/api/monitor/cache.ts index b5fc7479..37ef06ed 100644 --- a/src/api/monitor/cache.ts +++ b/src/api/monitor/cache.ts @@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch'; export function getCache() { return request({ url: '/monitor/cache', - method: 'get', + method: 'GET', }); } @@ -17,8 +17,8 @@ export function getCache() { */ export function listCacheName() { return request({ - url: '/monitor/cache/getNames', - method: 'get', + url: '/monitor/cache/names', + method: 'GET', }); } @@ -29,8 +29,9 @@ export function listCacheName() { */ export function listCacheKey(cacheName: string) { return request({ - url: `/monitor/cache/getKeys/${cacheName}`, - method: 'get', + url: `/monitor/cache//keys`, + method: 'GET', + params: { cacheName }, }); } @@ -42,8 +43,22 @@ export function listCacheKey(cacheName: string) { */ export function getCacheValue(cacheName: string, cacheKey: string) { return request({ - url: `/monitor/cache/getValue/${cacheName}/${cacheKey}`, - method: 'get', + url: `/monitor/cache/value`, + method: 'GET', + params: { cacheName, cacheKey }, + }); +} + +/** + * 缓存名称列表安全删除 + * + * 指定可清理的缓存key + * @returns object + */ +export function clearCacheSafe() { + return request({ + url: '/monitor/cache/names', + method: 'DELETE', }); } @@ -54,8 +69,9 @@ export function getCacheValue(cacheName: string, cacheKey: string) { */ export function clearCacheName(cacheName: string) { return request({ - url: `/monitor/cache/clearCacheName/${cacheName}`, - method: 'delete', + url: `/monitor/cache/keys`, + method: 'DELETE', + params: { cacheName }, }); } @@ -67,20 +83,8 @@ export function clearCacheName(cacheName: string) { */ export function clearCacheKey(cacheName: string, cacheKey: string) { return request({ - url: `/monitor/cache/clearCacheKey/${cacheName}/${cacheKey}`, - method: 'delete', - }); -} - -/** - * 安全清理缓存名称 - * - * 指定可清理的缓存key - * @returns object - */ -export function clearCacheSafe() { - return request({ - url: '/monitor/cache/clearCacheSafe', - method: 'delete', + url: `/monitor/cache/value`, + method: 'DELETE', + params: { cacheName, cacheKey }, }); } diff --git a/src/api/monitor/job.ts b/src/api/monitor/job.ts index 09ec7d5b..8f45ee57 100644 --- a/src/api/monitor/job.ts +++ b/src/api/monitor/job.ts @@ -8,8 +8,8 @@ import { request } from '@/plugins/http-fetch'; export function exportJob(query: Record) { return request({ url: '/monitor/job/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -22,7 +22,7 @@ export function exportJob(query: Record) { export function listJob(query: Record) { return request({ url: '/monitor/job/list', - method: 'get', + method: 'GET', params: query, }); } @@ -35,7 +35,7 @@ export function listJob(query: Record) { export function getJob(jobId: string | number) { return request({ url: `/monitor/job/${jobId}`, - method: 'get', + method: 'GET', }); } @@ -47,7 +47,7 @@ export function getJob(jobId: string | number) { export function addJob(data: Record) { return request({ url: '/monitor/job', - method: 'post', + method: 'POST', data: data, }); } @@ -60,7 +60,7 @@ export function addJob(data: Record) { export function updateJob(data: Record) { return request({ url: '/monitor/job', - method: 'put', + method: 'PUT', data: data, }); } @@ -73,7 +73,7 @@ export function updateJob(data: Record) { export function delJob(jobId: string | number) { return request({ url: `/monitor/job/${jobId}`, - method: 'delete', + method: 'DELETE', }); } @@ -85,14 +85,14 @@ export function delJob(jobId: string | number) { */ export function changeJobStatus( jobId: string | number, - status: string | number + statusFlag: string | number ) { return request({ - url: '/monitor/job/changeStatus', - method: 'put', + url: '/monitor/job/status', + method: 'PUT', data: { jobId, - status, + statusFlag, }, }); } @@ -105,7 +105,7 @@ export function changeJobStatus( export function runJob(jobId: string) { return request({ url: `/monitor/job/run/${jobId}`, - method: 'put', + method: 'PUT', }); } @@ -115,7 +115,7 @@ export function runJob(jobId: string) { */ export function resetQueueJob() { return request({ - url: '/monitor/job/resetQueueJob', - method: 'put', + url: '/monitor/job/reset', + method: 'PUT', }); } diff --git a/src/api/monitor/jobLog.ts b/src/api/monitor/jobLog.ts index ade7b771..a2eec109 100644 --- a/src/api/monitor/jobLog.ts +++ b/src/api/monitor/jobLog.ts @@ -5,13 +5,11 @@ import { request } from '@/plugins/http-fetch'; * @param query 查询参数 * @returns bolb */ -export function exportJobLog( - query: Record -) { +export function exportJobLog(query: Record) { return request({ - url: '/monitor/jobLog/export', - method: 'post', - data: query, + url: '/monitor/job/log/export', + method: 'GET', + params: query, responseType: 'blob', }); } @@ -23,8 +21,8 @@ export function exportJobLog( */ export function listJobLog(query: Record) { return request({ - url: '/monitor/jobLog/list', - method: 'get', + url: '/monitor/job/log/list', + method: 'GET', params: query, }); } @@ -36,8 +34,8 @@ export function listJobLog(query: Record) { */ export function delJobLog(jobLogId: string) { return request({ - url: `/monitor/jobLog/${jobLogId}`, - method: 'delete', + url: `/monitor/job/log/${jobLogId}`, + method: 'DELETE', }); } @@ -47,7 +45,7 @@ export function delJobLog(jobLogId: string) { */ export function cleanJobLog() { return request({ - url: '/monitor/jobLog/clean', - method: 'delete', + url: '/monitor/job/log/clean', + method: 'DELETE', }); } diff --git a/src/api/monitor/monitor.ts b/src/api/monitor/monitor.ts index 830f4cf5..c821a931 100644 --- a/src/api/monitor/monitor.ts +++ b/src/api/monitor/monitor.ts @@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch'; export function getLoad(query: Record) { return request({ url: '/monitor/load', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); diff --git a/src/api/monitor/online.ts b/src/api/monitor/online.ts index 4faa13ea..47b4b186 100644 --- a/src/api/monitor/online.ts +++ b/src/api/monitor/online.ts @@ -7,8 +7,8 @@ import { request } from '@/plugins/http-fetch'; */ export function listOnline(query: Record) { return request({ - url: '/monitor/online/list', - method: 'get', + url: '/monitor/user-online/list', + method: 'GET', params: query, }); } @@ -20,7 +20,7 @@ export function listOnline(query: Record) { */ export function forceLogout(tokenId: string) { return request({ - url: `/monitor/online/${tokenId}`, - method: 'delete', + url: `/monitor/user-online/logout/${tokenId}`, + method: 'DELETE', }); } diff --git a/src/api/monitor/system.ts b/src/api/monitor/system.ts index fbb19aab..6d0b0051 100644 --- a/src/api/monitor/system.ts +++ b/src/api/monitor/system.ts @@ -3,8 +3,7 @@ import { request } from '@/plugins/http-fetch'; /**服务器服务信息 */ export function getSystemInfo() { return request({ - url: '/monitor/system-info', - method: 'get', - timeout: 60_000, + url: '/monitor/system', + method: 'GET', }); } diff --git a/src/api/monitor/topology.ts b/src/api/monitor/topology.ts index 2529c483..1f9345ac 100644 --- a/src/api/monitor/topology.ts +++ b/src/api/monitor/topology.ts @@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch'; export function getGraphGroups() { return request({ url: '/chart/graph/groups', - method: 'get', + method: 'GET', }); } @@ -12,7 +12,7 @@ export function getGraphGroups() { export function getGraphData(group: string) { return request({ url: '/chart/graph', - method: 'get', + method: 'GET', params: { group, }, @@ -23,7 +23,7 @@ export function getGraphData(group: string) { export function saveGraphData(group: string, data: Record) { return request({ url: '/chart/graph', - method: 'post', + method: 'POST', data: { group, data, @@ -35,6 +35,6 @@ export function saveGraphData(group: string, data: Record) { export function delGraphData(group: string) { return request({ url: `/chart/graph/${group}`, - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/ne/neConfig.ts b/src/api/ne/neConfig.ts index dcd1e8dd..c6b657d9 100644 --- a/src/api/ne/neConfig.ts +++ b/src/api/ne/neConfig.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function getAllNeConfig(neType: string) { return request({ url: `/ne/config/list/${neType}`, - method: 'get', + method: 'GET', timeout: 60_000, }); } @@ -22,7 +22,7 @@ export function getNeConfigData(params: Record) { return request({ url: `/ne/config/data`, params, - method: 'get', + method: 'GET', }); } @@ -34,7 +34,7 @@ export function getNeConfigData(params: Record) { export function editNeConfigData(data: Record) { return request({ url: `/ne/config/data`, - method: 'put', + method: 'PUT', data: data, }); } @@ -47,7 +47,7 @@ export function editNeConfigData(data: Record) { export function addNeConfigData(data: Record) { return request({ url: `/ne/config/data`, - method: 'post', + method: 'POST', data: data, }); } @@ -60,7 +60,7 @@ export function addNeConfigData(data: Record) { export function delNeConfigData(params: Record) { return request({ url: `/ne/config/data`, - method: 'delete', + method: 'DELETE', params, }); } diff --git a/src/api/ne/neConfigBackup.ts b/src/api/ne/neConfigBackup.ts index 4c96b485..56e12ec0 100644 --- a/src/api/ne/neConfigBackup.ts +++ b/src/api/ne/neConfigBackup.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeConfigBackup(query: Record) { return request({ url: '/ne/config/backup/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listNeConfigBackup(query: Record) { export function updateNeConfigBackup(data: Record) { return request({ url: '/ne/config/backup', - method: 'put', + method: 'PUT', data: data, }); } @@ -34,7 +34,7 @@ export function updateNeConfigBackup(data: Record) { export async function downNeConfigBackup(id: string) { return await request({ url: '/ne/config/backup/download', - method: 'get', + method: 'GET', params: { id }, responseType: 'blob', timeout: 180_000, @@ -49,7 +49,7 @@ export async function downNeConfigBackup(id: string) { export async function delNeConfigBackup(id: string) { return request({ url: '/ne/config/backup', - method: 'delete', + method: 'DELETE', params: { id }, }); } @@ -62,7 +62,7 @@ export async function delNeConfigBackup(id: string) { export function exportNeConfigBackup(data: Record) { return request({ url: '/ne/config/backup/export', - method: 'post', + method: 'POST', data: data, responseType: 'blob', timeout: 180_000, @@ -77,7 +77,7 @@ export function exportNeConfigBackup(data: Record) { export function importNeConfigBackup(data: Record) { return request({ url: '/ne/config/backup/import', - method: 'post', + method: 'POST', data: data, }); } \ No newline at end of file diff --git a/src/api/ne/neHost.ts b/src/api/ne/neHost.ts index 4d652cf3..3dff34e2 100644 --- a/src/api/ne/neHost.ts +++ b/src/api/ne/neHost.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeHost(query: Record) { return request({ url: '/ne/host/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listNeHost(query: Record) { export function getNeHost(hostId: string | number) { return request({ url: `/ne/host/${hostId}`, - method: 'get', + method: 'GET', }); } @@ -33,7 +33,7 @@ export function getNeHost(hostId: string | number) { export function addNeHost(data: Record) { return request({ url: '/ne/host', - method: 'post', + method: 'POST', data: data, }); } @@ -46,7 +46,7 @@ export function addNeHost(data: Record) { export function updateNeHost(data: Record) { return request({ url: '/ne/host', - method: 'put', + method: 'PUT', data: data, }); } @@ -59,7 +59,7 @@ export function updateNeHost(data: Record) { export function delNeHost(hostId: string | number) { return request({ url: `/ne/host/${hostId}`, - method: 'delete', + method: 'DELETE', }); } @@ -71,7 +71,7 @@ export function delNeHost(hostId: string | number) { export function testNeHost(data: Record) { return request({ url: '/ne/host/test', - method: 'post', + method: 'POST', data: data, }); } @@ -84,7 +84,7 @@ export function testNeHost(data: Record) { export function neHostCheckInfo(data: Record) { return request({ url: '/ne/host/checkBySSH', - method: 'post', + method: 'POST', data: data, }); } @@ -97,7 +97,7 @@ export function neHostCheckInfo(data: Record) { export function neHostAuthorizedRSA(data: Record) { return request({ url: '/ne/host/authorizedBySSH', - method: 'post', + method: 'POST', data: data, }); } diff --git a/src/api/ne/neHostCmd.ts b/src/api/ne/neHostCmd.ts index a7e57279..1879a9d5 100644 --- a/src/api/ne/neHostCmd.ts +++ b/src/api/ne/neHostCmd.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeHostCmd(query: Record) { return request({ url: '/ne/hostCmd/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listNeHostCmd(query: Record) { export function getNeHostCmd(cmdId: string | number) { return request({ url: `/ne/hostCmd/${cmdId}`, - method: 'get', + method: 'GET', }); } @@ -33,7 +33,7 @@ export function getNeHostCmd(cmdId: string | number) { export function addNeHostCmd(data: Record) { return request({ url: '/ne/hostCmd', - method: 'post', + method: 'POST', data: data, }); } @@ -46,7 +46,7 @@ export function addNeHostCmd(data: Record) { export function updateNeHostCmd(data: Record) { return request({ url: '/ne/hostCmd', - method: 'put', + method: 'PUT', data: data, }); } @@ -59,6 +59,6 @@ export function updateNeHostCmd(data: Record) { export function delNeHostCmd(cmdId: string | number) { return request({ url: `/ne/hostCmd/${cmdId}`, - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/ne/neInfo.ts b/src/api/ne/neInfo.ts index 013443c3..80022fe3 100644 --- a/src/api/ne/neInfo.ts +++ b/src/api/ne/neInfo.ts @@ -10,7 +10,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeInfo(query: Record) { return request({ url: '/ne/info/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -24,7 +24,7 @@ export function listNeInfo(query: Record) { export function getNeInfo(infoId: string | number) { return request({ url: `/ne/info/${infoId}`, - method: 'get', + method: 'GET', }); } @@ -36,7 +36,7 @@ export function getNeInfo(infoId: string | number) { export function addNeInfo(data: Record) { return request({ url: `/ne/info`, - method: 'post', + method: 'POST', data: data, crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', timeout: 30_000, @@ -51,7 +51,7 @@ export function addNeInfo(data: Record) { export function updateNeInfo(data: Record) { return request({ url: `/ne/info`, - method: 'put', + method: 'PUT', data: data, crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', timeout: 30_000, @@ -66,7 +66,7 @@ export function updateNeInfo(data: Record) { export function delNeInfo(infoIds: string | number) { return request({ url: `/ne/info/${infoIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -79,7 +79,7 @@ export function delNeInfo(infoIds: string | number) { export function listAllNeInfo(query: Record) { return request({ url: '/ne/info/listAll', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -94,7 +94,7 @@ export function listAllNeInfo(query: Record) { export function stateNeInfo(neType: string, neId: string) { return request({ url: '/ne/info/state', - method: 'get', + method: 'GET', params: { neType, neId }, }); } @@ -108,7 +108,7 @@ export function stateNeInfo(neType: string, neId: string) { export function getNeInfoByTypeAndID(neType: string, neId: string) { return request({ url: '/ne/info/byTypeAndID', - method: 'get', + method: 'GET', params: { neType, neId }, }); } @@ -122,7 +122,7 @@ export function getNeInfoByTypeAndID(neType: string, neId: string) { export function getOAMFile(neType: string, neId: string) { return request({ url: '/ne/info/oamFile', - method: 'get', + method: 'GET', params: { neType, neId }, }); } @@ -138,7 +138,7 @@ export function getOAMFile(neType: string, neId: string) { export function saveOAMFile(data: Record) { return request({ url: `/ne/info/oamFile`, - method: 'put', + method: 'PUT', data: data, timeout: 60_000, }); @@ -151,7 +151,7 @@ export function saveOAMFile(data: Record) { export function getPara5GFilee() { return request({ url: '/ne/info/para5GFile', - method: 'get', + method: 'GET', }); } @@ -164,7 +164,7 @@ export function getPara5GFilee() { export function savePara5GFile(data: Record) { return request({ url: `/ne/info/para5GFile`, - method: 'put', + method: 'PUT', data: data, timeout: 60_000, }); @@ -178,7 +178,7 @@ export function savePara5GFile(data: Record) { export function serviceNeAction(data: Record) { return request({ url: `/ne/action/service`, - method: 'put', + method: 'PUT', data: data, timeout: 60_000, }); diff --git a/src/api/ne/neLicense.ts b/src/api/ne/neLicense.ts index 38277c07..1fd43f69 100644 --- a/src/api/ne/neLicense.ts +++ b/src/api/ne/neLicense.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeLicense(query: Record) { return request({ url: '/ne/license/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listNeLicense(query: Record) { export function getNeLicense(licenseId: string | number) { return request({ url: `/ne/license/${licenseId}`, - method: 'get', + method: 'GET', }); } @@ -35,7 +35,7 @@ export function getNeLicense(licenseId: string | number) { export function getNeLicenseByTypeAndID(neType: string, neId: string) { return request({ url: `/ne/license/byTypeAndID`, - method: 'get', + method: 'GET', params: { neType, neId }, }); } @@ -49,7 +49,7 @@ export function getNeLicenseByTypeAndID(neType: string, neId: string) { export function codeNeLicense(neType: string, neId: string) { return request({ url: `/ne/license/code`, - method: 'get', + method: 'GET', params: { neType, neId }, }); } @@ -62,7 +62,7 @@ export function codeNeLicense(neType: string, neId: string) { export function changeNeLicense(data: Record) { return request({ url: `/ne/license/change`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); @@ -77,7 +77,7 @@ export function changeNeLicense(data: Record) { export function stateNeLicense(neType: string, neId: string) { return request({ url: `/ne/license/state`, - method: 'get', + method: 'GET', params: { neType, neId }, }); } diff --git a/src/api/ne/neSoftware.ts b/src/api/ne/neSoftware.ts index 7d2255ed..bf773c18 100644 --- a/src/api/ne/neSoftware.ts +++ b/src/api/ne/neSoftware.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeSoftware(query: Record) { return request({ url: '/ne/software/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listNeSoftware(query: Record) { export function getNeSoftware(softwareId: string | number) { return request({ url: `/ne/software/${softwareId}`, - method: 'get', + method: 'GET', }); } @@ -34,7 +34,7 @@ export function getNeSoftware(softwareId: string | number) { export function addNeSoftware(data: Record) { return request({ url: `/ne/software`, - method: 'post', + method: 'POST', data: data, repeatSubmit: false, }); @@ -48,7 +48,7 @@ export function addNeSoftware(data: Record) { export function updateNeSoftware(data: Record) { return request({ url: `/ne/software`, - method: 'put', + method: 'PUT', data: data, }); } @@ -61,7 +61,7 @@ export function updateNeSoftware(data: Record) { export function delNeSoftware(softwareIds: string | number) { return request({ url: `/ne/software/${softwareIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -74,7 +74,7 @@ export function delNeSoftware(softwareIds: string | number) { export function newNeVersion(data: Record) { return request({ url: `/ne/software/newNeVersion`, - method: 'post', + method: 'POST', data: data, }); } diff --git a/src/api/ne/neVersion.ts b/src/api/ne/neVersion.ts index 629781ed..0075a29c 100644 --- a/src/api/ne/neVersion.ts +++ b/src/api/ne/neVersion.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeVersion(query: Record) { return request({ url: '/ne/version/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listNeVersion(query: Record) { export function getNeVersion(versionId: string | number) { return request({ url: `/ne/version/${versionId}`, - method: 'get', + method: 'GET', }); } @@ -34,7 +34,7 @@ export function getNeVersion(versionId: string | number) { export function operateNeVersion(data: Record) { return request({ url: `/ne/version/operate`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); diff --git a/src/api/neData/amf.ts b/src/api/neData/amf.ts index fd5d57f4..77895799 100644 --- a/src/api/neData/amf.ts +++ b/src/api/neData/amf.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listAMFDataUE(query: Record) { return request({ url: '/neData/amf/ue/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listAMFDataUE(query: Record) { export function delAMFDataUE(ueIds: string | number) { return request({ url: `/neData/amf/ue/${ueIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,7 +35,7 @@ export function delAMFDataUE(ueIds: string | number) { export function exportAMFDataUE(data: Record) { return request({ url: '/neData/amf/ue/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, @@ -50,7 +50,7 @@ export function exportAMFDataUE(data: Record) { export function listAMFNblist(query: Record) { return request({ url: '/neData/amf/nb/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -64,7 +64,7 @@ export function listAMFNblist(query: Record) { export function listAMFNbStatelist(query: Record) { return request({ url: '/neData/amf/nb/list-cfg', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -79,7 +79,7 @@ export function listAMFNbStatelist(query: Record) { export function addAMFNbState(neId: string, data: Record) { return request({ url: `/ne/config/data`, - method: 'post', + method: 'POST', data: { neType: 'AMF', neId: neId, @@ -99,7 +99,7 @@ export function addAMFNbState(neId: string, data: Record) { export function editAMFNbState(neId: string, data: Record) { return request({ url: `/ne/config/data`, - method: 'put', + method: 'PUT', data: { neType: 'AMF', neId: neId, @@ -119,7 +119,7 @@ export function editAMFNbState(neId: string, data: Record) { export function delAMFNbState(neId: string, index: string | number) { return request({ url: `/ne/config/data`, - method: 'delete', + method: 'DELETE', params: { neType: 'AMF', neId: neId, diff --git a/src/api/neData/ims.ts b/src/api/neData/ims.ts index a0e53cb0..b56486a5 100644 --- a/src/api/neData/ims.ts +++ b/src/api/neData/ims.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listIMSDataCDR(query: Record) { return request({ url: '/neData/ims/cdr/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listIMSDataCDR(query: Record) { export function delIMSDataCDR(cdrIds: string | number) { return request({ url: `/neData/ims/cdr/${cdrIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,9 +35,35 @@ export function delIMSDataCDR(cdrIds: string | number) { export function exportIMSDataCDR(data: Record) { return request({ url: '/neData/ims/cdr/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, }); } + +/** + * SMF-在线订阅用户数量 + * @param query 查询参数 + * @returns object + */ +export function listIMSSessionNum(neId: string) { + return request({ + url: '/neData/ims/session/num', + method: 'GET', + params: { neId }, + }); +} + +/** + * IMS-在线会话用户列表信息 + * @param query 查询参数 {neId, imsi, msisdn} + * @returns objectv + */ +export function listIMSSessionList(query: Record) { + return request({ + url: '/neData/ims/session/list', + method: 'GET', + params: query, + }); +} diff --git a/src/api/neData/mme.ts b/src/api/neData/mme.ts index 4219eed7..6b1bbe3b 100644 --- a/src/api/neData/mme.ts +++ b/src/api/neData/mme.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listMMEDataUE(query: Record) { return request({ url: '/neData/mme/ue/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listMMEDataUE(query: Record) { export function delMMEDataUE(ueIds: string | number) { return request({ url: `/neData/mme/ue/${ueIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,7 +35,7 @@ export function delMMEDataUE(ueIds: string | number) { export function exportMMEDataUE(data: Record) { return request({ url: '/neData/mme/ue/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, @@ -50,7 +50,7 @@ export function exportMMEDataUE(data: Record) { export function listMMENblist(query: Record) { return request({ url: '/neData/mme/nb/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -64,7 +64,7 @@ export function listMMENblist(query: Record) { export function listMMENbStatelist(query: Record) { return request({ url: '/neData/mme/nb/list-cfg', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -79,7 +79,7 @@ export function listMMENbStatelist(query: Record) { export function addMMENbState(neId: string, data: Record) { return request({ url: `/ne/config/data`, - method: 'post', + method: 'POST', data: { neType: 'MME', neId: neId, @@ -99,7 +99,7 @@ export function addMMENbState(neId: string, data: Record) { export function editMMENbState(neId: string, data: Record) { return request({ url: `/ne/config/data`, - method: 'put', + method: 'PUT', data: { neType: 'MME', neId: neId, @@ -119,7 +119,7 @@ export function editMMENbState(neId: string, data: Record) { export function delMMENbState(neId: string, index: string | number) { return request({ url: `/ne/config/data`, - method: 'delete', + method: 'DELETE', params: { neType: 'MME', neId: neId, diff --git a/src/api/neData/nb-state.ts b/src/api/neData/nb-state.ts index a5f9f91d..bb62e9ad 100644 --- a/src/api/neData/nb-state.ts +++ b/src/api/neData/nb-state.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNBState(query: Record) { return request({ url: '/neData/nb-state/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listNBState(query: Record) { export function exportNBState(data: Record) { return request({ url: '/neData/nb-state/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, diff --git a/src/api/neData/sgwc.ts b/src/api/neData/sgwc.ts index b7a0a498..1cb3853f 100644 --- a/src/api/neData/sgwc.ts +++ b/src/api/neData/sgwc.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listSGWCDataCDR(query: Record) { return request({ url: '/neData/sgwc/cdr/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listSGWCDataCDR(query: Record) { export function delSGWCDataCDR(cdrIds: string | number) { return request({ url: `/neData/sgwc/cdr/${cdrIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,7 +35,7 @@ export function delSGWCDataCDR(cdrIds: string | number) { export function exportSGWCDataCDR(data: Record) { return request({ url: '/neData/sgwc/cdr/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, diff --git a/src/api/neData/smf.ts b/src/api/neData/smf.ts index 05050abc..9b87a10f 100644 --- a/src/api/neData/smf.ts +++ b/src/api/neData/smf.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listSMFDataCDR(query: Record) { return request({ url: '/neData/smf/cdr/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listSMFDataCDR(query: Record) { export function delSMFDataCDR(cdrIds: string | number) { return request({ url: `/neData/smf/cdr/${cdrIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,7 +35,7 @@ export function delSMFDataCDR(cdrIds: string | number) { export function exportSMFDataCDR(data: Record) { return request({ url: '/neData/smf/cdr/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, @@ -50,20 +50,20 @@ export function exportSMFDataCDR(data: Record) { export function listSMFSubNum(neId: string) { return request({ url: '/neData/smf/sub/num', - method: 'get', + method: 'GET', params: { neId }, }); } /** * SMF-在线订阅用户列表信息 - * @param query 查询参数 + * @param query 查询参数 {neId, pageNum, imsi, msisdn, upstate} * @returns object */ export function listSMFSubList(query: Record) { return request({ url: '/neData/smf/sub/list', - method: 'get', + method: 'GET', params: query, }); } diff --git a/src/api/neData/smsc.ts b/src/api/neData/smsc.ts index 501c7446..bcbe6545 100644 --- a/src/api/neData/smsc.ts +++ b/src/api/neData/smsc.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listSMSCDataCDR(query: Record) { return request({ url: '/neData/smsc/cdr/list', - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -22,7 +22,7 @@ export function listSMSCDataCDR(query: Record) { export function delSMSCDataCDR(cdrIds: string | number) { return request({ url: `/neData/smsc/cdr/${cdrIds}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -35,7 +35,7 @@ export function delSMSCDataCDR(cdrIds: string | number) { export function exportSMSCDataCDR(data: Record) { return request({ url: '/neData/smsc/cdr/export', - method: 'post', + method: 'POST', data, responseType: 'blob', timeout: 60_000, diff --git a/src/api/neData/udm_auth.ts b/src/api/neData/udm_auth.ts index 17faa266..1f20dd42 100644 --- a/src/api/neData/udm_auth.ts +++ b/src/api/neData/udm_auth.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function resetUDMAuth(neId: string) { return request({ url: `/neData/udm/auth/resetData/${neId}`, - method: 'put', + method: 'PUT', timeout: 180_000, }); } @@ -21,7 +21,7 @@ export function resetUDMAuth(neId: string) { export function listUDMAuth(query: Record) { return request({ url: '/neData/udm/auth/list', - method: 'get', + method: 'GET', params: query, timeout: 30_000, }); @@ -36,7 +36,7 @@ export function listUDMAuth(query: Record) { export function getUDMAuth(neId: string, imsi: string) { return request({ url: `/neData/udm/auth/${neId}/${imsi}`, - method: 'get', + method: 'GET', }); } @@ -48,7 +48,7 @@ export function getUDMAuth(neId: string, imsi: string) { export function addUDMAuth(data: Record) { return request({ url: `/neData/udm/auth/${data.neId}`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); @@ -63,7 +63,7 @@ export function addUDMAuth(data: Record) { export function batchAddUDMAuth(data: Record, num: number) { return request({ url: `/neData/udm/auth/${data.neId}/${num}`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); @@ -77,7 +77,7 @@ export function batchAddUDMAuth(data: Record, num: number) { export function updateUDMAuth(data: Record) { return request({ url: `/neData/udm/auth/${data.neId}`, - method: 'put', + method: 'PUT', data: data, timeout: 180_000, }); @@ -92,7 +92,7 @@ export function updateUDMAuth(data: Record) { export function delUDMAuth(neId: string, imsi: string) { return request({ url: `/neData/udm/auth/${neId}/${imsi}`, - method: 'delete', + method: 'DELETE', timeout: 180_000, }); } @@ -107,7 +107,7 @@ export function delUDMAuth(neId: string, imsi: string) { export function batchDelUDMAuth(neId: string, imsi: string, num: number) { return request({ url: `/neData/udm/auth/${neId}/${imsi}/${num}`, - method: 'delete', + method: 'DELETE', timeout: 180_000, }); } @@ -120,7 +120,7 @@ export function batchDelUDMAuth(neId: string, imsi: string, num: number) { export function importUDMAuth(data: Record) { return request({ url: `/neData/udm/auth/import`, - method: 'post', + method: 'POST', data, timeout: 180_000, }); @@ -134,8 +134,8 @@ export function importUDMAuth(data: Record) { export function exportUDMAuth(data: Record) { return request({ url: '/neData/udm/auth/export', - method: 'post', - data, + method: 'GET', + params: data, responseType: 'blob', timeout: 180_000, }); diff --git a/src/api/neData/udm_sub.ts b/src/api/neData/udm_sub.ts index 9f1500b5..e3fee046 100644 --- a/src/api/neData/udm_sub.ts +++ b/src/api/neData/udm_sub.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function resetUDMSub(neId: string) { return request({ url: `/neData/udm/sub/resetData/${neId}`, - method: 'put', + method: 'PUT', timeout: 180_000, }); } @@ -21,7 +21,7 @@ export function resetUDMSub(neId: string) { export function listUDMSub(query: Record) { return request({ url: '/neData/udm/sub/list', - method: 'get', + method: 'GET', params: query, timeout: 30_000, }); @@ -36,7 +36,7 @@ export function listUDMSub(query: Record) { export function getUDMSub(neId: string, imsi: string) { return request({ url: `/neData/udm/sub/${neId}/${imsi}`, - method: 'get', + method: 'GET', }); } @@ -48,7 +48,7 @@ export function getUDMSub(neId: string, imsi: string) { export function addUDMSub(data: Record) { return request({ url: `/neData/udm/sub/${data.neId}`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); @@ -63,7 +63,7 @@ export function addUDMSub(data: Record) { export function batchAddUDMSub(data: Record, num: number) { return request({ url: `/neData/udm/sub/${data.neId}/${num}`, - method: 'post', + method: 'POST', data: data, timeout: 180_000, }); @@ -77,7 +77,7 @@ export function batchAddUDMSub(data: Record, num: number) { export function updateUDMSub(data: Record) { return request({ url: `/neData/udm/sub/${data.neId}`, - method: 'put', + method: 'PUT', data: data, timeout: 180_000, }); @@ -91,7 +91,7 @@ export function updateUDMSub(data: Record) { export function delUDMSub(neId: string, imsi: string) { return request({ url: `/neData/udm/sub/${neId}/${imsi}`, - method: 'delete', + method: 'DELETE', timeout: 180_000, }); } @@ -106,7 +106,7 @@ export function delUDMSub(neId: string, imsi: string) { export function batchDelUDMSub(neId: string, imsi: string, num: number) { return request({ url: `/neData/udm/sub/${neId}/${imsi}/${num}`, - method: 'delete', + method: 'DELETE', timeout: 180_000, }); } @@ -119,8 +119,8 @@ export function batchDelUDMSub(neId: string, imsi: string, num: number) { export function exportUDMSub(data: Record) { return request({ url: '/neData/udm/sub/export', - method: 'post', - data, + method: 'GET', + params: data, responseType: 'blob', timeout: 180_000, }); @@ -134,7 +134,7 @@ export function exportUDMSub(data: Record) { export function importUDMSub(data: Record) { return request({ url: `/neData/udm/sub/import`, - method: 'post', + method: 'POST', data, timeout: 180_000, }); diff --git a/src/api/neUser/base5G.ts b/src/api/neUser/base5G.ts deleted file mode 100644 index 2621ed53..00000000 --- a/src/api/neUser/base5G.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; - -/** - * 查询列表 - * @param query 查询参数 - * @returns object - */ -export async function listBase5G(query: Record) { - const result = await request({ - url: `/api/rest/ueManagement/v1/elementType/${query.neType.toLowerCase()}/objectType/nbInfo`, - method: 'get', - params: query, - }); - let data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { - const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; - } - - // 模拟数据 - // data.rows = [{"address":"192.168.1.137:38412","id":"217","name":"attach-enb-100000-20","ueNum":0}] - // data.rows = [{address: "192.168.8.223", id: 257, name: "SmallCell", ueNum: 0}] - - return data; -} diff --git a/src/api/neUser/ims.ts b/src/api/neUser/ims.ts index 0ead4388..4f380381 100644 --- a/src/api/neUser/ims.ts +++ b/src/api/neUser/ims.ts @@ -11,20 +11,19 @@ export async function listUEInfoByIMS(query: Record) { query.nbId = query.id; const result = await request({ url: '/api/rest/ueManagement/v1/elementType/ims/objectType/ueInfo', - method: 'get', + method: 'GET', params: query, }); - let data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; // 解析数据 if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; + data.data.total = rows.length; + data.data.rows = rows; } // 测试数据 @@ -49,7 +48,7 @@ export async function listUEInfoByIMS(query: Record) { export async function listUENumByIMS(neId: String) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/ims/objectType/ueNum?neId=${neId}`, - method: 'get', + method: 'GET', }); if (result.code === RESULT_CODE_SUCCESS) { let num = result.data['ueNum'] || 0; diff --git a/src/api/neUser/n3iwf.ts b/src/api/neUser/n3iwf.ts index 9b68a157..3e2c4ece 100644 --- a/src/api/neUser/n3iwf.ts +++ b/src/api/neUser/n3iwf.ts @@ -10,20 +10,19 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; export async function listN3iwf(query: Record) { const result = await request({ url: '/api/rest/ueManagement/v1/elementType/n3iwf/objectType/ueInfo', - method: 'get', + method: 'GET', params: query, }); - let data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; // 解析数据 if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; + data.data.total = rows.length; + data.data.rows = rows; } // 模拟数据 // data.rows = [ diff --git a/src/api/neUser/nssf.ts b/src/api/neUser/nssf.ts index 04fa6426..817c7361 100644 --- a/src/api/neUser/nssf.ts +++ b/src/api/neUser/nssf.ts @@ -9,19 +9,18 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; export async function listNSSF() { const result = await request({ url: '/api/rest/ueManagement/v1/elementType/nssf/objectType/subscriptions', - method: 'get', + method: 'GET', }); - let data: DataList = { - total: 0, - rows: [], + let data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; // 解析数据 if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; + data.data.total = rows.length; + data.data.rows = rows; } return data; } diff --git a/src/api/neUser/nssfAmf.ts b/src/api/neUser/nssfAmf.ts index b2ae5bc1..edf06582 100644 --- a/src/api/neUser/nssfAmf.ts +++ b/src/api/neUser/nssfAmf.ts @@ -9,19 +9,18 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; export async function listNSSFAMF() { const result = await request({ url: '/api/rest/ueManagement/v1/elementType/nssf/objectType/availableAMFs', - method: 'get', + method: 'GET', }); - let data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; // 解析数据 if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; + data.data.total = rows.length; + data.data.rows = rows; } // let testData = { @@ -39,6 +38,6 @@ export async function listNSSFAMF() { // code: 1, // msg:'', // }; - //return testData; + //return testData; return data; } diff --git a/src/api/neUser/pcf.ts b/src/api/neUser/pcf.ts index 32214aa3..2495c373 100644 --- a/src/api/neUser/pcf.ts +++ b/src/api/neUser/pcf.ts @@ -13,7 +13,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; export function exportRule(data: Record) { return request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/file/export`, - method: 'get', + method: 'GET', params: data, responseType: 'blob', timeout: 180_000, @@ -28,7 +28,7 @@ export function exportRule(data: Record) { export function importRuleData(data: Record) { return request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/file/import?neId=${data.neId}&filePath=${data.filePath}&fileType=${data.fileType}`, - method: 'put', + method: 'PUT', data, timeout: 60_000, }); @@ -42,12 +42,11 @@ export function importRuleData(data: Record) { export async function listRules(query: Record) { const result = await request({ url: '/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo', - method: 'get', + method: 'GET', params: query, }); - let data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] } as any, code: result.code, msg: result.msg, }; @@ -58,13 +57,13 @@ export async function listRules(query: Record) { return { code: RESULT_CODE_ERROR, msg: result.data?.cause, - rows: result.data, + data: result.data, }; } if (Array.isArray(result.data.data)) { const rows = parseObjLineToHump(result.data.data); - data.total = rows.length; - data.rows = rows; + data.data.total = rows.length; + data.data.rows = rows; } } @@ -95,7 +94,7 @@ export async function listRules(query: Record) { export async function getRule(neId: string, imsi: string) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${imsi}`, - method: 'get', + method: 'GET', }); // 解析数据 if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { @@ -112,7 +111,7 @@ export async function getRule(neId: string, imsi: string) { export async function updateRule(data: Record) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`, - method: 'put', + method: 'PUT', data: data, }); // 解析数据 @@ -134,7 +133,7 @@ export async function updateRule(data: Record) { export async function batchUpdateRule(data: Record) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`, - method: 'put', + method: 'PUT', data: data, timeout: 60_000, }); @@ -163,7 +162,7 @@ export async function batchUpdateRule(data: Record) { export async function addRule(data: Record) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`, - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -186,7 +185,7 @@ export async function addRule(data: Record) { export async function batchAddRule(data: Record) { const result = await request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`, - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -215,7 +214,7 @@ export async function batchAddRule(data: Record) { export function delRule(neId: string, imsi: string) { return request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${imsi}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -228,7 +227,7 @@ export function delRule(neId: string, imsi: string) { export async function batchDelRule(data: Record) { return request({ url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}&imsi=${data.imsi}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } diff --git a/src/api/neUser/smf.ts b/src/api/neUser/smf.ts deleted file mode 100644 index 3a848850..00000000 --- a/src/api/neUser/smf.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { request } from '@/plugins/http-fetch'; - -/** - * 查询列表 - * @param query 查询参数 - * @returns object - */ -export async function listUEInfoBySMF(query: Record) { - query.nbId = query.id; - const result = await request({ - url: '/api/rest/ueManagement/v1/elementType/smf/objectType/ueInfo', - method: 'get', - params: query, - }); - let data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data) { - if (Array.isArray(result.data.data)) { - const rows = result.data.data; - data.total = rows.length; - data.rows = rows; - } else { - Object.assign(data, result.data); - } - } - - // 模拟数据 - // data.code = RESULT_CODE_SUCCESS; - // data.total = 2; - // data.rows = [ - // { - // imsi: 'imsi-460000100000090', - // msisdn: 'msisdn-12307550090', - // pduSessionInfo: [ - // { - // activeTime: '2024-06-19 14:35:26', - // dnn: 'ims', - // ipv4: '10.10.48.8', - // ipv6: '', - // pduSessionID: 6, - // ranN3IP: '192.168.1.137', - // sstSD: '1-000001', - // tai: '46000-001124', - // upState: 'Active', - // upfN3IP: '192.168.1.161', - // }, - // { - // activeTime: '2024-06-19 14:35:26', - // dnn: 'cmnet', - // ipv4: '10.10.48.9', - // ipv6: '2001:4860:4860::/64', - // pduSessionID: 7, - // ranN3IP: '192.168.1.137', - // sstSD: '1-000001', - // tai: '46000-001124', - // upState: 'Active', - // upfN3IP: '192.168.1.161', - // }, - // ], - // ratType: 'NR', - // }, - // { - // imsi: 'imsi-460602072701180', - // msisdn: 'msisdn-123460600080', - // pduSessionInfo: [ - // { - // activeTime: '2024-06-19 14:31:09', - // dnn: 'cmnet', - // ipv4: '10.10.48.4', - // ipv6: '', - // pduSessionID: 5, - // ranN3IP: '192.168.8.223', - // sstSD: '1-000001', - // tai: '46060-0001', - // upState: 'Active', - // upfN3IP: '192.168.1.161', - // }, - // ], - // ratType: 'EUTRAN', - // }, - // ]; - return data; -} - -/** - * 首页查询SMF在线用户数 - * @param query 查询参数 - * @returns neId - */ -export async function listUENumBySMF(neId: String) { - const result = await request({ - url: `/api/rest/ueManagement/v1/elementType/smf/objectType/ueNum?neId=${neId}`, - method: 'get', - }); - if (result.code === RESULT_CODE_SUCCESS) { - return Object.assign(result, { - data: result.data.data['ueNum'], - }); - } - - // 模拟数据 - // { "data": { "ueNum": 0 } } - // result.data = 0 - return result; -} diff --git a/src/api/perfManage/customData.ts b/src/api/perfManage/customData.ts index 802b32bc..d398044b 100644 --- a/src/api/perfManage/customData.ts +++ b/src/api/perfManage/customData.ts @@ -9,7 +9,7 @@ export async function listCustomData(query: Record) { // 发起请求 const result = await request({ url: `/pm/kpiC/report`, - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); diff --git a/src/api/perfManage/customTarget.ts b/src/api/perfManage/customTarget.ts index ac3b9ab6..be5c6d05 100644 --- a/src/api/perfManage/customTarget.ts +++ b/src/api/perfManage/customTarget.ts @@ -1,66 +1,4 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; -import { parseDateToStr } from '@/utils/date-utils'; - -/** - * 查询自定义指标 - * @param query 查询参数 - * @returns object - */ -// export async function listCustom(query: Record) { -// let totalSQL = 'select count(*) as total from pm_custom_title where 1=1 '; -// let rowsSQL = 'select * from pm_custom_title where 1=1 '; - -// // 查询 -// let querySQL = ''; -// if (query.neType) { -// querySQL += ` and ne_type like '%${query.neType}%' `; -// } - -// // 排序 -// let sortSql = ' order by update_time '; -// if (query.sortOrder === 'asc') { -// sortSql += ' asc '; -// } else { -// sortSql += ' desc '; -// } -// // 分页 -// const pageNum = (query.pageNum - 1) * query.pageSize; -// const limtSql = ` limit ${pageNum},${query.pageSize} `; - -// // 发起请求 -// const result = await request({ -// url: `/api/rest/databaseManagement/v1/select/omc_db/pm_custom_title`, -// method: 'get', -// params: { -// totalSQL: totalSQL + querySQL, -// rowsSQL: rowsSQL + querySQL + sortSql + limtSql, -// }, -// }); - -// // 解析数据 -// if (result.code === RESULT_CODE_SUCCESS) { -// const data: DataList = { -// total: 0, -// rows: [], -// code: result.code, -// msg: result.msg, -// }; -// result.data.data.forEach((item: any) => { -// const itemData = item['pm_custom_title']; -// if (Array.isArray(itemData)) { -// if (itemData.length === 1 && itemData[0]['total'] >= 0) { -// data.total = itemData[0]['total']; -// } else { -// data.rows = itemData.map(v => parseObjLineToHump(v)); -// } -// } -// }); -// return data; -// } -// return result; -// } /** * 新 查询自定义指标 @@ -71,7 +9,7 @@ export async function listCustom(query?: Record) { // 发起请求 const result = await request({ url: `/pm/kpiC/title/totalList`, - method: 'get', + method: 'GET', params: query, }); return result; @@ -85,7 +23,7 @@ export async function listCustom(query?: Record) { export async function getCustom(id: string | number) { return request({ url: `/pm/kpiC/title/${id}`, - method: 'get', + method: 'GET', }); } @@ -97,7 +35,7 @@ export async function getCustom(id: string | number) { export function addCustom(data: Record) { return request({ url: `/pm/kpiC/title`, - method: 'post', + method: 'POST', data: data, }); } @@ -110,7 +48,7 @@ export function addCustom(data: Record) { export function updateCustom(data: Record) { return request({ url: `/pm/kpiC/title/${data.id}`, - method: 'put', + method: 'PUT', data: data, }); } @@ -122,6 +60,6 @@ export function updateCustom(data: Record) { export async function delCustom(data: Record) { return request({ url: `/pm/kpiC/title/${data.id}`, - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/perfManage/goldTarget.ts b/src/api/perfManage/goldTarget.ts index 3ecf5af9..e43d80f1 100644 --- a/src/api/perfManage/goldTarget.ts +++ b/src/api/perfManage/goldTarget.ts @@ -46,7 +46,7 @@ export async function listgoldData(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/gold_kpi`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -56,9 +56,8 @@ export async function listgoldData(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -66,9 +65,9 @@ export async function listgoldData(query: Record) { const itemData = item['gold_kpi']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -85,7 +84,7 @@ export async function listgoldData(query: Record) { export async function listKPIData(query: Record) { const result = await request({ url: `/neData/kpi/data`, - method: 'get', + method: 'GET', params: query, timeout: 60_000, }); @@ -102,7 +101,7 @@ export async function getKPITitle(neType: string) { // 发起请求 const result = await request({ url: `/neData/kpi/title`, - method: 'get', + method: 'GET', params: { neType }, }); // 解析数据// @@ -125,7 +124,7 @@ export async function listUPFData(timeArr: any) { // 获取参数规则 request({ url: `/api/rest/databaseManagement/v1/select/omc_db/gold_kpi`, - method: 'get', + method: 'GET', params: { SQL: `SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 and gold_kpi.kpi_id ='UPF.03' AND timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 10 MINUTE) AND NOW()`, }, @@ -134,7 +133,7 @@ export async function listUPFData(timeArr: any) { // 获取对应信息 request({ url: `/api/rest/databaseManagement/v1/select/omc_db/gold_kpi`, - method: 'get', + method: 'GET', params: { SQL: `SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 and gold_kpi.kpi_id ='UPF.06' AND timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 10 MINUTE) AND NOW()`, }, diff --git a/src/api/perfManage/perfData.ts b/src/api/perfManage/perfData.ts index 92e84f58..8a9d6b3c 100644 --- a/src/api/perfManage/perfData.ts +++ b/src/api/perfManage/perfData.ts @@ -30,10 +30,10 @@ export async function listperfData(query: Record) { let sortSql = ' order by '; if (query.sortField) { sortSql += ` ${query.sortField} `; - }else{ + } else { sortSql += ` start_time `; } - + if (query.sortOrder === 'asc') { sortSql += ' asc '; } else { @@ -47,7 +47,7 @@ export async function listperfData(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/measure_data`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -56,9 +56,8 @@ export async function listperfData(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -66,9 +65,9 @@ export async function listperfData(query: Record) { const itemData = item['measure_data']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); diff --git a/src/api/perfManage/perfThreshold.ts b/src/api/perfManage/perfThreshold.ts index d884a049..355b0269 100644 --- a/src/api/perfManage/perfThreshold.ts +++ b/src/api/perfManage/perfThreshold.ts @@ -32,7 +32,7 @@ export async function listPerfThreshold(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/measure_threshold`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql + limtSql, @@ -41,9 +41,8 @@ export async function listPerfThreshold(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -51,9 +50,9 @@ export async function listPerfThreshold(query: Record) { const itemData = item['measure_threshold']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -71,7 +70,7 @@ export async function getPerfThre(id: string | number) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/measure_threshold`, - method: 'get', + method: 'GET', params: { SQL: `select * from measure_threshold where id = ${id}`, }, @@ -102,7 +101,7 @@ export function addPerfThre(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_threshold`, - method: 'post', + method: 'POST', data: { measure_threshold: [obj] }, }); } @@ -122,7 +121,7 @@ export function updatePerfThre(data: Record) { }; return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_threshold?WHERE=id=${data.id}`, - method: 'put', + method: 'PUT', data: { measure_threshold: obj }, }); } @@ -135,7 +134,7 @@ export function updatePerfThre(data: Record) { export async function delPerfThre(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_threshold?WHERE=id=${data.id}`, - method: 'delete', + method: 'DELETE', }); } @@ -147,7 +146,7 @@ export async function getNePerformanceList() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/measure_title`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM measure_title`, }, @@ -170,7 +169,7 @@ export async function getNePerformanceList() { export function threRun(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_threshold?WHERE=id=${data.id}`, - method: 'put', + method: 'PUT', data: { data: { status: 'Active' } }, }); } @@ -183,7 +182,7 @@ export function threRun(data: Record) { export function threStop(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_threshold?WHERE=id=${data.id}`, - method: 'put', + method: 'PUT', data: { data: { status: 'Inactive' } }, }); } diff --git a/src/api/perfManage/taskManage.ts b/src/api/perfManage/taskManage.ts index cd62139e..bcd32b47 100644 --- a/src/api/perfManage/taskManage.ts +++ b/src/api/perfManage/taskManage.ts @@ -32,7 +32,7 @@ export async function listPerfTask(query: Record) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/measure_task`, - method: 'get', + method: 'GET', params: { totalSQL: totalSQL + querySQL, rowsSQL: rowsSQL + querySQL + sortSql+ limtSql, @@ -41,9 +41,8 @@ export async function listPerfTask(query: Record) { // 解析数据 if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], + const data = { + data: { total: 0, rows: [] as any }, code: result.code, msg: result.msg, }; @@ -51,9 +50,9 @@ export async function listPerfTask(query: Record) { const itemData = item['measure_task']; if (Array.isArray(itemData)) { if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; + data.data.total = itemData[0]['total']; } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); + data.data.rows = itemData.map(v => parseObjLineToHump(v)); } } }); @@ -71,7 +70,7 @@ export async function getPerfTask(id: string | number) { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/select/omc_db/measure_task`, - method: 'get', + method: 'GET', params: { SQL: `select * from measure_task where id = ${id}`, }, @@ -120,7 +119,7 @@ export function addPerfTask(data: Record) { return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_task`, - method: 'post', + method: 'POST', data: { measure_task: [obj] }, }); } @@ -158,7 +157,7 @@ export function updatePerfTask(data: Record) { }; return request({ url: `/api/rest/databaseManagement/v1/omc_db/measure_task?WHERE=id=${data.id}`, - method: 'put', + method: 'PUT', data: { measure_task: obj }, }); } @@ -173,7 +172,7 @@ export async function delPerfTask(data: Record) { url: `/api/rest/performanceManagement/v1/elementType/${data.neType.toLowerCase()}/objectType/measureTask?id=${ data.id }`, - method: 'delete', + method: 'DELETE', }); } @@ -185,7 +184,7 @@ export async function getNePerformanceList() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/measure_title`, - method: 'get', + method: 'GET', params: { SQL: `SELECT * FROM measure_title`, }, @@ -209,7 +208,7 @@ export async function getNePerformanceList() { export function taskRun(data: Record) { return request({ url: `/api/rest/performanceManagement/v1/elementType/${data.neType.toLowerCase()}/objectType/measureTask?id=${data.id}`, - method: 'post', + method: 'POST', }); } diff --git a/src/api/profile.ts b/src/api/profile.ts index be793283..63295ed3 100644 --- a/src/api/profile.ts +++ b/src/api/profile.ts @@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch'; export function getUserProfile() { return request({ url: '/system/user/profile', - method: 'get', + method: 'GET', }); } @@ -19,38 +19,21 @@ export function getUserProfile() { export function updateUserProfile(data: Record) { return request({ url: '/system/user/profile', - method: 'put', + method: 'PUT', data: data, }); } /** - * 用户密码重置 - * @param userId 用户ID - * @param status 变更状态值 + * 用户个人密码重置 + * @param oldPassword 旧密码 + * @param newPassword 新密码 * @returns object */ -export function updateUserPwd(oldPassword: string, newPassword: string) { +export function updateUserPassword(oldPassword: string, newPassword: string) { return request({ - url: '/system/user/profile/updatePwd', - method: 'put', - data: { - oldPassword, - newPassword, - }, - }); -} - -/** - * 用户头像上传 - * @param data 表单数据对象 - * @returns object - */ -export function uploadAvatar(data: FormData) { - return request({ - url: '/system/user/profile/avatar', - method: 'post', - data, - dataType: 'form-data', + url: '/system/user/profile/password', + method: 'PUT', + data: { oldPassword, newPassword }, }); } diff --git a/src/api/router.ts b/src/api/router.ts index a0b810cf..4846be2b 100644 --- a/src/api/router.ts +++ b/src/api/router.ts @@ -6,7 +6,7 @@ import { request } from '@/plugins/http-fetch'; */ export const getRouters = () => { return request({ - url: '/getRouters', - method: 'get', + url: '/router', + method: 'GET', }); }; diff --git a/src/api/system/config.ts b/src/api/system/config.ts index 027cdd35..31e76589 100644 --- a/src/api/system/config.ts +++ b/src/api/system/config.ts @@ -8,8 +8,8 @@ import { request } from '@/plugins/http-fetch'; export function exportConfig(query: Record) { return request({ url: '/system/config/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -22,7 +22,7 @@ export function exportConfig(query: Record) { export function listConfig(query: Record) { return request({ url: '/system/config/list', - method: 'get', + method: 'GET', params: query, }); } @@ -35,7 +35,7 @@ export function listConfig(query: Record) { export function getConfig(configId: string | number) { return request({ url: `/system/config/${configId}`, - method: 'get', + method: 'GET', }); } @@ -46,8 +46,8 @@ export function getConfig(configId: string | number) { */ export function getConfigKey(configKey: string) { return request({ - url: `/system/config/configKey/${configKey}`, - method: 'get', + url: `/system/config/config-key/${configKey}`, + method: 'GET', }); } @@ -59,7 +59,7 @@ export function getConfigKey(configKey: string) { export function addConfig(data: Record) { return request({ url: '/system/config', - method: 'post', + method: 'POST', data: data, }); } @@ -72,7 +72,7 @@ export function addConfig(data: Record) { export function updateConfig(data: Record) { return request({ url: '/system/config', - method: 'put', + method: 'PUT', data: data, }); } @@ -85,7 +85,7 @@ export function updateConfig(data: Record) { export function delConfig(configId: string | number) { return request({ url: `/system/config/${configId}`, - method: 'delete', + method: 'DELETE', }); } @@ -95,8 +95,8 @@ export function delConfig(configId: string | number) { */ export function refreshCache() { return request({ - url: '/system/config/refreshCache', - method: 'put', + url: '/system/config/refresh', + method: 'PUT', }); } @@ -108,7 +108,7 @@ export function refreshCache() { export function changeValue(data: Record) { return request({ url: '/system/config/changeValue', - method: 'put', + method: 'PUT', data: data, }); } diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 288a16ef..920266a4 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listDept(query: Record) { return request({ url: '/system/dept/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listDept(query: Record) { export function listDeptExcludeChild(deptId: string | number) { return request({ url: `/system/dept/list/exclude/${deptId}`, - method: 'get', + method: 'GET', }); } @@ -33,7 +33,7 @@ export function listDeptExcludeChild(deptId: string | number) { export function getDept(deptId: string | number) { return request({ url: `/system/dept/${deptId}`, - method: 'get', + method: 'GET', }); } @@ -45,7 +45,7 @@ export function getDept(deptId: string | number) { export function addDept(data: Record) { return request({ url: '/system/dept', - method: 'post', + method: 'POST', data: data, }); } @@ -58,7 +58,7 @@ export function addDept(data: Record) { export function updateDept(data: Record) { return request({ url: '/system/dept', - method: 'put', + method: 'PUT', data: data, }); } @@ -71,7 +71,7 @@ export function updateDept(data: Record) { export function delDept(deptId: string | number) { return request({ url: `/system/dept/${deptId}`, - method: 'delete', + method: 'DELETE', }); } @@ -79,10 +79,10 @@ export function delDept(deptId: string | number) { * 查询部门下拉树结构 * @returns object */ -export function deptTreeSelect() { +export function deptTree() { return request({ - url: '/system/dept/treeSelect', - method: 'get', + url: '/system/dept/tree', + method: 'GET', }); } @@ -91,9 +91,9 @@ export function deptTreeSelect() { * @param roleId 角色ID * @returns object */ -export function roleDeptTreeSelect(roleId: string | number) { +export function deptTreeRole(roleId: string | number) { return request({ - url: `/system/dept/roleDeptTreeSelect/${roleId}`, - method: 'get', + url: `/system/dept/tree/role/${roleId}`, + method: 'GET', }); } diff --git a/src/api/system/dict/data.ts b/src/api/system/dict/data.ts index f4fc8df4..4e5ff670 100644 --- a/src/api/system/dict/data.ts +++ b/src/api/system/dict/data.ts @@ -8,8 +8,8 @@ import { request } from '@/plugins/http-fetch'; export function exportData(query: Record) { return request({ url: '/system/dict/data/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -22,20 +22,20 @@ export function exportData(query: Record) { export function listData(query: Record) { return request({ url: '/system/dict/data/list', - method: 'get', + method: 'GET', params: query, }); } /** * 查询字典数据详细 - * @param dictCode 字典代码值 + * @param id 字典代码值 * @returns object */ -export function getData(dictCode: string | number) { +export function getData(id: string | number) { return request({ - url: `/system/dict/data/${dictCode}`, - method: 'get', + url: `/system/dict/data/${id}`, + method: 'GET', }); } @@ -47,7 +47,7 @@ export function getData(dictCode: string | number) { export function addData(data: Record) { return request({ url: '/system/dict/data', - method: 'post', + method: 'POST', data: data, }); } @@ -60,20 +60,20 @@ export function addData(data: Record) { export function updateData(data: Record) { return request({ url: '/system/dict/data', - method: 'put', + method: 'PUT', data: data, }); } /** * 删除字典数据 - * @param dictCode 字典代码值 + * @param id 字典代码值 * @returns object */ -export function delData(dictCode: string | number) { +export function delData(id: string | number) { return request({ - url: `/system/dict/data/${dictCode}`, - method: 'delete', + url: `/system/dict/data/${id}`, + method: 'DELETE', }); } @@ -85,6 +85,6 @@ export function delData(dictCode: string | number) { export function getDictDataType(dictType: string) { return request({ url: `/system/dict/data/type/${dictType}`, - method: 'get', + method: 'GET', }); } diff --git a/src/api/system/dict/type.ts b/src/api/system/dict/type.ts index 040b0329..5312e9ec 100644 --- a/src/api/system/dict/type.ts +++ b/src/api/system/dict/type.ts @@ -8,8 +8,8 @@ import { request } from '@/plugins/http-fetch'; export function exportType(query: Record) { return request({ url: '/system/dict/type/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -22,7 +22,7 @@ export function exportType(query: Record) { export function listType(query: Record) { return request({ url: '/system/dict/type/list', - method: 'get', + method: 'GET', params: query, }); } @@ -35,7 +35,7 @@ export function listType(query: Record) { export function getType(dictId: string | number) { return request({ url: `/system/dict/type/${dictId}`, - method: 'get', + method: 'GET', }); } @@ -47,7 +47,7 @@ export function getType(dictId: string | number) { export function addType(data: Record) { return request({ url: '/system/dict/type', - method: 'post', + method: 'POST', data: data, }); } @@ -60,20 +60,20 @@ export function addType(data: Record) { export function updateType(data: Record) { return request({ url: '/system/dict/type', - method: 'put', + method: 'PUT', data: data, }); } /** * 删除字典类型 - * @param dictCode 字典代码值 + * @param id 字典代码值 * @returns object */ -export function delType(dictId: string | number) { +export function delType(id: string | number) { return request({ - url: `/system/dict/type/${dictId}`, - method: 'delete', + url: `/system/dict/type/${id}`, + method: 'DELETE', }); } @@ -84,8 +84,8 @@ export function delType(dictId: string | number) { */ export function refreshCache() { return request({ - url: '/system/dict/type/refreshCache', - method: 'put', + url: '/system/dict/type/refresh', + method: 'PUT', }); } @@ -94,9 +94,9 @@ export function refreshCache() { * @param data 字典数据对象 * @returns object */ -export function getDictOptionselect() { +export function getDictOption() { return request({ - url: '/system/dict/type/getDictOptionselect', - method: 'get', + url: '/system/dict/type/options', + method: 'GET', }); } diff --git a/src/api/system/log/login.ts b/src/api/system/log/login.ts index 24322f98..ebf05d3b 100644 --- a/src/api/system/log/login.ts +++ b/src/api/system/log/login.ts @@ -10,8 +10,8 @@ export function exportSysLogLogin( ) { return request({ url: '/system/log/login/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -26,7 +26,7 @@ export function listSysLogLogin( ) { return request({ url: '/system/log/login/list', - method: 'get', + method: 'GET', params: query, }); } @@ -39,7 +39,7 @@ export function listSysLogLogin( export function delSysLogLogin(loginIds: string) { return request({ url: `/system/log/login/${loginIds}`, - method: 'delete', + method: 'DELETE', }); } @@ -50,7 +50,7 @@ export function delSysLogLogin(loginIds: string) { export function cleanSysLogLogin() { return request({ url: '/system/log/login/clean', - method: 'delete', + method: 'DELETE', }); } @@ -62,6 +62,6 @@ export function cleanSysLogLogin() { export function unlock(userName: string) { return request({ url: `/system/log/login/unlock/${userName}`, - method: 'put', + method: 'PUT', }); } diff --git a/src/api/system/log/operate.ts b/src/api/system/log/operate.ts index 83fefad9..2f5cf02c 100644 --- a/src/api/system/log/operate.ts +++ b/src/api/system/log/operate.ts @@ -10,8 +10,8 @@ export function exportSysLogOperate( ) { return request({ url: '/system/log/operate/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -26,7 +26,7 @@ export function listSysLogOperate( ) { return request({ url: '/system/log/operate/list', - method: 'get', + method: 'GET', params: query, }); } @@ -39,7 +39,7 @@ export function listSysLogOperate( export function delSysLogOperate(operId: string) { return request({ url: `/system/log/operate/${operId}`, - method: 'delete', + method: 'DELETE', }); } @@ -50,6 +50,6 @@ export function delSysLogOperate(operId: string) { export function cleanSysLogOperate() { return request({ url: '/system/log/operate/clean', - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts index 4827d770..058909f8 100644 --- a/src/api/system/menu.ts +++ b/src/api/system/menu.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listMenu(query?: Record) { return request({ url: '/system/menu/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listMenu(query?: Record) { export function getMenu(menuId: string | number) { return request({ url: `/system/menu/${menuId}`, - method: 'get', + method: 'GET', }); } @@ -31,8 +31,8 @@ export function getMenu(menuId: string | number) { */ export function menuTreeSelect() { return request({ - url: '/system/menu/treeSelect', - method: 'get', + url: '/system/menu/tree', + method: 'GET', }); } @@ -41,10 +41,10 @@ export function menuTreeSelect() { * @param roleId 角色ID * @returns object */ -export function roleMenuTreeSelect(roleId: string | number) { +export function menuTreeSelectRole(roleId: string | number) { return request({ - url: `/system/menu/roleMenuTreeSelect/${roleId}`, - method: 'get', + url: `/system/menu/tree/role/${roleId}`, + method: 'GET', }); } @@ -56,7 +56,7 @@ export function roleMenuTreeSelect(roleId: string | number) { export function addMenu(data: Record) { return request({ url: '/system/menu', - method: 'post', + method: 'POST', data: data, }); } @@ -69,7 +69,7 @@ export function addMenu(data: Record) { export function updateMenu(data: Record) { return request({ url: '/system/menu', - method: 'put', + method: 'PUT', data: data, }); } @@ -82,6 +82,6 @@ export function updateMenu(data: Record) { export function delMenu(menuId: string | number) { return request({ url: `/system/menu/${menuId}`, - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/system/post.ts b/src/api/system/post.ts index da63bc92..1d477aab 100644 --- a/src/api/system/post.ts +++ b/src/api/system/post.ts @@ -8,8 +8,8 @@ import { request } from '@/plugins/http-fetch'; export function exportPost(query: Record) { return request({ url: '/system/post/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -22,7 +22,7 @@ export function exportPost(query: Record) { export function listPost(query: Record) { return request({ url: '/system/post/list', - method: 'get', + method: 'GET', params: query, }); } @@ -35,7 +35,7 @@ export function listPost(query: Record) { export function getPost(postId: string | number) { return request({ url: `/system/post/${postId}`, - method: 'get', + method: 'GET', }); } @@ -47,7 +47,7 @@ export function getPost(postId: string | number) { export function addPost(data: Record) { return request({ url: '/system/post', - method: 'post', + method: 'POST', data: data, }); } @@ -60,7 +60,7 @@ export function addPost(data: Record) { export function updatePost(data: Record) { return request({ url: '/system/post', - method: 'put', + method: 'PUT', data: data, }); } @@ -73,6 +73,6 @@ export function updatePost(data: Record) { export function delPost(postId: string | number) { return request({ url: `/system/post/${postId}`, - method: 'delete', + method: 'DELETE', }); } diff --git a/src/api/system/quick-start/bootloader.ts b/src/api/system/quick-start/bootloader.ts index 445fec91..feed96d8 100644 --- a/src/api/system/quick-start/bootloader.ts +++ b/src/api/system/quick-start/bootloader.ts @@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch'; export function bootloaderStart() { return request({ url: `/bootloader`, - method: 'post', + method: 'POST', whithToken: false, repeatSubmit: false, }); @@ -20,7 +20,7 @@ export function bootloaderStart() { export function bootloaderDone() { return request({ url: `/bootloader`, - method: 'put', + method: 'PUT', }); } @@ -31,7 +31,7 @@ export function bootloaderDone() { export function bootloaderReset() { return request({ url: `/bootloader`, - method: 'delete', + method: 'DELETE', timeout: 180_000 }); } @@ -43,7 +43,7 @@ export function bootloaderReset() { export function bootloaderAccount(username: string, password: string) { return request({ url: `/bootloader/account`, - method: 'put', + method: 'PUT', data: { username, password, diff --git a/src/api/system/role.ts b/src/api/system/role.ts index 2f426836..185f6ade 100644 --- a/src/api/system/role.ts +++ b/src/api/system/role.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function exportRole(query: Record) { return request({ url: '/system/role/export', - method: 'post', + method: 'POST', data: query, responseType: 'blob', }); @@ -22,7 +22,7 @@ export function exportRole(query: Record) { export function listRole(query: Record) { return request({ url: '/system/role/list', - method: 'get', + method: 'GET', params: query, }); } @@ -35,7 +35,7 @@ export function listRole(query: Record) { export function getRole(roleId: string | number) { return request({ url: `/system/role/${roleId}`, - method: 'get', + method: 'GET', }); } @@ -47,7 +47,7 @@ export function getRole(roleId: string | number) { export function addRole(data: Record) { return request({ url: '/system/role', - method: 'post', + method: 'POST', data: data, }); } @@ -60,7 +60,7 @@ export function addRole(data: Record) { export function updateRole(data: Record) { return request({ url: '/system/role', - method: 'put', + method: 'PUT', data: data, }); } @@ -73,24 +73,21 @@ export function updateRole(data: Record) { export function delRole(roleId: string | number) { return request({ url: `/system/role/${roleId}`, - method: 'delete', + method: 'DELETE', }); } /** * 角色状态修改 * @param roleId 角色ID - * @param status 角色状态 + * @param statusFlag 角色状态 * @returns object */ -export function changeRoleStatus(roleId: string, status: string | number) { +export function changeRoleStatus(roleId: string, statusFlag: string | number) { return request({ - url: '/system/role/changeStatus', - method: 'put', - data: { - roleId, - status, - }, + url: '/system/role/status', + method: 'PUT', + data: { roleId, statusFlag }, }); } @@ -101,8 +98,8 @@ export function changeRoleStatus(roleId: string, status: string | number) { */ export function dataScope(data: Record) { return request({ - url: '/system/role/dataScope', - method: 'put', + url: '/system/role/data-scope', + method: 'PUT', data: data, }); } @@ -112,10 +109,10 @@ export function dataScope(data: Record) { * @param query 查询参数 * @returns object */ -export function authUserAllocatedList(query: Record) { +export function authUserList(query: Record) { return request({ - url: '/system/role/authUser/allocatedList', - method: 'get', + url: '/system/role/user/list', + method: 'GET', params: query, }); } @@ -127,8 +124,8 @@ export function authUserAllocatedList(query: Record) { */ export function authUserChecked(data: Record) { return request({ - url: '/system/role/authUser/checked', - method: 'put', + url: '/system/role/user/auth', + method: 'PUT', data: data, }); } diff --git a/src/api/system/user.ts b/src/api/system/user.ts index c0a04eb2..4563069f 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -5,12 +5,11 @@ import { request } from '@/plugins/http-fetch'; * @param data 表单数据对象 * @returns object */ -export function importData(data: FormData) { +export function importData(filePath: string, update: boolean) { return request({ - url: '/system/user/importData', - method: 'post', - data, - dataType: 'form-data', + url: '/system/user/import', + method: 'POST', + data: { filePath, update }, timeout: 180_000, }); } @@ -21,8 +20,8 @@ export function importData(data: FormData) { */ export function importTemplate() { return request({ - url: '/system/user/importTemplate', - method: 'get', + url: '/system/user/import/template', + method: 'GET', responseType: 'blob', }); } @@ -35,8 +34,8 @@ export function importTemplate() { export function exportUser(query: Record) { return request({ url: '/system/user/export', - method: 'post', - data: query, + method: 'GET', + params: query, responseType: 'blob', }); } @@ -49,7 +48,7 @@ export function exportUser(query: Record) { export function listUser(query: Record) { return request({ url: '/system/user/list', - method: 'get', + method: 'GET', params: query, }); } @@ -62,7 +61,7 @@ export function listUser(query: Record) { export function getUser(userId: string | number = '0') { return request({ url: `/system/user/${userId}`, - method: 'get', + method: 'GET', }); } @@ -74,7 +73,7 @@ export function getUser(userId: string | number = '0') { export function addUser(data: Record) { return request({ url: '/system/user', - method: 'post', + method: 'POST', data: data, }); } @@ -87,7 +86,7 @@ export function addUser(data: Record) { export function updateUser(data: Record) { return request({ url: '/system/user', - method: 'put', + method: 'PUT', data: data, }); } @@ -100,7 +99,7 @@ export function updateUser(data: Record) { export function delUser(userId: string | number) { return request({ url: `/system/user/${userId}`, - method: 'delete', + method: 'DELETE', }); } @@ -112,8 +111,8 @@ export function delUser(userId: string | number) { */ export function resetUserPwd(userId: string | number, password: string) { return request({ - url: '/system/user/resetPwd', - method: 'put', + url: '/system/user/password', + method: 'PUT', data: { userId, password, @@ -124,19 +123,16 @@ export function resetUserPwd(userId: string | number, password: string) { /** * 用户状态修改 * @param userId 用户ID - * @param status 变更状态值 + * @param statusFlag 变更状态值 * @returns object */ export function changeUserStatus( userId: string | number, - status: string | number + statusFlag: string | number ) { return request({ - url: '/system/user/changeStatus', - method: 'put', - data: { - userId, - status, - }, + url: '/system/user/status', + method: 'PUT', + data: { userId, statusFlag }, }); } diff --git a/src/api/tool/file.ts b/src/api/tool/file.ts index 928be1be..bd953004 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, @@ -169,7 +169,7 @@ export async function uploadFileChunk( export function chunkCheck(identifier: string, fileName: string) { return request({ url: '/file/chunkCheck', - method: 'post', + method: 'POST', data: { identifier, fileName }, timeout: 60_000, }); @@ -189,7 +189,7 @@ export function chunkMerge( ) { return request({ url: '/file/chunkMerge', - method: 'post', + method: 'POST', data: { identifier, fileName, subPath }, timeout: 60_000, }); @@ -203,7 +203,7 @@ export function chunkMerge( export function chunkUpload(data: FormData) { return request({ url: '/file/chunkUpload', - method: 'post', + method: 'POST', data, dataType: 'form-data', timeout: 60_000, @@ -217,7 +217,7 @@ export function chunkUpload(data: FormData) { export function transferStaticFile(data: Record) { return request({ url: `/file/transferStaticFile`, - method: 'post', + method: 'POST', data, timeout: 60_000, }); @@ -241,7 +241,7 @@ 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, neType, diff --git a/src/api/tool/iperf.ts b/src/api/tool/iperf.ts index 5b5e146c..fe23ae79 100644 --- a/src/api/tool/iperf.ts +++ b/src/api/tool/iperf.ts @@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch'; export function iperfV(data: Record) { return request({ url: '/tool/iperf/v', - method: 'get', + method: 'GET', params: data, }); } @@ -13,7 +13,7 @@ export function iperfV(data: Record) { export function iperfI(data: Record) { return request({ url: '/tool/iperf/i', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); diff --git a/src/api/tool/neFile.ts b/src/api/tool/neFile.ts index 236a33c2..363b1239 100644 --- a/src/api/tool/neFile.ts +++ b/src/api/tool/neFile.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listNeFiles(query: Record) { return request({ url: '/ne/action/files', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listNeFiles(query: Record) { export function getNeFile(query: Record) { return request({ url: '/ne/action/pullFile', - method: 'get', + method: 'GET', params: query, responseType: 'blob', timeout: 180_000, @@ -32,7 +32,7 @@ export function getNeFile(query: Record) { export function getNeDirZip(data: Record) { return request({ url: '/ne/action/pullDirZip', - method: 'get', + method: 'GET', params: data, responseType: 'blob', timeout: 60_000, @@ -43,7 +43,7 @@ export function getNeDirZip(data: Record) { export function getNeViewFile(data: Record) { return request({ url: '/ne/action/viewFile', - method: 'get', + method: 'GET', params: data, timeout: 60_000, }); diff --git a/src/api/tool/ping.ts b/src/api/tool/ping.ts index b897604e..ce48abdc 100644 --- a/src/api/tool/ping.ts +++ b/src/api/tool/ping.ts @@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch'; export function pingV(data: Record) { return request({ url: '/tool/ping/v', - method: 'get', + method: 'GET', params: data, }); } diff --git a/src/api/trace/analysis.ts b/src/api/trace/analysis.ts index 592340ac..1a4ccf11 100644 --- a/src/api/trace/analysis.ts +++ b/src/api/trace/analysis.ts @@ -1,60 +1,16 @@ -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; -import { parseObjLineToHump } from '@/utils/parse-utils'; /** - * 查询信令列表 + * 跟踪任务数据列表 * @param query 查询参数 * @returns object */ export async function listTraceData(query: Record) { - let totalSQL = 'select count(*) as total from trace_data where 1=1 '; - let rowsSQL = 'select * from trace_data where 1=1 '; - - // 查询 - let querySQL = ''; - if (query.imsi) { - querySQL += ` and imsi like '%${query.imsi}%' `; - } - if (query.msisdn) { - querySQL += ` and msisdn like '%${query.msisdn}%' `; - } - - // 分页 - const pageNum = (query.pageNum - 1) * query.pageSize; - const limtSql = ` limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/omc_db/trace_data`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, + return request({ + url: '/trace/task/list', + method: 'GET', + params: query, }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['trace_data']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; } /** @@ -65,7 +21,7 @@ export async function listTraceData(query: Record) { export function getTraceRawInfo(id: Record) { return request({ url: `/api/rest/traceManagement/v1/decMessage/${id}`, - method: 'get', + method: 'GET', responseType: 'text', }); } diff --git a/src/api/trace/packet.ts b/src/api/trace/packet.ts index dd6c2535..2266e510 100644 --- a/src/api/trace/packet.ts +++ b/src/api/trace/packet.ts @@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch'; export function packetDevices() { return request({ url: '/trace/packet/devices', - method: 'get', + method: 'GET', }); } @@ -19,7 +19,7 @@ export function packetDevices() { export function packetStart(data: Record) { return request({ url: '/trace/packet/start', - method: 'post', + method: 'POST', data: data, }); } @@ -32,7 +32,7 @@ export function packetStart(data: Record) { export function packetStop(taskNo: string) { return request({ url: '/trace/packet/stop', - method: 'post', + method: 'POST', data: { taskNo }, }); } @@ -45,7 +45,7 @@ export function packetStop(taskNo: string) { export function packetFilter(taskNo: string, expr: string) { return request({ url: '/trace/packet/filter', - method: 'put', + method: 'PUT', data: { taskNo, expr }, }); } @@ -58,7 +58,7 @@ export function packetFilter(taskNo: string, expr: string) { export function packetKeep(taskNo: string, duration: number = 120) { return request({ url: '/trace/packet/keep-alive', - method: 'put', + method: 'PUT', data: { taskNo, duration }, }); } diff --git a/src/api/trace/pcap.ts b/src/api/trace/pcap.ts index da3a4cd7..984410a5 100644 --- a/src/api/trace/pcap.ts +++ b/src/api/trace/pcap.ts @@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch'; export function dumpStart(data: Record) { return request({ url: '/trace/tcpdump/start', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -14,7 +14,7 @@ export function dumpStart(data: Record) { export function dumpStop(data: Record) { return request({ url: '/trace/tcpdump/stop', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -24,7 +24,7 @@ export function dumpStop(data: Record) { export function traceUPF(data: Record) { return request({ url: '/trace/tcpdump/upf', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); diff --git a/src/api/trace/task.ts b/src/api/trace/task.ts index e5620942..d30473e1 100644 --- a/src/api/trace/task.ts +++ b/src/api/trace/task.ts @@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; export async function listTraceTask(query: Record) { return request({ url: '/trace/task/list', - method: 'get', + method: 'GET', params: query, }); } @@ -23,7 +23,7 @@ export async function listTraceTask(query: Record) { export async function getTraceTask(id: string | number) { return request({ url: `/trace/task/${id}`, - method: 'get', + method: 'GET', }); } @@ -35,7 +35,7 @@ export async function getTraceTask(id: string | number) { export function addTraceTask(data: Record) { return request({ url: `/trace/task`, - method: 'post', + method: 'POST', data: data, }); } @@ -48,7 +48,7 @@ export function addTraceTask(data: Record) { export function updateTraceTask(data: Record) { return request({ url: `/trace/task`, - method: 'put', + method: 'PUT', data: data, }); } @@ -61,7 +61,7 @@ export function updateTraceTask(data: Record) { export async function delTraceTask(ids: string) { return request({ url: `/trace/task/${ids}`, - method: 'delete', + method: 'DELETE', }); } @@ -73,7 +73,7 @@ export async function delTraceTask(ids: string) { export function filePullTask(traceId: string) { return request({ url: '/trace/task/filePull', - method: 'get', + method: 'GET', params: { traceId }, responseType: 'blob', timeout: 60_000, @@ -88,7 +88,7 @@ export async function getNeTraceInterfaceAll() { // 发起请求 const result = await request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/ne_info`, - method: 'get', + method: 'GET', params: { SQL: `SELECT ne_type,interface FROM trace_info GROUP BY ne_type,interface`, }, diff --git a/src/api/trace/taskHLR.ts b/src/api/trace/taskHLR.ts index 6d6adf34..5af6fcfc 100644 --- a/src/api/trace/taskHLR.ts +++ b/src/api/trace/taskHLR.ts @@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch'; export function listTaskHLR(query: Record) { return request({ url: '/trace/task/hlr/list', - method: 'get', + method: 'GET', params: query, }); } @@ -21,7 +21,7 @@ export function listTaskHLR(query: Record) { export function delTaskHLR(ids: string | number) { return request({ url: `/trace/task/hlr/${ids}`, - method: 'delete', + method: 'DELETE', timeout: 60_000, }); } @@ -34,7 +34,7 @@ export function delTaskHLR(ids: string | number) { export function startTaskHLR(data: Record) { return request({ url: '/trace/task/hlr/start', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -48,7 +48,7 @@ export function startTaskHLR(data: Record) { export function stopTaskHLR(data: Record) { return request({ url: '/trace/task/hlr/stop', - method: 'post', + method: 'POST', data: data, timeout: 60_000, }); @@ -62,7 +62,7 @@ export function stopTaskHLR(data: Record) { export function fileTaskHLR(data: Record) { return request({ url: '/trace/task/hlr/file', - method: 'post', + method: 'POST', data: data, }); } @@ -75,7 +75,7 @@ export function fileTaskHLR(data: Record) { export function filePullTaskHLR(query: Record) { return request({ url: '/trace/task/hlr/filePull', - method: 'get', + method: 'GET', params: query, responseType: 'blob', timeout: 60_000, diff --git a/src/constants/token-constants.ts b/src/constants/token-constants.ts index 34c4d1b5..03d2cc87 100644 --- a/src/constants/token-constants.ts +++ b/src/constants/token-constants.ts @@ -1,5 +1,5 @@ /**令牌-数据响应字段 */ -export const TOKEN_RESPONSE_FIELD = 'access_token'; +export const TOKEN_RESPONSE_FIELD = 'accessToken'; /**令牌-请求头标识前缀 */ export const TOKEN_KEY_PREFIX = 'Bearer '; diff --git a/src/plugins/auth-token.ts b/src/plugins/auth-token.ts index d468771f..536d54b1 100644 --- a/src/plugins/auth-token.ts +++ b/src/plugins/auth-token.ts @@ -1,7 +1,10 @@ import Cookies from 'js-cookie'; import { TOKEN_COOKIE } from '@/constants/token-constants'; import { localRemove, localSet } from '@/utils/cache-local-utils'; -import { CACHE_LOCAL_LOCK_PASSWD, CACHE_LOCAL_MASK } from '@/constants/cache-keys-constants'; +import { + CACHE_LOCAL_LOCK_PASSWD, + CACHE_LOCAL_MASK, +} from '@/constants/cache-keys-constants'; /**获取cookis中Token字符串 */ export function getToken(): string { @@ -10,7 +13,7 @@ export function getToken(): string { /**设置cookis中Token字符串 */ export function setToken(token: string): void { - Cookies.set(TOKEN_COOKIE, token); + Cookies.set(TOKEN_COOKIE, token || ''); localSet(CACHE_LOCAL_MASK, 'none'); } diff --git a/src/plugins/http-fetch.ts b/src/plugins/http-fetch.ts index 7a4a8849..b5f38c97 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'; /**请求头 */ headers?: HeadersInit; /**地址栏参数 */ @@ -101,7 +101,7 @@ const FATCH_OPTIONS: OptionsType = { baseUrl: baseUrl, timeout: 10_000, url: '', - method: 'get', + method: 'GET', headers: { [APP_REQUEST_HEADER_CODE]: import.meta.env.VITE_APP_CODE, [APP_REQUEST_HEADER_VERSION]: import.meta.env.VITE_APP_VERSION, @@ -195,7 +195,7 @@ function beforeRequest(options: OptionsType): OptionsType | Promise { } } - if (options.method === 'get') return options; + if (options.method === 'GET') return options; // 非get参数提交 let body = options.data;