index.vue 13 KB

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