<template>
  <el-form-item
    :label="label"
    :rules="requireRule(required, label)"
    :prop="prop"
  >
    <el-time-select
      :disabled="disabled"
      @change="setOvertimeHours"
      v-model="$parent.model[prop]"
      :picker-options="pickerOptions"
      :placeholder="placeholder"
    >
    </el-time-select>
  </el-form-item>
</template>

<script>
import mixin from "./mixin";
/**
 * 返回格式化后的日期（范围）
 * 日期类型返回单个字符串，日期范围返回包含开始和结束日期的数组
 */
export default {
  mixins: [mixin],
  props: {
    pickerOptions: {
      type: Object,
      default: {
        start: "05:30",
        step: "00:30",
        end: "23:30",
      },
    },
  },
  created() {},
  methods: {
    setOvertimeHours(id) {
      this.$emit("change");
    },
  },
};
</script>
