AlarmHistoryTable.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="alarm-history-table">
  3. <BasicTable @register="registerTable" />
  4. </div>
  5. </template>
  6. <script lang="ts" name="system-user" setup>
  7. //ts语法
  8. import { BasicTable } from '/@/components/Table';
  9. import { useListPage } from '/@/hooks/system/useListPage';
  10. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  11. import { defHttp } from '/@/utils/http/axios';
  12. const list = (params) => defHttp.get({ url: '/ventanaly-device/safety/ventanalyAlarmLog/list', params });
  13. const props = defineProps({
  14. columnsType: {
  15. type: String,
  16. required: true,
  17. },
  18. deviceType: {
  19. type: String,
  20. required: true,
  21. },
  22. deviceListApi: {
  23. type: Function,
  24. required: true,
  25. },
  26. designScope: {
  27. type: String,
  28. },
  29. });
  30. const columns = getTableHeaderColumns(props.columnsType);
  31. // 列表页面公共参数、方法
  32. const { tableContext } = useListPage({
  33. tableProps: {
  34. api: list,
  35. columns: columns,
  36. canResize: true,
  37. showTableSetting: false,
  38. showActionColumn: false,
  39. bordered: false,
  40. size: 'small',
  41. formConfig: {
  42. labelAlign: 'left',
  43. showAdvancedButton: false,
  44. // autoAdvancedCol: 2,
  45. schemas: [
  46. {
  47. label: '时间范围',
  48. field: 'createTime',
  49. component: 'RangePicker',
  50. componentProps: {
  51. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  52. },
  53. },
  54. {
  55. label: '查询设备',
  56. field: 'gdeviceid',
  57. component: 'ApiSelect',
  58. componentProps: {
  59. api: props.deviceListApi,
  60. resultField: 'records',
  61. labelField: 'strname',
  62. valueField: 'id',
  63. },
  64. },
  65. ],
  66. fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], '']],
  67. },
  68. fetchSetting: {
  69. listField: 'records',
  70. },
  71. pagination: {
  72. current: 1,
  73. pageSize: 10,
  74. pageSizeOptions: ['5', '10', '20'],
  75. },
  76. beforeFetch(params) {
  77. params.gdevicetype = props.deviceType + '*';
  78. },
  79. },
  80. });
  81. //注册table数据
  82. const [registerTable] = tableContext;
  83. </script>
  84. <style scoped lang="less">
  85. :deep(.ant-table-body) {
  86. height: auto !important;
  87. }
  88. .alarm-history-table {
  89. width: 100%;
  90. :deep(.jeecg-basic-table-form-container) {
  91. .ant-form {
  92. padding: 0 !important;
  93. border: none !important;
  94. margin-bottom: 0 !important;
  95. .ant-picker,
  96. .ant-select-selector {
  97. width: 100% !important;
  98. background: #00000017;
  99. border: 1px solid #b7b7b7;
  100. input,
  101. .ant-select-selection-item,
  102. .ant-picker-suffix {
  103. color: #fff;
  104. }
  105. .ant-select-selection-placeholder {
  106. color: #ffffffaa;
  107. }
  108. }
  109. }
  110. .ant-table-title {
  111. min-height: 0 !important;
  112. }
  113. }
  114. }
  115. </style>