AlarmHistoryTable.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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: '/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. scroll: {
  30. type: Object,
  31. default: () => { }
  32. }
  33. });
  34. const columns = getTableHeaderColumns(props.columnsType);
  35. // 列表页面公共参数、方法
  36. const { tableContext } = useListPage({
  37. tableProps: {
  38. api: list,
  39. columns: columns,
  40. canResize: true,
  41. showTableSetting: false,
  42. showActionColumn: false,
  43. bordered: false,
  44. size: 'small',
  45. scroll: props.scroll,
  46. formConfig: {
  47. labelAlign: 'left',
  48. showAdvancedButton: false,
  49. // autoAdvancedCol: 2,
  50. schemas: [
  51. {
  52. label: '时间范围',
  53. field: 'createTime',
  54. component: 'RangePicker',
  55. componentProps: {
  56. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  57. },
  58. },
  59. {
  60. label: '查询设备',
  61. field: 'gdeviceid',
  62. component: 'ApiSelect',
  63. componentProps: {
  64. api: props.deviceListApi,
  65. resultField: 'records',
  66. labelField: 'strname',
  67. valueField: 'id',
  68. },
  69. },
  70. ],
  71. fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], '']],
  72. },
  73. fetchSetting: {
  74. listField: 'records',
  75. },
  76. pagination: {
  77. current: 1,
  78. pageSize: 10,
  79. pageSizeOptions: ['5', '10', '20'],
  80. },
  81. beforeFetch(params) {
  82. params.gdevicetype = props.deviceType + '*';
  83. },
  84. },
  85. });
  86. //注册table数据
  87. const [registerTable] = tableContext;
  88. </script>
  89. <style scoped lang="less">
  90. @ventSpace: zxm;
  91. :deep(.ventSpace-table-body) {
  92. height: auto !important;
  93. }
  94. :deep(.zxm-picker){
  95. height: 30px !important;
  96. }
  97. .alarm-history-table {
  98. width: 100%;
  99. :deep(.jeecg-basic-table-form-container) {
  100. .@{ventSpace}-form {
  101. padding: 0 !important;
  102. border: none !important;
  103. margin-bottom: 0 !important;
  104. .@{ventSpace}-picker,
  105. .@{ventSpace}-select-selector {
  106. width: 100% !important;
  107. background: #00000017;
  108. border: 1px solid #b7b7b7;
  109. input,
  110. .@{ventSpace}-select-selection-item,
  111. .@{ventSpace}-picker-suffix {
  112. color: #fff;
  113. }
  114. .@{ventSpace}-select-selection-placeholder {
  115. color: #ffffffaa;
  116. }
  117. }
  118. }
  119. .@{ventSpace}-table-title {
  120. min-height: 0 !important;
  121. }
  122. }
  123. }
  124. </style>