Conformance Filter: fetch filter doning 50%.
This commit is contained in:
@@ -304,9 +304,9 @@ export default {
|
||||
async openMore(no) {
|
||||
// async await 解決非同步資料延遲傳遞導致未讀取到而出錯的問題
|
||||
this.issuesNo = no;
|
||||
await this.conformanceStore.getLogConformanceIssue(no);
|
||||
await this.conformanceStore.getConformanceIssue(no);
|
||||
this.traceId = await this.issueTraces[0].id;
|
||||
this.firstCases = await this.conformanceStore.getLogConformanceTraceDetail(no, this.issueTraces[0].id, 0);
|
||||
this.firstCases = await this.conformanceStore.getConformanceTraceDetail(no, this.issueTraces[0].id, 0);
|
||||
this.issuesModal = await true;
|
||||
},
|
||||
/**
|
||||
@@ -316,9 +316,9 @@ export default {
|
||||
async openLoopMore(no) {
|
||||
// async await 解決非同步資料延遲傳遞導致未讀取到而出錯的問題
|
||||
this.loopNo = no;
|
||||
await this.conformanceStore.getLogConformanceLoop(no);
|
||||
await this.conformanceStore.getConformanceLoop(no);
|
||||
this.looptraceId = await this.loopTraces[0].id;
|
||||
this.loopFirstCases = await this.conformanceStore.getLogConformanceLoopsTraceDetail(no, this.loopTraces[0].id, 0);
|
||||
this.loopFirstCases = await this.conformanceStore.getConformanceLoopsTraceDetail(no, this.loopTraces[0].id, 0);
|
||||
this.loopModal = await true;
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -907,8 +907,8 @@ export default {
|
||||
this.isLoading = true;
|
||||
this.isSubmit = true;
|
||||
this.isSubmitData = data; // 已 Apply 後,沒有重新改變規則的 Data
|
||||
await this.conformanceStore.addLogConformanceTempCheckId(data);
|
||||
await this.conformanceStore.getLogConformanceTempReport();
|
||||
await this.conformanceStore.addConformanceCheckId(data);
|
||||
await this.conformanceStore.getConformanceReport();
|
||||
this.isShowBar = false;
|
||||
this.isLoading = false;
|
||||
// Results page Cover Plate
|
||||
|
||||
@@ -182,8 +182,8 @@ export default {
|
||||
this.startNum = 0;
|
||||
|
||||
let result;
|
||||
if(this.category === 'issue') result = await this.conformanceStore.getLogConformanceTraceDetail(this.listNo, id, 0);
|
||||
else if(this.category === 'loop') result = await this.conformanceStore.getLogConformanceLoopsTraceDetail(this.listNo, id, 0);
|
||||
if(this.category === 'issue') result = await this.conformanceStore.getConformanceTraceDetail(this.listNo, id, 0);
|
||||
else if(this.category === 'loop') result = await this.conformanceStore.getConformanceLoopsTraceDetail(this.listNo, id, 0);
|
||||
this.infiniteData = await result;
|
||||
},
|
||||
/**
|
||||
@@ -248,7 +248,7 @@ export default {
|
||||
try {
|
||||
this.loading = true;
|
||||
this.startNum += 20
|
||||
const result = await this.conformanceStore.getLogConformanceTraceDetail(this.listNo, this.showTraceId, this.startNum);
|
||||
const result = await this.conformanceStore.getConformanceTraceDetail(this.listNo, this.showTraceId, this.startNum);
|
||||
this.infiniteData = [...this.infiniteData, ...result];
|
||||
} catch(error) {
|
||||
// console.error('Failed to load data:', error);
|
||||
|
||||
@@ -9,6 +9,7 @@ export default defineStore('conformanceStore', {
|
||||
conformanceLogId: null, // log 檔
|
||||
conformanceFilterId: null, // filter 檔
|
||||
conformanceLogTempCheckId: null, // log 檔存檔前的 check Id
|
||||
conformanceFilterTempCheckId: null, // Filter 檔存檔前的 check Id
|
||||
allConformanceTask: [],
|
||||
allCfmSeqStart: [],
|
||||
allCfmSeqEnd: [],
|
||||
@@ -178,13 +179,14 @@ export default defineStore('conformanceStore', {
|
||||
* fetch Log Conformance Parameters api for Rule Settings.
|
||||
*/
|
||||
async getConformanceParams() {
|
||||
let logId = this.conformanceLogId;
|
||||
let filterId = this.conformanceFilterId;
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
else api = `/api/log-checks/params?log_id=${logId}`;
|
||||
console.log('getConformanceParams', api);
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -201,23 +203,34 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Creates a new temporary check for a log.
|
||||
*/
|
||||
async addLogConformanceTempCheckId(data) {
|
||||
let logId = this.conformanceLogId;
|
||||
const api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
async addConformanceCheckId(data) {
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
else api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.post(api, data);
|
||||
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 log.');
|
||||
apiError(error, 'Failed to add the Temporary Check for a file.');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the Temporary Log Conformance Report
|
||||
*/
|
||||
async getLogConformanceTempReport() {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}`;
|
||||
async getConformanceReport() {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -229,9 +242,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the detail of a temporary log conformance issue.
|
||||
*/
|
||||
async getLogConformanceIssue(issueNo) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}`;
|
||||
async getConformanceIssue(issueNo) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -243,9 +261,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Trace Details of a Temporary Log Conformance lssue.
|
||||
*/
|
||||
async getLogConformanceTraceDetail(issueNo, traceId, start) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
async getConformanceTraceDetail(issueNo, traceId, start) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -260,9 +283,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Details of a Temporary Log Conformance Loop.
|
||||
*/
|
||||
async getLogConformanceLoop(loopNo) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
let api = `/api/temp-log-checks/${checkId}/loops/${loopNo}`;
|
||||
async getConformanceLoop(loopNo) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/loops/${loopNo}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/loops/${loopNo}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -274,9 +302,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Trace Details of a Temporary Log Conformance Loops.
|
||||
*/
|
||||
async getLogConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
async getConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
|
||||
Reference in New Issue
Block a user