define(["exports"], function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
var _default = {
template: '<section><b-field grouped="" group-multiline=""><div class="control"><b-switch v-model="showDetailIcon">Show detail icon</b-switch></div></b-field><b-table :data="data" ref="table" paginated="" per-page="5" :opened-detailed="defaultOpenedDetails" detailed="" detail-key="id" @details-open="(row, index) => $toast.open(`Expanded ${row.logID}`)" :show-detail-icon="showDetailIcon" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page"><template slot-scope="props"><b-table-column field="callerName" label="Caller" width="40" numeric="">{{ props.row.callerName }}</b-table-column><b-table-column field="logQuestion" label="Question" sortable=""><template v-if="showDetailIcon">{{ props.row.logQuestion }}<template v-else=""><a @click="toggle(props.row)">{{ props.row.logQuestion }}</a></template></b-table-column><b-table-column field="logAnswer" label="Answer" sortable="">{{ props.row.logAnswer }}</b-table-column><b-table-column field="logDate" label="Log Date" sortable="" centered=""><span class="tag is-success">{{ new Date(props.row.logDate).toLocaleDateString() }}</span></b-table-column></template><template slot="detail" slot-scope="props"><article class="media"><figure class="media-left"><p class="image is-64x64"><img src="/static/img/placeholder-128x128.png">/p></p></figure><div class="media-content"><div class="content"><p><strong>{{ props.row.customCategoryName }} {{ props.row.categories }}</strong><small>@{{ props.row.logStaffName }}</small><small>31m</small><br>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p></div></div></article></template></b-table></section></template>',
name: 'search-form',
data() {
return {
data: [],
columns: [{
field: 'logID',
label: 'Log ID',
visible: false
}, {
field: 'callerName',
label: 'Caller',
sortable: true
}, {
field: 'logQuestion',
label: 'Question',
sortable: true
}, {
field: 'logAnswer',
label: 'Answer',
sortable: true
}, {
field: 'customCategoryName',
label: 'Custom Category',
sortable: true
}, {
field: 'categories',
label: 'Categories',
sortable: true
}, {
field: 'logStaffName',
label: 'Staff Name',
sortable: true
}, {
field: 'logDate',
label: 'Log Date',
sortable: true
}],
isPaginated: true,
isPaginationSimple: false,
defaultSortDirection: 'asc',
currentPage: 1,
perPage: 15,
isStriped: true,
isHoverable: true,
hasMobileCards: true,
isEmpty: false,
defaultOpenedDetails: [1],
showDetailIcon: true
};
},
mounted() {
let self = this;
axios.get('https://localhost:44390/Log').then(response => {
self.data = response.data;
if (self.data.length === 0) {
self.isEmpty = true;
}
}).catch(function (error) {
console.log(error);
});
},
methods: {
toggle(row) {
this.$refs.table.toggleDetails(row);
}
}
};
_exports.default = _default;
});