singleActions.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import i18n from '@/locales'
  2. import { getEnabledSwitchActions } from '@/utils/common/tableActions'
  3. export default {
  4. created () {
  5. this.singleActions = [
  6. {
  7. label: i18n.t('system.text_153'),
  8. actions: (row) => {
  9. return [
  10. ...getEnabledSwitchActions(this, row, ['domains_perform_enable', 'domains_perform_disable'], {
  11. actions: [
  12. () => {
  13. this.onManager('batchUpdate', {
  14. id: [row.id],
  15. managerArgs: {
  16. data: {
  17. enabled: true,
  18. },
  19. },
  20. })
  21. },
  22. () => {
  23. this.onManager('batchUpdate', {
  24. id: [row.id],
  25. managerArgs: {
  26. data: {
  27. enabled: false,
  28. },
  29. },
  30. })
  31. },
  32. ],
  33. }),
  34. // {
  35. // label: '克隆',
  36. // action: () => {
  37. // this.$router.push(`/domain/create?domain=${row.id}`)
  38. // },
  39. // meta: () => {
  40. // return {
  41. // validate: row.enabled,
  42. // }
  43. // },
  44. // },
  45. {
  46. label: i18n.t('system.text_129'),
  47. permission: 'domains_delete',
  48. action: () => {
  49. this.createDialog('DeleteResDialog', {
  50. vm: this,
  51. data: [row],
  52. columns: this.columns,
  53. title: i18n.t('system.text_129'),
  54. name: this.$t('dictionary.domain'),
  55. onManager: this.onManager,
  56. })
  57. },
  58. meta: () => this.$getDeleteResult(row),
  59. },
  60. ]
  61. },
  62. },
  63. ]
  64. },
  65. }