This commit is contained in:
2021-10-06 17:05:25 +00:00
parent 87c40e7259
commit eddacbfa1d
2 changed files with 15 additions and 22 deletions

View File

@@ -478,10 +478,15 @@ export default {
hour12: window.$gz.locale.getHour12(),
formUserOptions: {},
tempFirstTime: null,
lastMouseDownMS: null
lastMouseDownMS: null,
lastStart: null,
lastEnd: null
};
},
methods: {
async refresh() {
await this.fetchEvents({ start: null, end: null });
},
openObject: function(type, id) {
window.$gz.eventBus.$emit("openobject", {
type: type,
@@ -817,6 +822,13 @@ export default {
}
},
async fetchEvents({ start, end }) {
if (start) {
this.lastStart = start;
this.lastEnd = end;
} else {
start = this.lastStart;
end = this.lastEnd;
}
try {
window.$gz.form.deleteAllErrorBoxErrors(this);
const res = await window.$gz.api.post("schedule/personal", {
@@ -877,11 +889,7 @@ export default {
async saveUserOptions() {
this.settingsDialog = false;
await saveFormUserOptions(this);
//doesn't seem to be any reliable way to trigger refresh on the calendar itself
//and trying to load the events manually is not working out as the calendar reports a different
//start and end than it provides for the change event
//this is brutal but works
window.location.reload();
await this.refresh();
}
//eom
},

View File

@@ -411,11 +411,7 @@ export default {
},
methods: {
async refresh() {
console.log("REFRESH");
await this.fetchEvents({ start: null, end: null });
//this.focus = null; //"";
// this.categories.splice(0);
// this.$refs.calendar.checkChange();
},
openObject: function(type, id) {
window.$gz.eventBus.$emit("openobject", {
@@ -772,20 +768,13 @@ export default {
}
},
async fetchEvents({ start, end }) {
console.log("fetchEvents ", { start: start, end: end });
if (start) {
console.log("Saving last dates");
this.lastStart = start;
this.lastEnd = end;
} else {
console.log("rehydrating from last dates");
start = this.lastStart;
end = this.lastEnd;
}
/*
{ items = r, users = Users }
*/
try {
window.$gz.form.deleteAllErrorBoxErrors(this);
const res = await window.$gz.api.post("schedule/svc", {
@@ -850,11 +839,7 @@ export default {
async saveUserOptions() {
this.settingsDialog = false;
await saveFormUserOptions(this);
//doesn't seem to be any reliable way to trigger refresh on the calendar itself
//and trying to load the events manually is not working out as the calendar reports a different
//start and end than it provides for the change event
//this is brutal but works
window.location.reload();
await this.refresh();
}
//eom
},