index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="home_echarts">
  3. <div class="left" id='step3'>
  4. <report-echart :resize="resize"></report-echart>
  5. </div>
  6. <div class="right">
  7. <div class="top" id='step4'>
  8. <task-echart :resize="resize"></task-echart>
  9. </div>
  10. <div class="bottom" id='step5'>
  11. <event-echart :resize="resize"></event-echart>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import reportEchart from './components/report.vue'
  18. import eventEchart from './components/event.vue'
  19. import taskEchart from './components/task.vue'
  20. export default {
  21. components: {
  22. reportEchart,
  23. eventEchart,
  24. taskEchart
  25. },
  26. props: {},
  27. data() {
  28. return {
  29. resize:true
  30. };
  31. },
  32. watch: {},
  33. computed: {},
  34. created() {},
  35. mounted() {
  36. window.addEventListener('resize',()=>{
  37. this.resize = false
  38. this.$nextTick(()=>{
  39. this.resize = true
  40. })
  41. })
  42. },
  43. methods: {},
  44. deactivated(){
  45. window.removeEventListener('resize',()=>{})
  46. },
  47. beforeDestroy(){
  48. window.removeEventListener('resize',()=>{})
  49. }
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. .home_echarts{
  54. width: 100%;
  55. height: 400px;
  56. display: flex;
  57. flex: 1;
  58. align-items: center;
  59. border: 2px solid var(--bg);
  60. .left{
  61. width: 100%;
  62. height: 100%;
  63. min-width:324px;
  64. border-right: 2px solid var(--bg);
  65. }
  66. .right{
  67. width: 100%;
  68. height: 100%;
  69. min-width:700px;
  70. .top{
  71. height: 50%;
  72. width:calc(100% - 3px);
  73. border-bottom: 2px solid var(--bg);
  74. }
  75. .bottom{
  76. width:calc(100% - 3px);
  77. height: 50%;
  78. }
  79. }
  80. }
  81. </style>