ProductionScheduleOfHeavyParts.vue 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div class="screen-common-component">
  3. <ScreenComHeader :module-id="moduleId" title="关重件生产进度" />
  4. <dv-capsule-chart
  5. :config="config"
  6. class="charts-container"
  7. style="width: calc(100% - 20px)"
  8. />
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import ScreenComHeader from "@/views/screens/configs/screenComHeader.vue";
  13. import { productionSchedule } from "@/api/screens";
  14. import { allChartColors } from "@/views/screens/configs/chartsConfig";
  15. const config = ref({});
  16. const props = defineProps({
  17. moduleId: {
  18. type: String,
  19. required: true,
  20. },
  21. });
  22. onMounted(async () => {
  23. let res = await productionSchedule();
  24. let { data } = res;
  25. let bigData: any[] = [];
  26. data?.forEach((item: any) => {
  27. bigData.push({
  28. name: item.materialName,
  29. value: item.count,
  30. });
  31. });
  32. config.value = {
  33. colors: allChartColors,
  34. data: bigData,
  35. showValue: true,
  36. };
  37. });
  38. </script>