right-center.vue 915 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="right_bottom">
  3. <CapsuleChart
  4. :config="config"
  5. style="width: 100%; height: 260px"
  6. :data="data"
  7. />
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { ref, reactive, onMounted } from "vue";
  12. import CapsuleChart from "@/components/datav/capsule-chart";
  13. import { currentGET } from "@/api";
  14. import signalR from "@/utils/signalR";
  15. const config = ref({
  16. showValue: true,
  17. unit: "次",
  18. });
  19. const data = ref([]);
  20. const getData = () => {
  21. currentGET("rightCenter").then((res) => {
  22. console.log("报警排名", res);
  23. if (res.success) {
  24. data.value = res.data;
  25. } else {
  26. window["$message"]({
  27. text: res.msg,
  28. type: "warning",
  29. });
  30. }
  31. });
  32. };
  33. onMounted(() => {
  34. getData();
  35. signalR.joinGroup("BsDataShowArea7");
  36. });
  37. </script>
  38. <style scoped lang="scss">
  39. .right_bottom {
  40. box-sizing: border-box;
  41. padding: 0 16px;
  42. }
  43. </style>