feat: refs #8045 modified icon and route to redirect from CardDescriptor
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
f465b8219e
commit
aa15a31b39
|
@ -5,7 +5,7 @@ import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
|||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useClipboard } from 'src/composables/useClipboard';
|
||||
import VnMoreOptions from './VnMoreOptions.vue';
|
||||
|
||||
|
@ -42,6 +42,7 @@ const $props = defineProps({
|
|||
|
||||
const state = useState();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { copyText } = useClipboard();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -111,11 +112,15 @@ function copyIdText(id) {
|
|||
|
||||
const emit = defineEmits(['onFetch']);
|
||||
|
||||
const iconModule = computed(() => route.matched[1].meta.icon);
|
||||
const toModule = computed(() =>
|
||||
route.matched[1].path.split('/').length > 2
|
||||
? route.matched[1].redirect
|
||||
: route.matched[1].children[0].redirect,
|
||||
const iconModule = computed(
|
||||
() =>
|
||||
router.options.routes[1].children.find((r) => r.name === $props.dataKey).meta
|
||||
.icon,
|
||||
);
|
||||
const toModule = computed(
|
||||
() =>
|
||||
router.options.routes[1].children.find((r) => r.name === $props.dataKey)
|
||||
.children[0].redirect,
|
||||
);
|
||||
</script>
|
||||
|
||||
|
@ -123,8 +128,8 @@ const toModule = computed(() =>
|
|||
<div class="descriptor">
|
||||
<template v-if="entity && !isLoading">
|
||||
<div class="header bg-primary q-pa-sm justify-between">
|
||||
<slot name="header-extra-action"
|
||||
><QBtn
|
||||
<slot name="header-extra-action">
|
||||
<QBtn
|
||||
round
|
||||
flat
|
||||
dense
|
||||
|
@ -132,13 +137,13 @@ const toModule = computed(() =>
|
|||
:icon="iconModule"
|
||||
color="white"
|
||||
class="link"
|
||||
:to="$attrs['to-module'] ?? toModule"
|
||||
:to="toModule"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('globals.goToModuleIndex') }}
|
||||
</QTooltip>
|
||||
</QBtn></slot
|
||||
>
|
||||
</QBtn>
|
||||
</slot>
|
||||
<QBtn
|
||||
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
|
||||
round
|
||||
|
|
Loading…
Reference in New Issue