จัด โค้ด รายการสืบสวนข้อเท็จจริง
This commit is contained in:
parent
aeaa8c8df2
commit
0e03d4279d
5 changed files with 79 additions and 31 deletions
|
|
@ -7,11 +7,9 @@ import { useRouter, useRoute } from "vue-router";
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
// get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const data = reactive<FormData>({
|
||||
complaint: "",
|
||||
complaintdetail: "",
|
||||
|
|
@ -29,6 +27,7 @@ const data = reactive<FormData>({
|
|||
causeText: "",
|
||||
});
|
||||
|
||||
/** จำลองข้อมูลจาก api */
|
||||
const fetchData = async () => {
|
||||
// ดึงค่าจาก api
|
||||
data.complaint = "เรื่องที่ 1";
|
||||
|
|
@ -47,12 +46,20 @@ const fetchData = async () => {
|
|||
data.causeText = "";
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
const onSubmit = async (id: string) => {
|
||||
/**
|
||||
* บันทึกข้อมูลที่เเก้ไข
|
||||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
async function onSubmit(id:string){
|
||||
// put
|
||||
console.log("edit");
|
||||
console.log("edit",id);
|
||||
router.push(`/discipline/investigatefacts`);
|
||||
};
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue