diff --git a/electron.js b/electron.js index df5f212..74f1dcb 100644 --- a/electron.js +++ b/electron.js @@ -16,7 +16,7 @@ function createWindow() { } }); win.loadURL('http://localhost:8080'); - //win.loadFile(path.join(__dirname, 'dist/index.html')); + // win.loadFile(path.join(__dirname, 'dist/index.html')); } app.whenReady().then(createWindow); diff --git a/src/App.vue b/src/App.vue index c82800a..94bb4aa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,7 +31,7 @@ onMounted(() => { :root { --header-height: 150px !important; --app-shadow: rgba(0, 0, 0, 0.45); - --navmenu-height: 200px; + --navmenu-height: 210px; } body { @@ -69,6 +69,7 @@ body { label { text-align: left !important; + text-transform: capitalize; } .window-container { diff --git a/src/components/app/Layout.vue b/src/components/app/Layout.vue index 259da68..0a541d1 100644 --- a/src/components/app/Layout.vue +++ b/src/components/app/Layout.vue @@ -1,14 +1,15 @@ diff --git a/src/components/app/Nav.vue b/src/components/app/Nav.vue index 03ae901..838fdef 100644 --- a/src/components/app/Nav.vue +++ b/src/components/app/Nav.vue @@ -4,10 +4,12 @@ import {onMounted, ref} from "vue"; import {useUi} from "@/pinia/ui"; import {useRouter} from "vue-router"; import {useUserStore} from "@/pinia/user"; +import {useProductStore} from "@/pinia/products"; const router = useRouter(); const ui = useUi(); const userStore = useUserStore(); +const productStore = useProductStore(); const options = ref([ { name: "Aplicacion", items: [ @@ -32,7 +34,12 @@ const options = ref([ }, { name: "Productos", items: [ - {name: "Agregar Producto"}, + { + name: "Agregar Producto", callback: () => { + ui.reset() + productStore.product_modal = true; + } + }, {name: "Generar Venta"}, ] }, @@ -48,10 +55,18 @@ const options = ref([ items: [], url: '/', }, + { + name: "Chat", + items: [], + url: '/', + }, ]); function openMenu(items, name, url) { + if (ui.selectedMenu === name) return; + + ui.setCurrentMenu(null); if (!items) return; if (url) { diff --git a/src/components/app/NavMenu.vue b/src/components/app/NavMenu.vue index 42afa60..efcad51 100644 --- a/src/components/app/NavMenu.vue +++ b/src/components/app/NavMenu.vue @@ -25,6 +25,10 @@ const ui = useUi(); animation: fade .2s ease-in-out forwards; overflow-y: auto; + + &::-webkit-scrollbar { + display: none; + } } .item { diff --git a/src/components/productos/Filters.vue b/src/components/productos/Filters.vue index 0cd5838..d09028a 100644 --- a/src/components/productos/Filters.vue +++ b/src/components/productos/Filters.vue @@ -1,15 +1,22 @@ diff --git a/src/components/productos/ProductModal.vue b/src/components/productos/ProductModal.vue new file mode 100644 index 0000000..7941b65 --- /dev/null +++ b/src/components/productos/ProductModal.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/src/components/productos/Table.vue b/src/components/productos/Table.vue index aeb6220..860f7ce 100644 --- a/src/components/productos/Table.vue +++ b/src/components/productos/Table.vue @@ -2,6 +2,7 @@ import {useUi} from "@/pinia/ui"; import {onMounted} from "vue"; import {useProductStore} from "@/pinia/products"; +import {limit} from "../../services/utils"; const props = defineProps(["items", "headers"]) const productStore = useProductStore(); @@ -20,7 +21,10 @@ onMounted(async () => { - {{ item?.[head?.name?.toLowerCase()] }} + {{ + limit(item?.[head?.name?.toLowerCase()], 30) + }} + @@ -47,6 +51,7 @@ table { thead > tr > th { border-top: none; + text-transform: capitalize; &:first-child { diff --git a/src/pinia/products.js b/src/pinia/products.js index 059a012..0fa502c 100644 --- a/src/pinia/products.js +++ b/src/pinia/products.js @@ -4,7 +4,8 @@ import {DBService, post} from "@/services/apiReq"; export const useProductStore = defineStore('products', { state: () => ({ productos: [], - filter: {} + filter: {}, + product_modal: false, }), actions: { async fetchProducts() { diff --git a/src/services/utils.js b/src/services/utils.js new file mode 100644 index 0000000..cd7fc76 --- /dev/null +++ b/src/services/utils.js @@ -0,0 +1,12 @@ +export const limit = (text, limit) => { + if (!text) return ""; + if (text?.length <= limit) { + return text; + } else { + try { + return text?.slice(0, limit) + '...'; + } catch (e) { + return text; + } + } +} \ No newline at end of file diff --git a/src/styles/digitalpower.css b/src/styles/digitalpower.css index 0e17d0c..725a8d1 100644 --- a/src/styles/digitalpower.css +++ b/src/styles/digitalpower.css @@ -357,13 +357,14 @@ p { [overlay] { position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; + top: 2em !important; + left: 2em !important; + width: calc(100vw - 4.6em) !important; + height: calc(100vh - 4.2em) !important; z-index: 15; background: var(--gray); + border-radius: 15px; } [inside-verlay] { diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 553a7a5..b465861 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -2,6 +2,7 @@
+
@@ -11,13 +12,14 @@ import Table from "@/components/productos/Table.vue"; import {computed, onMounted, ref} from "vue"; import Filters from "@/components/productos/Filters.vue"; import {useUi} from "@/pinia/ui"; -import {show} from "@/services/notification"; import {useUserStore} from "@/pinia/user"; +import ProductModal from "@/components/productos/ProductModal.vue"; +import {useProductStore} from "@/pinia/products"; const ui = useUi(); -const userStore = useUserStore() +const productStore = useProductStore() const headers = computed(() => { - const producto = productos.value?.[0]; + const producto = productStore.productos?.[0]; if (!producto) return [ {value: 'Nombre', name: 'Nombre'}, {value: 'Precio', name: 'Precio'}, @@ -26,32 +28,17 @@ const headers = computed(() => { {value: 'Acciones', name: 'Acciones'}, ]; + delete producto.id; + producto.acciones = null; + return Object.keys(producto).map((x) => { return {value: x, name: x}; }) }) const productos = ref([ {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, - {Nombre: "Producto de prueba de longitud", Precio: "Precio", Stock: "Stock", Vendidos: 0, Acciones: 0}, ]); - -onMounted(() => { - -}) - function handleClick() { ui.setCurrentMenu(null) }