From cd388c78650efe85fe4dd41cc439208d58ab6c29 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 05 十二月 2023 16:19:55 +0800 Subject: [PATCH] 接口轮训时 设备负荷对比柱状图 动画问题修改 --- src/views/cockpitPage/components/OrderCompleteRadio.vue | 58 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/views/cockpitPage/components/OrderCompleteRadio.vue b/src/views/cockpitPage/components/OrderCompleteRadio.vue index 11066c7..5993877 100644 --- a/src/views/cockpitPage/components/OrderCompleteRadio.vue +++ b/src/views/cockpitPage/components/OrderCompleteRadio.vue @@ -29,19 +29,52 @@ components: { ChartTitle, }, - props: {}, + props: { + orderCompleteObject: { + type: Object, + default: () => { + return { + startIndex: 0, + orderCompleteList: [], + }; + }, + }, + }, data() { return { - tableList: [ - { title: "DD19070047", radio: 50.6 }, - { title: "DD19070048", radio: 89 }, - { title: "DD19070049", radio: 100 }, - { title: "DD19070050", radio: 30 }, - ], + startIndex: 0, + time: 0, }; }, - mounted() {}, - watch: {}, + mounted() { + setInterval(() => { + this.startIndex += 4; + }, 5000); + }, + computed: { + tableList: { + get() { + if ( + this.startIndex > this.orderCompleteObject.orderCompleteList.length + ) { + this.startIndex = 0; + } + return this.orderCompleteObject.orderCompleteList.slice( + this.startIndex, + this.startIndex + 4 + ); + }, + // set(val) { + // console.log(val); + // }, + }, + }, + watch: { + "orderCompleteObject.orderCompleteList"(val) { + // console.log(val, "ssssssssss"); + this.startIndex = this.orderCompleteObject.startIndex; + }, + }, methods: {}, }; </script> @@ -66,13 +99,16 @@ border-radius: 50px; transition: all 1s ease-in-out 0s; .left { - width: 20%; + width: 23%; margin: 0 10px; color: #02f1fc; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .middle { flex: 1; - margin: 0 10px; + margin-right: 5px; } } } -- Gitblit v1.8.0