Browse Source

对接大数据应用平台接口

lulihong 6 years ago
parent
commit
871a5b2e05

+ 5 - 25
component/chart/map-chart.js

@ -16,7 +16,7 @@
            this.$nextTick(function () {
                that.chart = echarts.init(document.getElementById(that.chartid));
                that.chart.setOption(that.setOption()); //试着一下
                // that.chart.setOption(that.getOption()); //试着一下
                this.chart.on('click', function (params) { //点击事件
                    that.$emit('clickMap', params) //传给外面点击事件
                    if (params.componentType === 'series') {
@ -42,7 +42,7 @@
        },
        methods: {
            setOption: function () {
            getOption: function () {
                var options=JSON.parse(JSON.stringify(defaults));
                if(this.config){
                    var maxValue =0;
@ -129,7 +129,7 @@
        watch: {
            config: function (data) {
                if (data) {
                    this.chart.setOption(this.setOption());
                    this.chart.setOption(this.getOption());
                    if(data.index !== null)this.selectLineHeight(data.index)
                }
            }
@ -142,7 +142,7 @@
        },      
        series: [{
            type: 'map',
            mapType: '贵港', // 自定义扩展图表类型
            mapType: '上饶', // 自定义扩展图表类型
            itemStyle: {
                normal: {
                    label: {
@ -163,27 +163,7 @@
                    areaColor: '#00e9fa',
                }
            },
            data: [{
                    name: '港北区',
                    value: 20057.34
                },
                {
                    name: '港南区',
                    value: 15477.48
                },
                {
                    name: '桂平市',
                    value: 31686.1
                },
                {
                    name: '平南县',
                    value: 6992.6
                },
                {
                    name: '覃塘区',
                    value: 44045.49
                }
            ],
            data: [],
            selectedMode: 'single'
        }],

+ 4 - 0
js/api/bigData-api.js

@ -3,6 +3,10 @@
		getJsonData: function(url,data) {
			return httpRequest.getJson(url, {data: data})
		},
		getNoChartTemplateData: "/gov/report/getNoChartTemplateData",
		getTemplateDataByViewCode:"/gov/report/getTemplateDataByViewCode",
		getCityArea: "/gov/report/getCityArea",
		getMapJingWeiDuInfo:"/gov/front/js/lib/plugins/echarts/map/json/china-main-city/361100.json",
	}
	
	exports.bigDataAPI = bigDataAPI;

+ 3 - 9
js/api/http-request.js

@ -1,20 +1,14 @@
(function(exports) {
	var publish_version = true;
	var publish_version = false;
	var server;
	var agentName = "useragent"
	var userInfo = "userInfoForPay"
	var isNeedLogin = false
	var openServer;
	if(publish_version) { // 生产环境配置
		server = "http://www.xmtyw.cn/iot"; // 仕杰
		//      openServer="http://192.168.131.102:8080/user"; // 伟达
		openServer = "http://192.168.131.150:8080"; // 晓阳
		server = "http://jksr.srswjw.gov.cn:1235";
	} else { // 测试环境配置
		//      server = "http://192.168.131.202:9099/iot"; // 桃红
//		      server = "http://192.168.131.24:9099/iot"; // 仕杰
		server = "http://172.19.103.88:9099/iot"; // 测试环境
		//		openServer="http://192.168.131.102:8080/user"; // 伟达
		openServer = "http://192.168.131.150:8080"; // 晓阳
		server = "http://192.168.131.104:9088"; // 测试环境
	}
	//保存userAgent

+ 11 - 1
page/bigData/css/medical.css

@ -339,4 +339,14 @@ td img {
.dropdown-menu {
	background: url(../images/mjzfwqktoubukuang.png) no-repeat 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;
}

+ 198 - 167
page/bigData/html/medical.html

@ -17,9 +17,31 @@
	<body>
		<div id="app" v-cloak>
            <div class="div-header flex f_y_c pl20">
                <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>
			<!-- 遮罩层 -->
			<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 flex f_y_c pl20">
				<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>
			<div class="div-skip" :class="{'div-skip-active':skipShow}">
				<div>
					<a href="home.html">
@ -33,49 +55,49 @@
				</div>
			</div>
			<div class="div-body flex">
                <div class="left">
				<div class="left">
					<!-- 大数据应用服务平台 -->
					<div class="contentBox h443   bigData">
						<div class="title flex f_y_c">
							<span :class="{active:timeType == 1}" @click="setTimeStr(1)">上月</span>
							<span :class="{active:timeType == 2}"  @click="setTimeStr(2)">本年</span>
							<span :class="{active:timeType == 2}" @click="setTimeStr(2)">本年</span>
						</div>
						<div class="menJiZhen contentBox2 flex f_x_sb mb20">
							<div class="left">
									<p class="mb10  tr">门诊人次</p>
									<p class="yellow_number pl15 mb25">{{leftData1['门诊人次']}} <span class="sub">人次</span></p>
									<p class="pl10 mb10">门诊总费用</p>
									<p class="yellow_number pl15">{{leftData1['门诊总费用']}} <span class="sub">元</span></p>
								<p class="mb10  tr">门诊人次</p>
								<p class="yellow_number pl15 mb25">{{leftData.HC_04_1050}} <span class="sub">人次</span></p>
								<p class="pl10 mb10">门急诊总费用</p>
								<p class="yellow_number pl15">{{leftData.HC_05_1001}} <span class="sub">元</span></p>
							</div>
							<div class="middle flex_coloumn f_xy_c">
									<p class="mb10">门急诊人次</p>
									<p class="red_number">{{leftData1['门急诊人次']}} </p>
									<p class="sub">人次</p>
								<p class="mb10">门急诊人次</p>
								<p class="red_number">{{leftData.HC_05_1004}} </p>
								<p class="sub">人次</p>
							</div>
							<div class="right">
									<p class="mb10 tl">急诊人次</p>
									<p class="yellow_number pr15 mb25">{{leftData1['急诊人次']}} <span class="sub">人次</span></p>
									<p class="pr10 mb10">门急诊总费用</p>
									<p class="yellow_number pr15">{{leftData1['急诊总费用']}} <span class="sub">元</span></p>
								<p class="mb10 tl">急诊人次</p>
								<p class="yellow_number pr15 mb25">{{leftData.HC_04_1048}} <span class="sub">人次</span></p>
								<p class="pr10 mb10">门急诊均次费用</p>
								<p class="yellow_number pr15">{{leftData.HC_05_1003}} <span class="sub">元</span></p>
							</div>
						</div>
						<div class="menJiZhen contentBox2 flex f_x_sb">
							<div class="left">
									<p class="mb10 	 tr">住院总费用</p>
									<p class="yellow_number  mb25">{{leftData1['住院总费用']}} <span class="sub">元</span></p>
									<p class="pl10 mb10">住院总床日数</p>
									<p class="yellow_number pl15">{{leftData1['住院床日数']}} <span class="sub">天</span></p>
								<p class="mb10 	 tr">住院总费用</p>
								<p class="yellow_number  mb25">{{leftData.HC_06_1014}} <span class="sub">元</span></p>
								<p class="pl10 mb10">住院总床日数</p>
								<p class="yellow_number pl15">{{leftData.HC_04_1013}} <span class="sub">天</span></p>
							</div>
							<div class="middle flex_coloumn f_xy_c">
									<p class="mb10">住院人次</p>
									<p class="red_number">{{leftData1['住院人次']}} </p>
									<p class="sub">人次</p>
								<p class="mb10">住院人次</p>
								<p class="red_number">{{leftData.HC_06_1013}} </p>
								<p class="sub">人次</p>
							</div>
							<div class="right">
									<p class="mb10 tl">住院次均费用</p>
									<p class="yellow_number pr15 mb25">{{leftData1['住院均次费用']}} <span class="sub">元</span></p>
									<p class="pr10 mb5">平均床日数</p>
									<p class="yellow_number pr15">{{leftData1['住院平均床日数']}} <span class="sub">天</span></p>
								<p class="mb10 tl">住院次均费用</p>
								<p class="yellow_number pr15 mb25">{{leftData.HC_06_1022}} <span class="sub">元</span></p>
								<p class="pr10 mb5">平均床日数</p>
								<p class="yellow_number pr15">{{leftData.HC_04_1066}} <span class="sub">天</span></p>
							</div>
						</div>
					</div>
@ -91,155 +113,165 @@
					</div>
				</div>
				<!-- 中间 -->
                <div class="middle flex_coloumn">
				<div class="middle flex_coloumn">
					<!-- 地图 -->
					<div class="map mt20">
							<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>
							<div class="dropdown Mapselect">
									<label class="diqu-label">地区</label>
									<div type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">{{city}}
										<span class="caret"></span>
									</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>
											</li>
									</ul>
						<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>
						<div class="dropdown Mapselect">
							<label class="diqu-label">地区</label>
							<div type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">{{city}}
								<span class="caret"></span>
							</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.name}}</a>
								</li>
							</ul>
						</div>
					</div>
					<!-- 地图底部 -->
					<div class="bottom  flex f_x_sb">
							<div class="left flex_coloumn f_x_sb">
								<div class="flex">
										<p class="w100">门急诊人次</p>
										<p class="yellow_number pl15 ">{{yesterdayData['门急诊人次']}} <span class="sub">人次</span></p>
								</div>
								<div class="flex ">
										<p class="w100">门急诊总费用</p>
										<p class="yellow_number pl15 ">{{yesterdayData['门急诊总费用']}} <span class="sub">元</span></p>
								</div>
									
								<div class="flex">
										<p class="w100">门急诊次均费用</p>
										<p class="yellow_number pl15 ">{{yesterdayData['门急诊次均费用']}} <span class="sub">元</span></p>
								</div>								
						<div class="left flex_coloumn f_x_sb">
							<div class="flex">
								<p class="w100">门急诊人次</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_04_1008}} <span class="sub">人次</span></p>
							</div>
							
							<div class="middle flex_coloumn f_xy_c">
									<p class="mb10 title">昨日数据</p>
									<p class="font44 red_number">{{yesterdayData['服务患者数']}} </p>
									<p class="sub">服务患者人数</p>
							<div class="flex ">
								<p class="w100">门急诊总费用</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_05_1001}} <span class="sub">元</span></p>
							</div>
							<div class="flex">
								<p class="w100">门急诊次均费用</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_05_1003}} <span class="sub">元</span></p>
							</div>
							<div class="right flex_coloumn f_x_sb">
									<div class="flex">
											<p class="w100">住院人次</p>
											<p class="yellow_number pl15 ">{{yesterdayData['住院人次']}} <span class="sub">人次</span></p>
									</div>
									<div class="flex">
											<p class="w100">住院总费用</p>
											<p class="yellow_number pl15 ">{{yesterdayData['门急诊次均费用']}} <span class="sub">元</span></p>
									</div>
										
									<div class="flex">
											<p class="w100">住院次均费用</p>
											<p class="yellow_number pl15 ">{{yesterdayData['住院均次费用']}} <span class="sub">元</span></p>
									</div>							
									<div class="flex">
											<p class="w100">住院平均日数</p>
											<p class="yellow_number pl15 ">{{yesterdayData['住院平均床日数']}} <span class="sub">天</span></p>
									</div>							
						</div>
						<div class="middle flex_coloumn f_xy_c">
							<p class="mb10 title">昨日数据</p>
							<p class="font44 red_number">{{yesterdayData.HC_14_1019}} </p>
							<p class="sub">服务患者人数</p>
						</div>
						<div class="right flex_coloumn f_x_sb">
							<div class="flex">
								<p class="w100">住院人次</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_06_1013}} <span class="sub">人次</span></p>
							</div>
							<div class="flex">
								<p class="w100">住院总费用</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_05_1003}} <span class="sub">元</span></p>
							</div>
							<div class="flex">
								<p class="w100">住院次均费用</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_06_1022}} <span class="sub">元</span></p>
							</div>
							<div class="flex">
								<p class="w100">住院平均日数</p>
								<p class="yellow_number pl15 ">{{yesterdayData.HC_04_1066}} <span class="sub">天</span></p>
							</div>
						</div>
					</div>
				</div>
				<div class="right">
					<!-- 门诊服务情况 -->
					<div class="right1">
						<div class="boxTitle mb10">门诊服务情况</div>
						<div class="contentBox mb20  h234">
							<table>
								<tr>
									<th class="w60">
										<div>月份</div>
									</th>
									<th class="w193">
										<div>门急诊总费用</div>
									</th>
									<th class="w188">
										<div>门急诊均次费用</div>
									</th>
								</tr>
								<tr v-for="(item,index) in tableData1">
									<td>
										<div>{{item.month}}</div>
									</td>
									<td>
										<div>
											<span class="mr10">{{item.HC_05_1001}}元</span>
											<span class="mr20">环比</span>
											<img v-if="item['门急诊总费用环比'] >1" src="../images/zengzhang.png">
											<img v-else src="../images/xiajiang.png">
											<span>{{item['门急诊总费用环比']}}%</span>
										</div>
									</td>
									<td>
										<div>
											<span class="mr10">{{item.HC_05_1003}}元</span>
											<span class="mr20">环比</span>
											<img v-if="item['门急诊次均费用环比'] >1" src="../images/zengzhang.png">
											<img v-else src="../images/xiajiang.png">
											<span>{{item['门急诊次均费用环比']}}%</span>
										</div>
									</td>
								</tr>
							</table>
                <div class="right">
						<!-- 门诊服务情况 -->
						<div class="right1">
								<div class="boxTitle mb10">门诊服务情况</div>
								<div class="contentBox mb20  h234">
									<table>
										<tr>
										  <th class="w60"><div>月份</div></th>
										  <th class="w193"><div>门急诊总费用</div></th>
										  <th class="w188"><div>门急诊均次费用</div></th>
										</tr>
										<tr v-for="(item,index) in tableData1">
										  <td><div>{{(index+1)+'月'}}</div></td>
										  <td>
											<div>
											  <span class="mr10">{{item['门急诊总费用']}}元</span>
											  <span class="mr20">环比</span>
											  <img  v-if="item['门急诊总费用环比'] >1" src="../images/zengzhang.png">
											  <img v-else src="../images/xiajiang.png">
											  <span>{{item['门急诊总费用环比']}}%</span>
											</div>
										   </td>
										   <td>
												<div>
											    <span class="mr10">{{item['门急诊次均费用']}}元</span>
											  <span class="mr20">环比</span>
											  <img  v-if="item['门急诊次均费用环比'] >1" src="../images/zengzhang.png">
											  <img v-else src="../images/xiajiang.png">
											  <span>{{item['门急诊次均费用环比']}}%</span>
											</div>
										   </td>
										</tr>
									  </table>
								</div>
								<div class="contentBox3 mb20 h165">
										<bar-chart :config="rightChart1"></bar-chart>
								</div>
							</div>
						<!-- 住院服务情况 -->
						<div class="right2">
								<div class="boxTitle mb10 mt24">住院服务情况</div>
								<div class="contentBox mb20 h234">
										<table>
												<tr>
												  <th class="w60"><div>月份</div></th>
												  <th class="w193"><div>住院总费用</div></th>
												  <th class="w188"><div>住院均次费用</div></th>
												</tr>
												<tr v-for="(item,index) in tableData2">
												  <td><div>{{(index+1)+'月'}}</div></td>
												  <td>
														<div>
																<span class="mr10">{{parseInt(item['住院总费用'])}}元</span>
																<span class="mr20">环比</span>
																<img  v-if="item['住院总费用环比'] >1" src="../images/zengzhang.png">
																<img v-else src="../images/xiajiang.png">
																<span>{{item['住院总费用环比']}}%</span>
														</div>													 
												   </td>
												   <td>
														<div>
														<span class="mr10">{{item['住院次均费用']}}元</span>
													  <span class="mr20">环比</span>
													  <img  v-if="item['住院次均费用环比'] >1" src="../images/zengzhang.png">
													  <img v-else src="../images/xiajiang.png">
													  <span>{{item['住院次均费用环比']}}%</span>
													</div>						
												   </td>
												</tr>
											  </table>
								</div>
								<div class="contentBox3  h165 mb10">
									<bar-chart :config="rightChart2"></bar-chart>
								</div>
							</div>
						</div>
						<div class="contentBox3 mb20 h165">
							<bar-chart :config="rightChart1"></bar-chart>
						</div>
					</div>
					<!-- 住院服务情况 -->
					<div class="right2">
						<div class="boxTitle mb10 mt24">住院服务情况</div>
						<div class="contentBox mb20 h234">
							<table>
								<tr>
									<th class="w60">
										<div>月份</div>
									</th>
									<th class="w193">
										<div>住院总费用</div>
									</th>
									<th class="w188">
										<div>住院均次费用</div>
									</th>
								</tr>
								<tr v-for="(item,index) in tableData2">
									<td>
										<div>{{item.month}}</div>
									</td>
									<td>
										<div>
											<span class="mr10">{{parseInt(item.HC_06_1014)}}元</span>
											<span class="mr20">环比</span>
											<img v-if="item['住院总费用环比'] >1" src="../images/zengzhang.png">
											<img v-else src="../images/xiajiang.png">
											<span>{{item['住院总费用环比']}}%</span>
										</div>
									</td>
									<td>
										<div>
											<span class="mr10">{{item.HC_06_1022}}元</span>
											<span class="mr20">环比</span>
											<img v-if="item['住院次均费用环比'] >1" src="../images/zengzhang.png">
											<img v-else src="../images/xiajiang.png">
											<span>{{item['住院次均费用环比']}}%</span>
										</div>
									</td>
								</tr>
							</table>
						</div>
						<div class="contentBox3  h165 mb10">
							<bar-chart :config="rightChart2"></bar-chart>
						</div>
					</div>
				</div>
            </div>			
			</div>
			<div class="div-bottom"></div>
		</div>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=1W9gqPiqc7C9TDliPP8S9Rj9"></script>
@ -253,19 +285,18 @@
		<script src="../../../js/bootstrap.min.js"></script>
		<script src="../../../js/es6-promise.js"></script>
		<script src="../../../js/underscore.js"></script>
		<script src="../../../js/util.js"></script>
		<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="../../../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="../../../dataJson/bigData.js"></script>
		<script src="../../../dataJson/bigData2.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="../../../dataJson/bigData5.js"></script>-->
		<script src="../js/medical.js"></script>
	</body>

BIN
page/bigData/images/allCity.png


+ 256 - 184
page/bigData/js/medical.js

@ -1,201 +1,273 @@
new Vue({
	el: '#app',
	data: {     
        city:'贵港市',
        town: [
            {
                "townName": "贵港市",
                "result": "0"
            },
            {
                "townName": "港北区",
                "result": "26531"
            },
            {
                "townName": "港南区",
                "result": "25634"
            },
            {
                "townName": "桂平市",
                "result": "113485"
            },
            {
                "townName": "平南县",
                "result": "74128"
            },
            {
                "townName": "覃塘区",
                "result": "12587"
            },
        ],
        timeType:'1',//时间过滤条件  1是上月  2是半年
        leftData1:{},  //左边数据块1
        leftData2:{}, //左边数据块2
        yesterdayData:{},
        leftChart1:null,   //左边的图表1
        leftChart2:null,    //左边的图表2
        rightChart1:null,    //右边边的图表1
        rightChart2:null,    //右边的图表2
        tableData1:null, //表格数据1
        tableData2:null, //表格数据2
        mapData:null,
        allData:null ,  //所有的数据  用来切换区县
        lineHeightIndex:null,
        skipShow:0,
	data: {
		city: '上饶市',
		town: [],
		cityVal:"0",
		timeType: '1', //时间过滤条件  1是上月  2是半年
		leftData: {}, //左边数据块
		leftData1: {}, //左边数据块1
		leftData2: {}, //左边数据块2
		yesterdayData: {},
		leftChart1: null, //左边的图表1
		leftChart2: null, //左边的图表2
		rightChart1: null, //右边边的图表1
		rightChart2: null, //右边的图表2
		tableData1: null, //表格数据1
		tableData2: null, //表格数据2
		mapData: null,
		allData: null, //所有的数据  用来切换区县
		lineHeightIndex: null,
		skipShow: 0,
		firstDay: "", //上月第一天
		lastDay: "", //上月最后一天
		firstDayYear: "", //本年第一天
		lastDayYear: "", //本年最后一天
		halfYearStartDate: "", //近半年开始时间
		halfYearEndDate: "" //近半年结束时间
	},
	mounted: function() {
        this.allData = this.newObj(bigData);
       this.initData()
    },
    methods: {
        initData:function(){
            
            this.setLeftChart1();
            this.setLeftChart2();
            this.setRightChart1();
            this.setRightChart2();
            this.setTable1();
            this.setTable2();
            this.setleftData1();
            this.setYesterDay();
            this.setMapData();
        },
        setleftData1:function(){
            var options = null;
            if(this.timeType == 1){
               options= this.newObj(this.allData['上月']);         
                
            }
            else{
                options= this.newObj(this.allData['本年'])
            }
            this.setFormater(options);
            this.leftData1 =  options;
        },
        setYesterDay:function(){
            var options = null;
            options= this.newObj(this.allData['昨日数据'])
		this.initData();
	},
	methods: {
		initData: function() {
			$(".div-mask-layer").show();
			var vm = this,
				data1, data2, data3, data4, data5, data6, data7, data8;
			this.formatDate(); //格式化时间
			this.town.map(function(v, i) {
				if(v.name == vm.city) {
					vm.cityVal = v.id;
				}
			})
			var linkageFilter1 = "quotaDate >= '" + vm.firstDay + "' and quotaDate <= '" + vm.lastDay + "';";
			if(vm.cityVal) {
				linkageFilter1 += "town=" + vm.cityVal + ";";
			}
			var linkageFilter2 = "quotaDate >= '" + vm.firstDayYear + "' and quotaDate <= '" + vm.lastDayYear + "';";
			if(vm.cityVal) {
				linkageFilter2 += "town=" + vm.cityVal + ";";
			}
			var linkageFilter3 = "quotaDate >= '" + vm.halfYearStartDate + "' and quotaDate <= '" + vm.halfYearEndDate + "';";
			if(vm.cityVal) {
				linkageFilter3 += "town=" + vm.cityVal + ";";
			}
			var reqUrl = [{url: bigDataAPI.getCityArea,reqType: 'get',data: {}},
						  {url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0011",linkageFilter:linkageFilter1}},//左上角-上月 
						  {url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0011",linkageFilter:linkageFilter2}},//左上角-本年
						  {url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0012"}},
						  {url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0013",linkageFilter:linkageFilter3}},//
						  {url: bigDataAPI.getNoChartTemplateData,reqType: 'get',data: {viewCodeStr: "VIEW_14_0014",linkageFilter:linkageFilter3}},//
						  {url: bigDataAPI.getTemplateDataByViewCode,reqType: 'get',data: {viewCode: "VIEW_14_0015",linkageFilter:linkageFilter3}},//门诊人次月趋势
						  {url: bigDataAPI.getTemplateDataByViewCode,reqType: 'get',data: {viewCode: "VIEW_14_0016",linkageFilter:linkageFilter3}},//住院人次月趋势
						  {url: bigDataAPI.getTemplateDataByViewCode,reqType: 'get',data: {viewCode: "VIEW_14_0017",linkageFilter:linkageFilter3}},//门诊分类别月趋势
						  {url: bigDataAPI.getTemplateDataByViewCode,reqType: 'get',data: {viewCode: "VIEW_14_0018",linkageFilter:linkageFilter3}},//住院平均日数月趋势
						  {url:bigDataAPI.getMapJingWeiDuInfo,reqType: 'get',data:{}}//上饶地图经纬度数据
						  ];
			httpRequest.getReqPromises(reqUrl).then(function(datas) {
				debugger
				vm.town = [{
					"name": "上饶市",
					"id": "0"
				}].concat(datas[0]);
				vm.leftData1 = datas[1];
				vm.leftData2 = data2 = datas[2];
				data3 = datas[3];
				data4 = datas[4];
				data5 = datas[5];
				data6 = datas[6];
				data7 = datas[7];
				data8 = datas[8];
				data9 = datas[9];
				data10 = datas[10];
            this.setFormater(options);
            this.yesterdayData =  options;
        
        },
        setLeftChart1:function(){
           var options =this.allData['门诊人次月趋势'];
           options.grid= {
                top: '70',
                left: '75',
                bottom:'40'
            };
            options.yAxis[1].show =true;
            options.tooltip.formatter=  '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%";
            options.yAxis[0].axisLabel.fontSize='14'
            options.yAxis[1].axisLabel.fontSize='14'
            options.xAxis[0].axisLabel.fontSize='14'
           this.leftChart1 = options
        },
        setLeftChart2:function(){
           var options =this.allData['住院人次月趋势'];
           options.grid={
			top: '70',
            left: '70',
            bottom:'40'
		};
        options.yAxis[1].show =true;
        options.tooltip.formatter=  '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%";
        options.yAxis[0].axisLabel.fontSize='14'
        options.yAxis[1].axisLabel.fontSize='14'
        options.xAxis[0].axisLabel.fontSize='14'
           this.leftChart2 = options
        },
        setMapData:function(){
            var options =this.allData['各区县服务患者数'];
            this.mapData ={data:options,index:this.lineHeightIndex}  ;       
        },
        setRightChart1:function(){
           var options =this.allData['门诊分类别月趋势'];
           options.grid={
			top: '80',
			left: '80',
			bottom: '30'
        }
        options.yAxis[1].show =true;
        options.yAxis[0].axisLabel.fontSize='14'
        options.yAxis[1].axisLabel.fontSize='14'
        options.xAxis[0].axisLabel.fontSize='14'
           this.rightChart1= options
        },
        setRightChart2:function(){
           var options =this.allData['住院平均日数月趋势'];
           options.yAxis[1].show = true;
           options.tooltip.formatter=  '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%";
           options.yAxis[0].axisLabel.fontSize='14'
           options.yAxis[1].axisLabel.fontSize='14'
           options.xAxis[0].axisLabel.fontSize='14'
           this.rightChart2= options
        },
        setTable1:function(){
            var options =this.allData['门急诊服务情况'];
				vm.setLeftChart1(data6);
				vm.setLeftChart2(data7);
				vm.setRightChart1(data8);
				vm.setRightChart2(data9);
				vm.setTable1(data4);
				vm.setTable2(data5);
				vm.setleftData1();
				echarts.registerMap('上饶',data10);
				vm.setMapData(data3);
				vm.setYesterDay(data3);
				$(".div-mask-layer").hide();
			})
		},
		setleftData1: function() {
			var options = null,vm=this;
			if(this.timeType == 1) {
				if(this.leftData1.successFlg) {
					 _.map(vm.leftData1.obj.VIEW_14_0011,function(item,index){
						if(vm.cityVal=="0"){//上饶市
							options =  vm.leftData1.obj.VIEW_14_0011[0];
						}else if(item.firstColumn==vm.city){
							options = item;
						}
					})
				}
			} else {
				if(this.leftData2.successFlg) {
					 _.map(vm.leftData2.obj.VIEW_14_0011,function(item,index){
						if(vm.cityVal=="0"){//上饶市
							options =  vm.leftData2.obj.VIEW_14_0011[0];
						}else if(item.firstColumn==vm.city){
							options = item;
						}
					})
				}
			}
			this.setFormater(options);
			this.leftData = options;
		},
		setYesterDay: function(data3) {
			var options = null;
			if(data3.successFlg) {
				options = data3.obj.VIEW_14_0012[0];
			}
			this.setFormater(options);
			this.yesterdayData = options;
            this.tableData1= options
        },
        setTable2:function(){
            var options =this.allData['住院服务情况'];
		},
		setLeftChart1: function(data6) {
			var options = null;
			if(data6.successFlg) {
				options = JSON.parse(data6.obj.viewInfos[0].options[0].option);
			}
			options = leftChart1DataFormat(options);
			this.leftChart1 = options
		},
		setLeftChart2: function(data7) {
			var options = null;
			if(data7.successFlg) {
				options = JSON.parse(data7.obj.viewInfos[0].options[0].option);
			}
			options = leftChart2DataFormat(options);
			this.leftChart2 = options;
		},
		setMapData: function(data3) {
			var optionData = [];
			_.map(data3.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
			};
		},
		setRightChart1: function(data8) {
			var options = null;
			if(data8.successFlg) {
				options = JSON.parse(data8.obj.viewInfos[0].options[0].option);
			}
			options = rightChart1DataFormat(options);
			this.rightChart1 = options
		},
		setRightChart2: function(data9) {
			var options = null;
			if(data9.successFlg) {
				options = JSON.parse(data9.obj.viewInfos[0].options[0].option);
			}
			options = rightChart2DataFormat(options);
			this.rightChart2 = options
		},
		setTable1: function(data4) {
			var resData = [];
			_.map(data4.obj.VIEW_14_0013, function(item, index) {
				if(item.firstColumn != "合计") {
					item.month = parseInt(item.month.substring(5, 7));
					resData.push(item)
				}
			})
			this.tableData1 = resData
		},
		setTable2: function(data5) {
			var resData = [];
			_.map(data5.obj.VIEW_14_0014, function(item, index) {
				if(item.firstColumn != "合计") {
					item.month = parseInt(item.month.substring(5, 7));
					resData.push(item)
				}
			})
			this.tableData2 = resData
		},
		setCity(item) {
			this.city = item.name;
            this.tableData2= options
        },
        setCity(item){
            this.city = item.townName;
   
           
        },
        setTimeStr(v){
            this.timeType = v;
            this.setleftData1()
        },
        setFormater:function(obj){
            for(var c in obj){
                obj[c] =toThousands(obj[c])
            }
        },
        newObj:function(obj){
            return JSON.parse(JSON.stringify(obj))
        },
        clickMap:function(res){
            this.city = res.name;
        },
        skipClick:function(){
		},
		setTimeStr(v) {
			this.timeType = v;
			this.setleftData1()
		},
		setFormater: function(obj) {
			for(var c in obj) {
				obj[c] = toThousands(obj[c])
			}
		},
		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() - 1;
			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();
		},
		getCurrentMonthLast: function() {
			var date = new Date();
			var currentMonth = date.getMonth();
			var nextMonth = ++currentMonth;
			var nextMonthFirstDay = new Date(date.getFullYear() - 1, nextMonth-1, 1);
			var oneDay = 1000 * 60 * 60 * 24;
			return(new Date(nextMonthFirstDay - oneDay)).format("yyyy-MM-dd");
		},
		newObj: function(obj) {
			return JSON.parse(JSON.stringify(obj))
		},
		clickMap: function(res) {
			this.city = res.name;
		},
		skipClick: function() {
			console.log(222)
			this.skipShow == 0 ? this.skipShow = 1 : this.skipShow = 0
		}
    },
    watch: {
        city:function(value){
            var that =this;
            that.lineHeightIndex =value;
            this.town.map(function(v,i){
                if(v.townName == value) {                
                    switch(i){
                        case 0:that.allData = that.newObj(bigData);break;
                        case 1:that.allData = that.newObj(bigData2);break;
                        case 2:that.allData = that.newObj(bigData3);break;
                        case 3:that.allData = that.newObj(bigData4);break;
                        case 4:that.allData = that.newObj(bigData5);break;
                        case 5:that.allData = that.newObj(bigData5);break;
                    }
                }
            })
            this.initData()  
	},
	watch: {
		city: function(value) {
			var that = this;
			that.lineHeightIndex = value;
			this.initData();
        }
    }
		}
	}
});
//数字格式化
function toThousands(str) {
    if(!str)return
    str  =parseInt(str);
    if(typeof(str) == 'number')str = str.toString()
	if(!str) return
	str = parseInt(str);
	if(typeof(str) == 'number') str = str.toString()
	var newStr = "";
	var count = 0;

+ 553 - 0
page/bigData/js/medicalCharts.js

@ -0,0 +1,553 @@
var leftChart1DataFormat = function(options) {
	var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
		item = parseInt(item.substring(5, 7)) + "月";
		return item;
	});
	var series0data = options.series[0].data  || [];
	var series1data = options.series[1].data || [];
	var option = {
		"title": {
			"text": "门诊人次月趋势",
			"x": "center",
			textStyle: {
				color: '#b5e1fc',
				fontSize: 16,
				fontWeight: 'bold'
			}
		},
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#fff'
				}
			},
			formatter: '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%"
		},
		"grid": {
			top: '70',
			left: '75',
			bottom: '40'
		},
		legend: {
			data: ['门诊人次', '环比'],
			textStyle: {
				color: '#b5e1fc'
			},
			top: '40'
		},
		xAxis: [{
			type: 'category',
			data: xAxisData,
			axisPointer: {
				type: 'shadow'
			},
			axisTick: {
				show: false
			},
			axisLine: {
				lineStyle: {
					color: '#095f8e'
				}
			},
			axisLabel: {
				color: '#b5e1fc',
				fontSize: 14
			}
		}],
		yAxis: [{
				type: 'value',
				name: '门诊人次',
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e'
					}
				},
				axisLabel: {
					color: '#b5e1fc',
					fontSize: 14
				}
			},
			{
				type: 'value',
				name: '环比',
				min: 0,
				max: 4,
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false // 不显示坐标轴刻度
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e' // 坐标轴轴线颜色
					}
				},
				axisLabel: {
					color: '#b5e1fc', // 坐标轴刻度标签文本颜色
					fontSize: 14
				},
				show: true
			}
		],
		series: [{
				name: '门诊人次',
				type: 'bar',
				"data": series0data,
				barWidth: 20,
				label: {
					normal: {
						show: true,
						position: 'top', // 在柱状图上方显示
						color: '#fff' // 柱状图上方显示的数值颜色
					}
				},
				itemStyle: {
					barBorderRadius: [8, 8, 0, 0],
					color: '#00e6f3'
				}
			},
			{
				name: '环比',
				type: 'line',
				yAxisIndex: 1,
				"data": series1data,
				itemStyle: {
					color: '#03fa6d'
				}
			}
		]
	}
	return option;
},
leftChart2DataFormat = function(options){
	var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
		item = parseInt(item.substring(5, 7)) + "月";
		return item;
	});
	var series0data = options.series[0].data  || [];;
	var series1data = options.series[1].data  || [];;
	var option = {
		"title": {
			"text": "住院人次月趋势",
			"x": "center",
			textStyle: {
				color: '#b5e1fc',
				fontSize: 16,
				fontWeight: 'bold'
			}
		},
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#fff'
				}
			}
		},
		"grid": {
			top: '70',
			left: '70',
			bottom: '40'
		},
		legend: {
			data: ['住院人次', '环比'],
			textStyle: {
				color: '#b5e1fc'
			},
			top: '40'
		},
		xAxis: [{
			type: 'category',
			data: xAxisData,
			axisPointer: {
				type: 'shadow'
			},
			axisTick: {
				show: false
			},
			axisLine: {
				lineStyle: {
					color: '#095f8e'
				}
			},
			axisLabel: {
				color: '#b5e1fc',
				fontSize: 14
			}
		}],
		yAxis: [{
				type: 'value',
				name: '住院人次',
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e'
					}
				},
				axisLabel: {
					color: '#b5e1fc',
					fontSize: 14
				}
			},
			{
				type: 'value',
				name: '环比',
				min: 0,
				max: 4,
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false // 不显示坐标轴刻度
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e' // 坐标轴轴线颜色
					}
				},
				axisLabel: {
					color: '#b5e1fc', // 坐标轴刻度标签文本颜色
					fontSize: 14
				},
				show:true
			}
		],
		series: [{
				name: '住院人次',
				type: 'bar',
				"data": series0data,
				barWidth: 20,
				label: {
					normal: {
						show: true,
						position: 'top', // 在柱状图上方显示
						color: '#fff' // 柱状图上方显示的数值颜色
					}
				},
				itemStyle: {
					barBorderRadius: [8, 8, 0, 0],
					color: '#ff616f'
				}
			},
			{
				name: '环比',
				type: 'line',
				yAxisIndex: 1,
				"data": series1data,
				itemStyle: {
					color: '#03fa6d'
				}
			}
		]
	}
	return option;
},
rightChart1DataFormat = function(options){
	debugger
	var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
		item = parseInt(item.substring(5, 7)) + "月";
		return item;
	});
	var series0data = options.series[0].data || [];
	var series1data = options.series[1].data || [];
	var series2data = options.series[2].data || [];
	var series3data = options.series[3].data || [];
	var option = {
		"title": {
			"text": "门诊分类别月趋势",
			"x": "center",
			textStyle: {
				color: '#b5e1fc',
				fontSize: 16,
				fontWeight: 'bold'
			}
		},
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#fff'
				}
			},
			formatter: '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%"
		},
		"grid":{
			top: '80',
			left: '80',
			bottom: '30'
		},
		legend: {
			data: ['普通号', '专家号', '普通号环比', '专家号环比'],
			textStyle: {
				color: '#b5e1fc'
			},
			top: '30',
			itemWidth: 10
		},
		xAxis: [{
			type: 'category',
			data: xAxisData,
			axisPointer: {
				type: 'shadow'
			},
			axisTick: {
				show: false
			},
			axisLine: {
				lineStyle: {
					color: '#095f8e'
				}
			},
			axisLabel: {
				color: '#b5e1fc',
				fontSize: 14
			}
		}],
		yAxis: [{
				type: 'value',
				name: '人次',
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e'
					}
				},
				axisLabel: {
					color: '#b5e1fc',
					fontSize: 14
				},
				splitNumber: 2
			},
			{
				type: 'value',
				name: '环比',
				min: 0,
				max: 4,
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false // 不显示坐标轴刻度
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e' // 坐标轴轴线颜色
					}
				},
				axisLabel: {
					color: '#b5e1fc', // 坐标轴刻度标签文本颜色
					fontSize: 14
				},
				show:true
			}
		],
		series: [{
				name: '普通号',
				type: 'bar',
				"data": series0data,
				barWidth: 20,
				label: {
					normal: {
						show: true,
						position: 'top', // 在柱状图上方显示
						color: '#fff', // 柱状图上方显示的数值颜色
						fontSize: 11
					}
				},
				itemStyle: {
					barBorderRadius: [8, 8, 0, 0],
					color: '#00e6f3'
				}
			},
			{
				name: '专家号',
				type: 'bar',
				"data": series1data,
				barWidth: 20,
				label: {
					normal: {
						show: true,
						position: 'top', // 在柱状图上方显示
						color: '#fff', // 柱状图上方显示的数值颜色
						fontSize: 11
					}
				},
				itemStyle: {
					barBorderRadius: [8, 8, 0, 0],
					color: '#fff71a'
				}
			},
			{
				name: '普通号环比',
				type: 'line',
				yAxisIndex: 1,
				"data": series2data,
				itemStyle: {
					color: '#03fa6d'
				}
			},
			{
				name: '专家号环比',
				type: 'line',
				yAxisIndex: 1,
				"data": series3data,
				itemStyle: {
					color: '#ff616f'
				}
			},
		]
	}
	return option;
},
rightChart2DataFormat = function(options){
	var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
		item = parseInt(item.substring(5, 7)) + "月";
		return item;
	});
	var series0data = options.series[0].data  || [];;
	var series1data = options.series[1].data  || [];;
	var option = {
		"title": {
			"text": "住院平均日数月趋势",
			"x": "center",
			textStyle: {
				color: '#b5e1fc',
				fontSize: 16,
				fontWeight: 'bold'
			}
		},
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#fff'
				}
			},
			formatter:'{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%"
		},
		"grid": {
			top: '70',
			left: '60',
			bottom: '30'
		},
		legend: {
			data: ['住院平均床日数', '环比'],
			textStyle: {
				color: '#b5e1fc'
			},
			top: '30'
		},
		xAxis: [{
			type: 'category',
			data: xAxisData,
			axisPointer: {
				type: 'shadow'
			},
			axisTick: {
				show: false
			},
			axisLine: {
				lineStyle: {
					color: '#095f8e'
				}
			},
			axisLabel: {
				color: '#b5e1fc',
				fontSize: 14
			}
		}],
		yAxis: [{
				type: 'value',
				name: '天',
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e'
					}
				},
				axisLabel: {
					color: '#b5e1fc',
					fontSize: 14
				},
				splitNumber: 2
			},
			{
				type: 'value',
				name: '环比',
				min: 0,
				max: 4,
				nameTextStyle: {
					color: '#b5e1fc' // 坐标轴名称颜色
				},
				splitLine: {
					show: false // 不显示坐标轴刻度
				},
				axisLine: {
					lineStyle: {
						color: '#095f8e' // 坐标轴轴线颜色
					}
				},
				axisLabel: {
					color: '#b5e1fc', // 坐标轴刻度标签文本颜色
					fontSize: 14
				},
				show:true
			}
		],
		series: [{
				name: '住院平均床日数',
				type: 'bar',
				"data": series0data,
				barWidth: 20,
				label: {
					normal: {
						show: true,
						position: 'top', // 在柱状图上方显示
						color: '#fff' // 柱状图上方显示的数值颜色
					}
				},
				itemStyle: {
					barBorderRadius: [8, 8, 0, 0],
					color: '#00e6f3'
				}
			},
			{
				name: '环比',
				type: 'line',
				yAxisIndex: 1,
				"data": series1data,
				itemStyle: {
					color: '#03fa6d'
				}
			}
		]
	}
	return option;
}