singleActions.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('cloudenv.text_590'),
  7. action: obj => {
  8. this.handleOpenSidepage(obj, 'access-group-rule')
  9. },
  10. },
  11. {
  12. label: i18n.t('storage.text_65'),
  13. actions: (obj) => {
  14. return [
  15. {
  16. label: i18n.t('storage.text_100'),
  17. permission: 'access_groups_perform_syncstatus',
  18. action: obj => {
  19. this.onManager('performAction', {
  20. steadyStatus: ['available'],
  21. id: obj.id,
  22. managerArgs: {
  23. action: 'syncstatus',
  24. },
  25. })
  26. },
  27. meta: () => ({
  28. validate: true,
  29. }),
  30. },
  31. {
  32. label: i18n.t('storage.text_36'),
  33. permission: 'access_groups_delete',
  34. action: () => {
  35. this.createDialog('DeleteResDialog', {
  36. vm: this,
  37. title: i18n.t('storage.text_36'),
  38. name: this.$t('dictionary.access_group'),
  39. alert: this.$t('storage.text_266'),
  40. data: [obj],
  41. columns: this.columns,
  42. onManager: this.onManager,
  43. refresh: this.refresh,
  44. })
  45. },
  46. meta: () => this.$getDeleteResult(obj),
  47. },
  48. ]
  49. },
  50. },
  51. ]
  52. },
  53. methods: {
  54. handleOpenSidepage (row, tab) {
  55. if (this.sidePageData) {
  56. this.handleTabChange(tab)
  57. } else {
  58. this.sidePageTriggerHandle(this, 'AccessGroupSidePage', {
  59. id: row.id,
  60. resource: 'access_groups',
  61. getParams: this.getParam,
  62. }, {
  63. list: this.list,
  64. tab,
  65. })
  66. }
  67. },
  68. },
  69. }