import conditionObjectBase from '../condition-object-base.js'
import { yfydYears } from "@/api/webApi/career-other";

export default {
  ...conditionObjectBase,
  dependentKeys: ['yfydLocation'],
  key: 'yfydYear',
  title: '学年',
  isDependencyReady(params) {
    return params.yfydLocation
  },
  getList: function(param) {
    return new Promise((resolve, reject) => {
      yfydYears({ location:param.yfydLocation }).then(res => resolve(res.rows))
        .catch(e => reject(e))
    })
  },
  getCode: function(item) {
    return item
  },
  getLabel: function(item) {
    return item
  }
}
