API การแจ้งเตือน
This commit is contained in:
parent
4ff1334b32
commit
23314ca3a6
6 changed files with 115 additions and 17 deletions
|
|
@ -238,6 +238,35 @@ export const useCounterMixin = defineStore('mixin', () => {
|
|||
}
|
||||
}
|
||||
|
||||
function dialogRemove(
|
||||
q: any,
|
||||
ok?: () => void,
|
||||
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||
cancel?: () => void
|
||||
) {
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: title && title != null ? title : 'ยืนยันการลบข้อมูล',
|
||||
message:
|
||||
desc && desc != null
|
||||
? desc
|
||||
: 'ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?',
|
||||
icon: 'delete',
|
||||
color: 'red',
|
||||
textOk: 'ตกลง',
|
||||
onlycancel: false,
|
||||
},
|
||||
})
|
||||
.onOk(() => {
|
||||
if (ok) ok()
|
||||
})
|
||||
.onCancel(() => {
|
||||
if (cancel) cancel()
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
date2Thai,
|
||||
showLoader,
|
||||
|
|
@ -247,5 +276,6 @@ export const useCounterMixin = defineStore('mixin', () => {
|
|||
messageError,
|
||||
success,
|
||||
notify,
|
||||
dialogRemove,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue