LeftCounter.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="content-container">
  3. <el-row class="title-bar">
  4. <p class="page-title">巡检任务</p>
  5. </el-row>
  6. <el-row class="btn-group">
  7. <el-button class="send-menu" @click="handleAdd">创建任务</el-button>
  8. </el-row>
  9. <el-row class="list-group">
  10. <div>
  11. <div :class="currentSelect === 0 ? 'list-item active' : 'list-item'" @click="selectItem(0)">
  12. <el-col :span="18">
  13. <p class="title">待处理</p>
  14. </el-col>
  15. </div>
  16. <div :class="currentSelect === 1 ? 'list-item active' : 'list-item'" @click="selectItem(1)">
  17. <el-col :span="18">
  18. <p class="title">处理完成</p>
  19. </el-col>
  20. </div>
  21. <div :class="currentSelect === 2 ? 'list-item active' : 'list-item'" @click="selectItem(2)">
  22. <el-col :span="18">
  23. <p class="title">逾期</p>
  24. </el-col>
  25. </div>
  26. </div>
  27. </el-row>
  28. <task ref="AddCheckTask" title="新增检查任务" @formSuccess="loadData" />
  29. </div>
  30. </template>
  31. <script>
  32. import Task from './CheckTask.vue'
  33. import { getCheckTaskCounter } from '@/api/aqpt/checkTaskStatisApi'
  34. export default {
  35. name: 'CheckTaskCounter',
  36. components: {
  37. Task
  38. },
  39. data() {
  40. return {
  41. currentSelect: 0
  42. }
  43. },
  44. mounted() {
  45. this.getData()
  46. },
  47. methods: {
  48. // Load Data
  49. loadData() {
  50. this.getData()
  51. this.setItem(this.currentSelect)
  52. },
  53. // Add Action
  54. handleAdd() {
  55. this.$refs['AddCheckTask'].showAddModel()
  56. },
  57. // fetch data
  58. getData() {
  59. getCheckTaskCounter().then((resp) => {
  60. const { code, data, msg } = resp
  61. if (code === 0) {
  62. this.counter = data
  63. } else {
  64. this.$message.error(msg)
  65. }
  66. }).catch((error) => {
  67. console.log(error)
  68. })
  69. },
  70. // 选中事件
  71. selectItem(ival) {
  72. this.currentSelect = ival
  73. this.$emit('selectItem', ival)
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .content-container {
  80. margin: 10px;
  81. height: calc(100vh - 90px);
  82. .title-bar {
  83. height: 40px;
  84. line-height: 40px;
  85. text-indent: 15px;
  86. background: #113849;
  87. margin-bottom: 15px;
  88. .page-title {
  89. font-size: 16px;
  90. color: #FFF;
  91. margin: 0;
  92. font-weight: bold;
  93. }
  94. }
  95. .sub-title-bar {
  96. height: 40px;
  97. line-height: 40px;
  98. text-indent: 15px;
  99. background: #113849;
  100. margin-bottom: 15px;
  101. .sub-title {
  102. font-size: 16px;
  103. color: #FFF;
  104. margin: 0;
  105. }
  106. }
  107. .btn-group {
  108. margin-bottom: 10px;
  109. padding-right: 15px;
  110. .send-menu {
  111. width: 100%;
  112. background: #3D5F76;
  113. color: #FFF;
  114. border-color: #3D5F76;
  115. &:hover {
  116. background: #283c4c;
  117. color: #FFF;
  118. border-color: #283c4c;
  119. }
  120. }
  121. }
  122. .list-group {
  123. background: #193142;
  124. p {
  125. margin: 0;
  126. padding: 0;
  127. }
  128. .count {
  129. text-align: right;
  130. }
  131. .list-item {
  132. height: 40px;
  133. line-height: 40px;
  134. color: #FFF;
  135. padding: 0 30px;
  136. font-size: 14px;
  137. &.active {
  138. color: #08A6DC;
  139. position: relative;
  140. &::after {
  141. position: absolute;
  142. content: "";
  143. width: 0;
  144. height: 0;
  145. top: calc(50% - 3.5px);
  146. right: -3px;
  147. border-left: 7px solid transparent;
  148. border-right: 7px solid transparent;
  149. border-bottom: 7px solid #08A6DC;
  150. transform: rotate(270deg);
  151. }
  152. }
  153. }
  154. }
  155. }
  156. </style>