lulihong 6 роки тому
батько
коміт
d4986cfbcf

+ 15 - 0
page/bigData/css/home.css

@ -404,6 +404,11 @@ h4 {
	margin-top: 0.1rem;
}
.pt20 {
	padding-top: 0.1rem;
}
.div-siwang-type {
	width: 50%;
	position: absolute;
@ -508,3 +513,13 @@ h4 {
	background: url(../images/mjzfwqktoubukuang.png) center center / 100% 100% no-repeat;
	background-size: 100% 100%;
}
.div-mask-layer{
	width: 100%;height: 100%;background: black;opacity: 0.5;position: absolute;z-index: 200;overflow: hidden;
}
.ibox-content{
	position: absolute;top:50%;margin-top: -117.5px;background-color: transparent;left: 50%;margin-left: -45px;border: 0;
}
.sk-spinner-fading-circle .sk-circle:before{
	background-color:white;
}

+ 24 - 4
page/bigData/html/home.html

@ -17,6 +17,27 @@
	<body>
		<div id="main">
			<!-- 遮罩层 -->
			<div class="div-mask-layer">
				<div class="ibox-content">
					<div class="spiner-example">
						<div class="sk-spinner sk-spinner-fading-circle">
							<div class="sk-circle1 sk-circle"></div>
							<div class="sk-circle2 sk-circle"></div>
							<div class="sk-circle3 sk-circle"></div>
							<div class="sk-circle4 sk-circle"></div>
							<div class="sk-circle5 sk-circle"></div>
							<div class="sk-circle6 sk-circle"></div>
							<div class="sk-circle7 sk-circle"></div>
							<div class="sk-circle8 sk-circle"></div>
							<div class="sk-circle9 sk-circle"></div>
							<div class="sk-circle10 sk-circle"></div>
							<div class="sk-circle11 sk-circle"></div>
							<div class="sk-circle12 sk-circle"></div>
						</div>
					</div>
				</div>
			</div>
			<div class="div-header"></div>
			<div class="div-title" @click="skipClick()">大数据应用服务平台 <input type="checkbox" class="sanjiao"><img style="transition: all .3s ease-in-out" src="../images/sanjiao.png"></div>
			<div class="div-skip" :class="{'div-skip-active':skipShow}">
@ -42,8 +63,8 @@
				</div>
				<div class="center-panel" v-cloak>
					<!-- 地图 -->
					<div class="map mt20">
							<div class="set_all_city" @click="clickMap({name:'贵港市'})" title="选择全市">
					<div class="map mt20 pt20">
							<div class="set_all_city" @click="clickMap({name:'上饶市'})" title="选择全市">
									<img src="../images/allCity.png">
								</div>
							<map-chart @map-click="clickMap" ref="map" :config="mapData"></map-chart>
@ -54,7 +75,7 @@
									</div>
									<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
											<li role="presentation" @click="setCity(item)" v-for="item in town">
													<a role="menuitem" href="#">{{item.townName}}</a>
													<a role="menuitem" href="#">{{item.name}}</a>
											</li>
									</ul>
							</div>
@ -86,7 +107,6 @@
		<script src="../../../js/plugins/layer/layer.min.js"></script>
		<script src="../../../js/api/http-request.js"></script>
		<script src="../../../js/api/bigData-api.js"></script>
		<script src="../../../component/chart/guigang.js"></script>
		<script src="../../../component/chart/map-chart.js"></script>
		<script src="../component/disease-crowd.js"></script>
		<script src="../component/high-incidence-disease.js"></script>

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

@ -289,14 +289,9 @@
		<script src="../../../js/plugins/layer/layer.min.js"></script>
		<script src="../../../js/api/http-request.js"></script>
		<script src="../../../js/api/bigData-api.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="../js/medicalCharts.js"></script>
		<!--<script src="../../../dataJson/bigData2.js"></script>
		<script src="../../../dataJson/bigData3.js"></script>
		<script src="../../../dataJson/bigData4.js"></script>
		<script src="../../../dataJson/bigData5.js"></script>-->
		<script src="../js/medical.js"></script>
	</body>

+ 36 - 27
page/bigData/js/home.js

@ -9,42 +9,51 @@ new Vue({
	data: {
		jsonUrl:"../../../dataJson/jumingHealthJson/高血压人群.json",
		jsonData:null,
        city:'贵港市',
        town:[
            {
                "townName": "贵港市",
                "result": "0"
            },
            {
                "townName": "港北区",
                "result": "26531"
            },
            {
                "townName": "港南区",
                "result": "25634"
            },
            {
                "townName": "桂平市",
                "result": "113485"
            },
            {
                "townName": "平南县",
                "result": "74128"
            },
            {
                "townName": "覃塘区",
                "result": "12587"
            },
        ],
        city: '上饶市',
		town: [],
		cityVal:"0",
        mapData:null,
		skipShow:0,
		lineHeightIndex:null,
	},
	mounted: function() {
	  this.bindEvents();
	  this.initData();
      this.getJsonData();
    },
    methods: {
    	initData:function(){
    		var vm = this;
    		$(".div-mask-layer").hide();
    		var reqUrl = [{url: bigDataAPI.getCityArea,reqType: 'get',data: {}},
    		{url:bigDataAPI.getMapJingWeiDuInfo,reqType: 'get',data:{}},//上饶地图经纬度数据
    		{url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0012"}},//地图数据
    		];
    		httpRequest.getReqPromises(reqUrl).then(function(datas) {
    			vm.town = [{
					"name": "上饶市",
					"id": "0"
				}].concat(datas[0]);
				echarts.registerMap('上饶',datas[1]);
				vm.setMapData(datas[2]);
    		})
    	},
    	setMapData: function(data) {
			var optionData = [];
			_.map(data.obj.VIEW_14_0012, function(item) {
				if(item.firstColumn != "合计") {
					optionData.push({
						name: item.townName,
						value: parseInt(item.HC_14_1019)
					})
				}
			})
			var options = optionData;
			this.mapData = {
				data: options,
				index: this.lineHeightIndex
			};
		},
    	getJsonData:function(){
    		var vm = this;
    		bigDataAPI.getJsonData(this.jsonUrl).then(function(res){

+ 58 - 11
page/bigData/js/medical.js

@ -25,7 +25,7 @@ new Vue({
		lastDayYear: "", //本年最后一天
		halfYearStartDate: "", //近半年开始时间
		halfYearEndDate: "", //近半年结束时间
		yesterdayDate:""
		yesterdayDate:""//昨天
	},
	mounted: function() {
		this.initData();
@ -33,9 +33,8 @@ new Vue({
	methods: {
		initData: function() {
			$(".div-mask-layer").show();
			var vm = this,
				data1, data2, data3, data4, data5, data6, data7, data8;
			this.formatDate(); //格式化时间
			var vm = this,data1, data2, data3, data4, data5, data6, data7, data8;
			this.formatDate2017(); //格式化时间
			this.town.map(function(v, i) {
				if(v.name == vm.city) {
					vm.cityVal = v.id;
@ -75,7 +74,7 @@ new Vue({
					"id": "0"
				}].concat(datas[0]);
				vm.leftData1 = datas[1];
				vm.leftData2 = data2 = datas[2];
				vm.leftData2 = datas[2];
				data3 = datas[3];
				data4 = datas[4];
				data5 = datas[5];
@ -184,7 +183,7 @@ new Vue({
		setTable1: function(data4) {
			var resData = [];
			_.map(data4.obj.VIEW_14_0013, function(item, index) {
				if(item.firstColumn != "合计") {
				if(item.firstColumn != "合计" && item.month) {
					item.month = parseInt(item.month.substring(5, 7))+"月";
					resData.push(item)
				}
@ -194,7 +193,7 @@ new Vue({
		setTable2: function(data5) {
			var resData = [];
			_.map(data5.obj.VIEW_14_0014, function(item, index) {
				if(item.firstColumn != "合计") {
				if(item.firstColumn != "合计" && item.month) {
					item.month = parseInt(item.month.substring(5, 7))+"月";
					resData.push(item)
				}
@ -217,6 +216,53 @@ new Vue({
			}
		},
		formatDate: function() {
			//获取上个月第一天
			var firstdate = new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1);
			//获取上个月最后一天
			var date = new Date();
			var day = new Date(date.getFullYear(), date.getMonth(), 0).getDate();
			var enddate = new Date(new Date().getFullYear(), new Date().getMonth() - 1, day);
			//获取本年第一天和最后一天
			var firstYearDate = new Date();
			firstYearDate.setDate(1);
			firstYearMonty = firstYearDate.setMonth(0);
			//近半年开始时间
			var date1 = new Date();
			date1.setMonth(date1.getMonth() - 6);
			var year1 = date1.getFullYear();
			var month1 = date1.getMonth() + 1;
			month1 = (month1 < 10 ? "0" + month1 : month1);
			//格式化结果
			this.firstDay = firstdate.format("yyyy-MM-dd");
			this.lastDay = enddate.format("yyyy-MM-dd");
			this.firstDayYear = firstYearDate.format("yyyy-MM-dd");
			this.lastDayYear = (new Date().getFullYear()) + "-12-31";
			this.halfYearStartDate = year1.toString() + '-' + month1.toString() + "-01";
			this.halfYearEndDate = this.getCurrentMonthLast();
			this.yesterdayDate = this.getYesterday(-1, '-');
		},
		getCurrentMonthLast: function() {
			var date = new Date();
			var currentMonth = date.getMonth();
			var nextMonth = ++currentMonth;
			var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth-1, 1);
			var oneDay = 1000 * 60 * 60 * 24;
			return(new Date(nextMonthFirstDay - oneDay)).format("yyyy-MM-dd");
		},
		getYesterday:function(num, str){
			var today = new Date();
		    var nowTime = today.getTime();
		    var ms = 24*3600*1000*num;
		    today.setTime(parseInt(nowTime + ms));
		    var oYear = today.getFullYear();
		    var oMoth = (today.getMonth() + 1).toString();
		    if (oMoth.length <= 1) oMoth = '0' + oMoth;
		    var oDay = today.getDate().toString();
		    if (oDay.length <= 1) oDay = '0' + oDay;
		    return oYear + str + oMoth + str + oDay;
		},
		formatDate2017: function() {
			debugger
			//获取上个月第一天
			var firstdate = new Date(new Date().getFullYear()-1, new Date().getMonth() - 1, 1);
			//获取上个月最后一天
@ -225,6 +271,7 @@ new Vue({
			var enddate = new Date(new Date().getFullYear()-1, new Date().getMonth() - 1, day);
			//获取本年第一天和最后一天
			var firstYearDate = new Date();
			firstYearDate.setFullYear(new Date().getFullYear()-1)
			firstYearDate.setDate(1);
			firstYearMonty = firstYearDate.setMonth(0);
			//近半年开始时间
@ -239,10 +286,10 @@ new Vue({
			this.firstDayYear = firstYearDate.format("yyyy-MM-dd");
			this.lastDayYear = (new Date().getFullYear()-1) + "-12-31";
			this.halfYearStartDate = year1.toString() + '-' + month1.toString() + "-01";
			this.halfYearEndDate = this.getCurrentMonthLast();
			this.yesterdayDate = this.getYesterday(-1, '-');
			this.halfYearEndDate = this.getCurrentMonthLast2017();
			this.yesterdayDate = this.getYesterday2017(-1, '-');
		},
		getYesterday:function(num, str){
		getYesterday2017:function(num, str){
			var today = new Date();
		    var nowTime = today.getTime();
		    var ms = 24*3600*1000*num;
@ -254,7 +301,7 @@ new Vue({
		    if (oDay.length <= 1) oDay = '0' + oDay;
		    return oYear + str + oMoth + str + oDay;
		},
		getCurrentMonthLast: function() {
		getCurrentMonthLast2017: function() {
			var date = new Date();
			var currentMonth = date.getMonth();
			var nextMonth = ++currentMonth;