feat ui设计稿

This commit is contained in:
Ironsp
2026-09-30 15:55:36 +08:00
parent ce8210fb3f
commit 9ab6253c81
102 changed files with 4855 additions and 2359 deletions

View File

@@ -39,6 +39,25 @@ function percentOf(value: number): number {
业务类型分布
</h3>
<div class="finance-chart__body">
<!-- 设计 37:横向网格线 + 等宽柱条(柱高按占比换算) -->
<div class="finance-chart__plot">
<div class="finance-chart__grid" aria-hidden="true">
<i class="finance-chart__line" />
<i class="finance-chart__line" />
<i class="finance-chart__line" />
<i class="finance-chart__line" />
<i class="finance-chart__line" />
</div>
<div class="finance-chart__bars">
<span
v-for="item in distribution"
:key="item.name"
class="finance-chart__bar"
:style="{ height: `${Math.max(percentOf(item.value), 6)}%` }"
/>
</div>
</div>
<!-- 数据源色环:设计稿为柱状图,此处仅保留绑定(隐藏)以免游离变量 -->
<div class="finance-chart__pie" :style="{ background: gradient }" />
<ul class="finance-chart__legend">
<li
@@ -59,52 +78,100 @@ function percentOf(value: number): number {
</template>
<style lang="less" scoped>
// 设计 37:白卡 + 蓝色竖条标题(15 设计px → 12px/700)+ 柱状图 + 横排图例
.finance-chart {
padding: @spacing-lg;
border-radius: @radius-lg;
padding: 20px @spacing-lg @spacing-lg;
border-radius: @radius-base;
background: @white;
box-shadow: @shadow-base;
&__title {
position: relative;
padding-left: 10px;
margin-bottom: @spacing-base;
font-size: @font-size-lg;
font-weight: 600;
font-size: 12px;
font-weight: 700;
color: @heading-color;
&::before {
content: '';
position: absolute;
top: 50%;
left: 0;
width: 4px;
height: 14px;
border-radius: @radius-round;
background: @primary-strong;
transform: translateY(-50%);
}
}
&__body {
.flex(row, center, center);
gap: @spacing-xl;
.flex(column, center, center);
gap: @spacing-base;
}
&__plot {
position: relative;
width: 100%;
height: 184px;
}
&__grid {
.flex(column, space-between);
position: absolute;
inset: 0;
}
&__line {
display: block;
width: 100%;
height: 1px;
background: @finance-chart-grid;
}
&__bars {
.flex(row, space-around, flex-end);
position: absolute;
inset: 0;
padding: 0 60px;
}
&__bar {
display: block;
width: 40px;
border-radius: 2px 2px 0 0;
background: @finance-chart-bar;
}
// 设计稿无色环:绑定保留但不参与展示
&__pie {
width: 180px;
height: 180px;
border-radius: @radius-round;
flex-shrink: 0;
display: none;
}
&__legend {
.flex(column, flex-start);
gap: @spacing-base;
.flex(row, center, center);
gap: @spacing-lg;
list-style: none;
padding: 0;
}
&__legend-item {
.flex(row, flex-start, center);
gap: @spacing-sm;
font-size: @font-size-base;
color: @text-color;
gap: 6px;
font-size: 11px;
color: @text-color-secondary;
}
&__dot {
width: 10px;
height: 10px;
width: 8px;
height: 8px;
border-radius: @radius-round;
flex-shrink: 0;
}
&__name {
min-width: 72px;
min-width: 0;
}
&__value {