fix fetchData ใหม่
This commit is contained in:
parent
1c490719b9
commit
424808fab0
2 changed files with 30 additions and 6 deletions
|
|
@ -150,9 +150,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-5 q-pr-sm text-grey-7">ความคิดเห็น/ข้อแนะนำ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs">
|
||||
{{ review }}
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs">{{ review }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -161,7 +159,7 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
|
||||
import http from '@/plugins/http'
|
||||
import config from '@/app.config'
|
||||
|
|
@ -200,6 +198,15 @@ const reviewPoint = ref<number>(0)
|
|||
const review = ref<string>('-')
|
||||
const candidateId = ref<string>('')
|
||||
|
||||
const props = defineProps({
|
||||
isSubmit: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['updateIsSubmit'])
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchStatus()
|
||||
})
|
||||
|
|
@ -243,6 +250,7 @@ const fetchStatus = async () => {
|
|||
})
|
||||
.finally(() => {
|
||||
loaderPage(false)
|
||||
emit('updateIsSubmit') // ส่ง event 'submit'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -272,6 +280,15 @@ const downloadFilePDF = async (res: string, fileName: string) => {
|
|||
document.body.appendChild(link)
|
||||
link.click()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.isSubmit,
|
||||
() => {
|
||||
if (props.isSubmit) {
|
||||
fetchStatus()
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
/>ได้รับใบสมัครแล้ว
|
||||
</div>
|
||||
</q-card>
|
||||
<ExamCard />
|
||||
<ExamCard :isSubmit="isSubmit" @updateIsSubmit="updateIsSubmit" />
|
||||
</div>
|
||||
</div>
|
||||
<q-dialog v-model="dialog" persistent>
|
||||
|
|
@ -127,6 +127,7 @@ const avatar = ref<string>('')
|
|||
const dialog = ref<boolean>(false)
|
||||
const rating = ref<number>(5)
|
||||
const text = ref<string>('')
|
||||
const isSubmit = ref<boolean>(false)
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchStatus()
|
||||
|
|
@ -174,7 +175,9 @@ const sendRating = async () => {
|
|||
reviewPoint: rating.value, //คะแนน
|
||||
review: text.value //ข้อความ
|
||||
})
|
||||
.then((res) => {})
|
||||
.then(async () => {
|
||||
isSubmit.value = true
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
|
|
@ -184,6 +187,10 @@ const sendRating = async () => {
|
|||
})
|
||||
}
|
||||
|
||||
const updateIsSubmit = () => {
|
||||
isSubmit.value = false
|
||||
}
|
||||
|
||||
const getClass = (val: string) => {
|
||||
return val == 'done' || val == 'checkPoint' ? 'bg-green-1' : 'bg-yellow-2'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue