<template>
    <el-card shadow="hover" class="card-box">
        <div class="card-box-agent">
            <div class="flex align-center">
                <div class="agent-left">
                    <img :src="emptyImg" alt="" />
                </div>
                <div class="agent-right">
                    <div class="title auto-tooltip">
                        {{ title }}
                    </div>
                    <div class="description">
                      {{ description }}
                    </div>
                    <div class="createName">
                      <img :src="userSvg" alt="">
                      {{ createdByName }}
                    </div>
                    <div class="tag"></div>
                    <!-- <el-icon class="icon-arrow"><ArrowRightBold /></el-icon> -->
                </div>
                <img :src="senior" v-if="tyType === 1" class="senior">
            </div>

        </div>
    </el-card>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import defImg  from '@/assets/agent/def_agent.svg'
import senior  from '@/assets/agent/senior.svg'
import userSvg  from '@/assets/agent/user.svg'

defineOptions({ name: 'CardBoxAgent' })
const props = withDefaults(
    defineProps<{
        /**
         * 标题
         */
        title?: string
        /**
         * 描述
         */
        description?: string
        /**
         * 图片
         */
         avatar: string
         /**
         * 通用状态;[0-普通定制 1-高级定制]
         */
         tyType: number
         /**
          * 标题
          */
         createdByName?: string
    }>(),
    { title: '', description: '', avatar: '', tyType: 0 }
)
const emptyImg = computed(() => {
    return props.avatar ? props.avatar: defImg
})

</script>
<style lang="scss" scoped>
.card-box{
    transition: all 0.3s ease-in-out;
    border: none;
    box-shadow: 0px 0px 10px -3px #DADDE7;
    border-radius: 8px;
    cursor: pointer;
    .card-box-agent{
      min-height: 83px;
        position: relative;
        .agent-left{
            margin-right: 8px;
            img {
                width: 73px;
                height: 73px;
                // border-radius: 50%;
            }
        }
        .agent-right {
            color: var(--app-text-color-secondary);
            font-weight: 400;
            padding-right: 16px;
            flex: 1;
            width: calc(100% - 81px);
            .title {
                height: 20px;
                font-size: 16px;
                font-weight: bold;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                color: var(--app-text-color-1);
            }
            .description {
                display: -webkit-box;
                 //height: var(--app-card-box-description-height, 36px);
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                overflow: hidden;
                padding-top: 6px;
                font-size: 12px;
                color: #8C8C8C ;
            }
          .createName {
            margin-top: 4px;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 3px;
            font-weight: 400;
            font-size: 11px;
            color: #999999;
            img {
              position: relative;
              top: 1px;
            }
          }
        }
        .senior{
            position: absolute;
            right: -10px;
            top: -10px;
        }
    }
}

.card-box.is-always-shadow, .el-card.is-hover-shadow:focus, .el-card.is-hover-shadow:hover {
    box-shadow: 0px 0px 10px -3px #DADDE7;
    background-color: var(--app-layout-bg-color);
}
</style>
