singleActions.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. export default {
  2. created () {
  3. this.singleActions = [
  4. {
  5. label: this.$t('compute.text_982'),
  6. permission: 'secgrouprules_update',
  7. action: obj => {
  8. this.createDialog('EditRulesDialog', {
  9. data: [obj],
  10. title: 'edit',
  11. columns: this.columns,
  12. onManager: this.onManager,
  13. refresh: this.refresh,
  14. type: this.type,
  15. brand: this.data.brand,
  16. cloud_env: this.data.cloud_env,
  17. })
  18. },
  19. meta: (obj) => {
  20. const ret = {
  21. validate: !this.isRead,
  22. tooltip: this.isRead ? this.$t('compute.secgroup.shared') : '',
  23. }
  24. if (['hcs', 'hcso', 'huawei', 'volcengine'].includes((this.data.brand || '').toLowerCase())) {
  25. ret.validate = false
  26. ret.tooltip = this.$t('compute.text_1388')
  27. }
  28. return ret
  29. },
  30. },
  31. // {
  32. // label: this.$t('compute.text_983'),
  33. // permission: 'secgrouprules_create',
  34. // action: obj => {
  35. // this.createDialog('EditRulesDialog', {
  36. // data: [obj],
  37. // title: 'clone',
  38. // columns: this.columns,
  39. // onManager: this.onManager,
  40. // refresh: this.refresh,
  41. // type: this.type,
  42. // secgroup: this.id,
  43. // })
  44. // },
  45. // meta: () => {
  46. // return {
  47. // validate: !this.isRead,
  48. // tooltip: this.isRead ? i18n.t('compute.secgroup.shared') : '',
  49. // }
  50. // },
  51. // },
  52. {
  53. label: this.$t('compute.perform_delete'),
  54. permission: 'secgrouprules_delete',
  55. action: obj => {
  56. this.createDialog('DeleteResDialog', {
  57. vm: this,
  58. data: [obj],
  59. columns: this.columns,
  60. title: this.$t('compute.perform_delete'),
  61. name: this.$t('compute.text_984'),
  62. onManager: this.onManager,
  63. refresh: this.refresh,
  64. })
  65. },
  66. meta: () => {
  67. return {
  68. validate: !this.isRead,
  69. tooltip: this.isRead ? this.$t('compute.secgroup.shared') : '',
  70. }
  71. },
  72. },
  73. ]
  74. },
  75. }