Browse Source

Merge remote-tracking branch 'origin/master'

gt 2 years ago
parent
commit
e4c09ad8ff

+ 2 - 2
nngkxxdp/src/main/resources/static/natj/enter_showStatis.html

@@ -108,7 +108,7 @@
 
 			.centerCon .centerTree {
 				border: 1px solid #DAE4ED;
-				width: 20%;
+				width: 18%;
 				overflow: auto;
 			}
 
@@ -151,7 +151,7 @@
 			}
 
 			.centerTable table th:first-child {
-				min-width: 200px;
+				min-width: 206px;
 			}
 
 			.centerTable table tr:nth-of-type(2n) {

+ 91 - 7
nngkxxdp/src/main/resources/static/natj/js/enterStatisMain.js

@@ -33,7 +33,7 @@ layui.use(['element', 'form', 'tree', 'util', 'laydate'], function() {
 				}]
 			},
 			{
-				title: '规模以上工业总产值',
+				title: '规模以上工业增加值增速',
 				id: 2,
 				color1: '#9BCE4A',
 
@@ -154,7 +154,7 @@ layui.use(['element', 'form', 'tree', 'util', 'laydate'], function() {
 			if (obj.data.title == '地区生产总值') {
 				getAllIndustry(data1, myChart)
 			}
-			if (obj.data.title == '规模以上工业总产值') {
+			if (obj.data.title == '规模以上工业增加值增速') {
 				getAllScale(obj, myChart)
 
 			}
@@ -327,7 +327,7 @@ function getAllScale(obj, myChart) {
 		var array = [];
 		var xdata = [];
 		for (var i = 0; i < list.length; i++) {
-			var subData = list[i].totalNum;
+			var subData = list[i].growth;
 			if (subData.length == 4) {
 				xdata.push(list[i].date + '年1季度');
 				xdata.push(list[i].date + '年1-2季度');
@@ -348,20 +348,20 @@ function getAllScale(obj, myChart) {
 			'color2': obj.data.color2,
 			'xdata': xdata
 		}]
-		option = getLine(chat, '万元');
+		option = getLinel(chat, '%');
 
 		myChart.setOption(option, true);
 
 		var tabletit = list[0].name;
 		str = '<th>' + tabletit + '</th>';
 		listdataa += '<tr>'
-		listdataa += '<td></td>'
+		listdataa += '<td>增速</td>'
 		for (var j = 0; j < array.length; j++) {
-			listdataa += '<td>' + array[j] + '万元' + '</td>';
+			listdataa += '<td>' + array[j] + '%' + '</td>';
 		}
 		listdataa += '</tr>'
 		for (var j = 0; j < list.length; j++) {
-			for (var k = 0; k < list[j].totalNum.length; k++) {
+			for (var k = 0; k < list[j].growth.length; k++) {
 				let a = NoToChinese(Number(k) + 1)
 				str += '<th>' + list[j].date + '第一至' + a + '季度</th>'
 			}
@@ -1548,6 +1548,90 @@ function getLine(list, unit) {
 	return chart;
 }
 
+function getLinel(list, unit) {
+
+	var chart = {
+		tooltip: {
+			trigger: 'axis',
+		},
+		grid: {
+			left: '3%',
+			right: '4%',
+			bottom: '3%',
+			containLabel: true
+		},
+		toolbox: {
+			show: true,
+			x: 'right',
+			y: 'top',
+			feature: {
+				saveAsImage: {
+					pixelRatio: 1,
+					name: '导出的文件名',
+					title: '保存图片',
+					emphasis: {
+						iconStyle: {
+							textAlign: 'right', //文字在图标在右边
+							textPosition: 'left', //文字与图标在一行
+						},
+
+					}
+				}
+			}
+		},
+		xAxis: {
+			type: 'category',
+			boundaryGap: false,
+			data: list[0].xdata,
+			axisLabel:{
+				interval:0,
+				rotate:-40
+			}
+		},
+		yAxis: {
+			type: 'value',
+			axisLabel: {
+				formatter: '{value}' + unit
+			}
+		}
+	};
+	var series = [];
+	var tolstr = [];
+	for (var i = 0; i < list.length; i++) {
+		series.push({
+			name: list[i].name,
+			type: 'line',
+			// type: 'bar',
+			// stack: '增速',
+			// symbol: 'none',
+			data: list[i].data,
+			itemStyle: {
+				normal: {
+					color: list[i].color1
+				}
+
+			},
+
+		})
+		tolstr.push(list[i].color1);
+	}
+	chart.series = series;
+	chart.tooltip.formatter = function(v) {
+		var str = '';
+		var res = "<div>" + v[0].axisValue + "</div>";
+		var result = ''
+		v.forEach(function(item, index) {
+			result +=
+				`<span style="display:inline-block;margin-right:5px;margin-bottom:2px;border-radius:10px;width:9px;height:9px;background:` +
+				tolstr[index] + `;"></span>`
+			result += item.seriesName + ":" + item.data + unit + "<br>";
+		})
+		str = res + result
+		return str;
+	}
+	return chart;
+}
+
 function getAllLine(list) {
 	var dateList = [];
 	var listThri = [];

+ 4 - 4
nngkxxdp/src/main/resources/static/natj/json/scale.json

@@ -2,7 +2,7 @@
   "scale": [
     {
       "date": "2018",
-      "name": "规模以上工业",
+      "name": "规模以上工业增加值增速",
       "totalNum": [
         "1698531",
         "3516015",
@@ -24,7 +24,7 @@
     },
     {
       "date": "2019",
-      "name": "规模以上工业",
+      "name": "规模以上工业增加值增速",
       "totalNum": [
         "1753752.8",
         "3749046.7",
@@ -46,7 +46,7 @@
     },
     {
       "date": "2020",
-      "name": "规模以上工业",
+      "name": "规模以上工业增加值增速",
       "totalNum": [
         "1442223",
         "3765347.5",
@@ -68,7 +68,7 @@
     },
     {
       "date": "2021",
-      "name": "规模以上工业",
+      "name": "规模以上工业增加值增速",
       "totalNum": [
         "2313252.8",
         "4453822.2",