columns.js 812 B

1234567891011121314151617181920212223242526272829
  1. import i18n from '@/locales'
  2. import { contactMap } from '@/constants'
  3. export const getConfigTypeTableColumn = () => {
  4. return {
  5. title: i18n.t('system.text_48'),
  6. field: 'type',
  7. minWidth: 120,
  8. formatter: ({ row }) => {
  9. return contactMap[row.type]?.label || row.type
  10. },
  11. }
  12. }
  13. export const getAttirubuteTableColumn = ({ vm = {} } = {}) => {
  14. return {
  15. title: i18n.t('IAM.text_1'),
  16. field: 'attribution',
  17. width: 120,
  18. slots: {
  19. default: ({ row }, h) => {
  20. const attribution = row.attribution
  21. if (vm.isPreLoad && !row.project_domain) return [<data-loading />]
  22. if (attribution === 'domain') return `${row.project_domain}${i18n.t(`shareScope.${attribution}`)}`
  23. return i18n.t(`shareScope.${attribution}`) || attribution
  24. },
  25. },
  26. }
  27. }