จัดโค้ดข้อมูลพื้นฐาน
This commit is contained in:
parent
977f938439
commit
43c02f3469
6 changed files with 282 additions and 164 deletions
|
|
@ -5,6 +5,9 @@ import { useRouter, useRoute } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
/**
|
||||
* รวมตัวแปร
|
||||
*/
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
|
|
@ -22,23 +25,36 @@ const myForm = ref<QForm | null>(null); //form data input
|
|||
const edit = ref<boolean>(false);
|
||||
const channel = ref<string>("");
|
||||
|
||||
/**
|
||||
* เรียกข้อมูลจากรายการ
|
||||
*/
|
||||
onMounted(async () => {});
|
||||
// เรียกข้อมูลของรอบการเสนอขอ
|
||||
const fetchData = async () => {};
|
||||
|
||||
/**
|
||||
* ลบข้อมูล
|
||||
* @param id ไอดีของข้อมูลที่ต้องการลบ
|
||||
*/
|
||||
const deleteData = async (id: string) => {};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
|
||||
// คลิกบันทึก
|
||||
const checkSave = () => {};
|
||||
// บันทึกข้อมูล
|
||||
/* บันทึกข้อมูล**/
|
||||
const SaveData = async () => {};
|
||||
// เพิ่มข้อมูลรอบการเสนอขอพระราชทานเครื่องราชฯ
|
||||
const checkSave = () => {};
|
||||
|
||||
/**
|
||||
* เพิ่มข้อมูล
|
||||
*/
|
||||
const addData = async () => {};
|
||||
// แก้ไขข้อมูล
|
||||
|
||||
/**
|
||||
* แก้ไขข้อมูล
|
||||
* @param id ช่องทาง
|
||||
*/
|
||||
const editData = async (id: string) => {};
|
||||
|
||||
/**
|
||||
* ย้อนกลับหน้ารายการ
|
||||
*/
|
||||
const clickBack = () => {
|
||||
router.push(`/discipline/channel`);
|
||||
};
|
||||
|
|
@ -81,12 +97,7 @@ const clickBack = () => {
|
|||
<q-separator />
|
||||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn label="บันทึก" color="public" @click="checkSave"> </q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,15 +5,17 @@ import router from "@/router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useDisciplineChannelDataStore } from "@/modules/11_discipline/store/ChannelStore";
|
||||
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
const dataStore = useDisciplineChannelDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove } = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
// ค้นหาในตาราง
|
||||
/**
|
||||
* ค้นหาในตาราง
|
||||
*/
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -22,7 +24,10 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
}
|
||||
};
|
||||
const dataStore = useDisciplineChannelDataStore();
|
||||
|
||||
/**
|
||||
*pagination ของตาราง
|
||||
*/
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
|
|
@ -30,10 +35,17 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* clickไปหน้าเพิ่มchanel
|
||||
*/
|
||||
const clickAdd = () => {
|
||||
router.push(`/discipline/channel/add`);
|
||||
};
|
||||
|
||||
/**
|
||||
* ลบข้อมู,
|
||||
* @param id ไอดีของข้อมูล
|
||||
*/
|
||||
const clickDelete = (id: string) => {
|
||||
dialogRemove(
|
||||
$q,
|
||||
|
|
@ -46,6 +58,9 @@ const clickDelete = (id: string) => {
|
|||
);
|
||||
};
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(() => {
|
||||
// get ข้อมูลแล้วโยนใส่ store
|
||||
dataStore.fetchData([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue