check.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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.getData()
  233. },
  234. getData(){
  235. for(let key in this.conditions){
  236. if(this.conditions[key]===undefined||this.conditions[key]===''||this.conditions[key]==='undefined'){
  237. delete this.conditions[key]
  238. }
  239. }
  240. getCheckTaskByPage(this.conditions).then((resp) => {
  241. this.listLoading = false
  242. const {data, total } = resp
  243. this.dataList = data
  244. this.total = total
  245. })
  246. },
  247. resetSubmit(){
  248. this.conditions={
  249. page: 1,
  250. limit: 10,
  251. status:0,
  252. taskTitle:"",
  253. expectedStartDate:getTime(),
  254. expectedEndDate:getTime(1),
  255. goafId: '',
  256. goafOrebelt: '',
  257. goafOrebody: '',
  258. goafOreheight: '',
  259. goafName:"",
  260. goafDevName:""
  261. }
  262. this.goafOrebodys=[]
  263. this.goafOreheights=[]
  264. this.goafNames=[]
  265. this.getData()
  266. },
  267. handleSizeChange(limit){
  268. this.conditions.limit=limit
  269. this.getData()
  270. },
  271. handleCurrentChange(pageNumber){
  272. this.conditions.page=pageNumber
  273. this.getData()
  274. },
  275. changeArea(type) {
  276. const goafs = this.deeepClone(this.goafList)
  277. let goafOrebodys = this.deeepClone(this.goafOrebodys)
  278. let goafOreheights = this.deeepClone(this.goafOreheights)
  279. let goafNames = this.deeepClone(this.goafNames)
  280. if (type === 1) {
  281. goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
  282. goafOrebodys = this.unique(goafOrebodys, 'goafOrebody')
  283. this.goafOrebodys = goafOrebodys
  284. this.goafOreheights = []
  285. this.goafNames = []
  286. this.conditions.goafOrebody = ''
  287. this.conditions.goafOreheight = ''
  288. this.conditions.goafName = ''
  289. this.conditions.goafId = ''
  290. } else if (type === 2) {
  291. goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
  292. goafOreheights = this.unique(goafOrebodys, 'goafOreheight')
  293. this.goafOreheights = goafOreheights
  294. this.goafNames = []
  295. this.conditions.goafOreheight = ''
  296. this.conditions.goafName = ''
  297. this.conditions.goafId = ''
  298. } else if (type === 3) {
  299. goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
  300. this.goafNames = goafNames
  301. this.conditions.goafName = ''
  302. this.conditions.goafId = ''
  303. } else {
  304. for (let i = 0; i < goafNames.length; i++) {
  305. if (this.conditions.goafId === goafNames[i].goafId) {
  306. this.conditions.goafName = goafNames[i].goafName
  307. }
  308. }
  309. }
  310. this.$forceUpdate()
  311. },
  312. unique(arr = [], name = 'name') {
  313. const res = new Map()
  314. return arr.filter((item) => !res.has(item[name]) && res.set(item[name], 1))
  315. },
  316. deeepClone(params) {
  317. return JSON.parse(JSON.stringify(params))
  318. }
  319. }
  320. }
  321. </script>
  322. <style lang="scss" scoped>
  323. .check-page{
  324. .search-item{
  325. display: flex;
  326. justify-content: center;
  327. align-items: center;
  328. margin-bottom: 14px;
  329. span{
  330. font-family: 'Ping Hei';
  331. font-size: 14px;
  332. line-height: 1;
  333. color: rgba(255, 255, 255, 0.7);
  334. }
  335. }
  336. .input,.select,.el-date-editor{
  337. width: 180px;
  338. margin-right:16px;
  339. color: #fff;
  340. }
  341. ::v-deep{
  342. .el-input__wrapper{
  343. background-color: rgba(8, 128, 255, 0.2);
  344. border: 0;
  345. box-shadow: none;
  346. }
  347. .el-input__inner{
  348. color: #fff;
  349. }
  350. }
  351. header{
  352. padding-top: 0.5vh;
  353. padding-bottom: 36px;
  354. }
  355. .tab{
  356. padding-top: 1.5vh;
  357. .item{
  358. display: inline-block;
  359. padding: 5px 10px;
  360. color: #fff;
  361. font-size: 16px;
  362. background: #003B7A;
  363. border: 1px solid #004EA2;
  364. letter-spacing: 0.6px;
  365. margin-right: 24px;
  366. border-radius: 4px 15px 8px 4px;
  367. cursor: pointer;
  368. &.active{
  369. background: #0083CF;
  370. border: 1px solid #0097DD;
  371. }
  372. }
  373. }
  374. .container{
  375. display: flex;
  376. .lf{
  377. width: 60%;
  378. padding-left: 100px;
  379. .search-container{
  380. padding:4.4vh 0 5vh 0;
  381. box-sizing: border-box;
  382. .top{
  383. display: flex;
  384. flex-wrap: wrap;
  385. .search-item{
  386. display: flex;
  387. justify-content: center;
  388. align-items: center;
  389. margin-top: 14px;
  390. span{
  391. font-family: 'Ping Hei';
  392. font-size: 14px;
  393. line-height: 1;
  394. color: rgba(255, 255, 255, 0.7);
  395. }
  396. }
  397. }
  398. .input,.select,.el-date-editor{
  399. width: 180px;
  400. margin-right:16px;
  401. color: #fff;
  402. }
  403. ::v-deep{
  404. .el-input__wrapper{
  405. background-color: rgba(8, 128, 255, 0.2);
  406. border: 0;
  407. box-shadow: none;
  408. }
  409. .el-input__inner{
  410. color: #fff;
  411. }
  412. }
  413. .bt{
  414. width: 100px;
  415. height: 36px;
  416. line-height: 36px;
  417. text-align: center;
  418. color: #fff;
  419. font-size: 14px;
  420. background: rgba(8, 128, 255, 0.2);
  421. border-radius: 4px;
  422. margin-top: 14px;
  423. cursor: pointer;
  424. display: inline-block;
  425. &.search{
  426. background: linear-gradient(rgba(94, 226, 255, 1),rgba(79, 175, 255, 1));
  427. margin:14px 10px 0 0;
  428. }
  429. }
  430. }
  431. .lf-container{
  432. overflow-y: auto;
  433. table{
  434. width: 100%;
  435. color: #fff;
  436. font-family: 'Microsoft YaHei UI';
  437. tr:nth-child(1){
  438. td{
  439. color: #BFE7F9;
  440. font-size: 16px;
  441. }
  442. }
  443. td{
  444. font-size: 16px;
  445. color: #D9E1EC;
  446. padding: 8px;
  447. line-height: 1;
  448. border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  449. }
  450. }
  451. .el-pagination-wrap{
  452. float: right;
  453. margin-top: 5vh;
  454. ::v-deep{
  455. .el-pager li,button{
  456. background-color: #00539F;
  457. margin-left: 10px;
  458. color: rgba(255, 255, 255, 0.75);
  459. &.is-active{
  460. background-color: rgba(0, 131, 207, 1);
  461. }
  462. }
  463. }
  464. }
  465. }
  466. }
  467. .rt{
  468. flex: 1;
  469. padding-left: 5%;
  470. box-sizing: border-box;
  471. .head{
  472. height: 32px;
  473. background-image: url(@/views/home/images/home/title.png);
  474. background-size: 100% 100%;
  475. background-repeat: no-repeat;
  476. color: #2affff;
  477. font-size: 20px;
  478. display: flex;
  479. justify-content: space-between;
  480. align-items: center;
  481. text-indent: 24px;
  482. padding: 0 14px;
  483. font-family: "YouSheBiaoTiHei";
  484. letter-spacing: 1px;
  485. margin-top: 4.8vh;
  486. }
  487. .head-info{
  488. display: flex;
  489. justify-content: center;
  490. align-items: center;
  491. padding-top: 20px;
  492. .item{
  493. width: 33.33%;
  494. display: flex;
  495. justify-content: center;
  496. align-items: center;
  497. flex-direction: column;
  498. color: #fff;
  499. font-size: 12px;
  500. &.total{
  501. display: block;
  502. font-weight: bold;
  503. text-align: left;
  504. .name{
  505. font-size: 14px;
  506. line-height: 20px;
  507. }
  508. .number{
  509. font-size: 20px;
  510. line-height: 38px;
  511. font-weight: 700;
  512. background: rgba(108, 128, 151, 0.1)
  513. }
  514. }
  515. &.normal{
  516. border-left:1px solid rgba(255, 255, 255, 0.12);
  517. border-right:1px solid rgba(255, 255, 255, 0.12);
  518. margin: 0 2%;
  519. height: 100%;
  520. .number{
  521. font-size: 20px;
  522. line-height: 28px;
  523. color: #3CD495;
  524. font-weight: 500;
  525. }
  526. }
  527. &.error{
  528. .number{
  529. font-size: 20px;
  530. line-height: 28px;
  531. color: #D4603C;
  532. font-weight: 500;
  533. }
  534. }
  535. }
  536. }
  537. .chart-wrap{
  538. padding-top: 0.8vh;
  539. .title{
  540. color: #fff;
  541. font-size: 18px;
  542. line-height: 20px;
  543. padding: 10px;
  544. position: relative;
  545. font-family: "YouSheBiaoTiHei";
  546. letter-spacing: 1px;
  547. margin-bottom: 2vh;
  548. &::after{
  549. display: block;
  550. content: "";
  551. width: 100%;
  552. height: 3px;
  553. position: absolute;
  554. bottom: 0;
  555. left: 0;
  556. background-image: url('./images/line.png');
  557. background-repeat: no-repeat;
  558. background-size: 100% 100%;
  559. }
  560. }
  561. }
  562. }
  563. }
  564. }
  565. </style>