fix: 开站网元信息无终端配置时不显示,没有则新建个默认的占位

This commit is contained in:
TsMask
2024-06-11 10:28:16 +08:00
parent 04cbdc6b11
commit eadd4709ee

View File

@@ -313,16 +313,19 @@ function fnGetList() {
listAllNeInfo({ listAllNeInfo({
bandHost: true, bandHost: true,
}).then(res => { }).then(res => {
console.log(res);
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
for (const item of res.data) { for (const item of res.data) {
if (item.neType === 'OMC') continue; if (item.neType === 'OMC' || !Array.isArray(item.hosts)) continue;
tabState.panes.push({ tabState.panes.push({
key: `${item.neType}@${item.neId}`, key: `${item.neType}@${item.neId}`,
data: item, data: item,
status: false, status: false,
}); });
} }
// 没有终端信息时,新建一个占位
if (tabState.panes.length === 0) {
fnTabCreate();
}
// 选择首个 // 选择首个
if (tabState.panes.length > 0) { if (tabState.panes.length > 0) {
tabState.activeKey = tabState.panes[0].key; tabState.activeKey = tabState.panes[0].key;