refs #6080 Changes in components
gitea/salix-front/pipeline/head There was a failure building this commit
Details
gitea/salix-front/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
d16c215936
commit
0b066062ea
|
@ -107,20 +107,72 @@ async function togglePinned(item, event) {
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
function firstLower(str) {
|
||||||
|
return str[0].toLowerCase() + str.slice(1);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QList padding>
|
<QList padding>
|
||||||
<template v-if="$props.source === 'main'">
|
<template v-if="$props.source === 'main'">
|
||||||
<template v-if="this.$route.matched[1].name === 'Dashboard'">
|
<template v-if="this.$route.matched[1].name === 'Dashboard'">
|
||||||
<QItemLabel header>
|
<QItem class="header">
|
||||||
{{ t('globals.modules') }}
|
<QItemSection avatar>
|
||||||
</QItemLabel>
|
<QIcon name="view_module" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection> {{ t('globals.modules') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
</template>
|
|
||||||
<template v-for="item in items" :key="item.name">
|
<template v-for="item in items" :key="item.name">
|
||||||
<template v-if="item.name === this.$route.matched[1].name || this.$route.matched[1].name === 'Dashboard'">
|
<template v-if="item.children">
|
||||||
|
<LeftMenuItem :item="item" group="modules">
|
||||||
|
<template #side>
|
||||||
|
<QBtn
|
||||||
|
v-if="item.isPinned === true"
|
||||||
|
@click="togglePinned(item, $event)"
|
||||||
|
icon="remove_circle"
|
||||||
|
size="xs"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('components.leftMenu.removeFromPinned') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
v-if="item.isPinned === false"
|
||||||
|
@click="togglePinned(item, $event)"
|
||||||
|
icon="push_pin"
|
||||||
|
size="xs"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('components.leftMenu.addToPinned') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</template>
|
||||||
|
</LeftMenuItem>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-for="item in items" :key="item.name">
|
||||||
|
<template v-if="item.name === this.$route.matched[1].name">
|
||||||
|
<QItem class="header">
|
||||||
|
<QItemSection avatar v-if="item.icon">
|
||||||
|
<QIcon :name="item.icon" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection avatar v-if="!item.icon">
|
||||||
|
<QIcon name="disabled_by_default" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t(item.title) }}</QItemSection>
|
||||||
|
<QItemSection side>
|
||||||
|
<slot name="side" :item="item" />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QSeparator />
|
||||||
<template v-if="item.children">
|
<template v-if="item.children">
|
||||||
<LeftMenuItemGroup :item="item" group="modules">
|
<LeftMenuItemGroup :item="item" group="modules">
|
||||||
<template #side>
|
<template #side>
|
||||||
|
@ -153,7 +205,6 @@ async function togglePinned(item, event) {
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<QSeparator />
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="$props.source === 'card'">
|
<template v-if="$props.source === 'card'">
|
||||||
<template v-for="item in items" :key="item.name">
|
<template v-for="item in items" :key="item.name">
|
||||||
|
@ -171,4 +222,7 @@ async function togglePinned(item, event) {
|
||||||
.pinned:hover .q-btn {
|
.pinned:hover .q-btn {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
.header {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -22,5 +22,8 @@ const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys
|
||||||
<QIcon name="disabled_by_default" />
|
<QIcon name="disabled_by_default" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t(item.title) }}</QItemSection>
|
<QItemSection>{{ t(item.title) }}</QItemSection>
|
||||||
|
<QItemSection side>
|
||||||
|
<slot name="side" :item="item" />
|
||||||
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import LeftMenuItem from './LeftMenuItem.vue';
|
import LeftMenuItem from './LeftMenuItem.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -19,33 +14,9 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys
|
const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys
|
||||||
const isOpened = computed(() => {
|
|
||||||
const { matched } = route;
|
|
||||||
const { name } = item.value;
|
|
||||||
|
|
||||||
return matched.some((item) => item.name === name);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QExpansionItem
|
|
||||||
:group="props.group"
|
|
||||||
active-class="text-primary"
|
|
||||||
:label="item.title"
|
|
||||||
:to="{ name: item.name }"
|
|
||||||
expand-separator
|
|
||||||
:default-opened="isOpened"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<QItemSection avatar>
|
|
||||||
<QIcon :name="item.icon"></QIcon>
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection>{{ t(item.title) }}</QItemSection>
|
|
||||||
<QItemSection side>
|
|
||||||
<slot name="side" :item="item" />
|
|
||||||
</QItemSection>
|
|
||||||
</template>
|
|
||||||
<template v-for="section in item.children" :key="section.name">
|
<template v-for="section in item.children" :key="section.name">
|
||||||
<LeftMenuItem :item="section" />
|
<LeftMenuItem :item="section" />
|
||||||
</template>
|
</template>
|
||||||
</QExpansionItem>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue