singleActions.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { mapGetters } from 'vuex'
  2. import i18n from '@/locales'
  3. export default {
  4. computed: {
  5. ...mapGetters(['isAdminMode', 'userInfo']),
  6. },
  7. created () {
  8. this.singleActions = [
  9. {
  10. label: i18n.t('table.action.delete'),
  11. permission: 'samlusers_delete',
  12. action: (obj) => {
  13. this.createDialog('DeleteResDialog', {
  14. vm: this,
  15. data: [obj],
  16. columns: this.columns,
  17. title: i18n.t('table.action.delete'),
  18. name: this.$t('res.samluser'),
  19. onManager: this.onManager,
  20. })
  21. },
  22. meta: (obj) => this.$getDeleteResult(obj),
  23. },
  24. ]
  25. },
  26. methods: {
  27. isNormalStatus () {
  28. let normalStatus = false
  29. if (
  30. this.cloudaccount &&
  31. this.cloudaccount.enabled &&
  32. this.cloudaccount.status === 'connected' &&
  33. this.cloudaccount.health_status === 'normal'
  34. ) {
  35. normalStatus = true
  36. }
  37. return normalStatus
  38. },
  39. isOwner () {
  40. return this.isAdminMode || (this.cloudaccount && this.cloudaccount.domain_id === this.userInfo.projectDomainId)
  41. },
  42. },
  43. }