feat: batch feedback
This commit is contained in:
47
frontend/src/components/BatchFeedback.vue
Normal file
47
frontend/src/components/BatchFeedback.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div v-if="feedbackList.data"></div>
|
||||
<div v-else class="space-y-8">
|
||||
<div class="grid grid-cols-4 gap-5">
|
||||
<Rating v-model="feedback.content" :label="__('Content')" />
|
||||
<Rating v-model="feedback.delivery" :label="__('Delivery')" />
|
||||
<Rating v-model="feedback.instructors" :label="__('Instructors')" />
|
||||
<Rating v-model="feedback.value" :label="__('Value')" />
|
||||
</div>
|
||||
<FormControl
|
||||
v-model="feedback.feedback"
|
||||
type="textarea"
|
||||
:label="__('Feedback')"
|
||||
rows="7"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { inject, reactive } from 'vue'
|
||||
import { createListResource, FormControl, Rating } from 'frappe-ui'
|
||||
|
||||
const user = inject('$user')
|
||||
const feedback = reactive({
|
||||
content: 0,
|
||||
delivery: 0,
|
||||
instructors: 0,
|
||||
value: 0,
|
||||
feedback: '',
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
batch: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const feedbackList = createListResource({
|
||||
doctype: 'LMS Batch Feedback',
|
||||
filters: {
|
||||
batch: props.batch,
|
||||
member: user.data?.name,
|
||||
},
|
||||
cache: ['feedbackList', props.batch, user.data?.name],
|
||||
auto: true,
|
||||
})
|
||||
</script>
|
||||
@@ -391,7 +391,7 @@ const getChartOptions = (categories) => {
|
||||
},
|
||||
rotate: 0,
|
||||
formatter: function (value) {
|
||||
return value.length > 20 ? `${value.substring(0, 20)}...` : value // Trim long labels
|
||||
return value.length > 20 ? `${value.substring(0, 20)}...` : value
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -77,10 +77,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <span class="mt-4">
|
||||
{{ student }}
|
||||
</span> -->
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user