diff --git a/src/api/configManage/configParam.ts b/src/api/configManage/configParam.ts index 29dd00cd..54101596 100644 --- a/src/api/configManage/configParam.ts +++ b/src/api/configManage/configParam.ts @@ -38,13 +38,13 @@ export async function getParamConfigTopTab(neType: string) { } /** - * 查询配置参数标签栏对应信息 + * 查询配置参数标签栏对应信息和规则 * @param neType 网元类型 * @param topTag * @param neId * @returns object { wrRule, dataArr } */ -async function getParamConfigInfo( +async function getParamConfigInfoAndRule( neType: string, topTag: string, neId: string @@ -57,7 +57,6 @@ async function getParamConfigInfo( params: { SQL: `SELECT param_json FROM param_config WHERE ne_type = '${neType}' AND top_tag='${topTag}'`, }, - timeout: 1_000, }), // 获取对应信息 request({ @@ -66,7 +65,6 @@ async function getParamConfigInfo( params: { ne_id: neId, }, - timeout: 1_000, }), ]).then(resArr => { let wrRule: Record = {}; @@ -120,7 +118,11 @@ export async function getParamConfigInfoForm( topTag: string, neId: string ) { - const { wrRule, dataArr } = await getParamConfigInfo(neType, topTag, neId); + const { wrRule, dataArr } = await getParamConfigInfoAndRule( + neType, + topTag, + neId + ); // 拼装数据 const result = { @@ -187,6 +189,35 @@ export async function getParamConfigInfoForm( return result; } +/** + * 查询配置参数标签栏对应信息 + * @param neType 网元类型 + * @param topTag + * @param neId + * @returns object + */ +export async function getParamConfigInfo( + neType: string, + topTag: string, + neId: string +) { + // 发起请求 + const result = await request({ + url: `/api/rest/systemManagement/v1/elementType/${neType.toLowerCase()}/objectType/config/${topTag}`, + method: 'get', + params: { + ne_id: neId, + }, + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { + return Object.assign(result, { + data: parseObjLineToHump(result.data.data), + }); + } + return result; +} + /** * 查询配置参数标签栏对应信息子节点 * @param neType 网元类型 diff --git a/src/views/configManage/configParamTreeTable/hooks/useSMFOptions.ts b/src/views/configManage/configParamTreeTable/hooks/useSMFOptions.ts new file mode 100644 index 00000000..2a020cfe --- /dev/null +++ b/src/views/configManage/configParamTreeTable/hooks/useSMFOptions.ts @@ -0,0 +1,22 @@ +import { getParamConfigInfo } from '@/api/configManage/configParam'; +import { ref } from 'vue'; + +export default function useSMFOptions() { + /**upfId可选择 */ + const optionsUPFIds = ref<{ value: string; label: string }[]>([]); + + /**初始加载upfId */ + function initUPFIds() { + getParamConfigInfo('smf', 'upfConfig', '001').then(res => { + optionsUPFIds.value = []; + for (const s of res.data) { + optionsUPFIds.value.push({ + value: s.id, + label: s.id, + }); + } + }); + } + + return { initUPFIds, optionsUPFIds }; +} diff --git a/src/views/configManage/configParamTreeTable/index.vue b/src/views/configManage/configParamTreeTable/index.vue index 95a807d8..edd63c2a 100644 --- a/src/views/configManage/configParamTreeTable/index.vue +++ b/src/views/configManage/configParamTreeTable/index.vue @@ -1,5 +1,5 @@