Property system: - Add PropertyService.js and PropertyStatusService.js - Add Property pages: CreateProperty.vue, ListProperties.vue, TransactionDialog.vue - Remove legacy BelongingService.js and Belonging pages (CreateBelonging, ListBelongings, TransactionDialog) Dashboard: - Update RecentSalesWidget.vue - Update RevenueStreamWidget.vue - Update StatsWidget.vue UI & config: - Major MapComponent.vue improvements (extended functionality) - Update ListCategories.vue - Update ListTransactions.vue - Update vite.config.mjs
96 lines
2.5 KiB
Vue
96 lines
2.5 KiB
Vue
<script setup>
|
|
import { useLayout } from '@/layout/composables/layout';
|
|
import { onMounted, ref, watch } from 'vue';
|
|
|
|
const { getPrimary, getSurface, isDarkTheme } = useLayout();
|
|
|
|
const chartData = ref(null);
|
|
const chartOptions = ref(null);
|
|
|
|
function setChartData() {
|
|
const documentStyle = getComputedStyle(document.documentElement);
|
|
|
|
return {
|
|
labels: ['زمین', 'ساختمان'],
|
|
datasets: [
|
|
{
|
|
type: 'bar',
|
|
label: 'تعداد املاک',
|
|
backgroundColor: documentStyle.getPropertyValue('--p-primary-400'),
|
|
font: {
|
|
family: 'Estedad',
|
|
size: 14
|
|
},
|
|
data: [18, 13],
|
|
barThickness: 32
|
|
}
|
|
]
|
|
};
|
|
}
|
|
|
|
function setChartOptions() {
|
|
const documentStyle = getComputedStyle(document.documentElement);
|
|
const borderColor = documentStyle.getPropertyValue('--surface-border');
|
|
const textMutedColor = documentStyle.getPropertyValue('--text-color-secondary');
|
|
|
|
return {
|
|
maintainAspectRatio: false,
|
|
aspectRatio: 0.8,
|
|
scales: {
|
|
x: {
|
|
stacked: true,
|
|
ticks: {
|
|
color: textMutedColor,
|
|
font: {
|
|
family: 'Estedad',
|
|
size: 14
|
|
}
|
|
},
|
|
grid: {
|
|
color: 'transparent',
|
|
borderColor: 'transparent'
|
|
}
|
|
},
|
|
y: {
|
|
stacked: true,
|
|
ticks: {
|
|
color: textMutedColor,
|
|
font: {
|
|
family: 'Estedad',
|
|
size: 14
|
|
}
|
|
},
|
|
grid: {
|
|
color: borderColor,
|
|
borderColor: 'transparent',
|
|
drawTicks: false
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
watch([getPrimary, getSurface, isDarkTheme], () => {
|
|
chartData.value = setChartData();
|
|
chartOptions.value = setChartOptions();
|
|
});
|
|
|
|
onMounted(() => {
|
|
chartData.value = setChartData();
|
|
chartOptions.value = setChartOptions();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="card">
|
|
<div class="font-semibold text-xl mb-4">تقسیم بندی املاک</div>
|
|
<Chart type="bar" :data="chartData" :options="chartOptions" class="h-80" />
|
|
</div>
|
|
</template>
|
|
|
|
<style>
|
|
.card {
|
|
font-family: 'Estedad', sans-serif !important;
|
|
}
|
|
</style>
|