index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.project')"
  5. icon="res-project"
  6. :res-name="detailData.name"
  7. :current-tab="params.windowData.currentTab"
  8. :tabs="detailTabs"
  9. :loaded="loaded"
  10. @tab-change="handleTabChange">
  11. <template v-slot:actions>
  12. <actions
  13. :options="singleActions"
  14. :row="detailData"
  15. button-type="link"
  16. button-size="small" />
  17. </template>
  18. <component
  19. :is="params.windowData.currentTab"
  20. :res-id="data.id"
  21. :id="listId"
  22. :data="detailData"
  23. :resource="resource"
  24. :on-manager="onManager"
  25. :columns="columns"
  26. @refresh="refresh"
  27. @tab-change="handleTabChange" />
  28. </base-side-page>
  29. </template>
  30. <script>
  31. import { mapGetters } from 'vuex'
  32. import SidePageMixin from '@/mixins/sidePage'
  33. import WindowsMixin from '@/mixins/windows'
  34. import Actions from '@/components/PageList/Actions'
  35. import SingleActionsMixin from '../mixins/singleActions'
  36. import ColumnsMixin from '../mixins/columns'
  37. import ProjectDetail from './Detail'
  38. import ProjectDirectlyUnderUserList from './DirectlyUnderUserList'
  39. // import ProjectResourcesStatistics from './ResourcesStatistics'
  40. export default {
  41. name: 'ProjectSidePage',
  42. components: {
  43. ProjectDetail,
  44. Actions,
  45. ProjectDirectlyUnderUserList,
  46. // ProjectResourcesStatistics,
  47. },
  48. mixins: [SidePageMixin, WindowsMixin, SingleActionsMixin, ColumnsMixin],
  49. data () {
  50. return {}
  51. },
  52. computed: {
  53. ...mapGetters(['globalConfig']),
  54. listId () {
  55. switch (this.params.windowData.currentTab) {
  56. case 'event-drawer':
  57. return 'EventListForProjectSidePage'
  58. case 'project-directly-under-user-list':
  59. return 'DirectlyUnderUserListForProjectSidePage'
  60. default:
  61. return ''
  62. }
  63. },
  64. detailTabs () {
  65. const detailTabs = [
  66. { label: this.$t('system.text_159'), key: 'project-detail' },
  67. { label: this.$t('common_492'), key: 'project-directly-under-user-list' },
  68. // { label: this.$t('system.text_173'), key: 'project-resources-statistics' },
  69. { label: this.$t('system.text_17'), key: 'event-drawer' },
  70. ]
  71. return detailTabs
  72. },
  73. },
  74. created () {
  75. if (this.params.tab) this.handleTabChange(this.params.tab)
  76. },
  77. methods: {
  78. handleOpenSidepage (row, tab) {
  79. this.handleTabChange(tab)
  80. },
  81. },
  82. }
  83. </script>