check.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <div class="check-page">
  3. <header></header>
  4. <div class="tab">
  5. <el-select v-model="conditions.goafOrebelt" placeholder="矿带" @change="changeArea(1)" style="width:120px">
  6. <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
  7. </el-select>
  8. <el-select v-model="conditions.goafOrebody" placeholder="矿体" @change="changeArea(2)" style="width:120px;margin:0 12px;">
  9. <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
  10. </el-select>
  11. <el-select v-model="conditions.goafOreheight" placeholder="中段" @change="changeArea(3)" style="width:120px">
  12. <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
  13. </el-select>
  14. <el-select v-model="conditions.goafId" placeholder="采空区编号" @change="changeArea(4)" style="width:210px;margin:0 12px;">
  15. <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
  16. </el-select>
  17. </div>
  18. <div class="container">
  19. <div class="lf">
  20. <div class="search-container">
  21. <div class="top">
  22. <div class="search-item">
  23. <el-input v-model="conditions.taskTitle" class="input" placeholder="请输入任务名称" />
  24. </div>
  25. <!-- <div class="search-item">
  26. <span>是否异常:</span>
  27. <el-select v-model="search.level" class="select" placeholder="全部">
  28. <el-option
  29. v-for="item in options1"
  30. :key="item.value"
  31. :label="item.label"
  32. :value="item.value"
  33. placeholder="是否异常"
  34. />
  35. </el-select>
  36. </div> -->
  37. <div class="search-item">
  38. <span>状态:</span>
  39. <el-select v-model="conditions.status" class="select" placeholder="全部" clearable>
  40. <el-option
  41. v-for="item in status_options"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value"
  45. placeholder="状态"
  46. />
  47. </el-select>
  48. </div>
  49. <div class="search-item">
  50. <span>开始时间:</span>
  51. <el-date-picker
  52. v-model="conditions.expectedStartDate"
  53. type="datetime"
  54. placeholder="请选择巡检时间"
  55. format="YYYY-MM-DD HH:mm:ss"
  56. value-format="YYYY-MM-DD HH:mm:ss"
  57. style="width:200px;margin-right: 14px;"
  58. />
  59. </div>
  60. <div class="search-item">
  61. <span>结束时间:</span>
  62. <el-date-picker
  63. v-model="conditions.expectedEndDate"
  64. type="datetime"
  65. placeholder="请选择巡检时间"
  66. style="width:200px;margin-right: 14px;"
  67. format="YYYY-MM-DD HH:mm:ss"
  68. value-format="YYYY-MM-DD HH:mm:ss"
  69. />
  70. </div>
  71. </div>
  72. <div class="bt-group">
  73. <div class="bt search" @click="searchSubmit">查询</div>
  74. <div class="bt" @click="resetSubmit">重置</div>
  75. </div>
  76. </div>
  77. <div class="lf-container">
  78. <table>
  79. <tr>
  80. <td>任务名称</td>
  81. <td>状态</td>
  82. <td>执行人员</td>
  83. <td>截止时间</td>
  84. </tr>
  85. <tr v-for="(item,index) in dataList" :key="index">
  86. <td>{{ item.taskTitle }}</td>
  87. <td>{{ formateStatus(item.status) }}</td>
  88. <td>{{ item.handleAccountName }}</td>
  89. <td>{{ item.expectedEndDate }}</td>
  90. </tr>
  91. </table>
  92. <div class="el-pagination-wrap">
  93. <el-pagination small layout="prev, pager, next"
  94. :total="total"
  95. @size-change="handleSizeChange"
  96. @current-change="handleCurrentChange" />
  97. </div>
  98. </div>
  99. </div>
  100. <div class="rt">
  101. <div class="head">
  102. <div class="name">巡检数据统计</div>
  103. <div class="number">123</div>
  104. </div>
  105. <div class="head-info">
  106. <div class="item total">
  107. <div class="name">总数</div>
  108. <div class="number">{{statistics.total}}</div>
  109. </div>
  110. <div class="item normal">
  111. <div class="name">正常</div>
  112. <div class="number">{{statistics.normal}}</div>
  113. </div>
  114. <div class="item error">
  115. <div class="name">异常</div>
  116. <div class="number">{{statistics.error}}</div>
  117. </div>
  118. </div>
  119. <div class="chart-wrap">
  120. <div class="title">异常分析</div>
  121. <abnormal ref="abnormal" />
  122. </div>
  123. <div class="chart-wrap">
  124. <div class="title">异常处理情况</div>
  125. <warn-chart ref="warn-chart" />
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </template>
  131. <script>
  132. import Abnormal from './components/Abnormal.vue'
  133. import WarnChart from './components/WarnChart.vue'
  134. import { getCheckTaskByPage } from '@/api/goaf/task'
  135. import { getGoafBaseInfo } from '@/api/goaf/info'
  136. import {goaftaskstatis} from '@/api/goaf/check'
  137. import {getTime} from '@/utils'
  138. export default {
  139. name:"check",
  140. components:{
  141. Abnormal,
  142. WarnChart
  143. },
  144. data(){
  145. return{
  146. activeId:'1',
  147. activetab:'1',
  148. goafList: [],
  149. goafOrebelts: [],
  150. goafOrebodys: [],
  151. goafOreheights: [],
  152. goafNames: [],
  153. conditions: {
  154. page: 1,
  155. limit: 10,
  156. status:0,
  157. taskTitle:"",
  158. expectedStartDate:getTime(),
  159. expectedEndDate:getTime(1),
  160. goafId: '',
  161. goafOrebelt: '',
  162. goafOrebody: '',
  163. goafOreheight: '',
  164. goafName:"",
  165. goafDevName:""
  166. },
  167. items:[
  168. {name:"首页",id:"1",path:"/particulars/sensor"},
  169. {name:"压力传感器",id:"2",path:"/particulars/check"},
  170. {name:"位移传感器",id:"3",path:"/particulars/goaf-info"},
  171. {name:"有害气体传感器",id:"4",path:"/particulars/goaf-info"},
  172. {name:"视频监控",id:"5",path:"/particulars/goaf-info"},
  173. ],
  174. status_options:[
  175. {label:"待处理",value:0},
  176. {label:"处理完成",value:1},
  177. {label:"逾期",value:2},
  178. ] ,
  179. options1:[
  180. {label:'是',value:1},
  181. {label:'否',value:0},
  182. ],
  183. dataList:[],
  184. total:0 ,
  185. statistics:{
  186. total:0,
  187. normal:0,
  188. error:0
  189. }
  190. }
  191. },
  192. created(){
  193. this.init()
  194. },
  195. methods:{
  196. formateStatus(val){
  197. let status=['待处理','处理完成','已逾期']
  198. return status[val]
  199. },
  200. init(){
  201. this.$nextTick(()=>{
  202. this.$refs['abnormal'].init();
  203. this.$refs['warn-chart'].init();
  204. this.getData()
  205. })
  206. this.getGoafBaseInfo()
  207. this.goaftaskstatis()
  208. },
  209. getGoafBaseInfo(){
  210. getGoafBaseInfo().then((res) => {
  211. const goafOrebelts = res.data.map(item => item.goafOrebelt)
  212. this.goafOrebelts = [...new Set(goafOrebelts)]
  213. this.goafList = res.data
  214. })
  215. },
  216. goaftaskstatis(){
  217. goaftaskstatis().then((res)=>{
  218. this.statistics={
  219. total:res.data.goafTaskCompletedNum,
  220. normal:res.data.goafTaskPassNum,
  221. error:res.data.goafTaskNopassdNum
  222. }
  223. })
  224. },
  225. changeHead(item){
  226. this.activeId=item.id
  227. },
  228. changeTab(item){
  229. this.activetab=item.id
  230. },
  231. searchSubmit(){
  232. this.conditions.page=1
  233. this.getData()
  234. },
  235. getData(){
  236. for(let key in this.conditions){
  237. if(this.conditions[key]===undefined||this.conditions[key]===''||this.conditions[key]==='undefined'){
  238. delete this.conditions[key]
  239. }
  240. }
  241. getCheckTaskByPage(this.conditions).then((resp) => {
  242. this.listLoading = false
  243. const {data, total } = resp
  244. this.dataList = data
  245. this.total = total
  246. })
  247. },
  248. resetSubmit(){
  249. this.conditions={
  250. page: 1,
  251. limit: 10,
  252. status:0,
  253. taskTitle:"",
  254. expectedStartDate:getTime(),
  255. expectedEndDate:getTime(1),
  256. goafId: '',
  257. goafOrebelt: '',
  258. goafOrebody: '',
  259. goafOreheight: '',
  260. goafName:"",
  261. goafDevName:""
  262. }
  263. this.goafOrebodys=[]
  264. this.goafOreheights=[]
  265. this.goafNames=[]
  266. this.getData()
  267. },
  268. handleSizeChange(limit){
  269. this.conditions.limit=limit
  270. this.getData()
  271. },
  272. handleCurrentChange(pageNumber){
  273. this.conditions.page=pageNumber
  274. this.getData()
  275. },
  276. changeArea(type) {
  277. const goafs = this.deeepClone(this.goafList)
  278. let goafOrebodys = this.deeepClone(this.goafOrebodys)
  279. let goafOreheights = this.deeepClone(this.goafOreheights)
  280. let goafNames = this.deeepClone(this.goafNames)
  281. if (type === 1) {
  282. goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
  283. goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
  284. this.goafOrebodys = goafOrebodys
  285. this.goafOreheights = []
  286. this.goafNames = []
  287. this.conditions.goafOrebody = ''
  288. this.conditions.goafOreheight = ''
  289. this.conditions.goafName = ''
  290. this.conditions.goafId = ''
  291. } else if (type === 2) {
  292. goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
  293. goafOreheights = this.unique(goafOreheights, 'goafOreheight')
  294. this.goafOreheights = goafOreheights
  295. this.goafNames = []
  296. this.conditions.goafOreheight = ''
  297. this.conditions.goafName = ''
  298. this.conditions.goafId = ''
  299. } else if (type === 3) {
  300. goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
  301. this.goafNames = goafNames
  302. this.conditions.goafName = ''
  303. this.conditions.goafId = ''
  304. } else {
  305. for (let i = 0; i < goafNames.length; i++) {
  306. if (this.conditions.goafId === goafNames[i].goafId) {
  307. this.conditions.goafName = goafNames[i].goafName
  308. }
  309. }
  310. }
  311. this.$forceUpdate()
  312. },
  313. unique(arr = [], name = 'name') {
  314. const res = new Map()
  315. return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
  316. },
  317. deeepClone(params) {
  318. return JSON.parse(JSON.stringify(params))
  319. }
  320. }
  321. }
  322. </script>
  323. <style lang="scss" scoped>
  324. .check-page{
  325. .search-item{
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. margin-bottom: 14px;
  330. span{
  331. font-family: 'Ping Hei';
  332. font-size: 14px;
  333. line-height: 1;
  334. color: rgba(255, 255, 255, 0.7);
  335. }
  336. }
  337. .input,.select,.el-date-editor{
  338. width: 180px;
  339. margin-right:16px;
  340. color: #fff;
  341. }
  342. ::v-deep{
  343. .el-input__wrapper{
  344. background-color: rgba(8, 128, 255, 0.2);
  345. border: 0;
  346. box-shadow: none;
  347. }
  348. .el-input__inner{
  349. color: #fff;
  350. }
  351. }
  352. header{
  353. padding-top: 0.5vh;
  354. padding-bottom: 36px;
  355. }
  356. .tab{
  357. padding-top: 1.5vh;
  358. .item{
  359. display: inline-block;
  360. padding: 5px 10px;
  361. color: #fff;
  362. font-size: 16px;
  363. background: #003B7A;
  364. border: 1px solid #004EA2;
  365. letter-spacing: 0.6px;
  366. margin-right: 24px;
  367. border-radius: 4px 15px 8px 4px;
  368. cursor: pointer;
  369. &.active{
  370. background: #0083CF;
  371. border: 1px solid #0097DD;
  372. }
  373. }
  374. }
  375. .container{
  376. display: flex;
  377. .lf{
  378. width: 60%;
  379. padding-left: 100px;
  380. .search-container{
  381. padding:4.4vh 0 5vh 0;
  382. box-sizing: border-box;
  383. .top{
  384. display: flex;
  385. flex-wrap: wrap;
  386. .search-item{
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. margin-top: 14px;
  391. span{
  392. font-family: 'Ping Hei';
  393. font-size: 14px;
  394. line-height: 1;
  395. color: rgba(255, 255, 255, 0.7);
  396. }
  397. }
  398. }
  399. .input,.select,.el-date-editor{
  400. width: 180px;
  401. margin-right:16px;
  402. color: #fff;
  403. }
  404. ::v-deep{
  405. .el-input__wrapper{
  406. background-color: rgba(8, 128, 255, 0.2);
  407. border: 0;
  408. box-shadow: none;
  409. }
  410. .el-input__inner{
  411. color: #fff;
  412. }
  413. }
  414. .bt{
  415. width: 100px;
  416. height: 36px;
  417. line-height: 36px;
  418. text-align: center;
  419. color: #fff;
  420. font-size: 14px;
  421. background: rgba(8, 128, 255, 0.2);
  422. border-radius: 4px;
  423. margin-top: 14px;
  424. cursor: pointer;
  425. display: inline-block;
  426. &.search{
  427. background: linear-gradient(rgba(94, 226, 255, 1),rgba(79, 175, 255, 1));
  428. margin:14px 10px 0 0;
  429. }
  430. }
  431. }
  432. .lf-container{
  433. overflow-y: auto;
  434. table{
  435. width: 100%;
  436. color: #fff;
  437. font-family: 'Microsoft YaHei UI';
  438. tr:nth-child(1){
  439. td{
  440. color: #BFE7F9;
  441. font-size: 16px;
  442. }
  443. }
  444. td{
  445. font-size: 16px;
  446. color: #D9E1EC;
  447. padding: 8px;
  448. line-height: 1;
  449. border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  450. }
  451. }
  452. .el-pagination-wrap{
  453. float: right;
  454. margin-top: 5vh;
  455. ::v-deep{
  456. .el-pager li,button{
  457. background-color: #00539F;
  458. margin-left: 10px;
  459. color: rgba(255, 255, 255, 0.75);
  460. &.is-active{
  461. background-color: rgba(0, 131, 207, 1);
  462. }
  463. }
  464. }
  465. }
  466. }
  467. }
  468. .rt{
  469. flex: 1;
  470. padding-left: 5%;
  471. box-sizing: border-box;
  472. .head{
  473. height: 32px;
  474. background-image: url(@/views/home/images/home/title.png);
  475. background-size: 100% 100%;
  476. background-repeat: no-repeat;
  477. color: #2affff;
  478. font-size: 20px;
  479. display: flex;
  480. justify-content: space-between;
  481. align-items: center;
  482. text-indent: 24px;
  483. padding: 0 14px;
  484. font-family: "YouSheBiaoTiHei";
  485. letter-spacing: 1px;
  486. margin-top: 4.8vh;
  487. }
  488. .head-info{
  489. display: flex;
  490. justify-content: center;
  491. align-items: center;
  492. padding-top: 20px;
  493. .item{
  494. width: 33.33%;
  495. display: flex;
  496. justify-content: center;
  497. align-items: center;
  498. flex-direction: column;
  499. color: #fff;
  500. font-size: 12px;
  501. &.total{
  502. display: block;
  503. font-weight: bold;
  504. text-align: left;
  505. .name{
  506. font-size: 14px;
  507. line-height: 20px;
  508. }
  509. .number{
  510. font-size: 20px;
  511. line-height: 38px;
  512. font-weight: 700;
  513. background: rgba(108, 128, 151, 0.1)
  514. }
  515. }
  516. &.normal{
  517. border-left:1px solid rgba(255, 255, 255, 0.12);
  518. border-right:1px solid rgba(255, 255, 255, 0.12);
  519. margin: 0 2%;
  520. height: 100%;
  521. .number{
  522. font-size: 20px;
  523. line-height: 28px;
  524. color: #3CD495;
  525. font-weight: 500;
  526. }
  527. }
  528. &.error{
  529. .number{
  530. font-size: 20px;
  531. line-height: 28px;
  532. color: #D4603C;
  533. font-weight: 500;
  534. }
  535. }
  536. }
  537. }
  538. .chart-wrap{
  539. padding-top: 0.8vh;
  540. .title{
  541. color: #fff;
  542. font-size: 18px;
  543. line-height: 20px;
  544. padding: 10px;
  545. position: relative;
  546. font-family: "YouSheBiaoTiHei";
  547. letter-spacing: 1px;
  548. margin-bottom: 2vh;
  549. &::after{
  550. display: block;
  551. content: "";
  552. width: 100%;
  553. height: 3px;
  554. position: absolute;
  555. bottom: 0;
  556. left: 0;
  557. background-image: url('./images/line.png');
  558. background-repeat: no-repeat;
  559. background-size: 100% 100%;
  560. }
  561. }
  562. }
  563. }
  564. }
  565. }
  566. </style>