style: 网元列表加载同时清除缓存

This commit is contained in:
TsMask
2024-12-19 11:14:55 +08:00
parent b64c4c66ab
commit 7d470fd681

View File

@@ -357,7 +357,8 @@ function fnGetList(pageNum?: number) {
if (pageNum) {
queryParams.pageNum = pageNum;
}
listNeInfo(toRaw(queryParams)).then(res => {
listNeInfo(toRaw(queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
@@ -383,6 +384,10 @@ function fnGetList(pageNum?: number) {
});
}
tableState.loading = false;
})
.finally(() => {
// 刷新缓存的网元信息
useNeInfoStore().fnRefreshNelist();
});
}
@@ -441,14 +446,9 @@ onMounted(() => {
}
});
// 刷新缓存的网元信息
useNeInfoStore()
.fnRefreshNelist()
.finally(() => {
// 获取列表数据
fnGetList();
});
});
</script>
<template>