fix: 修复breadcrumb未刷新列表问题

fix: 修复breadcrumb未刷新列表问题
This commit is contained in:
wangdan-fit2cloud 2024-07-01 02:47:21 -07:00 committed by GitHub
commit a6bcceb716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View File

@ -112,7 +112,7 @@
</template>
</el-dropdown>
</div>
<CreateApplicationDialog ref="CreateApplicationDialogRef" />
<CreateApplicationDialog ref="CreateApplicationDialogRef" @refresh="refresh" />
</template>
<script setup lang="ts">
@ -127,7 +127,7 @@ const router = useRouter()
const {
meta: { activeMenu },
params: { id }
} = route
} = route as any
onBeforeRouteLeave((to, from) => {
common.saveBreadcrumb(null)
@ -140,19 +140,14 @@ const loading = ref(false)
const breadcrumbData = computed(() => common.breadcrumb)
const current = computed(() => {
const {
params: { id }
} = route
return list.value?.filter((v) => v.id === id)?.[0]
})
const isApplication = computed(() => {
const { meta } = route as any
return meta?.activeMenu.includes('application')
return activeMenu.includes('application')
})
const isDataset = computed(() => {
const { meta } = route as any
return meta?.activeMenu.includes('dataset')
return activeMenu.includes('dataset')
})
function openCreateDialog() {
@ -207,6 +202,12 @@ function getApplication() {
loading.value = false
})
}
function refresh() {
if (isApplication.value) {
common.saveBreadcrumb(null)
getApplication()
}
}
onMounted(() => {
if (!breadcrumbData.value) {
if (isDataset.value) {

View File

@ -198,6 +198,7 @@ import emptyImg from '@/assets/hit-test-empty.png'
const route = useRoute()
const {
meta: { activeMenu },
params: { id }
} = route as any
@ -223,12 +224,10 @@ const questionTitle = ref('')
const isDisabledChart = computed(() => !inputValue.value)
const isApplication = computed(() => {
const { meta } = route as any
return meta?.activeMenu.includes('application')
return activeMenu.includes('application')
})
const isDataset = computed(() => {
const { meta } = route as any
return meta?.activeMenu.includes('dataset')
return activeMenu.includes('dataset')
})
function changeHandle(val: string) {