feat: disabled menu
This commit is contained in:
parent
8cb6a87be1
commit
17bf0737eb
3 changed files with 51 additions and 8 deletions
|
|
@ -7,7 +7,9 @@ const router = useRouter();
|
||||||
|
|
||||||
const currentRoute = ref<string>('');
|
const currentRoute = ref<string>('');
|
||||||
|
|
||||||
const labelMenu = ref<{ label: string; icon: string; route: string }[]>([
|
const labelMenu = ref<
|
||||||
|
{ label: string; icon: string; route: string; disabled?: boolean }[]
|
||||||
|
>([
|
||||||
{
|
{
|
||||||
label: 'drawerDashboard',
|
label: 'drawerDashboard',
|
||||||
icon: 'img:/file-account-outline.png',
|
icon: 'img:/file-account-outline.png',
|
||||||
|
|
@ -33,16 +35,43 @@ const labelMenu = ref<{ label: string; icon: string; route: string }[]>([
|
||||||
icon: 'raphael:package',
|
icon: 'raphael:package',
|
||||||
route: '/product-service',
|
route: '/product-service',
|
||||||
},
|
},
|
||||||
{ label: 'drawerQuotation', icon: 'raphael:package', route: '' },
|
{
|
||||||
{ label: 'drawerRequestList', icon: 'raphael:package', route: '' },
|
label: 'drawerQuotation',
|
||||||
{ label: 'drawerWorkOrder', icon: 'raphael:package', route: '' },
|
icon: 'raphael:package',
|
||||||
{ label: 'drawerInvoice', icon: 'raphael:package', route: '' },
|
route: '',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'drawerRequestList',
|
||||||
|
icon: 'raphael:package',
|
||||||
|
route: '',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'drawerWorkOrder',
|
||||||
|
icon: 'raphael:package',
|
||||||
|
route: '',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'drawerInvoice',
|
||||||
|
icon: 'raphael:package',
|
||||||
|
route: '',
|
||||||
|
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'drawerAccountingLedger',
|
label: 'drawerAccountingLedger',
|
||||||
icon: 'mdi-account-cash-outline',
|
icon: 'mdi-account-cash-outline',
|
||||||
route: '',
|
route: '',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'drawerReport',
|
||||||
|
icon: 'mdi-file-chart-outline',
|
||||||
|
route: '',
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{ label: 'drawerReport', icon: 'mdi-file-chart-outline', route: '' },
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
|
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
|
||||||
|
|
@ -83,6 +112,7 @@ function navigateTo(label: string, destination: string) {
|
||||||
v-for="v in labelMenu"
|
v-for="v in labelMenu"
|
||||||
:key="v.label"
|
:key="v.label"
|
||||||
clickable
|
clickable
|
||||||
|
:disable="!!v.disabled"
|
||||||
@click="navigateTo(v.label, v.route)"
|
@click="navigateTo(v.label, v.route)"
|
||||||
class="no-padding"
|
class="no-padding"
|
||||||
:class="{ active: currentRoute === v.label, dark: $q.dark.isActive }"
|
:class="{ active: currentRoute === v.label, dark: $q.dark.isActive }"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ defineProps<{
|
||||||
icon: string;
|
icon: string;
|
||||||
title: string;
|
title: string;
|
||||||
caption: string;
|
caption: string;
|
||||||
|
disabled?: boolean;
|
||||||
isax?: boolean;
|
isax?: boolean;
|
||||||
color:
|
color:
|
||||||
| 'green'
|
| 'green'
|
||||||
|
|
@ -35,10 +36,11 @@ function navigateTo(destination: string) {
|
||||||
<div class="menu-container">
|
<div class="menu-container">
|
||||||
<AppBox
|
<AppBox
|
||||||
class="column inline-flex items-center"
|
class="column inline-flex items-center"
|
||||||
|
:class="{ disabled: !!v.disabled }"
|
||||||
v-for="(v, i) in list"
|
v-for="(v, i) in list"
|
||||||
:key="i"
|
:key="i"
|
||||||
:bordered="$q.dark.isActive"
|
:bordered="$q.dark.isActive"
|
||||||
@click="navigateTo(v.value)"
|
@click="!v.disabled && navigateTo(v.value)"
|
||||||
>
|
>
|
||||||
<AppCircle
|
<AppCircle
|
||||||
:id="`menu-icon-${v.value}`"
|
:id="`menu-icon-${v.value}`"
|
||||||
|
|
@ -65,7 +67,11 @@ function navigateTo(destination: string) {
|
||||||
transition: 100ms border-color ease-in-out;
|
transition: 100ms border-color ease-in-out;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
|
||||||
&:hover {
|
&.disabled {
|
||||||
|
opacity: 0.4;
|
||||||
|
filter: grayscale(1);
|
||||||
|
}
|
||||||
|
&:not(.disabled):hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-color: var(--brand-1);
|
border-color: var(--brand-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ const menu = [
|
||||||
color: 'violet',
|
color: 'violet',
|
||||||
title: 'mainQuotationTitle',
|
title: 'mainQuotationTitle',
|
||||||
caption: 'mainQuotationCaption',
|
caption: 'mainQuotationCaption',
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -46,6 +47,7 @@ const menu = [
|
||||||
title: 'mainRequestTitle',
|
title: 'mainRequestTitle',
|
||||||
caption: 'mainRequestCaption',
|
caption: 'mainRequestCaption',
|
||||||
isax: true,
|
isax: true,
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -54,6 +56,7 @@ const menu = [
|
||||||
title: 'mainOrderTitle',
|
title: 'mainOrderTitle',
|
||||||
caption: 'mainOrderCaption',
|
caption: 'mainOrderCaption',
|
||||||
isax: true,
|
isax: true,
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -61,6 +64,7 @@ const menu = [
|
||||||
color: 'camo',
|
color: 'camo',
|
||||||
title: 'mainReceiptTitle',
|
title: 'mainReceiptTitle',
|
||||||
caption: 'mainReceiptCaption',
|
caption: 'mainReceiptCaption',
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -69,6 +73,7 @@ const menu = [
|
||||||
title: 'mainFinanceTitle',
|
title: 'mainFinanceTitle',
|
||||||
caption: 'mainFinanceCaption',
|
caption: 'mainFinanceCaption',
|
||||||
isax: true,
|
isax: true,
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -77,6 +82,7 @@ const menu = [
|
||||||
title: 'mainDashboardTitle',
|
title: 'mainDashboardTitle',
|
||||||
caption: 'mainDashboardCaption',
|
caption: 'mainDashboardCaption',
|
||||||
isax: true,
|
isax: true,
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
@ -84,6 +90,7 @@ const menu = [
|
||||||
color: 'indigo',
|
color: 'indigo',
|
||||||
title: 'mainReportTitle',
|
title: 'mainReportTitle',
|
||||||
caption: 'mainReportCaption',
|
caption: 'mainReportCaption',
|
||||||
|
disabled: true,
|
||||||
},
|
},
|
||||||
] satisfies InstanceType<typeof MenuItem>['$props']['list'];
|
] satisfies InstanceType<typeof MenuItem>['$props']['list'];
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue