index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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: '/ventanaly-device/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. // scroll: { y: 600 },
  48. formConfig: {
  49. labelAlign: 'left',
  50. showAdvancedButton: false,
  51. // autoAdvancedCol: 2,
  52. schemas: [
  53. {
  54. label: '设备类型',
  55. field: 'devicetype',
  56. component: 'MTreeSelect',
  57. componentProps: {
  58. virtual: false,
  59. },
  60. colProps: { span: 5 },
  61. },
  62. {
  63. label: '操作类型',
  64. field: 'nlogtype',
  65. component: 'Select',
  66. componentProps: {
  67. options: [
  68. {
  69. label: '人工远程控制',
  70. value: '1',
  71. },
  72. {
  73. label: '系统联动控制',
  74. value: '2',
  75. },
  76. {
  77. label: '其他控制',
  78. value: '3',
  79. },
  80. ],
  81. },
  82. colProps: { span: 5 },
  83. },
  84. {
  85. field: 'createTime_begin',
  86. label: '开始时间',
  87. component: 'DatePicker',
  88. defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
  89. required: true,
  90. componentProps: {
  91. showTime: true,
  92. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  93. getPopupContainer: getAutoScrollContainer,
  94. },
  95. colProps: {
  96. span: 4,
  97. },
  98. },
  99. {
  100. field: 'createTime_end',
  101. label: '结束时间',
  102. component: 'DatePicker',
  103. defaultValue: dayjs(),
  104. required: true,
  105. componentProps: {
  106. showTime: true,
  107. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  108. getPopupContainer: getAutoScrollContainer,
  109. },
  110. colProps: {
  111. span: 4,
  112. },
  113. },
  114. ],
  115. },
  116. fetchSetting: {
  117. listField: 'records',
  118. },
  119. pagination: {
  120. current: 1,
  121. pageSize: 10,
  122. pageSizeOptions: ['10', '30', '50', '100'],
  123. },
  124. beforeFetch(params) {
  125. params.devicetype = params.devicetype ? params.devicetype + '*' : '';
  126. return params;
  127. },
  128. },
  129. exportConfig: {
  130. name: '操作历史列表',
  131. url: '/safety/ventanalyDevicesetLog/exportXls',
  132. },
  133. });
  134. //注册table数据
  135. const [registerTable, { setLoading }] = tableContext;
  136. onMounted(async () => {});
  137. defineExpose({ setLoading });
  138. </script>
  139. <style scoped lang="less">
  140. @ventSpace: zxm;
  141. :deep(.zxm-table-container) {
  142. max-height: 720px !important;
  143. }
  144. :deep(.ventSpace-table-body) {
  145. height: auto !important;
  146. }
  147. :deep(.zxm-picker) {
  148. height: 30px !important;
  149. }
  150. :deep(.@{ventSpace}-picker-dropdown) {
  151. position: absolute !important;
  152. top: 35px !important;
  153. left: 0 !important;
  154. }
  155. .alarm-history-table {
  156. width: 100%;
  157. height: 700px;
  158. :deep(.jeecg-basic-table-form-container) {
  159. .@{ventSpace}-form {
  160. padding: 0 !important;
  161. border: none !important;
  162. margin-bottom: 0 !important;
  163. .@{ventSpace}-picker,
  164. .@{ventSpace}-select-selector {
  165. width: 100% !important;
  166. background: #00000017;
  167. border: 1px solid #b7b7b7;
  168. input,
  169. .@{ventSpace}-select-selection-item,
  170. .@{ventSpace}-picker-suffix {
  171. color: #fff;
  172. }
  173. .@{ventSpace}-select-selection-placeholder {
  174. color: #ffffffaa;
  175. }
  176. }
  177. }
  178. .@{ventSpace}-table-title {
  179. min-height: 0 !important;
  180. }
  181. }
  182. }
  183. </style>