index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <customHeader>预警历史监控系统</customHeader>
  3. <div class="data-statistics">
  4. <div class="statistics-box" v-for="(item, index) in statisticsList" :key="index">
  5. <div class="left-box">
  6. <div class="box-title">{{ item.title }}</div>
  7. </div>
  8. <div class="right-box">
  9. <div class="box-text">
  10. <div class="text-label">监测数量</div>
  11. <div class="text-value">{{ item.valueT }}</div>
  12. </div>
  13. <div class="warning-state box-text">
  14. <div class="text-label">预警状态</div>
  15. <div class="text-value">{{ item.valueB }}</div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. <a-tabs class="tab-box" v-model:activeKey="activeKey" @change="onChangeTab">
  21. <a-tab-pane tab="设备预警历史" key="device" />
  22. <a-tab-pane tab="联动预警历史" key="manageAuto" />
  23. </a-tabs>
  24. <div class="alarm-history-table">
  25. <BasicTable v-if="activeKey == 'device'" ref="alarmHistory" @register="registerTable" :scroll="{ x: 0, y: 350 }">
  26. <template #form-onExportXls>
  27. <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls()"> 导出</a-button>
  28. </template>
  29. </BasicTable>
  30. <BasicTable v-if="activeKey == 'manageAuto'" ref="alarmHistory" @register="registerTable" :scroll="{ x: 0, y: 350 }">
  31. <template #form-onExportXls>
  32. <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls()"> 导出</a-button>
  33. </template>
  34. </BasicTable>
  35. </div>
  36. </template>
  37. <script lang="ts" name="system-user" setup>
  38. //ts语法
  39. import { watch, ref, defineExpose, onMounted, reactive } from 'vue';
  40. import { BasicTable } from '/@/components/Table';
  41. import { useListPage } from '/@/hooks/system/useListPage';
  42. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  43. import { manageAutoColumns1 } from './alarm.data';
  44. import { getAutoScrollContainer } from '/@/utils/common/compUtils';
  45. import { list, getEachMineWarnCountInfo } from './warning.api';
  46. import { useRoute } from 'vue-router';
  47. import customHeader from '/@/components/vent/customHeader.vue';
  48. const props = defineProps({
  49. formConfig: {
  50. type: Object as PropType<FormProps> | undefined,
  51. default: undefined,
  52. },
  53. });
  54. const route = useRoute();
  55. let statisticsList = reactive<any[]>([
  56. { title: '通风', valueT: 0, valueB: '' },
  57. { title: '粉尘', valueT: 0, valueB: '' },
  58. { title: '瓦斯', valueT: 0, valueB: '' },
  59. { title: '火灾', valueT: 0, valueB: '' },
  60. { title: '安全监测', valueT: 0, valueB: '' },
  61. ]);
  62. const activeKey = ref('device');
  63. const alarmHistory = ref();
  64. const deviceColumns = getTableHeaderColumns('alarm_history') as [];
  65. const dataColumns = ref(deviceColumns);
  66. const paramType = ref('alarmLog');
  67. // 列表页面公共参数、方法
  68. const { tableContext, onExportXls } = useListPage({
  69. tableProps: {
  70. api: list,
  71. columns: dataColumns,
  72. canResize: true,
  73. showTableSetting: false,
  74. showActionColumn: false,
  75. showIndexColumn: true,
  76. bordered: false,
  77. size: 'small',
  78. formConfig: {
  79. labelAlign: 'left',
  80. showAdvancedButton: false,
  81. // autoAdvancedCol: 4,
  82. // labelWidth:50,
  83. schemas: [
  84. {
  85. label: '是否解决',
  86. field: 'isOk',
  87. defaultValue: false,
  88. component: 'Select',
  89. componentProps: {
  90. options: [
  91. {
  92. label: '未解决',
  93. value: false,
  94. },
  95. {
  96. label: '已解决',
  97. value: true,
  98. },
  99. ],
  100. },
  101. colProps: { span: 4 },
  102. },
  103. {
  104. label: '系统',
  105. field: 'systemType',
  106. component: 'Select',
  107. componentProps: {
  108. options: [
  109. {
  110. label: '通风',
  111. value: 'ventS',
  112. },
  113. {
  114. label: '防灭火',
  115. value: 'fireS',
  116. },
  117. {
  118. label: '防尘',
  119. value: 'dustS',
  120. },
  121. {
  122. label: '瓦斯',
  123. value: 'gasS',
  124. },
  125. ],
  126. },
  127. colProps: { span: 3 },
  128. },
  129. {
  130. label: '矿编码',
  131. field: 'orgcode',
  132. component: 'Select',
  133. defaultValue: 'sdmtjtbetmk',
  134. componentProps: {
  135. options: [
  136. {
  137. label: '布尔台煤矿',
  138. value: 'sdmtjtbetmk',
  139. },
  140. {
  141. label: '活鸡兔井',
  142. value: 'sdmtjtdltmkhjtj',
  143. },
  144. {
  145. label: '大柳塔井',
  146. value: 'sdmtjtdltmk',
  147. },
  148. {
  149. label: '补连塔煤矿',
  150. value: 'sdmtjtbltmk',
  151. },
  152. {
  153. label: '上湾煤矿',
  154. value: 'sdmtjtswmk',
  155. },
  156. {
  157. label: '锦界煤矿',
  158. value: 'sdmtjtjjmk',
  159. },
  160. {
  161. label: '哈拉沟煤矿',
  162. value: 'sdmtjthlgmk',
  163. },
  164. {
  165. label: '柳塔煤矿',
  166. value: 'sdmtjtltmk',
  167. },
  168. {
  169. label: '石圪台煤矿',
  170. value: 'sdmtjtsgtmk',
  171. },
  172. {
  173. label: '保德煤矿',
  174. value: 'sdmtjtbdmk',
  175. },
  176. {
  177. label: '寸草塔煤矿',
  178. value: 'sdmtjtcctmk',
  179. },
  180. {
  181. label: '寸草塔二矿',
  182. value: 'sdmtjtcctrk',
  183. },
  184. {
  185. label: '榆家粱煤矿',
  186. value: 'sdmtjtyjlmk',
  187. },
  188. {
  189. label: '乌兰木伦煤矿',
  190. value: 'sdmtjtwlmlmk',
  191. },
  192. ],
  193. },
  194. colProps: { span: 3 },
  195. },
  196. {
  197. field: 'starttime',
  198. label: '开始时间',
  199. component: 'DatePicker',
  200. componentProps: {
  201. showTime: true,
  202. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  203. getPopupContainer: getAutoScrollContainer,
  204. },
  205. colProps: {
  206. span: 4,
  207. },
  208. },
  209. {
  210. field: 'endtime',
  211. label: '结束时间',
  212. component: 'DatePicker',
  213. componentProps: {
  214. showTime: true,
  215. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  216. getPopupContainer: getAutoScrollContainer,
  217. },
  218. colProps: {
  219. span: 4,
  220. },
  221. },
  222. ],
  223. },
  224. fetchSetting: {
  225. listField: 'records',
  226. },
  227. pagination: {
  228. current: 1,
  229. pageSize: 10,
  230. pageSizeOptions: ['10', '30', '50', '100'],
  231. },
  232. beforeFetch(params) {
  233. params.type = paramType.value;
  234. return params;
  235. },
  236. },
  237. exportConfig: {
  238. name: '预警历史列表',
  239. url: '/safety/ventanalyAlarmLog/exportXls',
  240. },
  241. });
  242. //注册table数据
  243. const [registerTable, { reload, setLoading, getForm }] = tableContext;
  244. function onChangeTab(tab) {
  245. if (tab === 'device') {
  246. paramType.value = 'alarmLog';
  247. dataColumns.value = deviceColumns;
  248. } else {
  249. paramType.value = 'autoLog';
  250. dataColumns.value = manageAutoColumns1;
  251. }
  252. }
  253. //获取预警统计信息
  254. async function getEachMineWarnCountInfoList() {
  255. let res = await getEachMineWarnCountInfo({});
  256. console.log(res, '监测数量预警状态------');
  257. statisticsList[0].valueT = res.ventSWarnInfo.totalNum || 0;
  258. statisticsList[0].valueB = res.ventSWarnInfo.maxWarnLevel || '';
  259. statisticsList[1].valueT = res.dustSWarnInfo.totalNum || 0;
  260. statisticsList[1].valueB = res.dustSWarnInfo.maxWarnLevel || '';
  261. statisticsList[2].valueT = res.gasSWarnInfo.totalNum || 0;
  262. statisticsList[2].valueB = res.gasSWarnInfo.maxWarnLevel || '';
  263. statisticsList[3].valueT = res.fireSWarnInfo.totalNum || 0;
  264. statisticsList[3].valueB = res.fireSWarnInfo.maxWarnLevel || '';
  265. statisticsList[4].valueT = res.synthesizeSWarnInfo.totalNum || 0;
  266. statisticsList[4].valueB = res.synthesizeSWarnInfo.maxWarnLevel || '';
  267. }
  268. onMounted(async () => {
  269. getEachMineWarnCountInfoList();
  270. });
  271. defineExpose({ setLoading });
  272. </script>
  273. <style scoped lang="less">
  274. @ventSpace: zxm;
  275. :deep(.zxm-table-container) {
  276. max-height: 720px !important;
  277. }
  278. :deep(.ventSpace-table-body) {
  279. height: auto !important;
  280. }
  281. :deep(.zxm-picker) {
  282. height: 30px !important;
  283. }
  284. :deep(.@{ventSpace}-picker-dropdown) {
  285. position: absolute !important;
  286. top: 35px !important;
  287. left: 0 !important;
  288. }
  289. .data-statistics {
  290. height: 200px;
  291. padding: 20px;
  292. margin-top: 90px;
  293. background-color: #0ebbff15;
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. .statistics-box {
  298. display: flex;
  299. flex: 1;
  300. height: 100%;
  301. justify-content: center;
  302. align-items: center;
  303. .left-box {
  304. position: relative;
  305. width: 138px;
  306. height: 100%;
  307. .box-title {
  308. position: absolute;
  309. left: 50%;
  310. bottom: 18px;
  311. transform: translate(-50%, 0);
  312. color: #fff;
  313. }
  314. }
  315. &:nth-child(1) .left-box {
  316. background: url('../../../../assets/images/vent-tf.png') no-repeat center;
  317. background-size: 100% auto;
  318. }
  319. &:nth-child(2) .left-box {
  320. background: url('../../../../assets/images/dust-fc.png') no-repeat center;
  321. background-size: 100% auto;
  322. }
  323. &:nth-child(3) .left-box {
  324. background: url('../../../../assets/images/gas-ws.png') no-repeat center;
  325. background-size: 100% auto;
  326. }
  327. &:nth-child(4) .left-box {
  328. background: url('../../../../assets/images/fire-fz.png') no-repeat center;
  329. background-size: 100% auto;
  330. }
  331. &:nth-child(5) .left-box {
  332. background: url('../../../../assets/images/aqjc.png') no-repeat center;
  333. background-size: 100% auto;
  334. }
  335. .right-box {
  336. position: relative;
  337. width: 215px;
  338. height: 100%;
  339. display: flex;
  340. flex-direction: column;
  341. justify-content: space-around;
  342. align-items: center;
  343. .box-text {
  344. position: relative;
  345. width: 100%;
  346. height: 40px;
  347. color: #fff;
  348. background: url('../../../../assets/images/his-one.png') no-repeat center;
  349. background-size: 100% 100%;
  350. .text-label {
  351. position: absolute;
  352. left: 20px;
  353. top: 50%;
  354. transform: translate(0, -50%);
  355. }
  356. .text-value {
  357. position: absolute;
  358. left: 130px;
  359. top: 50%;
  360. transform: translate(0, -50%);
  361. font-family: 'douyuFont';
  362. }
  363. }
  364. .warning-state {
  365. .text-value {
  366. color: aqua !important;
  367. font-family: 'douyuFont';
  368. }
  369. }
  370. }
  371. }
  372. }
  373. .tab-box {
  374. display: flex;
  375. color: #fff;
  376. position: relative;
  377. top: 11px;
  378. background: linear-gradient(#001325, #012e4f);
  379. :deep(.zxm-tabs-nav) {
  380. margin: 0 !important;
  381. .zxm-tabs-tab {
  382. width: 180px;
  383. height: 45px;
  384. background: url('@/assets/images/top-btn.png') center no-repeat;
  385. background-size: cover;
  386. display: flex;
  387. justify-content: center;
  388. font-size: 16px;
  389. }
  390. .zxm-tabs-tab-active {
  391. width: 180px;
  392. position: relative;
  393. background: url('@/assets/images/top-btn-select.png') center no-repeat;
  394. background-size: cover;
  395. .zxm-tabs-tab-btn {
  396. color: #fff !important;
  397. }
  398. }
  399. .zxm-tabs-ink-bar {
  400. width: 0 !important;
  401. }
  402. .zxm-tabs-tab + .zxm-tabs-tab {
  403. margin: 0 !important;
  404. }
  405. }
  406. }
  407. .alarm-history-table {
  408. width: 100%;
  409. background-color: #0ebbff15;
  410. position: relative;
  411. margin-top: 10px;
  412. &::after {
  413. position: absolute;
  414. content: '';
  415. width: calc(100% + 10px);
  416. height: 2px;
  417. top: 0px;
  418. left: -10px;
  419. border-bottom: 1px solid #0efcff44;
  420. }
  421. }
  422. </style>