From ca0913a8cf116347f756d7c5486b7940bce736e7 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 6 Nov 2023 14:33:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2page?= =?UTF-8?q?Num=E8=AE=BE=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configManage/configParam.ts | 145 +- src/views/configManage/backupManage/index.vue | 11 +- src/views/configManage/configParam/index.vue | 4 +- .../components/array-children.vue | 64 + .../configManage/configParamTree/index.vue | 2170 +++++++++++++++++ src/views/configManage/license/index.vue | 11 +- src/views/configManage/neManage/index.vue | 15 +- .../components/software-history.vue | 9 +- .../configManage/softwareManage/index.vue | 11 +- src/views/faultManage/active-alarm/index.vue | 11 +- src/views/faultManage/history-alarm/index.vue | 11 +- src/views/logManage/alarm/index.vue | 11 +- src/views/logManage/forwarding/index.vue | 11 +- src/views/logManage/mml/index.vue | 11 +- src/views/logManage/operation/index.vue | 11 +- src/views/logManage/security/index.vue | 11 +- src/views/monitor/job/index.vue | 12 +- src/views/monitor/job/log.vue | 14 +- src/views/monitor/session/index.vue | 11 +- src/views/neUser/auth/index.vue | 25 +- src/views/neUser/base5G/index.vue | 11 +- src/views/neUser/ims/index.vue | 11 +- src/views/neUser/sub/index.vue | 26 +- src/views/neUser/ue/index.vue | 11 +- src/views/perfManage/customTarget/index.vue | 11 +- src/views/perfManage/goldTarget/index.vue | 11 +- src/views/perfManage/perfData/index.vue | 11 +- src/views/perfManage/perfReport/index.vue | 11 +- src/views/perfManage/perfSet/index.vue | 11 +- src/views/perfManage/perfThreshold/index.vue | 11 +- src/views/perfManage/taskManage/index.vue | 11 +- src/views/system/dict/data.vue | 11 +- src/views/system/dict/index.vue | 13 +- src/views/system/log/login/index.vue | 11 +- src/views/system/log/operate/index.vue | 13 +- src/views/system/post/index.vue | 13 +- src/views/system/role/auth-user.vue | 13 +- .../role/components/auth-user-select.vue | 9 +- src/views/system/role/index.vue | 13 +- src/views/system/user/index.vue | 13 +- src/views/traceManage/analysis/index.vue | 11 +- src/views/traceManage/task/index.vue | 16 +- 42 files changed, 2652 insertions(+), 199 deletions(-) create mode 100644 src/views/configManage/configParamTree/components/array-children.vue create mode 100644 src/views/configManage/configParamTree/index.vue diff --git a/src/api/configManage/configParam.ts b/src/api/configManage/configParam.ts index a1b42ab0..bed1a69d 100644 --- a/src/api/configManage/configParam.ts +++ b/src/api/configManage/configParam.ts @@ -37,49 +37,19 @@ export async function getParamConfigTopTab(neType: string) { return result; } -/** - * 查询配置参数标签栏对应JSON信息 - * @param neType 网元类型 - * @returns object - */ -export async function getParamConfigTopTabJson(neType: string, topTag: string) { - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/param_config`, - method: 'get', - params: { - SQL: `SELECT param_json FROM param_config WHERE ne_type = '${neType}' AND top_tag='${topTag}'`, - }, - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { - let data = result.data.data[0]; - data = data['param_config']; - if (Array.isArray(data)) { - const v = data[0]['param_json']; - try { - result.data = JSON.parse(v); - } catch (error) { - console.error(error); - result.data = {}; - } - } - return result; - } - return result; -} - /** * 查询配置参数标签栏对应信息 * @param neType 网元类型 - * @returns object + * @param topTag + * @param neId + * @returns object { wrRule, dataArr } */ -export async function getParamConfigInfo( +async function getParamConfigInfo( neType: string, topTag: string, neId: string ) { - const { wrRule, dataArr } = await Promise.allSettled([ + return await Promise.allSettled([ // 获取参数规则 request({ url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/param_config`, @@ -134,6 +104,21 @@ export async function getParamConfigInfo( } return { wrRule, dataArr }; }); +} + +/** + * 查询配置参数标签栏对应信息-表格处理 + * @param neType 网元类型 + * @param topTag + * @param neId + * @returns object + */ +export async function getParamConfigInfoTable( + neType: string, + topTag: string, + neId: string +) { + const { wrRule, dataArr } = await getParamConfigInfo(neType, topTag, neId); // UPF参数不统一 // if (neType === 'UPF') { @@ -226,6 +211,7 @@ export async function getParamConfigInfo( }, ]; } + // 多列表 if (Reflect.has(wrRule, 'array')) { result.data.type = 'array'; @@ -273,6 +259,95 @@ export async function getParamConfigInfo( return result; } +/** + * 查询配置参数标签栏对应信息-树结构处理 + * @param neType 网元类型 + * @param topTag + * @param neId + * @returns object + */ +export async function getParamConfigInfoTree( + neType: string, + topTag: string, + neId: string +) { + const { wrRule, dataArr } = await getParamConfigInfo(neType, topTag, neId); + + type TreeNodeType = { + title: string; + key: string; + record: Record[]; + }; + + // 拼装数据 + const result = { + code: RESULT_CODE_SUCCESS, + msg: RESULT_MSG_SUCCESS, + data: { + type: 'list' as 'list' | 'array', + data: [] as TreeNodeType[], + recordRule: {}, + }, + }; + + // kv单列表 + if (Reflect.has(wrRule, 'list')) { + result.data.type = 'list'; + const ruleArr = Object.freeze(wrRule['list']); + + // 列表项数据 + const dataList = []; + for (const item of dataArr) { + for (const key of Object.keys(item)) { + // 规则为准 + for (const rule of ruleArr) { + if (rule['name'] === key) { + const ruleItem = Object.assign({ optional: 'true' }, rule, { + value: item[key], + }); + dataList.push(ruleItem); + break; + } + } + } + } + result.data.data = dataList; + } + // 多列表 + if (Reflect.has(wrRule, 'array')) { + result.data.type = 'array'; + const ruleArr = Object.freeze(wrRule['array']); + // 列表项数据 + const dataArray = []; + for (const item of dataArr) { + const index = item['index']; + let record: Record[] = []; + for (const key of Object.keys(item)) { + // 规则为准 + for (const rule of ruleArr) { + if (rule['name'] === key) { + const ruleItem = Object.assign({ optional: 'true' }, rule, { + value: item[key], + }); + record.push(ruleItem); + break; + } + } + } + dataArray.push({ title: `Index-${index}`, key: index, record }); + } + result.data.data = dataArray; + + // 无数据时,用于新增 + let dataRule: Record = {}; + for (const rule of ruleArr) { + dataRule[rule.name] = rule; + } + result.data.recordRule = dataRule; + } + return result; +} + /** * 查询配置参数标签栏对应信息子节点 * @param neType 网元类型 diff --git a/src/views/configManage/backupManage/index.vue b/src/views/configManage/backupManage/index.vue index 7b6eb734..9e241580 100644 --- a/src/views/configManage/backupManage/index.vue +++ b/src/views/configManage/backupManage/index.vue @@ -200,10 +200,13 @@ function fnRecordDelete(row: Record) { }); } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listNeBackup(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { // 取消勾选 @@ -347,7 +350,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -387,7 +390,7 @@ onMounted(() => { - + diff --git a/src/views/configManage/configParam/index.vue b/src/views/configManage/configParam/index.vue index 4e5b7509..5c6a3ca8 100644 --- a/src/views/configManage/configParam/index.vue +++ b/src/views/configManage/configParam/index.vue @@ -6,7 +6,7 @@ import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { getParamConfigTopTab, - getParamConfigInfo, + getParamConfigInfoTable, updateParamConfigInfo, updateNeConfigReload, delParamConfigInfo, @@ -53,7 +53,7 @@ function fnTabActiveTopTag(key: string | number) { const neType = neTypeSelect.value[0]; const neId = neTypeSelect.value[1]; const topTag = tabState.tabActiveTopTag; - getParamConfigInfo(neType, topTag, neId) + getParamConfigInfoTable(neType, topTag, neId) .then(res => { if (res.code === RESULT_CODE_SUCCESS && res.data.type) { tableState.type = res.data.type; diff --git a/src/views/configManage/configParamTree/components/array-children.vue b/src/views/configManage/configParamTree/components/array-children.vue new file mode 100644 index 00000000..23812331 --- /dev/null +++ b/src/views/configManage/configParamTree/components/array-children.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/views/configManage/configParamTree/index.vue b/src/views/configManage/configParamTree/index.vue new file mode 100644 index 00000000..ca295e5a --- /dev/null +++ b/src/views/configManage/configParamTree/index.vue @@ -0,0 +1,2170 @@ + + + + + diff --git a/src/views/configManage/license/index.vue b/src/views/configManage/license/index.vue index 4e7b92d0..12a8349b 100644 --- a/src/views/configManage/license/index.vue +++ b/src/views/configManage/license/index.vue @@ -125,10 +125,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询信息列表 */ -function fnGetList() { +/**查询信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listLicense(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { // 取消勾选 @@ -325,7 +328,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -365,7 +368,7 @@ onMounted(() => { - + diff --git a/src/views/configManage/neManage/index.vue b/src/views/configManage/neManage/index.vue index 1c643efc..3f41f555 100644 --- a/src/views/configManage/neManage/index.vue +++ b/src/views/configManage/neManage/index.vue @@ -329,7 +329,7 @@ function fnModalOk() { }); modalState.visibleByEdit = false; modalStateFrom.resetFields(); - fnGetList(); + fnGetList(1); } else { message.error({ content: `${res.msg}`, @@ -387,7 +387,7 @@ function fnImportModalOk() { hide(); modalState.confirmLoading = false; // 获取列表数据 - fnGetList(); + fnGetList(1); }); }) .catch(e => { @@ -600,10 +600,13 @@ function fnRecordMore(type: string | number, row: Record) { } } -/**查询网元列表 */ -function fnGetList() { +/**查询网元列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listNeInfo(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { // 取消勾选 @@ -682,7 +685,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -722,7 +725,7 @@ onMounted(() => { - + diff --git a/src/views/configManage/softwareManage/components/software-history.vue b/src/views/configManage/softwareManage/components/software-history.vue index 44935710..b1030d34 100644 --- a/src/views/configManage/softwareManage/components/software-history.vue +++ b/src/views/configManage/softwareManage/components/software-history.vue @@ -154,10 +154,13 @@ let tablePagination = reactive({ }, }); -/**查询角色未授权用户列表 */ -function fnGetList() { +/**查询角色未授权用户列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -238,7 +241,7 @@ watch( - + {{ t('common.search') }} diff --git a/src/views/configManage/softwareManage/index.vue b/src/views/configManage/softwareManage/index.vue index cac7b7a6..d4f78277 100644 --- a/src/views/configManage/softwareManage/index.vue +++ b/src/views/configManage/softwareManage/index.vue @@ -370,10 +370,13 @@ function fnRecordDelete(row: Record) { }); } -/**查询信息列表 */ -function fnGetList() { +/**查询信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listNeSoftware(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { // 取消勾选 @@ -614,7 +617,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -658,7 +661,7 @@ onMounted(() => { - + diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index 5a61d7fe..49c91ef7 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -721,10 +721,13 @@ function fnModalCancel() { modalState.visibleByShowSet = false; } -/**查询列表 */ -function fnGetList() { +/**查询列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -817,7 +820,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -965,7 +968,7 @@ onMounted(() => { - + diff --git a/src/views/faultManage/history-alarm/index.vue b/src/views/faultManage/history-alarm/index.vue index 8234d89d..16098a8c 100644 --- a/src/views/faultManage/history-alarm/index.vue +++ b/src/views/faultManage/history-alarm/index.vue @@ -528,10 +528,13 @@ function fnModalCancel() { modalState.visibleByShowSet = false; } -/**查询列表 */ -function fnGetList() { +/**查询列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -616,7 +619,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -739,7 +742,7 @@ onMounted(() => { - + diff --git a/src/views/logManage/alarm/index.vue b/src/views/logManage/alarm/index.vue index ba550efd..faea5132 100644 --- a/src/views/logManage/alarm/index.vue +++ b/src/views/logManage/alarm/index.vue @@ -166,10 +166,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -247,7 +250,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -280,7 +283,7 @@ onMounted(() => { - + diff --git a/src/views/logManage/forwarding/index.vue b/src/views/logManage/forwarding/index.vue index 40bfc524..a887f561 100644 --- a/src/views/logManage/forwarding/index.vue +++ b/src/views/logManage/forwarding/index.vue @@ -177,10 +177,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -247,7 +250,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -280,7 +283,7 @@ onMounted(() => { - + diff --git a/src/views/logManage/mml/index.vue b/src/views/logManage/mml/index.vue index a8191bdc..901d0859 100644 --- a/src/views/logManage/mml/index.vue +++ b/src/views/logManage/mml/index.vue @@ -138,10 +138,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -199,7 +202,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -232,7 +235,7 @@ onMounted(() => { - + diff --git a/src/views/logManage/operation/index.vue b/src/views/logManage/operation/index.vue index 691c0ef9..94fb0ae4 100644 --- a/src/views/logManage/operation/index.vue +++ b/src/views/logManage/operation/index.vue @@ -176,10 +176,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listOperationLog(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { tablePagination.total = res.total; @@ -259,7 +262,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -292,7 +295,7 @@ onMounted(() => { - + diff --git a/src/views/logManage/security/index.vue b/src/views/logManage/security/index.vue index 4cc74da0..a3cd3717 100644 --- a/src/views/logManage/security/index.vue +++ b/src/views/logManage/security/index.vue @@ -160,10 +160,13 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**查询备份信息列表 */ -function fnGetList() { +/**查询备份信息列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -238,7 +241,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -271,7 +274,7 @@ onMounted(() => { - + diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 36e970f5..e7a9aa9b 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -528,9 +528,13 @@ function fnJobLogView(jobId: string | number = '0') { router.push(`${routePath}${MENU_PATH_INLINE}/log/${jobId}`); } -/**查询定时任务列表 */ -function fnGetList() { +/**查询定时任务列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { + if (tableState.loading) return; tableState.loading = true; + if (pageNum) { + queryParams.pageNum = pageNum; + } listJob(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 @@ -610,7 +614,7 @@ onMounted(() => { - + 搜索 @@ -698,7 +702,7 @@ onMounted(() => { - + diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue index 30ce2d4e..ce188b9d 100644 --- a/src/views/monitor/job/log.vue +++ b/src/views/monitor/job/log.vue @@ -297,7 +297,7 @@ function fnCleanList() { key, duration: 2, }); - fnGetList(); + fnGetList(1); } else { message.error({ content: `${res.msg}`, @@ -348,9 +348,13 @@ function fnClose() { } } -/**查询调度日志列表 */ -function fnGetList() { +/**查询调度日志列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { + if (tableState.loading) return; tableState.loading = true; + if (pageNum) { + queryParams.pageNum = pageNum; + } if (!queryRangePicker.value) { queryRangePicker.value = ['', '']; } @@ -455,7 +459,7 @@ onMounted(() => { - + 搜索 @@ -531,7 +535,7 @@ onMounted(() => { - + diff --git a/src/views/monitor/session/index.vue b/src/views/monitor/session/index.vue index 12c2674e..03a23b1d 100644 --- a/src/views/monitor/session/index.vue +++ b/src/views/monitor/session/index.vue @@ -178,10 +178,13 @@ function fnForceLogout(row: Record) { }, }); } -/**查询网元列表 */ -function fnGetList() { +/**查询网元列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if(pageNum){ + queryParams.pageNum = pageNum; + } listSession(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { tablePagination.total = res.total; @@ -231,7 +234,7 @@ onMounted(() => { - + @@ -268,7 +271,7 @@ onMounted(() => { - + diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index 0c3e013d..73687625 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -85,6 +85,7 @@ let tableColumns: ColumnsType = [ align: 'center', fixed: 'left', width: 5, + sorter: true, }, { title: 'AMF', @@ -158,6 +159,18 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } +/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */ +function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) { + const { field, order } = sorter; + if (order) { + queryParams.sortField = field; + queryParams.sortOrder = order.replace('end', ''); + } else { + queryParams.sortOrder = 'asc'; + } + fnGetList(1); +} + /**对话框对象信息状态类型 */ type ModalStateType = { /**详情框是否显示 */ @@ -557,10 +570,13 @@ function fnLoadData() { }); } -/**查询网元列表 */ -function fnGetList() { +/**查询列表, pageNum初始页数 */ +function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; + if (pageNum) { + queryParams.pageNum = pageNum; + } listAuth(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { tablePagination.total = res.total; @@ -690,7 +706,7 @@ onMounted(() => { - + @@ -790,7 +806,7 @@ onMounted(() => { - + @@ -835,6 +851,7 @@ onMounted(() => { :size="tableState.size" :pagination="tablePagination" :scroll="{ x: 1000, y: 400 }" + @change="fnTableChange" >