This commit is contained in:
2020-11-03 20:15:11 +00:00
parent 51f485acbe
commit bbd80cc1ea
5 changed files with 44 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
<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="hasUrl"> <template v-if="hasMoreUrl">
<v-btn text icon :to="moreUrl"> <v-btn text icon :to="moreUrl">
<template v-if="count > 0"> <template v-if="count > 0">
<v-badge overlap> <v-badge overlap>
@@ -46,6 +46,15 @@
</template> </template>
<v-list> <v-list>
<v-list-item v-if="hasAddUrl" :to="addUrl">
<v-list-item-icon>
<v-icon>$ayiPlus</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item @click="$emit('dash-refresh', id)"> <v-list-item @click="$emit('dash-refresh', id)">
<v-list-item-icon> <v-list-item-icon>
<v-icon>$ayiSync</v-icon> <v-icon>$ayiSync</v-icon>
@@ -123,6 +132,7 @@ export default {
}, },
title: String, title: String,
moreUrl: String, moreUrl: String,
addUrl: String,
count: { type: Number, default: 0 }, count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 }, updateFrequency: { type: Number, default: 60000 },
maxListItems: { type: Number, default: 10 }, maxListItems: { type: Number, default: 10 },
@@ -140,8 +150,11 @@ export default {
clearInterval(this.timer); clearInterval(this.timer);
}, },
computed: { computed: {
hasUrl: function() { hasMoreUrl: function() {
return this.moreUrl && this.moreUrl != ""; return this.moreUrl && this.moreUrl != "";
},
hasAddUrl: function() {
return this.addUrl && this.addUrl != "";
} }
}, },
methods: { methods: {

View File

@@ -1,6 +1,7 @@
<template> <template>
<gz-dash <gz-dash
icon="$ayiSplotch" icon="$ayiUser"
:addUrl="'widgets/0'"
:updateFrequency="60000" :updateFrequency="60000"
v-on:dash-refresh="loadData" v-on:dash-refresh="loadData"
v-on="$listeners" v-on="$listeners"
@@ -49,11 +50,15 @@ export default {
}, },
data() { data() {
return { return {
obj: { obj: {}
// These labels appear in the legend and in the tooltips when hovering different arcs };
//_.map(users, 'user'); },
//de-lodash props: {},
// labels: window.$gz. _.map(this.db.topTables, "name"), created() {},
computed: {},
methods: {
loadData: function() {
this.obj = {
labels: [ labels: [
"Customer", "Customer",
"Head office", "Head office",
@@ -68,15 +73,7 @@ export default {
backgroundColor: getPalette(5) backgroundColor: getPalette(5)
} }
] ]
} };
};
},
props: {},
created() {},
computed: {},
methods: {
loadData: function() {
//console.log("GzDashTestBarWidgetCountByUserType::loadData");
} }
} }
}; };

View File

@@ -1,6 +1,7 @@
<template> <template>
<gz-dash <gz-dash
icon="$ayiSplotch" icon="$ayiTools"
:addUrl="'widgets/0'"
:updateFrequency="0" :updateFrequency="0"
v-on:dash-refresh="loadData" v-on:dash-refresh="loadData"
v-on="$listeners" v-on="$listeners"
@@ -18,6 +19,7 @@
:events="events" :events="events"
:event-color="getEventColor" :event-color="getEventColor"
@click:event="showEvent" @click:event="showEvent"
:locale="languageName"
></v-calendar> ></v-calendar>
</template> </template>
</gz-dash> </gz-dash>
@@ -30,7 +32,8 @@ export default {
}, },
data() { data() {
return { return {
events: [] events: [],
languageName: window.$gz.locale.getBrowserFirstLanguage()
}; };
}, },
props: {}, props: {},

View File

@@ -1,6 +1,7 @@
<template> <template>
<gz-dash <gz-dash
icon="$ayiSplotch" icon="$ayiSplotch"
:addUrl="'widgets/0'"
:updateFrequency="60000" :updateFrequency="60000"
v-on:dash-refresh="loadData" v-on:dash-refresh="loadData"
v-on="$listeners" v-on="$listeners"
@@ -30,7 +31,15 @@ export default {
}, },
data() { data() {
return { return {
obj: { obj: {}
};
},
props: {},
created() {},
computed: {},
methods: {
loadData: function() {
this.obj = {
labels: [ labels: [
"January", "January",
"February", "February",
@@ -51,15 +60,7 @@ export default {
data: [0, 10, 5, 2, 20, 30, 45] data: [0, 10, 5, 2, 20, 30, 45]
} }
] ]
} };
};
},
props: {},
created() {},
computed: {},
methods: {
loadData: function() {
//console.log("GzDashTestLineWidgetMonthlyTotalPrice::loadData");
} }
} }
}; };

View File

@@ -1,6 +1,7 @@
<template> <template>
<gz-dash <gz-dash
icon="$ayiSplotch" icon="$ayiSplotch"
:addUrl="'widgets/0'"
:updateFrequency="60000" :updateFrequency="60000"
v-on:dash-refresh="getDataFromApi()" v-on:dash-refresh="getDataFromApi()"
v-on="$listeners" v-on="$listeners"