OrganizationalPortraitSectionLevel.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class="content">
  3. <div class="content-top">
  4. <div class="content-left">
  5. <div class="personal" v-if=" pageType === 'personal' ">
  6. <div>
  7. <QualificationCapabilityPersonal />
  8. </div>
  9. <div style="height: 280px;">
  10. <Attendance type="personal" />
  11. </div>
  12. </div>
  13. <div class="department" v-else>
  14. <QualificationCapability />
  15. </div>
  16. </div>
  17. <div class="content-center">
  18. <div class="userSelectParams">
  19. <CustomStyleSelect type="tree" :propsConfig="{ value: 'id', showPrefix: false }" v-model="params.deptId"
  20. :options="departments" />
  21. </div>
  22. <div class="quantity-overview">
  23. <div class="quantity-overview-item" v-for=" item in pageInfo " :key="item.label" :data-title="item.label">
  24. <div>{{ item.desc }}</div>
  25. <div style="font-size: 22px;">{{ getLabel( item.value, item.list ) }}</div>
  26. </div>
  27. </div>
  28. <template v-if=" pageType === 'personal' ">
  29. <div style="flex: 1; overflow: hidden;">
  30. <CollaborationPersonal />
  31. </div>
  32. <div class="quantity-buttom">
  33. <WorkOutput type="personal" />
  34. <LearningGrowth type="personal" />
  35. </div>
  36. </template>
  37. <Collaboration v-else />
  38. </div>
  39. <div class="content-right">
  40. <!-- if 销毁组件 重制布局 -->
  41. <template v-if="pageType === 'personal'">
  42. <StandardExecution :type="pageType" />
  43. <SubjectiveImpression :type="pageType" />
  44. </template>
  45. <template v-else>
  46. <StandardExecution :type="pageType" />
  47. <SubjectiveImpression :type="pageType" />
  48. </template>
  49. </div>
  50. </div>
  51. <div class="content-bottom" v-if=" pageType !== 'personal' ">
  52. <Attendance :type="pageType" />
  53. <WorkOutput :type="pageType" />
  54. <LearningGrowth :type="pageType" />
  55. <DepartmentInfo :type="pageType" />
  56. </div>
  57. </div>
  58. </template>
  59. <script setup>
  60. import {
  61. QualificationCapability,
  62. Collaboration,
  63. StandardExecution,
  64. SubjectiveImpression,
  65. Attendance,
  66. WorkOutput,
  67. LearningGrowth,
  68. DepartmentInfo,
  69. CustomStyleSelect,
  70. CollaborationPersonal,
  71. QualificationCapabilityPersonal
  72. } from '../pageItems';
  73. import { getOverview, getDeptUserTree } from '@/api/item/items'
  74. import moment from 'moment'
  75. import { useDict } from '@/utils/dict'
  76. import { useTimeOut } from '../pageItems/useTimeOut'
  77. import { provide, computed } from 'vue'
  78. const dictList = useDict(
  79. 'sys_user_working_style',
  80. 'sys_user_personality_trait',
  81. 'sys_user_capability_performance',
  82. 'sys_user_interpersonal_interaction',
  83. 'sys_user_growth_potential')
  84. const params = ref({
  85. deptId: ''
  86. })
  87. const defaultIndex = ref(0)
  88. const flatDepartments = ref([])
  89. const pageType = computed(() => {
  90. const item = flatDepartments.value.find(item => String(item.id) === String(params.value.deptId)) || { type: 'department' }
  91. return item.type
  92. })
  93. const departments = ref([])
  94. const provideParams = computed(() => {
  95. return {
  96. deptId: params.value.deptId
  97. }
  98. })
  99. try {
  100. getDeptUserTree().then(res => {
  101. const flatDepartmentsList = []
  102. const appendItem = (list) => {
  103. list.forEach(attr => {
  104. let type = 'department'
  105. if (attr.deptType === 'BRIGADE') {
  106. type = 'brigade'
  107. }
  108. if (attr.deptType === 'MANAGER') {
  109. type = 'department'
  110. }
  111. if (attr.deptType === 'TEAMS') {
  112. type = 'team'
  113. }
  114. if (attr.nodeType === 'user') {
  115. type = 'personal'
  116. }
  117. flatDepartmentsList.push({
  118. id: attr.id,
  119. type: type
  120. })
  121. if (attr.children && attr.children.length) {
  122. appendItem(attr.children)
  123. }
  124. })
  125. }
  126. departments.value = res.data.reduce((cur, acc) => {
  127. acc.children && acc.children.length && cur.push(...acc.children)
  128. appendItem(acc.children)
  129. return cur
  130. }, [])
  131. flatDepartments.value = flatDepartmentsList
  132. params.value.deptId = departments.value[ 0 ] ? departments.value[ 0 ].id : ''
  133. })
  134. } catch (err) { }
  135. provide('provideParams', provideParams)
  136. const infoNumber = ref({})
  137. const pageInfo = computed(() => {
  138. return pageType.value === 'personal' ? [
  139. {
  140. label: '资质能力',
  141. value: infoNumber.value.qualificationLevel
  142. },
  143. {
  144. label: '工作履历',
  145. desc: '安检工作年限',
  146. value: infoNumber.value.workYears
  147. },
  148. {
  149. label: '出勤投入',
  150. desc: '上岗时长',
  151. value: (infoNumber.value.avgWorkingHours || 0) + 'h'
  152. },
  153. {
  154. label: '工作产出',
  155. desc: '有效查获数据',
  156. value: infoNumber.value.avgSeizureCount
  157. },
  158. {
  159. label: '标准执行',
  160. desc: '巡检问题总次数',
  161. value: infoNumber.value.checkCount
  162. },
  163. {
  164. label: '学习成长',
  165. desc: '平均分',
  166. value: infoNumber.value.learningGrowthScore
  167. },
  168. {
  169. label: '协调配合',
  170. desc: '工作风格',
  171. value: infoNumber.value.workingStyle,
  172. list: dictList.sys_user_working_style.value
  173. },
  174. {
  175. label: '主观印象',
  176. desc: '高频词',
  177. value: infoNumber.value.subjectiveImpression,
  178. list: [
  179. ...dictList.sys_user_personality_trait.value,
  180. ...dictList.sys_user_capability_performance.value,
  181. ...dictList.sys_user_interpersonal_interaction.value,
  182. ...dictList.sys_user_growth_potential.value
  183. ]
  184. },
  185. ] : [
  186. {
  187. label: '资质能力',
  188. desc: '高级资质等级人数',
  189. value: infoNumber.value.qualificationLevel
  190. },
  191. {
  192. label: '工作履历',
  193. desc: '平均安检工作年限',
  194. value: infoNumber.value.workYears
  195. },
  196. {
  197. label: '出勤投入',
  198. desc: '人均上岗时长',
  199. value: (infoNumber.value.avgWorkingHours || 0) + 'h'
  200. },
  201. {
  202. label: '工作产出',
  203. desc: '有效查获数据',
  204. value: infoNumber.value.avgSeizureCount
  205. },
  206. {
  207. label: '标准执行',
  208. desc: '巡检问题总次数',
  209. value: infoNumber.value.checkCount
  210. },
  211. {
  212. label: '学习成长',
  213. desc: '平均分',
  214. value: infoNumber.value.learningGrowthScore
  215. },
  216. {
  217. label: '协调配合',
  218. desc: '工作风格',
  219. value: infoNumber.value.workingStyle,
  220. list: dictList.sys_user_working_style.value
  221. },
  222. {
  223. label: '主观印象',
  224. desc: '高频词',
  225. value: infoNumber.value.subjectiveImpression,
  226. list: [
  227. ...dictList.sys_user_personality_trait.value,
  228. ...dictList.sys_user_capability_performance.value,
  229. ...dictList.sys_user_interpersonal_interaction.value,
  230. ...dictList.sys_user_growth_potential.value
  231. ]
  232. },
  233. ]
  234. })
  235. const getLabel = (value, list = []) => {
  236. const item = list.find(item => item.value.includes(value)) || { label: value }
  237. return item.label
  238. }
  239. useTimeOut(() => {
  240. getOverview(pageType.value === 'personal' ? { userId: provideParams.value.deptId } : {
  241. ...provideParams.value
  242. }).then((res) => {
  243. const data = res.data || {}
  244. infoNumber.value = {
  245. ...data
  246. }
  247. })
  248. }, [ provideParams ])
  249. defineExpose({
  250. next: () => {
  251. defaultIndex.value++
  252. if (defaultIndex.value === departments.value.length) {
  253. return () => { // resetIndex
  254. defaultIndex.value = 0
  255. }
  256. } else {
  257. params.value.deptId = departments.value[ defaultIndex.value ] ? departments.value[ defaultIndex.value ].id : ''
  258. return false
  259. }
  260. }
  261. })
  262. </script>
  263. <style lang="scss" scoped>
  264. .content {
  265. display: flex;
  266. width: 100%;
  267. height: 100%;
  268. flex-direction: column;
  269. row-gap: 15px;
  270. }
  271. .content-top {
  272. flex: 1;
  273. display: flex;
  274. width: 100%;
  275. column-gap: 30px;
  276. overflow: hidden;
  277. .content-left {
  278. width: 30%;
  279. height: 100%;
  280. .department {
  281. width: 100%;
  282. height: 100%;
  283. display: flex;
  284. flex-direction: column;
  285. overflow: hidden;
  286. row-gap: 15px;
  287. &>*:nth-child(2) {
  288. width: 100%;
  289. height: 70%;
  290. }
  291. }
  292. .personal {
  293. height: 100%;
  294. display: flex;
  295. flex-direction: column;
  296. overflow: hidden;
  297. row-gap: 15px;
  298. &>div:nth-child(1) {
  299. flex: 1;
  300. display: flex;
  301. flex-direction: column;
  302. overflow: hidden;
  303. row-gap: 15px;
  304. &>*:nth-child(2) {
  305. width: 100%;
  306. height: 70%;
  307. }
  308. }
  309. }
  310. }
  311. .content-center {
  312. flex: 1;
  313. height: 100%;
  314. display: flex;
  315. flex-direction: column;
  316. row-gap: 10px;
  317. overflow: hidden;
  318. padding-top: 20px;
  319. box-sizing: border-box;
  320. .userSelectParams {
  321. display: flex;
  322. column-gap: 30px;
  323. --el-input-height: 40px;
  324. :deep(.el-select__wrapper) {
  325. font-size: 16px;
  326. }
  327. :deep(.el-input) {
  328. font-size: 16px;
  329. --el-input-height: 40px;
  330. --el-input-inner-height: 40px;
  331. }
  332. &>*:nth-child(1) {
  333. flex: 1;
  334. }
  335. }
  336. .public-inheritance-style {
  337. width: 100%;
  338. display: flex;
  339. column-gap: 10px;
  340. }
  341. .quantity-overview {
  342. @extend .public-inheritance-style;
  343. color: #fff;
  344. font-size: 18px;
  345. display: flex;
  346. column-gap: 15px;
  347. row-gap: 25px;
  348. padding: 20px 0px 10px;
  349. box-sizing: border-box;
  350. flex-wrap: wrap;
  351. .quantity-overview-item {
  352. flex: calc(25% - 12px);
  353. background: #051E40;
  354. display: flex;
  355. flex-direction: column;
  356. align-items: center;
  357. justify-content: center;
  358. row-gap: 5px;
  359. padding-top: 25px;
  360. padding-bottom: 10px;
  361. border-radius: 5px;
  362. font-weight: bold;
  363. position: relative;
  364. div {
  365. overflow: hidden;
  366. width: 100%;
  367. text-align: center;
  368. }
  369. &::before {
  370. display: block;
  371. content: attr(data-title);
  372. position: absolute;
  373. white-space: nowrap;
  374. padding: 2px 10px;
  375. top: 0px;
  376. left: 50%;
  377. width: fit-content;
  378. transform: translate(-50%, -50%);
  379. background: #062047;
  380. border: 1px solid #064371;
  381. color: #32CDF4;
  382. border-radius: 6px;
  383. }
  384. }
  385. }
  386. .quantity-buttom {
  387. height: 280px;
  388. display: flex;
  389. column-gap: 15px;
  390. }
  391. }
  392. .content-right {
  393. width: 30%;
  394. height: 100%;
  395. display: flex;
  396. flex-direction: column;
  397. overflow: hidden;
  398. row-gap: 15px;
  399. &>*:nth-child(2) {
  400. width: 100%;
  401. height: 80%;
  402. }
  403. }
  404. }
  405. .content-bottom {
  406. height: 30%;
  407. display: flex;
  408. column-gap: 15px;
  409. &>*:nth-child(4) {
  410. min-width: 40%;
  411. }
  412. }
  413. </style>