index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <div class="app-container home" >
  3. <div id="main" >
  4. <el-row :gutter="4">
  5. <el-col :span="12" v-loading="loading1">
  6. <div class="card_left">
  7. <el-col :span="24">
  8. <el-card class="box-card card1">
  9. <span class="title">
  10. <el-image
  11. class="imgTitle"
  12. :src="img"
  13. ></el-image>
  14. <p>{{title}}</p>
  15. </span>
  16. <div class="contain">
  17. <div>
  18. <span>总数</span>
  19. <div>
  20. <p>{{index1Data.total}}</p>
  21. </div>
  22. </div>
  23. <div>
  24. <span>已处理</span>
  25. <div>
  26. <p>{{index1Data.checkCount}}</p>
  27. </div>
  28. </div>
  29. <div>
  30. <span>未处理</span>
  31. <div>
  32. <p>{{index1Data.noCheckCount}}</p>
  33. </div>
  34. </div>
  35. <div>
  36. <span>处置率</span>
  37. <div>
  38. <p v-loading="loading1">{{index1Data.checkRadio ? Number((index1Data.checkRadio)*100).toFixed(2) : '0'}}%</p>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="contain2">
  43. <div class="wrap">
  44. <index1 :resData="index1Data.checkRadio"
  45. :dataMap="index1Data.checkRadio"
  46. color="#80FFA5"
  47. :size="21"
  48. :with="16"
  49. :tick="false" style="width:100%;" alt="饼图" />
  50. <p>处置率</p>
  51. </div>
  52. </div>
  53. </el-card>
  54. </el-col>
  55. </div>
  56. </el-col>
  57. <el-col :span="12">
  58. <div class="card_right">
  59. <el-card class="box-card card2" v-loading="loading2">
  60. <div class="contain">
  61. <index2
  62. :resData="index2Data"
  63. style="width:100%;height:40vh;" alt="折线图" />
  64. </div>
  65. </el-card>
  66. </div>
  67. </el-col>
  68. <el-col :span="24" v-loading="loading3">
  69. <div class="card_bottom">
  70. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
  71. <el-form-item label="单位名称:" prop="companyCode">
  72. <el-select
  73. v-model="queryParams.companyCode"
  74. placeholder="请选择单位名称"
  75. clearable
  76. size="small"
  77. style="width: 160px"
  78. >
  79. <el-option
  80. v-for="dict in companyList"
  81. :key="dict.dictValue"
  82. :label="dict.dictLabel"
  83. :value="dict.dictValue"
  84. />
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item label="处理状态:" >
  88. <el-select v-model="queryParams.status" style="width: 160px" placeholder="请选择处理状态" clearable size="small">
  89. <el-option label="未处理" :value="0"/>
  90. <el-option label="已处理" :value="1"/>
  91. </el-select>
  92. </el-form-item>
  93. <el-form-item label="时间:" label-width="50px">
  94. <el-date-picker style="vertical-align: middle;width:340px"
  95. v-model="dateRange"
  96. size="small"
  97. value-format="yyyy-MM-dd HH:mm:ss"
  98. type="datetimerange"
  99. range-separator="-"
  100. start-placeholder="开始日期"
  101. end-placeholder="结束日期"
  102. ></el-date-picker>
  103. </el-form-item>
  104. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-top:4px">搜索</el-button>
  105. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  106. <el-button
  107. type="warning"
  108. plain
  109. icon="el-icon-download"
  110. size="mini"
  111. :loading="exportLoading"
  112. @click="handleExport"
  113. v-hasPermi="['system:admin:export']"
  114. >导出</el-button>
  115. </el-form>
  116. </div>
  117. <el-table :data="adminList" height="calc(100vh - 67vh)" :default-sort = "{prop: 'alarmTime', order: 'descending'}">
  118. <el-table-column label="序号" align="center" prop="id" show-overflow-tooltip />
  119. <el-table-column label="单位名称" align="center" prop="companyName" show-overflow-tooltip />
  120. <el-table-column label="报告时间" align="center" prop="alarmTime" sortable show-overflow-tooltip />
  121. <el-table-column label="报告数据" align="center" prop="property" show-overflow-tooltip />
  122. <el-table-column label="报告内容" align="center" prop="deviceName" show-overflow-tooltip />
  123. <el-table-column label="处理状态" align="center" show-overflow-tooltip >
  124. <template slot-scope="scope">
  125. <span :class="scope.row.alarmStatus == 0 ? 'color-red' : 'color-green'">{{ scope.row.alarmStatus == 0 ? '未处理':scope.row.alarmStatus ==1 ? '已处理':'' }}</span>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="处理人" align="center" prop="updateBy" show-overflow-tooltip />
  129. <el-table-column label="处理时间" align="center" prop="updateTime" show-overflow-tooltip />
  130. </el-table>
  131. </el-col>
  132. </el-row>
  133. </div>
  134. <pagination
  135. v-show="total>0"
  136. :total="total"
  137. :page.sync="queryParams.current"
  138. :limit.sync="queryParams.size"
  139. @pagination="getList"
  140. />
  141. <!-- 导出-->
  142. <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
  143. </div>
  144. </template>
  145. <script>
  146. import { getTbAlarmCollectIcoDetail, exportTbAlarm ,getTbAlarm, collectTbAlarm } from "@/api/business/OM/eventCenter";
  147. import { listChannel } from "@/api/system/product";
  148. import index1 from "@/views/components/fireInternetInfo/index1";
  149. import index2 from "@/views/components/fireInternetInfo/index2";
  150. import { BASEPATH } from "@/assets/js/common.js";
  151. import { getThisDateBeforMonth, YearMonthDate } from "@/assets/js/dataFormate.js";
  152. export default {
  153. name: "index",
  154. components: {
  155. index1,index2
  156. },
  157. data() {
  158. return {
  159. img:require('@/assets/images/1.gif'),
  160. title:"火警监控告警处理情况",
  161. index1Data:{},//饼图
  162. index2Data:[],//折线图
  163. index3Data:[],//table
  164. // 遮罩层
  165. loading1: true,
  166. loading2: true,
  167. loading3: true,
  168. // 导出遮罩层
  169. exportLoading: false,
  170. // 显示搜索条件
  171. showSearch: true,
  172. // 总条数
  173. total: 0,
  174. open: false,
  175. t:null,
  176. timeList:[],
  177. queryParams:{
  178. bigDeviceType:1,
  179. current:1,
  180. size:10,
  181. companyCode:undefined,
  182. status:undefined,
  183. },
  184. queryParams2:{
  185. type:2,
  186. bigDeviceType:1,
  187. current:1,
  188. size:10,
  189. // startTime:"2022-01-18 00:00:00",
  190. // endTime:"2022-04-18 00:00:00",
  191. startTime:getThisDateBeforMonth(),
  192. endTime:YearMonthDate(),
  193. },
  194. dataZ:[],//折线图
  195. // 公司列表
  196. companyList: [],
  197. // 日期范围
  198. dateRange: [],
  199. adminList:[]
  200. };
  201. },
  202. created(){
  203. this.init()
  204. this.getList()
  205. },
  206. /* type=2&bigDeviceType=1&isLine=1
  207. type 1隐患2告警
  208. bigDeviceType1火系统 2 水系统 3rtu 4电气火灾 5 视频监控
  209. */
  210. methods: {
  211. init(){
  212. /* 饼图 */
  213. collectTbAlarm(this.queryParams).then(response =>{
  214. this.index1Data = response.data
  215. this.loading1 = false
  216. })
  217. /* 折线图 */
  218. getTbAlarmCollectIcoDetail(this.queryParams2).then(response =>{
  219. let data = response.data
  220. let lineData = []
  221. let total = []
  222. let checkCount = []
  223. total[0] = {data:[],name:undefined}
  224. checkCount[0] = {data:[],name:undefined}
  225. if(data){
  226. for (let i = 0; i < data.length; i++) {
  227. lineData.push(data[i].time);
  228. total[0].data.push(data[i].list.checkCount + data[i].list.noCheckCount)
  229. checkCount[0].data.push(data[i].list.checkCount)
  230. }
  231. total[0].name = "告警总数"
  232. checkCount[0].name = "处理次数"
  233. this.index2Data.push(total[0],checkCount[0],lineData)
  234. this.index2Data.push({name:"火警监控告警处理情况跟踪",color:"#FF2416"})
  235. }
  236. this.loading2 = false
  237. })
  238. /* 公司列表 */
  239. listChannel(this.queryParams).then(response => {
  240. if(response.data.records.length>0){
  241. this.companyList = response.data.records.map(val =>{
  242. return {
  243. dictValue:val.ownerId,
  244. dictLabel:val.ownerName,
  245. address:val.ownerAddress,
  246. }
  247. })
  248. }
  249. });
  250. },
  251. getList(){
  252. this.loading3 = true
  253. if(this.dateRange.length>0){
  254. this.queryParams.startTime = this.dateRange[0]
  255. this.queryParams.endTime = this.dateRange[1]
  256. }
  257. getTbAlarm(this.queryParams).then(response =>{
  258. this.adminList = response.data.records
  259. this.total = response.data.total;
  260. this.loading3 = false;
  261. })
  262. },
  263. /** 搜索按钮操作 */
  264. handleQuery() {
  265. this.getList();
  266. },
  267. /** 重置按钮操作 */
  268. resetQuery() {
  269. this.queryParams.current = 1;
  270. this.queryParams.size = 10;
  271. this.queryParams.startTime = undefined;
  272. this.queryParams.endTime = undefined;
  273. this.queryParams.status = undefined;
  274. this.queryParams.companyCode = undefined;
  275. this.dateRange = [];
  276. this.resetForm("queryForm");
  277. this.handleQuery();
  278. },
  279. /** 导出按钮操作 */
  280. handleExport() {
  281. let queryParams = {...this.queryParams};
  282. delete queryParams.current
  283. delete queryParams.size
  284. this.exportLoading = true;
  285. exportTbAlarm(queryParams).then(response =>{
  286. this.exportLoading = false;
  287. document.getElementById("xz").href = BASEPATH() + response.data
  288. document.getElementById("xz").download = response.data
  289. document.getElementById("xz").click()
  290. })
  291. },
  292. }
  293. }
  294. </script>
  295. <style scoped lang="scss">
  296. ::-webkit-scrollbar-track
  297. {
  298. background: #fff;
  299. border-radius: 0;
  300. }
  301. ::-webkit-scrollbar
  302. {
  303. -webkit-appearance: none;
  304. width: 4px;
  305. height: 4px;
  306. }
  307. ::-webkit-scrollbar-thumb
  308. {
  309. cursor: pointer;
  310. border-radius: 5px;
  311. background: rgba(0,0,0,.25);
  312. transition: color .2s ease;
  313. }
  314. .text {
  315. font-size: 14px;
  316. }
  317. .item {
  318. margin-bottom: 18px;
  319. }
  320. .clearfix:before,
  321. .clearfix:after {
  322. display: table;
  323. content: "";
  324. }
  325. .clearfix:after {
  326. clear: both
  327. }
  328. .box-card {
  329. margin-top:20px;
  330. }
  331. #main{
  332. margin-top:-20px;
  333. .box-card{
  334. .h2{
  335. text-align: center;
  336. margin:0 auto;
  337. display: block;
  338. font-size: 1.2em;
  339. background-image: -webkit-linear-gradient(bottom, #00adce, #000);
  340. -webkit-background-clip: text;
  341. -webkit-text-fill-color: transparent;
  342. }
  343. }
  344. .card_left{
  345. .card1{
  346. height:43vh;
  347. .title{
  348. width:100%;
  349. display: block;
  350. text-align: left !important;
  351. .imgTitle{
  352. width:5%;
  353. display: inline-block;
  354. vertical-align: middle;
  355. }
  356. p{
  357. display: inline-block;
  358. vertical-align: middle;
  359. margin-left:2%;
  360. font-size:1.4vw;
  361. }
  362. }
  363. .contain{
  364. margin-top:0.5vh;
  365. width:58%;
  366. display: inline-block;
  367. vertical-align: top;
  368. div{
  369. height:7.8vh;
  370. span{
  371. font-size: 1vw;
  372. vertical-align: middle;
  373. width:4vw;
  374. text-align: left;
  375. display: inline-block;
  376. }
  377. div{
  378. width:212px;
  379. height:6vh;
  380. vertical-align: middle;
  381. background:url("../../../../../assets/images/operation_item.png") no-repeat right center;
  382. display: inline-block;
  383. p{
  384. font-size: 1.4vw;
  385. vertical-align: top;
  386. margin:1vh 0 0 3vh;
  387. }
  388. }
  389. }
  390. }
  391. .contain2{
  392. margin-top:-2.5rem;
  393. vertical-align: top;
  394. width:42%;
  395. display: inline-block;
  396. p{
  397. text-align: center;
  398. font-size: 1.4rem;
  399. margin:-2vh 0 0 0%;
  400. }
  401. }
  402. }
  403. }
  404. .card_right{
  405. .card2{
  406. height:43vh;
  407. }
  408. }
  409. .card_bottom{
  410. padding-top:10px;
  411. margin-bottom:-10px
  412. }
  413. }
  414. ::v-deep {
  415. .el-table__body-wrapper::-webkit-scrollbar {
  416. /*width: 0;宽度为0隐藏*/
  417. width: 4px;
  418. }
  419. .el-table__body-wrapper::-webkit-scrollbar-thumb {
  420. border-radius: 6px;
  421. height: 50px;
  422. background: rgba(40, 190, 252, .6);//滚动条颜色
  423. }
  424. .el-table__body-wrapper::-webkit-scrollbar-track {
  425. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  426. border-radius: 6px;
  427. background: #eee;//滚动条背景色
  428. }
  429. }
  430. </style>