ปรับ dialog บรรจุ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-17 11:40:46 +07:00
parent 508fb3b02b
commit 1881aa1b2f
23 changed files with 1064 additions and 1072 deletions

View file

@ -44,8 +44,16 @@ const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const mixin = useCounterMixin();
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
mixin;
const {
success,
dateToISO,
date2Thai,
messageError,
showLoader,
hideLoader,
dialogRemove,
dialogConfirm,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const levelId = ref<string>();
@ -549,30 +557,20 @@ const editData = async () => {
* ลบลบขอม
*/
const clickDelete = async () => {
$q.dialog({
title: `ลบข้อมูล`,
message: `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
cancel: "ยกเลิก",
ok: "ยืนยัน",
persistent: true,
})
.onOk(async () => {
showLoader();
await http
.delete(config.API.placementEducationId(id.value))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await props.fetch();
rows.value = props.data;
});
dialogRemove($q, async () => await deletePlacementEducation());
};
const deletePlacementEducation = async () => {
showLoader();
await http
.delete(config.API.placementEducationId(id.value))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
modal.value = false;
})
.onCancel(async () => {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await props.fetch();
rows.value = props.data;
});
@ -666,17 +664,26 @@ const addData = () => {
*/
const clickCancel = async () => {
if (editRow.value == true) {
$q.dialog({
title: `ข้อมูลมีการแก้ไข`,
message: `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`,
cancel: "ยกเลิก",
ok: "ยืนยัน",
persistent: true,
}).onOk(async () => {
edit.value = false;
await checkRowPage();
await getData();
});
dialogConfirm(
$q,
async () => {
await checkRowPage();
await getData();
},
`ข้อมูลมีการแก้ไข`,
`ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`
);
// $q.dialog({
// title: ``,
// message: `?`,
// cancel: "",
// ok: "",
// persistent: true,
// }).onOk(async () => {
// edit.value = false;
// await checkRowPage();
// await getData();
// });
} else {
edit.value = false;
await checkRowPage();