From 8bb30d6c524ff6c1b816d2113d967d4380c20967 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 12 八月 2025 17:41:49 +0800 Subject: [PATCH] fix: 灵工管理 --- packages/components/src/Card/FlexJobTopView.vue | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 50 insertions(+), 5 deletions(-) diff --git a/packages/components/src/Card/FlexJobTopView.vue b/packages/components/src/Card/FlexJobTopView.vue index 4f938b6..af58bf0 100644 --- a/packages/components/src/Card/FlexJobTopView.vue +++ b/packages/components/src/Card/FlexJobTopView.vue @@ -1,16 +1,26 @@ <template> <div :class="['flexJob-card-top-wrapper', size]"> - <UserAvatar :size="size === 'small' ? 50 : 60" class="flexJob-card-top-avatar" /> + <Avatar :src="avatar" :size="size === 'small' ? 50 : 60" class="flexJob-card-top-avatar" /> <div class="flexJob-card-top-info"> <div class="flexJob-card-top-info-item"> - <div class="flexJob-card-top-info-name">{{ '娲嬫磱' }}</div> + <div class="flexJob-card-top-info-name">{{ name }}</div> <div class="flexJob-card-top-info-gender"> - <img v-if="1" :src="IconMale" class="flexJob-card-top-info-gender-icon" /> + <img + v-if="gender === EnumUserGender.Male" + :src="IconMale" + class="flexJob-card-top-info-gender-icon" + /> <img v-else :src="IconFemale" class="flexJob-card-top-info-gender-icon" /> </div> - <div class="flexJob-card-top-info-auth">{{ '宸插疄鍚�' }}</div> + <div class="flexJob-card-top-info-auth" :class="{ 'is-real-name': isReal }"> + {{ isReal ? '宸插疄鍚�' : '鏈疄鍚�' }} + </div> </div> - <div class="flexJob-card-top-info-detail">{{ '26宀� | 闈炲鐢� | 鏈 | 涓婂矖121娆�' }}</div> + <slot name="detail"> + <div class="flexJob-card-top-info-detail"> + {{ infoDetail }} + </div> + </slot> </div> </div> </template> @@ -18,6 +28,9 @@ <script setup lang="ts"> import IconMale from '@/assets/mine/icon-male.png'; import IconFemale from '@/assets/mine/icon-female.png'; +import { AvatarImage, EnumUserGender } from '@12333/constants'; +import { Avatar } from '@12333/components'; +import { computed } from 'vue'; defineOptions({ name: 'FlexJobTopView', @@ -25,11 +38,34 @@ type Props = { size?: 'normal' | 'small'; + + avatar?: string; + name?: string; + gender?: EnumUserGender; + age?: number; + isReal?: boolean; + personalIdentityContent?: string; + educationalBackgroundContent?: string; + taskCount?: number; }; const props = withDefaults(defineProps<Props>(), { size: 'normal', + avatar: AvatarImage, + personalIdentityContent: '', + educationalBackgroundContent: '', }); + +const infoDetail = computed(() => + [ + props.age > 0 ? `${props.age}宀乣 : '', + props.personalIdentityContent, + props.educationalBackgroundContent, + props.taskCount > 0 ? `涓婂矖${props.taskCount ?? 0}娆 : '', + ] + .filter(Boolean) + .join('|') +); </script> <style lang="scss"> @@ -46,6 +82,8 @@ .flexJob-card-top-info { display: flex; flex-direction: column; + flex: 1; + min-width: 0; .flexJob-card-top-info-item { display: flex; @@ -56,6 +94,7 @@ line-height: 34px; font-weight: bold; color: boleGetCssVar('text-color', 'primary'); + @include ellipsis; } .flexJob-card-top-info-gender { @@ -63,6 +102,7 @@ align-items: center; height: 34px; margin: 0 10px; + flex-shrink: 0; .flexJob-card-top-info-gender-icon { width: 24px; @@ -73,6 +113,11 @@ .flexJob-card-top-info-auth { font-size: 28px; line-height: 34px; + flex-shrink: 0; + + &.is-real-name { + color: #2a9e1b; + } } } -- Gitblit v1.9.1