Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a60ad354c | ||
|
|
c565a20344 | ||
|
|
735ee88f0b | ||
|
|
9405ce2cc0 | ||
|
|
115277d88a | ||
|
|
6925c11dbd | ||
|
|
984d835892 | ||
|
|
23353a4960 | ||
|
|
955bcda032 | ||
|
|
81ad5d7a2c | ||
|
|
dada7980ec | ||
|
|
511a308646 | ||
|
|
65c8f2cc81 | ||
|
|
238c18bc48 |
@@ -39,10 +39,25 @@
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-input
|
||||
ref="input"
|
||||
v-model="search"
|
||||
class="q-ml-sm q-mt-xs"
|
||||
outlined dense
|
||||
style="width: 185px"
|
||||
bg-color="white"
|
||||
placeholder="Найти"
|
||||
@click.stop
|
||||
>
|
||||
<template #append>
|
||||
<q-icon v-if="search !== ''" name="la la-times" class="cursor-pointer" @click.stop="resetSearch" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
ref="sortMethod"
|
||||
v-model="sortMethod"
|
||||
class="q-ml-md q-mt-xs"
|
||||
class="q-ml-sm q-mt-xs"
|
||||
:options="sortMethodOptions"
|
||||
style="width: 180px"
|
||||
bg-color="white"
|
||||
@@ -60,21 +75,6 @@
|
||||
<div style="height: 28px; padding-top: 2px; overflow: hidden" v-html="scope.opt.label" />
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-input
|
||||
ref="input"
|
||||
v-model="search"
|
||||
class="q-ml-sm q-mt-xs"
|
||||
outlined dense
|
||||
style="width: 180px"
|
||||
bg-color="white"
|
||||
placeholder="Найти"
|
||||
@click.stop
|
||||
>
|
||||
<template #append>
|
||||
<q-icon v-if="search !== ''" name="la la-times" class="cursor-pointer" @click.stop="resetSearch" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<q-virtual-scroll
|
||||
@@ -86,7 +86,7 @@
|
||||
@virtual-scroll="onScroll"
|
||||
>
|
||||
<div class="table-row row" :class="{even: index % 2 > 0, 'active-book': item.active, 'active-parent-book': item.activeParent}">
|
||||
<div v-show="item.inGroup" class="row-part column justify-center items-center" style="width: 40px; border-right: 1px solid #cccccc">
|
||||
<div v-show="item.inGroup" class="row-part column justify-center items-center" style="width: 40px">
|
||||
<q-icon name="la la-code-branch" size="24px" style="color: green" />
|
||||
</div>
|
||||
|
||||
@@ -101,40 +101,44 @@
|
||||
</div>
|
||||
|
||||
<div class="row-part column items-stretch clickable break-word" :style="{ 'width': (350 - 40*(+item.inGroup)) + 'px' }" style="font-size: 75%" @click="loadBook(item)">
|
||||
<div class="row" style="font-size: 80%">
|
||||
<div class="row justify-center row-info-top" style="width: 30px">
|
||||
{{ item.num }}
|
||||
</div>
|
||||
<div class="row justify-center row-info-top" style="width: 130px">
|
||||
Читался: {{ item.touchTime }}
|
||||
</div>
|
||||
<div class="row justify-center row-info-top" style="width: 138px">
|
||||
Загружен: {{ item.loadTime }}
|
||||
</div>
|
||||
<div class="row justify-center row-info-top" style="width: 1px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col q-mt-xs" :style="{ 'width': (340 - 40*(+item.inGroup)) + 'px' }">
|
||||
<div class="col" style="border: 1px solid #cccccc; border-bottom: 0; padding: 4px" :style="{ 'width': (340 - 40*(+item.inGroup)) + 'px' }">
|
||||
<div class="text-green-10" style="font-size: 105%">
|
||||
{{ item.desc.author }}
|
||||
</div>
|
||||
<div>{{ item.desc.title }}</div>
|
||||
<!--div>{{ item.path }}</div-->
|
||||
</div>
|
||||
|
||||
<div class="row q-mt-xs" style="font-size: 80%">
|
||||
<div class="row justify-center row-info-bottom" style="width: 60px">
|
||||
<div class="row" style="font-size: 10px">
|
||||
<div class="row justify-center items-center row-info-top" style="width: 60px">
|
||||
{{ item.desc.textLen }}
|
||||
</div>
|
||||
<div class="row justify-center row-info-bottom" style="width: 60px">
|
||||
|
||||
<div class="row items-center row-info-top" :style="`width: ${(220 - 40*(+item.inGroup))}px; padding: 1px`">
|
||||
<div class="read-bar" :style="`width: ${100*item.readPart}%`"></div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-center items-center row-info-top" style="width: 59px">
|
||||
{{ item.desc.perc }}
|
||||
</div>
|
||||
<div class="row justify-center row-info-bottom" style="width: 1px">
|
||||
<div class="row-info-top" style="width: 1px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="read-bar" :style="`width: ${(340 - 40*(+item.inGroup))*item.readPart}px`"></div>
|
||||
<div class="row" style="font-size: 10px" :style="{ 'width': (340 - 40*(+item.inGroup)) + 'px' }">
|
||||
<div class="row justify-center items-center row-info-bottom" style="width: 30px">
|
||||
{{ item.num }}
|
||||
</div>
|
||||
<div class="col row">
|
||||
<div class="row justify-center items-center row-info-bottom time-info" style="width: 50%">
|
||||
Загружен: {{ item.loadTime }}
|
||||
</div>
|
||||
<div class="row justify-center items-center row-info-bottom time-info" style="width: 50%">
|
||||
Читался: {{ item.touchTime }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-info-bottom" style="width: 1px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-part column justify-center" style="width: 80px; font-size: 75%">
|
||||
@@ -299,12 +303,11 @@ class RecentBooksPage {
|
||||
}
|
||||
|
||||
//нумерация
|
||||
let num = 0;
|
||||
|
||||
result.sort((a, b) => b.loadTimeRaw - a.loadTimeRaw);
|
||||
for (const book of result) {
|
||||
let num = 0;
|
||||
for (let i = result.length - 1; i >= 0; i--) {
|
||||
num++;
|
||||
book.num = num;
|
||||
result[i].num = num;
|
||||
}
|
||||
|
||||
//фильтрация
|
||||
@@ -600,7 +603,6 @@ export default vueComponent(RecentBooksPage);
|
||||
|
||||
.table-row {
|
||||
min-height: 80px;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
.row-part {
|
||||
@@ -618,12 +620,6 @@ export default vueComponent(RecentBooksPage);
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.read-bar {
|
||||
height: 3px;
|
||||
background-color: #aaaaaa;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.even {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
@@ -644,18 +640,6 @@ export default vueComponent(RecentBooksPage);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.row-info-top {
|
||||
line-height: 110%;
|
||||
border-left: 1px solid #cccccc;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
.row-info-bottom {
|
||||
line-height: 110%;
|
||||
border: 1px solid #cccccc;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.tool-button {
|
||||
min-width: 30px;
|
||||
width: 30px;
|
||||
@@ -664,4 +648,27 @@ export default vueComponent(RecentBooksPage);
|
||||
margin: 10px 6px 0px 3px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.row-info-bottom {
|
||||
line-height: 110%;
|
||||
border-left: 1px solid #cccccc;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.row-info-top {
|
||||
line-height: 110%;
|
||||
border: 1px solid #cccccc;
|
||||
border-right: 0;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.time-info, .row-info-top {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.read-bar {
|
||||
height: 4px;
|
||||
background-color: #bbbbbb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,6 +3,7 @@ import sax from '../../../../server/core/sax';
|
||||
import * as utils from '../../../share/utils';
|
||||
|
||||
const maxImageLineCount = 100;
|
||||
const maxParaTextLength = 10000;
|
||||
|
||||
// defaults
|
||||
const defaultSettings = {
|
||||
@@ -226,13 +227,25 @@ export default class BookParser {
|
||||
paraOffset += len;
|
||||
};
|
||||
|
||||
const growParagraph = (text, len) => {
|
||||
const growParagraph = (text, len, textRaw) => {
|
||||
if (paraIndex < 0) {
|
||||
newParagraph();
|
||||
growParagraph(text, len);
|
||||
return;
|
||||
}
|
||||
|
||||
//ограничение на размер куска текста в параграфе
|
||||
if (textRaw && textRaw.length > maxParaTextLength) {
|
||||
while (textRaw.length > 0) {
|
||||
const textPart = textRaw.substring(0, maxParaTextLength);
|
||||
textRaw = textRaw.substring(maxParaTextLength);
|
||||
|
||||
newParagraph();
|
||||
growParagraph(textPart, textPart.length);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (inSubtitle) {
|
||||
curSubtitle.title += text;
|
||||
} else if (inTitle) {
|
||||
@@ -536,7 +549,7 @@ export default class BookParser {
|
||||
tClose += (center ? '</center>' : '');
|
||||
|
||||
if (text != ' ')
|
||||
growParagraph(`${tOpen}${text}${tClose}`, text.length);
|
||||
growParagraph(`${tOpen}${text}${tClose}`, text.length, text);
|
||||
else
|
||||
growParagraph(' ', 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user