alertRectifyInfo.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="item report">
  3. <div class="title">
  4. <span class="name">告警整改情况</span>
  5. </div>
  6. <div class="container" :style="height?'height:'+height:''">
  7. <vueSeamlessScroll ref="seamlessScroll" :data="items" :class-option="defaultOption">
  8. <div class="table-wrap">
  9. <table>
  10. <tr class="report-title">
  11. <td>名称</td>
  12. <td>未完成</td>
  13. <td>已完成</td>
  14. <td>操作</td>
  15. </tr>
  16. <tr v-for="(item,index) in items" :key="index" class="report-item">
  17. <td>{{ parseTime(item.goafSensorAlarmReportTime,'{y}-{m}-{d}') }}告警整改情况</td>
  18. <td>{{ item.goafSensorAlarmEndNum }}</td>
  19. <td>{{ item.goafSensorAlarmFinishNum }}</td>
  20. <td class="handle">
  21. <span class="edit" @click="handle(item,1)">编辑</span>
  22. <span class="detail" @click="handle(item,2)">查看</span>
  23. </td>
  24. </tr>
  25. </table>
  26. </div>
  27. </vueSeamlessScroll>
  28. <div class="pagination-warp" style="text-align: right;">
  29. <el-pagination
  30. small
  31. layout="prev, pager, next"
  32. :total="total"
  33. :page-size="conditions.limit"
  34. background
  35. style="background-color:transparent ;"
  36. @current-change="changePageNumber"
  37. />
  38. </div>
  39. </div>
  40. <alertRectifyHand ref="alertRectifyHand" @success="handlesuccess" />
  41. </div>
  42. </template>
  43. <script>
  44. import { getAlertRectifyInfoByPage } from '@/api/goaf/alarm'
  45. import vueSeamlessScroll from 'vue-seamless-scroll'
  46. import alertRectifyHand from './alertRectifyHand.vue'
  47. import { parseTime } from '@/utils'
  48. export default {
  49. name: 'AlertRectifyInfo',
  50. components: {
  51. vueSeamlessScroll,
  52. alertRectifyHand
  53. },
  54. props: {
  55. height: {
  56. type: String,
  57. default: ''
  58. }
  59. },
  60. data() {
  61. return {
  62. defaultOption: {
  63. step: 1, // 数值越大速度滚动越快
  64. hoverStop: true, // 是否开启鼠标悬停stop
  65. direction: 1, // 0向下 1向上 2向左 3向右
  66. openWatch: true,
  67. singleHeight: 0,
  68. singleWidth: 0,
  69. waitTime: 1000
  70. },
  71. items: [],
  72. conditions: {
  73. page: 1,
  74. limit: 5
  75. },
  76. total: 0
  77. }
  78. },
  79. created() {
  80. this.loadData()
  81. },
  82. methods: {
  83. parseTime,
  84. dangerStatus(val) {
  85. const status = ['待提交', '待评审', '待整改', '待验收', '完成']
  86. return val === -1 ? '撤销' : status[val]
  87. },
  88. AlarmLevel(val) {
  89. const obj = { 0: '一般', 1: '重大' }
  90. return obj[val] || '--'
  91. },
  92. loadData() {
  93. getAlertRectifyInfoByPage(this.conditions).then((res) => {
  94. const { data } = res
  95. this.total = data.totalCount
  96. this.items = data.list
  97. })
  98. },
  99. handle(data, type) {
  100. this.$refs['alertRectifyHand'].loadData(data, type)
  101. },
  102. handlesuccess() {
  103. this.loadData()
  104. },
  105. changePageNumber(page) {
  106. this.conditions.page = page
  107. this.loadData()
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .container{
  114. height: 36vh !important;
  115. display: flex;
  116. flex-direction: column;
  117. justify-content: space-between;
  118. padding-bottom: 5px;
  119. box-sizing: border-box;
  120. .table-wrap{
  121. table{
  122. tr td{
  123. font-size: 8px !important;
  124. text-align: center;
  125. &.handle{
  126. .edit{
  127. color: #2AFFFF;
  128. padding: 5px;
  129. }
  130. .detail{
  131. color: #e0dbdb;
  132. padding: 5px;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. </style>