Authored by 鲁尚清

lineChart封装为组件

@@ -16,6 +16,9 @@ export default { @@ -16,6 +16,9 @@ export default {
16 chartId:'line-echart-declare' 16 chartId:'line-echart-declare'
17 } 17 }
18 }, 18 },
  19 + watch:{
  20 +
  21 + },
19 setup(props, {attrs, slots, emit}) { 22 setup(props, {attrs, slots, emit}) {
20 const {proxy} = Vue.getCurrentInstance(); 23 const {proxy} = Vue.getCurrentInstance();
21 24
1 -<div class="lineChart">  
2 -<!-- <div :id="chartId" style="width:100%;height:225px;"></div>-->  
3 - <div id="line-echart" style="width:100%;height:225px;"></div>  
4 -</div>  
  1 +<div :id="chartId" style="width:100%;height:225px;"></div>
@@ -24,11 +24,8 @@ export default { @@ -24,11 +24,8 @@ export default {
24 proxy.yAxisData=props.yAxisData; 24 proxy.yAxisData=props.yAxisData;
25 proxy.seriesData=props.seriesData; 25 proxy.seriesData=props.seriesData;
26 proxy.chartId=props.chartId; 26 proxy.chartId=props.chartId;
27 - console.log('ddd',proxy.chartId)  
28 -  
29 - const chartDom = document.getElementById('line-echart');  
30 - // const chartDom = document.getElementById(proxy.chartId);  
31 - console.log('d3e3',$(proxy.chartId)) 27 + // const chartDom = document.getElementById('line-echart-declare');
  28 + const chartDom=proxy.$el
32 const myChart = echarts.init(chartDom); 29 const myChart = echarts.init(chartDom);
33 let option; 30 let option;
34 31
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <section class="screen-left left-40" > 13 <section class="screen-left left-40" >
14 <div class="left-top"> 14 <div class="left-top">
15 <!--省局网络拓扑--> 15 <!--省局网络拓扑-->
16 - <NetworkTopology ></NetworkTopology> 16 +<!-- <NetworkTopology ></NetworkTopology>-->
17 </div> 17 </div>
18 <div class="left-bottom data-cloud"> 18 <div class="left-bottom data-cloud">
19 <div class="left-bottom-left flex-data"> 19 <div class="left-bottom-left flex-data">