<script lang="ts" setup>
import { useCronStore } from '@/pages/sys/task/cron/cron-store.ts'

const {yearState} = toRefs(useCronStore())
let year = new Date().getFullYear()

</script>

<template>
  <ElRadioGroup v-model="yearState.mode" class="select-panel">
    <ElRadio value="none">不指定</ElRadio>
    <ElRadio value="every">每年</ElRadio>
    <ElRadio value="period1">
      <span>周期，从</span>
      <ElInputNumber v-model="yearState.period1.start" :controls="false" :max="year+99" :min="year" size="small"/>
      <span>到</span>
      <ElInputNumber v-model="yearState.period1.end" :controls="false" :max="year+100" :min="yearState.period1.start" size="small"/>
    </ElRadio>
  </ElRadioGroup>
</template>

<style lang="stylus" scoped>
.select-panel {
  flex-direction column
  align-items start
  gap 10px
  width 100%;
  flex-wrap nowrap

  :deep(.el-input-number) {
    margin 0 10px
    width: 80px
  }
}
</style>
