ปรับ ui form

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-07 16:35:39 +07:00
parent 8ea5ad36da
commit 68ef892d62
8 changed files with 230 additions and 246 deletions

View file

@ -4,7 +4,7 @@ import { useCounterMixin } from "@/stores/mixin";
import moment, { Moment } from "moment";
const mixin = useCounterMixin();
const { date2Thai } = mixin;
const { date2Thai, covertDateObject } = mixin;
const props = defineProps({
dataById: {
@ -42,105 +42,103 @@ function onCkickSave() {
}
</script>
<template>
<!-- <q-card style="width: 350px; max-width: 80vw; higth: 100%"> -->
<div class="row q-pa-md q-col-q-gutter-sm">
<q-card
flat
bordered
:class="$q.screen.gt.xs ? 'col-12 bg-grey-1' : 'col-12 '"
>
<q-card-section class="bg-primary text-white" v-if="!$q.screen.gt.xs">
<div class="text-center">เวลาปจจ</div>
</q-card-section>
<div v-else class="q-pa-sm text-primary">เวลาปจจ</div>
<q-card-section class="text-center">
<div class="row q-gutter-md">
<!-- <div class="col">{{ data.date }}</div>
<div class="col">{{ data.in }} .</div> -->
<div class="col">{{ date2Thai(dateNow) }}</div>
<div class="col">{{ timeNoew }}</div>
</div>
</q-card-section>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm" v-if="statusAction">
<VueDatePicker
v-model="date"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
<q-card-section class="col q-pt-none">
<div class="row q-pa-sm q-col-q-gutter-sm">
<q-card
flat
bordered
:class="$q.screen.gt.xs ? 'col-12 bg-grey-1' : 'col-12 '"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
borderless
dense
:model-value="date !== null ? date2Thai(date) : null"
:label="`${'กรอกวันที่'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input> </template
></VueDatePicker>
</q-card>
<q-card-section class="bg-primary text-white" v-if="!$q.screen.gt.xs">
<div class="text-center">เวลาปจจ</div>
</q-card-section>
<div v-else class="q-pa-sm text-primary">เวลาปจจ</div>
<q-card-section class="text-center">
<div class="row q-gutter-md">
<div class="col">{{ date2Thai(dateNow) }}</div>
<div class="col">{{ timeNoew }}</div>
</div>
</q-card-section>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 bg-grey-1 q-mt-sm" v-else>
<div class="row q-gutter-md text-grey-5">
<div class="col-1">
<q-icon color="grey-5" name="calendar_today" />
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm" v-if="statusAction">
<VueDatePicker
v-model="date"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
borderless
dense
:model-value="date !== null ? date2Thai(date) : null"
:label="`${'กรอกวันที่'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input> </template
></VueDatePicker>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 bg-grey-1 q-mt-sm" v-else>
<div class="row q-gutter-md text-grey-5">
<div class="col-1">
<q-icon color="grey-5" name="calendar_today" />
</div>
<div class="col">{{ covertDateObject(dataById.date) }}</div>
</div>
<div class="col">31 .. 56</div>
</div>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm">
<div class="row q-gutter-xs">
<div class="col-12">
<q-checkbox
keep-color
color="primary"
v-model="checkboxIn"
label="ขอแก้ไขเวลาเข้างาน"
/>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm">
<div class="row q-gutter-xs">
<div class="col-12">
<q-checkbox
keep-color
color="primary"
v-model="checkboxIn"
label="ขอแก้ไขเวลาเข้างาน"
/>
</div>
<div class="col-12">
<q-checkbox
keep-color
v-model="checkboxOut"
color="primary"
label="ขอแก้ไขเวลาออกงาน"
/>
</div>
</div>
<div class="col-12">
<q-checkbox
keep-color
v-model="checkboxOut"
color="primary"
label="ขอแก้ไขเวลาออกงาน"
/>
</div>
</div>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm">
<q-input
borderless
v-model="reason"
label="เหตุผล"
type="textarea"
rows="1"
label-color="grey-5"
/>
</q-card>
</div>
</q-card>
<q-card flat bordered class="q-pa-sm col-12 q-mt-sm">
<q-input
borderless
v-model="reason"
label="เหตุผล"
type="textarea"
:rows="$q.screen.gt.xs ? '5' : '1'"
label-color="grey-5"
/>
</q-card>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn dense color="secondary" label="บันทึก" @click="onCkickSave" />
</q-card-actions>
<!-- </q-card> -->
</template>
<style scoped></style>