This commit is contained in:
2020-11-03 00:08:10 +00:00
parent 259aa1be7b
commit bdfeabe03f
5 changed files with 51 additions and 13 deletions

View File

@@ -125,6 +125,7 @@ export default {
moreUrl: String,
count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 },
maxListItems: { type: Number, default: 10 },
icon: { type: String, default: "$ayiTachometer" }
},
created() {

View File

@@ -2,34 +2,54 @@
<gz-dash
icon="$ayiSplotch"
:updateFrequency="60000"
v-on:dash-refresh="loadData"
v-on:dash-refresh="getDataFromApi()"
v-on="$listeners"
v-bind="$attrs"
>
<template slot="main">
<div class="ml-4 mt-1 d-flex align-center">
<div>
<span class="green--text">LIST PRICIEST WIDGETS CONTENT HERE</span>
max list items:{{ maxListItems }}
<span class="green--text">{{ obj }}</span>
</div>
</div>
</template>
</gz-dash>
</template>
<script>
/*
*/
import GzDash from "../components/dash-base.vue";
const LIST_VIEW = {
offset: 0,
limit: 10,
dataListKey: "TestWidgetDataList",
listView: '[{"fld":"widgetname"},{"fld":"widgetdollaramount","sort":"-"}]'
};
export default {
components: {
GzDash
},
data() {
return {};
return { obj: [] };
},
props: {
maxListItems: { type: Number, default: 10 }
},
props: {},
created() {},
computed: {},
methods: {
loadData: function() {
console.log("dash-test-widgets-priciest::loadData");
async getDataFromApi() {
let lv = LIST_VIEW;
lv.limit = this.maxListItems;
let res = await window.$gz.api.post("data-list", lv);
if (!res.error) {
this.obj = res.data;
} else {
this.obj = [];
}
}
}
};