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

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

<template>
  <div class="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?.oriBeginTime" />
        <van-cell title="原加班结束时间" :value="props.detail?.oriEndTime" />
        <van-cell title="原加班时长" :value="props.detail?.oriHour">{{ props.detail?.hour }}</van-cell>
        <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="差异工时">{{ props.detail?.differHour }}小时</van-cell>
        <van-cell title="异常加班事由" :value="props.detail?.reason" />
      </van-cell-group>
    </div>
    <van-button class="button-default float-bottom" type="default" @click="onBack">返回</van-button>
  </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>
