import { useUserStore } from '@/store/user'
import { ListFormOption } from '@/types'

const userStore = useUserStore()
const option: ListFormOption = {
  api: '/sys/position',
  permissionPrefix: 'sys_position_',
  permissions: userStore.permissions,
  viewBtn: {
    display: false
  },
  tabsProps: {
    columns: [
      {
        title: '权限管理',
        slotName: 'permission',
        permission: 'sys_position_permission'
      }
    ]
  },
  columns: [
    {
      name: '职位名称',
      prop: 'name',
      rules: [
        { required: true, message: '名称不能为空' },
        { minLength: 2, message: '名称不少于2个字符' },
        { maxLength: 20, message: '不能超过20个字符' }
      ]
    },
    {
      name: '职位描述',
      prop: 'description',
      type: 'textarea',
      rules: [{ maxLength: 200, message: '不能超过200个字符' }]
    }
  ]
}
export default option
