This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
DASHBOARD / KPI / BIZ METRICS
|
||||
|
||||
todo:
|
||||
|
||||
|
||||
lt titles of dash items properly
|
||||
List one goes to a list filter and sorted appropriately
|
||||
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
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<v-sheet color="white" elevation="4" height="300px" style="overflow: hidden;">
|
||||
<slot name="dash-title">
|
||||
<v-toolbar flat dense>
|
||||
<template v-if="hasMoreUrl">
|
||||
<v-btn text icon :to="moreUrl">
|
||||
<template v-if="showMoreButton">
|
||||
<v-btn text icon @click="$emit('dash-more-click', id)">
|
||||
<template v-if="count > 0">
|
||||
<v-badge overlap>
|
||||
<template v-slot:badge>
|
||||
@@ -30,7 +30,7 @@
|
||||
<v-icon class="mr-4">{{ icon }}</v-icon>
|
||||
</template>
|
||||
</template>
|
||||
<v-toolbar-title> {{ title }}</v-toolbar-title>
|
||||
<v-toolbar-title> {{ translatedTitle }} </v-toolbar-title>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
required: true
|
||||
},
|
||||
title: String,
|
||||
moreUrl: String,
|
||||
showMoreButton: { type: Boolean, default: false },
|
||||
addUrl: String,
|
||||
count: { type: Number, default: 0 },
|
||||
updateFrequency: { type: Number, default: 60000 },
|
||||
@@ -150,11 +150,11 @@ export default {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
computed: {
|
||||
hasMoreUrl: function() {
|
||||
return this.moreUrl && this.moreUrl != "";
|
||||
},
|
||||
hasAddUrl: function() {
|
||||
return this.addUrl && this.addUrl != "";
|
||||
},
|
||||
translatedTitle() {
|
||||
return this.$ay.t(this.title);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -75,10 +75,10 @@ export default {
|
||||
//https://stackoverflow.com/a/42635435/8939
|
||||
datakeys: [
|
||||
{ id: 11, type: 34 },
|
||||
{ id: 11, type: 34 },
|
||||
{ id: 11, type: 34 },
|
||||
{ id: 11, type: 34 },
|
||||
{ id: 11, type: 34 }
|
||||
{ id: 22, type: 34 },
|
||||
{ id: 33, type: 34 },
|
||||
{ id: 44, type: 34 },
|
||||
{ id: 55, type: 34 }
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
<gz-dash
|
||||
icon="$ayiSplotch"
|
||||
:addUrl="'widgets/0'"
|
||||
:showMoreButton="true"
|
||||
:updateFrequency="60000"
|
||||
v-on:dash-refresh="getDataFromApi()"
|
||||
v-on:dash-more-click="moreClick()"
|
||||
v-on="$listeners"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
@@ -49,6 +51,9 @@ export default {
|
||||
created() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
moreClick() {
|
||||
console.log("more click");
|
||||
},
|
||||
async getDataFromApi() {
|
||||
let lv = LIST_VIEW;
|
||||
lv.limit = this.maxListItems;
|
||||
|
||||
Reference in New Issue
Block a user