inputgreen
This commit is contained in:
parent
90c263aa45
commit
301e4f9dab
2 changed files with 25 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ import { useDisciplineChannelDataStore } from "@/modules/11_discipline/store/Cha
|
||||||
const dataStore = useDisciplineChannelDataStore();
|
const dataStore = useDisciplineChannelDataStore();
|
||||||
const channel = ref<string>(dataStore.type);
|
const channel = ref<string>(dataStore.type);
|
||||||
const channelRef = ref<any>();
|
const channelRef = ref<any>();
|
||||||
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
/**
|
/**
|
||||||
* รับ props มาจาก page หลัก
|
* รับ props มาจาก page หลัก
|
||||||
*/
|
*/
|
||||||
|
|
@ -26,7 +26,6 @@ const props = defineProps({
|
||||||
* เก็บข้อมูลลง formData
|
* เก็บข้อมูลลง formData
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||||
function save() {
|
function save() {
|
||||||
channelRef.value.validate().then(async (result: boolean) => {
|
channelRef.value.validate().then(async (result: boolean) => {
|
||||||
|
|
@ -38,6 +37,13 @@ function save() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inputEdit(val: boolean) {
|
||||||
|
return {
|
||||||
|
"full-width cursor-pointer ": val,
|
||||||
|
"full-width cursor-pointer inputgreen": !val,
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-form ref="channelRef">
|
<q-form ref="channelRef">
|
||||||
|
|
@ -48,7 +54,7 @@ function save() {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||||
<q-input
|
<q-input
|
||||||
class="col-12"
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="channel"
|
v-model="channel"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const props = defineProps({
|
||||||
default: () => "",
|
default: () => "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
const emit = defineEmits(["formDataReturn"]);
|
const emit = defineEmits(["formDataReturn"]);
|
||||||
/**
|
/**
|
||||||
* ข้อมูลรหัสบัตรประชาชน
|
* ข้อมูลรหัสบัตรประชาชน
|
||||||
|
|
@ -67,6 +67,7 @@ watch(props.data, async () => {
|
||||||
formData.position = props.data.position;
|
formData.position = props.data.position;
|
||||||
formData.phone = props.data.phone;
|
formData.phone = props.data.phone;
|
||||||
formData.email = props.data.email;
|
formData.email = props.data.email;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -144,6 +145,13 @@ function onValidate() {
|
||||||
props.onSubmit(formData);
|
props.onSubmit(formData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inputEdit(val: boolean) {
|
||||||
|
return {
|
||||||
|
"full-width cursor-pointer ": val,
|
||||||
|
"full-width cursor-pointer inputgreen": !val,
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<form @submit.prevent.stop="onValidate">
|
<form @submit.prevent.stop="onValidate">
|
||||||
|
|
@ -165,6 +173,7 @@ function onValidate() {
|
||||||
<div class="col-xs-12 q-pa-sm row">
|
<div class="col-xs-12 q-pa-sm row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="idCard"
|
v-model="idCard"
|
||||||
|
|
@ -191,6 +200,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.prefix"
|
v-model="formData.prefix"
|
||||||
|
|
@ -203,6 +213,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.firstname"
|
v-model="formData.firstname"
|
||||||
|
|
@ -215,6 +226,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.lastname"
|
v-model="formData.lastname"
|
||||||
|
|
@ -227,6 +239,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.position"
|
v-model="formData.position"
|
||||||
|
|
@ -239,6 +252,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.phone"
|
v-model="formData.phone"
|
||||||
|
|
@ -253,6 +267,7 @@ function onValidate() {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-input
|
<q-input
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.email"
|
v-model="formData.email"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue