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;">
<slot name="dash-title">
<v-toolbar flat dense>
<template v-if="hasUrl">
<template v-if="hasMoreUrl">
<v-btn text icon :to="moreUrl">
<template v-if="count > 0">
<v-badge overlap>
@@ -46,6 +46,15 @@
</template>
<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-icon>
<v-icon>$ayiSync</v-icon>
@@ -123,6 +132,7 @@ export default {
},
title: String,
moreUrl: String,
addUrl: String,
count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 },
maxListItems: { type: Number, default: 10 },
@@ -140,8 +150,11 @@ export default {
clearInterval(this.timer);
},
computed: {
hasUrl: function() {
hasMoreUrl: function() {
return this.moreUrl && this.moreUrl != "";
},
hasAddUrl: function() {
return this.addUrl && this.addUrl != "";
}
},
methods: {

View File

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

View File

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

View File

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