index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <BasicTable @register="registerRealtimeTable">
  4. <template #resetBefore>
  5. <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="onExportXls"> 导出 </a-button>
  6. </template>
  7. <template #action="{ record }">
  8. <button @click="handleGoToPageQuery(record, `/sealed/${record.parentId}`)" class="action-btn" title="老空区永久密闭监测数据">
  9. <SvgIcon name="database" />
  10. </button>
  11. <!-- <button @click="handleGoToPageQuery(record, '/basicinfo/access-statistics')" class="action-btn" title="接入统计数据">
  12. <SvgIcon name="info" />
  13. </button> -->
  14. <button @click="handleGoToPageQuery(record, '/warningAnalysis/connectAnalysis')" class="action-btn" title="智能分析数据">
  15. <SvgIcon name="chart" />
  16. </button>
  17. </template>
  18. <template #expandedRowRender="{ record }">
  19. <BasicTable :dataSource="record.coalSeamList" :columns="coalSeamColumns" :pagination="false">
  20. <!-- <template #action="{ record }">
  21. <button @click="handleEdit(record, 'goaf')" class="action-btn" title="编辑">
  22. <SvgIcon name="edit" />
  23. </button>
  24. </template> -->
  25. <template #emptyText> 暂无数据 </template>
  26. </BasicTable>
  27. </template>
  28. </BasicTable>
  29. </template>
  30. <script setup lang="ts">
  31. import { useRoute } from 'vue-router';
  32. import { BasicTable } from '/@/components/Table';
  33. import { SvgIcon } from '/@/components/Icon';
  34. // 引入动态列/表单配置函数 + 类型
  35. import { coalSeamColumns, columns, searchFormSchema } from './minesInfo.data';
  36. import { getMineData } from '../basicInfo.api';
  37. // 引入字典获取方法
  38. import { useListPage } from '/@/hooks/system/useListPage';
  39. import { advancedRoutePush } from '/@/utils';
  40. // import { useIntervalFn } from '@vueuse/core';
  41. // import { useModal } from '/@/components/Modal';
  42. // 路由实例
  43. const route = useRoute();
  44. // ========== 表格注册 ==========
  45. const { tableContext: ctxRealtime, onExportXls } = useListPage({
  46. tableProps: {
  47. api: getMineData, // 数据统计接口
  48. columns, // 绑定动态列
  49. formConfig: {
  50. model: {
  51. deptId: route.query.deptId,
  52. accessStatus: route.query.accessStatus,
  53. status: route.query.status,
  54. gjMineStatus: route.query.gjMineStatus,
  55. },
  56. labelWidth: 120,
  57. schemas: searchFormSchema, // 绑定动态搜索表单
  58. showAdvancedButton: false,
  59. schemaGroupNames: ['常规查询'],
  60. },
  61. showIndexColumn: false,
  62. scroll: { x: 'max-content' },
  63. },
  64. exportConfig: {
  65. url: '/ventanaly-province/province/mineData/exportMineData',
  66. name: '矿山信息',
  67. params: {},
  68. },
  69. });
  70. const [registerRealtimeTable] = ctxRealtime;
  71. // useIntervalFn(() => realtimeTable.reload({ silence: true }), 10000);
  72. /**
  73. * 通用页面跳转方法
  74. * @param record 当前行数据
  75. * @param path 目标路径
  76. */
  77. function handleGoToPageQuery(record: any, path: string) {
  78. const deptId = record.deptId;
  79. advancedRoutePush({
  80. path,
  81. query: { deptId },
  82. });
  83. }
  84. // const [registerRealtimeModal, { openModal: openRealtimeModal }] = useModal();
  85. // const openModal = (record) => {
  86. // openRealtimeModal(true, record);
  87. // // if (type === 'realtime') {
  88. // // // 可向实时弹窗传递当前记录数据
  89. // // } else {
  90. // // // 可向历史弹窗传递当前记录数据
  91. // // openHistoryModal(true, record);
  92. // // }
  93. // pause();
  94. // };
  95. </script>
  96. <style lang="less" scoped>
  97. .action-btn {
  98. height: 30px;
  99. cursor: pointer;
  100. margin-right: 10px;
  101. &:last-child {
  102. margin-right: 0;
  103. }
  104. }
  105. </style>