search tree report by dna
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m34s

This commit is contained in:
kittapath 2026-01-11 15:14:48 +07:00
parent 0c768e3626
commit c46aa520d4
2 changed files with 15 additions and 15 deletions

View file

@ -71,7 +71,7 @@ const splitterModel = ref<number>(14);
/** tree*/ /** tree*/
const filterTree = ref<string>(""); const filterTree = ref<string>("");
const nodeId = ref<string>(""); const nodeId = ref<string>("");
const orgTreeId = ref<string>(""); const orgTreeDnaId = ref<string>("");
const nodeLevel = ref<number>(0); const nodeLevel = ref<number>(0);
const node = ref<DataStructureTree[]>([]); const node = ref<DataStructureTree[]>([]);
const expanded = ref<string[]>([]); const expanded = ref<string[]>([]);
@ -94,9 +94,9 @@ function onUpdateYear(val: number) {
function onSelectedNode(data: any) { function onSelectedNode(data: any) {
org.value = data.orgName; org.value = data.orgName;
nodeId.value = data.orgTreeId; nodeId.value = data.orgTreeDnaId;
nodeLevel.value = data.orgLevel; nodeLevel.value = data.orgLevel;
orgTreeId.value = data.orgTreeId; orgTreeDnaId.value = data.orgTreeDnaId;
expandedModal.value = false; expandedModal.value = false;
} }
@ -110,7 +110,7 @@ function fetchDataReport() {
const queryParams = { const queryParams = {
nodeId: nodeId:
reportType.value.type === "probation" && reportType.value.id === "2" reportType.value.type === "probation" && reportType.value.id === "2"
? orgTreeId.value ? orgTreeDnaId.value
: nodeId.value, : nodeId.value,
node: nodeLevel.value, node: nodeLevel.value,
startDate: dateToISO(dateStart.value), startDate: dateToISO(dateStart.value),
@ -184,7 +184,7 @@ function clearFilter() {
org.value = ""; org.value = "";
nodeId.value = ""; nodeId.value = "";
nodeLevel.value = 0; nodeLevel.value = 0;
orgTreeId.value = ""; orgTreeDnaId.value = "";
reportType.value = undefined; reportType.value = undefined;
detailReport.value = undefined; detailReport.value = undefined;
pdfSrc.value = undefined; pdfSrc.value = undefined;
@ -297,7 +297,7 @@ onMounted(() => {
<q-tree <q-tree
dense dense
:nodes="node" :nodes="node"
node-key="orgTreeId" node-key="orgTreeDnaId"
label-key="labelName" label-key="labelName"
v-model:expanded="expanded" v-model:expanded="expanded"
:filter="filterTree.trim()" :filter="filterTree.trim()"
@ -308,7 +308,7 @@ onMounted(() => {
<template v-slot:default-header="prop"> <template v-slot:default-header="prop">
<q-item <q-item
@click.stop="onSelectedNode(prop.node)" @click.stop="onSelectedNode(prop.node)"
:active="nodeId === prop.node.orgTreeId" :active="nodeId === prop.node.orgTreeDnaId"
clickable clickable
active-class="my-list-link text-primary text-weight-medium" active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list" class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"

View file

@ -112,7 +112,7 @@ const nodeId = ref<string>("");
const nodeLevel = ref<number>(0); const nodeLevel = ref<number>(0);
const node = ref<DataStructureTree[]>([]); const node = ref<DataStructureTree[]>([]);
const expanded = ref<string[]>([]); const expanded = ref<string[]>([]);
const orgTreeId = ref<string>(""); const orgTreeDnaId = ref<string>("");
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/ /** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
async function fetchDataTree() { async function fetchDataTree() {
@ -133,10 +133,10 @@ async function fetchDataTree() {
*/ */
function onSelectedNode(data: any) { function onSelectedNode(data: any) {
org.value = data.orgName; org.value = data.orgName;
nodeId.value = data.orgTreeId; nodeId.value = data.orgTreeDnaId;
nodeLevel.value = data.orgLevel; nodeLevel.value = data.orgLevel;
expandedModal.value = false; expandedModal.value = false;
orgTreeId.value = data.orgTreeId; orgTreeDnaId.value = data.orgTreeDnaId;
updateLeaveday(); updateLeaveday();
} }
@ -221,7 +221,7 @@ async function fetchLeaveday(
startDate: Date, startDate: Date,
endDate: Date endDate: Date
) { ) {
const nodeIdVal = typeReport.value === 3 ? orgTreeId.value : nodeId.value; const nodeIdVal = typeReport.value === 3 ? orgTreeDnaId.value : nodeId.value;
const body = { const body = {
type: type:
year === "FULL" year === "FULL"
@ -337,7 +337,7 @@ function filterOption(val: string, update: any, typeOp: string) {
function clearData() { function clearData() {
nodeId.value = ""; nodeId.value = "";
nodeLevel.value = 0; nodeLevel.value = 0;
orgTreeId.value = ""; orgTreeDnaId.value = "";
org.value = ""; org.value = "";
typeReport.value = null; typeReport.value = null;
yearType.value = "FULL"; yearType.value = "FULL";
@ -414,7 +414,7 @@ function getReport() {
: "WEEKLY", : "WEEKLY",
startDate: dateToISO(dateStart.value), startDate: dateToISO(dateStart.value),
endDate: dateToISO(dateEnd.value), endDate: dateToISO(dateEnd.value),
nodeId: orgTreeId.value, nodeId: orgTreeDnaId.value,
node: nodeLevel.value, node: nodeLevel.value,
}; };
http http
@ -626,7 +626,7 @@ onMounted(() => {
<q-tree <q-tree
dense dense
:nodes="node" :nodes="node"
node-key="orgTreeId" node-key="orgTreeDnaId"
label-key="labelName" label-key="labelName"
v-model:expanded="expanded" v-model:expanded="expanded"
:filter="filterTree.trim()" :filter="filterTree.trim()"
@ -637,7 +637,7 @@ onMounted(() => {
<template v-slot:default-header="prop"> <template v-slot:default-header="prop">
<q-item <q-item
@click.stop="onSelectedNode(prop.node)" @click.stop="onSelectedNode(prop.node)"
:active="nodeId === prop.node.orgTreeId" :active="nodeId === prop.node.orgTreeDnaId"
clickable clickable
active-class="my-list-link text-primary text-weight-medium" active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list" class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"