Conformance: StatusSidebar Have activity Clear button done.

This commit is contained in:
chiayin
2023-07-13 09:42:58 +08:00
parent 6955f376ca
commit 97ac9535f9
6 changed files with 64 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ let delay = (s = 0) => new Promise((resolve, reject) => setTimeout(resolve, s))
export default defineStore('conformanceStore', {
state: () => ({
conformanceLogId: null,
conformanceLogTempCheckerId: null,
conformanceFilterId: null,
allConformanceTask: [],
selectedRuleType: 'Have activity', // radio
@@ -45,6 +46,27 @@ export default defineStore('conformanceStore', {
await delay(500);
$toast.default('Failed to load the Conformance Parameters.',{position: 'bottom'});
}
},
/**
* Creates a new temporary checker for a log.
*/
async addLogConformanceTempCheckerId() {
let logId = this.conformanceLogId;
const api = `/api/temp-log-checkers?log_id=${logId}`;
try {
const response = await this.$axios.post(api);
console.log(response);
this.conformanceLogTempCheckerId = response.data.id;
} catch(error) {
console.log(error);
await delay();
loading.isLoading = true;
await delay(1000);
loading.isLoading = false;
await delay(500);
$toast.default('Failed to add the Temporary Checker for a log.',{position: 'bottom'});
}
}
},
})