refactor: add id

This commit is contained in:
Thanaphon Frappet 2024-11-21 09:48:46 +07:00
parent 3036ca1070
commit 1e15dcc856
3 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
defineProps<{ defineProps<{
prefixId?: string;
inactive?: boolean; inactive?: boolean;
color?: 'none' | 'pers' | 'corp'; color?: 'none' | 'pers' | 'corp';
data: { data: {
@ -52,6 +53,7 @@ defineProps<{
<div class="branch-card__action"> <div class="branch-card__action">
<q-btn <q-btn
:id="`${prefixId}-btn-view-detail`"
icon="mdi-eye-outline" icon="mdi-eye-outline"
size="sm" size="sm"
dense dense

View file

@ -21,6 +21,7 @@ const prop = withDefaults(
fieldSelected?: string[]; fieldSelected?: string[];
inTable?: boolean; inTable?: boolean;
addButton?: boolean; addButton?: boolean;
prefixId?: string;
}>(), }>(),
{ {
gridView: false, gridView: false,
@ -74,7 +75,7 @@ defineEmits<{
</span> </span>
<span v-if="col.label === '' && !!addButton"> <span v-if="col.label === '' && !!addButton">
<AddButton <AddButton
id="btn-add-employee" :id="`${prefixId || 'default'}-btn-add-employee`"
icon-only icon-only
@click.stop="() => $emit('add')" @click.stop="() => $emit('add')"
/> />

View file

@ -516,6 +516,7 @@ watch(
<q-btn <q-btn
dense dense
flat flat
:id="`btn-show-employee-${currentCustomerName}`"
@click.stop=" @click.stop="
async () => { async () => {
currentBranchEmployee = props.row.id; currentBranchEmployee = props.row.id;
@ -551,7 +552,7 @@ watch(
</q-btn> </q-btn>
<q-btn <q-btn
icon="mdi-eye-outline" icon="mdi-eye-outline"
:id="`btn-eye-${props.row.customerName}`" :id="`btn-eye-${currentCustomerName}`"
size="sm" size="sm"
dense dense
round round
@ -570,6 +571,7 @@ watch(
<q-td colspan="100%" style="padding: 16px"> <q-td colspan="100%" style="padding: 16px">
<div class="text-center"> <div class="text-center">
<TableEmpoloyee <TableEmpoloyee
:prefix-id="props.row.registerName || props.row.firstName"
add-button add-button
in-table in-table
:list-employee="listEmployee" :list-employee="listEmployee"
@ -607,6 +609,7 @@ watch(
<template #item="props"> <template #item="props">
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<BranchCardCustomer <BranchCardCustomer
:prefix-id="props.row.registerName || props.row.firstName"
class="surface-1" class="surface-1"
:inactive="props.row.status === 'INACTIVE'" :inactive="props.row.status === 'INACTIVE'"
:color="customerType === 'CORP' ? 'corp' : 'pers'" :color="customerType === 'CORP' ? 'corp' : 'pers'"
@ -775,7 +778,7 @@ watch(
</div> </div>
</div> </div>
<EmployerFormAbout <EmployerFormAbout
prefixId="dialog" prefix-id="dialog"
:readonly="customerBranchFormState.dialogType === 'info'" :readonly="customerBranchFormState.dialogType === 'info'"
class="q-mb-xl" class="q-mb-xl"
:index=" :index="