This commit is contained in:
2025-04-15 12:16:17 +03:30
parent 57d328bbfe
commit 47de2bf54c
20 changed files with 1557 additions and 195 deletions
@@ -1,6 +1,7 @@
<script setup>
import { ProductService } from '@/service/ProductService';
import { onMounted, ref } from 'vue';
import { BelongingService } from '@/service/BelongingService';
const products = ref(null);
@@ -9,26 +10,26 @@ function formatCurrency(value) {
}
onMounted(() => {
ProductService.getProductsSmall().then((data) => (products.value = data));
BelongingService.getAllBelongings().then((data) => (products.value = data));
});
</script>
<template>
<div class="card">
<div class="font-semibold text-xl mb-4">Recent Sales</div>
<div class="font-semibold text-xl mb-4">آخرین دارایی های افزوده شده</div>
<DataTable :value="products" :rows="5" :paginator="true" responsiveLayout="scroll">
<Column style="width: 15%" header="Image">
<template #body="slotProps">
<img :src="`https://primefaces.org/cdn/primevue/images/product/${slotProps.data.image}`" :alt="slotProps.data.image" width="50" class="shadow" />
<img :src="`${slotProps.data.mainImageUrl}`" :alt="slotProps.data.name" width="50" class="shadow" />
</template>
</Column>
<Column field="name" header="Name" :sortable="true" style="width: 35%"></Column>
<Column field="price" header="Price" :sortable="true" style="width: 35%">
<Column field="name" header="نام" :sortable="true" style="width: 35%"></Column>
<Column field="price" header="دسته بندی" :sortable="true" style="width: 35%">
<template #body="slotProps">
{{ formatCurrency(slotProps.data.price) }}
{{ slotProps.data.category.nativeName }}
</template>
</Column>
<Column style="width: 15%" header="View">
<Column style="width: 15%" header="نمایش">
<template #body>
<Button icon="pi pi-search" type="button" class="p-button-text"></Button>
</template>