runData.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="operation-data">
  3. <div class="row">
  4. <ChannelCheckChart :chartsData="chartsData" />
  5. </div>
  6. <div class="row">
  7. <div class="col">
  8. <SeizedInfo :chartsData="chartsData"/>
  9. </div>
  10. <div class="col">
  11. <SeizedItems :chartsData="chartsData" />
  12. </div>
  13. </div>
  14. <div class="row">
  15. <div class="col">
  16. <SeizedNumAll :chartsData="chartsData"/>
  17. </div>
  18. <div class="col">
  19. <SeizedNum :chartsData="chartsData" />
  20. </div>
  21. </div>
  22. <div class="row">
  23. <SeizedWorkArea :chartsData="chartsData" />
  24. </div>
  25. <div class="row">
  26. <div class="col">
  27. <EventItems :chartsData="chartsData" />
  28. </div>
  29. <div class="col">
  30. <EventType :chartsData="chartsData" />
  31. </div>
  32. <div class="col">
  33. <EventWorkArea :chartsData="chartsData" />
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="col">
  38. <TestItems :chartsData="chartsData" />
  39. </div>
  40. <div class="col">
  41. <TestResult :chartsData="chartsData" />
  42. </div>
  43. <div class="col">
  44. <TestArea :chartsData="chartsData" />
  45. </div>
  46. </div>
  47. <div class="row">
  48. <div class="col">
  49. <SupervisionDistribution :chartsData="supervisionData"/>
  50. </div>
  51. <div class="col">
  52. <InterceptionDistribution :chartsData="interceptionData" />
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script setup>
  58. import { watch } from 'vue'
  59. import ChannelCheckChart from '../../components/ChannelCheckChart.vue';
  60. import SeizedInfo from '../../components/SeizedInfo.vue';
  61. import SeizedItems from '../../components/SeizedItems.vue';
  62. import SeizedNumAll from '../../components/SeizedNumAll.vue';
  63. import SeizedNum from '../../components/SeizedNum.vue';
  64. import SeizedWorkArea from '../../components/SeizedWorkArea.vue';
  65. import EventItems from '../../components/EventItems.vue';
  66. import EventType from '../../components/EventType.vue';
  67. import EventWorkArea from '../../components/EventWorkArea.vue';
  68. import TestItems from '../../components/TestItems.vue';
  69. import TestResult from '../../components/TestResult.vue';
  70. import TestArea from '../../components/TestArea.vue';
  71. import SupervisionDistribution from '../../components/SupervisionDistribution.vue';
  72. import InterceptionDistribution from '../../components/InterceptionDistribution.vue';
  73. import { realtimeInterceptionItem, supervisionProblemPosition } from '@/api/portraitManagement/portraitManagement';
  74. const props = defineProps({
  75. queryParams: {
  76. type: Object,
  77. default: () => ({})
  78. }
  79. })
  80. const chartsData = ref([
  81. {
  82. num: 370,
  83. num1: 330,
  84. num2: 120,
  85. num3: 470,
  86. num4: 570,
  87. rate: 30,
  88. name: '打火机'
  89. },
  90. {
  91. num: 330,
  92. num1: 430,
  93. num2: 420,
  94. num3: 430,
  95. num4: 150,
  96. rate: 60,
  97. name: '火柴'
  98. },
  99. {
  100. num: 410,
  101. num1: 310,
  102. num2: 220,
  103. num3: 370,
  104. num4: 510,
  105. rate: 35,
  106. name: '刀具'
  107. },
  108. {
  109. num: 570,
  110. num1: 440,
  111. num2: 420,
  112. num3: 410,
  113. num4: 470,
  114. rate: 80,
  115. name: '充电宝'
  116. },
  117. {
  118. num: 340,
  119. num1: 330,
  120. num2: 620,
  121. num3: 370,
  122. num4: 170,
  123. rate: 60,
  124. name: '烟火'
  125. },
  126. ])
  127. const supervisionData = ref([])
  128. const interceptionData = ref([])
  129. const fetchSupervisionData = async () => {
  130. try {
  131. const res = await supervisionProblemPosition(props.queryParams)
  132. if (res.code === 200 && res.data) {
  133. supervisionData.value = res.data.map(item => ({
  134. num: item.total,
  135. name: item.name
  136. }))
  137. }
  138. } catch (error) {
  139. console.error('获取各岗位监察问题分布数据失败', error)
  140. }
  141. }
  142. const fetchInterceptionData = async () => {
  143. try {
  144. const res = await realtimeInterceptionItem(props.queryParams)
  145. if (res.code === 200 && res.data) {
  146. interceptionData.value = res.data.map(item => ({
  147. num: item.total,
  148. name: item.name
  149. }))
  150. }
  151. } catch (error) {
  152. console.error('获取实时质控拦截物品分布数据失败', error)
  153. }
  154. }
  155. const fetchData = () => {
  156. fetchSupervisionData()
  157. fetchInterceptionData()
  158. }
  159. watch(() => props.queryParams, () => {
  160. fetchData()
  161. }, { deep: true, immediate: true })
  162. </script>
  163. <style lang="scss" scoped>
  164. .operation-data {
  165. padding: 20px;
  166. .row {
  167. display: flex;
  168. column-gap: 15px;
  169. height: 360px;
  170. margin-bottom: 15px;
  171. .col {
  172. flex: 1;
  173. height: 100%;
  174. :deep(.info-card) {
  175. height: 100%;
  176. }
  177. }
  178. }
  179. }
  180. </style>