fix: history updatedBy i18n

This commit is contained in:
puriphatt 2024-07-02 06:08:10 +00:00
parent 45aadfd7e6
commit 51f230bf93
2 changed files with 83 additions and 76 deletions

View file

@ -23,10 +23,10 @@ const columns: QTableColumn[] = [
headerStyle: 'font-weight: bold',
},
{
name: 'editBy',
name: 'updatedBy',
align: 'center',
label: t('editBy'),
field: 'editBy',
field: 'updatedBy',
headerStyle: 'font-weight: bold',
},
@ -258,7 +258,6 @@ async function groupEmployeeHistory(
masterId: curr.masterId,
updatedBy: curr.updatedBy,
updatedByUserId: curr.updatedByUserId,
timestamp: curr.timestamp,
updatedAt: updatedAt,
id: curr.id,
history: [
@ -278,7 +277,6 @@ async function groupEmployeeHistory(
masterId: curr.masterId,
updatedBy: curr.updatedBy,
updatedByUserId: curr.updatedByUserId,
timestamp: curr.timestamp,
updatedAt: updatedAt,
id: curr.id,
history: [
@ -319,7 +317,7 @@ watch(
</script>
<template>
<div class="full-width">
<div class="col-12">
<div
class="row full-width justify-center q-py-sm header-border"
style="background: hsla(var(--info-bg) / 0.1)"
@ -366,8 +364,8 @@ watch(
</div>
</div>
<div v-if="isHistoryData && currentData?.length > 0">
<q-table
v-if="isHistoryData && currentData?.length > 0"
flat
class="table-border"
table-header-class="surface-2"
@ -384,15 +382,23 @@ watch(
{{ dateFormat(props.row.updatedAt, false, true, true) }}
</q-td>
<q-td key="editBy" :props="props">
<q-td key="updatedBy" :props="props">
<div class="row items-center no-wrap">
<q-avatar class="surface-tab">
<img v-if="false" src="https://cdn.quasar.dev/img/avatar.png" />
<img
v-if="false"
src="https://cdn.quasar.dev/img/avatar.png"
/>
<q-icon v-else name="mdi-account"></q-icon>
</q-avatar>
<div class="column q-pl-md items-start">
<span class="text-weight-bold">
{{ props.row.editBy ?? '-' }}
{{
$i18n.locale === 'en-US'
? `${props.row.updatedBy.firstNameEN} ${props.row.updatedBy.lastNameEN}`
: `${props.row.updatedBy.firstName} ${props.row.updatedBy.lastName}` ??
'-'
}}
</span>
<!-- <span class="text-caption">นักบริหาร</span> -->
</div>
@ -408,9 +414,7 @@ watch(
:title="$t(mapName(item.field).title)"
:caption="$t(mapName(item.field).i18n)"
:icon="`mdi-numeric-${props.row.history.length - index}`"
>
asd
</q-step>
></q-step>
</q-stepper>
</q-td>
@ -444,6 +448,8 @@ watch(
</q-tr>
</template>
</q-table>
</div>
<div v-else class="table-border flex items-center justify-center q-py-lg">
<NoData />
</div>

View file

@ -179,5 +179,6 @@ export default {
formDialogEmployerRanchCode: 'Branch Code',
formTitleCustomer: 'Company {msg}',
formTitleCustomerNaturalPerson: 'Name {msg}',
formTitleBranch: 'Branch {msg}',
};