index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.user')"
  5. icon="res-user"
  6. :res-name="detailData.name"
  7. :actions="params.actions"
  8. :current-tab="params.windowData.currentTab"
  9. :tabs="detailTabs"
  10. :loaded="loaded"
  11. @tab-change="handleTabChange">
  12. <template v-slot:actions>
  13. <actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  14. </template>
  15. <component :is="params.windowData.currentTab" :onManager="onManager" :res-id="data.id" :id="listId" :data="detailData" :getParams="getParams" @tab-change="handleTabChange" />
  16. </base-side-page>
  17. </template>
  18. <script>
  19. import SidePageMixin from '@/mixins/sidePage'
  20. import WindowsMixin from '@/mixins/windows'
  21. import Actions from '@/components/PageList/Actions'
  22. import ColumnsMixin from '../mixins/columns'
  23. import SingleActionsMixin from '../mixins/singleActions'
  24. import UserDetail from './Detail'
  25. import Projects from './Projects'
  26. import Group from './Groups'
  27. export default {
  28. name: 'UserSidePage',
  29. components: {
  30. 'user-detail': UserDetail,
  31. Projects,
  32. Group,
  33. Actions,
  34. },
  35. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  36. data () {
  37. return {
  38. detailTabs: [
  39. { label: this.$t('system.text_159'), key: 'user-detail' },
  40. { label: this.$t('common_494'), key: 'projects' },
  41. { label: this.$t('common_495'), key: 'Group' },
  42. { label: this.$t('system.text_17'), key: 'event-drawer' },
  43. ],
  44. }
  45. },
  46. computed: {
  47. listId () {
  48. switch (this.params.windowData.currentTab) {
  49. case 'event-drawer':
  50. return 'EventListForUserSidePage'
  51. case 'projects':
  52. return 'ProjectsListForUserSidePage'
  53. case 'Group':
  54. return 'GroupListForUserSidePage'
  55. default:
  56. return ''
  57. }
  58. },
  59. },
  60. created () {
  61. if (this.params.tab) {
  62. this.handleTabChange(this.params.tab)
  63. }
  64. },
  65. methods: {
  66. handleOpenSidepage (row, tab) {
  67. this.handleTabChange(tab)
  68. },
  69. },
  70. }
  71. </script>