7f1e368555a7718ca5565043a2d87fbc66f373ce.svn-base 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="app-container">
  3. <!-- <h1>集团</h1> -->
  4. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  5. <el-tab-pane label="汇总统计" name="first">
  6. <component :is="myComponent1" ref="detail1" />
  7. </el-tab-pane>
  8. <el-tab-pane label="混料统计" name="second">
  9. <keep-alive>
  10. <component :is="myComponent2" ref="detail2" />
  11. </keep-alive>
  12. </el-tab-pane>
  13. <el-tab-pane label="撒料统计" name="third">
  14. <keep-alive>
  15. <component :is="myComponent3" ref="detail3" />
  16. </keep-alive>
  17. </el-tab-pane>
  18. </el-tabs>
  19. </div>
  20. </template>
  21. <script>
  22. import echarts from 'echarts'
  23. require('echarts/theme/macarons')
  24. import { GetDataByName, GetReportform } from '@/api/common'
  25. import Cookies from 'js-cookie'
  26. import { parseTime } from '@/utils/index.js'
  27. import Pagination from '@/components/Pagination'
  28. import { json2excel } from '@/utils/index.js'
  29. import { MessageBox } from 'element-ui'
  30. import Tab1 from './tab1'
  31. import Tab2 from './tab2'
  32. export default {
  33. name: 'GroupErrorAnalysis',
  34. components: { Pagination, Tab1, Tab2 },
  35. data() {
  36. return {
  37. activeName: 'first',
  38. myComponent1: null,
  39. myComponent2: null,
  40. myComponent3: null
  41. }
  42. },
  43. created() {},
  44. mounted() {
  45. this.detailComponent1()
  46. },
  47. methods: {
  48. detailComponent1() {
  49. if (this.activeName == 'first') {
  50. const vue = this
  51. var myComponent1 = () => import('./tab1.vue')
  52. return vue.myComponent1 = myComponent1
  53. }
  54. },
  55. handleTabClick() {
  56. if (this.activeName == 'first') {
  57. const vue = this
  58. var myComponent1 = () => import('./tab1.vue')
  59. return vue.myComponent1 = myComponent1
  60. } else if (this.activeName == 'second') {
  61. const vue = this
  62. var myComponent2 = () => import('./tab2.vue')
  63. return vue.myComponent2 = myComponent2
  64. } else if (this.activeName == 'third') {
  65. const vue = this
  66. var myComponent3 = () => import('./tab3.vue')
  67. return vue.myComponent3 = myComponent3
  68. }
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .search{margin-bottom:10px;}
  75. </style>