HandlerHistoryTable.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div class="handler-history-table">
  3. <BasicTable @register="registerTable" />
  4. </div>
  5. </template>
  6. <script lang="ts" name="system-user" setup>
  7. //ts语法
  8. import { watch } from 'vue';
  9. import { BasicTable } from '/@/components/Table';
  10. import { useListPage } from '/@/hooks/system/useListPage';
  11. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  12. import { defHttp } from '/@/utils/http/axios';
  13. const list = (params) => defHttp.get({ url: '/safety/ventanalyDevicesetLog/list', params });
  14. const props = defineProps({
  15. columnsType: {
  16. type: String,
  17. required: true,
  18. },
  19. deviceType: {
  20. type: String,
  21. required: true,
  22. },
  23. deviceListApi: {
  24. type: Function,
  25. required: true,
  26. },
  27. designScope: {
  28. type: String,
  29. },
  30. scroll: {
  31. type: Object,
  32. default: () => {}
  33. }
  34. });
  35. const columns = getTableHeaderColumns(props.columnsType);
  36. // 列表页面公共参数、方法
  37. const { tableContext } = useListPage({
  38. tableProps: {
  39. api: list,
  40. columns: columns,
  41. canResize: true,
  42. showTableSetting: false,
  43. showActionColumn: false,
  44. bordered: false,
  45. size: 'small',
  46. scroll: props.scroll,
  47. formConfig: {
  48. labelAlign: 'left',
  49. showAdvancedButton: false,
  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, { reload }] = 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. .handler-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. height: 100%;
  108. background: #00000017;
  109. border: 1px solid #b7b7b7;
  110. input,
  111. .@{ventSpace}-select-selection-item,
  112. .@{ventSpace}-picker-suffix {
  113. color: #fff;
  114. }
  115. .@{ventSpace}-select-selection-placeholder {
  116. color: #ffffffaa;
  117. }
  118. }
  119. }
  120. .@{ventSpace}-table-title {
  121. min-height: 0 !important;
  122. }
  123. }
  124. }
  125. </style>