From efc19ed875c62dfcf6e8f37b2c4f51fa86161f28 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 11 Mar 2025 11:29:38 +0700 Subject: [PATCH] feat: add order field and type options to property management table --- src/pages/04_property-managment/MainPage.vue | 176 ++++++++++++++++--- 1 file changed, 156 insertions(+), 20 deletions(-) diff --git a/src/pages/04_property-managment/MainPage.vue b/src/pages/04_property-managment/MainPage.vue index 511186d6..7bb547cf 100644 --- a/src/pages/04_property-managment/MainPage.vue +++ b/src/pages/04_property-managment/MainPage.vue @@ -15,6 +15,7 @@ import PaginationPageSize from 'src/components/PaginationPageSize.vue'; import PropertyDialog from './PropertyDialog.vue'; import { Property } from 'src/stores/property/types'; import { dialog } from 'src/stores/utils'; +import CreateButton from 'src/components/AddButton.vue'; const { t } = useI18n(); const $q = useQuasar(); @@ -35,13 +36,20 @@ const formProperty = ref({ }); const statusFilter = ref<'all' | 'statusACTIVE' | 'statusINACTIVE'>('all'); const refFilter = ref>(); -const fieldSelected = ref<('name' | 'type')[]>(['name', 'type']); +const fieldSelected = ref<('order' | 'name' | 'type')[]>([ + 'order', + 'name', + 'type', +]); const fieldSelectedOption = ref<{ label: string; value: string }[]>([ + { + label: 'general.order', + value: 'order', + }, { label: 'property.table.name', value: 'name', }, - { label: 'property.table.type', value: 'type', @@ -49,6 +57,12 @@ const fieldSelectedOption = ref<{ label: string; value: string }[]>([ ]); const columns = [ + { + name: 'order', + align: 'center', + label: 'general.order', + field: 'order', + }, { name: 'name', align: 'center', @@ -64,6 +78,33 @@ const columns = [ }, ] satisfies QTableProps['columns']; +const typeOption = { + string: { + label: 'Text', + value: 'string', + color: 'var(--pink-6-hsl)', + icon: 'mdi-alpha-t', + }, + number: { + label: 'Number', + value: 'number', + color: 'var(--purple-11-hsl)', + icon: 'mdi-numeric', + }, + date: { + label: 'Date', + value: 'date', + color: 'var(--green-9-hsl)', + icon: 'mdi-calendar-blank-outline', + }, + array: { + label: 'Selection', + value: 'array', + color: 'var(--indigo-7-hsl)', + icon: 'mdi-code-array', + }, +}; + const pageState = reactive({ hideStat: false, inputSearch: '', @@ -295,7 +336,7 @@ watch([() => pageState.inputSearch, propertyPageSize], () => { labelI18n :branch="[ { - icon: 'mdi-cogs', + icon: 'mdi-tag-text-outline', count: pageState.total, label: 'property.title', color: 'blue', @@ -445,10 +486,9 @@ watch([() => pageState.inputSearch, propertyPageSize], () => { v-if="pageState.total !== 0" :not-found="!!pageState.inputSearch" /> - @@ -483,10 +523,11 @@ watch([() => pageState.inputSearch, propertyPageSize], () => { - + +