import { reactive } from 'vue'
import { USER_STATUS } from '@/utils/dictionary.js'

const data = reactive({
  roleForm: {
    code: '',
    name: '',
    status: 1,
    note: ''
  },
  roleRules: {
    code: [{ required: true, message: '请输入角色编号', trigger: 'blur' }],
    name: [{ required: true, message: '请输入角色名称', type: 'string', trigger: 'blur' }],
    status: [{ required: true, message: '请选择状态', type: 'number', trigger: 'blur' }]
  },
  formItem: [
    { type: 'input', key: 'code', label: '角色编号', props: { maxlength: '20', placeholder: '请输入角色编号', clearable: true }},
    { type: 'input', key: 'name', label: '角色名称', props: { maxlength: '20', placeholder: '请输入角色名称', clearable: true }},
    { type: 'radio', key: 'status', label: '状态', options: USER_STATUS },
    { type: 'input', key: 'note', label: '备注', props: { type: 'textarea', autosize: { maxlength: '200', minRows: 3, maxRows: 3 }}}
  ]
})

export default data
