This commit is contained in:
@@ -679,21 +679,25 @@ export default {
|
|||||||
setFormState(newState) {
|
setFormState(newState) {
|
||||||
//this returns a promise so any function that needs to wait for this can utilize that
|
//this returns a promise so any function that needs to wait for this can utilize that
|
||||||
return Vue.nextTick(function() {
|
return Vue.nextTick(function() {
|
||||||
if (newState.valid != undefined) {
|
if (newState.valid != null) {
|
||||||
newState.vm.formState.valid = newState.valid;
|
newState.vm.formState.valid = newState.valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newState.dirty != undefined) {
|
if (newState.dirty != null) {
|
||||||
newState.vm.formState.dirty = newState.dirty;
|
newState.vm.formState.dirty = newState.dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newState.loading != undefined) {
|
if (newState.loading != null) {
|
||||||
newState.vm.formState.loading = newState.loading;
|
newState.vm.formState.loading = newState.loading;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newState.readOnly != undefined) {
|
if (newState.readOnly != null) {
|
||||||
newState.vm.formState.readOnly = newState.readOnly;
|
newState.vm.formState.readOnly = newState.readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newState.ready != null) {
|
||||||
|
newState.vm.formState.ready = newState.ready;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|||||||
@@ -800,12 +800,6 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
todo: Undo / redo (ctrl-z / ctrl-y) ability?
|
|
||||||
- may need a library for this one if it's tricky to support levels of undo
|
|
||||||
|
|
||||||
todo: wiki controls showing before widget form has loaded causing annoying ability to click but then doesn't work right away
|
todo: wiki controls showing before widget form has loaded causing annoying ability to click but then doesn't work right away
|
||||||
- wiki controls (and indeed nothing at all) should show on form until the object is finished loading
|
- wiki controls (and indeed nothing at all) should show on form until the object is finished loading
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,20 @@
|
|||||||
</v-form>
|
</v-form>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
<!-- <v-overlay :value="!formState.ready">
|
||||||
|
<v-progress-circular
|
||||||
|
color="secondary"
|
||||||
|
indeterminate
|
||||||
|
size="70"
|
||||||
|
></v-progress-circular>
|
||||||
|
</v-overlay> -->
|
||||||
|
<template v-if="!formState.ready">
|
||||||
|
<v-progress-circular
|
||||||
|
indeterminate
|
||||||
|
color="primary"
|
||||||
|
:size="60"
|
||||||
|
></v-progress-circular>
|
||||||
|
</template>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -237,7 +251,7 @@ export default {
|
|||||||
initForm(vm)
|
initForm(vm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
vm.rights = window.$gz.role.getRights(window.$gz.type.Widget);
|
vm.rights = window.$gz.role.getRights(window.$gz.type.Widget);
|
||||||
vm.formState.ready = true;
|
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
@@ -251,18 +265,23 @@ export default {
|
|||||||
dirty: false,
|
dirty: false,
|
||||||
valid: true,
|
valid: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
readOnly: readOnly
|
readOnly: readOnly,
|
||||||
|
ready: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// //bugbug WTF? This doesn't make sense, if it's an attempt to hide delete button then that's wrong
|
// //bugbug WTF? This doesn't make sense, if it's an attempt to hide delete button then that's wrong
|
||||||
// //it's a new record so it can't be deleted so...
|
// //it's a new record so it can't be deleted so...
|
||||||
// vm.rights.delete = false;
|
// vm.rights.delete = false;
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
|
vm.formState.ready = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
vm.formState.ready = true;
|
|
||||||
window.$gz.errorHandler.handleFormError(err, vm);
|
window.$gz.errorHandler.handleFormError(err, vm);
|
||||||
|
vm.formState.ready = true;
|
||||||
|
})
|
||||||
|
.finally(function() {
|
||||||
|
// vm.formState.ready = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeRouteUpdate(to, from, next) {
|
beforeRouteUpdate(to, from, next) {
|
||||||
@@ -398,6 +417,7 @@ export default {
|
|||||||
window.$gz.api
|
window.$gz.api
|
||||||
.get(url)
|
.get(url)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
vm.formState.ready = true;
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
//Not found?
|
//Not found?
|
||||||
if (res.error.code == "2010") {
|
if (res.error.code == "2010") {
|
||||||
|
|||||||
Reference in New Issue
Block a user