Discover: Save button done.

This commit is contained in:
chiayin
2023-04-27 18:40:14 +08:00
parent b1161a82a7
commit ab8708a597
4 changed files with 123 additions and 126 deletions

View File

@@ -15,6 +15,7 @@ export default defineStore('allMapDataStore', {
logId: null,
traceId: 1,
tempFilterId: null,
createFilterId: null,
allProcessMap: {},
allBpmn: {},
allStats: {},
@@ -216,6 +217,28 @@ export default defineStore('allMapDataStore', {
await delay(500);
$toast.default('Failed to add the Temporary Filters.',{position: 'bottom'});
};
},
async addFilterId(value) {
let logId = this.logId;
const api = `/api/filters?log_id=${logId}`;
let createFilterObj = {
name: value,
rules: this.postRuleData
};
try {
const response = await this.$axios.post(api, createFilterObj)
this.createFilterId = response.data.id;
this.tempFilterId = null;
}catch(error) {
this.httpStatus = error.request.status;
await delay();
loading.isLoading = true;
await delay(1000);
loading.isLoading = false;
await delay(500);
$toast.default('Failed to load the Filters.',{position: 'bottom'});
};
}
},
})