taskStatistics.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. },
  84. watch: {
  85. projectId() {
  86. this.getTaskCount();
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .statistics-box {
  93. height: 120px;
  94. color: #333;
  95. .statistics-all{
  96. flex: 2;
  97. border: 1px solid #c9c9c9;
  98. margin-right: 10px;
  99. background: #fff;
  100. .statistics-progress{
  101. flex: 1;
  102. position: relative;
  103. height: 120px;
  104. box-sizing: border-box;
  105. text-align: center;
  106. padding: 15px 0;
  107. .statistics-progress-num{
  108. font-size: 12px;
  109. line-height: 18px;
  110. position: absolute;
  111. top: 50%;
  112. left: 50%;
  113. transform: translate(-50%, -50%);
  114. }
  115. }
  116. .statistics-all-box{
  117. flex: 1;
  118. font-weight: bold;
  119. padding: 25px 0;
  120. >span{
  121. flex: 1;
  122. font-size: 15px;
  123. line-height: 35px;
  124. }
  125. }
  126. }
  127. .statistics-list{
  128. flex: 7;
  129. >li{
  130. flex: 1;
  131. border: 1px solid #c9c9c9;
  132. padding: 10px;
  133. margin-left: 10px;
  134. background: #fff;
  135. .statistics-list-text{
  136. font-size: 15px;
  137. line-height: 30px;
  138. font-weight: bold;
  139. }
  140. .statistics-list-num{
  141. text-align: center;
  142. font-size: 20px;
  143. line-height: 50px;
  144. font-weight: bold;
  145. }
  146. }
  147. }
  148. }
  149. .flex-row{
  150. display: flex;
  151. flex-direction: row;
  152. }
  153. .flex-col{
  154. display: flex;
  155. flex-direction: column;
  156. }
  157. </style>