ปรับแก้ไขเครื่องราช

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-01 13:54:08 +07:00
parent 64152f72d9
commit 7611d51974
11 changed files with 386 additions and 71 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, watch } from "vue";
const reason = ref<string>("");
const props = defineProps({
@ -17,11 +17,16 @@ const props = defineProps({
},
clickClose: {
type: Function,
default: () => { }
default: () => {},
},
savaForm: {
type: Function,
default: () => { }
default: () => {},
},
});
watch(props, () => {
if (props.modal === true) {
reason.value = "";
}
});
@ -29,7 +34,7 @@ const myForm = ref<any>();
const submit = () => {
myForm.value.validate().then((result: boolean) => {
if (result) {
props.savaForm(reason.value)
props.savaForm(reason.value);
}
});
};
@ -40,16 +45,31 @@ const submit = () => {
<q-card style="width: 500px; max-width: 500px">
<q-toolbar class="q-py-md">
<q-toolbar-title class="header-text">{{ props.title }}</q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="clickClose"
style="color: #ff8080; background-color: #ffdede" />
<q-btn
icon="close"
unelevated
round
dense
@click="clickClose"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<q-separator />
<q-form ref="myForm">
<q-card-section class="q-p-sm">
<div class="row col-12">
<q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined dense
lazy-rules :rules="[(val) => !!val || `กรุณากรอก${label}`]" v-model="reason" :label="`${label}`" />
<q-input
type="textarea"
class="full-width inputgreen cursor-pointer"
hide-bottom-space
outlined
dense
lazy-rules
:rules="[(val) => !!val || `กรุณากรอก${label}`]"
v-model="reason"
:label="`${label}`"
/>
</div>
</q-card-section>
@ -60,7 +80,6 @@ const submit = () => {
<q-btn label="บันทึก" color="secondary" @click="submit" />
</q-toolbar>
</q-form>
</q-card>
</q-dialog>
</template>
</template>