singleActions.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import { disableDeleteAction } from '@/utils/common/tableActions'
  2. import i18n from '@/locales'
  3. export default {
  4. created () {
  5. this.singleActions = [
  6. {
  7. label: i18n.t('storage.text_100'),
  8. permission: 'file_systems_perform_syncstatus',
  9. action: obj => {
  10. this.onManager('performAction', {
  11. steadyStatus: ['available'],
  12. id: obj.id,
  13. managerArgs: {
  14. action: 'syncstatus',
  15. },
  16. })
  17. },
  18. meta: () => ({
  19. validate: true,
  20. }),
  21. },
  22. {
  23. label: i18n.t('storage.text_65'),
  24. actions: (obj) => {
  25. return [
  26. {
  27. label: this.$t('common_641', [this.$t('dictionary.project')]),
  28. action: () => {
  29. this.createDialog('ChangeOwenrDialog', {
  30. data: [obj],
  31. columns: this.columns,
  32. name: this.$t('dictionary.filesystem'),
  33. onManager: this.onManager,
  34. resource: 'file_systems',
  35. ignoreCandidateDomains: true,
  36. })
  37. },
  38. meta: () => {
  39. const ret = {
  40. validate: false,
  41. tooltip: '',
  42. }
  43. if (this.isProjectMode) {
  44. ret.tooltip = this.$t('storage.check_sys_permission', [this.$t('dictionary.domain')])
  45. return ret
  46. }
  47. return {
  48. validate: true,
  49. }
  50. },
  51. },
  52. disableDeleteAction(this, {
  53. name: this.$t('dictionary.nas'),
  54. }),
  55. {
  56. label: i18n.t('storage.text_36'),
  57. permission: 'file_systems_delete',
  58. action: () => {
  59. this.createDialog('DeleteResDialog', {
  60. vm: this,
  61. title: i18n.t('storage.text_36'),
  62. name: this.$t('dictionary.nas'),
  63. data: [obj],
  64. columns: this.columns,
  65. onManager: this.onManager,
  66. refresh: this.refresh,
  67. })
  68. },
  69. meta: () => this.$getDeleteResult(obj),
  70. },
  71. ]
  72. },
  73. },
  74. ]
  75. },
  76. }