Refactor
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 1009 B |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="300px" height="200px" viewBox="0 0 300 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>Artboard</title>
|
|
||||||
<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<rect id="Rectangle" fill="#F8F9FA" x="0" y="0" width="300" height="200"></rect>
|
|
||||||
<g id="image" transform="translate(110.000000, 70.000000)" fill="#BABABC" fill-rule="nonzero">
|
|
||||||
<path d="M75,0 L5,0 C2.23857625,0 0,2.23857625 0,5 L0,55 C0,57.7614237 2.23857625,60 5,60 L75,60 C77.7614237,60 80,57.7614237 80,55 L80,5 C80,2.23857625 77.7614237,0 75,0 Z M20,10 C25.5228475,10 30,14.4771525 30,20 C30,25.5228475 25.5228475,30 20,30 C14.4771525,30 10,25.5228475 10,20 C10,14.4771525 14.4771525,10 20,10 Z M70,40 L70,50 L10,50 L10,40 L18.55,35.7 C19.4648753,35.2524957 20.5351247,35.2524957 21.45,35.7 L30,40 L53.65,21.1 C54.4866298,20.4991452 55.6133702,20.4991452 56.45,21.1 L70,30 L70,40 Z" id="Shape"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -26,7 +26,8 @@ const containerClass = computed(() => {
|
|||||||
'layout-mobile-active': layoutState.staticMenuMobileActive
|
'layout-mobile-active': layoutState.staticMenuMobileActive
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const bindOutsideClickListener = () => {
|
|
||||||
|
function bindOutsideClickListener() {
|
||||||
if (!outsideClickListener.value) {
|
if (!outsideClickListener.value) {
|
||||||
outsideClickListener.value = (event) => {
|
outsideClickListener.value = (event) => {
|
||||||
if (isOutsideClicked(event)) {
|
if (isOutsideClicked(event)) {
|
||||||
@@ -35,19 +36,21 @@ const bindOutsideClickListener = () => {
|
|||||||
};
|
};
|
||||||
document.addEventListener('click', outsideClickListener.value);
|
document.addEventListener('click', outsideClickListener.value);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const unbindOutsideClickListener = () => {
|
|
||||||
|
function unbindOutsideClickListener() {
|
||||||
if (outsideClickListener.value) {
|
if (outsideClickListener.value) {
|
||||||
document.removeEventListener('click', outsideClickListener);
|
document.removeEventListener('click', outsideClickListener);
|
||||||
outsideClickListener.value = null;
|
outsideClickListener.value = null;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const isOutsideClicked = (event) => {
|
|
||||||
|
function isOutsideClicked(event) {
|
||||||
const sidebarEl = document.querySelector('.layout-sidebar');
|
const sidebarEl = document.querySelector('.layout-sidebar');
|
||||||
const topbarEl = document.querySelector('.layout-menu-button');
|
const topbarEl = document.querySelector('.layout-menu-button');
|
||||||
|
|
||||||
return !(sidebarEl.isSameNode(event.target) || sidebarEl.contains(event.target) || topbarEl.isSameNode(event.target) || topbarEl.contains(event.target));
|
return !(sidebarEl.isSameNode(event.target) || sidebarEl.contains(event.target) || topbarEl.isSameNode(event.target) || topbarEl.contains(event.target));
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ watch(
|
|||||||
isActiveMenu.value = newVal === itemKey.value || newVal.startsWith(itemKey.value + '-');
|
isActiveMenu.value = newVal === itemKey.value || newVal.startsWith(itemKey.value + '-');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const itemClick = (event, item) => {
|
|
||||||
|
function itemClick(event, item) {
|
||||||
if (item.disabled) {
|
if (item.disabled) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
@@ -60,11 +61,11 @@ const itemClick = (event, item) => {
|
|||||||
const foundItemKey = item.items ? (isActiveMenu.value ? props.parentItemKey : itemKey) : itemKey.value;
|
const foundItemKey = item.items ? (isActiveMenu.value ? props.parentItemKey : itemKey) : itemKey.value;
|
||||||
|
|
||||||
setActiveMenuItem(foundItemKey);
|
setActiveMenuItem(foundItemKey);
|
||||||
};
|
}
|
||||||
|
|
||||||
const checkActiveRoute = (item) => {
|
function checkActiveRoute(item) {
|
||||||
return route.path === item.to;
|
return route.path === item.to;
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ watch([getPrimary, getSurface, isDarkTheme], () => {
|
|||||||
<DataTable :value="products" :rows="5" :paginator="true" responsiveLayout="scroll">
|
<DataTable :value="products" :rows="5" :paginator="true" responsiveLayout="scroll">
|
||||||
<Column style="width: 15%" header="Image">
|
<Column style="width: 15%" header="Image">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<img :src="'demo/images/product/' + slotProps.data.image" :alt="slotProps.data.image" width="50" class="shadow" />
|
<img :src="`https://primefaces.org/cdn/primevue/images/product/${slotProps.data.image}`" :alt="slotProps.data.image" width="50" class="shadow" />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="name" header="Name" :sortable="true" style="width: 35%"></Column>
|
<Column field="name" header="Name" :sortable="true" style="width: 35%"></Column>
|
||||||
|
|||||||
@@ -26,20 +26,23 @@ const statuses = ref([
|
|||||||
{ label: 'OUTOFSTOCK', value: 'outofstock' }
|
{ label: 'OUTOFSTOCK', value: 'outofstock' }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const formatCurrency = (value) => {
|
function formatCurrency(value) {
|
||||||
if (value) return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
|
if (value) return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
const openNew = () => {
|
|
||||||
|
function openNew() {
|
||||||
product.value = {};
|
product.value = {};
|
||||||
submitted.value = false;
|
submitted.value = false;
|
||||||
productDialog.value = true;
|
productDialog.value = true;
|
||||||
};
|
}
|
||||||
const hideDialog = () => {
|
|
||||||
|
function hideDialog() {
|
||||||
productDialog.value = false;
|
productDialog.value = false;
|
||||||
submitted.value = false;
|
submitted.value = false;
|
||||||
};
|
}
|
||||||
const saveProduct = () => {
|
|
||||||
|
function saveProduct() {
|
||||||
submitted.value = true;
|
submitted.value = true;
|
||||||
|
|
||||||
if (product?.value.name?.trim()) {
|
if (product?.value.name?.trim()) {
|
||||||
@@ -59,22 +62,26 @@ const saveProduct = () => {
|
|||||||
productDialog.value = false;
|
productDialog.value = false;
|
||||||
product.value = {};
|
product.value = {};
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const editProduct = (prod) => {
|
|
||||||
|
function editProduct(prod) {
|
||||||
product.value = { ...prod };
|
product.value = { ...prod };
|
||||||
productDialog.value = true;
|
productDialog.value = true;
|
||||||
};
|
}
|
||||||
const confirmDeleteProduct = (prod) => {
|
|
||||||
|
function confirmDeleteProduct(prod) {
|
||||||
product.value = prod;
|
product.value = prod;
|
||||||
deleteProductDialog.value = true;
|
deleteProductDialog.value = true;
|
||||||
};
|
}
|
||||||
const deleteProduct = () => {
|
|
||||||
|
function deleteProduct() {
|
||||||
products.value = products.value.filter((val) => val.id !== product.value.id);
|
products.value = products.value.filter((val) => val.id !== product.value.id);
|
||||||
deleteProductDialog.value = false;
|
deleteProductDialog.value = false;
|
||||||
product.value = {};
|
product.value = {};
|
||||||
toast.add({ severity: 'success', summary: 'Successful', detail: 'Product Deleted', life: 3000 });
|
toast.add({ severity: 'success', summary: 'Successful', detail: 'Product Deleted', life: 3000 });
|
||||||
};
|
}
|
||||||
const findIndexById = (id) => {
|
|
||||||
|
function findIndexById(id) {
|
||||||
let index = -1;
|
let index = -1;
|
||||||
for (let i = 0; i < products.value.length; i++) {
|
for (let i = 0; i < products.value.length; i++) {
|
||||||
if (products.value[i].id === id) {
|
if (products.value[i].id === id) {
|
||||||
@@ -84,29 +91,33 @@ const findIndexById = (id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
};
|
}
|
||||||
const createId = () => {
|
|
||||||
|
function createId() {
|
||||||
let id = '';
|
let id = '';
|
||||||
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||||
for (var i = 0; i < 5; i++) {
|
for (var i = 0; i < 5; i++) {
|
||||||
id += chars.charAt(Math.floor(Math.random() * chars.length));
|
id += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
};
|
}
|
||||||
const exportCSV = () => {
|
|
||||||
|
function exportCSV() {
|
||||||
dt.value.exportCSV();
|
dt.value.exportCSV();
|
||||||
};
|
}
|
||||||
const confirmDeleteSelected = () => {
|
|
||||||
|
function confirmDeleteSelected() {
|
||||||
deleteProductsDialog.value = true;
|
deleteProductsDialog.value = true;
|
||||||
};
|
}
|
||||||
const deleteSelectedProducts = () => {
|
|
||||||
|
function deleteSelectedProducts() {
|
||||||
products.value = products.value.filter((val) => !selectedProducts.value.includes(val));
|
products.value = products.value.filter((val) => !selectedProducts.value.includes(val));
|
||||||
deleteProductsDialog.value = false;
|
deleteProductsDialog.value = false;
|
||||||
selectedProducts.value = null;
|
selectedProducts.value = null;
|
||||||
toast.add({ severity: 'success', summary: 'Successful', detail: 'Products Deleted', life: 3000 });
|
toast.add({ severity: 'success', summary: 'Successful', detail: 'Products Deleted', life: 3000 });
|
||||||
};
|
}
|
||||||
|
|
||||||
const getStatusLabel = (status) => {
|
function getStatusLabel(status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'INSTOCK':
|
case 'INSTOCK':
|
||||||
return 'success';
|
return 'success';
|
||||||
@@ -120,7 +131,7 @@ const getStatusLabel = (status) => {
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
const smoothScroll = (id) => {
|
function smoothScroll(id) {
|
||||||
document.body.click();
|
document.body.click();
|
||||||
document.querySelector(id).scrollIntoView({
|
document.querySelector(id).scrollIntoView({
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const items = ref([
|
|||||||
|
|
||||||
const loading = ref([false, false, false]);
|
const loading = ref([false, false, false]);
|
||||||
|
|
||||||
const load = (index) => {
|
function load(index) {
|
||||||
loading.value[index] = true;
|
loading.value[index] = true;
|
||||||
setTimeout(() => (loading.value[index] = false), 1000);
|
setTimeout(() => (loading.value[index] = false), 1000);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ onMounted(() => {
|
|||||||
setColorOptions();
|
setColorOptions();
|
||||||
});
|
});
|
||||||
|
|
||||||
const setColorOptions = () => {
|
function setColorOptions() {
|
||||||
const documentStyle = getComputedStyle(document.documentElement);
|
const documentStyle = getComputedStyle(document.documentElement);
|
||||||
const textColor = documentStyle.getPropertyValue('--text-color');
|
const textColor = documentStyle.getPropertyValue('--text-color');
|
||||||
const textColorSecondary = documentStyle.getPropertyValue('--text-color-secondary');
|
const textColorSecondary = documentStyle.getPropertyValue('--text-color-secondary');
|
||||||
@@ -216,7 +216,7 @@ const setColorOptions = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[getPrimary, getSurface, isDarkTheme],
|
[getPrimary, getSurface, isDarkTheme],
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import { ref } from 'vue';
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const fileupload = ref();
|
const fileupload = ref();
|
||||||
|
|
||||||
const upload = () => {
|
function upload() {
|
||||||
fileupload.value.upload();
|
fileupload.value.upload();
|
||||||
};
|
}
|
||||||
|
|
||||||
const onUpload = () => {
|
function onUpload() {
|
||||||
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ onMounted(() => {
|
|||||||
NodeService.getTreeNodes().then((data) => (treeSelectNodes.value = data));
|
NodeService.getTreeNodes().then((data) => (treeSelectNodes.value = data));
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchCountry = (event) => {
|
function searchCountry(event) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!event.query.trim().length) {
|
if (!event.query.trim().length) {
|
||||||
autoFilteredValue.value = [...autoValue.value];
|
autoFilteredValue.value = [...autoValue.value];
|
||||||
@@ -68,7 +68,7 @@ const searchCountry = (event) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, 250);
|
}, 250);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const getSeverity = (product) => {
|
function getSeverity(product) {
|
||||||
switch (product.inventoryStatus) {
|
switch (product.inventoryStatus) {
|
||||||
case 'INSTOCK':
|
case 'INSTOCK':
|
||||||
return 'success';
|
return 'success';
|
||||||
@@ -30,7 +30,7 @@ const getSeverity = (product) => {
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ onMounted(() => {
|
|||||||
PhotoService.getImages().then((data) => (images.value = data));
|
PhotoService.getImages().then((data) => (images.value = data));
|
||||||
});
|
});
|
||||||
|
|
||||||
const getSeverity = (status) => {
|
function getSeverity(status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'INSTOCK':
|
case 'INSTOCK':
|
||||||
return 'success';
|
return 'success';
|
||||||
@@ -60,7 +60,7 @@ const getSeverity = (status) => {
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -412,13 +412,13 @@ const panelMenuitems = ref([
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const toggleMenu = (event) => {
|
function toggleMenu(event) {
|
||||||
menu.value.toggle(event);
|
menu.value.toggle(event);
|
||||||
};
|
}
|
||||||
|
|
||||||
const onContextRightClick = (event) => {
|
function onContextRightClick(event) {
|
||||||
contextMenu.value.show(event);
|
contextMenu.value.show(event);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -7,21 +7,21 @@ const message = ref([]);
|
|||||||
const username = ref(null);
|
const username = ref(null);
|
||||||
const email = ref(null);
|
const email = ref(null);
|
||||||
|
|
||||||
const showSuccess = () => {
|
function showSuccess() {
|
||||||
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Detail', life: 3000 });
|
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Detail', life: 3000 });
|
||||||
};
|
}
|
||||||
|
|
||||||
const showInfo = () => {
|
function showInfo() {
|
||||||
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Detail', life: 3000 });
|
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Detail', life: 3000 });
|
||||||
};
|
}
|
||||||
|
|
||||||
const showWarn = () => {
|
function showWarn() {
|
||||||
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Detail', life: 3000 });
|
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Detail', life: 3000 });
|
||||||
};
|
}
|
||||||
|
|
||||||
const showError = () => {
|
function showError() {
|
||||||
toast.add({ severity: 'error', summary: 'Error Message', detail: 'Message Detail', life: 3000 });
|
toast.add({ severity: 'error', summary: 'Error Message', detail: 'Message Detail', life: 3000 });
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { onBeforeUnmount, onMounted, ref } from 'vue';
|
|||||||
const value = ref(0);
|
const value = ref(0);
|
||||||
let interval = null;
|
let interval = null;
|
||||||
|
|
||||||
const startProgress = () => {
|
function startProgress() {
|
||||||
interval = setInterval(() => {
|
interval = setInterval(() => {
|
||||||
let newValue = value.value + Math.floor(Math.random() * 10) + 1;
|
let newValue = value.value + Math.floor(Math.random() * 10) + 1;
|
||||||
if (newValue >= 100) {
|
if (newValue >= 100) {
|
||||||
@@ -12,11 +12,12 @@ const startProgress = () => {
|
|||||||
}
|
}
|
||||||
value.value = newValue;
|
value.value = newValue;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
}
|
||||||
const endProgress = () => {
|
|
||||||
|
function endProgress() {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
interval = null;
|
interval = null;
|
||||||
};
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
startProgress();
|
startProgress();
|
||||||
|
|||||||
@@ -24,36 +24,32 @@ onMounted(() => {
|
|||||||
ProductService.getProductsSmall().then((data) => (products.value = data));
|
ProductService.getProductsSmall().then((data) => (products.value = data));
|
||||||
});
|
});
|
||||||
|
|
||||||
const open = () => {
|
function open() {
|
||||||
display.value = true;
|
display.value = true;
|
||||||
};
|
}
|
||||||
|
|
||||||
const close = () => {
|
function close() {
|
||||||
display.value = false;
|
display.value = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
const openConfirmation = () => {
|
function openConfirmation() {
|
||||||
displayConfirmation.value = true;
|
displayConfirmation.value = true;
|
||||||
};
|
}
|
||||||
|
|
||||||
const closeConfirmation = () => {
|
function closeConfirmation() {
|
||||||
displayConfirmation.value = false;
|
displayConfirmation.value = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
const toggle = (event) => {
|
function toggleDataTable(event) {
|
||||||
op.value.toggle(event);
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleDataTable = (event) => {
|
|
||||||
op2.value.toggle(event);
|
op2.value.toggle(event);
|
||||||
};
|
}
|
||||||
|
|
||||||
const onProductSelect = (event) => {
|
function onProductSelect(event) {
|
||||||
op.value.hide();
|
op.value.hide();
|
||||||
toast.add({ severity: 'info', summary: 'Product Selected', detail: event.data.name, life: 3000 });
|
toast.add({ severity: 'info', summary: 'Product Selected', detail: event.data.name, life: 3000 });
|
||||||
};
|
}
|
||||||
|
|
||||||
const confirm = (event) => {
|
function confirm(event) {
|
||||||
confirmPopup.require({
|
confirmPopup.require({
|
||||||
target: event.target,
|
target: event.target,
|
||||||
message: 'Are you sure you want to proceed?',
|
message: 'Are you sure you want to proceed?',
|
||||||
@@ -73,7 +69,7 @@ const confirm = (event) => {
|
|||||||
toast.add({ severity: 'info', summary: 'Rejected', detail: 'You have rejected', life: 3000 });
|
toast.add({ severity: 'info', summary: 'Rejected', detail: 'You have rejected', life: 3000 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ const cardMenu = ref([
|
|||||||
]);
|
]);
|
||||||
const menuRef = ref(null);
|
const menuRef = ref(null);
|
||||||
|
|
||||||
const toggle = () => {
|
function toggle() {
|
||||||
menuRef.value.toggle(event);
|
menuRef.value.toggle(event);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||