From 846bb33d3243871c3dc4226e3c054bedc8a71660 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 26 九月 2025 14:01:17 +0800
Subject: [PATCH] 生产订单页面开发联调
---
src/components/geek-xd/components/geek-statistic/geek-statistic.vue | 84 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/src/components/geek-xd/components/geek-statistic/geek-statistic.vue b/src/components/geek-xd/components/geek-statistic/geek-statistic.vue
new file mode 100644
index 0000000..dc8ac3f
--- /dev/null
+++ b/src/components/geek-xd/components/geek-statistic/geek-statistic.vue
@@ -0,0 +1,84 @@
+<template>
+ <view :style="labelStyle" class="title">{{ label }}</view>
+ <view :style="numberStyle" class="number">{{ formatNumber(number,props.place) }}</view>
+</template>
+
+<script setup>
+import { computed } from 'vue';
+
+const props = defineProps({
+ label: {
+ type: String,
+ default: "璁㈠崟鏁伴噺"
+ },
+ width: {
+ type: Number,
+ default: 300
+ },
+ labelColor: {
+ type: String,
+ default: '#white'
+ },
+ labelSize: {
+ type: Number,
+ default: 16
+ },
+ number: {
+ type: Number,
+ default: 80
+ },
+ numberColor: {
+ type: String,
+ default: 'red'
+ },
+ numberSize: {
+ type: Number,
+ default: 20
+ },
+ place: {
+ type: Number,
+ default: 2
+ }
+})
+const labelStyle = computed(() => {
+ return {
+ width: `${props.width}rpx`,
+ color: props.labelColor,
+ fontSize: `${props.labelSize}px`
+ }
+})
+
+const numberStyle = computed(() => {
+ return {
+ width: `${props.width}rpx`,
+ color: props.numberColor,
+ fontSize: `${props.numberSize}px`
+ }
+})
+
+function formatNumber(num,place) {
+
+ let fixedNum = Number(num).toFixed(place); // 灏嗘暟瀛椾繚鐣欎袱浣嶅皬鏁�
+ let parts = fixedNum.split('.'); // 鎷嗗垎鏁存暟閮ㄥ垎鍜屽皬鏁伴儴鍒�
+ let integerPart = parts[0]; // 鏁存暟閮ㄥ垎
+ let decimalPart = parts[1]; // 灏忔暟閮ㄥ垎
+
+ // 浣跨敤padStart鏂规硶琛�0鍒板皬鏁伴儴鍒�
+ decimalPart = decimalPart.padStart(place, '0');
+
+ return integerPart + '.' + decimalPart;
+}
+
+
+</script>
+
+<style lang="scss" scoped>
+.title {
+ text-align: center;
+}
+
+.number {
+ text-align: center;
+}
+</style>
+
\ No newline at end of file
--
Gitblit v1.9.3