taskStatistics.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="statistics-box flex-row">
  3. <div class="statistics-all flex-row">
  4. <div class="statistics-progress">
  5. <div class="statistics-progress-num">
  6. <p>{{taskProgress?taskProgress:0 + '%'}}</p>
  7. <p>完成情况</p>
  8. </div>
  9. <el-progress :width="90" type="circle" :percentage="taskProgress?taskProgress:0" :show-text="false"></el-progress>
  10. </div>
  11. <div class="statistics-all-box flex-col">
  12. <span>总任务:<b>{{allCount}}</b></span>
  13. <span>已完成:<b>{{alreadyCount}}</b></span>
  14. </div>
  15. </div>
  16. <ul class="statistics-list flex-row">
  17. <li>
  18. <p class="statistics-list-text">现场未找到(需人工确认):</p>
  19. <p class="statistics-list-num">{{notFoundCount}}</p>
  20. </li>
  21. <li>
  22. <p class="statistics-list-text">待验证任务:</p>
  23. <p class="statistics-list-num">{{waitCount}}</p>
  24. </li>
  25. <li>
  26. <p class="statistics-list-text">待撕码任务:</p>
  27. <p class="statistics-list-num">{{waitTearCount}}</p>
  28. </li>
  29. <li>
  30. <p class="statistics-list-text">待换码任务:</p>
  31. <p class="statistics-list-num">{{waitReplaceCount}}</p>
  32. </li>
  33. </ul>
  34. </div>
  35. </template>
  36. <script>
  37. import {mapGetters} from "vuex"
  38. import {countAssetsTask, queryTaskCount} from "@/api/data_admin/buildTaskApi"
  39. export default {
  40. components: {},
  41. computed: {
  42. ...mapGetters("layout", ["projectId", "secret", "userId"]),
  43. taskProgress() {
  44. if (typeof this.alreadyCount == 'number' && typeof this.allCount == 'number') {
  45. return Math.round(this.alreadyCount / this.allCount * 100)
  46. }
  47. }
  48. },
  49. data() {
  50. return {
  51. allCount: '',//总任务
  52. alreadyCount: '',//已完成
  53. notFoundCount: '',//未找到
  54. waitCount: '',//未完成验证
  55. waitTearCount: '',//未完成撕码任务
  56. waitReplaceCount: ''//未完成换码任务
  57. }
  58. },
  59. created() {
  60. this.getTaskCount();
  61. },
  62. methods: {
  63. getTaskCount(){
  64. queryTaskCount({},(res) => {
  65. this.allCount = res.Count
  66. })
  67. queryTaskCount({Filters: `TaskState=0`},(res) => {
  68. this.alreadyCount = res.Count
  69. })
  70. queryTaskCount({Filters: `TaskState=-1`},(res) => {
  71. this.notFoundCount = res.Count
  72. })
  73. queryTaskCount({Filters: `TaskState=1`},(res) => {
  74. this.waitCount = res.Count
  75. })
  76. countAssetsTask({Filters: `TaskState=1&&TaskType='3'`},(res) => {
  77. this.waitTearCount = res.Count
  78. })
  79. countAssetsTask({Filters: `TaskState=1&&TaskType='2'`},(res) => {
  80. this.waitReplaceCount = res.Count
  81. })
  82. },
  83. upDataList() {
  84. this.getTaskCount()
  85. }
  86. },
  87. watch: {
  88. projectId() {
  89. this.getTaskCount();
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .statistics-box {
  96. height: 120px;
  97. color: #333;
  98. .statistics-all{
  99. flex: 2;
  100. border: 1px solid #c9c9c9;
  101. margin-right: 10px;
  102. background: #fff;
  103. .statistics-progress{
  104. flex: 1;
  105. position: relative;
  106. height: 120px;
  107. box-sizing: border-box;
  108. text-align: center;
  109. padding: 15px 0;
  110. .statistics-progress-num{
  111. font-size: 12px;
  112. line-height: 18px;
  113. position: absolute;
  114. top: 50%;
  115. left: 50%;
  116. transform: translate(-50%, -50%);
  117. }
  118. }
  119. .statistics-all-box{
  120. flex: 1;
  121. font-weight: bold;
  122. padding: 25px 0;
  123. >span{
  124. flex: 1;
  125. font-size: 15px;
  126. line-height: 35px;
  127. }
  128. }
  129. }
  130. .statistics-list{
  131. flex: 7;
  132. >li{
  133. flex: 1;
  134. border: 1px solid #c9c9c9;
  135. padding: 10px;
  136. margin-left: 10px;
  137. background: #fff;
  138. .statistics-list-text{
  139. font-size: 15px;
  140. line-height: 30px;
  141. font-weight: bold;
  142. }
  143. .statistics-list-num{
  144. text-align: center;
  145. font-size: 20px;
  146. line-height: 50px;
  147. font-weight: bold;
  148. }
  149. }
  150. }
  151. }
  152. .flex-row{
  153. display: flex;
  154. flex-direction: row;
  155. }
  156. .flex-col{
  157. display: flex;
  158. flex-direction: column;
  159. }
  160. </style>