Add abilty to switch to edit mode

This commit is contained in:
2022-02-25 20:37:31 +00:00
parent 1e80ba6ca8
commit 97be5abc8c
2 changed files with 67 additions and 4 deletions

View File

@@ -1,19 +1,22 @@
<script lang="ts" setup>
import { computed } from "vue";
import { computed, ref } from "vue";
import { useBudgetsStore } from "../stores/budget";
import { Transaction } from "../stores/budget-account";
import Currency from "./Currency.vue";
import TransactionEditRow from "./TransactionEditRow.vue";
const props = defineProps<{
transaction: Transaction,
index: number,
}>();
const edit = ref(false);
const CurrentBudgetID = computed(()=> useBudgetsStore().CurrentBudgetID);
</script>
<template>
<tr class="{{transaction.Date.After now ? 'future' : ''}}"
<tr v-if="!edit" class="{{new Date(transaction.Date) > new Date() ? 'future' : ''}}"
:class="[index % 6 < 3 ? 'bg-gray-300' : 'bg-gray-100']">
<!--:class="[index % 6 < 3 ? index % 6 === 1 ? 'bg-gray-400' : 'bg-gray-300' : index % 6 !== 4 ? 'bg-gray-100' : '']">-->
<td style="width: 90px;">{{ transaction.Date.substring(0, 10) }}</td>
@@ -32,8 +35,9 @@ const CurrentBudgetID = computed(()=> useBudgetsStore().CurrentBudgetID);
<td style="width: 20px;">
{{ transaction.Status == "Reconciled" ? "✔" : (transaction.Status == "Uncleared" ? "" : "*") }}
</td>
<td style="width: 20px;">{{ transaction.GroupID ? "☀" : "" }}</td>
<td style="width: 20px;" class="text-right">{{ transaction.GroupID ? "☀" : "" }}<a @click="edit = true;"></a></td>
</tr>
<TransactionEditRow v-if="edit" :transaction="transaction" />
</template>
<style>