From 24d3b5769ef41d4c10dd1ee2f60a1a1ed9c28bfd Mon Sep 17 00:00:00 2001 From: Stanislav Popov Date: Mon, 19 Nov 2018 00:04:18 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=81=D0=B2=D0=BE=D1=80=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B3=D1=80=D1=83=D0=BF?= =?UTF-8?q?=D0=BF=20=D0=BA=D0=BE=D0=BB=D0=BE=D0=BD=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Оставлены только фильтры и пресеты колонок по умолчанию --- pages/index.scss | 11 +++++---- pages/index.vue | 61 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/pages/index.scss b/pages/index.scss index bdec27a..8f6fba7 100644 --- a/pages/index.scss +++ b/pages/index.scss @@ -39,15 +39,18 @@ margin: 0 auto; text-align: left; columns: 4; - @media (max-width: 768px){ + @media (max-width: 768px) { columns: 1; } max-width: 1140px; .field-group { + &__header { + margin-top: 15px; + } &__name { font-weight: bold; - margin-top: 15px; + cursor: pointer; } &__all-button { padding: 0; @@ -152,10 +155,10 @@ } .table-responsive { - @media (max-width: 768px){ + @media (max-width: 768px) { margin: 0 -15px; } - @media (mix-width: 769px){ + @media (mix-width: 769px) { overflow: none; } } diff --git a/pages/index.vue b/pages/index.vue index 866eaff..748c3ef 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -4,9 +4,12 @@
total: {{ filteredSites.length }}
-
-
- {{ group.name }} + Развернуть / свернуть все + +
+ +
+
-
- -
- +
+ +
-
- - + +
+ +
+ + +
@@ -101,7 +107,8 @@ export default { columnPresets: columnPresets, filterPresets: filterPresets, routerProcess: false, - tests: this.$store.state.tests + tests: this.$store.state.tests, + fieldGroupsOpened: {} }; }, @@ -321,6 +328,24 @@ export default { // this.$emit('changeFilter', { name, value }); }, + // сворачивает/разворачивает одну группу + changeGroupOpened(group) { + this.fieldGroupsOpened[group.name] = + group.name in this.fieldGroupsOpened ? !this.fieldGroupsOpened[group.name] : true; + this.$forceUpdate(); + }, + + // сворачивает/разворачивает все группы + changeGroupOpenedAll() { + let to = true; + if ('main' in this.fieldGroupsOpened && this.fieldGroupsOpened.main) to = false; + + Object.keys(this.fieldGroups).forEach(groupName => { + this.fieldGroupsOpened[groupName] = to; + }); + this.$forceUpdate(); + }, + // индекс поля в массиве по объекту fieldIndex(field) { return this.fields.findIndex(column => {