mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
56 lines
2.8 KiB
Vue
56 lines
2.8 KiB
Vue
<template>
|
|
<div class="row parentContainer m-b-10">
|
|
<div class="col">
|
|
<div class="row m-l-0 m-r-0 p-t-10 b-a align-items-center pointer shadow bg-white rounded b-white">
|
|
<div class="col-12">
|
|
<div class="row m-b-10">
|
|
<div class="col-1">{{ item.id }}</div>
|
|
<div class="col-2">{{ item.question_title }}</div>
|
|
<div class="col-1">
|
|
<a :href="route('booking.details', JSON.parse(item.question_metadata).marking)" target="_blank" v-if="JSON.parse(item.question_metadata)">
|
|
{{ JSON.parse(item.question_metadata).marking }}
|
|
</a>
|
|
</div>
|
|
<div class="col-1">{{ parsedAnswer === 'go_back' ? '' : item.answer }}</div>
|
|
<div class="col-2">{{ parsedAnswer }}</div>
|
|
<div class="col-1" style="display: flex; flex-wrap: nowrap; gap: 5px;">
|
|
<div v-if="item.documents != null" style="display: flex; flex-wrap: nowrap; gap: 5px;">
|
|
<div
|
|
v-for="file in item.documents.files"
|
|
v-bind:key="file.id"
|
|
class="col-auto no-padding">
|
|
<document-file-viewer-component :file="file">
|
|
<template slot="button">
|
|
<button class="btn btn-xs btn-default bg-master-lightest b-rad-none no-border">
|
|
<i class="fa fa-download"></i>
|
|
</button>
|
|
</template>
|
|
</document-file-viewer-component>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-1">{{ item.time }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import componentHandler from '../../../general/mixins/componentHandler';
|
|
export default {
|
|
computed: {
|
|
parsedAnswer() {
|
|
try {
|
|
const parsed = this.item && this.item.answer_value ? JSON.parse(this.item.answer_value) : null;
|
|
return parsed && parsed.text ? parsed.text : this.item.answer_value;
|
|
} catch (error) {
|
|
// console.error("Error parsing JSON:", error);
|
|
return this.item.answer_value;
|
|
}
|
|
},
|
|
},
|
|
mixins: [componentHandler]
|
|
}
|
|
</script>
|