Service updates

This commit is contained in:
tugcekucukoglu
2024-07-26 17:05:04 +03:00
parent 34a4d4a98d
commit a60346c2da
24 changed files with 11309 additions and 430 deletions

View File

@@ -1,7 +1,13 @@
<script setup>
import { ref } from 'vue';
import { useToast } from 'primevue/usetoast';
const toast = useToast();
const fileupload = ref();
const upload = () => {
fileupload.value.upload();
};
const onUpload = () => {
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });

View File

@@ -21,10 +21,9 @@ const value7 = ref(null);
const value8 = ref(null);
const value9 = ref(null);
const value10 = ref(null);
const countryService = new CountryService();
onMounted(() => {
countryService.getCountries().then((data) => (countries.value = data));
CountryService.getCountries().then((data) => (countries.value = data));
});
const searchCountry = (event) => {

View File

@@ -72,7 +72,7 @@ const dropdownItem = ref(null);
<label for="lastname1" class="sr-only">Lastname</label>
<InputText id="lastname1" type="text" placeholder="Lastname" />
</div>
<Button label="Submit"></Button>
<Button label="Submit" :fluid="false"></Button>
</div>
</div>
<div class="card flex flex-col gap-4">

View File

@@ -55,12 +55,10 @@ const knobValue = ref(50);
const inputGroupValue = ref(false);
const treeSelectNodes = ref(null);
const selectedNode = ref(null);
const countryService = new CountryService();
const nodeService = new NodeService();
onMounted(() => {
countryService.getCountries().then((data) => (autoValue.value = data));
nodeService.getTreeNodes().then((data) => (treeSelectNodes.value = data));
CountryService.getCountries().then((data) => (autoValue.value = data));
NodeService.getTreeNodes().then((data) => (treeSelectNodes.value = data));
});
const searchCountry = (event) => {

View File

@@ -21,10 +21,9 @@ const cities = ref([
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
]);
const countryService = new CountryService();
onMounted(() => {
countryService.getCountries().then((data) => {
CountryService.getCountries().then((data) => {
countries.value = data;
});
});

View File

@@ -28,10 +28,9 @@ const orderlistValue = ref([
const products = ref(null);
const options = ref(['list', 'grid']);
const layout = ref('grid');
const productService = new ProductService();
onMounted(() => {
productService.getProductsSmall().then((data) => (products.value = data));
ProductService.getProductsSmall().then((data) => (products.value = data));
});
const getSeverity = (product) => {
@@ -81,7 +80,15 @@ const getSeverity = (product) => {
<div class="text-lg font-medium mt-2">{{ item.name }}</div>
</div>
<div class="bg-surface-100 p-1" style="border-radius: 30px">
<div class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2" style="border-radius: 30px; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)">
<div
class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2"
style="
border-radius: 30px;
box-shadow:
0px 1px 2px 0px rgba(0, 0, 0, 0.04),
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
"
>
<span class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
<i class="pi pi-star-fill text-yellow-500"></i>
</div>
@@ -117,7 +124,15 @@ const getSeverity = (product) => {
<div class="text-lg font-medium mt-1">{{ item.name }}</div>
</div>
<div class="bg-surface-100 p-1" style="border-radius: 30px">
<div class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2" style="border-radius: 30px; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)">
<div
class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2"
style="
border-radius: 30px;
box-shadow:
0px 1px 2px 0px rgba(0, 0, 0, 0.04),
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
"
>
<span class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
<i class="pi pi-star-fill text-yellow-500"></i>
</div>

View File

@@ -41,12 +41,9 @@ const carouselResponsiveOptions = ref([
}
]);
const productService = new ProductService();
const photoService = new PhotoService();
onMounted(() => {
productService.getProductsSmall().then((data) => (products.value = data));
photoService.getImages().then((data) => (images.value = data));
ProductService.getProductsSmall().then((data) => (products.value = data));
PhotoService.getImages().then((data) => (images.value = data));
});
const getSeverity = (status) => {

View File

@@ -6,6 +6,7 @@ const toast = useToast();
const message = ref([]);
const username = ref(null);
const email = ref(null);
const value = ref(null);
const count = ref(0);
const addMessage = (type) => {

View File

@@ -17,12 +17,11 @@ const op = ref(null);
const op2 = ref(null);
const popup = ref(null);
const productService = new ProductService();
const toast = useToast();
const confirmPopup = useConfirm();
onMounted(() => {
productService.getProductsSmall().then((data) => (products.value = data));
ProductService.getProductsSmall().then((data) => (products.value = data));
});
const open = () => {

View File

@@ -185,8 +185,8 @@ const toggle = () => {
</div>
</div>
<div class="w-full md:w-2/12">
<Divider layout="vertical" class="!hidden md:flex"><b>OR</b></Divider>
<Divider layout="horizontal" class="flex md:!hidden" align="center"><b>OR</b></Divider>
<Divider layout="vertical" class="hidden md:flex"><b>OR</b></Divider>
<Divider layout="horizontal" class="flex md:hidden" align="center"><b>OR</b></Divider>
</div>
<div class="w-full md:w-5/12 flex items-center justify-center py-5">
<Button label="Sign Up" icon="pi pi-user-plus" severity="success" class="w-full max-w-[17.35rem] mx-auto"></Button>

View File

@@ -26,9 +26,6 @@ const representatives = reactive([
{ name: 'XuXue Feng', image: 'xuxuefeng.png' }
]);
const customerService = new CustomerService();
const productService = new ProductService();
const getOrderSeverity = (order) => {
switch (order.status) {
case 'DELIVERED':
@@ -67,15 +64,31 @@ const getSeverity = (status) => {
}
};
const getStockSeverity = (product) => {
switch (product.inventoryStatus) {
case 'INSTOCK':
return 'success';
case 'LOWSTOCK':
return 'warn';
case 'OUTOFSTOCK':
return 'danger';
default:
return null;
}
};
onBeforeMount(() => {
productService.getProductsWithOrdersSmall().then((data) => (products.value = data));
customerService.getCustomersLarge().then((data) => {
ProductService.getProductsWithOrdersSmall().then((data) => (products.value = data));
CustomerService.getCustomersLarge().then((data) => {
customers1.value = data;
loading1.value = false;
customers1.value.forEach((customer) => (customer.date = new Date(customer.date)));
});
customerService.getCustomersLarge().then((data) => (customers2.value = data));
customerService.getCustomersMedium().then((data) => (customers3.value = data));
CustomerService.getCustomersLarge().then((data) => (customers2.value = data));
CustomerService.getCustomersMedium().then((data) => (customers3.value = data));
initFilters1();
});
@@ -306,7 +319,7 @@ const calculateCustomerTotal = (name) => {
</Column>
<Column header="Status">
<template #body="slotProps">
<Tag :value="slotProps.data.inventoryStatus" :severity="getSeverity(slotProps.data)" />
<Tag :value="slotProps.data.inventoryStatus" :severity="getStockSeverity(slotProps.data)" />
</template>
</Column>
<template #expansion="slotProps">

View File

@@ -6,11 +6,10 @@ const treeValue = ref(null);
const selectedTreeValue = ref(null);
const treeTableValue = ref(null);
const selectedTreeTableValue = ref(null);
const nodeService = new NodeService();
onMounted(() => {
nodeService.getTreeNodes().then((data) => (treeValue.value = data));
nodeService.getTreeTableNodes().then((data) => (treeTableValue.value = data));
NodeService.getTreeNodes().then((data) => (treeValue.value = data));
NodeService.getTreeTableNodes().then((data) => (treeTableValue.value = data));
});
</script>