This commit is contained in:
2022-03-01 17:38:15 +00:00
parent 0eb9571172
commit aa3f111179
3 changed files with 0 additions and 164 deletions

View File

@@ -1,68 +0,0 @@
<template>
<gz-dash
icon="$ayiSplotch"
:add-url="'cust-customers/0'"
:update-frequency="32000"
v-bind="$attrs"
@dash-refresh="loadData"
v-on="$listeners"
>
<template slot="main">
<div class="ml-4 mt-1">
<gz-chart-line
:width="400"
:height="240"
:chart-data="obj"
:options="{
responsive: true,
maintainAspectRatio: false,
legend: { display: false }
}"
></gz-chart-line>
</div>
</template>
</gz-dash>
</template>
<script>
import Palette from "../api/palette";
import GzDash from "../components/dash-base.vue";
export default {
components: {
GzDash
},
props: {},
data() {
return {
obj: {}
};
},
computed: {},
created() {},
methods: {
loadData: function() {
this.obj = {
labels: [
"January",
"February",
"March",
"April",
"May",
"June",
"July"
],
datasets: [
{
borderColor: Palette.color.soft_deep_blue,
backgroundColor: Palette.color.soft_deep_blue,
fill: false,
radius: 5,
hoverRadius: 10,
hitRadius: 5,
data: [0, 10, 5, 2, 20, 30, 45]
}
]
};
}
}
};
</script>

View File

@@ -1,91 +0,0 @@
<template>
<gz-dash
icon="$ayiSplotch"
:add-url="'widgets/0'"
:show-more-button="true"
:update-frequency="60000"
v-bind="$attrs"
@dash-refresh="getDataFromApi()"
@dash-more-click="moreClick()"
v-on="$listeners"
>
<template slot="main">
<div class="ml-4 mt-1">
<template v-for="(item, i) in obj"
><span :key="i"
>{{ localizedCurrency(item[1].v)
}}<span class="ml-2"
><a :href="'/widgets/' + item[0].i"> {{ item[0].v }}</a>
<br /></span></span
></template>
</div>
</template>
</gz-dash>
</template>
<script>
/*
TODO: LINK TO LIST FROM HERE, GRID VIEW PREFILTERED AND SORTED
*/
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
},
props: {
maxListItems: { type: Number, default: 10 }
},
data() {
return {
obj: [],
currencyName: window.$gz.locale.getCurrencyName(),
languageName: window.$gz.locale.getResolvedLanguage()
};
},
computed: {},
created() {},
methods: {
moreClick() {
const LIST_FORM_KEY = "widget-list";
//get current settings for the form
const formSettings = window.$gz.form.getFormSettings(LIST_FORM_KEY);
//switch to an unsaved listview and substitute this dash widgets list view criteria
formSettings.temp.page = 0;
formSettings.saved.dataTable.listViewId = -1;
formSettings.saved.dataTable.unsavedListView = LIST_VIEW.listView;
//save back again
window.$gz.form.setFormSettings(LIST_FORM_KEY, formSettings);
//now navigate to the data table list view
this.$router.push({
name: "widget-list"
});
},
async getDataFromApi() {
const lv = LIST_VIEW;
lv.limit = this.maxListItems;
const res = await window.$gz.api.post("data-list", lv);
if (!res.error) {
this.obj = res.data;
} else {
this.obj = [];
}
},
localizedCurrency(value) {
return window.$gz.locale.currencyLocalized(
value,
this.languageName,
this.currencyName
);
}
}
};
</script>

View File

@@ -83,9 +83,6 @@
const FORM_KEY = "home-dashboard";
import DashRegistry from "../api/dash-registry";
//---------- DASH ITEMS ----------
//import GzDashTestListWidgetsPriciest from "../components/dash-test-list-widgets-priciest.vue";
import GzDashTestBarWidgetCountByUserType from "../components/dash-test-bar-widget-count-by-usertype.vue";
import GzDashTestLineWidgetMonthlyTotalPrice from "../components/dash-test-line-widget-monthly-total-price.vue";
import GzDashTodayScheduledWo from "../components/dash-today-scheduled-wo.vue";
import GzDashTodayReminders from "../components/dash-today-reminders.vue";
import GzDashTodayReviews from "../components/dash-today-reviews.vue";
@@ -97,8 +94,6 @@ export default {
components: {
GzDashLaborHoursPersonalLine,
GzDashLaborHoursPersonalBar,
GzDashTestBarWidgetCountByUserType,
GzDashTestLineWidgetMonthlyTotalPrice,
GzDashTodayScheduledWo,
GzDashTodayReminders,
GzDashTodayReviews,