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 { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useClipboard } from 'src/composables/useClipboard';
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { copyText } = useClipboard();
|
const { copyText } = useClipboard();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -111,11 +112,15 @@ function copyIdText(id) {
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const iconModule = computed(() => route.matched[1].meta.icon);
|
const iconModule = computed(
|
||||||
const toModule = computed(() =>
|
() =>
|
||||||
route.matched[1].path.split('/').length > 2
|
router.options.routes[1].children.find((r) => r.name === $props.dataKey).meta
|
||||||
? route.matched[1].redirect
|
.icon,
|
||||||
: route.matched[1].children[0].redirect,
|
);
|
||||||
|
const toModule = computed(
|
||||||
|
() =>
|
||||||
|
router.options.routes[1].children.find((r) => r.name === $props.dataKey)
|
||||||
|
.children[0].redirect,
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -123,8 +128,8 @@ const toModule = computed(() =>
|
||||||
<div class="descriptor">
|
<div class="descriptor">
|
||||||
<template v-if="entity && !isLoading">
|
<template v-if="entity && !isLoading">
|
||||||
<div class="header bg-primary q-pa-sm justify-between">
|
<div class="header bg-primary q-pa-sm justify-between">
|
||||||
<slot name="header-extra-action"
|
<slot name="header-extra-action">
|
||||||
><QBtn
|
<QBtn
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
@ -132,13 +137,13 @@ const toModule = computed(() =>
|
||||||
:icon="iconModule"
|
:icon="iconModule"
|
||||||
color="white"
|
color="white"
|
||||||
class="link"
|
class="link"
|
||||||
:to="$attrs['to-module'] ?? toModule"
|
:to="toModule"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('globals.goToModuleIndex') }}
|
{{ t('globals.goToModuleIndex') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn></slot
|
</QBtn>
|
||||||
>
|
</slot>
|
||||||
<QBtn
|
<QBtn
|
||||||
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
|
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
|
||||||
round
|
round
|
||||||
|
|
Loading…
Reference in New Issue