style: 网元接口/补充注释

This commit is contained in:
TsMask
2023-09-25 19:51:49 +08:00
parent 67d77b1ae9
commit 5903bb49ed
4 changed files with 30 additions and 9 deletions

View File

@@ -11,7 +11,6 @@ import Tabs from './components/Tabs.vue';
import { scriptUrl } from '@/assets/js/icon_font_8d5l8fzk5b87iudi'; import { scriptUrl } from '@/assets/js/icon_font_8d5l8fzk5b87iudi';
import { computed, reactive, watch } from 'vue'; import { computed, reactive, watch } from 'vue';
import useLayoutStore from '@/store/modules/layout'; import useLayoutStore from '@/store/modules/layout';
import useAppStore from '@/store/modules/app';
import useRouterStore from '@/store/modules/router'; import useRouterStore from '@/store/modules/router';
import useTabsStore from '@/store/modules/tabs'; import useTabsStore from '@/store/modules/tabs';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@@ -19,7 +18,6 @@ import { MENU_PATH_INLINE } from '@/constants/menu-constants';
const { proConfig, waterMarkContent } = useLayoutStore(); const { proConfig, waterMarkContent } = useLayoutStore();
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
const { t } = useI18n(); const { t } = useI18n();
const { appName } = useAppStore();
const routerStore = useRouterStore(); const routerStore = useRouterStore();
const tabsStore = useTabsStore(); const tabsStore = useTabsStore();
const router = useRouter(); const router = useRouter();

View File

@@ -2,22 +2,26 @@ import { defineStore } from 'pinia';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { getNelistAll } from '@/api/configManage/neManage'; import { getNelistAll } from '@/api/configManage/neManage';
import { parseDataToOptions } from '@/utils/parse-tree-utils'; import { parseDataToOptions } from '@/utils/parse-tree-utils';
import { getNeTraceInterfaceAll } from '@/api/trace/task';
/**网元信息类型 */ /**网元信息类型 */
type NeInfo = { type NeInfo = {
/**网元列表 */ /**网元列表 */
nelist: Record<string, any>[]; neList: Record<string, any>[];
/**级联options树结构 */ /**级联options树结构 */
neCascaderOtions: Record<string, any>[]; neCascaderOtions: Record<string, any>[];
/**选择器单级父类型 */ /**选择器单级父类型 */
neSelectOtions: Record<string, any>[]; neSelectOtions: Record<string, any>[];
/**跟踪接口列表 */
traceInterfaceList: Record<string, any>[];
}; };
const useNeInfoStore = defineStore('neinfo', { const useNeInfoStore = defineStore('neinfo', {
state: (): NeInfo => ({ state: (): NeInfo => ({
nelist: [], neList: [],
neCascaderOtions: [], neCascaderOtions: [],
neSelectOtions: [], neSelectOtions: [],
traceInterfaceList: [],
}), }),
getters: { getters: {
/** /**
@@ -40,20 +44,20 @@ const useNeInfoStore = defineStore('neinfo', {
actions: { actions: {
// 刷新网元列表 // 刷新网元列表
async fnRefreshNelist() { async fnRefreshNelist() {
this.nelist = []; this.neList = [];
const res = await this.fnNelist(); const res = await this.fnNelist();
return res; return res;
}, },
// 获取网元列表 // 获取网元列表
async fnNelist() { async fnNelist() {
// 有数据不请求 // 有数据不请求
if (this.nelist.length > 0) { if (this.neList.length > 0) {
return { code: 1, data: this.nelist, msg: 'success' }; return { code: 1, data: this.neList, msg: 'success' };
} }
const res = await getNelistAll(); const res = await getNelistAll();
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
// 原始列表 // 原始列表
this.nelist = res.data; this.neList = res.data;
// 转级联数据 // 转级联数据
const options = parseDataToOptions( const options = parseDataToOptions(
@@ -69,6 +73,24 @@ const useNeInfoStore = defineStore('neinfo', {
} }
return res; return res;
}, },
// 刷新跟踪接口列表
async fnRefreshNeTraceInterface() {
this.traceInterfaceList = [];
const res = await this.fnNeTraceInterface();
return res;
},
// 获取跟踪接口列表
async fnNeTraceInterface() {
// 有数据不请求
if (this.traceInterfaceList.length > 0) {
return { code: 1, data: this.traceInterfaceList, msg: 'success' };
}
const res = await getNeTraceInterfaceAll();
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
this.traceInterfaceList = res.data;
}
return res;
},
}, },
}); });

View File

@@ -525,7 +525,7 @@ onMounted(() => {
<template #icon><ReloadOutlined /></template> <template #icon><ReloadOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip placement="bottomRight">
<template #title>密度</template> <template #title>密度</template>
<a-dropdown trigger="click"> <a-dropdown trigger="click">
<a-button type="text"> <a-button type="text">

View File

@@ -49,6 +49,7 @@ let modalState: ModalStateType = reactive({
downBtn: false, downBtn: false,
}); });
/**网元类型选择对应修改 */
function fnNeChange(_: any, item: any) { function fnNeChange(_: any, item: any) {
modalState.from.ip = item[1].ip; modalState.from.ip = item[1].ip;
modalState.execLogMsg = ''; modalState.execLogMsg = '';