yangfeng
2023-12-04 1f4903411dd41223554e62bc3b134b7ec4d42975
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;
      }
    }
  }