import { ref, reactive } from 'vue'
import { getUserList } from '@/api/system/user/index'
const userOptions = ref()
export const form = reactive({
  assignForm: {
    handleUserList: []
  },
  assignRules: {
    handleUserList: [{ required: true, type: 'array', message: '请选择分配用户', trigger: 'blur' }]
  },
  formItem: [
    { type: 'select', key: 'handleUserList', label: '人员姓名', props: { multiple: true, options: userOptions, placeholder: '请选择用户', labelField: 'realname', valueField: 'id' }}
  ]
})

export const getUserOptions = async function() {
  const res = await getUserList({ page: 1, limit: 100 })
  userOptions.value = res.data.records
}

