From fe256161a5f81f514d2b664f9efb2f17206d66f5 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:30:36 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=20=E0=B8=95=E0=B8=B2=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/cardBackupRestore.vue | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/modules/04_system/components/cardBackupRestore.vue b/src/modules/04_system/components/cardBackupRestore.vue index 90fdf943..bdd83c23 100644 --- a/src/modules/04_system/components/cardBackupRestore.vue +++ b/src/modules/04_system/components/cardBackupRestore.vue @@ -23,7 +23,7 @@ const { showLoader, hideLoader, date2Thai, dialogRemove, dialogConfirm } = useCounterMixin(); const { fetchListBackup, createBackUp, restore, deleteBackUp } = useDataStore(); const storeData = useDataStore(); -const { dataBackUp } = storeToRefs(storeData); +const { dataBackUp, backupRunTotal } = storeToRefs(storeData); /** * props @@ -50,17 +50,23 @@ const baseColumns = ref([ align: "left", label: "วันที่สร้าง", sortable: true, - field: (v) => date2Thai(v), + // field: (v) => date2Thai(v, false, true), + field: "timestamp", + format: (v) => date2Thai(v, false, true), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "status", + align: "left", + label: "สถานะ", + sortable: true, + field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", }, ]); const columns = computed(() => { - if (tab.value === "restore") { - if (baseColumns.value) { - return baseColumns.value.filter((column) => column.name !== "status"); - } - } return baseColumns.value; }); @@ -98,7 +104,6 @@ function onRestore(name: string) { dialogConfirm( $q, async () => { - showLoader(); await restore(name); }, "ยืนยันการคืนค่าข้อมูสำรอง", @@ -120,6 +125,7 @@ onMounted(async () => { icon="add" label="สร้างข้อมูลสำรอง" @click="onCreateBackup" + :disable="backupRunTotal > 0" > สร้างข้อมูลสำรอง @@ -170,9 +176,18 @@ onMounted(async () => {