perf: Merge More into Info and update detail page

This commit is contained in:
w940853815
2025-02-13 15:19:08 +08:00
committed by w940853815
parent 55c8dfa549
commit 3e3cb309ce
4 changed files with 11 additions and 44 deletions

View File

@@ -173,7 +173,7 @@ export default {
const data = await this.$store.dispatch('common/getUrlMeta', { url: this.url })
let remoteMeta = data.actions['GET'] || {}
if (this.nested) {
remoteMeta = remoteMeta[this.nested]?.children || {}
remoteMeta = remoteMeta[this.nested]?.children || remoteMeta || {}
}
let fields = this.fields
fields = fields || Object.keys(remoteMeta)

View File

@@ -9,14 +9,12 @@
<script>
import { GenericDetailPage } from '@/layout/components'
import Info from './info.vue'
import More from './more.vue'
export default {
name: 'AccountDiscoverDetail',
components: {
GenericDetailPage,
Info,
More
Info
},
data() {
return {
@@ -32,10 +30,6 @@ export default {
{
title: this.$t('Basic'),
name: 'Info'
},
{
title: this.$t('More'),
name: 'More'
}
],
getTitle: this.getExecutionTitle

View File

@@ -1,6 +1,7 @@
<template>
<TwoCol>
<AutoDetailCard :fields="detailFields" :object="object" :url="url" />
<AutoDetailCard v-bind="moreConfig" />
</TwoCol>
</template>
@@ -28,7 +29,14 @@ export default {
'date_last_login', 'address_last_login',
'remote_present', 'present',
'date_updated', 'status'
]
],
moreConfig: {
url: `/api/v1/accounts/gathered-accounts/${this.object.id}/details/`,
title: this.$t('More'),
object: this.object,
nested: 'detail',
showUndefined: false
}
}
},
computed: {}

View File

@@ -1,35 +0,0 @@
<template>
<TwoCol>
<AutoDetailCard :object="detail" :url="url" />
</TwoCol>
</template>
<script>
import AutoDetailCard from '@/components/Cards/DetailCard/auto.vue'
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
export default {
name: 'AccountDiscoverMore',
components: {
TwoCol,
AutoDetailCard
},
props: {
object: {
type: Object,
default: () => ({})
}
},
data() {
return {
url: `/api/v1/accounts/gathered-accounts/${this.object.id}/details/`,
detail: this.object?.detail
}
},
computed: {}
}
</script>
<style scoped>
</style>