zhengyiming
4 天以前 ac7fde69c457b3488bbfe2671dbfeb3eeba26414
packages/components/src/Card/FlexJobTopView.vue
@@ -1,6 +1,10 @@
<template>
  <div :class="['flexJob-card-top-wrapper', size]">
    <Avatar :src="avatar" :size="size === 'small' ? 50 : 60" class="flexJob-card-top-avatar" />
    <Avatar
      :src="setOSSLink(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">{{ name }}</div>
@@ -18,11 +22,7 @@
      </div>
      <slot name="detail">
        <div class="flexJob-card-top-info-detail">
          {{
            `${age ? '' : `${age}岁|`}${personalIdentityContent ?? ''} |  ${
              educationalBackgroundContent ?? ''
            } | 上岗${taskCount ?? 0}次`
          }}
          {{ infoDetail }}
        </div>
      </slot>
    </div>
@@ -34,6 +34,8 @@
import IconFemale from '@/assets/mine/icon-female.png';
import { AvatarImage, EnumUserGender } from '@12333/constants';
import { Avatar } from '@12333/components';
import { computed } from 'vue';
import { setOSSLink } from '@12333/utils';
defineOptions({
  name: 'FlexJobTopView',
@@ -55,7 +57,20 @@
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">