zhanghaoyu 6 роки тому
батько
коміт
c76f55fc41
3 змінених файлів з 31 додано та 8 видалено
  1. 16 0
      js/util.js
  2. 2 2
      page/bigData/html/alert3.html
  3. 13 6
      page/bigData/js/alert3.js

+ 16 - 0
js/util.js

@ -273,3 +273,19 @@ function getLastHalfMonthArray(dateStr){//格式:2018-07
    halfDate = data.getFullYear()+"-"+month+"-01"
    return halfDate;
}
Date.prototype.Format = function (fmt) { //author: meizz 
	var o = {
	  "M+": this.getMonth() + 1, //月份 
	  "d+": this.getDate(), //日 
	  "h+": this.getHours(), //小时 
	  "m+": this.getMinutes(), //分 
	  "s+": this.getSeconds(), //秒 
	  "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
	  "S": this.getMilliseconds() //毫秒 
	};
	if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	for (var k in o)
	  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) :
		(("00" + o[k]).substr(("" + o[k]).length)));
	return fmt;
  }

+ 2 - 2
page/bigData/html/alert3.html

@ -55,12 +55,12 @@
            </div>
            <div class="alert_people flex  f_y_c">
                <div>
                    <span>总人数</span>
                    <span>新增孕妇数</span>
                    <span>{{alertData1}}</span>
                    <span>人</span>
                </div>
                <div style="margin-left: 20px;">
                    <span>新增人数</span>
                    <span>已生产孕妇数</span>
                    <span>{{alertData2}}</span>
                    <span>人</span>
                </div>

+ 13 - 6
page/bigData/js/alert3.js

@ -33,11 +33,15 @@ new Vue({
		halfYearStartDate: "", //近半年开始时间
		halfYearEndDate: "", //近半年结束时间
        yesterdayDate:"",//昨天
        type:0
        type:0,
        time:''//42天前
	},
	mounted: function() {
        var vm = this;
        this.formatDate();
        var t = new Date(vm.firstMonth+'-'+'01');
        t = Date.parse(t)-3600*24*42*1000
        vm.time = new Date(t).Format('yyyy-MM-dd');
        this.initData(this.type);
        var myDate = new Date();
        var maxMonth = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月)
@ -63,6 +67,9 @@ new Vue({
                console.log(date); //得到日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                console.log(endDate); //得结束的日期时间对象,开启范围选择(range: true)才会返回。对象成员同上。
                console.log(vm.firstDay);
                var t = new Date(date.year+'-'+date.month+'-'+'01');
                t = Date.parse(t)-3600*24*42*1000
                vm.time = new Date(t).Format('yyyy-MM-dd');
                if(date.month < 10){
                    vm.firstDay = date.year+'-0'+date.month+'-01';
                }else{
@ -94,14 +101,15 @@ new Vue({
                event_type = 0;//门诊
            }
            var linkageFilter1 = "quotaDate >= '" + vm.firstDay + "' and quotaDate <= '" + vm.lastDay + "';";
            var linkageFilter2 = "quotaDate >= '" + vm.time + "' and quotaDate <= '" + vm.lastDay + "';";
            var linkageFilter3 = "quotaDate >= '" + vm.halfYearStartDate + "' and quotaDate <= '" + vm.halfYearEndDate + "';";
            console.log(linkageFilter1)
            var code = this.code;
            var urlNumber = '/gov/report/getNoChartTemplateData';
            var urlChart = '/gov/report/getTemplateDataByViewCode';
            var reqUrl = [
                {url:urlNumber,reqType: 'get',data: {viewCodeStr:code[0]}},//总人数
                {url:urlNumber,reqType: 'get',data: {viewCodeStr:code[1],linkageFilter:linkageFilter1}},//新增人数
                {url:urlNumber,reqType: 'get',data: {viewCodeStr:code[0],linkageFilter:linkageFilter1}},//新增人数
                {url:urlNumber,reqType: 'get',data: {viewCodeStr:code[1],linkageFilter:linkageFilter2}},//已生产人数
                {url:urlChart,reqType: 'get',data: {viewCode:code[2],linkageFilter:linkageFilter1+'eventType='+event_type}},//区县分布
                {url:urlChart,reqType: 'get',data: {viewCode:code[3],linkageFilter:linkageFilter1+'eventType='+event_type}},//性别分布
                {url:urlChart,reqType: 'get',data: {viewCode:code[4],linkageFilter:linkageFilter1+'eventType='+event_type}},//疾病前五
@ -111,8 +119,8 @@ new Vue({
            $(".div-mask-layer").show();
            httpRequest.getReqPromises(reqUrl).then(function(datas) {
                console.log(datas);
                vm.alertData1 = datas[1].obj.VIEW_16_0006[0].HC_13_0034; //新增
                vm.alertData2 = datas[0].obj.VIEW_16_0001[0].HC_13_0033; //已生产人数
                vm.alertData1 = datas[0].obj.VIEW_16_0001[0].HC_13_0033; //新增
                vm.alertData2 = datas[1].obj.VIEW_16_0006[0].HC_13_0034; //已生产人数
                var chart1 = datas[2].obj.viewInfos[0].options[0].option;
                var chart2 = datas[3].obj.viewInfos[0].options[0].option;
                var chart3 = datas[4].obj.viewInfos[0].options[0].option;
@ -193,7 +201,6 @@ new Vue({
            this.alertChart4 = options
        },
        setAlertChart5:function(data){
            console.log(options)
            var options = JSON.parse(data);
            options = qushiChart(options);
            // var options = this.bigData[t]['区县分布'];