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

const userStore = useUserStore()
const option: ListFormOption = {
  api: {
    base: '/sys/package'
  },
  permissionPrefix: 'sys_package_',
  permissions: userStore.permissions,
  tabsProps: {
    columns: [
      {
        title: '权限管理',
        slotName: 'permission',
        permission: 'sys_package_permission'
      }
    ]
  },
  columns: [
    {
      name: '名称',
      prop: 'name',
      width: 200,
      search: true,
      placeholder: '请输入名称',
      rules: [
        { required: true, message: '名称不能为空' },
        { maxLength: 50, message: '不能超过50个字符' }
      ]
    },
    {
      name: '描述',
      prop: 'description',
      type: 'textarea',
      rules: [{ maxLength: 200, message: '不能超过200个字符' }]
    }
  ]
}
export default option
