msc: translate item details

v0.6
rrr-marble 3 years ago
parent 686872fa4f
commit 787a2ab0d8

@ -6,12 +6,12 @@
<va-progress-circle indeterminate />
</template>
<template #error>
Image not found! :(
Изображение не найдено! :(
</template>
</va-image>
</va-card>
<va-card id="description" class="content-container">
<va-card-title>Description</va-card-title>
<va-card-title>Общее описание</va-card-title>
<va-card-content>
<p class="item-description">{{ itemDetails.description }}</p>
<p class="item-description">{{ itemDetails.additional_info }}</p>
@ -19,14 +19,13 @@
</va-card>
<div class="flex md6 lg4">
<va-card id="details" class="content-container">
<va-card-title>Details</va-card-title>
<va-card-title>Детальное описание</va-card-title>
<va-card-content>
<div class="va-table-responsive">
<table class="va-table va-table--striped detail-table">
<tbody>
<tr
v-for="[key, value] of Object.entries(this.itemDetails).filter(([k, _v]) => !(this.hidden.includes(k)))">
<tr v-for="[key, value] of formattedDetails">
<td>{{ key }}</td>
<td>{{ value }}</td>
</tr>
@ -40,10 +39,10 @@
<va-card id="map" class="content-container map-container">
<item-map-component v-if="detailsLoaded" :internal_id="this.itemDetails.internal_id"
:x_coord="this.itemDetails.x_coord" :y_coord="this.itemDetails.y_coord" />
<h3 v-else>map is loading</h3>
<h3 v-else>Карта загружается</h3>
</va-card>
<va-card id="contact" class="content-container">
<va-card-title>Contact Sales Representative</va-card-title>
<va-card-title>Связь с представителем</va-card-title>
</va-card>
</div>
</template>
@ -63,11 +62,14 @@ export default {
"y_coord",
"owner",
"ownercontacts",
"id"
"id",
"depth_min",
"depth_max",
],
itemPreview: {},
imageExtension: "bmp",
detailsLoaded: false,
columnHeaders: []
};
},
methods: {
@ -78,6 +80,12 @@ export default {
.then(() => this.detailsLoaded = true)
.catch((e) => console.log(e));
},
async fetchColumnHeaders() {
fetch(`/api/v1/headers/`)
.then(res => res.json())
.then(data => this.columnHeaders = data)
.catch((e) => console.log(e));
},
getPreviewPath() {
for (let extension of ["jpg", "png", "bmp"]) {
const path = `/static/previews/${this.itemDetails.fadr}+/${this.itemDetails.internal_id}.${extension}`
@ -100,6 +108,7 @@ export default {
},
created() {
this.fetchItemDetails();
this.fetchColumnHeaders();
},
computed: {
slotPreviewPath() {
@ -107,6 +116,16 @@ export default {
},
internalID() {
return
},
dictHeaders() {
const dictheaders = {};
this.columnHeaders.forEach(header => dictheaders[header.database] = header.spreadsheet);
return dictheaders;
},
formattedDetails() {
return Object.entries(this.itemDetails)
.filter(([k, _v]) => !(this.hidden.includes(k)))
.map(([k, v]) => [this.dictHeaders[k], v])
}
},
components: { ItemMapComponent }

@ -24,31 +24,31 @@ export default {
return {
sidebarItems: [
{
title: "Preview",
title: "Изображение",
icon: "image",
route: "item-details",
hash: "#preview",
},
{
title: "Description",
title: "Общее описание",
icon: "description",
route: "item-details",
hash: "#description",
},
{
title: "Details",
title: "Детальное описание",
icon: "summarize",
route: "item-details",
hash: "#details",
},
{
title: "Map",
title: "Карта",
icon: "map",
route: "item-details",
hash: "#map",
},
{
title: "Contact",
title: "Связь с представителем",
icon: "contact_page",
route: "item-details",
hash: "#contact",

Loading…
Cancel
Save