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*/
const filterTree = ref<string>("");
const nodeId = ref<string>("");
const orgTreeId = ref<string>("");
const orgTreeDnaId = ref<string>("");
const nodeLevel = ref<number>(0);
const node = ref<DataStructureTree[]>([]);
const expanded = ref<string[]>([]);
@ -94,9 +94,9 @@ function onUpdateYear(val: number) {
function onSelectedNode(data: any) {
org.value = data.orgName;
nodeId.value = data.orgTreeId;
nodeId.value = data.orgTreeDnaId;
nodeLevel.value = data.orgLevel;
orgTreeId.value = data.orgTreeId;
orgTreeDnaId.value = data.orgTreeDnaId;
expandedModal.value = false;
}
@ -110,7 +110,7 @@ function fetchDataReport() {
const queryParams = {
nodeId:
reportType.value.type === "probation" && reportType.value.id === "2"
? orgTreeId.value
? orgTreeDnaId.value
: nodeId.value,
node: nodeLevel.value,
startDate: dateToISO(dateStart.value),
@ -184,7 +184,7 @@ function clearFilter() {
org.value = "";
nodeId.value = "";
nodeLevel.value = 0;
orgTreeId.value = "";
orgTreeDnaId.value = "";
reportType.value = undefined;
detailReport.value = undefined;
pdfSrc.value = undefined;
@ -297,7 +297,7 @@ onMounted(() => {
<q-tree
dense
:nodes="node"
node-key="orgTreeId"
node-key="orgTreeDnaId"
label-key="labelName"
v-model:expanded="expanded"
:filter="filterTree.trim()"
@ -308,7 +308,7 @@ onMounted(() => {
<template v-slot:default-header="prop">
<q-item
@click.stop="onSelectedNode(prop.node)"
:active="nodeId === prop.node.orgTreeId"
:active="nodeId === prop.node.orgTreeDnaId"
clickable
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"

View file

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