diff --git a/src/stores/allMapData.js b/src/stores/allMapData.js index d78a447..27eb08f 100644 --- a/src/stores/allMapData.js +++ b/src/stores/allMapData.js @@ -201,6 +201,7 @@ export default defineStore('allMapDataStore', { break; case 'float': att.value = att.value !== null ? Number(new Decimal(att.value).toFixed(2)) : null; + break; default: break; } @@ -209,7 +210,10 @@ export default defineStore('allMapDataStore', { }); return this.allCase; } catch(error) { - if(error.response.status === 404) return this.infinite404 = 404; + if(error.response.status === 404) { + this.infinite404 = 404; + return; + } apiError(error, 'Failed to load the Trace Detail.'); }; }, @@ -236,6 +240,7 @@ export default defineStore('allMapDataStore', { break; case 'float': att.value = att.value !== null ? Number(new Decimal(att.value).toFixed(2)) : null; + break; default: break; } @@ -244,7 +249,10 @@ export default defineStore('allMapDataStore', { }); return this.allBaseCase; } catch(error) { - if(error.response.status === 404) return this.infinite404 = 404; + if(error.response.status === 404) { + this.infinite404 = 404; + return; + } apiError(error, 'Failed to load the Base Trace Detail.'); }; }, diff --git a/src/stores/conformance.js b/src/stores/conformance.js index 5b2d98c..5f750ac 100644 --- a/src/stores/conformance.js +++ b/src/stores/conformance.js @@ -267,7 +267,11 @@ export default defineStore('conformanceStore', { } try { const response = await this.$axios.get(api); - !getRouteFile ? this.allConformanceTempReportData = response.data : this.allRouteFile = response.data.file; + if(!getRouteFile) { + this.allConformanceTempReportData = response.data + } else { + this.allRouteFile = response.data.file; + } } catch(error) { apiError(error, 'Failed to Get the Temporary Log Conformance Report.'); } @@ -337,7 +341,10 @@ export default defineStore('conformanceStore', { this.allCases = response.data.cases; return response.data.cases; } catch(error) { - if(error.response.status === 404) return this.infinite404 = 404; + if(error.response.status === 404) { + this.infinite404 = 404; + return; + } apiError(error, 'Failed to Get the detail of a temporary log conformance issue.'); }; }, @@ -390,7 +397,10 @@ export default defineStore('conformanceStore', { this.allLoopCases = response.data.cases; return response.data.cases; } catch(error) { - if(error.response.status === 404) return this.infinite404 = 404; + if(error.response.status === 404) { + this.infinite404 = 404; + return; + } apiError(error, 'Failed to Get the detail of a temporary log conformance loop.'); }; }, diff --git a/src/stores/login.ts b/src/stores/login.ts index 06caa22..8e41110 100644 --- a/src/stores/login.ts +++ b/src/stores/login.ts @@ -115,7 +115,7 @@ export default defineStore('loginStore', { const api = '/api/my-account'; try { - const response = await axios.get(api); + await axios.get(api); } catch(error) { this.$router.push('/login'); }; diff --git a/src/views/Compare/Dashboard/Compare.vue b/src/views/Compare/Dashboard/Compare.vue index 44f9ae6..91df11b 100644 --- a/src/views/Compare/Dashboard/Compare.vue +++ b/src/views/Compare/Dashboard/Compare.vue @@ -441,7 +441,6 @@ console.log("TODO:", datasetsPrimary, ) let yDataPrimary; let labelPrimary = chartData.data[0].label; let datasetsSecondary = chartData.data[1].data; - // let xDataSecondary; let yDataSecondary; let labelSecondary = chartData.data[1].label; let primeVueSetData = {}; @@ -462,7 +461,6 @@ console.log("TODO:", datasetsPrimary, ) y: value.y === null ? null : value.y * 100 } }); - // xDataSecondary = datasetsSecondary.map(i => i.x); yDataSecondary = datasetsSecondary.map(i => i.y); primeVueSetData = { @@ -498,8 +496,7 @@ console.log("TODO:", datasetsPrimary, ) return `${content.x}: ${context[0].label}`; }, label: function(context) { - let value = context.parsed.y; - value = `${(context.parsed.y * 10).toFixed(2)}%`; + let value = `${(context.parsed.y * 10).toFixed(2)}%`; switch (context.datasetIndex) { case 0: // Primary return `${labelPrimary}: ${value}`; @@ -620,9 +617,7 @@ console.log("TODO:", datasetsPrimary, ) switch (xUnit) { case 'date': primeVueSetOption.plugins.tooltip.callbacks.label = function(context) { - let value = context.parsed.y; - - value = context.parsed.x === null ? "n/a" : getSimpleTimeLabel(context.parsed.x, 2); + let value = context.parsed.x === null ? "n/a" : getSimpleTimeLabel(context.parsed.x, 2); switch (context.datasetIndex) { case 0: // Primary return `${labelPrimary}: ${value}`; diff --git a/src/views/Discover/Map/Map.vue b/src/views/Discover/Map/Map.vue index 9fa46cc..2e64aec 100644 --- a/src/views/Discover/Map/Map.vue +++ b/src/views/Discover/Map/Map.vue @@ -18,14 +18,6 @@ - - @@ -253,7 +245,7 @@ export default { */ async switchTraceId(e) { if(e.id == this.traceId) return; - // if(e.count >= 1000) this.isLoading = true; // 超過 1000 筆要 loading 畫面 + // 超過 1000 筆要 loading 畫面 this.isLoading = true; // 都要 loading 畫面 this.traceId = e.id; await this.allMapDataStore.getTraceDetail(); diff --git a/src/views/Files/Files.vue b/src/views/Files/Files.vue index 8429bd2..7906d7f 100644 --- a/src/views/Files/Files.vue +++ b/src/views/Files/Files.vue @@ -483,6 +483,7 @@ switch (i.type) { case 'log-check': i.type = 'rule'; + break; case 'filter-check': i.type = 'rule'; break;