fix: 看板定时任务开启
This commit is contained in:
@@ -83,11 +83,57 @@ function fnGetState() {
|
||||
});
|
||||
}
|
||||
|
||||
stateTimeout.value = setTimeout(() => fnGetState(), 10_000);
|
||||
stateTimeout.value = setTimeout(() => fnGetState(), 5_000);
|
||||
}
|
||||
|
||||
/**获取概览信息 */
|
||||
async function fnGetSkim() {
|
||||
const resArr = await Promise.allSettled([
|
||||
listSub({
|
||||
neid: '001',
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
}),
|
||||
listBase5G({
|
||||
neType: 'AMF',
|
||||
neId: '001',
|
||||
id: '',
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
}),
|
||||
listUENumBySMF('001'),
|
||||
listUENumByIMS('001'),
|
||||
]);
|
||||
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
const res0 = resArr[0].value;
|
||||
if (res0.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.udmSubNum = res0.total;
|
||||
}
|
||||
}
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
const res1 = resArr[1].value;
|
||||
if (res1.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.nbNum = res1.total;
|
||||
}
|
||||
}
|
||||
if (resArr[2].status === 'fulfilled') {
|
||||
const res2 = resArr[2].value;
|
||||
if (res2.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.smfUeNum = res2.data;
|
||||
}
|
||||
}
|
||||
if (resArr[3].status === 'fulfilled') {
|
||||
const res3 = resArr[3].value;
|
||||
if (res3.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.imsUeNum = res3.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**初始数据函数 */
|
||||
function InitData() {
|
||||
function loadData() {
|
||||
fnGetState(); // 获取网元状态
|
||||
cdrEventSend();
|
||||
ueEventSend();
|
||||
@@ -104,60 +150,14 @@ function InitData() {
|
||||
} else if (upfTFActive.value === 2) {
|
||||
upfTFSend(0);
|
||||
}
|
||||
fnGetSkim(); // 获取概览信息
|
||||
}, 10_000);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
Promise.allSettled([
|
||||
listSub({
|
||||
neid: '001',
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
}),
|
||||
listBase5G({
|
||||
neType: 'AMF',
|
||||
neId: '001',
|
||||
id: '',
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
}),
|
||||
listUENumBySMF('001'),
|
||||
listUENumByIMS('001'),
|
||||
])
|
||||
.then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
const res = resArr[0].value;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.udmSubNum = res.total;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
resArr[1].status === 'fulfilled' &&
|
||||
resArr[1].value.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(resArr[1].value.rows)
|
||||
) {
|
||||
skimState.nbNum = resArr[1].value.rows.length;
|
||||
}
|
||||
|
||||
if (resArr[2].status === 'fulfilled') {
|
||||
const res = resArr[2].value;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.smfUeNum = res.data;
|
||||
}
|
||||
}
|
||||
|
||||
if (resArr[3].status === 'fulfilled') {
|
||||
const res = resArr[3].value;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
skimState.imsUeNum = res.data;
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
InitData();
|
||||
});
|
||||
fnGetSkim().then(() => {
|
||||
loadData();
|
||||
});
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
Reference in New Issue
Block a user