Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-20 14:45:47 +07:00
commit 7b66982c52

View file

@ -32,7 +32,6 @@ const { fetchStructureTree } = useStructureTree();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const route = useRoute();
const mode = ref<"table" | "card">("table"); //
const empType = ref<string>("officer"); // officer / employee / perm
const dataPersonMain = ref<DataPerson[]>([]); //
const maxPage = ref<number>(1); //
@ -51,9 +50,7 @@ const nodeData = reactive<DataNodeData>({
node: null,
});
/**
* function เรยกขอมลตำแหนงประเภท
*/
/** function เรียกข้อมูลตำแหน่งประเภท*/
function fetchType() {
http
.get(config.API.orgPosType)
@ -65,9 +62,7 @@ function fetchType() {
});
}
/**
* function เรยกขอมลกลมงาน
*/
/** function เรียกข้อมูลกลุ่มงาน*/
function fetchOptionGroup() {
http
.get(config.API.orgEmployeeType)
@ -79,9 +74,7 @@ function fetchOptionGroup() {
});
}
/**
* function fetch รายชอขอมลทะเบยนประว
*/
/** function fetch รายชื่อข้อมูลทะเบียนประวัติ*/
async function fetchDataPerson() {
showLoader();
dataPersonMain.value = [];
@ -137,10 +130,11 @@ async function fetchDataPerson() {
)
.then(async (res) => {
const dataList = await res.data.result.data;
dataPersonMain.value = dataList;
maxPage.value = Math.ceil(
res.data.result.total / store.formFilter.pageSize
);
dataPersonMain.value = dataList;
total.value = res.data.result.total;
isShowBtnFilter.value = true;
if (dataList) {
@ -209,7 +203,6 @@ function onclickSearch() {
*/
function selectType() {
empType.value = route.name == "registryNew" ? "officer" : "perm";
if (empType.value !== "officer") {
store.formFilter.isShowRetire = null;
store.formFilter.isProbation = null;
@ -317,9 +310,7 @@ async function fetchTree() {
}
}
/**
* นหาขอมลรายชอขอมลทะเบยนประวตามหนวยงาน/วนราชการ
*/
/** ค้นหาข้อมูลรายชื่อข้อมูลทะเบียนประวัติตามหน่วยงาน/ส่วนราชการ*/
function sendNode() {
nodeData.node = store.formFilter.node;
nodeData.nodeId = store.formFilter.nodeId;
@ -331,7 +322,6 @@ function sendNode() {
/**
* งกนเลอกหนวยงาน/วนราชการ
* @param data อมลหนวยงาน/วนราชการทองการคนหาร
*
* เพอคนหาขอมลตามหนวยงาน/วนราชการ
*/
function updateSelectedTreeMain(data: DataStructureTree) {
@ -354,14 +344,12 @@ watch(selectNode, () => {
isLoad.value && hideLoader();
});
/**
* hook เมอมการเรยกใช Components
*/
/** hook เมื่อมีการเรียกใช้ Components*/
function getSearch() {
store.formFilter.page = 1;
fetchDataPerson();
}
onMounted(async () => {
await Promise.all([selectType(), fetchTree()]);
});