singleActions.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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('network.text_130'),
  8. action: (obj) => {
  9. this.createDialog('DnsCreateDialog', {
  10. title: i18n.t('network.text_130'),
  11. data: [obj],
  12. columns: this.columns,
  13. onManager: this.onManager,
  14. refresh: this.refresh,
  15. type: 'update',
  16. })
  17. },
  18. meta: (obj) => ({
  19. validate: obj.can_update,
  20. }),
  21. },
  22. {
  23. label: i18n.t('network.text_129'),
  24. actions: obj => {
  25. return [
  26. ...getEnabledSwitchActions(this, obj),
  27. {
  28. label: i18n.t('network.text_155'),
  29. action: () => {
  30. this.createDialog('DnsCreateDialog', {
  31. title: i18n.t('network.text_155'),
  32. data: [obj],
  33. columns: this.columns,
  34. onManager: this.onManager,
  35. refresh: this.refresh,
  36. type: 'clone',
  37. })
  38. },
  39. },
  40. {
  41. label: i18n.t('network.text_131'),
  42. permission: 'dnsrecords_delete',
  43. action: () => {
  44. this.createDialog('DeleteResDialog', {
  45. vm: this,
  46. title: i18n.t('network.text_131'),
  47. name: this.$t('dictionary.dnsrecord'),
  48. data: [obj],
  49. columns: this.columns,
  50. onManager: this.onManager,
  51. })
  52. },
  53. meta: () => this.$getDeleteResult(obj),
  54. },
  55. ]
  56. },
  57. },
  58. ]
  59. },
  60. }