singleActions.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { disableDeleteAction } from '@/utils/common/tableActions'
  2. import i18n from '@/locales'
  3. export default {
  4. created () {
  5. this.singleActions = [
  6. {
  7. label: i18n.t('middleware.syncstatus'),
  8. permission: 'elastic_searchs_perform_syncstatus',
  9. action: obj => {
  10. this.onManager('performAction', {
  11. steadyStatus: ['available'],
  12. id: obj.id,
  13. managerArgs: {
  14. action: 'syncstatus',
  15. },
  16. })
  17. },
  18. meta: () => ({
  19. validate: true,
  20. }),
  21. },
  22. {
  23. label: i18n.t('middleware.more'),
  24. actions: (obj) => {
  25. return [
  26. disableDeleteAction(Object.assign(this, {
  27. permission: 'elastic_searchs_update',
  28. }), {
  29. name: this.$t('dictionary.elasticsearch'),
  30. }),
  31. {
  32. label: i18n.t('middleware.delete'),
  33. permission: 'elastic_searchs_delete',
  34. action: () => {
  35. this.createDialog('DeleteResDialog', {
  36. vm: this,
  37. title: i18n.t('middleware.delete'),
  38. name: this.$t('dictionary.elasticsearch'),
  39. data: [obj],
  40. columns: this.columns,
  41. onManager: this.onManager,
  42. refresh: this.refresh,
  43. })
  44. },
  45. meta: () => this.$getDeleteResult(obj),
  46. },
  47. ]
  48. },
  49. },
  50. ]
  51. },
  52. }