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

export default {
  ...conditionObjectBase,
  dependentKeys: ['yfydYear'],
  key: 'yfydMode',
  title: '科类',
  isDependencyReady(params) {
    return params.yfydYear
  },
  getList: function(param, $ref) {
    console.log('',$ref)
    return new Promise((resolve, reject) => {
      yfydModes({ location:$ref.model.yfydLocation,year:param.yfydYear }).then(res => resolve(res.rows))
        .catch(e => reject(e))
    })
  },
  getCode: function(item) {
    return item
  },
  getLabel: function(item) {
    return item
  }
}
