refactor: by data to itemCard

This commit is contained in:
Net 2024-09-06 11:11:28 +07:00
parent 9c8cae5273
commit 53ae34aaa8
2 changed files with 33 additions and 25 deletions

View file

@ -53,14 +53,17 @@ const utilsStore = useUtilsStore();
const modelCreateTypeBranch = ref<boolean>(false);
const typeBranchItem = [
{
icon: 'mdi-home-group',
text: 'Virtual Branch',
color: 'var(--blue-6)',
icon: 'material-symbols:home-work-outline',
text: t('branch.card.branchLabel'),
iconColor: '--purple-8',
color: 'var(--purple-6-hsl)',
},
{
icon: 'mdi-home-group',
text: 'Branch',
color: 'var(--purple-6)',
text: t('branch.card.branchVirtual'),
iconColor: '--blue-8',
color: 'var(--blue-6-hsl)',
},
];
const holdDialog = ref(false);
@ -2064,22 +2067,24 @@ watch(currentHq, () => {
hide-footer
no-app-box
width="40vw"
height="300px"
height="250px"
:close="() => (modelCreateTypeBranch = false)"
>
<div class="full-height row q-pa-md">
<div class="full-height row q-pa-md" style="gap: 16px">
<ItemCard
v-for="i in typeBranchItem"
class="col q-mx-sm -full-height"
:key="i.text"
:icon="i.icon"
:text="i.text"
:color="i.color"
v-for="(value, index) in typeBranchItem"
class="col full-height"
:key="value.text"
:icon="value.icon"
:text="value.text"
:icon-color="value.iconColor"
:bg-color="value.color"
:index="index"
@trigger="
() => {
modelCreateTypeBranch = false;
if (i.text === 'Virtual Branch') {
if (value.text === 'Virtual Branch') {
formData.virtual = true;
} else {
formData.virtual = false;