Conformance Filter: fetch filter params API done.
This commit is contained in:
@@ -6,9 +6,9 @@ import apiError from '@/module/apiError.js';
|
||||
|
||||
export default defineStore('conformanceStore', {
|
||||
state: () => ({
|
||||
conformanceLogId: null,
|
||||
conformanceFilterId: null,
|
||||
conformanceTempCheckId: null,
|
||||
conformanceLogId: null, // log 檔
|
||||
conformanceFilterId: null, // filter 檔
|
||||
conformanceLogTempCheckId: null, // log 檔存檔前的 check Id
|
||||
allConformanceTask: [],
|
||||
allCfmSeqStart: [],
|
||||
allCfmSeqEnd: [],
|
||||
@@ -177,9 +177,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* fetch Log Conformance Parameters api for Rule Settings.
|
||||
*/
|
||||
async getLogConformanceParams() {
|
||||
async getConformanceParams() {
|
||||
let logId = this.conformanceLogId;
|
||||
const api = `/api/log-checks/params?log_id=${logId}`;
|
||||
let 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}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -202,7 +207,7 @@ export default defineStore('conformanceStore', {
|
||||
|
||||
try {
|
||||
const response = await this.$axios.post(api, data);
|
||||
this.conformanceTempCheckId = response.data.id;
|
||||
this.conformanceLogTempCheckId = response.data.id;
|
||||
} catch(error) {
|
||||
apiError(error, 'Failed to add the Temporary Check for a log.');
|
||||
}
|
||||
@@ -211,7 +216,7 @@ export default defineStore('conformanceStore', {
|
||||
* Get the Temporary Log Conformance Report
|
||||
*/
|
||||
async getLogConformanceTempReport() {
|
||||
let checkId = this.conformanceTempCheckId;
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}`;
|
||||
|
||||
try {
|
||||
@@ -225,7 +230,7 @@ export default defineStore('conformanceStore', {
|
||||
* Get the detail of a temporary log conformance issue.
|
||||
*/
|
||||
async getLogConformanceIssue(issueNo) {
|
||||
let checkId = this.conformanceTempCheckId;
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}`;
|
||||
|
||||
try {
|
||||
@@ -239,7 +244,7 @@ export default defineStore('conformanceStore', {
|
||||
* Get the Trace Details of a Temporary Log Conformance lssue.
|
||||
*/
|
||||
async getLogConformanceTraceDetail(issueNo, traceId, start) {
|
||||
let checkId = this.conformanceTempCheckId;
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
@@ -256,7 +261,7 @@ export default defineStore('conformanceStore', {
|
||||
* Get the Details of a Temporary Log Conformance Loop.
|
||||
*/
|
||||
async getLogConformanceLoop(loopNo) {
|
||||
let checkId = this.conformanceTempCheckId;
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
let api = `/api/temp-log-checks/${checkId}/loops/${loopNo}`;
|
||||
|
||||
try {
|
||||
@@ -270,7 +275,7 @@ export default defineStore('conformanceStore', {
|
||||
* Get the Trace Details of a Temporary Log Conformance Loops.
|
||||
*/
|
||||
async getLogConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
let checkId = this.conformanceTempCheckId;
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user