fault.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <script setup lang="ts">
  2. import configs from "@@/config"
  3. import VbCommonReport from "@@@/reports/VbCommonReport.vue"
  4. import apis from "@a"
  5. const opts = reactive({
  6. title: "设备故障统计报表",
  7. cycleType: "M",
  8. columns: [
  9. {
  10. field: configs.TABLE_INDEX_FIELD,
  11. name: "序号",
  12. width: 40,
  13. visible: true,
  14. tooltip: true
  15. },
  16. { field: "deviceName", name: "设备名称", width: 120, tooltip: true },
  17. { field: "failureDuration", name: "故障时长(时)", width: 120, isSort: true, tooltip: true },
  18. { field: "sickDuration", name: "带病时长(时)", width: 120, isSort: true, tooltip: true },
  19. { field: "goodDuration", name: "完好时长(时)", width: 120, isSort: true, tooltip: true }
  20. ],
  21. searchItems: [
  22. {
  23. field: "deviceName",
  24. label: "设备名称",
  25. class: "w-100",
  26. required: false,
  27. placeholder: "请输入设备名称",
  28. component: "I",
  29. props: {
  30. clearable: true
  31. }
  32. }
  33. ] as any[],
  34. queryParams: {
  35. deviceName: undefined
  36. },
  37. tableListFun: apis.device.reportApi.queryFault,
  38. genReportFun: apis.device.reportApi.generateFault
  39. })
  40. </script>
  41. <template>
  42. <div class="app-container py-5">
  43. <VbCommonReport
  44. :title="opts.title"
  45. :cycle-type="opts.cycleType as 'Y' | 'Q' | 'M' | 'D' | 'W' | 'ALL'"
  46. :columns="opts.columns"
  47. :width="900"
  48. :search-items="opts.searchItems"
  49. :search-data="opts.queryParams"
  50. :table-list-fun="opts.tableListFun"
  51. :gen-report-fun="opts.genReportFun" />
  52. </div>
  53. </template>