singleActions.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('system.notify.topic.receiver.management'),
  7. action: (obj) => {
  8. this.sidePageTriggerHandle(this, 'NotifyTopicSidePage', {
  9. id: obj.id,
  10. resource: 'topics',
  11. apiVersion: 'v1',
  12. getParams: this.getParam,
  13. }, {
  14. list: this.list,
  15. tab: 'subscriber',
  16. })
  17. },
  18. meta: (obj) => {
  19. return {
  20. validate: true,
  21. }
  22. },
  23. },
  24. {
  25. label: i18n.t('system.text_225'),
  26. permission: 'topics_perform_enable',
  27. action: (obj) => {
  28. this.createDialog('DisableDialog', {
  29. title: i18n.t('system.text_225'),
  30. name: this.$t('dictionary.notify-topic'),
  31. columns: this.columns,
  32. data: [obj],
  33. ok: async () => {
  34. try {
  35. const response = await this.onManager('performAction', {
  36. id: obj.id,
  37. managerArgs: {
  38. action: 'enable',
  39. },
  40. })
  41. return response
  42. } catch (error) {
  43. throw error
  44. }
  45. },
  46. })
  47. },
  48. meta: (obj) => {
  49. return {
  50. validate: this.isAdminMode && !obj.enabled,
  51. }
  52. },
  53. },
  54. {
  55. label: i18n.t('system.text_226'),
  56. permission: 'topics_perform_disable',
  57. action: (obj) => {
  58. this.createDialog('DisableDialog', {
  59. title: i18n.t('system.text_226'),
  60. name: this.$t('dictionary.notify-topic'),
  61. columns: this.columns,
  62. data: [obj],
  63. ok: async () => {
  64. try {
  65. const response = await this.onManager('performAction', {
  66. id: obj.id,
  67. managerArgs: {
  68. action: 'disable',
  69. },
  70. })
  71. return response
  72. } catch (error) {
  73. throw error
  74. }
  75. },
  76. })
  77. },
  78. meta: (obj) => {
  79. return {
  80. validate: this.isAdminMode && obj.enabled,
  81. }
  82. },
  83. },
  84. ]
  85. },
  86. }