This commit is contained in:
setthawutttty 2023-11-15 11:30:13 +07:00
parent 13b5589083
commit c76af202de
2 changed files with 19 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import type { QTableProps } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const { dialogConfirm, dialogMessageNotify } = mixin;
interface typeOp {
id: string;
@ -127,6 +127,9 @@ const props = defineProps({
},
});
/**ส่งค่ากลับหน้าหลัก */
const emit = defineEmits(["returnData"]);
/** ปิด dialog */
async function close() {
console.log("close");
@ -135,13 +138,17 @@ async function close() {
/** เปิด dialog ยืนยัน */
function savePost() {
dialogConfirm($q, () => saveData());
if (selected.value.length != 0) {
dialogConfirm($q, () => saveData());
} else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
}
}
/** save data หลังจาก ยืนยัน */
function saveData() {
console.log("save #in component", selected.value);
props.save();
emit("returnData", selected.value);
}
/** input ค้นหา */