singleActions.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { getEnabledSwitchActions } from '@/utils/common/tableActions'
  2. import i18n from '@/locales'
  3. export default {
  4. created () {
  5. this.singleActions = [
  6. {
  7. label: i18n.t('system.text_152'),
  8. permission: 'contacts_update',
  9. action: (obj) => {
  10. const contact = this.parseDetail(obj.details)
  11. this.createDialog('ContactUpdateDialog', {
  12. data: [
  13. { ...obj, contact },
  14. ],
  15. columns: this.columns,
  16. success: () => {
  17. this.refresh()
  18. },
  19. })
  20. },
  21. },
  22. {
  23. label: i18n.t('system.text_153'),
  24. actions: obj => {
  25. return [
  26. ...getEnabledSwitchActions(this, obj, ['contacts_perform_enable', 'contacts_perform_disable']),
  27. {
  28. label: i18n.t('system.text_129'),
  29. permission: 'contacts_delete',
  30. action: (obj) => {
  31. this.createDialog('DeleteResDialog', {
  32. vm: this,
  33. data: [obj],
  34. columns: this.columns,
  35. title: i18n.t('system.text_129'),
  36. name: this.$t('dictionary.receiver'),
  37. onManager: this.onManager,
  38. })
  39. },
  40. meta: () => this.$getDeleteResult(obj),
  41. },
  42. ]
  43. },
  44. },
  45. ]
  46. },
  47. }