จัดโค้ดข้อมูลพื้นฐาน

This commit is contained in:
AnandaTon 2023-11-10 16:10:30 +07:00
parent 977f938439
commit 43c02f3469
6 changed files with 282 additions and 164 deletions

View file

@ -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>

View file

@ -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([