diff --git a/components/calculator/estate.vue b/components/calculator/estate.vue index 291b81d..a4dd6c8 100644 --- a/components/calculator/estate.vue +++ b/components/calculator/estate.vue @@ -444,9 +444,9 @@ function calculateDownpayYear() { } import { ElMessage, } from 'element-plus' -import { throttle, debounce } from './lodash.js' +import { throttle } from './lodash.js' const errorMssage = throttle(() => { - // ElMessage.error('房屋:家徒四壁!') + ElMessage.error('房屋:家徒四壁!') }, 4000) defineExpose({ diff --git a/components/calculator/estateDialog.vue b/components/calculator/estateDialog.vue index 9ecb213..da9bd3f 100644 --- a/components/calculator/estateDialog.vue +++ b/components/calculator/estateDialog.vue @@ -13,15 +13,16 @@ = 單價({{ estatePrice.unitPrice }}萬/坪) x 權狀({{ - estateSize.floorSize }}坪) = {{ - Number(Math.floor(tempTotalPrice / 10000)).toLocaleString() }} 萬 + estateSize.floorSize }}坪) = {{ + Number(Math.floor(tempTotalPrice / 10000)).toLocaleString() }} 萬 - 確認帶回 + 確認帶回 diff --git a/components/calculator/report/freedomRate.vue b/components/calculator/report/freedomRate.vue index fa3433e..6eda88c 100644 --- a/components/calculator/report/freedomRate.vue +++ b/components/calculator/report/freedomRate.vue @@ -159,7 +159,7 @@ function calculateFreedomRate(payload) { fill: true, tension, }) - // security sum + // security sum const finalAsset = securityData.pop() const finalDebt = estateDebtData.pop() const finalEstate = estateAsset.pop() diff --git a/components/calculator/retirement.vue b/components/calculator/retirement.vue index 818fdc6..dd0fcdf 100644 --- a/components/calculator/retirement.vue +++ b/components/calculator/retirement.vue @@ -23,7 +23,7 @@ - + @@ -58,15 +58,6 @@ - - - - - - {{ Number(retirement.annuitySum).toLocaleString() }} - - - @@ -641,11 +632,6 @@ async function drawRetirementAssetChart() { labels.push(calculatedYear) pv = fv } - if (fv <= 0) { - if (!errorMssage.pending()) { - errorMssage() - } - } // 繪圖 const tension = 0.5 const datasets = [ @@ -681,31 +667,37 @@ async function drawRetirementAssetChart() { datasets, labels } - // 繪圖 - if (pensionChartInstance.value) { - clearTimeout(debounceId.value) - debounceId.value = setTimeout(() => { + clearTimeout(debounceId.value) + debounceId.value = setTimeout(() => { + // 錯誤訊息 + if (fv <= 0) { + if (!errorMssage.pending()) { + errorMssage() + } + } + // 繪圖 + if (pensionChartInstance.value) { pensionChartInstance.value.data = chartData pensionChartInstance.value.update() - }, 250) - } else { - const ctx: any = document.getElementById('pensionChart') - const chartInstance = new Chart(ctx, { - type: 'bar', - data: chartData, - options: { - scales: { - x: { - stacked: true, - }, - y: { // 要部份stacked,部分overlap - stacked: true, - }, + } else { + const ctx: any = document.getElementById('pensionChart') + const chartInstance = new Chart(ctx, { + type: 'bar', + data: chartData, + options: { + scales: { + x: { + stacked: true, + }, + y: { // 要部份stacked,部分overlap + stacked: true, + }, + } } - } - }) - pensionChartInstance = shallowRef(chartInstance) - } + }) + pensionChartInstance = shallowRef(chartInstance) + } + }, 250) return { pensionLumpSumData: JSON.parse(JSON.stringify(pensionLumpSumData)) } @@ -725,9 +717,9 @@ function calculatePensionLumpsumTax(fv = 0) { } import { ElMessage, } from 'element-plus' -import { throttle, debounce } from './lodash.js' +import { throttle, } from './lodash.js' const errorMssage = throttle(() => { - // ElMessage.error('退休:晚節不保!') + ElMessage.error('退休:晚節不保!') }, 4000) defineExpose({