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

// 院校投档线  地域
export default {
  ...conditionObjectBase,
  dependentKeys: ['universityLocation','universityType','universityLevel'],
  key: 'universityYear',
  isDependencyReady(params) {
    return params.universityLocation && params.universityType && params.universityLevel
  },
  title: '年份',
  getList: function(param) {
    return new Promise((resolve, reject) => {
      selectUniversityYears({
        location: param.universityLocation,
        level: param.universityLevel,
        type: param.universityType
      }).then(res => resolve(res.rows))
        .catch(e => reject(e))
    })
  },
  getCode: function(item) {
    return item
  },
  getLabel: function(item) {
    return item
  }
}
