วินัย => fix bug

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-04 13:44:29 +07:00
parent 7a483649d4
commit 17b801eede
15 changed files with 197 additions and 90 deletions

View file

@ -15,7 +15,7 @@ const totalList = ref<number>(1);
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogMessageNotify, showLoader, hideLoader } = mixin;
const { dialogMessageNotify, showLoader, hideLoader, messageError } = mixin;
const pagination = ref({
sortBy: "createdAt",
@ -97,14 +97,14 @@ const emit = defineEmits(["returnData"]);
/** ปิด dialog */
async function close() {
console.log("close");
props.close();
rows.value = [];
search.value = "";
}
/** เปิด dialog ยืนยัน */
function savePost() {
if (selected.value.length != 0) {
// dialogConfirm($q, () => saveData());
saveData();
} else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
@ -185,7 +185,7 @@ async function getSearch() {
rows.value = list;
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
hideLoader();
@ -205,7 +205,6 @@ watch(
);
function updatePagination(newPagination: any) {
console.log("🚀 ~ updatePagination ~ newPagination:", newPagination)
pagination.value.page = 1;
pagination.value.rowsPerPage = newPagination.rowsPerPage;
}
@ -373,7 +372,12 @@ watch(
</q-card-section>
<q-separator />
<q-card-actions align="right" class="q-mx-sm q-my-xs">
<q-btn color="public" id="onSubmit" @click="savePost">
<q-btn
color="public"
id="onSubmit"
@click="savePost"
:disable="rows.length === 0"
>
<!-- <q-icon left name="add" /> -->
<div>{{ props.btnTitle }}</div>
<!-- icon="mdi-content-save-outline" -->