Ajuste de layout
This commit is contained in:
@@ -1,14 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-card class="q-pa-md" flat bordered>
|
<q-card class="q-pa-md" flat bordered>
|
||||||
<q-table
|
<q-table
|
||||||
|
:key="key + '-' + pagination.perPage"
|
||||||
:title="title"
|
:title="title"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:row-key="rowKey"
|
:row-key="rowKey"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:pagination="{ rowsPerPage: pagination.perPage, page: pagination.page }"
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
virtual-scroll
|
|
||||||
hide-pagination
|
hide-pagination
|
||||||
>
|
>
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
@@ -21,7 +23,19 @@
|
|||||||
</q-table>
|
</q-table>
|
||||||
|
|
||||||
<div class="row q-mt-md">
|
<div class="row q-mt-md">
|
||||||
<div class="col-8 flex justify-end">
|
<div class="col-2 flex items-center">
|
||||||
|
<q-select
|
||||||
|
filled
|
||||||
|
v-model="pagination.perPage"
|
||||||
|
:options="[10, 25, 50, 100]"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:disable="loading || rows.length === 0"
|
||||||
|
@update:model-value="updatePagination({ perPage: $event })"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-8 flex justify-center">
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="pagination.page"
|
v-model="pagination.page"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -29,11 +43,11 @@
|
|||||||
:max="pagination.totalPages"
|
:max="pagination.totalPages"
|
||||||
:disable="loading"
|
:disable="loading"
|
||||||
input
|
input
|
||||||
@update:model-value="updatePagination"
|
@update:model-value="updatePagination({ page: $event })"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-4 flex justify-end items-center">
|
<div class="col-2 flex justify-end items-center">
|
||||||
<span class="text-grey-5">Total: {{ pagination.total }}</span>
|
<span class="text-grey-5">Total: {{ pagination.total }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,6 +60,10 @@ import has from "lodash/has";
|
|||||||
export default {
|
export default {
|
||||||
name: "Table",
|
name: "Table",
|
||||||
props: {
|
props: {
|
||||||
|
key: {
|
||||||
|
type: String,
|
||||||
|
default: "table-clipperia",
|
||||||
|
},
|
||||||
columns: {
|
columns: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -87,8 +105,17 @@ export default {
|
|||||||
},
|
},
|
||||||
emits: ["update:pagination"],
|
emits: ["update:pagination"],
|
||||||
methods: {
|
methods: {
|
||||||
updatePagination(page) {
|
updatePagination({ page, perPage }) {
|
||||||
this.$emit("update:pagination", { ...this.pagination, page });
|
const newPagination = { ...this.pagination };
|
||||||
|
|
||||||
|
if (page) {
|
||||||
|
newPagination.page = page;
|
||||||
|
}
|
||||||
|
if (perPage) {
|
||||||
|
newPagination.perPage = perPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$emit("update:pagination", newPagination);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="user-list q-pa-md">
|
<div class="user-list q-pa-md">
|
||||||
<q-card flat bordered class="q-pa-sm q-mb-lg">
|
<q-card
|
||||||
<div class="row q-pa-sm q-gutter-sm">
|
flat
|
||||||
|
bordered
|
||||||
|
class="q-pa-sm q-mb-lg"
|
||||||
|
:class="{
|
||||||
|
'bg-grey-2': !$q.dark.isActive,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="row q-pa-sm q-gutter-md">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<TextField label="Título" />
|
<TextField label="Título" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<TextField label="URL" />
|
<TextField label="Video ID" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<TextField label="VideoID" />
|
<q-select outlined :options="['Ativo', 'Inativo']" label="Situação" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -30,7 +37,7 @@
|
|||||||
:rows="rows"
|
:rows="rows"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-key="id"
|
key="table-videos"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template #no-data>
|
<template #no-data>
|
||||||
@@ -84,19 +91,6 @@ const columns = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
|
||||||
{
|
|
||||||
"id": 195,
|
|
||||||
"title": "VIDA EXTRATERRESTRE: FINALMENTE ENCONTRADA A EVIDÊNCIA + AGUARDADA...",
|
|
||||||
"url": "https://www.youtube.com/watch?v=2iU7oAmQROQ",
|
|
||||||
"situation": "CONCLUIDO",
|
|
||||||
"clips_quantity": 3,
|
|
||||||
"videoid": "2iU7oAmQROQ",
|
|
||||||
"filename": "VIDA_EXTRATERRESTRE_FINALMENTE_ENCONTRADA_A_EVIDENCIA_AGUARDADA_medium.mp4",
|
|
||||||
"datetime_download": "Invalid Date"
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserList",
|
name: "UserList",
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Reference in New Issue
Block a user