[EDIT]分析値の+-表記と色分けについて記述しました

This commit is contained in:
2026-09-17 16:07:35 +09:00
parent cbaee01d13
commit 4e3477af77

View File

@@ -12,7 +12,7 @@
<table class="table text-center"> <table class="table text-center">
<thead> <thead>
<tr> <tr>
<th scope="col">カテゴリ別</th> <th scope="col"></th>
<th scope="col">支出</th> <th scope="col">支出</th>
<th scope="col">前月比</th> <th scope="col">前月比</th>
</tr> </tr>
@@ -20,8 +20,17 @@
<tbody> <tbody>
<tr> <tr>
<th scope="row">総支出</th> <th scope="row">総支出</th>
<td th:text="'¥' + ${analysisForm.currentMonthTotalAmount}">0</td> <td th:text="'¥' + ${analysisForm.currentMonthTotalAmount}">
<td th:text="'¥' + ${analysisForm.totalDifferenceAmount}">0</td> 0
</td>
<td th:text="${analysisForm.totalDifferenceAmount >= 0}
? '+' + ${analysisForm.totalDifferenceAmount}
: '-' + ${analysisForm.totalDifferenceAmount}"
th:class="${analysisForm.totalDifferenceAmount >= 0}
? 'color-danger;'
: 'color-primary;'">
0
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -44,7 +53,7 @@
<tr th:each="category : ${analysisForm.categoryAnalysisFormList}"> <tr th:each="category : ${analysisForm.categoryAnalysisFormList}">
<th scope="row" <th scope="row"
th;text="${category.categoryName}"> th:text="${category.categoryName}">
食費 食費
</th> </th>
@@ -53,10 +62,20 @@
</td> </td>
<td> <td>
<span th:text="'¥' + ${category.monthDifferenceAmount}"> <span th:text="${category.monthDifferenceAmount >= 0}
? '+' + ${category.monthDifferenceAmount}
: '-' + ${category.monthDifferenceAmount}"
th:class="${category.monthDifferenceAmount >= 0}
? 'color-danger;'
: 'color-primary;'">
</span> </span>
<br> <br>
<span th:text="'¥' + ${category.courseDifferenceAmount}"> <span th:text="${category.courseDifferenceAmount >= 0}
? '+' + ${category.courseDifferenceAmount}
: '-' + ${category.courseDifferenceAmount}"
th:class="${category.courseDifferenceAmount >= 0}
? 'color-danger;'
: 'color-primary;'">
</span> </span>
</td> </td>
</tr> </tr>