|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<CommonListPage
|
|
|
- v-if="currentCommonCategoryDefine"
|
|
|
+ v-if="currentCommonCategoryDefine && !loading"
|
|
|
:startTabIndex="pageStartTab"
|
|
|
:hasPadding="hasPadding"
|
|
|
:hasBg="hasBg"
|
|
|
@@ -60,8 +60,11 @@ const emit = defineEmits<{
|
|
|
(e: 'error', error: any): void;
|
|
|
}>();
|
|
|
|
|
|
+const loading = ref(false);
|
|
|
+
|
|
|
async function loadPageConfig() {
|
|
|
- await waitTimeOut(100);
|
|
|
+ loading.value = true;
|
|
|
+ await waitTimeOut(50);
|
|
|
try {
|
|
|
//特殊处理
|
|
|
let hasNestCategory = false;
|
|
|
@@ -76,7 +79,7 @@ async function loadPageConfig() {
|
|
|
}
|
|
|
|
|
|
if (hasNestCategory)
|
|
|
- await waitTimeOut(100);
|
|
|
+ await waitTimeOut(50);
|
|
|
|
|
|
//加载下拉列表
|
|
|
const result = [] as DropDownNames[];
|
|
|
@@ -108,10 +111,14 @@ async function loadPageConfig() {
|
|
|
dropdownNames.value = result;
|
|
|
} catch (error) {
|
|
|
emit('error', error);
|
|
|
+ } finally {
|
|
|
+ loading.value = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
watch(() => props.currentCommonCategoryDefine, loadPageConfig, { immediate: true });
|
|
|
+watch(() => props.currentCommonCategoryDefine?.content, loadPageConfig);
|
|
|
+watch(() => props.currentCommonCategoryContentDefine, loadPageConfig);
|
|
|
onMounted(loadPageConfig);
|
|
|
|
|
|
type RenderTabDefine = IHomeCommonCategoryListTabDefine & {
|