Skip to content

Commit

Permalink
fix message
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuiantw1212 committed May 13, 2024
1 parent 6f6d3dc commit 10938bd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 46 deletions.
4 changes: 2 additions & 2 deletions components/calculator/estate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
7 changes: 4 additions & 3 deletions components/calculator/estateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
<el-col :span="20">
<el-form-item label="房屋總價">
<el-text>= 單價({{ estatePrice.unitPrice }}萬/坪) x 權狀({{
estateSize.floorSize }}坪) = {{
Number(Math.floor(tempTotalPrice / 10000)).toLocaleString() }} 萬</el-text>
estateSize.floorSize }}坪) = {{
Number(Math.floor(tempTotalPrice / 10000)).toLocaleString() }} 萬</el-text>
</el-form-item>
</el-col>
<!-- <el-col :span="3">
<el-button @click="emits('close')">取消</el-button>
</el-col> -->
<el-col :span="4">
<el-button v-loading="confirmLoader" @click="confirmUpdate()">確認帶回</el-button>
<el-button v-loading="confirmLoader" :disabled="!estatePrice.unitPrice"
@click="confirmUpdate()">確認帶回</el-button>
</el-col>
</el-row>
<!-- </el-card> -->
Expand Down
2 changes: 1 addition & 1 deletion components/calculator/report/freedomRate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
72 changes: 32 additions & 40 deletions components/calculator/retirement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-row>
<el-col :span="12">
</el-col>
<el-col :span="12">
<el-form-item label="退休後餘命">
<el-text>{{ retirement.lifeExpectancy }} 年</el-text>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<el-collapse>
<el-collapse-item :title="detailTitle[profile.careerInsuranceType]" :disabled="isFormDisabled">
<el-row>
Expand All @@ -58,15 +58,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
</el-col>
<el-col :span="12">
<el-form-item label="餘命 x 年金現值">
<el-text>{{ Number(retirement.annuitySum).toLocaleString() }}</el-text>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="雇主提繳累計">
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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))
}
Expand All @@ -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({
Expand Down

0 comments on commit 10938bd

Please sign in to comment.