2026-06-14 10:08:46 +03:30
|
|
|
<script setup lang="ts">
|
2026-08-06 20:14:46 +02:00
|
|
|
import { computed } from 'vue'
|
2026-06-14 10:08:46 +03:30
|
|
|
import router from '@/router'
|
2026-08-06 20:14:46 +02:00
|
|
|
import { useSettingsStore } from '@/store/settingsStore'
|
|
|
|
|
import { getBoursecuActionIconSrc } from '@/utils/config'
|
2026-06-14 10:08:46 +03:30
|
|
|
import HomeQuickActionBox from '../../components/HomeQuickActionBox.vue'
|
|
|
|
|
import DesktopHomeCard from './DesktopHomeCard.vue'
|
|
|
|
|
import { boursecuQuickActions } from '../../layouts/configs/boursecuQuickActions'
|
|
|
|
|
import type { HomeQuickActionItem } from '../../layouts/types'
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
actions?: HomeQuickActionItem[]
|
|
|
|
|
}>(),
|
|
|
|
|
{
|
2026-08-06 20:14:46 +02:00
|
|
|
actions: undefined,
|
2026-06-14 10:08:46 +03:30
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-06 20:14:46 +02:00
|
|
|
const settingsStore = useSettingsStore()
|
|
|
|
|
|
|
|
|
|
const resolvedActions = computed(() => {
|
|
|
|
|
if (props.actions) return props.actions
|
|
|
|
|
|
|
|
|
|
const list = [...boursecuQuickActions]
|
|
|
|
|
if (settingsStore.isSettingTruthy('enable_product_funds')) {
|
|
|
|
|
list.push({
|
|
|
|
|
id: 'piggy',
|
|
|
|
|
label: 'قلک',
|
|
|
|
|
icon: 'vuesax-linear:safe-home',
|
|
|
|
|
iconSrc: getBoursecuActionIconSrc('piggy'),
|
|
|
|
|
route: { name: 'piggy' },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return list
|
|
|
|
|
})
|
|
|
|
|
|
2026-06-14 10:08:46 +03:30
|
|
|
function handleClick(action: HomeQuickActionItem) {
|
2026-09-02 08:26:52 -04:00
|
|
|
if (action.handler) {
|
|
|
|
|
action.handler()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (action.route) {
|
|
|
|
|
router.push(action.route)
|
|
|
|
|
}
|
2026-06-14 10:08:46 +03:30
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<DesktopHomeCard title="دسترسی سریع">
|
|
|
|
|
<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6">
|
|
|
|
|
<HomeQuickActionBox
|
2026-08-06 20:14:46 +02:00
|
|
|
v-for="action in resolvedActions"
|
2026-06-14 10:08:46 +03:30
|
|
|
:key="action.id"
|
|
|
|
|
:action="action"
|
|
|
|
|
class="home-desktop-quick-action"
|
|
|
|
|
@click="handleClick(action)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</DesktopHomeCard>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
:deep(.home-desktop-quick-action) {
|
|
|
|
|
min-height: 108px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|