Refactoring code module 08_registryEmployee

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-19 17:09:26 +07:00
parent bd33093d3e
commit 7091eaaeb9
31 changed files with 169 additions and 24405 deletions

View file

@ -1,8 +1,10 @@
<script setup lang="ts">
import { ref, reactive, watch, onBeforeMount, onMounted } from "vue";
import { ref, watch, onBeforeMount } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
import http from "@/plugins/http";
import config from "@/app.config";
@ -17,10 +19,6 @@ import type {
/** importComponents*/
import Header from "@/components/DialogHeader.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
/** use*/
const $q = useQuasar();
const { fetchStructureTree } = useStructureTree();
@ -48,16 +46,16 @@ const props = defineProps({
});
/** Tree*/
const nodeId = ref<string>("");
const nodeLevel = ref<number>(0);
const filterTree = ref<string>("");
const nodes = ref<Array<TreeMain>>([]);
const nodeId = ref<string>(""); //id /
const nodeLevel = ref<number>(0); // /
const filterTree = ref<string>(""); ///
const nodes = ref<Array<TreeMain>>([]); //
const lazy = ref(nodes);
const expanded = ref<string[]>([]);
/** Table*/
const filters = ref<string>("");
const rowsPosition = ref<Position[]>([]);
const filters = ref<string>(""); //
const rowsPosition = ref<Position[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "isPosition",
@ -198,12 +196,12 @@ const visibleColumns = ref<string[]>([
]);
/** Position*/
const positionNo = ref<PositionNo[]>([]);
const positionId = ref<string>("");
const seletcId = ref<string>("");
const selectedPos = ref<any[]>([]);
const positionNo = ref<PositionNo[]>([]); //
const positionId = ref<string>(""); //id
const seletcId = ref<string>(""); // id
const selectedPos = ref<any[]>([]); //
const datePos = ref<Date>(new Date());
const posMasterMain = ref<any>([]);
const posMasterMain = ref<any>([]); //
const orgRevisionId = ref<string>("");
const isLoad = ref<boolean>(false);
/**
@ -322,7 +320,9 @@ async function fetchPosFind(level: number, id: string) {
});
}
/** function บันทึกข้อมูลตำแหน่ง*/
/**
* function นทกขอมลตำแหน
*/
async function onClickSubmit() {
const dataPosMaster = await posMasterMain.value?.find(
(e: any) => e.id === positionId.value
@ -365,13 +365,17 @@ async function onClickSubmit() {
}
}
/** function closePopup*/
/**
* function closePopup
*/
function closePopup() {
modal.value = !modal.value;
clearData();
}
/** function clearData*/
/**
* function clearData
*/
async function clearData() {
nodeId.value = "";
expanded.value = [];
@ -392,6 +396,10 @@ function filterItemsTaps(data: any[]) {
return orgTreeIds;
}
/**
* function เลอกตำแหน
* @param id องการ
*/
async function onClickSelectPos(id: string) {
positionId.value = id;
selectedPos.value = [];
@ -425,6 +433,9 @@ watch(
}
);
/**
* ทำงานเมอเลอก แสดงตำแหนงทงหมด
*/
watch(
() => isAll.value,
(value, oldVal) => {
@ -434,6 +445,9 @@ watch(
}
);
/**
* ทำงานเมอเลอก แสดงเฉพาะตำแหนงวาง
*/
watch(
() => isBlank.value,
(value, oldVal) => {