This commit is contained in:
2021-10-02 00:33:13 +00:00
parent 8226f4f253
commit d97f7b45f4
3 changed files with 36 additions and 23 deletions

View File

@@ -1040,7 +1040,7 @@ async function getFormUserOptions(vm) {
//make a default
vm.formUserOptions = {
firstTime: "00:00",
wisuColorSource: 4,
wisuColorSource: "2",
wisu: true,
reviews: true,
reminders: true

View File

@@ -353,28 +353,8 @@
v-model="tempFirstTime"
></gz-time-picker>
</v-col>
<span class="text-h6 mt-3">{{
$ay.t("ScheduleShowTypes")
}}</span>
<v-col cols="12">
<v-checkbox
v-model="formUserOptions.reminders"
:label="$ay.t('ReminderList')"
></v-checkbox>
</v-col>
<v-col cols="12">
<v-checkbox
v-model="formUserOptions.reviews"
:label="$ay.t('ReviewList')"
></v-checkbox>
</v-col>
<v-col cols="12">
<v-checkbox
v-model="formUserOptions.wisu"
:label="$ay.t('WorkOrderList')"
></v-checkbox>
<v-radio-group
v-model="formUserOptions.wisuColorSource"
:mandatory="true"
@@ -546,22 +526,33 @@ export default {
this.extendOriginal = event.end;
}
},
async endDragExtend() {
async endDragExtend(e) {
//Vuetify bug in calendar apparently where it fires for both day and day-category views
//since I set them to both call into this same method I need to ignore the incorrect one
if (!e.category && this.viewType == "category") {
return;
}
//On drag then dragged is set to true and dragEvent and dragTime are set
//on extend then dragged is set to true extendEvent (actual event), extendOriginal and createStart are set, dragEvent is null
//on create then dragged is set to false and createStart is only value set, dragEvent is null and extendEvent is null
//Handle the event, could be one of three things: changing an event start time, changing an event length or creating a new event
if (this.extendEvent && this.extendEvent.type == 0) {
// console.log(
// "endDragExtend::extendEvent",
// JSON.stringify(this.extendEvent)
// );
//NEW, prompt for deets and create or if cancelled then just remove this faux event from events list (it will be the last one in the array)
this.newItemDialog = true;
} else {
//console.log("dragged:", this.dragged);
if (!this.dragged) {
//we're here due to mouse up but it's not a drag or an extend so it's a More Info mouse up click so bail out now
this.dragEvent = null; //this needs to be set or it will keep dragging off an editable event even as the moreinfo dialog show
return;
}
//MODIFY existing event, drag or extend
//console.log("endDragExtend::dragEvent", JSON.stringify(this.dragEvent));
if (this.dragEvent || this.extendEvent) {
const param = { type: null, id: null, start: null, end: null };
@@ -689,18 +680,26 @@ export default {
this.dragEvent.end = this.dragEvent.end + moveDelta;
},
startTime(tms) {
//due to vuetify calendar bug day and day-category both fire to this event handler in day-category view so need to reject incorrect one here
if (!tms.category && this.viewType == "category") {
return;
}
//console.log("startTime, tms:", JSON.stringify(tms));
//This is called on the start of dragging an existing schedule item or drag extending a NEW schedule item
const mouse = this.toTime(tms);
if (this.dragEvent && this.dragTime === null) {
//console.log("startTime drag path");
//# DAY VIEW *DRAG* EXISTING START EVENT (not extend)
//(also called on simple click to view schedule more info)
if (this.dragEvent.editable) {
const start = this.dragEvent.start;
this.dragTime = mouse - start;
} else {
// console.log("startTime NOT EDITABLE!");
}
} else {
//# DAY VIEW CREATE START EVENT
// console.log("startTime create start path");
this.createStart = this.roundTime(mouse);
this.extendEvent = {
name: "-",
@@ -1078,7 +1077,7 @@ async function getFormUserOptions(vm) {
//make a default
vm.formUserOptions = {
firstTime: "00:00",
wisuColorSource: 4,
wisuColorSource: "2",
wisu: true,
users: [...vm.availableUsers.map(x => x.id)] //default to all users
};