Merge branch 'front-styles' of ssh://git.ma-al.com:8822/goc_daniel/b2b into translate

This commit is contained in:
2026-03-31 12:49:25 +02:00
4 changed files with 14 additions and 28 deletions

View File

@@ -345,30 +345,6 @@ const columns: TableColumn<Payment>[] = [
}, },
cell: ({ row }) => row.getValue('quantity') as number cell: ({ row }) => row.getValue('quantity') as number
}, },
{
accessorKey: 'count',
header: 'Count',
cell: ({ row }) => {
return h(UInputNumber, {
modelValue: selectedCount.value.product_id === row.original.product_id ? selectedCount.value.count : 0,
'onUpdate:modelValue': (val: number) => {
if (val)
selectedCount.value = {
product_id: row.original.product_id,
count: val
}
else {
selectedCount.value = {
product_id: null,
count: 0
}
}
},
min: 0,
max: row.original.quantity
})
}
},
{ {
accessorKey: 'count', accessorKey: 'count',
header: '', header: '',
@@ -377,10 +353,9 @@ const columns: TableColumn<Payment>[] = [
onClick: () => { onClick: () => {
console.log('Clicked', row.original) console.log('Clicked', row.original)
}, },
color: selectedCount.value.product_id !== row.original.product_id ? 'info' : 'primary', color: 'primary',
disabled: selectedCount.value.product_id !== row.original.product_id,
variant: 'solid' variant: 'solid'
}, 'Add to cart') }, 'Show product')
}, },
} }
] ]

View File

@@ -1,8 +1,16 @@
import { useFetchJson } from "@/composable/useFetchJson"; import { useFetchJson } from "@/composable/useFetchJson";
import type { MenuItem, Route } from "@/types/menu"; import type { MenuItem, Route } from "@/types/menu";
import { ref } from "vue";
import { settings } from "./settings";
const categoryId = ref()
export const getMenu = async () => { export const getMenu = async () => {
const resp = await useFetchJson<MenuItem>('/api/v1/restricted/menu/get-category-tree'); if(!categoryId.value){
categoryId.value = settings['app'].category_tree_root_id
}
const resp = await useFetchJson<MenuItem>(`/api/v1/restricted/menu/get-category-tree?root_category_id=${categoryId.value}`);
return resp.items.children return resp.items.children
} }

View File

@@ -8,4 +8,6 @@ export const settings = reactive({} as Settings)
export async function getSettings() { export async function getSettings() {
const { items } = await useFetchJson<Resp<Settings>>('/api/v1/settings',) const { items } = await useFetchJson<Resp<Settings>>('/api/v1/settings',)
Object.assign(settings, items) Object.assign(settings, items)
console.log(settings['app'])
} }

View File

@@ -7,6 +7,7 @@ export interface Settings {
} }
export interface App { export interface App {
category_tree_root_id: number
name: string name: string
environment: string environment: string
base_url: string base_url: string