index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div v-if="detail.show" class="mine-policy-detail">
  3. <el-page-header title="返回" icon="arrow-left" :content="detail.name" @back="detail.show = false"></el-page-header>
  4. <policy-detail ref="policyDetail"></policy-detail>
  5. </div>
  6. <template v-else>
  7. <el-tabs v-model="element">
  8. <el-tab-pane v-for="(label, key) in myBusinessTab" :key="key" :label="label" :name="key"></el-tab-pane>
  9. </el-tabs>
  10. <component :is="allComps[element]" @replyAll="table_detail"></component>
  11. </template>
  12. </template>
  13. <script>
  14. import { myBusinessTab } from "@/views/myBusiness/main";
  15. import allComps from "@/views/myBusiness/component/index";
  16. import policyDetail from "@/views/home/policyDetail.vue";
  17. export default {
  18. components: {
  19. policyDetail
  20. },
  21. data() {
  22. return {
  23. allComps,
  24. myBusinessTab,
  25. element: "toDo",
  26. detail: {
  27. show: false,
  28. name: null
  29. }
  30. }
  31. },
  32. methods: {
  33. table_detail(row) {
  34. this.detail.show = true;
  35. this.detail.name = row.name;
  36. nextTick(() => this.$refs.policyDetail.setData(row, 5));
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .mine-policy-detail {
  43. .el-page-header {
  44. position: relative;
  45. top: calc(-1 * $base-padding);
  46. left: calc(-1 * $base-padding);
  47. width: calc(100% - $base-padding);
  48. padding: 15px;
  49. background: #fff;
  50. box-shadow: var(--el-box-shadow-light);
  51. :deep(.el-page-header__back:hover) {
  52. color: var(--el-color-primary);
  53. }
  54. }
  55. :deep(.tjm_card_style_custom) > .el-card__body {
  56. max-height: calc(
  57. $base-main-height - $base-padding - 2 * var(--el-card-padding) - 54px
  58. );
  59. overflow: auto;
  60. }
  61. }
  62. .el-tabs :deep(.el-tabs__content) {
  63. display: none;
  64. }
  65. </style>