LeftCounter.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="content-container">
  3. <el-row class="content-title">
  4. <span>{{ title }}</span>
  5. </el-row>
  6. <el-row class="btn-group">
  7. <el-button class="send-menu" @click="handleSubmitTask">登记预警</el-button>
  8. </el-row>
  9. <!-- <el-row class="list-group">
  10. <div>
  11. <div :class="curSel === 1 ? 'list-item active' : 'list-item'" @click="selectItem(1)">
  12. <el-col :span="18">
  13. <p class="title">处理中</p>
  14. </el-col>
  15. </div>
  16. <div :class="curSel === 2 ? 'list-item active' : 'list-item'" @click="selectItem(2)">
  17. <el-col :span="18">
  18. <p class="title">完成</p>
  19. </el-col>
  20. </div>
  21. <div :class="curSel === -1 ? 'list-item active' : 'list-item'" @click="selectItem(-1)">
  22. <el-col :span="18">
  23. <p class="title">撤销</p>
  24. </el-col>
  25. </div>
  26. <div :class="curSel === 0 ? 'list-item active' : 'list-item'" @click="selectItem(0)">
  27. <el-col :span="18">
  28. <p class="title">未提交</p>
  29. </el-col>
  30. </div>
  31. </div>
  32. </el-row> -->
  33. <submit-task ref="SubmitTask" title="预警登记" @formSuccess="selectItem(curSel)" />
  34. </div>
  35. </template>
  36. <script>
  37. import SubmitTask from '../activity/Submit'
  38. import { getDangerCounter } from '@/api/goaf/dangerStatisApi'
  39. export default {
  40. components: {
  41. SubmitTask
  42. },
  43. props: {
  44. value: {
  45. type: String,
  46. default: ''
  47. }
  48. },
  49. data() {
  50. return {
  51. title: '预警管理',
  52. dangerCounter: {
  53. myCreatedCount: 0,
  54. myHandlingCount: 0,
  55. myHandledCount: 0,
  56. myCanceledCount: 0,
  57. groupHandlingCount: 0,
  58. groupSubmitCount: 0,
  59. groupReviewCount: 0,
  60. groupRectifyCount: 0,
  61. groupAcceptCount: 0
  62. },
  63. curSel: 1
  64. }
  65. },
  66. mounted() {
  67. // this.loadData()
  68. // this.selectItem(this.curSel)
  69. },
  70. methods: {
  71. // 加载数据
  72. loadData() {
  73. this.getData()
  74. },
  75. // 添加
  76. handleSubmitTask() {
  77. this.$refs['SubmitTask'].start()
  78. },
  79. // 初始化
  80. getData() {
  81. getDangerCounter().then((resp) => {
  82. const { code, data, msg } = resp
  83. if (code === 0) {
  84. this.dangerCounter = data
  85. } else {
  86. this.$message.error(msg)
  87. }
  88. }).catch((error) => {
  89. console.log(error)
  90. })
  91. },
  92. // “选择” 处理
  93. selectItem(val) {
  94. this.curSel = val
  95. this.$emit('selectItem', val)
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .content-container {
  102. margin: 10px;
  103. padding: 10px;
  104. height: calc(100vh - 95px);
  105. .title-bar {
  106. height: 40px;
  107. line-height: 40px;
  108. text-indent: 15px;
  109. background: #113849;
  110. .content-title {
  111. font-size: 16px;
  112. color: #FFF;
  113. margin: 0;
  114. font-weight: bold;
  115. }
  116. }
  117. .sub-title-bar {
  118. height: 40px;
  119. line-height: 40px;
  120. text-indent: 15px;
  121. background: #113849;
  122. margin-top: 10px;
  123. margin-bottom: 5px;
  124. .sub-title {
  125. font-size: 16px;
  126. color: #FFF;
  127. margin: 0;
  128. }
  129. }
  130. .btn-group {
  131. margin-top: 20px;
  132. .send-menu {
  133. width: 90%;
  134. background: #3D5F76;
  135. color: #FFF;
  136. border-color: #3D5F76;
  137. &:hover {
  138. background: #283c4c;
  139. color: #FFF;
  140. border-color: #283c4c;
  141. }
  142. }
  143. }
  144. .list-group {
  145. background: #193142;
  146. p {
  147. margin: 0;
  148. padding: 0;
  149. }
  150. .count {
  151. text-align: right;
  152. }
  153. .list-item {
  154. height: 40px;
  155. line-height: 40px;
  156. color: #FFF;
  157. padding: 0 30px;
  158. font-size: 14px;
  159. &.active {
  160. color: #08A6DC;
  161. position: relative;
  162. &::after {
  163. position: absolute;
  164. content: "";
  165. width: 0;
  166. height: 0;
  167. top: calc(50% - 3.5px);
  168. right: -3px;
  169. border-left: 7px solid transparent;
  170. border-right: 7px solid transparent;
  171. border-bottom: 7px solid #08A6DC;
  172. transform: rotate(270deg);
  173. }
  174. }
  175. }
  176. }
  177. }
  178. </style>