| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import { getAccessUrlTableColumn, getAccountTableColumn } from '../utils/columns'
- import {
- getCopyWithContentTableColumn,
- getBrandTableColumn,
- } from '@/utils/common/tableColumn'
- import i18n from '@/locales'
- export const getResource = (row) => {
- if (row.accounts?.length > 0) {
- return 'cloudaccounts'
- }
- if (row.managers?.length > 0) {
- return 'cloudproviders'
- }
- return ''
- }
- export const getColumns = (row) => {
- if (row.accounts?.length > 0) {
- return [
- getCopyWithContentTableColumn({
- field: 'id',
- title: 'ID',
- minWidth: 140,
- }),
- getCopyWithContentTableColumn({
- field: 'name',
- title: i18n.t('cloudenv.text_95'),
- }),
- getAccessUrlTableColumn(),
- getBrandTableColumn(),
- ]
- }
- if (row.managers?.length > 0) {
- return [
- getCopyWithContentTableColumn({
- field: 'id',
- title: 'ID',
- minWidth: 140,
- }),
- getCopyWithContentTableColumn({
- field: 'name',
- title: i18n.t('cloudenv.text_95'),
- }),
- getBrandTableColumn(),
- getAccountTableColumn(),
- ]
- }
- return []
- }
- export const getTargetColumns = (type) => {
- if (type === 'accounts') {
- return [
- getCopyWithContentTableColumn({
- field: 'id',
- title: 'ID',
- minWidth: 140,
- }),
- getCopyWithContentTableColumn({
- field: 'name',
- title: i18n.t('cloudenv.text_95'),
- }),
- getAccessUrlTableColumn(),
- getBrandTableColumn(),
- ]
- }
- if (type === 'providers') {
- return [
- getCopyWithContentTableColumn({
- field: 'id',
- title: 'ID',
- minWidth: 140,
- }),
- getCopyWithContentTableColumn({
- field: 'name',
- title: i18n.t('cloudenv.text_95'),
- }),
- getBrandTableColumn(),
- getAccountTableColumn(),
- ]
- }
- return []
- }
|