|
1 | 1 | <template>
|
2 |
| - <v-card elevation='2' class='mb-2'> |
| 2 | + <v-card elevation='2' class='mb-2' max-width='400px'> |
3 | 3 | <v-card-title>{{ name }}</v-card-title>
|
4 | 4 | <v-card-text>
|
5 |
| - <div v-if="hasAmount">Valor Investido: {{ amountDisplay }}</div> |
6 |
| - <div v-if='!!interestAmount'> |
7 |
| - Rendimento Bruto: {{ interestAmountDisplay }} |
8 |
| - </div> |
9 |
| - <div v-if='!!iofAmount'>IOF: {{ iofAmountDisplay }}</div> |
10 |
| - <div v-if='!!taxAmount'> |
11 |
| - Imposto de Renda: {{ taxAmountDisplay }} |
12 |
| - <v-badge |
13 |
| - inline |
14 |
| - v-if='!!taxPercentage' |
15 |
| - :content='taxPercentageDisplay' |
16 |
| - color='red lighten-2' |
17 |
| - /> |
18 |
| - </div> |
19 |
| - <div>Valor Total Líquido: {{ totalAmountDisplay }}</div> |
20 |
| - <v-progress-linear v-model='totalProfitPercentage' :color='color' height='25'> |
21 |
| - {{ totalProfitPercentageDisplay }} |
22 |
| - </v-progress-linear> |
| 5 | + <v-table density="compact"> |
| 6 | + <tbody> |
| 7 | + <tr v-if="hasAmount"> |
| 8 | + <td class="border-0">Valor Investido</td> |
| 9 | + <td class="border-0 text-right"> |
| 10 | + <code>{{ amountDisplay }}</code> |
| 11 | + </td> |
| 12 | + </tr> |
| 13 | + <tr v-if='!!interestAmount'> |
| 14 | + <td class="border-0">Rendimento Bruto</td> |
| 15 | + <td class="border-0 text-right"> |
| 16 | + <code>{{ interestAmountDisplay }}</code> |
| 17 | + </td> |
| 18 | + </tr> |
| 19 | + <tr v-if='!!iofAmount'> |
| 20 | + <td class="border-0">IOF</td> |
| 21 | + <td class="border-0 text-right"> |
| 22 | + <code>{{ iofAmountDisplay }}</code> |
| 23 | + </td> |
| 24 | + </tr> |
| 25 | + <tr> |
| 26 | + <td class="border-0">Imposto de Renda <v-badge |
| 27 | + inline |
| 28 | + v-if='!!taxPercentage' |
| 29 | + :content='taxPercentageDisplay' |
| 30 | + color='red lighten-2' |
| 31 | + /></td> |
| 32 | + <td class="border-0 text-right"> |
| 33 | + <code>{{ taxAmountDisplay }}</code> |
| 34 | + </td> |
| 35 | + </tr> |
| 36 | + <tr> |
| 37 | + <td class="border-0 border-t-sm">Valor Total Líquido</td> |
| 38 | + <td class="border-0 border-t-sm text-right"> |
| 39 | + <code>{{ totalAmountDisplay }}</code> |
| 40 | + </td> |
| 41 | + </tr> |
| 42 | + <tr> |
| 43 | + <td colspan="2"> |
| 44 | + <v-progress-linear v-model='totalProfitPercentage' :color='color' height='25'> |
| 45 | + {{ totalProfitPercentageDisplay }} |
| 46 | + </v-progress-linear> |
| 47 | + </td> |
| 48 | + </tr> |
| 49 | + </tbody> |
| 50 | + </v-table> |
23 | 51 | </v-card-text>
|
24 | 52 | </v-card>
|
25 | 53 | </template>
|
@@ -90,7 +118,7 @@ const totalAmount = computed(() => props.amount + totalProfit.value)
|
90 | 118 | const totalProfitPercentage = computed(() => (totalProfit.value / props.amount) * 100)
|
91 | 119 |
|
92 | 120 | const taxPercentageDisplay = computed(() => filters.percent(props.taxPercentage))
|
93 |
| -const taxAmountDisplay = computed(() => filters.currency(props.taxAmount)) |
| 121 | +const taxAmountDisplay = computed(() => filters.currency((props.taxAmount ? props.taxAmount * -1 : 0))) |
94 | 122 | const amountDisplay = computed(() => filters.currency(props.amount))
|
95 | 123 | const iofAmountDisplay = computed(() => filters.currency(props.iofAmount))
|
96 | 124 | const totalAmountDisplay = computed(() => filters.currency(totalAmount.value))
|
|
0 commit comments