import conditionObjectBase from '../condition-object-base.js'
import {
  getSchoolRounds
} from '@/api/webApi/selection.js'

export default {
  ...conditionObjectBase,
  dependentKeys: ['year'],
  key: 'roundId',
  title: '次数',
  isDependencyReady(params) {
    return params.year
  },
  getList: function(param) {
    return new Promise((resolve, reject) => {
      getSchoolRounds(param)
        .then(res => resolve(res.data))
        .catch(e => reject(e))
    })
  },
  getCode: function(item) {
    return item.roundId
  },
  getLabel: function(item) {
    return item.name
  }
}
