This commit is contained in:
@@ -54,14 +54,17 @@ todo: DASHBOARD
|
||||
feeds user registry, selection process etc
|
||||
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: 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: popup warning box error: Could not find one or more icon(s) iconName: "exclamation" prefix: "fas"
|
||||
todo: when showing a 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?
|
||||
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?
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -532,7 +532,21 @@ export default {
|
||||
r = await that.extractBodyEx(r);
|
||||
return r;
|
||||
} 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);
|
||||
}
|
||||
},
|
||||
///////////////////////////////////
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<component
|
||||
:is="item.type"
|
||||
v-bind="item"
|
||||
:maxListItems="10"
|
||||
v-on:dash-remove="dashRemove"
|
||||
v-on:dash-move-start="dashMoveStart"
|
||||
v-on:dash-move-back="dashMoveBack"
|
||||
@@ -81,7 +82,7 @@
|
||||
<script>
|
||||
const FORM_KEY = "home-dashboard";
|
||||
import DashRegistry from "../api/dash-registry";
|
||||
import GzDashBase from "../components/dash-base.vue";
|
||||
|
||||
//---------- DASH ITEMS ----------
|
||||
import GzDashTestListWidgetsPriciest from "../components/dash-test-list-widgets-priciest.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 {
|
||||
components: {
|
||||
GzDashBase,
|
||||
GzDashTestListWidgetsPriciest,
|
||||
GzDashTestBarWidgetCountByUserType,
|
||||
GzDashTestLineWidgetMonthlyTotalPrice,
|
||||
|
||||
Reference in New Issue
Block a user