This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* Xeslint-disable */
|
||||
///////////////////////////////
|
||||
// gzform
|
||||
//
|
||||
@@ -523,8 +523,6 @@ export default {
|
||||
//
|
||||
//
|
||||
setFormSettings(formKey, formSettings) {
|
||||
console.log("GZFORM: committing form settings for form " + formKey);
|
||||
console.log(formSettings);
|
||||
store.commit("setFormSettings", {
|
||||
formKey: formKey,
|
||||
formSettings: formSettings
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
/* Xeslint-disable */
|
||||
const FORM_KEY = "inventorywidgetlist";
|
||||
|
||||
export default {
|
||||
@@ -98,8 +98,6 @@ export default {
|
||||
})
|
||||
.then(() => {
|
||||
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
|
||||
if (!storedFormSettings) {
|
||||
@@ -126,10 +124,6 @@ export default {
|
||||
appError: null,
|
||||
serverError: {}
|
||||
},
|
||||
dialogdata: {
|
||||
showeditdialog: false,
|
||||
recordId: 0
|
||||
},
|
||||
totalItems: 0,
|
||||
Items: [],
|
||||
loading: true,
|
||||
@@ -166,8 +160,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
newItem() {
|
||||
this.dialogdata.recordId = -1;
|
||||
this.dialogdata.showeditdialog = true;
|
||||
this.$router.push({
|
||||
name: "inventory-widget-edit",
|
||||
params: { id: 0 }
|
||||
});
|
||||
},
|
||||
getDataFromApi() {
|
||||
var that = this;
|
||||
@@ -196,8 +192,6 @@ export default {
|
||||
that.localFormSettings.pagination &&
|
||||
that.localFormSettings.pagination.rowsPerPage
|
||||
) {
|
||||
console.log("IWL: setting local formsettings as there is data:");
|
||||
console.log(that.localFormSettings);
|
||||
that.$gzform.setFormSettings(FORM_KEY, that.localFormSettings);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
import createPersistedState from "vuex-persistedstate";
|
||||
import _ from "./libs/lodash.min.js";
|
||||
/* eslint-disable */
|
||||
/* Xeslint-disable */
|
||||
const MaxLogLength = 100;
|
||||
|
||||
Vue.use(Vuex);
|
||||
@@ -90,13 +90,7 @@ export default new Vuex.Store({
|
||||
state.formSettings = {};
|
||||
},
|
||||
setFormSettings(state, 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) {
|
||||
delete state.formSettings[formKey];
|
||||
|
||||
@@ -273,7 +273,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$on("menu-click", clickHandler);
|
||||
this.getDataFromApi();
|
||||
//id 0 means create a new record don't load one
|
||||
if (this.$route.params.id != 0) {
|
||||
this.getDataFromApi();
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
var vm = this;
|
||||
|
||||
Reference in New Issue
Block a user