a02819d90adc39cb25c73c8234d5226e6575d82d.svn-base 955 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div>
  3. <a-radio-group v-model="barType" button-style="solid" v-if="graphTypeDictOptions.length>1">
  4. <template v-for="graphType in graphTypeDictOptions">
  5. <a-radio-button :key="graphType.value" :value="graphType.value">{{graphType.text}}</a-radio-button>
  6. </template>
  7. </a-radio-group>
  8. <chart :chartData="chartData" :head="head" :graphType="barType" :aliases="aliases" :title="graphTypeDictOptions.length===1 && title"/>
  9. </div>
  10. </template>
  11. <script>
  12. import Chart from './Chart'
  13. export default {
  14. name: 'TabGraphreportAutoChart',
  15. components: {
  16. Chart
  17. },
  18. props: ['chartData', 'head', 'graphTypeDictOptions', 'title', 'aliases'],
  19. data() {
  20. return {
  21. barType: ''
  22. }
  23. },
  24. mounted() {
  25. this.barType = this.graphTypeDictOptions[0] && this.graphTypeDictOptions[0].value
  26. },
  27. updated() {
  28. // this.barType = this.graphTypeDictOptions[0] && this.graphTypeDictOptions[0].value
  29. }
  30. }
  31. </script>