Работа над BookInfoDialog

This commit is contained in:
Book Pauk
2022-11-10 20:10:43 +07:00
parent e39611098a
commit 6dfb3f6db9
2 changed files with 13 additions and 5 deletions

View File

@@ -133,8 +133,13 @@ body, html, #app {
animation: rotating 2s linear infinite; animation: rotating 2s linear infinite;
} }
.q-dialog__inner--minimized {
padding: 10px !important;
}
.q-dialog__inner--minimized > div { .q-dialog__inner--minimized > div {
max-width: 800px; max-height: 100% !important;
max-width: 800px !important;
} }
@keyframes rotating { @keyframes rotating {

View File

@@ -17,7 +17,7 @@
</div> </div>
<div class="row q-mt-sm no-wrap"> <div class="row q-mt-sm no-wrap">
<div class="column justify-center" style="height: 300px; width: 200px;"> <div class="column justify-center" style="height: 300px; width: 200px; min-width: 100px">
<img v-if="coverSrc" :src="coverSrc" class="fit row justify-center items-center" style="object-fit: contain" @error="coverSrc = ''" /> <img v-if="coverSrc" :src="coverSrc" class="fit row justify-center items-center" style="object-fit: contain" @error="coverSrc = ''" />
<div v-if="!coverSrc" class="fit row justify-center items-center text-grey-5" style="border: 1px solid #ccc; font-size: 300%"> <div v-if="!coverSrc" class="fit row justify-center items-center text-grey-5" style="border: 1px solid #ccc; font-size: 300%">
<i>{{ book.ext }}</i> <i>{{ book.ext }}</i>
@@ -81,6 +81,7 @@ import vueComponent from '../../vueComponent.js';
import Dialog from '../../share/Dialog.vue'; import Dialog from '../../share/Dialog.vue';
import Fb2Parser from '../../../../server/core/fb2/Fb2Parser'; import Fb2Parser from '../../../../server/core/fb2/Fb2Parser';
import * as utils from '../../../share/utils'; import * as utils from '../../../share/utils';
import _ from 'lodash';
const componentOptions = { const componentOptions = {
components: { components: {
@@ -169,7 +170,6 @@ class BookInfoDialog {
{name: 'author', label: 'Автор(ы)'}, {name: 'author', label: 'Автор(ы)'},
{name: 'title', label: 'Название'}, {name: 'title', label: 'Название'},
{name: 'series', label: 'Серия'}, {name: 'series', label: 'Серия'},
{name: 'serno', label: 'Номер в серии'},
{name: 'genre', label: 'Жанр'}, {name: 'genre', label: 'Жанр'},
{name: 'librate', label: 'Оценка'}, {name: 'librate', label: 'Оценка'},
{name: 'lang', label: 'Язык книги'}, {name: 'lang', label: 'Язык книги'},
@@ -190,7 +190,7 @@ class BookInfoDialog {
if (nodePath == 'titleInfo/author') if (nodePath == 'titleInfo/author')
return value.split(',').join(', '); return value.split(',').join(', ');
if ((nodePath == 'titleInfo/serno' || nodePath == 'titleInfo/librate') && !value) if (nodePath == 'titleInfo/librate' && !value)
return null; return null;
if (typeof(value) === 'string') { if (typeof(value) === 'string') {
@@ -201,6 +201,9 @@ class BookInfoDialog {
}; };
let result = []; let result = [];
const book = _.cloneDeep(this.book);
book.series = [book.series, book.serno].filter(v => v).join(' #');
for (const item of mapping) { for (const item of mapping) {
const itemOut = {name: item.name, label: item.label, value: []}; const itemOut = {name: item.name, label: item.label, value: []};
@@ -208,7 +211,7 @@ class BookInfoDialog {
const subItemOut = { const subItemOut = {
name: subItem.name, name: subItem.name,
label: subItem.label, label: subItem.label,
value: valueToString(this.book[subItem.name], `${item.name}/${subItem.name}`) value: valueToString(book[subItem.name], `${item.name}/${subItem.name}`)
}; };
if (subItemOut.value) if (subItemOut.value)
itemOut.value.push(subItemOut); itemOut.value.push(subItemOut);