В список недавних добавлена полоска прочитанного
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
<div class="break-word" style="width: 332px; font-size: 90%">
|
<div class="break-word" style="width: 332px; font-size: 90%">
|
||||||
<div style="color: green">{{ props.row.desc.author }}</div>
|
<div style="color: green">{{ props.row.desc.author }}</div>
|
||||||
<div>{{ props.row.desc.title }}</div>
|
<div>{{ props.row.desc.title }}</div>
|
||||||
|
<div class="read-bar" :style="`width: ${332*props.row.readPart}px`"></div>
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
@@ -203,11 +204,13 @@ class RecentBooksPage extends Vue {
|
|||||||
d.setTime(book.touchTime);
|
d.setTime(book.touchTime);
|
||||||
const t = utils.formatDate(d).split(' ');
|
const t = utils.formatDate(d).split(' ');
|
||||||
|
|
||||||
|
let readPart = 0;
|
||||||
let perc = '';
|
let perc = '';
|
||||||
let textLen = '';
|
let textLen = '';
|
||||||
const p = (book.bookPosSeen ? book.bookPosSeen : (book.bookPos ? book.bookPos : 0));
|
const p = (book.bookPosSeen ? book.bookPosSeen : (book.bookPos ? book.bookPos : 0));
|
||||||
if (book.textLength) {
|
if (book.textLength) {
|
||||||
perc = ` [${((p/book.textLength)*100).toFixed(2)}%]`;
|
readPart = p/book.textLength;
|
||||||
|
perc = ` [${(readPart*100).toFixed(2)}%]`;
|
||||||
textLen = ` ${Math.round(book.textLength/1000)}k`;
|
textLen = ` ${Math.round(book.textLength/1000)}k`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,6 +229,7 @@ class RecentBooksPage extends Vue {
|
|||||||
author,
|
author,
|
||||||
title: `${title}${perc}${textLen}`,
|
title: `${title}${perc}${textLen}`,
|
||||||
},
|
},
|
||||||
|
readPart,
|
||||||
descString: `${author}${title}${perc}${textLen}`,//для сортировки
|
descString: `${author}${title}${perc}${textLen}`,//для сортировки
|
||||||
url: book.url,
|
url: book.url,
|
||||||
path: book.path,
|
path: book.path,
|
||||||
@@ -354,6 +358,10 @@ class RecentBooksPage extends Vue {
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.read-bar {
|
||||||
|
height: 3px;
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user