refactor edit btn add

This commit is contained in:
Thanaphon Frappet 2024-09-27 13:49:40 +07:00
parent 04bd1b0ba5
commit 4dce5a5b92
2 changed files with 20 additions and 43 deletions

View file

@ -1,4 +1,8 @@
<script setup lang="ts"></script> <script setup lang="ts">
defineProps<{
hideIcon?: boolean;
}>();
</script>
<template> <template>
<q-page-sticky position="bottom-right" :offset="[8, 8]"> <q-page-sticky position="bottom-right" :offset="[8, 8]">
@ -10,7 +14,12 @@
class="color-btn" class="color-btn"
> >
<slot> <slot>
<q-fab-action padding="xs" color="primary" icon="mdi-account-plus" /> <q-fab-action
padding="xs"
color="primary"
icon="mdi-account-plus"
v-if="!hideIcon"
/>
</slot> </slot>
</q-fab> </q-fab>
</q-page-sticky> </q-page-sticky>

View file

@ -1510,55 +1510,23 @@ watch(
<template> <template>
<ButtonAddComponent <ButtonAddComponent
hide-icon
v-if="actionDisplay && !currentNoAction" v-if="actionDisplay && !currentNoAction"
style="z-index: 999" style="z-index: 999"
> @click="
<q-fab-action async () => {
v-if="productMode === 'group'" if (productMode === 'group') {
id="btn-add-product-group"
style="color: white; background-color: hsla(var(--pink-6-hsl))"
padding="xs"
icon="mdi-folder-multiple-plus-outline"
:label="$t('productService.group.addTitle')"
external-label
label-position="left"
@click="
async () => {
clearFormGroup(); clearFormGroup();
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
dialogInputForm = true; dialogInputForm = true;
} }
" if (productMode === 'product') {
/>
<q-fab-action
v-if="productMode === 'product'"
:label="$t('productService.product.addTitle')"
id="btn-add-product"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--green-11-hsl))"
padding="xs"
icon="mdi-folder-multiple-plus-outline"
@click="
async () => {
productTab = 1; productTab = 1;
clearFormProduct(); clearFormProduct();
await fetchListOfOptionBranch(); await fetchListOfOptionBranch();
dialogProduct = true; dialogProduct = true;
} }
" if (productMode === 'service') {
></q-fab-action>
<q-fab-action
v-if="productMode === 'service'"
:label="$t('productService.service.addTitle')"
id="btn-add-service"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--orange-6-hsl))"
padding="xs"
icon="mdi-server-plus-outline"
@click="
async () => {
serviceTab = 1; serviceTab = 1;
clearFormGroup(); clearFormGroup();
clearFormService(); clearFormService();
@ -1566,9 +1534,9 @@ watch(
serviceTab = 1; serviceTab = 1;
dialogService = true; dialogService = true;
} }
" }
></q-fab-action> "
</ButtonAddComponent> />
<div class="full-height column no-wrap"> <div class="full-height column no-wrap">
<div class="text-body-2 q-mb-xs flex items-center"> <div class="text-body-2 q-mb-xs flex items-center">