diff --git a/Web/src/components/Budget/BudgetCard.vue b/Web/src/components/Budget/BudgetCard.vue index 28faa58..e563bd3 100644 --- a/Web/src/components/Budget/BudgetCard.vue +++ b/Web/src/components/Budget/BudgetCard.vue @@ -12,7 +12,7 @@ plain class="status-tag" > - {{ budget.type === BudgetPeriodType.Year ? '年度预算' : '月度预算' }} + {{ budget.type === BudgetPeriodType.Year ? '年度' : '月度' }} @@ -92,6 +92,7 @@ plain size="small" style="width: 50px;" + :disabled="isNextDisabled" @click="handleSwitch(1)" /> @@ -130,6 +131,11 @@ const emit = defineEmits(['toggle-stop', 'switch-period', 'click']) const transitionName = ref('slide-left') const showDescription = ref(false) +const isNextDisabled = computed(() => { + if (!props.budget.periodEnd) return false + return new Date(props.budget.periodEnd) > new Date() +}) + const handleSwitch = (direction) => { transitionName.value = direction > 0 ? 'slide-left' : 'slide-right' emit('switch-period', direction) diff --git a/Web/src/components/Budget/BudgetEditPopup.vue b/Web/src/components/Budget/BudgetEditPopup.vue index 11b6b12..e76ed0f 100644 --- a/Web/src/components/Budget/BudgetEditPopup.vue +++ b/Web/src/components/Budget/BudgetEditPopup.vue @@ -16,7 +16,11 @@ />