This commit is contained in:
2019-06-05 17:15:03 +00:00
parent f4d9220d62
commit 1ef6f6bbd9
3 changed files with 25 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* xeslint-disable */ /* eslint-disable */
/////////////////////////////// ///////////////////////////////
// gzform // gzform
// //
@@ -523,6 +523,11 @@ export default {
// //
// //
setFormSettings(formKey, formSettings) { setFormSettings(formKey, formSettings) {
store.commit("setFormSettings", formKey, formSettings); console.log("GZFORM: committing form settings for form " + formKey);
console.log(formSettings);
store.commit("setFormSettings", {
formKey: formKey,
formSettings: formSettings
});
} }
}; };

View File

@@ -71,7 +71,7 @@
</template> </template>
<script> <script>
/* Xeslint-disable */ /* eslint-disable */
const FORM_KEY = "inventorywidgetlist"; const FORM_KEY = "inventorywidgetlist";
export default { export default {
@@ -97,16 +97,19 @@ export default {
}); });
}) })
.then(() => { .then(() => {
//eslint-disable-next-line
debugger;
var storedFormSettings = that.$gzform.getFormSettings(FORM_KEY); var storedFormSettings = that.$gzform.getFormSettings(FORM_KEY);
console.log("IWL:beforeCreate storedFormSettings:");
console.log(storedFormSettings);
//set default values for form settings if they are not present yet //set default values for form settings if they are not present yet
if (!storedFormSettings) { if (!storedFormSettings) {
storedFormSettings = { storedFormSettings = {
pagination: {} pagination: {}
}; };
} else {
that.localFormSettings = storedFormSettings;
} }
that.localFormSettings = storedFormSettings;
that.formState.ready = true; that.formState.ready = true;
}) })
.catch(err => { .catch(err => {
@@ -193,8 +196,8 @@ export default {
that.localFormSettings.pagination && that.localFormSettings.pagination &&
that.localFormSettings.pagination.rowsPerPage that.localFormSettings.pagination.rowsPerPage
) { ) {
//eslint-disable-next-line console.log("IWL: setting local formsettings as there is data:");
debugger; console.log(that.localFormSettings);
that.$gzform.setFormSettings(FORM_KEY, that.localFormSettings); that.$gzform.setFormSettings(FORM_KEY, that.localFormSettings);
} }

View File

@@ -2,7 +2,7 @@ import Vue from "vue";
import Vuex from "vuex"; import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate"; import createPersistedState from "vuex-persistedstate";
import _ from "./libs/lodash.min.js"; import _ from "./libs/lodash.min.js";
/* eslint-disable */
const MaxLogLength = 100; const MaxLogLength = 100;
Vue.use(Vuex); Vue.use(Vuex);
@@ -89,8 +89,14 @@ export default new Vuex.Store({
clearAllFormSettings(state) { clearAllFormSettings(state) {
state.formSettings = {}; state.formSettings = {};
}, },
setFormSettings(state, formKey, data) { setFormSettings(state, data) {
state.formSettings[formKey] = data; console.log("STORE::setFormSettings for formkey " + data.formKey);
console.log(data.formSettings);
state.formSettings[data.formKey] = data.formSettings;
console.log("STORE::setFormSettings state.formSettings is now:");
console.log(state.formSettings);
}, },
clearFormSettings(state, formKey) { clearFormSettings(state, formKey) {
delete state.formSettings[formKey]; delete state.formSettings[formKey];