BanZuChuQinTongJi.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="screen-common-component">
  3. <ScreenComHeader :module-id="moduleId" title="班组出勤统计" />
  4. <dv-scroll-board
  5. :config="config"
  6. style="width: 100%; height: calc(100% - 32px)"
  7. @mouseover="tableHover"
  8. />
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import ScreenComHeader from "@/views/screens/configs/screenComHeader.vue";
  13. import { productionPlan, teamAttendance } from "@/api/screens";
  14. const config = ref({});
  15. const props = defineProps({
  16. moduleId: {
  17. type: String,
  18. required: true,
  19. },
  20. });
  21. const bigScreenData: any = inject("bigScreenData");
  22. onMounted(async () => {
  23. let res = await teamAttendance();
  24. if (res.data.length > 0) {
  25. let dicts = {
  26. deptName: `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>班组名称</span>`,
  27. deptNum: `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>班组人数</span>`,
  28. answerNum: `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>应出勤人数</span>`,
  29. practicalNum: `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>实际出勤人数</span>`,
  30. attendanceRate: `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>出勤率</span>`,
  31. };
  32. let bigData: any[] = [];
  33. res.data.forEach((item: any) => {
  34. let row = [
  35. `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>${item.deptName}</span>`,
  36. `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>${item.deptNum}</span>`,
  37. `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>${item.answerNum}</span>`,
  38. `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>${item.practicalNum}</span>`,
  39. `<span style='font-size:${bigScreenData.value.fontSize * 1.5}px'>${item.attendanceRate}%</span>`,
  40. ];
  41. bigData.push(row);
  42. });
  43. config.value = {
  44. header: Object.values(dicts),
  45. data: bigData,
  46. // index: true,
  47. // columnWidth: [80, 80, 95, 110, 80],
  48. align: ["left"],
  49. carousel: "page",
  50. click: (row: any, index: number) => {
  51. console.log("mouseover", row, index);
  52. },
  53. };
  54. }
  55. });
  56. const tableHover = (data: any) => {
  57. // console.log("mouseover", data.row[data.columnIndex]);
  58. };
  59. </script>