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