modify dialogRemove function (mixin)

This commit is contained in:
Warunee Tamkoo 2023-08-17 11:32:50 +07:00
parent 054ed8b5ad
commit d1d0404fff

View file

@ -441,12 +441,21 @@ export const useCounterMixin = defineStore("mixin", () => {
}); });
}; };
const dialogRemove = (q: any, ok?: Function, cancel?: Function) => { const dialogRemove = (
q: any,
ok?: Function,
title?: string, // ถ้ามี cancel action ใส่เป็น null
desc?: string, // ถ้ามี cancel action ใส่เป็น null
cancel?: Function
) => {
q.dialog({ q.dialog({
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {
title: "ยืนยันการลบข้อมูล", title: title && title != null ? title : "ยืนยันการลบข้อมูล",
message: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?", message:
desc && desc != null
? desc
: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?",
icon: "delete", icon: "delete",
color: "red", color: "red",
textOk: "ตกลง", textOk: "ตกลง",
@ -792,6 +801,6 @@ export const useCounterMixin = defineStore("mixin", () => {
// common dialog // common dialog
dialogConfirm, dialogConfirm,
dialogRemove, dialogRemove,
dialogMessageNotify dialogMessageNotify,
}; };
}); });