singleActions.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('compute.text_477'),
  7. permission: 'images_delete',
  8. action: obj => {
  9. this.createDialog('DeleteResDialog', {
  10. vm: this,
  11. data: [obj],
  12. columns: this.columns,
  13. title: i18n.t('compute.text_477'),
  14. name: this.cloudEnv === 'images' ? this.$t('dictionary.image') : this.$t('compute.text_98'),
  15. onManager: this.onManager,
  16. requestParams: { override_pending_delete: true },
  17. })
  18. },
  19. meta: obj => this.$getDeleteResult(obj),
  20. },
  21. {
  22. label: i18n.t('compute.text_478'),
  23. permission: 'images_perform_cancel_delete',
  24. action: (obj) => {
  25. this.createDialog('ImageRestoreDialog', {
  26. data: [obj],
  27. columns: this.columns,
  28. refresh: this.refresh,
  29. cloudEnv: this.cloudEnv,
  30. })
  31. },
  32. meta: obj => {
  33. return {
  34. validate: obj.status !== 'deleting',
  35. }
  36. },
  37. },
  38. ]
  39. },
  40. }