index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div class="group-profile-page">
  3. <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
  4. <SearchBar v-model:visible="searchVisible" ref="searchBar" @search="handleSearch"
  5. :deptType="'BRIGADE'" />
  6. <PentagonGroup :items="pentagonItems" />
  7. <Profile v-if="activeTab === 0" :query-params="queryParams" />
  8. <RunData v-else :query-params="queryParams" />
  9. </Page>
  10. </div>
  11. </template>
  12. <script setup>
  13. import { ref, onMounted } from 'vue'
  14. import Page from '../components/page.vue'
  15. import SearchBar from '../components/SearchBar.vue'
  16. import Profile from './component/profile.vue'
  17. import RunData from './component/runData.vue'
  18. import PentagonGroup from '../components/PentagonGroup.vue'
  19. import { countDeptTeamStats } from '@/api/portraitManagement/portraitManagement'
  20. import zongheIcon from '@/assets/icons/portrait/zonghe_icon.png'
  21. import renyuanIcon from '@/assets/icons/portrait/renyuan_icon.png'
  22. import zu02Icon from '@/assets/icons/portrait/zu02_icon.png'
  23. import nianlingIcon from '@/assets/icons/portrait/nianling_icon.png'
  24. import silingIcon from '@/assets/icons/portrait/siling_icon.png'
  25. const activeTab = ref(0)
  26. const searchVisible = ref(false)
  27. const queryParams = ref({})
  28. const pentagonItems = ref([])
  29. const invokerCountDeptTeamStats = (params) => {
  30. const copyParams = {
  31. deptId: params.deptId,
  32. }
  33. countDeptTeamStats(copyParams).then(res => {
  34. if (res.code === 200 && res.data) {
  35. const result = res.data
  36. pentagonItems.value = [
  37. {
  38. value: result.totalScore,
  39. label: '综合得分',
  40. iconPath: zongheIcon,
  41. cornerRadius: 20,
  42. vertices: {
  43. topLeft: { x: 0, y: 0 },
  44. topRight: { x: 300, y: 0 },
  45. bottomRight: { x: 260, y: 200 },
  46. bottomLeft: { x: 0, y: 200 }
  47. },
  48. cardContentStyle: {
  49. gap: '100px'
  50. },
  51. edgeGradients: {
  52. top: { start: '#0f46fa', end: 'transparent' },
  53. right: { start: 'transparent', end: '#9903C1' },
  54. bottom: { start: '#9903C1', end: 'transparent' },
  55. left: { start: 'transparent', end: '#0f46fa' }
  56. },
  57. bgGradientStart: 'rgba(33,33,58,0.95)',
  58. bgGradientEnd: 'rgba(15,70,250,0.2)'
  59. },
  60. {
  61. value: result.employeeCount,
  62. label: '人员数量',
  63. iconPath: renyuanIcon,
  64. cornerRadius: 20,
  65. vertices: {
  66. topLeft: { x: 10, y: 0 },
  67. topRight: { x: 300, y: 0 },
  68. bottomRight: { x: 260, y: 200 },
  69. bottomLeft: { x: -30, y: 200 }
  70. }, cardContentStyle: {
  71. gap: '100px'
  72. },
  73. edgeGradients: {
  74. top: { start: '#0f46fa', end: 'transparent' },
  75. right: { start: 'transparent', end: '#9903C1' },
  76. bottom: { start: '#9903C1', end: 'transparent' },
  77. left: { start: 'transparent', end: '#0f46fa' }
  78. },
  79. bgGradientStart: 'rgba(33,33,58,0.95)',
  80. bgGradientEnd: 'rgba(15,70,250,0.2)'
  81. },
  82. {
  83. value: result.deptName,
  84. label: '',
  85. iconPath: zu02Icon,
  86. iconStyle: {
  87. width: '250px',
  88. height: '250px'
  89. },
  90. valueStyle: {
  91. fontSize: '48px',
  92. bottom: '26px',
  93. position: 'relative'
  94. },
  95. vertical: true,
  96. cornerRadius: 20,
  97. vertices: {
  98. topLeft: { x: 10, y: 0 },
  99. topRight: { x: 280, y: 0 },
  100. bottomRight: { x: 320, y: 200 },
  101. bottomLeft: { x: -30, y: 200 }
  102. },
  103. cardContentStyle: {
  104. gap: '0px',
  105. position: 'relative',
  106. bottom: '65px'
  107. },
  108. edgeGradients: {
  109. top: { start: '#0f46fa', end: 'transparent' },
  110. right: { start: 'transparent', end: '#9903C1' },
  111. bottom: { start: '#9903C1', end: 'transparent' },
  112. left: { start: 'transparent', end: '#0f46fa' }
  113. },
  114. bgGradientStart: 'rgba(33,33,58,0.95)',
  115. bgGradientEnd: 'rgba(15,70,250,0.2)'
  116. },
  117. {
  118. value: result.avgAge,
  119. label: '平均年龄',
  120. iconPath: nianlingIcon,
  121. cornerRadius: 20,
  122. vertices: {
  123. topLeft: { x: -10, y: 0 },
  124. topRight: { x: 290, y: 0 },
  125. bottomRight: { x: 330, y: 200 },
  126. bottomLeft: { x: 30, y: 200 }
  127. },
  128. cardContentStyle: {
  129. gap: '100px'
  130. },
  131. edgeGradients: {
  132. top: { start: '#0f46fa', end: 'transparent' },
  133. right: { start: 'transparent', end: '#9903C1' },
  134. bottom: { start: '#9903C1', end: 'transparent' },
  135. left: { start: 'transparent', end: '#0f46fa' }
  136. },
  137. bgGradientStart: 'rgba(33,33,58,0.95)',
  138. bgGradientEnd: 'rgba(15,70,250,0.2)'
  139. },
  140. {
  141. value: result.avgWorkYears,
  142. label: '平均司龄',
  143. iconPath: silingIcon,
  144. cornerRadius: 20,
  145. vertices: {
  146. topLeft: { x: 0, y: 0 },
  147. topRight: { x: 300, y: 0 },
  148. bottomRight: { x: 300, y: 200 },
  149. bottomLeft: { x: 40, y: 200 }
  150. },
  151. cardContentStyle: {
  152. gap: '100px'
  153. },
  154. edgeGradients: {
  155. top: { start: '#0f46fa', end: 'transparent' },
  156. right: { start: 'transparent', end: '#9903C1' },
  157. bottom: { start: '#9903C1', end: 'transparent' },
  158. left: { start: 'transparent', end: '#0f46fa' }
  159. },
  160. bgGradientStart: 'rgba(33,33,58,0.95)',
  161. bgGradientEnd: 'rgba(15,70,250,0.2)'
  162. }
  163. ]
  164. }
  165. })
  166. }
  167. const handleSearch = (params) => {
  168. queryParams.value = params
  169. invokerCountDeptTeamStats(params)
  170. }
  171. const handleTabChange = (index) => {
  172. activeTab.value = index
  173. }
  174. const searchBar = ref(null)
  175. onMounted(() => {
  176. const defParams = Object.assign({ deptId: '' }, searchBar.value.getDefQuery())
  177. queryParams.value = defParams
  178. })
  179. </script>
  180. <style lang="scss" scoped>
  181. .group-profile-page {
  182. width: 100%;
  183. min-height: 100vh;
  184. overflow-y: auto;
  185. }
  186. </style>