Ed tasks fixed

master
Slava 6 years ago
parent 470b89ef7f
commit e26f1b78ca

@ -8,25 +8,22 @@
</q-item-section>
<q-item-section v-if="topicsMode" style="display: flex; flex-basis: 50%;" side top>
<q-expansion-item
v-model="infoExpanded"
expand-separator
label="Информация"
header-class="primary"
>
<q-card style="background-color: #f8f8fc;">
<q-card-section>
{{description}}
</q-card-section>
</q-card>
</q-expansion-item>
</q-item-section>
</q-item>
<q-item v-if="infoExpanded" style="background-color: #f8f8fc;">
{{description}}
</q-item>
<q-separator />
<q-item-label header>{{topicsMode ? "Темы" : "Разделы"}}</q-item-label>
<q-item @click="moveTo()" clickable v-ripple v-for="item in items" :key="item.name">
<q-item @click="moveTo()" clickable v-ripple v-for="item in pages[pageN]" :key="item.name">
<q-item-section center avatar>
<q-icon :name="item.icon" color="primary"/>
<q-icon :size="'xs'" :name="item.icon" color="primary"/>
</q-item-section>
<q-item-section>
@ -34,13 +31,13 @@
</q-item-section>
<q-item-section class="q-mt-sm" side top>
<q-badge v-if="topicsMode" class="q-mb-sm text-h6">
<q-badge v-if="topicsMode" class="q-mb-sm">
{{item.nMessages}}
<q-tooltip content-class="bg-indigo" :offset="[10, 10]">
Сообщения
</q-tooltip>
</q-badge>
<q-badge v-else class="q-mb-sm text-h6">
<q-badge v-else class="q-mb-sm">
{{item.nTopics}}
<q-tooltip content-class="bg-indigo" :offset="[10, 10]">
Темы
@ -54,11 +51,28 @@
<p v-if="!topicsMode"> тема: "{{item.lastMessage.topic}}" </p>
</q-item-section>
</q-item>
<q-separator />
<q-item>
<q-btn v-if="pageN != 0" @click="pageN = 0" flat color="primary" label="<<" />
<q-btn v-if="pageN != 0" @click="pageN--" flat color="primary" label="<" />
<q-btn v-if="pageN != 0" @click="pageN--" flat color="primary" :label="pageN" />
<q-btn outline color="primary" :label="pageN + 1" />
<q-btn v-if="pageN + 1 != pages.length" @click="pageN++" flat color="primary" :label="pageN + 2" />
<q-btn v-if="pageN + 1 != pages.length" @click="pageN++" flat color="primary" label=">" />
<q-btn v-if="pageN + 1 != pages.length" @click="pageN = pages.length - 1" flat color="primary" label=">>" />
</q-item>
</q-list>
</template>
<script>
export default {
name: 'ForumSelection',
data () {
return ({
pages: [],
pageN: 0,
infoExpanded: false
})
},
props: {
title: {
type: String,
@ -82,6 +96,23 @@ export default {
topicsMode: {
type: Boolean,
default: false
},
maxPerPage: {
type: Number
}
},
beforeMount () {
const self = this
let page = []
this.items.forEach((el) => {
page.push(el)
if (page.length === self.maxPerPage) {
self.pages.push(page)
page = []
}
})
if (page.length !== 0) {
self.pages.push(page)
}
},
methods: {

@ -1,8 +1,9 @@
<template>
<q-layout view="lHh Lpr lFf">
<q-header elevated>
<q-layout style="background-color: #f5f5f5;" view="lHh Lpr lFf">
<q-header>
<q-toolbar>
<q-btn
v-if="$q.screen.width < 1200"
flat
dense
round
@ -10,31 +11,75 @@
aria-label="Menu"
@click="leftDrawerOpen = !leftDrawerOpen"
/>
<q-toolbar-title>
Форум ЭкспеРО
</q-toolbar-title>
<q-space />
<q-btn-dropdown flat :label="'Иван Иванов'">
<q-list>
<q-item clickable v-close-popup tabindex="0" v-ripple>
<q-item-section>
<q-item-label>Выйти</q-item-label>
</q-item-section>
<q-item-section side>
<q-icon name="exit_to_app" />
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-toolbar>
</q-header>
<q-drawer
v-model="leftDrawerOpen"
bordered
content-class="bg-grey-1"
show-if-above
content-class="bg-white"
>
<q-list>
<q-item-label
header
style="background-color: #7B89CA"
class="text-white text-h6"
style="background-color: #7B89CA; height: 50px"
class="text-white text-h6 text-center"
>
Меню
ЭкспеРО
</q-item-label>
<EssentialLink
v-for="link in essentialLinks"
:key="link.title"
v-bind="link"
/>
<q-item
v-for="option in menu.options"
:key="option.title"
clickable
@click="menu.chosenOption = option"
>
<q-item-section
v-if="option.icon"
avatar
>
<q-icon :name="option.icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ option.title }}</q-item-label>
</q-item-section>
</q-item>
<div v-if="menu.chosenOption">
<q-item style="background-color: #7b89ca">
<q-item-section>
{{menu.chosenOption.title}}
</q-item-section>
</q-item>
<q-item
v-for="suboption in menu.chosenOption.suboptions"
:key="suboption.title"
clickable
>
<q-item-section
v-if="suboption.icon"
avatar
>
<q-icon :name="suboption.icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ suboption.title }}</q-item-label>
</q-item-section>
</q-item>
</div>
</q-list>
</q-drawer>
@ -45,50 +90,107 @@
</template>
<script>
import EssentialLink from 'components/EssentialLink'
// import EssentialLink from 'components/EssentialLink'
export default {
name: 'MainLayout',
components: {
EssentialLink
},
// components: {
// EssentialLink
// },
data () {
return {
leftDrawerOpen: false,
essentialLinks: [
{
title: 'Приборная панель',
caption: 'Перейти на глагне',
icon: 'backspace',
link: '/'
},
{
title: 'Пользователи',
caption: 'Перейти на площадку',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Дополнительные поля',
caption: 'Выйти из платформы',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Зоны ответственности',
caption: 'Выйти из платформы',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Группы черт',
caption: 'Выйти из платформы',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
}
]
menu: {
chosenOption: null,
options: [
{
title: 'Приборная панель',
icon: 'backspace',
suboptions: [
{
title: 'Пользователи',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Дополнительные поля',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Зоны ответственности',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
}
]
},
{
title: 'Пользователи',
icon: 'school',
suboptions: [
{
title: 'Пользователи',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Дополнительные поля',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Зоны ответственности',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
}
]
},
{
title: 'Дополнительные поля',
icon: 'subdirectory_arrow_left',
suboptions: [
{
title: 'Пользователи',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Дополнительные поля',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Зоны ответственности',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
}
]
},
{
title: 'Зоны ответственности',
icon: 'subdirectory_arrow_left',
suboptions: [
{
title: 'Пользователи',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Дополнительные поля',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
},
{
title: 'Зоны ответственности',
icon: 'subdirectory_arrow_left',
link: 'https://github.com/quasarframework'
}
]
}
]
}
}
}
}

@ -1,6 +1,6 @@
<template>
<div class="q-pa-md row justify-center full-height">
<ForumSection style="max-width: 700px" class="q-mb-md col" title="Семейства методик" description="Какое-то описание" :items="sections"/>
<ForumSection style="max-width: 700px" class="q-mb-md col" title="Семейства методик" description="Какое-то описание" :maxPerPage="3" :items="sections"/>
</div>
</template>
@ -15,8 +15,8 @@ export default {
data () {
return {
sections: [
{ name: 'Семейство 1', icon: 'error', nMessages: 10, nTopics: 10 },
{ name: 'Семейство 2', icon: 'error', nMessages: 10, nTopics: 10 },
{ name: 'Семейство 1', icon: 'warning', nMessages: 10, nTopics: 10 },
{ name: 'Семейство 2', icon: 'warning', nMessages: 10, nTopics: 10 },
{ name: 'Семейство 5', icon: 'fiber_manual_record', nMessages: 10, nTopics: 10 },
{ name: 'Семейство 14', icon: 'fiber_manual_record', nMessages: 10, nTopics: 10 },
{ name: 'Семейство -1', icon: 'fiber_manual_record', nMessages: 10, nTopics: 10 }

@ -50,13 +50,13 @@ export default {
topics: [
{
name: 'tema 1',
icon: 'error',
icon: 'warning',
nMessages: 10,
lastMessage: { from: 'Василий Терентьев', time: 'Сегодня 19:20', topic: 'Как пропатчить KDE2 под FreeBSD' }
},
{
name: 'tema 3',
icon: 'error',
icon: 'warning',
nMessages: 10,
lastMessage: { from: 'Василий Терентьев', time: 'Сегодня 19:20', topic: 'Как пропатчить KDE2 под FreeBSD' }
},

Loading…
Cancel
Save