index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="data-statistics"> </div>
  3. <div class="alarm-history-table">
  4. <BasicTable ref="alarmHistory" @register="registerTable">
  5. <template #form-onExportXls>
  6. <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls()"> 导出</a-button>
  7. </template>
  8. </BasicTable>
  9. </div>
  10. </template>
  11. <script lang="ts" name="system-user" setup>
  12. //ts语法
  13. import { watch, ref, defineExpose, inject, onMounted } from 'vue';
  14. import { BasicTable } from '/@/components/Table';
  15. import { useListPage } from '/@/hooks/system/useListPage';
  16. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  17. import { defHttp } from '/@/utils/http/axios';
  18. import dayjs from 'dayjs';
  19. import { getAutoScrollContainer } from '/@/utils/common/compUtils';
  20. import { list } from './warning.api';
  21. const props = defineProps({
  22. deviceListApi: {
  23. type: Function,
  24. },
  25. designScope: {
  26. type: String,
  27. },
  28. sysId: {
  29. type: String,
  30. },
  31. list: {
  32. type: Function,
  33. default: (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params }),
  34. },
  35. });
  36. const alarmHistory = ref();
  37. const columns = getTableHeaderColumns('alarm_history');
  38. // 列表页面公共参数、方法
  39. const { tableContext, onExportXls } = useListPage({
  40. tableProps: {
  41. api: list,
  42. columns: columns,
  43. canResize: true,
  44. showTableSetting: false,
  45. showActionColumn: false,
  46. bordered: false,
  47. size: 'small',
  48. formConfig: {
  49. labelAlign: 'left',
  50. showAdvancedButton: false,
  51. // autoAdvancedCol: 2,
  52. schemas: [
  53. {
  54. label: '是否解决',
  55. field: 'isok',
  56. component: 'Select',
  57. componentProps: {
  58. options: [
  59. {
  60. label: '未解决',
  61. value: '0',
  62. },
  63. {
  64. label: '已解决',
  65. value: '1',
  66. },
  67. ],
  68. },
  69. colProps: { span: 4 },
  70. },
  71. {
  72. label: '所属系统',
  73. field: 'kindtype',
  74. component: 'Select',
  75. componentProps: {
  76. options: [
  77. {
  78. label: '通风',
  79. value: 'ventS',
  80. },
  81. {
  82. label: '防灭火',
  83. value: 'fireS',
  84. },
  85. {
  86. label: '防尘',
  87. value: 'dustS',
  88. },
  89. {
  90. label: '瓦斯',
  91. value: 'gasS',
  92. },
  93. ],
  94. },
  95. colProps: { span: 4 },
  96. },
  97. {
  98. field: 'startTime',
  99. label: '开始时间',
  100. component: 'DatePicker',
  101. defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
  102. required: true,
  103. componentProps: {
  104. showTime: true,
  105. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  106. getPopupContainer: getAutoScrollContainer,
  107. },
  108. colProps: {
  109. span: 4,
  110. },
  111. },
  112. {
  113. field: 'endTime',
  114. label: '结束时间',
  115. component: 'DatePicker',
  116. defaultValue: dayjs(),
  117. required: true,
  118. componentProps: {
  119. showTime: true,
  120. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  121. getPopupContainer: getAutoScrollContainer,
  122. },
  123. colProps: {
  124. span: 4,
  125. },
  126. },
  127. ],
  128. },
  129. fetchSetting: {
  130. listField: 'records',
  131. },
  132. pagination: {
  133. current: 1,
  134. pageSize: 10,
  135. pageSizeOptions: ['10', '30', '50', '100'],
  136. },
  137. beforeFetch(params) {
  138. // params.devicetype = params.devicetype ? params.devicetype + '*' : '';
  139. if (props.sysId) {
  140. params.sysId = props.sysId;
  141. }
  142. },
  143. },
  144. exportConfig: {
  145. name: '预警历史列表',
  146. url: '/safety/ventanalyAlarmLog/exportXls',
  147. },
  148. });
  149. //注册table数据
  150. const [registerTable, { reload, setLoading, getForm }] = tableContext;
  151. onMounted(async () => {});
  152. defineExpose({ setLoading });
  153. </script>
  154. <style scoped lang="less">
  155. @ventSpace: zxm;
  156. :deep(.zxm-table-container) {
  157. max-height: 720px !important;
  158. }
  159. :deep(.ventSpace-table-body) {
  160. height: auto !important;
  161. }
  162. :deep(.zxm-picker) {
  163. height: 30px !important;
  164. }
  165. :deep(.@{ventSpace}-picker-dropdown) {
  166. position: absolute !important;
  167. top: 35px !important;
  168. left: 0 !important;
  169. }
  170. .data-statistics {
  171. height: 200px;
  172. padding: 20px;
  173. margin-top: 20px;
  174. background-color: #0ebbff15;
  175. }
  176. // .tab-button-group {
  177. // // line-height: 60px;
  178. // margin-top: 16px;
  179. // display: flex;
  180. // pointer-events: auto;
  181. // position: relative;
  182. // &::after {
  183. // position: absolute;
  184. // content: '';
  185. // width: calc(100% + 10px);
  186. // height: 2px;
  187. // top: 44px;
  188. // left: -10px;
  189. // border-bottom: 1px solid #0efcff;
  190. // }
  191. // .tab-button {
  192. // padding: 10px 30px;
  193. // position: relative;
  194. // display: flex;
  195. // justify-content: center;
  196. // align-items: center;
  197. // font-size: 16px;
  198. // color: #fff;
  199. // cursor: pointer;
  200. // margin-right: 10px;
  201. // background-color: rgba(0, 103, 103, 0.253);
  202. // &::before {
  203. // content: '';
  204. // position: absolute;
  205. // top: 0;
  206. // right: 0;
  207. // bottom: 0;
  208. // left: 0;
  209. // border: 1px solid #2bb2c4;
  210. // // transform: skewX(-38deg);
  211. // // background-color: rgba(0, 77, 103, 85%);
  212. // z-index: 0;
  213. // }
  214. // &::after {
  215. // background-color: rgba(0, 77, 103, 85%);
  216. // }
  217. // }
  218. // .active {
  219. // &::before {
  220. // border-color: #46fcff;
  221. // box-shadow: 1px 1px 10px 2px #0efcff99 inset;
  222. // }
  223. // }
  224. // }
  225. .alarm-history-table {
  226. width: 100%;
  227. background-color: #0ebbff15;
  228. position: relative;
  229. margin-top: 10px;
  230. &::after {
  231. position: absolute;
  232. content: '';
  233. width: calc(100% + 10px);
  234. height: 2px;
  235. top: 0px;
  236. left: -10px;
  237. border-bottom: 1px solid #0efcff99;
  238. }
  239. }
  240. </style>