chore: 2026-03-30 store-web 备份
This commit is contained in:
parent
f1f290cd1d
commit
18c2911dcb
|
|
@ -20,23 +20,23 @@
|
|||
<div class="empty-sub">点击上方添加车辆</div>
|
||||
</div>
|
||||
<div v-else class="stats-bar">
|
||||
<div class="stat-item">
|
||||
<div class="stat-item" :class="{ active: currentTab === 'all' }" @click="currentTab = 'all'">
|
||||
<span class="stat-num">{{ list.length }}</span>
|
||||
<span class="stat-label">全部</span>
|
||||
</div>
|
||||
<div class="stat-divider"></div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-item" :class="{ active: currentTab === 'idle' }" @click="currentTab = 'idle'">
|
||||
<span class="stat-num idle">{{ idleCount }}</span>
|
||||
<span class="stat-label">空闲</span>
|
||||
</div>
|
||||
<div class="stat-divider"></div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-item" :class="{ active: currentTab === 'rented' }" @click="currentTab = 'rented'">
|
||||
<span class="stat-num rented">{{ rentedCount }}</span>
|
||||
<span class="stat-label">在租</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-for="item in list" :key="item._id" class="vehicle-card">
|
||||
<div v-for="item in filteredList" :key="item._id" class="vehicle-card">
|
||||
<!-- 卡片头部:车牌 + 状态 -->
|
||||
<div class="card-header">
|
||||
<div class="plate-row">
|
||||
|
|
@ -156,10 +156,17 @@ const showDialog = ref(false)
|
|||
const editingId = ref(null)
|
||||
const form = ref({ frameNumber: '', plateNumber: '', brand: '', vehicleType: '', color: '', batteryType: '' })
|
||||
const vehicleTypes = ref([])
|
||||
const currentTab = ref('all')
|
||||
|
||||
const idleCount = computed(() => list.value.filter(v => !v.isRented).length)
|
||||
const rentedCount = computed(() => list.value.filter(v => v.isRented).length)
|
||||
|
||||
const filteredList = computed(() => {
|
||||
if (currentTab.value === 'idle') return list.value.filter(v => !v.isRented)
|
||||
if (currentTab.value === 'rented') return list.value.filter(v => v.isRented)
|
||||
return list.value
|
||||
})
|
||||
|
||||
const brands = computed(() => {
|
||||
const set = new Set(vehicleTypes.value.map(vt => vt.brand).filter(Boolean))
|
||||
return [...set]
|
||||
|
|
@ -353,6 +360,18 @@ onMounted(() => {
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
cursor: pointer;
|
||||
padding: 4px 0;
|
||||
border-radius: 8px;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.stat-item.active {
|
||||
background: #FFF7F0;
|
||||
}
|
||||
|
||||
.stat-item:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.stat-num {
|
||||
|
|
|
|||
|
|
@ -13,5 +13,15 @@ export default defineConfig({
|
|||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'element-plus': ['element-plus'],
|
||||
'vendor': ['vue', 'vue-router', 'axios']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue