overdueCompany.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <script setup lang="ts">
  2. import configs from "@/core/config/Index"
  3. import { ref } from "vue"
  4. import router from "@/router"
  5. import { useRoute } from "vue-router"
  6. const route = useRoute()
  7. const companyName = ref(route.query.name)
  8. const queryParams = ref({
  9. company_id: route.query.company_id,
  10. time_type: route.query.time_type,
  11. warn_type: route.query.warn_type,
  12. query_start_time: route.query.query_start_time,
  13. query_end_time: route.query.query_end_time,
  14. })
  15. const cols = ref([
  16. {
  17. name: "序号",
  18. width: 60,
  19. field: configs.TABLE_INDEX_FIELD,
  20. },
  21. {
  22. name: "净化设施",
  23. field: "device_name",
  24. },
  25. {
  26. name: "告警类型",
  27. field: "warn_type_name",
  28. },
  29. {
  30. name: "报警时间",
  31. field: "warn_starttime",
  32. },
  33. {
  34. name: "操作",
  35. width: 120,
  36. field: "action",
  37. },
  38. ])
  39. function detail(row: any) {
  40. router.push({
  41. path: "/analysisInfo/overdue/warn",
  42. query: {
  43. back: 1,
  44. id: row.id,
  45. type: row.warn_type,
  46. },
  47. })
  48. }
  49. </script>
  50. <template>
  51. <VbDataTable
  52. ref="table"
  53. :header="cols"
  54. url="sys/overdueCompany/getWarnForPage"
  55. method="post"
  56. :query-params="queryParams"
  57. :has-checkbox="false"
  58. :pagination="false"
  59. >
  60. <template v-slot:table-tool>
  61. <h2>{{ companyName }}</h2>
  62. </template>
  63. <template #action="{ row }">
  64. <span class="table-action" @click="detail(row)">查看详情</span>
  65. </template>
  66. </VbDataTable>
  67. </template>