Работа над проектом
This commit is contained in:
@@ -60,6 +60,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col fit" style="position: relative">
|
||||||
|
<div v-show="loadingVisible" class="fit row justify-center items-center" style="position: absolute; background-color: rgba(0, 0, 0, 0.2)">
|
||||||
|
<div class="bg-white row justify-center items-center" style="width: 180px; height: 50px; border-radius: 10px; box-shadow: 2px 2px 10px #333333">
|
||||||
|
<q-spinner color="primary" size="2em" />
|
||||||
|
<div class="q-ml-sm">
|
||||||
|
Поиск авторов...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col fit column no-wrap" style="overflow: auto">
|
<div class="col fit column no-wrap" style="overflow: auto">
|
||||||
<div v-for="item in tableData" :key="item.key" style="border-bottom: 1px solid #aaaaaa">
|
<div v-for="item in tableData" :key="item.key" style="border-bottom: 1px solid #aaaaaa">
|
||||||
<div class="q-my-sm q-ml-md" style="font-size: 120%">
|
<div class="q-my-sm q-ml-md" style="font-size: 120%">
|
||||||
@@ -68,12 +78,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
import vueComponent from '../vueComponent.js';
|
import vueComponent from '../vueComponent.js';
|
||||||
|
|
||||||
|
import * as utils from '../../share/utils';
|
||||||
//import _ from 'lodash';
|
//import _ from 'lodash';
|
||||||
|
|
||||||
const componentOptions = {
|
const componentOptions = {
|
||||||
@@ -108,6 +120,8 @@ class Search {
|
|||||||
collection = '';
|
collection = '';
|
||||||
projectName = '';
|
projectName = '';
|
||||||
|
|
||||||
|
loadingVisible = false;
|
||||||
|
|
||||||
//input field consts
|
//input field consts
|
||||||
inputMaxLength = 1000;
|
inputMaxLength = 1000;
|
||||||
inputDebounce = 200;
|
inputDebounce = 200;
|
||||||
@@ -213,6 +227,13 @@ class Search {
|
|||||||
const query = this.queryExecute;
|
const query = this.queryExecute;
|
||||||
this.queryExecute = null;
|
this.queryExecute = null;
|
||||||
|
|
||||||
|
let inSearch = true;
|
||||||
|
(async() => {
|
||||||
|
await utils.sleep(500);
|
||||||
|
if (inSearch)
|
||||||
|
this.loadingVisible = true;
|
||||||
|
})();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await this.api.search(query);
|
const result = await this.api.search(query);
|
||||||
|
|
||||||
@@ -220,10 +241,13 @@ class Search {
|
|||||||
this.totalFound = result.totalFound;
|
this.totalFound = result.totalFound;
|
||||||
|
|
||||||
this.searchResult = result;
|
this.searchResult = result;
|
||||||
this.updateTableData();//no await
|
await this.updateTableData();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
||||||
return;
|
return;
|
||||||
|
} finally {
|
||||||
|
inSearch = false;
|
||||||
|
this.loadingVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {QIcon} from 'quasar/src/components/icon';
|
|||||||
//import {QList} from 'quasar/src/components/item';
|
//import {QList} from 'quasar/src/components/item';
|
||||||
//import {QItem, QItemSection, QItemLabel} from 'quasar/src/components/item';
|
//import {QItem, QItemSection, QItemLabel} from 'quasar/src/components/item';
|
||||||
//import {QTooltip} from 'quasar/src/components/tooltip';
|
//import {QTooltip} from 'quasar/src/components/tooltip';
|
||||||
//import {QSpinner} from 'quasar/src/components/spinner';
|
import {QSpinner} from 'quasar/src/components/spinner';
|
||||||
//import {QTable, QTh, QTr, QTd} from 'quasar/src/components/table';
|
//import {QTable, QTh, QTr, QTd} from 'quasar/src/components/table';
|
||||||
//import {QCheckbox} from 'quasar/src/components/checkbox';
|
//import {QCheckbox} from 'quasar/src/components/checkbox';
|
||||||
import {QSelect} from 'quasar/src/components/select';
|
import {QSelect} from 'quasar/src/components/select';
|
||||||
@@ -53,7 +53,7 @@ const components = {
|
|||||||
//QList,
|
//QList,
|
||||||
//QItem, QItemSection, QItemLabel,
|
//QItem, QItemSection, QItemLabel,
|
||||||
//QTooltip,
|
//QTooltip,
|
||||||
//QSpinner,
|
QSpinner,
|
||||||
//QTable, QTh, QTr, QTd,
|
//QTable, QTh, QTr, QTd,
|
||||||
//QCheckbox,
|
//QCheckbox,
|
||||||
QSelect,
|
QSelect,
|
||||||
|
|||||||
Reference in New Issue
Block a user