refactor (slight, although many files)
This commit is contained in:
@@ -193,9 +193,12 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
else api = `/api/log-checks/params?log_id=${logId}`;
|
||||
|
||||
if(filterId !== null) {
|
||||
api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
}
|
||||
else {
|
||||
api = `/api/log-checks/params?log_id=${logId}`;
|
||||
}
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
this.allConformanceTask = response.data.tasks;
|
||||
@@ -218,13 +221,22 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
else api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
if(filterId !== null) {
|
||||
api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
}
|
||||
else {
|
||||
api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log("addConformanceCheckId() axios data", data)
|
||||
const response = await this.$axios.post(api, data);
|
||||
if(filterId !== null) this.conformanceFilterTempCheckId = response.data.id;
|
||||
else this.conformanceLogTempCheckId = response.data.id;
|
||||
if(filterId !== null) {
|
||||
this.conformanceFilterTempCheckId = response.data.id;
|
||||
}
|
||||
else {
|
||||
this.conformanceLogTempCheckId = response.data.id;
|
||||
}
|
||||
} catch(error) {
|
||||
apiError(error, 'Failed to add the Temporary Check for a file.');
|
||||
}
|
||||
|
||||
25
src/stores/conformanceData.js
Normal file
25
src/stores/conformanceData.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export default defineStore('conformanceDataStore', {
|
||||
state: () => ({
|
||||
dataToSave: {
|
||||
start: null,
|
||||
end: null,
|
||||
min: null,
|
||||
max: null,
|
||||
type: null,
|
||||
task: null,
|
||||
},
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Set conformance input data which are fed to backend later.
|
||||
* @param {object} userInputObj
|
||||
*/
|
||||
setConformanceData(userInputObj){
|
||||
this.dataToSave = {...userInputObj};
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -37,7 +37,7 @@ export default defineStore('pageAdminStore', {
|
||||
},
|
||||
/**
|
||||
* Specify previous page state value.
|
||||
* @param {*} prevPage
|
||||
* @param {string} prevPage
|
||||
*/
|
||||
setPrevioiusPage(prevPage) {
|
||||
// console.log('setPrevioiusPage()', prevPage);
|
||||
|
||||
Reference in New Issue
Block a user