mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 00:43:58 +00:00
62 lines
2.7 KiB
Vue
62 lines
2.7 KiB
Vue
<template>
|
|
<div class="row parentContainer">
|
|
<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">{{ 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 class="col-1">
|
|
<div v-if="item.documents != null">
|
|
<div v-for="file in item.documents.files" v-bind:key="file.id" class="col-auto no-padding m-r-5">
|
|
<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>
|
|
</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>
|