index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="alarm-history-table">
  3. <BasicTable ref="alarmHistory" @register="registerTable">
  4. <template #form-onExportXls>
  5. <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls()"> 导出</a-button>
  6. </template>
  7. </BasicTable>
  8. </div>
  9. </template>
  10. <script lang="ts" name="system-user" setup>
  11. //ts语法
  12. import { watch, ref, defineExpose, inject, onMounted } from 'vue';
  13. import { BasicTable } from '/@/components/Table';
  14. import { useListPage } from '/@/hooks/system/useListPage';
  15. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  16. import { defHttp } from '/@/utils/http/axios';
  17. import dayjs from 'dayjs';
  18. import { getAutoScrollContainer } from '/@/utils/common/compUtils';
  19. import { list } from './handle.api';
  20. const props = defineProps({
  21. deviceListApi: {
  22. type: Function,
  23. },
  24. designScope: {
  25. type: String,
  26. },
  27. sysId: {
  28. type: String,
  29. },
  30. list: {
  31. type: Function,
  32. default: (params) => defHttp.get({ url: '/safety/ventanalyDevicesetLog/list', params }),
  33. },
  34. });
  35. const alarmHistory = ref();
  36. const columns = getTableHeaderColumns('operator_history');
  37. // 列表页面公共参数、方法
  38. const { tableContext, onExportXls } = useListPage({
  39. tableProps: {
  40. api: list,
  41. columns: columns,
  42. canResize: true,
  43. showTableSetting: false,
  44. showActionColumn: false,
  45. bordered: false,
  46. size: 'small',
  47. showIndexColumn: true,
  48. // scroll: { y: 600 },
  49. formConfig: {
  50. labelAlign: 'left',
  51. showAdvancedButton: false,
  52. // autoAdvancedCol: 2,
  53. schemas: [
  54. {
  55. label: '设备类型',
  56. field: 'devicetype',
  57. component: 'MTreeSelect',
  58. componentProps: {
  59. virtual: false,
  60. },
  61. colProps: { span: 5 },
  62. },
  63. {
  64. label: '操作类型',
  65. field: 'nlogtype',
  66. component: 'Select',
  67. componentProps: {
  68. options: [
  69. {
  70. label: '人工远程控制',
  71. value: '1',
  72. },
  73. {
  74. label: '系统联动控制',
  75. value: '2',
  76. },
  77. {
  78. label: '其他控制',
  79. value: '3',
  80. },
  81. ],
  82. },
  83. colProps: { span: 5 },
  84. },
  85. {
  86. field: 'createTime_begin',
  87. label: '开始时间',
  88. component: 'DatePicker',
  89. defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
  90. required: true,
  91. componentProps: {
  92. showTime: true,
  93. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  94. getPopupContainer: getAutoScrollContainer,
  95. },
  96. colProps: {
  97. span: 4,
  98. },
  99. },
  100. {
  101. field: 'createTime_end',
  102. label: '结束时间',
  103. component: 'DatePicker',
  104. defaultValue: dayjs(),
  105. required: true,
  106. componentProps: {
  107. showTime: true,
  108. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  109. getPopupContainer: getAutoScrollContainer,
  110. },
  111. colProps: {
  112. span: 4,
  113. },
  114. },
  115. ],
  116. },
  117. fetchSetting: {
  118. listField: 'records',
  119. },
  120. pagination: {
  121. current: 1,
  122. pageSize: 10,
  123. pageSizeOptions: ['10', '30', '50', '100'],
  124. },
  125. beforeFetch(params) {
  126. params.devicetype = params.devicetype ? params.devicetype + '*' : '';
  127. return params;
  128. },
  129. },
  130. exportConfig: {
  131. name: '操作历史列表',
  132. url: '/safety/ventanalyDevicesetLog/exportXls',
  133. },
  134. });
  135. //注册table数据
  136. const [registerTable, { setLoading }] = tableContext;
  137. onMounted(async () => {});
  138. defineExpose({ setLoading });
  139. </script>
  140. <style scoped lang="less">
  141. @ventSpace: zxm;
  142. :deep(.zxm-table-container) {
  143. max-height: 720px !important;
  144. }
  145. :deep(.ventSpace-table-body) {
  146. height: auto !important;
  147. }
  148. :deep(.zxm-picker) {
  149. height: 30px !important;
  150. }
  151. :deep(.@{ventSpace}-picker-dropdown) {
  152. position: absolute !important;
  153. top: 35px !important;
  154. left: 0 !important;
  155. }
  156. .alarm-history-table {
  157. width: 100%;
  158. height: 700px;
  159. :deep(.jeecg-basic-table-form-container) {
  160. .@{ventSpace}-form {
  161. padding: 0 !important;
  162. border: none !important;
  163. margin-bottom: 0 !important;
  164. .@{ventSpace}-picker,
  165. .@{ventSpace}-select-selector {
  166. width: 100% !important;
  167. background: #00000017;
  168. border: 1px solid #b7b7b7;
  169. input,
  170. .@{ventSpace}-select-selection-item,
  171. .@{ventSpace}-picker-suffix {
  172. color: #fff;
  173. }
  174. .@{ventSpace}-select-selection-placeholder {
  175. color: #ffffffaa;
  176. }
  177. }
  178. }
  179. .@{ventSpace}-table-title {
  180. min-height: 0 !important;
  181. }
  182. }
  183. }
  184. </style>