chore(mobile-h5): add existing H5 app sources to the monorepo
Track the weighbridge mobile-h5 codebase (excluding node_modules, dist, and local .env) so subsequent adaptation tasks can evolve it in-repo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f8f9c0ceff
commit
a4b13fa2bc
91 files changed
+15791
No files matched your search
@@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-header">
|
||||
<span class="chart-title">{{ title }}</span>
|
||||
<div class="legend">
|
||||
<span class="legend-item">
|
||||
<span class="legend-color planned"></span>
|
||||
计划量
|
||||
</span>
|
||||
<span class="legend-item">
|
||||
<span class="legend-color actual"></span>
|
||||
实际量
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="data.length === 0" class="chart-empty">
|
||||
<van-empty description="今日无数据" />
|
||||
</div>
|
||||
<div v-else class="chart-container">
|
||||
<div v-for="item in data" :key="item.label" class="chart-item">
|
||||
<span class="chart-label">{{ item.label }}</span>
|
||||
<div class="chart-bar-group">
|
||||
<div class="chart-bar-wrapper">
|
||||
<div
|
||||
class="chart-bar planned"
|
||||
:style="{
|
||||
width: maxValue ? (item.planned / maxValue) * 100 + '%' : '0%',
|
||||
minWidth: '4px'
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="chart-bar-wrapper">
|
||||
<div
|
||||
class="chart-bar actual"
|
||||
:style="{
|
||||
width: maxValue ? (item.actual / maxValue) * 100 + '%' : '0%',
|
||||
minWidth: '4px'
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart-values">
|
||||
<span class="value planned">{{ item.planned.toFixed(2) }}</span>
|
||||
<span class="value actual">{{ item.actual.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
interface DualBarItem {
|
||||
label: string
|
||||
planned: number
|
||||
actual: number
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
data: DualBarItem[]
|
||||
}>()
|
||||
|
||||
const maxValue = computed(() => {
|
||||
if (!props.data.length) return 0
|
||||
const maxPlanned = Math.max(...props.data.map((item) => item.planned))
|
||||
const maxActual = Math.max(...props.data.map((item) => item.actual))
|
||||
return Math.max(maxPlanned, maxActual) || 0
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.chart-card {
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.chart-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.chart-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.legend {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&-color {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 2px;
|
||||
|
||||
&.planned {
|
||||
background: #1677ff;
|
||||
}
|
||||
|
||||
&.actual {
|
||||
background: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chart-empty {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.chart-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chart-label {
|
||||
min-width: 70px;
|
||||
font-size: 13px;
|
||||
color: #111827;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.chart-bar-group {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.chart-bar-wrapper {
|
||||
background: #f3f4f6;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.chart-bar {
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
transition: width 0.3s ease;
|
||||
|
||||
&.planned {
|
||||
background: linear-gradient(90deg, #1677ff 0%, #4096ff 100%);
|
||||
}
|
||||
|
||||
&.actual {
|
||||
background: linear-gradient(90deg, #52c41a 0%, #73d13d 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.chart-values {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
min-width: 80px;
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
flex-shrink: 0;
|
||||
|
||||
.value {
|
||||
&.planned {
|
||||
color: #1677ff;
|
||||
}
|
||||
|
||||
&.actual {
|
||||
color: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-header">
|
||||
<span class="chart-title">{{ title }}</span>
|
||||
</div>
|
||||
<div v-if="data.length === 0" class="chart-empty">
|
||||
<van-empty description="今日无数据" />
|
||||
</div>
|
||||
<div v-else class="chart-container">
|
||||
<div v-for="item in data" :key="item.label" class="chart-item">
|
||||
<span class="chart-label">{{ item.label }}</span>
|
||||
<div class="chart-bar-wrapper">
|
||||
<div
|
||||
class="chart-bar"
|
||||
:style="{
|
||||
width: maxValue ? (item.value / maxValue) * 100 + '%' : '0%',
|
||||
minWidth: '4px'
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<span class="chart-value">{{ item.value.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
interface SimpleBarItem {
|
||||
label: string
|
||||
value: number
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
data: SimpleBarItem[]
|
||||
}>()
|
||||
|
||||
const maxValue = computed(() =>
|
||||
props.data.length ? Math.max(...props.data.map((item) => item.value)) : 0
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.chart-card {
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.chart-header {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.chart-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.chart-empty {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.chart-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chart-label {
|
||||
min-width: 80px;
|
||||
font-size: 14px;
|
||||
color: #111827;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.chart-bar-wrapper {
|
||||
flex: 1;
|
||||
background: #f3f4f6;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.chart-bar {
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(90deg, #1677ff 0%, #4096ff 100%);
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.chart-value {
|
||||
min-width: 60px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #111827;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in new issue
Block a user