|
|
@@ -19,7 +19,7 @@
|
|
|
</svg>
|
|
|
</div>
|
|
|
<div class="chem-stat-info">
|
|
|
- <div class="chem-stat-value" style="color:#48d7ff">{{ formatNum(stats.totalAmount) }}<span class="unit"> L</span></div>
|
|
|
+ <div class="chem-stat-value" style="color:#48d7ff">{{ formatNum(stats.totalAmount) }}<span class="unit"> {{ stats.unit }}</span></div>
|
|
|
<div class="chem-stat-label">存量化学品总量</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -62,7 +62,7 @@
|
|
|
|
|
|
<!-- 右下:类目统计 -->
|
|
|
<div class="chem-stat-item item-center">
|
|
|
- <div class="chem-stat-value" style="color:#ffb020;font-size:28px;">{{ stats.totalCategories }}</div>
|
|
|
+ <div class="chem-stat-value" style="color:#ffb020;font-size:22px;">{{ stats.totalCategories }}</div>
|
|
|
<div class="chem-stat-label">存量化学品总类目</div>
|
|
|
<div class="chem-stat-sub">管控{{ stats.controlledCategories }}类 / 非管控{{ stats.uncontrolledCategories }}类</div>
|
|
|
</div>
|
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
stats: {
|
|
|
- totalAmount: 0, controlledAmount: 0, uncontrolledAmount: 0,
|
|
|
+ totalAmount: 0, unit: 'L', controlledAmount: 0, uncontrolledAmount: 0,
|
|
|
totalCategories: 0, controlledCategories: 0, uncontrolledCategories: 0
|
|
|
},
|
|
|
controlledPct: 0,
|
|
|
@@ -105,16 +105,16 @@ export default {
|
|
|
try {
|
|
|
const d = await getChemicalStats()
|
|
|
this.stats = {
|
|
|
- totalAmount: d.totalAmount || 0,
|
|
|
- controlledAmount: d.controlledAmount || 0,
|
|
|
- uncontrolledAmount: d.uncontrolledAmount || 0,
|
|
|
- totalCategories: d.totalCategories || 0,
|
|
|
- controlledCategories: d.controlledCategories || 0,
|
|
|
- uncontrolledCategories: d.uncontrolledCategories || 0
|
|
|
+ totalAmount: d.totalSurplus || 0,
|
|
|
+ unit: d.totalUnit || 'L',
|
|
|
+ controlledAmount: d.controlledSurplus || 0,
|
|
|
+ uncontrolledAmount: d.uncontrolledSurplus || 0,
|
|
|
+ totalCategories: d.totalCategoryCount || 0,
|
|
|
+ controlledCategories: d.controlledCategoryCount || 0,
|
|
|
+ uncontrolledCategories: d.uncontrolledCategoryCount || 0
|
|
|
}
|
|
|
- const total = this.stats.totalAmount || 1
|
|
|
- this.controlledPct = Math.round(this.stats.controlledAmount / total * 1000) / 10
|
|
|
- this.uncontrolledPct = Math.round(this.stats.uncontrolledAmount / total * 1000) / 10
|
|
|
+ this.controlledPct = d.controlledPercent || 0
|
|
|
+ this.uncontrolledPct = d.uncontrolledPercent || 0
|
|
|
} catch (e) {
|
|
|
console.error('ChemicalsStats:', e)
|
|
|
}
|
|
|
@@ -151,7 +151,6 @@ export default {
|
|
|
border-radius: 6px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- padding: 0 14px;
|
|
|
gap: 12px;
|
|
|
overflow: hidden;
|
|
|
|
|
|
@@ -168,7 +167,7 @@ export default {
|
|
|
flex-shrink: 0;
|
|
|
width: 52px;
|
|
|
height: 52px;
|
|
|
-
|
|
|
+ margin-left:14px;
|
|
|
svg { width: 100%; height: 100%; }
|
|
|
}
|
|
|
|
|
|
@@ -199,25 +198,25 @@ export default {
|
|
|
}
|
|
|
|
|
|
.chem-stat-value {
|
|
|
- font-size: 22px;
|
|
|
+ font-size: 16px;
|
|
|
font-weight: 700;
|
|
|
line-height: 1;
|
|
|
letter-spacing: 1px;
|
|
|
|
|
|
.unit {
|
|
|
- font-size: 11px;
|
|
|
+ font-size: 12px;
|
|
|
font-weight: 400;
|
|
|
color: #7eacc8;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.chem-stat-label {
|
|
|
- font-size: 11px;
|
|
|
+ font-size: 12px;
|
|
|
color: #7eacc8;
|
|
|
}
|
|
|
|
|
|
.chem-stat-sub {
|
|
|
- font-size: 10px;
|
|
|
+ font-size: 14px;
|
|
|
color: rgba(126, 172, 200, 0.65);
|
|
|
}
|
|
|
</style>
|