From ecaa0ce077e384454f80c510b52a88be8a369519 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 11 Jul 2024 10:24:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4=E7=BD=91?= =?UTF-8?q?=E5=85=83=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9=EF=BC=8C=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configParamTreeTable/index.vue | 118 ++++++++---------- 1 file changed, 54 insertions(+), 64 deletions(-) diff --git a/src/views/configManage/configParamTreeTable/index.vue b/src/views/configManage/configParamTreeTable/index.vue index 007f2ac3..90622857 100644 --- a/src/views/configManage/configParamTreeTable/index.vue +++ b/src/views/configManage/configParamTreeTable/index.vue @@ -5,35 +5,25 @@ import { Modal, message } from 'ant-design-vue/lib'; import useI18n from '@/hooks/useI18n'; import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { - getParamConfigTopTab, - getParamConfigInfoForm, - updateParamConfigInfo, - delParamConfigInfo, - addParamConfigInfo, -} from '@/api/configManage/configParam'; import useNeInfoStore from '@/store/modules/neinfo'; import useOptions from './hooks/useOptions'; import useSMFOptions from './hooks/useSMFOptions'; import { SizeType } from 'ant-design-vue/lib/config-provider'; import { DataNode } from 'ant-design-vue/lib/tree'; +import { getAllNeConfig } from '@/api/ne/neConfig'; import { - addNeConfigData, - delNeConfigData, - editNeConfigData, - getAllNeConfig, - getNeConfigData, -} from '@/api/ne/neConfig'; + addPtNeConfigData, + delPtNeConfigData, + editPtNeConfigData, + getPtNeConfigData, +} from '@/api/pt/neConfig'; const neInfoStore = useNeInfoStore(); const { t } = useI18n(); -const { ruleVerification } = useOptions(); +const { ruleVerification, ptSaveConfig, ptResetConfig, ptConfigApply } = useOptions(); const { initUPFIds, optionsUPFIds } = useSMFOptions(); /**网元参数 */ -let neCascaderOptions = ref[]>([]); - -/**网元类型选择 type,id */ -let neTypeSelect = ref(['', '']); +let neSelectOptions = ref[]>([]); /**左侧导航是否可收起 */ let collapsible = ref(true); @@ -47,6 +37,8 @@ function changeCollapsible() { type TreeStateType = { /**网元 loading */ loading: boolean; + /**网元类型,教学固定neId:001 */ + neType: string; /**网元配置 tree */ data: DataNode[]; /**选择对应Node一级 tree */ @@ -66,6 +58,7 @@ type TreeStateType = { let treeState: TreeStateType = reactive({ loading: true, + neType: '', data: [], selectNode: { paramName: '', @@ -89,7 +82,7 @@ function fnSelectConfigNode(_: any, info: any) { fnActiveConfigNode(key); } -/**tab标签栏标签点击监听 */ +/**标签点击监听 */ function fnActiveConfigNode(key: string | number) { listState.data = []; arrayState.data = []; @@ -111,9 +104,8 @@ function fnActiveConfigNode(key: string | number) { treeState.selectNode = JSON.parse(JSON.stringify(param)); // 获取网元端的配置数据 - getNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + getPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, }).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { @@ -213,7 +205,7 @@ function fnActiveConfigNode(key: string | number) { /**查询配置可选属性值列表 */ function fnGetNeConfig() { - const neType = neTypeSelect.value[0]; + const neType = treeState.neType; if (!neType) { message.warning({ content: t('views.configManage.configParamForm.neTypePleace'), @@ -313,9 +305,8 @@ function listEditOk() { // 发送 const hide = message.loading(t('common.loading'), 0); - editNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + editPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, paramData: { [from['name']]: from['value'], @@ -458,12 +449,11 @@ function arrayEditOk(from: Record) { // 发送 const hide = message.loading(t('common.loading'), 0); - editNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + editPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, paramData: data, - loc: from['index']['value'], + loc: `${from['index']['value']}`, }) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { @@ -489,7 +479,7 @@ function arrayEditOk(from: Record) { /**多列表删除单行 */ function arrayDelete(rowIndex: Record) { - const loc = rowIndex.value; + const loc = `${rowIndex.value}`; const title = `${treeState.selectNode.paramDisplay} Index-${loc}`; Modal.confirm({ @@ -498,9 +488,8 @@ function arrayDelete(rowIndex: Record) { num: title, }), onOk() { - delNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + delPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, loc: loc, }).then(res => { @@ -568,12 +557,11 @@ function arrayAddOk(from: Record) { // 发送 const hide = message.loading(t('common.loading'), 0); - addNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + addPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, paramData: data, - loc: from['index']['value'], + loc: `${from['index']['value']}`, }) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { @@ -776,9 +764,8 @@ function arrayChildEditOk(from: Record) { // 发送 const hide = message.loading(t('common.loading'), 0); - editNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + editPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, paramData: data, loc, @@ -817,9 +804,8 @@ function arrayChildDelete(rowIndex: Record) { num: title, }), onOk() { - delNeConfigData({ - neType: neTypeSelect.value[0], - neId: neTypeSelect.value[1], + delPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, loc, }).then(res => { @@ -866,7 +852,6 @@ function arrayChildAdd() { /**多列表新增单行确认 */ function arrayChildAddOk(from: Record) { const loc = `${arrayChildState.loc}/${from['index']['value']}`; - const neType = neTypeSelect.value[0]; let data: Record = {}; for (const key in from) { @@ -888,9 +873,8 @@ function arrayChildAddOk(from: Record) { // 发送 const hide = message.loading(t('common.loading'), 0); - addNeConfigData({ - neType: neType, - neId: neTypeSelect.value[1], + addPtNeConfigData({ + neType: treeState.neType, paramName: treeState.selectNode.paramName, paramData: data, loc, @@ -1065,7 +1049,7 @@ watch( () => modalState.visible, val => { // SMF需要选择配置的UPF id - if (val && neTypeSelect.value[0] === 'SMF') { + if (val && treeState.neType === 'SMF') { initUPFIds(); } } @@ -1077,12 +1061,12 @@ onMounted(() => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.data.length > 0) { // 过滤不可用的网元 - neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( + neSelectOptions.value = neInfoStore.getNeSelectOtions.filter( (item: any) => { - return !['OMC'].includes(item.value); + return !['OMC','LMF','NEF'].includes(item.value); } ); - if (neCascaderOptions.value.length === 0) { + if (neSelectOptions.value.length === 0) { message.warning({ content: t('common.noData'), duration: 2, @@ -1090,13 +1074,13 @@ onMounted(() => { return; } // 默认选择AMF - const item = neCascaderOptions.value.find(s => s.value === 'AMF'); + const item = neSelectOptions.value.find(s => s.value === 'AMF'); if (item && item.children) { const info = item.children[0]; - neTypeSelect.value = [info.neType, info.neId]; + treeState.neType = info.neType; } else { - const info = neCascaderOptions.value[0].children[0]; - neTypeSelect.value = [info.neType, info.neId]; + const info = neSelectOptions.value[0].children[0]; + treeState.neType = info.neType; } fnGetNeConfig(); } @@ -1118,7 +1102,7 @@ onMounted(() => { > - + { - (管理员/教师)保存当前网元为示例配置 - (学生/教师)重置当前网元为示例配置 - (学生)申请应用当前网元配置 + + (管理员)载入网元配置为示例配置 + + + (学生)重置为班级示例/(教师)重置为系统示例 + + + (学生)申请应用当前网元配置 + @@ -1155,9 +1145,9 @@ onMounted(() => { > - @@ -1576,7 +1566,7 @@ onMounted(() => {