This commit is contained in:
2020-11-04 17:01:07 +00:00
parent 7f982fc4b8
commit 98ac083107
4 changed files with 16 additions and 13 deletions

View File

@@ -5,9 +5,7 @@
DASHBOARD / KPI / BIZ METRICS DASHBOARD / KPI / BIZ METRICS
todo: todo:
lt titles of dash items properly
List one goes to a list filter and sorted appropriately List one goes to a list filter and sorted appropriately
todo: MORE link button click todo: MORE link button click
Should take to a data-list view preselected with the criteria that show the complete list of what is in the dash-item wherever possible Should take to a data-list view preselected with the criteria that show the complete list of what is in the dash-item wherever possible

View File

@@ -2,8 +2,8 @@
<v-sheet color="white" elevation="4" height="300px" style="overflow: hidden;"> <v-sheet color="white" elevation="4" height="300px" style="overflow: hidden;">
<slot name="dash-title"> <slot name="dash-title">
<v-toolbar flat dense> <v-toolbar flat dense>
<template v-if="hasMoreUrl"> <template v-if="showMoreButton">
<v-btn text icon :to="moreUrl"> <v-btn text icon @click="$emit('dash-more-click', id)">
<template v-if="count > 0"> <template v-if="count > 0">
<v-badge overlap> <v-badge overlap>
<template v-slot:badge> <template v-slot:badge>
@@ -30,7 +30,7 @@
<v-icon class="mr-4">{{ icon }}</v-icon> <v-icon class="mr-4">{{ icon }}</v-icon>
</template> </template>
</template> </template>
<v-toolbar-title> {{ title }}</v-toolbar-title> <v-toolbar-title> {{ translatedTitle }} </v-toolbar-title>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -131,7 +131,7 @@ export default {
required: true required: true
}, },
title: String, title: String,
moreUrl: String, showMoreButton: { type: Boolean, default: false },
addUrl: String, addUrl: String,
count: { type: Number, default: 0 }, count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 }, updateFrequency: { type: Number, default: 60000 },
@@ -150,11 +150,11 @@ export default {
clearInterval(this.timer); clearInterval(this.timer);
}, },
computed: { computed: {
hasMoreUrl: function() {
return this.moreUrl && this.moreUrl != "";
},
hasAddUrl: function() { hasAddUrl: function() {
return this.addUrl && this.addUrl != ""; return this.addUrl && this.addUrl != "";
},
translatedTitle() {
return this.$ay.t(this.title);
} }
}, },
methods: { methods: {

View File

@@ -75,10 +75,10 @@ export default {
//https://stackoverflow.com/a/42635435/8939 //https://stackoverflow.com/a/42635435/8939
datakeys: [ datakeys: [
{ id: 11, type: 34 }, { id: 11, type: 34 },
{ id: 11, type: 34 }, { id: 22, type: 34 },
{ id: 11, type: 34 }, { id: 33, type: 34 },
{ id: 11, type: 34 }, { id: 44, type: 34 },
{ id: 11, type: 34 } { id: 55, type: 34 }
] ]
}; };
}, },

View File

@@ -2,8 +2,10 @@
<gz-dash <gz-dash
icon="$ayiSplotch" icon="$ayiSplotch"
:addUrl="'widgets/0'" :addUrl="'widgets/0'"
:showMoreButton="true"
:updateFrequency="60000" :updateFrequency="60000"
v-on:dash-refresh="getDataFromApi()" v-on:dash-refresh="getDataFromApi()"
v-on:dash-more-click="moreClick()"
v-on="$listeners" v-on="$listeners"
v-bind="$attrs" v-bind="$attrs"
> >
@@ -49,6 +51,9 @@ export default {
created() {}, created() {},
computed: {}, computed: {},
methods: { methods: {
moreClick() {
console.log("more click");
},
async getDataFromApi() { async getDataFromApi() {
let lv = LIST_VIEW; let lv = LIST_VIEW;
lv.limit = this.maxListItems; lv.limit = this.maxListItems;