<template>
    <div>
        <my-form-page
            title="添加人员"
            back-url="/staff"
            submit-url="/staff"
            :config="config"
        />
    </div>

</template>

<script>
import MyFormPage from '../components/MyFormPage'

export default {
    components: {
        MyFormPage
    },
    data () {
        return {
            config: [
                {
                    prop: 'name',
                    label: '姓名',
                    component: 'input',
                    rules: [
                        { required: true, message: '姓名不能为空' }
                    ]
                }, {
                    prop: 'email',
                    label: '邮箱',
                    component: 'input',
                    rules: [
                        { required: true, message: '邮箱不能为空' },
                        { type: 'email', message: '邮箱格式错误' }
                    ]
                }, {
                    prop: 'roles',
                    label: '角色',
                    component: 'select',
                    multiple: true,
                    options: this.$route.params.roles
                }
            ]
        }
    }
}
</script>