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

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