import conditionObjectBase from '../condition-object-base.js'
import * as back from '@/api/webApi/back'

export default {
  ...conditionObjectBase,
  dependentKeys: ['classGradeId'],
  key: 'classId',
  title: '班级',
  isDependencyReady(params) {
    return params.classGradeId
  },
  getList: function(param) {
    return new Promise((resolve, reject) => {
      back.getUserClasses({
        gradeId: param.classGradeId
      }).then(res => {
        resolve(res.data)
      }).catch(e => reject(e))
    })
  }
}
