44acc02be355adf040525eeeed087f8202300cf1.svn-base 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <a-tabs :defaultActiveKey="0">
  3. <span slot="tabBarExtraContent">
  4. <a-dropdown>
  5. <a-menu slot="overlay" >
  6. <template v-for="(chart,index) in group.charts">
  7. <a-menu-item @click="handleMenuClick(chart.head.code)" :key="index">{{chart.head.name}}</a-menu-item>
  8. </template>
  9. </a-menu>
  10. <a-button type="primary" size="small" class="ant-btn-background-ghost">详情<a-icon type="down"/></a-button>
  11. </a-dropdown>
  12. <a-button type="link" @click="handleToggle">
  13. <span v-if="isShow">展开<a-icon type="down"/></span>
  14. <span v-else>收起<a-icon type="up" /></span>
  15. </a-button>
  16. </span>
  17. <template v-for="(chart,index2) in group.charts">
  18. <a-tab-pane :key="index2" :tab="chart.head.name" style="margin-top:10px;">
  19. <transition name="slide-fade">
  20. <group-auto-chart v-if="isShow" :propsChartData="chart" :key="index2" ></group-auto-chart>
  21. </transition>
  22. </a-tab-pane>
  23. </template>
  24. </a-tabs>
  25. </template>
  26. <script>
  27. import GroupAutoChart from './GroupAutoChart'
  28. export default {
  29. name: 'GroupTemplateCard',
  30. components: {
  31. GroupAutoChart
  32. },
  33. props: ['group'],
  34. data() {
  35. return {
  36. isShow:true
  37. }
  38. },
  39. methods: {
  40. handleMenuClick(code) {
  41. this.$router.push({ path: '/online/cggraphreport/chart/' + code })
  42. },
  43. handleToggle(){
  44. this.isShow = !this.isShow
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. .slide-fade-enter-active {
  51. transition: all .3s ease;
  52. }
  53. .slide-fade-leave-active {
  54. transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
  55. }
  56. .slide-fade-enter, .slide-fade-leave-to{
  57. transform: translateX(10px);
  58. opacity: 0;
  59. }
  60. </style>