singleActions.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('table.action.modify'),
  7. permission: 'snapshotpolicy_update',
  8. action: obj => {
  9. this.createDialog('CreateSnapshotPolicyDialog', {
  10. type: 'update',
  11. data: [obj],
  12. onManager: this.onManager,
  13. columns: this.columns,
  14. })
  15. },
  16. },
  17. {
  18. label: i18n.t('compute.bind_resource'),
  19. permission: 'disks_perform_bind_snapshotpolicy,servers_perform_bind_snapshotpolicy,snapshotpolicy_perform_bind_resources,snapshotpolicy_perform_unbind_resources',
  20. action: obj => {
  21. this.createDialog('AttachResourceDialog', {
  22. data: [obj],
  23. columns: this.columns,
  24. title: i18n.t('compute.bind_resource'),
  25. refresh: this.refresh,
  26. })
  27. },
  28. meta: obj => {
  29. return {
  30. validate: true,
  31. }
  32. },
  33. },
  34. {
  35. label: i18n.t('compute.perform_delete'),
  36. permission: 'snapshotpolicy_delete',
  37. action: obj => {
  38. this.createDialog('DeleteResDialog', {
  39. vm: this,
  40. data: [obj],
  41. columns: this.columns,
  42. title: i18n.t('compute.perform_delete'),
  43. name: this.$t('dictionary.snapshotpolicy'),
  44. onManager: this.onManager,
  45. })
  46. },
  47. meta: obj => this.$getDeleteResult(obj),
  48. },
  49. ]
  50. },
  51. }