import { getRoleAll } from '@/api/system/role/index'
import { dataToSelect } from '@/utils/handleData.js'
import { ref } from 'vue'
const rolesOptions = ref([])
const getRolesOption = async function() {
  const res = await getRoleAll()
  rolesOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' })
}
// getRolesOption()
const data = [
  {
    label: '用户账号',
    key: 'username',
    props: {
      placeholder: '请输入用户账号'
    }
  },
  {
    label: '用户姓名',
    key: 'realname',
    props: {
      placeholder: '请输入用户姓名'
    }
  },
  {
    label: '用户角色',
    type: 'select',
    key: 'roleId',
    props: {
      placeholder: '请选择用户角色',
      options: rolesOptions
    }
  }
//   {
//     label: '角色类型',
//     type: 'date',
//     key: 'date',
//     props: {
//       type: 'date'
//     }
//   }
]

export default data

