| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- <template>
- <div class="content">
- <div class="content-top">
- <div class="content-left">
- <div class="personal" v-if=" pageType === 'personal' ">
- <div>
- <QualificationCapabilityPersonal />
- </div>
- <div style="height: 280px;">
- <Attendance type="personal" />
- </div>
- </div>
- <div class="department" v-else>
- <QualificationCapability />
- </div>
- </div>
- <div class="content-center">
- <div class="userSelectParams">
- <CustomStyleSelect type="tree" :propsConfig="{ value: 'id', showPrefix: false }" v-model="params.deptId"
- :options="departments" />
- </div>
- <div class="quantity-overview">
- <div class="quantity-overview-item" v-for=" item in pageInfo " :key="item.label" :data-title="item.label">
- <div>{{ item.desc }}</div>
- <div style="font-size: 22px;">{{ getLabel( item.value, item.list ) }}</div>
- </div>
- </div>
- <template v-if=" pageType === 'personal' ">
- <div style="flex: 1; overflow: hidden;">
- <CollaborationPersonal />
- </div>
- <div class="quantity-buttom">
- <WorkOutput type="personal" />
- <LearningGrowth type="personal" />
- </div>
- </template>
- <Collaboration v-else />
- </div>
- <div class="content-right">
- <!-- if 销毁组件 重制布局 -->
- <template v-if="pageType === 'personal'">
- <StandardExecution :type="pageType" />
- <SubjectiveImpression :type="pageType" />
- </template>
- <template v-else>
- <StandardExecution :type="pageType" />
- <SubjectiveImpression :type="pageType" />
- </template>
- </div>
- </div>
- <div class="content-bottom" v-if=" pageType !== 'personal' ">
- <Attendance :type="pageType" />
- <WorkOutput :type="pageType" />
- <LearningGrowth :type="pageType" />
- <DepartmentInfo :type="pageType" />
- </div>
- </div>
- </template>
- <script setup>
- import {
- QualificationCapability,
- Collaboration,
- StandardExecution,
- SubjectiveImpression,
- Attendance,
- WorkOutput,
- LearningGrowth,
- DepartmentInfo,
- CustomStyleSelect,
- CollaborationPersonal,
- QualificationCapabilityPersonal
- } from '../pageItems';
- import { getOverview, getDeptUserTree } from '@/api/item/items'
- import moment from 'moment'
- import { useDict } from '@/utils/dict'
- import { useTimeOut } from '../pageItems/useTimeOut'
- import { provide, computed } from 'vue'
- const dictList = useDict(
- 'sys_user_working_style',
- 'sys_user_personality_trait',
- 'sys_user_capability_performance',
- 'sys_user_interpersonal_interaction',
- 'sys_user_growth_potential')
- const params = ref({
- deptId: ''
- })
- const defaultIndex = ref(0)
- const flatDepartments = ref([])
- const pageType = computed(() => {
- const item = flatDepartments.value.find(item => String(item.id) === String(params.value.deptId)) || { type: 'department' }
- return item.type
- })
- const departments = ref([])
- const provideParams = computed(() => {
- return {
- deptId: params.value.deptId
- }
- })
- try {
- getDeptUserTree().then(res => {
- const flatDepartmentsList = []
- const appendItem = (list) => {
- list.forEach(attr => {
- let type = 'department'
- if (attr.deptType === 'BRIGADE') {
- type = 'brigade'
- }
- if (attr.deptType === 'MANAGER') {
- type = 'department'
- }
- if (attr.deptType === 'TEAMS') {
- type = 'team'
- }
- if (attr.nodeType === 'user') {
- type = 'personal'
- }
- flatDepartmentsList.push({
- id: attr.id,
- type: type
- })
- if (attr.children && attr.children.length) {
- appendItem(attr.children)
- }
- })
- }
-
- departments.value = res.data.reduce((cur, acc) => {
- acc.children && acc.children.length && cur.push(...acc.children)
- appendItem(acc.children)
- return cur
- }, [])
- flatDepartments.value = flatDepartmentsList
- params.value.deptId = departments.value[ 0 ] ? departments.value[ 0 ].id : ''
- })
- } catch (err) { }
- provide('provideParams', provideParams)
- const infoNumber = ref({})
- const pageInfo = computed(() => {
- return pageType.value === 'personal' ? [
- {
- label: '资质能力',
- value: infoNumber.value.qualificationLevel
- },
- {
- label: '工作履历',
- desc: '安检工作年限',
- value: infoNumber.value.workYears
- },
- {
- label: '出勤投入',
- desc: '上岗时长',
- value: (infoNumber.value.avgWorkingHours || 0) + 'h'
- },
- {
- label: '工作产出',
- desc: '有效查获数据',
- value: infoNumber.value.avgSeizureCount
- },
- {
- label: '标准执行',
- desc: '巡检问题总次数',
- value: infoNumber.value.checkCount
- },
- {
- label: '学习成长',
- desc: '平均分',
- value: infoNumber.value.learningGrowthScore
- },
- {
- label: '协调配合',
- desc: '工作风格',
- value: infoNumber.value.workingStyle,
- list: dictList.sys_user_working_style.value
- },
- {
- label: '主观印象',
- desc: '高频词',
- value: infoNumber.value.subjectiveImpression,
- list: [
- ...dictList.sys_user_personality_trait.value,
- ...dictList.sys_user_capability_performance.value,
- ...dictList.sys_user_interpersonal_interaction.value,
- ...dictList.sys_user_growth_potential.value
- ]
- },
- ] : [
- {
- label: '资质能力',
- desc: '高级资质等级人数',
- value: infoNumber.value.qualificationLevel
- },
- {
- label: '工作履历',
- desc: '平均安检工作年限',
- value: infoNumber.value.workYears
- },
- {
- label: '出勤投入',
- desc: '人均上岗时长',
- value: (infoNumber.value.avgWorkingHours || 0) + 'h'
- },
- {
- label: '工作产出',
- desc: '有效查获数据',
- value: infoNumber.value.avgSeizureCount
- },
- {
- label: '标准执行',
- desc: '巡检问题总次数',
- value: infoNumber.value.checkCount
- },
- {
- label: '学习成长',
- desc: '平均分',
- value: infoNumber.value.learningGrowthScore
- },
- {
- label: '协调配合',
- desc: '工作风格',
- value: infoNumber.value.workingStyle,
- list: dictList.sys_user_working_style.value
- },
- {
- label: '主观印象',
- desc: '高频词',
- value: infoNumber.value.subjectiveImpression,
- list: [
- ...dictList.sys_user_personality_trait.value,
- ...dictList.sys_user_capability_performance.value,
- ...dictList.sys_user_interpersonal_interaction.value,
- ...dictList.sys_user_growth_potential.value
- ]
- },
- ]
- })
- const getLabel = (value, list = []) => {
- const item = list.find(item => item.value.includes(value)) || { label: value }
- return item.label
- }
- useTimeOut(() => {
- getOverview(pageType.value === 'personal' ? { userId: provideParams.value.deptId } : {
- ...provideParams.value
- }).then((res) => {
- const data = res.data || {}
- infoNumber.value = {
- ...data
- }
- })
- }, [ provideParams ])
- defineExpose({
- next: () => {
- defaultIndex.value++
- if (defaultIndex.value === departments.value.length) {
- return () => { // resetIndex
- defaultIndex.value = 0
- }
- } else {
- params.value.deptId = departments.value[ defaultIndex.value ] ? departments.value[ defaultIndex.value ].id : ''
- return false
- }
- }
- })
- </script>
- <style lang="scss" scoped>
- .content {
- display: flex;
- width: 100%;
- height: 100%;
- flex-direction: column;
- row-gap: 15px;
- }
- .content-top {
- flex: 1;
- display: flex;
- width: 100%;
- column-gap: 30px;
- overflow: hidden;
- .content-left {
- width: 30%;
- height: 100%;
- .department {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- row-gap: 15px;
- &>*:nth-child(2) {
- width: 100%;
- height: 70%;
- }
- }
- .personal {
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- row-gap: 15px;
- &>div:nth-child(1) {
- flex: 1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- row-gap: 15px;
- &>*:nth-child(2) {
- width: 100%;
- height: 70%;
- }
- }
- }
- }
- .content-center {
- flex: 1;
- height: 100%;
- display: flex;
- flex-direction: column;
- row-gap: 10px;
- overflow: hidden;
- padding-top: 20px;
- box-sizing: border-box;
- .userSelectParams {
- display: flex;
- column-gap: 30px;
- --el-input-height: 40px;
- :deep(.el-select__wrapper) {
- font-size: 16px;
- }
- :deep(.el-input) {
- font-size: 16px;
- --el-input-height: 40px;
- --el-input-inner-height: 40px;
- }
- &>*:nth-child(1) {
- flex: 1;
- }
- }
- .public-inheritance-style {
- width: 100%;
- display: flex;
- column-gap: 10px;
- }
- .quantity-overview {
- @extend .public-inheritance-style;
- color: #fff;
- font-size: 18px;
- display: flex;
- column-gap: 15px;
- row-gap: 25px;
- padding: 20px 0px 10px;
- box-sizing: border-box;
- flex-wrap: wrap;
- .quantity-overview-item {
- flex: calc(25% - 12px);
- background: #051E40;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- row-gap: 5px;
- padding-top: 25px;
- padding-bottom: 10px;
- border-radius: 5px;
- font-weight: bold;
- position: relative;
- div {
- overflow: hidden;
- width: 100%;
- text-align: center;
- }
- &::before {
- display: block;
- content: attr(data-title);
- position: absolute;
- white-space: nowrap;
- padding: 2px 10px;
- top: 0px;
- left: 50%;
- width: fit-content;
- transform: translate(-50%, -50%);
- background: #062047;
- border: 1px solid #064371;
- color: #32CDF4;
- border-radius: 6px;
- }
- }
- }
- .quantity-buttom {
- height: 280px;
- display: flex;
- column-gap: 15px;
- }
- }
- .content-right {
- width: 30%;
- height: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- row-gap: 15px;
- &>*:nth-child(2) {
- width: 100%;
- height: 80%;
- }
- }
- }
- .content-bottom {
- height: 30%;
- display: flex;
- column-gap: 15px;
- &>*:nth-child(4) {
- min-width: 40%;
- }
- }
- </style>
|