<template>
  <div>
    <a-input-number :min="refundMinDays" v-model="val" @change="handleChange">
    </a-input-number>
    <a-tooltip
      placement="top"
      title="正数表示在门票使用开始日期之前几天可退；负数表示在门票使用开始日期之后几天内可退">
      <a-icon type="exclamation-circle" theme="filled" style="color:orange;margin-left: 5px;"/>
    </a-tooltip>
  </div>
</template>
<script>
export default {
  data () {
    return {
      val: null
    }
  },
  props: {
    value: {
      type: Number,
      default: null
    }
  },
  computed: {
    // 提前可退天数最小值
    refundMinDays () {
      return this.$store.getters.refundMinDays
    }
  },
  methods: {
    handleChange (e) {
      this.$emit('input', Number(e))
      this.$emit('change', Number(e))
    }
  },
  watch: {
    value: {
      handler (v) {
        this.val = v
      },
      immediate: true
    }
  }
}
</script>
<style lang="scss">

</style>
