columns.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import {
  2. getNameDescriptionTableColumn,
  3. getCopyWithContentTableColumn,
  4. getProjectDomainTableColumn,
  5. getPublicScopeTableColumn,
  6. getTimeTableColumn,
  7. } from '@/utils/common/tableColumn'
  8. import i18n from '@/locales'
  9. export default {
  10. created () {
  11. this.columns = [
  12. getNameDescriptionTableColumn({
  13. onManager: this.onManager,
  14. hideField: true,
  15. edit: (row) => {
  16. if (row.id === 'DIRECT') return false
  17. const { isDomainMode, userInfo } = this.$store.getters
  18. if (isDomainMode && (userInfo.projectDomainId !== row.domain_id)) {
  19. return false
  20. }
  21. return true
  22. },
  23. showDesc: (row) => {
  24. if (row.id === 'DIRECT') return false
  25. const { isDomainMode, userInfo } = this.$store.getters
  26. if (isDomainMode && (userInfo.projectDomainId !== row.domain_id)) {
  27. return false
  28. }
  29. return true
  30. },
  31. slotCallback: row => {
  32. return (
  33. <side-page-trigger name="ProxysettingSidePage" id={row.id} list={this.list} vm={this}>{ row.name } {row.id === 'DIRECT' && i18n.t('cloudenv.text_110')}</side-page-trigger>
  34. )
  35. },
  36. }),
  37. getCopyWithContentTableColumn({
  38. field: 'https_proxy',
  39. title: i18n.t('cloudenv.text_395'),
  40. }),
  41. getCopyWithContentTableColumn({
  42. field: 'http_proxy',
  43. title: i18n.t('cloudenv.text_398'),
  44. }),
  45. getCopyWithContentTableColumn({
  46. field: 'no_proxy',
  47. title: i18n.t('cloudenv.text_401'),
  48. }),
  49. getPublicScopeTableColumn({ vm: this, resource: 'proxysettings' }),
  50. getProjectDomainTableColumn({ sortable: false }),
  51. getTimeTableColumn(),
  52. ]
  53. },
  54. }