fix: conditional label hq or br

This commit is contained in:
Methapon2001 2024-04-11 09:57:24 +07:00
parent a92dc66503
commit a1a5e7a8ba

View file

@ -5,7 +5,7 @@ import { ref } from 'vue';
const color: string[] = ['pink', 'violet'];
const props = defineProps<{
defineProps<{
subBranch?: boolean;
rows: {
id: string;
@ -23,7 +23,7 @@ const columns = [
{
name: 'name',
required: true,
label: props.subBranch ? 'branchLabel' : 'branchHQLabel',
label: 'branchLabel',
align: 'left',
field: (row) => row.name,
format: (val) => `${val}`,
@ -76,7 +76,15 @@ const filter = ref('');
style="width: 120px"
:style="`${!$q.dark.isActive && i !== 0 ? 'color:gray' : ''}`"
>
{{ $t(prop.colsMap[k]?.label) }}
{{
$t(
k === 'name'
? subBranch
? 'branchLabel'
: 'branchHQLabel'
: prop.colsMap[k]?.label,
)
}}
</q-item-section>
<q-item-section>