Мелкий рефакторинг, поправки цветов

This commit is contained in:
Book Pauk
2022-10-27 14:36:55 +07:00
parent 7f68b1d68a
commit 1669a21add
4 changed files with 16 additions and 8 deletions

View File

@@ -49,7 +49,7 @@
<div class="row q-mx-md q-mb-sm items-center">
<q-input
ref="authorInput" v-model="search.author" :maxlength="5000" :debounce="inputDebounce"
class="bg-white q-mt-xs" style="width: 300px;" label="Автор" stack-label outlined dense clearable
class="q-mt-xs" :bg-color="inputBgColor('author')" style="width: 200px;" label="Автор" stack-label outlined dense clearable
>
<q-tooltip v-if="search.author" :delay="500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
{{ search.author }}
@@ -58,7 +58,7 @@
<div class="q-mx-xs" />
<q-input
v-model="search.series" :maxlength="inputMaxLength" :debounce="inputDebounce"
class="bg-white q-mt-xs" style="width: 200px;" label="Серия" stack-label outlined dense clearable
class="q-mt-xs" :bg-color="inputBgColor('series')" style="width: 200px;" label="Серия" stack-label outlined dense clearable
>
<q-tooltip v-if="search.series" :delay="500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
{{ search.series }}
@@ -67,7 +67,7 @@
<div class="q-mx-xs" />
<q-input
v-model="search.title" :maxlength="inputMaxLength" :debounce="inputDebounce"
class="bg-white q-mt-xs" style="width: 200px;" label="Название" stack-label outlined dense clearable
class="q-mt-xs" :bg-color="inputBgColor('title')" style="width: 200px;" label="Название" stack-label outlined dense clearable
>
<q-tooltip v-if="search.title" :delay="500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
{{ search.title }}
@@ -76,7 +76,7 @@
<div class="q-mx-xs" />
<q-input
v-model="genreNames" :maxlength="inputMaxLength" :debounce="inputDebounce"
class="bg-white q-mt-xs" input-style="cursor: pointer" style="width: 200px;" label="Жанр" stack-label outlined dense clearable readonly
class="q-mt-xs" :bg-color="inputBgColor()" input-style="cursor: pointer" style="width: 200px;" label="Жанр" stack-label outlined dense clearable readonly
@click="selectGenre"
>
<template v-if="genreNames" #append>
@@ -90,7 +90,7 @@
<div class="q-mx-xs" />
<q-input
v-model="search.lang" :maxlength="inputMaxLength" :debounce="inputDebounce"
class="bg-white q-mt-xs" input-style="cursor: pointer" style="width: 80px;" label="Язык" stack-label outlined dense clearable readonly
class="q-mt-xs" :bg-color="inputBgColor()" input-style="cursor: pointer" style="width: 80px;" label="Язык" stack-label outlined dense clearable readonly
@click="selectLang"
>
<q-tooltip v-if="search.lang && showTooltips" :delay="500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
@@ -187,7 +187,7 @@ import _ from 'lodash';
const route2component = {
'author': {component: 'AuthorList', label: 'Авторы'},
'series': {component: 'SeriesList', label: 'Серии'},
'book': {component: 'TitleList', label: 'Книги'},
'title': {component: 'TitleList', label: 'Книги'},
};
const componentOptions = {
@@ -452,6 +452,13 @@ class Search {
return result;
}
inputBgColor(inp) {
if (inp === this.selectedList)
return 'white';
else
return 'yellow-1';
}
async updateListFromRoute(to) {
const newPath = to.path;
let newList = this.getListRoute(newPath);

View File

@@ -43,7 +43,7 @@ import _ from 'lodash';
class TitleList extends BaseList {
get foundCountMessage() {
return `Найден${utils.wordEnding(this.list.totalFound, 4)} ${this.list.totalFound} уникальн${utils.wordEnding(this.list.totalFound, 6)} назван${utils.wordEnding(this.list.totalFound, 3)}`;
return `Найден${utils.wordEnding(this.list.totalFound, 7)} ${this.list.totalFound} уникальн${utils.wordEnding(this.list.totalFound, 6)} назван${utils.wordEnding(this.list.totalFound, 3)}`;
}
async updateTableData() {

View File

@@ -7,7 +7,7 @@ const myRoutes = [
['/', Search],
['/author', Search],
['/series', Search],
['/book', Search],
['/title', Search],
['/:pathMatch(.*)*', null, null, '/'],
];

View File

@@ -42,6 +42,7 @@ export function wordEnding(num, type = 0) {
['о', 'а', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о'],
['ок', 'ка', 'ки', 'ки', 'ки', 'ок', 'ок', 'ок', 'ок', 'ок'],
['ых', 'ое', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых'],
['о', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о'],
];
const deci = num % 100;
if (deci > 10 && deci < 20) {