
export default {
  name: 'my-department',
  render (h) {
    const data = this.obj
    const inputAttrs = {
      placeholder: data.placeholder,
      required: data.required,
      multiple: data.isMultiple
    }
    const optionItem = this.optionsData.map((v) =>
      <el-option label={v.label} value={v.value}></el-option>
    )
    return (
      <el-form-item label={this.obj.fieldNm} required={this.obj.required == 1} style="width:100%;margin-bottom:10px!important">
        <el-select style="width:100%" v-model={data.fieldValue} attrs={inputAttrs}>
          {optionItem}
        </el-select>
      </el-form-item>
    )
  },
  data () {
    return {
      optionsData: []
    }
  },
  mounted () {
    const a = [{ value: '1', label: '部门1' }, { value: '2', label: '部门2' }]
    this.optionsData = a
  },
  props: {
    obj: {
      type: Object,
      default: {}
    }
  }
}
