check.vue 21 KB

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