|
|
@@ -18,11 +18,11 @@
|
|
|
v-if="mostrarCampoPesquisa"
|
|
|
v-model="filter"
|
|
|
outlined
|
|
|
- dense
|
|
|
debounce="500"
|
|
|
- :placeholder="$t('general.search')"
|
|
|
+ placeholder="Buscar"
|
|
|
style="min-width: 400px"
|
|
|
clearable
|
|
|
+ dense
|
|
|
autofocus
|
|
|
>
|
|
|
<template #append>
|
|
|
@@ -65,6 +65,15 @@
|
|
|
<q-icon name="mdi-fullscreen" />
|
|
|
</q-btn>
|
|
|
|
|
|
+ <q-btn
|
|
|
+ outline
|
|
|
+ class="default-button-padding q-ml-md bg-white"
|
|
|
+ icon="mdi-filter-outline"
|
|
|
+ style="height: 40px; width: 40px"
|
|
|
+ @click="showFilters = !showFilters"
|
|
|
+ >
|
|
|
+ </q-btn>
|
|
|
+
|
|
|
<q-space />
|
|
|
|
|
|
<q-btn-dropdown
|
|
|
@@ -76,11 +85,9 @@
|
|
|
|
|
|
<q-btn
|
|
|
v-if="props.addItem"
|
|
|
- class="button-secondary"
|
|
|
- color="primary"
|
|
|
- padding="12px 16px"
|
|
|
:outline="props.outlineAdd"
|
|
|
- :label="$t('general.add')"
|
|
|
+ class="default-button-padding"
|
|
|
+ label="Adicionar"
|
|
|
@click="onAddItem"
|
|
|
>
|
|
|
</q-btn>
|
|
|
@@ -119,6 +126,33 @@
|
|
|
</q-td>
|
|
|
</template>
|
|
|
|
|
|
+ <template #body-cell-principal="{ value, row }">
|
|
|
+ <q-td style="width: 1%">
|
|
|
+ <q-item-section>
|
|
|
+ <span class="text-center">
|
|
|
+ <q-icon
|
|
|
+ v-if="row.principal && value"
|
|
|
+ name="mdi-star"
|
|
|
+ size="1.5rem"
|
|
|
+ style="color: #385873"
|
|
|
+ onmouseover="this.style.color='#688FAF';"
|
|
|
+ onmouseout="this.style.color='#385873';"
|
|
|
+ @click.stop="togglePrincipal(row)"
|
|
|
+ />
|
|
|
+ <q-icon
|
|
|
+ v-if="!row.principal"
|
|
|
+ name="mdi-star-outline"
|
|
|
+ size="1.5rem"
|
|
|
+ style="color: #385873"
|
|
|
+ onmouseover="this.style.color='#688FAF';"
|
|
|
+ onmouseout="this.style.color='#385873';"
|
|
|
+ @click.stop="togglePrincipal(row)"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </q-item-section>
|
|
|
+ </q-td>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-if="!props.hideNoDataLabel" #no-data>
|
|
|
<div class="q-my-md row justify-center full-width">
|
|
|
<q-spinner v-if="loading" color="primary" size="30px" />
|
|
|
@@ -138,7 +172,7 @@
|
|
|
import { ref, onMounted, toRaw, watch } from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
|
-const emit = defineEmits(["onRowClick", "onAddItem", "noRows"]);
|
|
|
+const emit = defineEmits(["onRowClick", "onAddItem", "noRows", "togglePrincipal"]);
|
|
|
|
|
|
const props = defineProps({
|
|
|
// colunas de configuração da tabela
|
|
|
@@ -326,6 +360,11 @@ const onRequest = async () => {
|
|
|
loading.value = false;
|
|
|
};
|
|
|
|
|
|
+// funcao exclusiva para contatos table, para alterar o contato principal
|
|
|
+const togglePrincipal = async (row) => {
|
|
|
+ emit("togglePrincipal", row);
|
|
|
+};
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
// faz a primeira requisição
|
|
|
await onRequest({
|
|
|
@@ -367,4 +406,17 @@ onMounted(async () => {
|
|
|
background: #f7cfbb;
|
|
|
border-radius: 24px;
|
|
|
}
|
|
|
+
|
|
|
+.circulo-status {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ border-radius: 50%;
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
+.circulo-ativo {
|
|
|
+ background-color: #80f680; /* Verde */
|
|
|
+}
|
|
|
+.circulo-inativo {
|
|
|
+ background-color: #919191; /* Cinza */
|
|
|
+}
|
|
|
</style>
|