ljj 6 years ago
parent
commit
55415180ef

File diff suppressed because it is too large
+ 5 - 27
component/chart/guigang.js


+ 22 - 3
component/chart/map-chart.js

@ -8,6 +8,7 @@
            return {
                chartid: _.uniqueId("chart_"),
                chart: null,
                lastIndex:null
            }
        },
        mounted: function () {
@ -15,11 +16,29 @@
      
            this.$nextTick(function () {
                that.chart = echarts.init(document.getElementById(that.chartid));
               
                    that.chart.setOption(defaults);  //试着一下
                that.chart.setOption(defaults);  //试着一下
                this.chart.on('click', function (params) {//点击事件
                    that.$emit('clickMap',params)    //传给外面点击事件
                    if (params.componentType === 'series') {
                      if(that.lastIndex !== null) {
                        that.chart.dispatchAction({   //把上一个高亮的取消掉
                                    type: 'downplay',
                                    seriesIndex: 0,
                                    dataIndex: that.lastIndex
                        })
                      }
                      that.$emit('map-click',params)     
                      that.lastIndex = params.dataIndex //高亮现在这个
                      that.chart.dispatchAction({
                          type: 'highlight',
                          seriesIndex: 0,
                          dataIndex: params.dataIndex
                      })  
                    }
                })  
   
            })
        
        },
        methods: {

+ 5 - 4
page/bigData/html/medical.html

@ -86,7 +86,7 @@
                <div class="middle flex_coloumn">
					<!-- 地图 -->
					<div class="map mt20">
							<map-chart></map-chart>
							<map-chart @map-click="clickMap"></map-chart>
							<div class="dropdown Mapselect">
									<div type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">{{city}}
										<span class="caret"></span>
@ -173,8 +173,7 @@
		<script src="../../../js/jquery.min.js?v=2.1.4"></script>
		<script src="../../../component/common/event-bus.js"></script>
		<script src="js/slider.js"></script>
		<!-- <script src="../../../js/plugins/echarts/echarts.js"></script> -->
		<script src="../../../js/echarts.js"></script> 
		<script src="../../../js/plugins/echarts/echarts.js"></script>
		<script src="../../../js/plugins/toastr/toastr.min.js"></script>
		<script src="../../../js/bootstrap.min.js"></script>
		<script src="../../../js/es6-promise.js"></script>
@ -182,9 +181,11 @@
		<script src="../../../js/plugins/layer/layer.min.js"></script>
		<!--<script src="../../../js/security.js"></script>-->
		<script src="../../../js/api/http-request.js"></script>
		<script src="../../../component/chart/guigang.js"></script>
		<script src="../../../component/chart/bar-chart.js"></script>
		<script src="../../../component/chart/map-chart.js"></script>
		<script src="../../../component/chart/guigang.js.js"></script>
	
		<script src="../../../dataJson/bigData.js"></script>
		<script src="../js/medical.js"></script>
	</body>

+ 4 - 0
page/bigData/js/medical.js

@ -80,6 +80,10 @@ new Vue({
        },
        newObj:function(obj){
            return JSON.parse(JSON.stringify(obj))
        },
        clickMap:function(res){
           console.log(res);
            
        }
    }
});