<script setup lang="ts" name="DetailEmployees">
/* 员工详情 */
const emit = defineEmits<{
  back: []
}>()
const props = defineProps<{
  detail: any
}>()

function onBack() {
  emit('back')
}
</script>

<template>
  <div class="container__body container float-bottom">
    <div class="container__card flex">
      <van-cell-group>
        <van-cell title="员工姓名" :value="props.detail?.userName" />
        <van-cell title="员工工号" :value="props.detail?.employeesCode" />
        <van-cell title="部门名称" :value="props.detail?.userDept" />
        <van-cell title="岗位名称" :value="props.detail?.userPost" />
        <van-cell title="开始时间" :value="props.detail?.beginTime" />
        <van-cell title="结束时间" :value="props.detail?.endTime" />
        <van-cell title="加班时长">
          {{ props.detail?.hour }}小时
        </van-cell>
        <van-cell title="调休事由" :value="props.detail?.reason" />
      </van-cell-group>
      <van-button class="button-default float-bottom" type="default" @click="onBack">返回</van-button>
    </div>
  </div>
</template>

<style lang="less" scoped>
.container {
  position: relative;
  padding: 0;
  &.float-bottom {
    padding-bottom: calc(1.8rem + var(--float-button-height)) !important;
  }
}
:deep(.van-cell) {
  .van-cell__title {
    margin-right: 1rem;
    flex: none;
  }
  .van-cell__value {
    display: flex;
    justify-content: flex-end;
    color: var(--van-cell-text-color);
    overflow: hidden;
    span {
      text-align: justify;
    }
  }
}

:deep(.tag-label) {
  font-size: 1.4rem;
}

.button-default {
  position: absolute;
  &.float-bottom {
    margin-bottom: 0;
  }
}
</style>
