refactor: show Badge virtual Branch

This commit is contained in:
Net 2024-09-09 14:22:07 +07:00
parent 426a486ef9
commit a8ebc85ace
2 changed files with 26 additions and 3 deletions

View file

@ -13,7 +13,7 @@ defineProps<{
branchLabelAddress: string;
branchImgUrl: string;
};
virtualBranch: boolean;
metadata?: unknown;
badgeField?: string[];
fieldSelected?: string[];
@ -31,7 +31,8 @@ defineProps<{
'branch-card__none':
color !== 'hq' && color !== 'br' && (!color || color === 'none'),
'branch-card__hq': color === 'hq',
'branch-card__br': color === 'br',
'branch-card__br': color === 'br' && !virtualBranch,
'branch-card__br-virtual': color === 'br' && virtualBranch,
}"
@click="$emit('open')"
>
@ -60,7 +61,24 @@ defineProps<{
</div>
<div class="branch-card__action">
<slot name="action" />
<div class="text-right">
<slot name="action" />
</div>
<div
v-if="color === 'br'"
class="q-pa-xs rounded"
:style="`background: hsl(var(${virtualBranch ? '--blue-6-hsl' : '--purple-6-hsl'}) / 0.1)`"
>
<b
:style="`color: hsl(var(${virtualBranch ? '--blue-8-hsl' : '--purple-8-hsl'}) )`"
>
{{
$t(
`branch.card.${virtualBranch ? 'branchVirtual' : 'branchLabel'}`,
)
}}
</b>
</div>
</div>
</div>
<div
@ -185,6 +203,10 @@ defineProps<{
}
}
&.branch-card__br-virtual {
--_branch-card-bg: var(--blue-6-hsl);
}
&.branch-card__inactive {
--_branch-status-color: var(--red-4-hsl);
--_branch-badge-bg: var(--red-4-hsl);

View file

@ -1335,6 +1335,7 @@ watch(currentHq, () => {
<div class="col-12 col-md-6">
<BranchCard
class="surface-1"
:virtual-branch="props.row.virtual"
:id="`branch-card-${props.row.name}`"
:class="{
'cursor-pointer': props.row._count.branch !== 0,