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-tooltip>
|
||||||
</q-btn>
|
</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
|
<q-select
|
||||||
ref="sortMethod"
|
ref="sortMethod"
|
||||||
v-model="sortMethod"
|
v-model="sortMethod"
|
||||||
class="q-ml-md q-mt-xs"
|
class="q-ml-sm q-mt-xs"
|
||||||
:options="sortMethodOptions"
|
:options="sortMethodOptions"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
@@ -60,21 +75,6 @@
|
|||||||
<div style="height: 28px; padding-top: 2px; overflow: hidden" v-html="scope.opt.label" />
|
<div style="height: 28px; padding-top: 2px; overflow: hidden" v-html="scope.opt.label" />
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</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>
|
</div>
|
||||||
|
|
||||||
<q-virtual-scroll
|
<q-virtual-scroll
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
@virtual-scroll="onScroll"
|
@virtual-scroll="onScroll"
|
||||||
>
|
>
|
||||||
<div class="table-row row" :class="{even: index % 2 > 0, 'active-book': item.active, 'active-parent-book': item.activeParent}">
|
<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" />
|
<q-icon name="la la-code-branch" size="24px" style="color: green" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -101,40 +101,44 @@
|
|||||||
</div>
|
</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-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="col" style="border: 1px solid #cccccc; border-bottom: 0; padding: 4px" :style="{ 'width': (340 - 40*(+item.inGroup)) + 'px' }">
|
||||||
<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="text-green-10" style="font-size: 105%">
|
<div class="text-green-10" style="font-size: 105%">
|
||||||
{{ item.desc.author }}
|
{{ item.desc.author }}
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.desc.title }}</div>
|
<div>{{ item.desc.title }}</div>
|
||||||
<!--div>{{ item.path }}</div-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row q-mt-xs" style="font-size: 80%">
|
<div class="row" style="font-size: 10px">
|
||||||
<div class="row justify-center row-info-bottom" style="width: 60px">
|
<div class="row justify-center items-center row-info-top" style="width: 60px">
|
||||||
{{ item.desc.textLen }}
|
{{ item.desc.textLen }}
|
||||||
</div>
|
</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 }}
|
{{ item.desc.perc }}
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-center row-info-bottom" style="width: 1px">
|
<div class="row-info-top" style="width: 1px">
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
|
||||||
<div class="row-part column justify-center" style="width: 80px; font-size: 75%">
|
<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);
|
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++;
|
num++;
|
||||||
book.num = num;
|
result[i].num = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
//фильтрация
|
//фильтрация
|
||||||
@@ -600,7 +603,6 @@ export default vueComponent(RecentBooksPage);
|
|||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
border-bottom: 1px solid #cccccc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.row-part {
|
.row-part {
|
||||||
@@ -618,12 +620,6 @@ export default vueComponent(RecentBooksPage);
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.read-bar {
|
|
||||||
height: 3px;
|
|
||||||
background-color: #aaaaaa;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.even {
|
.even {
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
@@ -644,18 +640,6 @@ export default vueComponent(RecentBooksPage);
|
|||||||
transform: rotate(90deg);
|
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 {
|
.tool-button {
|
||||||
min-width: 30px;
|
min-width: 30px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
@@ -664,4 +648,27 @@ export default vueComponent(RecentBooksPage);
|
|||||||
margin: 10px 6px 0px 3px;
|
margin: 10px 6px 0px 3px;
|
||||||
background-color: white;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import sax from '../../../../server/core/sax';
|
|||||||
import * as utils from '../../../share/utils';
|
import * as utils from '../../../share/utils';
|
||||||
|
|
||||||
const maxImageLineCount = 100;
|
const maxImageLineCount = 100;
|
||||||
|
const maxParaTextLength = 10000;
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
const defaultSettings = {
|
const defaultSettings = {
|
||||||
@@ -226,13 +227,25 @@ export default class BookParser {
|
|||||||
paraOffset += len;
|
paraOffset += len;
|
||||||
};
|
};
|
||||||
|
|
||||||
const growParagraph = (text, len) => {
|
const growParagraph = (text, len, textRaw) => {
|
||||||
if (paraIndex < 0) {
|
if (paraIndex < 0) {
|
||||||
newParagraph();
|
newParagraph();
|
||||||
growParagraph(text, len);
|
growParagraph(text, len);
|
||||||
return;
|
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) {
|
if (inSubtitle) {
|
||||||
curSubtitle.title += text;
|
curSubtitle.title += text;
|
||||||
} else if (inTitle) {
|
} else if (inTitle) {
|
||||||
@@ -536,7 +549,7 @@ export default class BookParser {
|
|||||||
tClose += (center ? '</center>' : '');
|
tClose += (center ? '</center>' : '');
|
||||||
|
|
||||||
if (text != ' ')
|
if (text != ' ')
|
||||||
growParagraph(`${tOpen}${text}${tClose}`, text.length);
|
growParagraph(`${tOpen}${text}${tClose}`, text.length, text);
|
||||||
else
|
else
|
||||||
growParagraph(' ', 1);
|
growParagraph(' ', 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user