feat:增加vant组件库

This commit is contained in:
2026-02-12 17:27:14 +08:00
parent 1b8bd5a7e2
commit 8940b3972a
29 changed files with 241 additions and 269 deletions

View File

@@ -9,12 +9,11 @@
:key="index" :date-item="item" />
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script setup lang="ts">
import DraggableButton from '@/components/Common/DraggableButton.vue'
import AnniversaryQuery from '@/components/Anniversary/AnniversaryQuery.vue'
import AnniversaryCard from '@/components/Anniversary/AnniversaryCard.vue'
import { useAnniversaryStore } from '@/store/anniversary.ts'

View File

@@ -14,14 +14,13 @@
:key="index" :item="item"/>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script setup lang="ts">
import AssetQuery from '@/components/Asset/AssetQuery.vue'
import AssetCard from '@/components/Asset/AssetCard.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useAssetStore } from '@/store/asset.ts'
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'

View File

@@ -4,8 +4,7 @@
<bill-daily-list v-if="billStore.billDateType === 'year'"/>
<bill-calendar v-if="billStore.billDateType === 'month'" />
<el-button type="primary" :icon="Plus" circle size="large"
@click="addNewBillRecordClick" class="add-new" />
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
@@ -15,7 +14,6 @@ import BillCalendar from '@/components/Bill/BillCalendar.vue'
import BillDailyList from '@/components/Bill/BillDailyList.vue'
import { onMounted } from 'vue'
import { useBillStore } from '@/store/bill.ts'
import { Plus } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
import { getCurrentMonth, getCurrentYear } from 'vue3-common/utils/dateUtil'
@@ -41,7 +39,7 @@ onMounted(async () => {
await billStore.refreshInfo()
})
const addNewBillRecordClick = () => {
const addClick = () => {
billStore.billApiType = 'ADD'
billStore.currentBillRecord = billStore.getEmptyBillRecord()
router.push({ name: 'BillDetailId', params: { id: 0 } })

View File

@@ -11,7 +11,7 @@
</div>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
<arrive-bottom v-if="foodStore.isScrollEnd"/>
</div>
@@ -23,7 +23,6 @@ import FoodCard from '@/components/Food/FoodCard.vue'
import ArriveBottom from '@/components/Common/ArriveButton.vue'
import { useFoodStore } from '@/store/food.ts'
import { onBeforeUnmount, onMounted, ref } from 'vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useRouter } from 'vue-router'
const foodRecipeRef = ref()

View File

@@ -4,14 +4,13 @@
<food-calendar />
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import FoodStats from '@/components/Food/FoodStats.vue'
import FoodCalendar from '@/components/Food/FoodCalendar.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useRouter } from 'vue-router'
import { useFoodStore } from '@/store/food.ts'
import { onMounted } from 'vue'

View File

@@ -2,13 +2,12 @@
<div class="mobile-journal-view common-mobile-view">
<journal-calendar />
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import JournalCalendar from '@/components/Journal/JournalCalendar.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useJournalStore } from '@/store/journal.ts'
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'

View File

@@ -7,13 +7,12 @@
<kpi-calendar />
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import KpiCalendar from '@/components/kpi/KpiCalendar.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useKpiStore } from '@/store/kpi.ts'
import { useRouter } from 'vue-router'
import { computed, onMounted } from 'vue'

View File

@@ -14,14 +14,13 @@
:key="index" :item="item"/>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script setup lang="ts">
import LedgerQuery from '@/components/Ledger/LedgerQuery.vue'
import LedgerCard from '@/components/Ledger/LedgerCard.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useLedgerStore } from '@/store/ledger.ts'
import { useRouter } from 'vue-router'
import { formatAmount } from 'vue3-common/utils/numberUtil'

View File

@@ -1,7 +1,8 @@
<template>
<div class="mobile-password-detail common-mobile-view">
<el-form ref="formRef" :model="passwordStore.currentPassword"
:rules="rules" label-width="70px">
:rules="rules" label-position="top" label-width="70px"
class="form-item">
<el-form-item label="标题" prop="title">
<el-input v-model="passwordStore.currentPassword.title" autocomplete="off"
placeholder="请输入标题" clearable
@@ -63,6 +64,8 @@
<div class="button-container">
<el-button type="primary" @click="confirmClick">确认</el-button>
<el-button v-if="passwordStore.passwordApiType === 'UPDATE'"
type="danger" @click="deleteClick">删除</el-button>
<el-button type="info" @click="cancelClick">取消</el-button>
</div>
</div>
@@ -74,6 +77,8 @@ import { useAppStore } from '@/store/app.ts'
import { FormRules } from 'element-plus'
import { passwordRules } from '@/utils/element/elRules.ts'
import { onMounted, reactive, ref } from 'vue'
import { IPassword } from '@/types/password.ts'
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
const formRef = ref()
const rules = reactive<FormRules>(passwordRules)
@@ -95,6 +100,13 @@ const confirmClick = () => {
})
}
const deleteClick = () => {
commonElMessageBox(`请确认是否删除该密码记录: ${passwordStore.currentPassword.title}?`).then(() => {
passwordStore.passwordApiType = 'DELETE'
passwordStore.handlePasswordApi(passwordStore.currentPassword)
})
}
const cancelClick = () => {
history.back()
appStore.isShowMobileBack = false

View File

@@ -9,12 +9,11 @@
:key="index" :password-item="item"/>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import DraggableButton from '@/components/Common/DraggableButton.vue'
import PasswordQuery from '@/components/Password/PasswordQuery.vue'
import PasswordCard from '@/components/Password/PasswordCard.vue'
import { usePasswordStore } from '@/store/password.ts'

View File

@@ -9,12 +9,11 @@
:key="index" :product-item="item"/>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import DraggableButton from '@/components/Common/DraggableButton.vue'
import ProductQuery from '@/components/Product/ProductQuery.vue'
import ProductCard from '@/components/Product/ProductCard.vue'
import { useProductStore } from '@/store/product.ts'

View File

@@ -4,14 +4,13 @@
<travel-calendar />
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
</div>
</template>
<script lang="ts" setup>
import TravelStats from '@/components/Travel/TravelStats.vue'
import TravelCalendar from '@/components/Travel/TravelCalendar.vue'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useTravelStore } from '@/store/travel.ts'
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'

View File

@@ -11,7 +11,7 @@
</div>
</div>
<draggable-button @click="addClick"/>
<van-floating-bubble icon="plus" @click="addClick" style="top: -60px;"/>
<arrive-bottom v-if="travelStore.isScrollEnd"/>
</div>
@@ -23,7 +23,6 @@ import ArriveBottom from '@/components/Common/ArriveButton.vue'
import { onBeforeUnmount, onMounted, ref } from 'vue'
import TravelCard from '@/components/Travel/TravelCard.vue'
import { useTravelStore } from '@/store/travel.ts'
import DraggableButton from '@/components/Common/DraggableButton.vue'
import { useRouter } from 'vue-router'
const travelStore = useTravelStore()