|
@@ -90,103 +90,29 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { count, alarm } from "@/api/system/datav";
|
|
|
+import { alarm } from "@/api/system/datav";
|
|
|
export default {
|
|
|
name: "LeftChart1",
|
|
|
data() {
|
|
|
return {
|
|
|
config: {
|
|
|
- // data: [
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '收费系统',
|
|
|
- // value: 167
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '通信系统',
|
|
|
- // value: 67
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '监控系统',
|
|
|
- // value: 123
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '供配系统',
|
|
|
- // value: 55
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '其他',
|
|
|
- // value: 98
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label:222,
|
|
|
- // name: '其他',
|
|
|
- // value: 98
|
|
|
- // },
|
|
|
- // ],
|
|
|
colors: ["#00baff", "#3de7c9", "#fff", "#ffc530", "#469f4b"],
|
|
|
unit: "件",
|
|
|
},
|
|
|
number: null,
|
|
|
data: {},
|
|
|
- config1: {},
|
|
|
- currentValue:0,
|
|
|
- digits: [0, 0, 0],
|
|
|
- animationInterval: null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initData();
|
|
|
- // this.flipToValue(this.number); // 初始化显示数字
|
|
|
- // this.startAnimation()
|
|
|
},
|
|
|
methods: {
|
|
|
- async initData() {
|
|
|
- await count().then((res) => {
|
|
|
- console.log(res, 999);
|
|
|
- this.number = res.data;
|
|
|
- });
|
|
|
+ initData() {
|
|
|
alarm().then((res) => {
|
|
|
console.log(res, 444);
|
|
|
this.data = res.data;
|
|
|
});
|
|
|
- this.config1 = {
|
|
|
- number: [this.number],
|
|
|
- content: String(this.number),
|
|
|
- // animationFrame:10
|
|
|
- };
|
|
|
- console.log(typeof String(this.number),777);
|
|
|
},
|
|
|
- // startAnimation() {
|
|
|
- // this.animationInterval = setInterval(() => {
|
|
|
- // const increment = this.number > this.currentValue ? 1 : -1;
|
|
|
- // this.currentValue += increment;
|
|
|
- // console.log(this.currentValue, increment,4545444);
|
|
|
- // this.flipToValue(this.currentValue);
|
|
|
- // // this.number = this.currentValue
|
|
|
-
|
|
|
- // if (this.currentValue === this.number) {
|
|
|
- // clearInterval(this.animationInterval);
|
|
|
- // setTimeout(() => {
|
|
|
- // this.currentValue = 0; // 重置当前值
|
|
|
- // this.startAnimation(); // 开始新一轮动画
|
|
|
- // }, 5000); // 5秒后重新开始
|
|
|
- // }
|
|
|
- // }, 50);
|
|
|
- // },
|
|
|
- // updateDigit(index, value) {
|
|
|
- // this.$set(this.digits, index, value);
|
|
|
- // },
|
|
|
- // flipToValue(value) {
|
|
|
- // const valueStr = String(value).padStart(3, '0');
|
|
|
- // for (let i = 0; i < 3; i++) {
|
|
|
- // this.updateDigit(i, Number(valueStr[i]));
|
|
|
- // }
|
|
|
- // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|