Refactoring code module 02_organization
This commit is contained in:
parent
63b9aafbaf
commit
0f5d772e53
24 changed files with 805 additions and 1033 deletions
|
|
@ -1,8 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
|
||||
/**
|
||||
* importType
|
||||
|
|
@ -24,12 +27,6 @@ import type { DataTree } from "@/modules/02_organization/interface/index/organiz
|
|||
*/
|
||||
import HeaderDialog from "@/components/DialogHeader.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
|
|
@ -72,19 +69,24 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const title = ref<string>("ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน");
|
||||
const filterTree = ref<string>("");
|
||||
const filterRef = ref();
|
||||
const selectedTree = ref<string>("");
|
||||
const levelTree = ref<number>(0);
|
||||
const filterTable = ref<string>("");
|
||||
const selectedFilter = ref<PosMaster2[]>([]);
|
||||
const title = ref<string>("ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน"); //title Dialog
|
||||
const filterTree = ref<string>(""); //ค้นหาหน่วยงาน/ส่วนราชการปลายทาง
|
||||
const filterRef = ref(); //
|
||||
const selectedTree = ref<string>(""); //หน่วยงานที่ต้องการย้าย
|
||||
const levelTree = ref<number>(0); //ระดับหน่วยงานที่ต้องการย้าย
|
||||
const filterTable = ref<string>(""); //ค้นหาตำแหน่งที่ต้องการย้าย
|
||||
const selectedFilter = ref<PosMaster2[]>([]); //ตำแหน่งที่ต้องการย้าย
|
||||
|
||||
const pagination = ref({
|
||||
page: reqMaster.value.page,
|
||||
rowsPerPage: reqMaster.value.pageSize,
|
||||
});
|
||||
|
||||
/**
|
||||
* ปิดปุ่มย้ายตำแหน่ง
|
||||
*
|
||||
* เมื่อไม่ได้เลือกตำแหน่งที่ต้องการย้ายและหน่วยงานที่ต้องการย้ายปุ่มย้ายตำแหน่งจะปืด
|
||||
*/
|
||||
const isDisable = computed(() => {
|
||||
if (selectedTree.value === "" && selectedFilter.value.length === 0) {
|
||||
return true;
|
||||
|
|
@ -146,6 +148,18 @@ function onClickMovePos() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function updatePagination
|
||||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
reqMaster.value.pageSize = newPagination.rowsPerPage;
|
||||
reqMaster.value.page = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลง modal เมื่อเป็น true
|
||||
*/
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
|
|
@ -164,15 +178,6 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* function updatePagination
|
||||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
reqMaster.value.pageSize = newPagination.rowsPerPage;
|
||||
reqMaster.value.page = 1;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue