feat: add disabled display field product service
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 9s

This commit is contained in:
Methapon2001 2025-02-26 16:09:44 +07:00
parent 16bcecc8d6
commit 896e1ba360

View file

@ -45,6 +45,8 @@ type ExclusiveProps = {
type: 'service' | 'product';
grid?: boolean;
disabledWorkerId?: string[];
disabledProductFields?: (typeof columnsProduct)[number]['name'][];
disabledServiceFields?: (typeof columnsService)[number]['name'][];
rows: Product[];
};
@ -76,7 +78,7 @@ const columnsProduct = [
label: 'productService.product.priceInformation',
field: (v: Product) => v,
},
] satisfies QTableColumn[];
] as const satisfies QTableColumn[];
const columnsService = [
{
@ -110,7 +112,7 @@ const columnsService = [
label: 'general.createdAt',
field: (v: Service) => dateFormatJS({ date: v.createdAt }),
},
] satisfies QTableColumn[];
] as const satisfies QTableColumn[];
const props = defineProps<ExclusiveProps>();
@ -165,7 +167,18 @@ function selectedIndex(item: any) {
:props="props"
>
<q-th
v-for="col in type === 'product' ? columnsProduct : columnsService"
v-for="col in type === 'product'
? columnsProduct.filter((v) =>
disabledProductFields
? !disabledProductFields.includes(v.name)
: true,
)
: columnsService.filter((v) =>
disabledServiceFields
? !disabledServiceFields.includes(v.name)
: true,
)"
:auto-width="col.name === '#check'"
:key="col.name"
:props="props"
>
@ -209,7 +222,17 @@ function selectedIndex(item: any) {
class="text-center"
>
<q-td
v-for="col in type === 'product' ? columnsProduct : columnsService"
v-for="col in type === 'product'
? columnsProduct.filter((v) =>
disabledProductFields
? !disabledProductFields.includes(v.name)
: true,
)
: columnsService.filter((v) =>
disabledServiceFields
? !disabledServiceFields.includes(v.name)
: true,
)"
:align="col.align"
:key="col.name"
>