From 93d04e35d6ff02470687b73ff7494b62bdc85f2c Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 06 十二月 2023 16:32:38 +0800 Subject: [PATCH] 页面背景图及饼图显示优化 --- src/views/cockpitPage/components/OrderCompleteRadio.vue | 54 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/views/cockpitPage/components/OrderCompleteRadio.vue b/src/views/cockpitPage/components/OrderCompleteRadio.vue index 11066c7..9d447b0 100644 --- a/src/views/cockpitPage/components/OrderCompleteRadio.vue +++ b/src/views/cockpitPage/components/OrderCompleteRadio.vue @@ -29,19 +29,48 @@ 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 + ); + }, + }, + }, + watch: { + "orderCompleteObject.orderCompleteList"(val) { + this.startIndex = this.orderCompleteObject.startIndex; + }, + }, methods: {}, }; </script> @@ -66,13 +95,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