|
@@ -1,42 +1,121 @@
|
|
|
<script setup>
|
|
|
+import { NNumberAnimation } from 'naive-ui';
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
direction: {
|
|
|
type: String,
|
|
|
},
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ unit: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ value: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="number-panel-container space-y-[6px]">
|
|
|
- <div :class="['number-panel-inner', 'direction-' + direction ]"></div>
|
|
|
+ <div :class="['number-panel-container', 'space-y-[6px]', direction]">
|
|
|
+ <div :class="['number-panel-inner', 'direction-' + direction ]">
|
|
|
+ <span class="number">
|
|
|
+ <NNumberAnimation :from="0" :to="value" :duration="1000" :precision="0"></NNumberAnimation>
|
|
|
+ </span>
|
|
|
+ <span class="unit" v-if="unit">mg/L</span>
|
|
|
+ </div>
|
|
|
<div class="sub-title">
|
|
|
- <span>智能控制系数</span>
|
|
|
+ <span>{{ title }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
|
|
|
-<style lang="scss">
|
|
|
+<style lang="scss" scoped>
|
|
|
.number-panel-container {
|
|
|
width: 194px;
|
|
|
- background: #ccc;
|
|
|
|
|
|
.number-panel-inner {
|
|
|
+ position: relative;
|
|
|
width: 140px;
|
|
|
height: 164px;
|
|
|
+
|
|
|
+ .number {
|
|
|
+ position: absolute;
|
|
|
+ color: #1A2029;
|
|
|
+ font-family: "DIN Alternate";
|
|
|
+ font-size: 52px;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.sub-title {
|
|
|
width: 100%;
|
|
|
- padding-right: 20px;
|
|
|
text-align: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
}
|
|
|
|
|
|
.direction-left {
|
|
|
background: url("@/assets/images/control/line-left-1.svg") left center no-repeat,
|
|
|
url("@/assets/images/control/line-left-2.svg") right bottom no-repeat,
|
|
|
- url("@/assets/images/control/line-left-3.svg") right bottom no-repeat;
|
|
|
- // background: red;
|
|
|
+ url("@/assets/images/control/line-left-3.svg") right 159px no-repeat,
|
|
|
+ url("@/assets/images/control/line-left-4.png") 10px -4px no-repeat;
|
|
|
+ background-size: auto auto, auto auto, auto auto, 100% 110%;
|
|
|
+
|
|
|
+ .number {
|
|
|
+ top: 30px;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-title {
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .direction-right {
|
|
|
+ background: url("@/assets/images/control/line-right-1.svg") right center no-repeat,
|
|
|
+ url("@/assets/images/control/line-right-2.svg") left bottom no-repeat,
|
|
|
+ url("@/assets/images/control/line-right-3.svg") left 158px no-repeat,
|
|
|
+ url("@/assets/images/control/line-right-4.png") 10px -4px no-repeat;
|
|
|
+ background-size: auto auto, auto auto, auto auto, 100% 110%;
|
|
|
+
|
|
|
+ .number {
|
|
|
+ top: 30px;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .unit {
|
|
|
+ position: absolute;
|
|
|
+ top: 96px;
|
|
|
+ left: 4px;
|
|
|
+ color: #000;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.left {
|
|
|
+ .sub-title {
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.right {
|
|
|
+ display: flex;
|
|
|
+ flex-flow: column;
|
|
|
+ align-items: flex-end;
|
|
|
+ .sub-title {
|
|
|
+ padding-left: 30px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|