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({
component: CustomComponent,
componentProps: {
title: "ยืนยันการลบข้อมูล",
message: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?",
title: title && title != null ? title : "ยืนยันการลบข้อมูล",
message:
desc && desc != null
? desc
: "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?",
icon: "delete",
color: "red",
textOk: "ตกลง",
@ -792,6 +801,6 @@ export const useCounterMixin = defineStore("mixin", () => {
// common dialog
dialogConfirm,
dialogRemove,
dialogMessageNotify
dialogMessageNotify,
};
});