Refactoring code module 06_retirement

This commit is contained in:
STW_TTTY\stwtt 2024-09-18 15:18:57 +07:00
parent 1225254062
commit ea921b39b0
29 changed files with 730 additions and 823 deletions

View file

@ -2,27 +2,27 @@
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
/** Use */
const router = useRouter();
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
success,
date2Thai,
findOrgName,
} = mixin;
const { showLoader, hideLoader, messageError, date2Thai, findOrgName } = mixin;
/** คอลัมน์ */
const rows = ref<any[]>([]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -74,16 +74,6 @@ const columns = ref<QTableProps["columns"]>([
return name;
},
},
// {
// name: "positionExecutive",
// align: "left",
// label: "",
// sortable: true,
// field: "positionExecutive",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: "org",
align: "left",
@ -120,13 +110,8 @@ const visibleColumns = ref<string[]>([
"createdAt",
]);
/**Hook */
onMounted(() => {
fectListDecased();
});
/**เรียกข้อมูลจาก APi */
const fectListDecased = async () => {
async function fectListDecased() {
showLoader();
await http
.get(config.API.listDeceased())
@ -140,25 +125,24 @@ const fectListDecased = async () => {
.finally(() => {
hideLoader();
});
};
}
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
};
}
/** Setting Pagination */
const nextPage = (id: string) => {
function nextPage(id: string) {
router.push("/retirement/deceased/" + id);
};
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
}
/**Hook */
onMounted(() => {
fectListDecased();
});
</script>
<template>