no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-29 17:09:25 +07:00
parent a19a0634d4
commit 9dc56a34e8

View file

@ -14,7 +14,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar(); // noti quasar const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader } = mixin; const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const pagination = ref({ const pagination = ref({
@ -164,43 +164,7 @@ const columns2 = ref<QTableProps["columns"]>([
]); ]);
// () // ()
const rows2 = ref<FormMainProbation2[]>([ const rows2 = ref<FormMainProbation2[]>([]);
// {
// no: "1",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "2",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "3",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "4",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "5",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
]);
onMounted(async () => { onMounted(async () => {
getpersonalList(); getpersonalList();
@ -291,24 +255,18 @@ const clickDelete = (id: string) => {
}; };
const clickAdd = (id: string) => { const clickAdd = (id: string) => {
$q.dialog({ dialogConfirm(
title: "ยืนยันการเพิ่มข้อมูล", $q,
message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?", async () => {
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
showLoader(); showLoader();
const postData = { const postData = {
personal_id: id, personal_id: id,
}; };
await http await http
.post(config.API.personalAdd(), postData) .post(config.API.personalAdd(), postData)
.then((res) => { .then(() => {
getpersonalList(); getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -317,9 +275,24 @@ const clickAdd = (id: string) => {
clickClose(); clickClose();
hideLoader(); hideLoader();
}); });
}) },
.onCancel(() => {}) "ยันยันการเพิ่มข้อมูล",
.onDismiss(() => {}); "ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
);
// $q.dialog({
// title: "",
// message: "?",
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {
// })
// .onCancel(() => {})
// .onDismiss(() => {});
}; };
const clickClose = async () => { const clickClose = async () => {