LandExpropriate-count-trend.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>征收补偿安置征地变化趋势</title>
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 引入mui样式 -->
  9. <link rel="stylesheet" type="text/css" href="../css/mui.css" />
  10. <!-- 引入弹窗及选择器样式 -->
  11. <link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/mui.poppicker.css" />
  13. <!-- 引入app样式 -->
  14. <link rel="stylesheet" type="text/css" href="../css/app.css" />
  15. <link rel="stylesheet" href="../css/app.new.css">
  16. <!-- 引入字体 -->
  17. <link rel="stylesheet" type="text/css" href="../fonts/TTTGB-Medium.css" />
  18. <link rel="stylesheet" type="text/css" href="../fonts/font-time.css" />
  19. </head>
  20. <body>
  21. <div class="jt-count-echarts-panel">
  22. <div class="jt-title">征收土地年度变化趋势</div>
  23. <div class="jt-content" id="divCountLineDL_YEAR"></div>
  24. <div class="jt-title">
  25. <button class="jt-select" id="selYear" value="2021">2021</button>
  26. 年度镇街征地变化统计
  27. </div>
  28. <div class="jt-content" id="divCountBarDL_SSXZ" style="height: 600px;"></div>
  29. <div class="jt-title">
  30. <button class="jt-select" id="selSankeyYear" value="2021">2021</button>
  31. 年度地类流量
  32. </div>
  33. <div class="jt-content" id="divCountSankey_DL" style="height: 600px;"></div>
  34. </div>
  35. </body>
  36. </html>
  37. <!-- 引入mui脚本 -->
  38. <script src="../js/mui.js" type="text/javascript" charset="utf-8"></script>
  39. <!-- 引入弹窗及选择器脚本 -->
  40. <script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
  41. <script src="../js/mui.poppicker.js" type="text/javascript" charset="utf-8"></script>
  42. <!-- 引入jQuery脚本 -->
  43. <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
  44. <!-- 引入通用脚本 -->
  45. <script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
  46. <!-- 进入webview脚本 -->
  47. <script src="../js/webview.js" type="text/javascript" charset="utf-8"></script>
  48. <!-- 引入存储脚本 -->
  49. <script src="../js/save.js" type="text/javascript" charset="utf-8"></script>
  50. <!-- 引入ajax脚本 -->
  51. <script src="../js/ajax.js" type="text/javascript" charset="utf-8"></script>
  52. <!-- 图表脚本 -->
  53. <script src="../js/ECharts/echarts.js" type="text/javascript" charset="utf-8"></script>
  54. <!-- 自定义图表脚本 -->
  55. <script src="../js/CRECharts.js" type="text/javascript" charset="utf-8"></script>
  56. <!-- 本页独有脚本 -->
  57. <script type="text/javascript">
  58. /* mui初始化 */
  59. mui.init();
  60. /* 页面尺寸 */
  61. var pageSize = getPageSize();
  62. /* 初始化完成 */
  63. plusInit(function() {
  64. /* 重置图表的尺寸 */
  65. echartsSizeInit();
  66. /* 绑定选择器 */
  67. bindListenerToSelectButton('selYear', 'view_app_zd_dkxx_collection', 'year', onSelectYEAR);
  68. bindListenerToSelectButton('selSankeyYear', 'view_app_zd_dkxx_collection', 'year', onSelectSankeyYEAR);
  69. /* 获取初始化值 */
  70. querySimpleFieldInfo('view_app_zd_dkxx_collection', 'year', function(res) {
  71. let text = res[res.length - 1].text;
  72. let value = res[res.length - 1].value;
  73. setSelectControlValue('selYear', text, value);
  74. setSelectControlValue('selSankeyYear', text, value);
  75. /* 统计 */
  76. countLandCategoryByYear(value);
  77. })
  78. });
  79. /**
  80. * 年度选择器选择事件
  81. * @param {string} text 文本
  82. * @param {string} value 值
  83. */
  84. function onSelectYEAR(text, value) {
  85. countTownLandCategoryByYear(text);
  86. }
  87. /**
  88. * 流量年度选择器选择事件
  89. * @param {string} text 文本
  90. * @param {string} value 值
  91. */
  92. function onSelectSankeyYEAR(text, value) {
  93. countLandCategoryFluxByYear(text);
  94. }
  95. /**
  96. * 征收土地面积年度变化趋势
  97. * @param {string} year 年度
  98. */
  99. function countLandCategoryByYear(year) {
  100. var iData = {
  101. type: 'year',
  102. year: '',
  103. }
  104. sendAjax({
  105. url: 'appCountZdTrendCategoryByYear',
  106. waitMessage: '分析中...',
  107. data: iData,
  108. success: function(resData) {
  109. showLandCategoryByYear(resData);
  110. countTownLandCategoryByYear(year);
  111. },
  112. error: function(err) {
  113. muiAlertError(err);
  114. }
  115. })
  116. }
  117. /**
  118. * 某一年度征收土地地类各乡镇变化趋势
  119. * @param {string} year 年份
  120. */
  121. function countTownLandCategoryByYear(year) {
  122. var iData = {
  123. type: 'town',
  124. year: year,
  125. }
  126. sendAjax({
  127. url: 'appCountZdTrendCategoryByYear',
  128. waitMessage: '分析中...',
  129. data: iData,
  130. success: function(resData) {
  131. showTownLandCategoryByYear(resData);
  132. countLandCategoryFluxByYear(year);
  133. },
  134. error: function(err) {
  135. muiAlertError(err);
  136. }
  137. })
  138. }
  139. /**
  140. * 某一年度征地地类面积流量统计
  141. * @param {string} year 年份
  142. */
  143. function countLandCategoryFluxByYear(year) {
  144. var iData = {
  145. type: 'flux',
  146. year: year,
  147. }
  148. sendAjax({
  149. url: 'appCountZdTrendCategoryByYear',
  150. waitMessage: '分析中...',
  151. data: iData,
  152. success: function(resData) {
  153. showLandCategoryFluxByYear(resData);
  154. },
  155. error: function(err) {
  156. muiAlertError(err);
  157. }
  158. })
  159. }
  160. /* 控件定义 */
  161. var CountLineDL_YEAR = undefined;
  162. var CountBarDL_SSXZ = undefined;
  163. var CountSankey_DL = undefined;
  164. /**
  165. * 释放图表资源
  166. * @param {Object} obj 图表控件
  167. */
  168. function eChartsDispose(obj) {
  169. if (obj != null && obj != "" && obj != undefined) obj.dispose();
  170. }
  171. /**
  172. * 展示征地地类面积年度变化趋势
  173. * @param {JSON} jsonData 数据集
  174. */
  175. function showLandCategoryByYear(jsonData) {
  176. var labels = [];
  177. var datas = [];
  178. var units = [];
  179. /* 组装数据 */
  180. for (var i in jsonData) {
  181. var dataItem = jsonData[i];
  182. labels.push(dataItem.groupName);
  183. for (var idx in dataItem.groupDataList) {
  184. var dataValue = dataItem.groupDataList[idx];
  185. var isExists = false;
  186. for (var dIdx in datas) {
  187. var data = datas[dIdx];
  188. if (data.name == dataValue.selCode) {
  189. data.values.push(dataValue.selName);
  190. isExists = true;
  191. break;
  192. }
  193. }
  194. /* 如果不存在则追加 */
  195. if (!isExists) {
  196. datas.push({
  197. name: dataValue.selCode,
  198. values: [dataValue.selName],
  199. });
  200. units.push('公顷');
  201. }
  202. }
  203. }
  204. var bbsData = {
  205. labels: labels,
  206. datas: datas,
  207. gridLeft: 50,
  208. gridBottom: 50,
  209. xrotate: 45,
  210. }
  211. /* 展示图表 */
  212. eChartsDispose(CountLineDL_YEAR)
  213. CountLineDL_YEAR = new CrCharts({
  214. domId: 'divCountLineDL_YEAR',
  215. labelColor: 'rgb(255,255,255)',
  216. legendTextColor: 'rgb(255,255,255)',
  217. xAxisLineColor: 'rgba(255,255,255,1.0)',
  218. yAxisLineColor: 'rgb(133, 215, 253)',
  219. splitLineColor: 'rgba(255,255,255,0.3)',
  220. xAxisLabel: {
  221. color: "rgba(255,255,255,1.0)",
  222. fontSize: 12,
  223. fontFamily: 'TTTGB-Medium',
  224. interval: 0,
  225. },
  226. yAxisLabel: {
  227. color: "rgb(133, 215, 253)",
  228. fontSize: 12,
  229. fontFamily: 'TTTGB-Medium',
  230. interval: 0,
  231. }
  232. });
  233. CountLineDL_YEAR.createLine(bbsData, units);
  234. }
  235. /**
  236. * 展示某一年度征收土地面积乡镇统计结果
  237. * @param {JSON} jsonData 数据集
  238. */
  239. function showTownLandCategoryByYear(jsonData) {
  240. var labels = [];
  241. var datas = [];
  242. var units = [];
  243. for (var i in jsonData) {
  244. var dataItem = jsonData[i];
  245. labels.push(dataItem.groupName);
  246. for (var idx in dataItem.groupDataList) {
  247. var dataValue = dataItem.groupDataList[idx];
  248. var isExists = false;
  249. for (var dIdx in datas) {
  250. var data = datas[dIdx];
  251. if (data.name == dataValue.selCode) {
  252. data.values.push(dataValue.selName);
  253. isExists = true;
  254. break;
  255. }
  256. }
  257. if (!isExists) {
  258. datas.push({
  259. name: dataValue.selCode,
  260. values: [dataValue.selName],
  261. lblPosition: 'right',
  262. })
  263. units.push('公顷');
  264. }
  265. }
  266. }
  267. eChartsDispose(CountBarDL_SSXZ);
  268. CountBarDL_SSXZ = new CrCharts({
  269. domId: 'divCountBarDL_SSXZ',
  270. labelColor: 'rgb(255,255,255)',
  271. legendTextColor: 'rgb(255,255,255)',
  272. xAxisLineColor: 'rgba(255,255,255,1.0)',
  273. yAxisLineColor: 'rgb(133, 215, 253)',
  274. splitLineColor: 'rgba(255,255,255,0.3)',
  275. xAxisLabel: {
  276. color: "rgba(255,255,255,1.0)",
  277. fontSize: 12,
  278. fontFamily: 'TTTGB-Medium',
  279. interval: 0,
  280. },
  281. yAxisLabel: {
  282. color: "rgb(133, 215, 253)",
  283. fontSize: 12,
  284. fontFamily: 'TTTGB-Medium',
  285. interval: 0,
  286. },
  287. });
  288. CountBarDL_SSXZ.createHorizontalBar({
  289. labels: labels,
  290. datas: datas,
  291. enabledAria: false,
  292. dataZoomY: true,
  293. zoomEndValue: 1,
  294. grid: {
  295. left: 60,
  296. top: 30,
  297. bottom: 40,
  298. right: 60
  299. }
  300. }, units);
  301. }
  302. /**
  303. * 展示某一年度征地地类面积流量统计
  304. * @param {JSON} jsonData 数据集
  305. */
  306. function showLandCategoryFluxByYear(jsonData) {
  307. var datas = [{
  308. name: '建设用地',
  309. value: 0,
  310. childs: []
  311. }];
  312. for (var i in jsonData) {
  313. var itemData = jsonData[i];
  314. var childs = [];
  315. var allValue = 0;
  316. for (var idx in itemData.groupDataList) {
  317. var itemChild = itemData.groupDataList[idx];
  318. datas[0].value += parseFloat(itemChild.selName);
  319. allValue += parseFloat(itemChild.selName);
  320. childs.push({
  321. name: itemChild.selCode,
  322. value: itemChild.selName,
  323. });
  324. }
  325. datas[0].childs.push({
  326. name: itemData.groupName,
  327. value: allValue,
  328. childs: childs,
  329. })
  330. }
  331. eChartsDispose(CountSankey_DL);
  332. CountSankey_DL = new CrCharts({
  333. domId: 'divCountSankey_DL',
  334. });
  335. CountSankey_DL.createSankey({
  336. data: datas,
  337. labelWidth: 120,
  338. nodeGap: 15
  339. }, '公顷');
  340. }
  341. </script>