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

@@ -54,14 +54,17 @@ todo: DASHBOARD
feeds user registry, selection process etc feeds user registry, selection process etc
todo: need user dashboard setup registry and route todo: need user dashboard setup registry and route
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
if an item doesn't really have anything appropriate to click on then don't bother for now, can flesh out more later
todo: if dashboard view is empty should be a string displayed saying nothing selected to show? todo: if dashboard view is empty should be a string displayed saying nothing selected to show?
// Todo: intermediate actual types (try list first), how to instantiate them from here by id (dynamic) todo: do we need a PLUS menu item to add one of that type to that widget, i.e. if it's showing workorders then a plus to make a new wokorder would be useful
// todo: do we need a PLUS menu item to add one of that type to that widget, i.e. if it's showing workorders then a plus to make a new wokorder would be useful
todo: when showing a popup warning box error: Could not find one or more icon(s) iconName: "exclamation" prefix: "fas"
todo: popup warning box error: Could not find one or more icon(s) iconName: "exclamation" prefix: "fas"
I think maybe this is a built in vuetify icon? I think maybe this is a built in vuetify icon?
Need to show a warning box to see it in action, maybe delete something and get the are you sure? or maybe it's only the warning type?

View File

@@ -532,7 +532,21 @@ export default {
r = await that.extractBodyEx(r); r = await that.extractBodyEx(r);
return r; return r;
} catch (error) { } catch (error) {
handleError("UPSERT", error, route); handleError("PUT", error, route);
}
},
///////////////////////////////////
// POST DATA TO API SERVER
// (used for post only routes not needing upserts)
async post(route, data) {
try {
let that = this;
let r = await fetch(that.APIUrl(route), that.fetchPostOptions(data));
that.statusEx(r);
r = await that.extractBodyEx(r);
return r;
} catch (error) {
handleError("POST", error, route);
} }
}, },
/////////////////////////////////// ///////////////////////////////////

View File

@@ -125,6 +125,7 @@ export default {
moreUrl: String, moreUrl: 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 },
icon: { type: String, default: "$ayiTachometer" } icon: { type: String, default: "$ayiTachometer" }
}, },
created() { created() {

View File

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

View File

@@ -67,6 +67,7 @@
<component <component
:is="item.type" :is="item.type"
v-bind="item" v-bind="item"
:maxListItems="10"
v-on:dash-remove="dashRemove" v-on:dash-remove="dashRemove"
v-on:dash-move-start="dashMoveStart" v-on:dash-move-start="dashMoveStart"
v-on:dash-move-back="dashMoveBack" v-on:dash-move-back="dashMoveBack"
@@ -81,7 +82,7 @@
<script> <script>
const FORM_KEY = "home-dashboard"; const FORM_KEY = "home-dashboard";
import DashRegistry from "../api/dash-registry"; import DashRegistry from "../api/dash-registry";
import GzDashBase from "../components/dash-base.vue";
//---------- DASH ITEMS ---------- //---------- DASH ITEMS ----------
import GzDashTestListWidgetsPriciest from "../components/dash-test-list-widgets-priciest.vue"; import GzDashTestListWidgetsPriciest from "../components/dash-test-list-widgets-priciest.vue";
import GzDashTestBarWidgetCountByUserType from "../components/dash-test-bar-widget-count-by-usertype.vue"; import GzDashTestBarWidgetCountByUserType from "../components/dash-test-bar-widget-count-by-usertype.vue";
@@ -90,7 +91,6 @@ import GzDashTestDayCalendarWidget from "../components/dash-test-day-calendar-wi
export default { export default {
components: { components: {
GzDashBase,
GzDashTestListWidgetsPriciest, GzDashTestListWidgetsPriciest,
GzDashTestBarWidgetCountByUserType, GzDashTestBarWidgetCountByUserType,
GzDashTestLineWidgetMonthlyTotalPrice, GzDashTestLineWidgetMonthlyTotalPrice,