dataDetails.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <el-dialog width="50%" @closed="closed()" :show-close="false" class="my-info-dialog">
  3. <template #title>
  4. <div class="showTitles">
  5. <div class="titles">{{title}}详情</div>
  6. </div>
  7. </template>
  8. <div class="body">
  9. <div id="detailEcharts" class="echarts"></div>
  10. </div>
  11. </el-dialog>
  12. </template>
  13. <script>
  14. import * as echarts from "echarts";
  15. export default {
  16. props: {
  17. title: {
  18. type: String,
  19. default: '111',
  20. required: true,
  21. },
  22. },
  23. updated() {
  24. this.getEcharts()
  25. },
  26. mounted() {
  27. this.xdata = JSON.parse("[\"09:24\",\"09:25\",\"09:26\",\"09:27\",\"09:28\",\"09:29\",\"09:30\",\"09:31\",\"09:32\",\"09:33\",\"09:34\",\"09:35\",\"09:36\",\"09:37\",\"09:38\",\"09:39\",\"09:40\",\"09:41\",\"09:42\",\"09:43\",\"09:44\",\"09:45\",\"09:46\",\"09:47\",\"09:48\",\"09:49\",\"09:50\",\"09:51\",\"09:52\",\"09:53\",\"09:54\",\"09:55\",\"09:56\",\"09:57\",\"09:58\",\"09:59\",\"10:00\",\"10:01\",\"10:02\",\"10:03\",\"10:04\",\"10:05\",\"10:06\",\"10:07\",\"10:08\",\"10:09\",\"10:10\",\"10:11\",\"10:12\",\"10:13\",\"10:14\",\"10:15\",\"10:16\",\"10:17\",\"10:18\",\"10:19\",\"10:20\",\"10:21\",\"10:22\",\"10:23\",\"10:24\",\"10:25\",\"10:26\",\"10:27\",\"10:28\",\"10:29\",\"10:30\",\"10:31\",\"10:32\",\"10:33\",\"10:34\",\"10:35\",\"10:36\",\"10:37\",\"10:38\",\"10:39\",\"10:40\",\"10:41\",\"10:42\",\"10:43\",\"10:44\",\"10:45\",\"10:46\",\"10:47\",\"10:48\",\"10:49\",\"10:50\",\"10:51\",\"10:52\",\"10:53\",\"10:54\",\"10:55\",\"10:56\",\"10:57\",\"10:58\",\"10:59\",\"11:00\",\"11:01\",\"11:02\",\"11:03\",\"11:04\",\"11:05\",\"11:06\",\"11:07\",\"11:08\",\"11:09\",\"11:10\",\"11:11\",\"11:12\",\"11:13\",\"11:14\",\"11:15\",\"11:16\",\"11:17\",\"11:18\",\"11:19\",\"11:20\",\"11:21\",\"11:22\",\"11:23\",\"11:24\",\"11:25\",\"11:26\",\"11:27\",\"11:28\",\"11:29\",\"11:30\",\"11:31\",\"11:32\",\"11:33\",\"11:34\",\"11:35\",\"11:36\",\"11:37\",\"11:38\",\"11:39\",\"11:40\",\"11:41\",\"11:42\",\"11:43\",\"11:44\",\"11:45\",\"11:46\",\"11:47\",\"11:48\",\"11:49\",\"11:50\",\"11:51\",\"11:52\",\"11:53\",\"11:54\",\"11:55\",\"11:56\",\"11:57\",\"11:58\",\"11:59\",\"12:00\",\"12:01\",\"12:02\",\"12:03\",\"12:04\",\"12:05\",\"12:06\",\"12:07\",\"12:08\",\"12:09\",\"12:10\",\"12:11\",\"12:12\",\"12:13\",\"12:14\",\"12:15\",\"12:16\",\"12:17\",\"12:18\",\"12:19\",\"12:20\",\"12:21\",\"12:22\",\"12:23\",\"12:24\",\"12:25\",\"12:26\",\"12:27\",\"12:28\",\"12:29\",\"12:30\",\"12:31\",\"12:32\",\"12:33\",\"12:34\",\"12:35\",\"12:36\",\"12:37\",\"12:38\",\"12:39\",\"12:40\",\"12:41\",\"12:42\",\"12:43\",\"12:44\",\"12:45\",\"12:46\",\"12:47\",\"12:48\",\"12:49\",\"12:50\",\"12:51\",\"12:52\",\"12:53\",\"12:54\",\"12:55\",\"12:56\",\"12:57\",\"12:58\",\"12:59\",\"01:00\",\"01:01\",\"01:02\",\"01:03\",\"01:04\",\"01:05\",\"01:06\",\"01:07\",\"01:08\",\"01:09\",\"01:10\",\"01:11\",\"01:12\",\"01:13\",\"01:14\",\"01:15\",\"01:16\",\"01:17\",\"01:18\",\"01:19\",\"01:20\",\"01:21\",\"01:22\",\"01:23\",\"01:24\",\"01:25\",\"01:26\",\"01:27\",\"01:28\",\"01:29\",\"01:30\",\"01:31\",\"01:32\",\"01:33\",\"01:34\",\"01:35\",\"01:36\",\"01:37\",\"01:38\",\"01:39\",\"01:40\",\"01:41\",\"01:42\",\"01:43\",\"01:44\",\"01:45\",\"01:46\",\"01:47\",\"01:48\",\"01:49\",\"01:50\",\"01:51\",\"01:52\",\"01:53\",\"01:54\",\"01:55\",\"01:56\",\"01:57\",\"01:58\",\"01:59\",\"02:00\",\"02:01\",\"02:02\",\"02:03\",\"02:04\",\"02:05\",\"02:06\",\"02:07\",\"02:08\",\"02:09\",\"02:10\",\"02:11\",\"02:12\",\"02:13\",\"02:14\",\"02:15\",\"02:16\",\"02:17\",\"02:18\",\"02:19\",\"02:20\",\"02:21\",\"02:22\",\"02:23\",\"02:24\",\"02:25\",\"02:26\",\"02:27\",\"02:28\",\"02:29\",\"02:30\",\"02:31\",\"02:32\",\"02:33\",\"02:34\",\"02:35\",\"02:36\",\"02:37\",\"02:38\",\"02:39\",\"02:40\",\"02:41\",\"02:42\",\"02:43\",\"02:44\",\"02:45\",\"02:46\",\"02:47\",\"02:48\",\"02:49\",\"02:50\",\"02:51\",\"02:52\",\"02:53\",\"02:54\",\"02:55\",\"02:56\",\"02:57\",\"02:58\",\"02:59\",\"03:00\",\"03:01\",\"03:02\",\"03:03\",\"03:04\",\"03:05\",\"03:06\",\"03:07\",\"03:08\",\"03:09\",\"03:10\",\"03:11\",\"03:12\",\"03:13\",\"03:14\",\"03:15\",\"03:16\",\"03:17\",\"03:18\",\"03:19\",\"03:20\",\"03:21\",\"03:22\",\"03:23\",\"03:24\",\"03:25\",\"03:26\",\"03:27\",\"03:28\",\"03:29\",\"03:30\",\"03:31\",\"03:32\",\"03:33\",\"03:34\",\"03:35\",\"03:36\",\"03:37\",\"03:38\",\"03:39\",\"03:40\",\"03:41\",\"03:42\",\"03:43\",\"03:44\",\"03:45\",\"03:46\",\"03:47\",\"03:48\",\"03:49\",\"03:50\",\"03:51\",\"03:52\",\"03:53\",\"03:54\",\"03:55\",\"03:56\",\"03:57\",\"03:58\",\"03:59\",\"04:00\",\"04:01\",\"04:02\",\"04:03\",\"04:04\",\"04:05\",\"04:06\",\"04:07\",\"04:08\",\"04:09\",\"04:10\",\"04:11\",\"04:12\",\"04:13\",\"04:14\",\"04:15\",\"04:16\",\"04:17\",\"04:18\",\"04:19\",\"04:20\",\"04:21\",\"04:22\",\"04:23\",\"04:24\",\"04:25\",\"04:26\",\"04:27\",\"04:28\",\"04:29\",\"04:30\",\"04:31\",\"04:32\",\"04:33\",\"04:34\",\"04:35\",\"04:36\",\"04:37\",\"04:38\",\"04:39\",\"04:40\",\"04:41\",\"04:42\",\"04:43\",\"04:44\",\"04:45\",\"04:46\",\"04:47\",\"04:48\",\"04:49\",\"04:50\",\"04:51\",\"04:52\",\"04:53\",\"04:54\",\"04:55\",\"04:56\",\"04:57\",\"04:58\",\"04:59\",\"05:00\",\"05:01\",\"05:02\",\"05:03\",\"05:04\",\"05:05\",\"05:06\",\"05:07\",\"05:08\",\"05:09\",\"05:10\",\"05:11\",\"05:12\",\"05:13\",\"05:14\",\"05:15\",\"05:16\",\"05:17\",\"05:18\",\"05:19\",\"05:20\",\"05:21\",\"05:22\",\"05:23\"]")
  28. },
  29. data(){
  30. return{
  31. xdata: []
  32. }
  33. },
  34. methods: {
  35. getEcharts() {
  36. console.log(document.getElementById('detailEcharts'));
  37. var chartDom = document.getElementById('detailEcharts');
  38. var myChart = echarts.init(chartDom, '#ffffff');
  39. var option;
  40. option = {
  41. legend: {
  42. show: true,
  43. data: ["111", "222"],
  44. right: 56,
  45. icon: "circle",
  46. itemWidth: 6,
  47. inactiveColor: '#606769',
  48. textStyle: {
  49. color: '#B3BDC0',
  50. fontSize: 12,
  51. },
  52. },
  53. // title: {
  54. // text: 'Income of Germany and France since 1950'
  55. // },
  56. // tooltip: {
  57. // trigger: 'axis'
  58. // },
  59. xAxis: [
  60. {
  61. type: "category",
  62. boundaryGap: false,
  63. axisLabel: {
  64. interval: 60,
  65. showMinLabel: true,
  66. showMaxLabel: true,
  67. formatter: "{value}",
  68. fontSize: 14,
  69. textStyle: {
  70. color: '#606769',
  71. },
  72. },
  73. axisLine: {
  74. show: false,
  75. },
  76. data: this.xdata,
  77. },
  78. ],
  79. yAxis: {
  80. type: "value",
  81. // name: 'y轴',
  82. axisLabel: {
  83. formatter: "{value}",
  84. fontSize: 14,
  85. },
  86. axisLine: {
  87. show: false,
  88. },
  89. splitLine: {
  90. show: true,
  91. lineStyle: {
  92. color: '#606769',
  93. type: "dashed",
  94. },
  95. },
  96. },
  97. series: [{
  98. name: '111',
  99. smooth: true,
  100. showSymbol: false,
  101. data: [150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260,],
  102. type: 'line'
  103. },
  104. {
  105. name: '222',
  106. smooth: true,
  107. showSymbol: false,
  108. data: [50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60,],
  109. type: 'line'
  110. }]
  111. };
  112. option && myChart.setOption(option);
  113. },
  114. closed() {
  115. this.$emit('closed');
  116. },
  117. },
  118. }
  119. </script>
  120. <style>
  121. .showTitles {
  122. display: flex;
  123. flex-direction: row;
  124. align-items: center;
  125. justify-content: center;
  126. margin-top: -10px;
  127. font-size: 18px;
  128. color: #FFFFFF;
  129. }
  130. .body {
  131. background-color: black;
  132. width: 100%;
  133. margin-top: -30px;
  134. /* height: 200px; */
  135. }
  136. .echarts {
  137. width: 900px;
  138. height: 480px;
  139. /* margin-top: 20px; */
  140. margin-left: 10px;
  141. padding-top: 20px;
  142. }
  143. </style>