This commit is contained in:
2022-02-24 01:06:21 +00:00
parent 8ef3a82545
commit 862b00704b
4 changed files with 25 additions and 155 deletions

View File

@@ -73,18 +73,6 @@ export default {
title: "TEST Line chart widget",
type: "GzDashTestLineWidgetMonthlyTotalPrice",
scheduleableUserOnly: false
},
{
id: "TestDayCalendarWidget",
roles: [
role.BizAdmin,
role.BizAdminRestricted,
role.Sales,
role.SalesRestricted
],
title: "TEST calendar widget",
type: "GzDashTestDayCalendarWidget",
scheduleableUserOnly: false
}
],
availableItems() {

View File

@@ -1,120 +0,0 @@
<template>
<gz-dash
icon="$ayiTools"
:add-url="'svc-workorders/0'"
:update-frequency="0"
v-bind="$attrs"
@dash-refresh="loadData"
v-on="$listeners"
>
<template slot="main">
<v-calendar
color="primary"
type="day"
hide-header
interval-count="11"
first-interval="7"
interval-height="24"
interval-width="45"
:events="events"
:event-color="getEventColor"
:locale="languageName"
@click:event="showEvent"
></v-calendar>
</template>
</gz-dash>
</template>
<script>
import GzDash from "../components/dash-base.vue";
export default {
components: {
GzDash
},
props: {},
data() {
return {
events: [],
languageName: window.$gz.locale.getResolvedLanguage()
};
},
computed: {},
created() {
// this.loadData();
},
methods: {
loadData: function() {
const events = [];
const now = new Date();
const yy = now.getFullYear();
const mm = now.getMonth() + 1;
const dd = now.getDate();
events.push({
id: 45,
type: 34,
name: "WO 45",
start: getEventTimeStamp(yy, mm, dd, 8, "00"),
end: getEventTimeStamp(yy, mm, dd, 8, 45),
color: "orange"
});
events.push({
id: 22,
type: 34,
name: "WO 22",
start: getEventTimeStamp(yy, mm, dd, 9, "00"),
end: getEventTimeStamp(yy, mm, dd, 10, 30),
color: "blue"
});
events.push({
id: 33,
type: 34,
name: "WO 33",
start: getEventTimeStamp(yy, mm, dd, 11, "00"),
end: getEventTimeStamp(yy, mm, dd, 11, 30),
color: "green"
});
events.push({
id: 44,
type: 34,
name: "WO 44",
start: getEventTimeStamp(yy, mm, dd, 11, "00"),
end: getEventTimeStamp(yy, mm, dd, 11, 30),
color: "indigo"
});
events.push({
id: 55,
type: 34,
name: "WO 55",
start: getEventTimeStamp(yy, mm, dd, 11, "00"),
end: getEventTimeStamp(yy, mm, dd, 11, 45),
color: "purple"
});
events.push({
id: 34,
type: 34,
name: "WO 66",
start: getEventTimeStamp(yy, mm, dd, 13, "00"),
end: getEventTimeStamp(yy, mm, dd, 16, 45),
color: "teal"
});
this.events = events;
},
getEventColor(event) {
return event.color;
},
showEvent({ nativeEvent, event }) {
nativeEvent.stopPropagation();
alert(`STUB: OPEN ITEM (data: ${JSON.stringify(event)})`);
}
}
};
function getEventTimeStamp(yy, mm, dd, hh, minutes) {
return `${yy}-${mm}-${dd} ${hh}:${minutes}`;
}
</script>

View File

@@ -84,7 +84,6 @@ import DashRegistry from "../api/dash-registry";
//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 GzDashTestDayCalendarWidget from "../components/dash-test-day-calendar-widget.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";
@@ -94,7 +93,6 @@ export default {
//GzDashTestListWidgetsPriciest,
GzDashTestBarWidgetCountByUserType,
GzDashTestLineWidgetMonthlyTotalPrice,
GzDashTestDayCalendarWidget,
GzDashTodayScheduledWo,
GzDashTodayReminders,
GzDashTodayReviews