complete user settings
This commit is contained in:
@@ -455,7 +455,6 @@ export default {
|
||||
this.initFilters();
|
||||
},
|
||||
mounted() {
|
||||
debugger;
|
||||
let that = this;
|
||||
// force to open case
|
||||
this.openDefaultCase();
|
||||
|
||||
@@ -314,16 +314,34 @@ export default {
|
||||
this.openDefaultCase();
|
||||
// define sort event
|
||||
Event.$on('vue-tables.draft.sorted', function (data) {
|
||||
that.$emit("updateUserSettings", "orderBy", data);
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
this.$emit("updateUserSettings", "columns", val);
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateUserSettings", "filters", val);
|
||||
},
|
||||
columns: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
@onLastPage="onLastPage"
|
||||
@onUpdateFilters="onUpdateFilters"
|
||||
@cleanDefaultOption="cleanDefaultOption"
|
||||
@updateUserSettings="updateUserSettings"
|
||||
@updateSettings="updateSettings"
|
||||
></component>
|
||||
</div>
|
||||
@@ -213,27 +212,6 @@ export default {
|
||||
console.error(e);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Update the user config service
|
||||
*/
|
||||
updateUserSettings(prop, data) {
|
||||
if (this.config.setting) {
|
||||
if (!this.config.setting[this.page]) {
|
||||
this.config.setting[this.page] = {};
|
||||
}
|
||||
this.config.setting[this.page][prop] = data;
|
||||
api.config
|
||||
.put(this.config)
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
//TODO success response
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Update the user config service
|
||||
* @param {object} params
|
||||
@@ -254,7 +232,7 @@ export default {
|
||||
if (!this.config.setting[this.page]) {
|
||||
this.config.setting[this.page] = {};
|
||||
}
|
||||
this.config.setting[this.page][params.key] = data;
|
||||
this.config.setting[this.page][params.key] = params.data;
|
||||
}
|
||||
api.config
|
||||
.put(this.config)
|
||||
@@ -424,7 +402,6 @@ export default {
|
||||
this.settings = {};
|
||||
}
|
||||
}
|
||||
|
||||
if (this.page === this.lastPage
|
||||
&& this.$refs["component"]
|
||||
&& this.$refs["component"].updateView) {
|
||||
|
||||
@@ -358,16 +358,34 @@ export default {
|
||||
this.openDefaultCase();
|
||||
// define sort event
|
||||
Event.$on('vue-tables.todo.sorted', function (data) {
|
||||
that.$emit("updateUserSettings", "orderBy", data);
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
this.$emit("updateUserSettings", "columns", val);
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateUserSettings", "filters", val);
|
||||
},
|
||||
columns: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
|
||||
@@ -230,16 +230,34 @@ export default {
|
||||
this.$refs["newRequest"].show();
|
||||
}
|
||||
// define sort event
|
||||
Event.$on("vue-tables.mycases.sorted", function(data) {
|
||||
that.$emit("updateUserSettings", "orderBy", data);
|
||||
Event.$on('vue-tables.mycases.sorted', function (data) {
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
columns: function(val) {
|
||||
this.$emit("updateUserSettings", "columns", val);
|
||||
columns: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
filters: function(val) {
|
||||
this.$emit("updateUserSettings", "filters", val);
|
||||
filters: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -357,16 +357,34 @@ export default {
|
||||
// force to open case
|
||||
this.openDefaultCase();
|
||||
Event.$on('vue-tables.paused.sorted', function (data) {
|
||||
that.$emit("updateUserSettings", "orderBy", data);
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
this.$emit("updateUserSettings", "columns", val);
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateUserSettings", "filters", val);
|
||||
},
|
||||
columns: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
|
||||
@@ -349,16 +349,34 @@ export default {
|
||||
this.initFilters();
|
||||
// define sort event
|
||||
Event.$on('vue-tables.unassigned.sorted', function (data) {
|
||||
that.$emit("updateUserSettings", "orderBy", data);
|
||||
that.$emit("updateSettings", {
|
||||
data: data,
|
||||
key: "orderBy",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
this.$emit("updateUserSettings", "columns", val);
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateUserSettings", "filters", val);
|
||||
},
|
||||
columns: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "columns",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
filters: function (val) {
|
||||
this.$emit("updateSettings", {
|
||||
data: val,
|
||||
key: "filters",
|
||||
parent: this.page,
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user