This commit is contained in:
2021-02-03 20:17:53 +00:00
parent fa739dcf35
commit 1e0a4219eb

View File

@@ -352,7 +352,7 @@ export default {
activeFilterId: Number
},
methods: {
saveAndExit() {
async saveAndExit() {
//todo: save changes here
//Note: we are working with a specific filter, either the "default" filter which is the one used when no other filter is specified or a specific one
//So here we need to take the current filter, update it and save it
@@ -374,7 +374,7 @@ export default {
from server: activefilter:{ "id": 1, "concurrency": 5029293, "userId": 1, "name": "-", "public": false, "defaultFilter": true, "listKey": "TestWidgetDataList", "filter": "[]" }
*/
console.log("BEFORE SAVE ACTIVE FILTER:", this.activeFilter);
// console.log("BEFORE SAVE ACTIVE FILTER:", this.activeFilter);
//turn activeFilter into object json.parse
let af = JSON.parse(this.activeFilter.filter);
@@ -403,9 +403,13 @@ from server: activefilter:{ "id": 1, "concurrency": 5029293, "userId": 1, "name"
this.activeFilter.filter = JSON.stringify(af);
//SAVE
console.log("SAVE ACTIVE FILTER:", this.activeFilter);
this.close({ refresh: true });
let res = await window.$gz.api.put("data-list-filter", this.activeFilter);
if (res.error) {
//throw new Error(res.error);
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
} else {
this.close({ refresh: true });
}
},
addFilterCondition(editItem) {
// filter:[{column:"PartPartNumber",any:true/false,items:[{op: "=",value: "400735"}]}],