hrms-checkin/src/components/ToolBar.vue

87 lines
2.4 KiB
Vue
Raw Normal View History

2023-11-14 17:47:43 +07:00
<script setup lang="ts">
import { ref } from 'vue'
// import type { DataOption } from '@/interface/index/Main'
2023-11-14 17:47:43 +07:00
import Popup from '@/components/PopUp.vue'
// import HeaderPopup from "@/components/HeaderPopup.vue";
// import FormTime from "@/components/FormTime.vue";
const filterYear = ref<number>(new Date().getFullYear())
// const yearOption = ref<DataOption[]>([{ id: '2566', name: '2566' }])
2023-11-14 17:47:43 +07:00
const titleName = ref<string>('เพิ่มรายการลงเวลากรณีพิเศษ')
function filterYearFn() {
console.log('test')
}
2023-11-14 17:47:43 +07:00
const modalPopup = ref<boolean>(false)
function onClickopen() {
modalPopup.value = true
}
function onClickClose() {
modalPopup.value = false
}
</script>
<template>
<div class="q-pb-sm row">
<div class="items-center col-12 row q-gutter-sm">
<datepicker
menu-class-name="modalfix"
v-model="filterYear"
class="col-2"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:modelValue="filterYearFn"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
lazy-rules
outlined
:model-value="filterYear + 543"
:label="`${'ปีงบประมาณ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<!-- <q-select
2023-11-14 17:47:43 +07:00
dense
outlined
style="width: 180px"
2023-11-14 18:01:22 +07:00
label="ปีงบประมาณ"
2023-11-14 17:47:43 +07:00
v-model="filterYear"
:options="yearOption"
option-label="name"
option-value="id"
/> -->
2023-11-14 17:47:43 +07:00
<q-space />
<q-btn
unelevated
outline
icon="add"
color="light-blue"
:class="$q.screen.gt.xs ? 'q-px-sm bg-blue-1' : ''"
:label="$q.screen.gt.xs ? 'เพิ่มรายการลงเวลากรณีพิเศษ' : ''"
@click="onClickopen"
/>
</div>
</div>
<Popup :modal="modalPopup" :title="titleName" :clickClose="onClickClose" />
</template>
<style scoped></style>