fix: notify

This commit is contained in:
setthawutttty 2025-08-21 12:57:16 +07:00
parent 8e56123e12
commit 163ff5ec12
2 changed files with 20 additions and 1 deletions

View file

@ -41,6 +41,7 @@ const {
showLoader,
hideLoader,
convertDateToAPI,
notifyWarring,
} = mixin;
const checkRoutePermisson = ref<boolean>(
@ -376,7 +377,11 @@ async function checkSave() {
myForm.value.validate().then(async (success) => {
if (success) {
if (edit.value) {
await editData(id.value);
if (rowsPosition.value.length == 0) {
notifyWarring($q, "กรุณาเพิ่มตำแหน่ง");
} else {
await editData(id.value);
}
} else {
await addData();
}

View file

@ -345,6 +345,19 @@ export const useCounterMixin = defineStore("mixin", () => {
});
}
}
function notifyWarring(q: any, val: string) {
if (val !== "") {
q.notify({
color: "warning",
message: val,
icon: "mdi-alert-circle",
position: "top",
multiLine: true,
timeout: 12000,
actions: [{ label: "ปิด", color: "white", handler: () => {} }],
});
}
}
const messageError = (q: any, e: any = "", msg: string = "") => {
if (e.response !== undefined) {
@ -1523,5 +1536,6 @@ export const useCounterMixin = defineStore("mixin", () => {
findOrgNameOldHtml,
findOrgChildNameHtml,
findChildNameHtml,
notifyWarring
};
});