|
@@ -32,47 +32,33 @@
|
|
|
<span class="text-caption text-grey-7">Data</span>
|
|
<span class="text-caption text-grey-7">Data</span>
|
|
|
<span class="text-caption text-grey-7">Setor</span>
|
|
<span class="text-caption text-grey-7">Setor</span>
|
|
|
<span class="text-caption text-grey-7">Status</span>
|
|
<span class="text-caption text-grey-7">Status</span>
|
|
|
- <span class="text-caption text-grey-7">Ações</span>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<q-separator />
|
|
<q-separator />
|
|
|
|
|
|
|
|
<div style="max-height: 320px; overflow-y: auto">
|
|
<div style="max-height: 320px; overflow-y: auto">
|
|
|
|
|
+ <div v-if="filteredTickets.length === 0" class="text-grey-6 text-center q-pa-lg">
|
|
|
|
|
+ Nenhum ticket aberto encontrado.
|
|
|
|
|
+ </div>
|
|
|
<template v-for="(ticket, index) in filteredTickets" :key="ticket.id">
|
|
<template v-for="(ticket, index) in filteredTickets" :key="ticket.id">
|
|
|
<div
|
|
<div
|
|
|
class="list-row q-px-md q-py-sm"
|
|
class="list-row q-px-md q-py-sm"
|
|
|
:class="{ 'row-selected': index === selectedIndex }"
|
|
:class="{ 'row-selected': index === selectedIndex }"
|
|
|
@click="selectedIndex = index"
|
|
@click="selectedIndex = index"
|
|
|
>
|
|
>
|
|
|
- <span class="text-body2 text-dark">{{ ticket.numero }}</span>
|
|
|
|
|
|
|
+ <span class="text-body2 text-dark">{{ ticket.number }}</span>
|
|
|
<q-badge
|
|
<q-badge
|
|
|
- :label="ticket.prioridade"
|
|
|
|
|
- :color="prioridadeColor(ticket.prioridade)"
|
|
|
|
|
|
|
+ :label="priorityLabel(ticket.priority)"
|
|
|
|
|
+ :color="priorityColor(ticket.priority)"
|
|
|
style="border-radius: 8px; font-size: 11px; padding: 4px 8px; width: max-content"
|
|
style="border-radius: 8px; font-size: 11px; padding: 4px 8px; width: max-content"
|
|
|
/>
|
|
/>
|
|
|
- <span class="text-caption text-dark">{{ ticket.data }}</span>
|
|
|
|
|
- <span class="text-caption text-dark">{{ ticket.setor }}</span>
|
|
|
|
|
|
|
+ <span class="text-caption text-dark">{{ ticket.date }}</span>
|
|
|
|
|
+ <span class="text-caption text-dark">{{ ticket.sector }}</span>
|
|
|
<q-badge
|
|
<q-badge
|
|
|
- :label="ticket.status"
|
|
|
|
|
|
|
+ :label="statusLabel(ticket.status)"
|
|
|
:color="statusColor(ticket.status)"
|
|
:color="statusColor(ticket.status)"
|
|
|
style="border-radius: 8px; font-size: 11px; padding: 4px 8px; width: max-content"
|
|
style="border-radius: 8px; font-size: 11px; padding: 4px 8px; width: max-content"
|
|
|
/>
|
|
/>
|
|
|
- <div class="row" style="gap: 6px">
|
|
|
|
|
- <q-btn
|
|
|
|
|
- flat
|
|
|
|
|
- dense
|
|
|
|
|
- icon="mdi-clipboard-outline"
|
|
|
|
|
- color="dark"
|
|
|
|
|
- style="border: 1px solid #ccc; border-radius: 6px; width: 30px; height: 30px"
|
|
|
|
|
- />
|
|
|
|
|
- <q-btn
|
|
|
|
|
- flat
|
|
|
|
|
- dense
|
|
|
|
|
- icon="mdi-delete-outline"
|
|
|
|
|
- color="dark"
|
|
|
|
|
- style="border: 1px solid #ccc; border-radius: 6px; width: 30px; height: 30px"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<q-separator v-if="index < filteredTickets.length - 1" />
|
|
<q-separator v-if="index < filteredTickets.length - 1" />
|
|
|
</template>
|
|
</template>
|
|
@@ -91,48 +77,47 @@ defineEmits([...useDialogPluginComponent.emits]);
|
|
|
|
|
|
|
|
const { dialogRef, onDialogHide, onDialogCancel } = useDialogPluginComponent();
|
|
const { dialogRef, onDialogHide, onDialogCancel } = useDialogPluginComponent();
|
|
|
|
|
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ tickets: {
|
|
|
|
|
+ type: Array,
|
|
|
|
|
+ default: () => [],
|
|
|
|
|
+ },
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const search = ref("");
|
|
const search = ref("");
|
|
|
const selectedIndex = ref(0);
|
|
const selectedIndex = ref(0);
|
|
|
|
|
|
|
|
-const tickets = [
|
|
|
|
|
- {
|
|
|
|
|
- id: 1,
|
|
|
|
|
- numero: "#12577",
|
|
|
|
|
- prioridade: "Baixa",
|
|
|
|
|
- data: "15/02/2026",
|
|
|
|
|
- setor: "Financeiro",
|
|
|
|
|
- status: "Não Resolvido",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 2,
|
|
|
|
|
- numero: "#12578",
|
|
|
|
|
- prioridade: "Alta",
|
|
|
|
|
- data: "16/02/2026",
|
|
|
|
|
- setor: "Comercial",
|
|
|
|
|
- status: "Em Análise",
|
|
|
|
|
- },
|
|
|
|
|
-];
|
|
|
|
|
|
|
+const priorityLabel = (priority) =>
|
|
|
|
|
+ ({ high: "Alta", medium: "Média", low: "Baixa" })[priority] ?? priority;
|
|
|
|
|
|
|
|
-const prioridadeColor = (p) => {
|
|
|
|
|
- if (p === "Alta") return "negative";
|
|
|
|
|
- if (p === "Média") return "warning";
|
|
|
|
|
|
|
+const priorityColor = (priority) => {
|
|
|
|
|
+ if (priority === "high") return "negative";
|
|
|
|
|
+ if (priority === "medium") return "warning";
|
|
|
return "orange";
|
|
return "orange";
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const statusColor = (s) => {
|
|
const statusColor = (s) => {
|
|
|
- if (s === "Resolvido") return "positive";
|
|
|
|
|
- if (s === "Em Análise") return "warning";
|
|
|
|
|
|
|
+ if (s === "resolved") return "positive";
|
|
|
|
|
+ if (s === "in_progress") return "warning";
|
|
|
return "negative";
|
|
return "negative";
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const statusLabel = (status) =>
|
|
|
|
|
+ ({
|
|
|
|
|
+ in_progress: "Em andamento",
|
|
|
|
|
+ resolved: "Resolvido",
|
|
|
|
|
+ unresolved: "Não resolvido",
|
|
|
|
|
+ })[status] ?? status;
|
|
|
|
|
+
|
|
|
const filteredTickets = computed(() => {
|
|
const filteredTickets = computed(() => {
|
|
|
- if (!search.value) return tickets;
|
|
|
|
|
|
|
+ if (!search.value) return props.tickets;
|
|
|
const q = search.value.toLowerCase();
|
|
const q = search.value.toLowerCase();
|
|
|
- return tickets.filter(
|
|
|
|
|
|
|
+ return props.tickets.filter(
|
|
|
(t) =>
|
|
(t) =>
|
|
|
- t.numero.toLowerCase().includes(q) ||
|
|
|
|
|
- t.data.includes(q) ||
|
|
|
|
|
- t.setor.toLowerCase().includes(q) ||
|
|
|
|
|
|
|
+ t.number.toLowerCase().includes(q) ||
|
|
|
|
|
+ t.title.toLowerCase().includes(q) ||
|
|
|
|
|
+ t.date.includes(q) ||
|
|
|
|
|
+ t.sector.toLowerCase().includes(q) ||
|
|
|
t.status.toLowerCase().includes(q),
|
|
t.status.toLowerCase().includes(q),
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
@@ -141,13 +126,13 @@ const filteredTickets = computed(() => {
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.list-header {
|
|
.list-header {
|
|
|
display: grid;
|
|
display: grid;
|
|
|
- grid-template-columns: 90px 100px 110px 1fr 140px 90px;
|
|
|
|
|
|
|
+ grid-template-columns: 90px 100px 110px 1fr 140px;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.list-row {
|
|
.list-row {
|
|
|
display: grid;
|
|
display: grid;
|
|
|
- grid-template-columns: 90px 100px 110px 1fr 140px 90px;
|
|
|
|
|
|
|
+ grid-template-columns: 90px 100px 110px 1fr 140px;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
transition: background-color 0.15s;
|
|
transition: background-color 0.15s;
|