columns.js 573 B

1234567891011121314151617181920
  1. import * as R from 'ramda'
  2. import { STORAGE_TYPES } from '../constants'
  3. import i18n from '@/locales'
  4. export const getStorageTypeTableColumn = ({ vm = {}, hidden } = {}) => {
  5. return {
  6. field: 'storage_type',
  7. title: i18n.t('table.title.storage_type'),
  8. width: 80,
  9. slots: {
  10. default: ({ row }, h) => {
  11. if (vm.isPreLoad && !row.storage_type) return [<data-loading />]
  12. return STORAGE_TYPES[row.storage_type] || row.storage_type || '-'
  13. },
  14. },
  15. hidden: () => {
  16. return R.is(Function, hidden) ? hidden() : hidden
  17. },
  18. }
  19. }