singleActions.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { getEnabledSwitchActions } from '@/utils/common/tableActions'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: this.$t('common.edit'),
  7. permission: 'commonalerts_update',
  8. action: obj => {
  9. this.$router.push({
  10. path: `commonalerts/${obj.id}/update`,
  11. query: {
  12. alertType: obj.alert_type,
  13. },
  14. })
  15. },
  16. },
  17. {
  18. label: this.$t('common.more'),
  19. actions: row => [
  20. ...getEnabledSwitchActions(this, row, ['commonalerts_perform_enable', 'commonalerts_perform_disable']),
  21. {
  22. label: this.$t('common.clone'),
  23. permission: 'commonalerts_create,commonalerts_create',
  24. action: obj => {
  25. this.$router.push({
  26. path: `commonalerts/${obj.id}/clone`,
  27. query: {
  28. alertType: obj.alert_type,
  29. },
  30. })
  31. },
  32. },
  33. {
  34. label: this.$t('common.delete'),
  35. permission: 'commonalerts_delete',
  36. action: (obj) => {
  37. this.createDialog('DeleteResDialog', {
  38. vm: this,
  39. data: [obj],
  40. columns: this.columns,
  41. title: this.$t('common.delete'),
  42. name: this.$t('dictionary.commonalert'),
  43. onManager: this.onManager,
  44. success: () => {
  45. if (this.params && this.params.options && this.params.options.sourceList) {
  46. this.params.options.sourceList.refresh()
  47. }
  48. },
  49. })
  50. },
  51. meta: (obj) => this.$getDeleteResult(obj),
  52. },
  53. ],
  54. },
  55. ]
  56. },
  57. }