驾驶舱

This commit is contained in:
‘937886381’
2024-05-11 16:40:29 +08:00
parent 6b2c0ebec3
commit 56e011c179
15 changed files with 1100 additions and 283 deletions

View File

@@ -6,11 +6,8 @@
-->
<template>
<div class="progress-bar" :data-title="title" :data-rate="dataRate">
<div
class="progress-bar__rate"
:style="{ width: dataRate == '-' ? 0 : dataRate }"
></div>
<div class="progress-bar" :data-title="titleYear" :data-rate="number">
<div class="progress-bar__rate" :style="{ width: dataRate == '-' ? 0 : dataRate }"></div>
</div>
</template>
@@ -23,23 +20,52 @@ export default {
type: Number,
default: 0,
},
total: {
target: {
type: Number,
default: 0,
},
goodNumber: {
type: Number,
default:0
},
componentYield: {
type: Number,
default:0
},
period: {
type: String,
default:'日',
},
title: {
type: String,
default: "",
},
city: {
type: String,
default:""
}
},
data() {
return {};
return {
number: 0,
titleYear:'',
};
},
computed: {
dataRate() {
return this.total == 0
if ((this.period === '年' || this.period === '月') && this.target != 0) {
// console.log(this.componentYield)
this.titleYear = this.title + ' ' + `${(this.target * 100).toFixed(0)}%`
} else {
this.titleYear = this.title
}
this.number = this.value == 0
? "-"
: `${(parseFloat(this.value / this.total) * 100).toFixed(0)}%`;
: `${(this.value * 100).toFixed(0)}%`
// console.log(this.period)
return this.value == 0
? "-"
: this.value >1 ? 100 + '%' :`${(this.value * 100).toFixed(0)}%`
},
},
methods: {},
@@ -69,7 +95,7 @@ export default {
color: #fff;
position: absolute;
bottom: -200%;
right: 0;
right: 10px;
font-size: 12px;
}