fix UI ค้นหาข้อมูลทะเบียนประวัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-06 09:31:23 +07:00
parent 8650cb2153
commit 377a8dc7c1

View file

@ -1,12 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { import { ref, reactive, onMounted, watch, defineAsyncComponent } from "vue";
ref,
reactive,
onMounted,
watch,
defineAsyncComponent,
computed,
} from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -340,9 +333,7 @@ function clearSelect(t: string) {
fetchDataPerson(); fetchDataPerson();
} }
/** /** ฟังก์ชันดึงข้อโครงสร้าง*/
* งกนดงขอโครงสราง
*/
async function fetchTree() { async function fetchTree() {
const data = await fetchStructureTree(route.meta.Key as string); const data = await fetchStructureTree(route.meta.Key as string);
if (store.routerName !== route.name) { if (store.routerName !== route.name) {
@ -466,366 +457,366 @@ onMounted(async () => {
</div> </div>
</q-form> </q-form>
<div class="row q-mt-sm q-gutter-sm"> <div class="row">
<q-btn-dropdown <div class="col-10">
flat <div class="row q-mt-sm q-gutter-sm">
rounded <q-btn-dropdown
dense flat
label-color="white" rounded
dropdown-icon="mdi-chevron-down" dense
class="q-pl-sm" label-color="white"
@click="() => ((selectNode = true), showLoader())" dropdown-icon="mdi-chevron-down"
> class="q-pl-sm"
<template v-slot:label> @click="() => ((selectNode = true), showLoader())"
{{ >
`${ <template v-slot:label>
store.labelOption.node !== "เลือกหน่วยงาน" {{
? store.labelOption.node `${
: empType === "officer" store.labelOption.node !== "เลือกหน่วยงาน"
? "เลือกหน่วยงาน/ส่วนราชการ" ? store.labelOption.node
: "เลือกหน่วยงาน" : empType === "officer"
}` ? "เลือกหน่วยงาน/ส่วนราชการ"
}} : "เลือกหน่วยงาน"
<q-btn }`
v-if=" }}
store.labelOption.node !== 'เลือกหน่วยงาน' && <q-btn
store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ' v-if="
store.labelOption.node !== 'เลือกหน่วยงาน' &&
store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ'
"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('org')"
/>
</template>
</q-btn-dropdown>
<q-toggle
v-if="store.formFilter.nodeId"
v-model="store.formFilter.isAll"
color="primary"
label="แสดงทุกตำแหน่ง"
class="q-pr-sm"
@update:model-value="getSearch"
>
<q-tooltip
>แสดงทกตำแหนงทอยภายใตหนวยงาน/วนราชการทเลอก</q-tooltip
>
</q-toggle>
<q-separator inset vertical class="lineFil" />
<q-btn-dropdown
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
store.labelOption.posType !== "ทั้งหมด"
? store.labelOption.posType
: empType === "officer"
? `ตำแหน่งประเภท${store.labelOption.posType}`
: `กลุ่มงาน${store.labelOption.posType}`
}}
<q-btn
v-if="store.labelOption.posType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('posType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.posTypeOps"
:key="index"
clickable
v-close-popup
@click="selectPosType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<!-- <q-separator inset vertical class="lineFil" /> -->
<q-btn-dropdown
flat
dense
rounded
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
:disable="
store.labelOption.posType === 'ทั้งหมด' ? true : false
" "
size="10px" >
flat <template v-slot:label>
round {{
color="white" store.labelOption.posLevel !== "ทั้งหมด"
icon="close" ? store.labelOption.posLevel
@click.stop.prevent="clearSelect('org')" : empType === "officer"
/> ? `ระดับ${store.labelOption.posLevel}`
</template> : `ระดับชั้นงาน${store.labelOption.posLevel}`
</q-btn-dropdown> }}
<q-btn
size="10px"
flat
round
color="white"
icon="close"
v-if="store.labelOption.posLevel !== 'ทั้งหมด'"
@click.stop.prevent="clearSelect('posLevel')"
/>
</template>
<q-list
:style="store.posLevelOps.length > 9 ? 'height: 450px' : ''"
>
<q-item
v-for="(item, index) in store.posLevelOps"
:key="index"
clickable
v-close-popup
@click="selectPosLevel(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-toggle <q-space />
v-if="store.formFilter.nodeId"
v-model="store.formFilter.isAll" <!-- <q-separator
color="primary" inset
label="แสดงทุกตำแหน่ง" vertical
class="q-pr-sm" class="lineFil"
@update:model-value="getSearch" v-if="empType !== 'officer' && store.formFilter.nodeId"
> /> -->
<q-tooltip
>แสดงทกตำแหนงทอยภายใตหนวยงาน/วนราชการทเลอก</q-tooltip <!-- <q-toggle
v-if="empType !== 'officer' && store.formFilter.nodeId"
v-model="store.formFilter.isAll"
color="primary"
label="แสดงตำแหน่งทั้งหมด"
@update:model-value="getSearch"
/> -->
</div>
<div
class="row q-gutter-sm justify-start"
v-if="empType !== 'officer'"
> >
</q-toggle> <q-toggle
v-model="store.formFilter.isShowRetire"
<q-separator inset vertical class="lineFil" /> color="primary"
label="แสดงข้อมูลผู้พ้นจากราชการ"
<q-btn-dropdown class="q-pr-sm"
rounded @update:model-value="getSearch"
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
store.labelOption.posType !== "ทั้งหมด"
? store.labelOption.posType
: empType === "officer"
? `ตำแหน่งประเภท${store.labelOption.posType}`
: `กลุ่มงาน${store.labelOption.posType}`
}}
<q-btn
v-if="store.labelOption.posType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('posType')"
/> />
</template> <q-btn-dropdown
<q-list> v-if="store.formFilter.isShowRetire"
<q-item rounded
v-for="(item, index) in store.posTypeOps"
:key="index"
clickable
v-close-popup
@click="selectPosType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<!-- <q-separator inset vertical class="lineFil" /> -->
<q-btn-dropdown
flat
dense
rounded
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
:disable="store.labelOption.posType === 'ทั้งหมด' ? true : false"
>
<template v-slot:label>
{{
store.labelOption.posLevel !== "ทั้งหมด"
? store.labelOption.posLevel
: empType === "officer"
? `ระดับ${store.labelOption.posLevel}`
: `ระดับชั้นงาน${store.labelOption.posLevel}`
}}
<q-btn
size="10px"
flat flat
round dense
color="white" label-color="white"
icon="close" dropdown-icon="mdi-chevron-down"
v-if="store.labelOption.posLevel !== 'ทั้งหมด'" class="q-px-sm"
@click.stop.prevent="clearSelect('posLevel')"
/>
</template>
<q-list
:style="store.posLevelOps.length > 9 ? 'height: 450px' : ''"
>
<q-item
v-for="(item, index) in store.posLevelOps"
:key="index"
clickable
v-close-popup
@click="selectPosLevel(item)"
> >
<q-item-section> <template v-slot:label>
<q-item-label>{{ item.name }}</q-item-label> {{
</q-item-section> store.labelOption.retireType !== "ทั้งหมด"
</q-item> ? store.labelOption.retireType
</q-list> : `${store.labelOption.retireType}`
</q-btn-dropdown> }}
<q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('retireType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeEmpOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-space /> <q-separator inset vertical class="lineFil" />
<div class="q-pt-sm q-pr-sm">
<!-- <a href="/report/registry" class="text-white"> <q-btn-dropdown
การคนหาขนส rounded
<q-tooltip flat
>ไปยงหนาการคนหาขนส (Advanced search)</q-tooltip dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
> >
</a> --> <template v-slot:label>
<q-btn {{
flat `ลำดับการแสดผล ${
@click="goToAdvancedSearch" store.formFilter.dateAppoint
class="text-white" ? store.formFilter.dateAppoint === "ASC"
style="text-decoration: underline" ? "เก่า-ล่าสุด"
label="การค้นหาขั้นสูง" : "ล่าสุด-เก่า"
: ""
}`
}}
</template>
<q-list>
<q-item
v-for="(item, index) in store.displayOrderOps"
:key="index"
clickable
v-close-popup
@click="selectDisplayOrderType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
<div
v-if="empType === 'officer'"
class="row q-gutter-sm justify-start"
> >
<q-tooltip <q-toggle
>ไปยงหนาการคนหาขนส (Advanced search)</q-tooltip v-model="store.formFilter.isProbation"
color="primary"
label="ทดลองปฏิบัติหน้าที่ราชการ"
class="q-pr-sm"
@update:model-value="getSearch"
/>
<q-separator inset vertical class="lineFil" />
<q-toggle
v-model="store.formFilter.isShowRetire"
color="primary"
label="แสดงข้อมูลผู้พ้นจากราชการ"
class="q-pr-sm"
@update:model-value="getSearch"
/>
<q-btn-dropdown
v-if="store.formFilter.isShowRetire"
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
> >
</q-btn> <template v-slot:label>
{{
store.labelOption.retireType !== "ทั้งหมด"
? store.labelOption.retireType
: `${store.labelOption.retireType}`
}}
<q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('retireType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-separator inset vertical class="lineFil" />
<!-- <q-toggle
v-if="store.formFilter.nodeId"
v-model="store.formFilter.isAll"
color="primary"
label="แสดงตำแหน่งทั้งหมด"
@update:model-value="getSearch"
/> -->
<q-btn-dropdown
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{ store.labelOption.sortName }}
</template>
<q-list>
<q-item
v-for="(item, index) in store.displayOrderOps"
:key="index"
clickable
v-close-popup
@click="selectDisplayOrderType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div> </div>
<div class="col-2">
<!-- <q-separator <div class="q-pt-sm flex justify-end">
inset
vertical
class="lineFil"
v-if="empType !== 'officer' && store.formFilter.nodeId"
/> -->
<!-- <q-toggle
v-if="empType !== 'officer' && store.formFilter.nodeId"
v-model="store.formFilter.isAll"
color="primary"
label="แสดงตำแหน่งทั้งหมด"
@update:model-value="getSearch"
/> -->
</div>
<div
class="row q-gutter-sm justify-start"
v-if="empType !== 'officer'"
>
<q-toggle
v-model="store.formFilter.isShowRetire"
color="primary"
label="แสดงข้อมูลผู้พ้นจากราชการ"
class="q-pr-sm"
@update:model-value="getSearch"
/>
<q-btn-dropdown
v-if="store.formFilter.isShowRetire"
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
store.labelOption.retireType !== "ทั้งหมด"
? store.labelOption.retireType
: `${store.labelOption.retireType}`
}}
<q-btn <q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat flat
round @click="goToAdvancedSearch"
color="white" class="text-white"
icon="close" style="text-decoration: underline"
@click.stop.prevent="clearSelect('retireType')" label="การค้นหาขั้นสูง"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeEmpOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
> >
<q-item-section> <q-tooltip
<q-item-label>{{ item.name }}</q-item-label> >ไปยงหนาการคนหาขนส (Advanced search)</q-tooltip
</q-item-section> >
</q-item> </q-btn>
</q-list> </div>
</q-btn-dropdown> </div>
<q-separator inset vertical class="lineFil" />
<q-btn-dropdown
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
`ลำดับการแสดผล ${
store.formFilter.dateAppoint
? store.formFilter.dateAppoint === "ASC"
? "เก่า-ล่าสุด"
: "ล่าสุด-เก่า"
: ""
}`
}}
</template>
<q-list>
<q-item
v-for="(item, index) in store.displayOrderOps"
:key="index"
clickable
v-close-popup
@click="selectDisplayOrderType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div> </div>
<div
v-if="empType === 'officer'"
class="row q-gutter-sm justify-start"
>
<q-toggle
v-model="store.formFilter.isProbation"
color="primary"
label="ทดลองปฏิบัติหน้าที่ราชการ"
class="q-pr-sm"
@update:model-value="getSearch"
/>
<q-separator inset vertical class="lineFil" />
<q-toggle
v-model="store.formFilter.isShowRetire"
color="primary"
label="แสดงข้อมูลผู้พ้นจากราชการ"
class="q-pr-sm"
@update:model-value="getSearch"
/>
<q-btn-dropdown
v-if="store.formFilter.isShowRetire"
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
>
<template v-slot:label>
{{
store.labelOption.retireType !== "ทั้งหมด"
? store.labelOption.retireType
: `${store.labelOption.retireType}`
}}
<q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('retireType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-separator inset vertical class="lineFil" />
<!-- <q-toggle
v-if="store.formFilter.nodeId"
v-model="store.formFilter.isAll"
color="primary"
label="แสดงตำแหน่งทั้งหมด"
@update:model-value="getSearch"
/> -->
<q-btn-dropdown
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{ store.labelOption.sortName }}
</template>
<q-list>
<q-item
v-for="(item, index) in store.displayOrderOps"
:key="index"
clickable
v-close-popup
@click="selectDisplayOrderType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
<!-- <div class="row justify-center">
<a href="/report/registry" class="text-white"> Advanced search </a>
</div> -->
</div> </div>
</div> </div>
</q-card-section> </q-card-section>