You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

322 lines
12 KiB

  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <!--360浏览器优先以webkit内核解析-->
  7. <title>首页介绍</title>
  8. <link rel="shortcut icon" href="favicon.ico">
  9. <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
  10. <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
  11. <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
  12. <link href="../static/css/main.css" th:href="@{/css/main.css}" rel="stylesheet"/>
  13. </head>
  14. <body class="gray-bg">
  15. <div class="container">
  16. <div class="travel" style="height: 68%;">
  17. <div style="width: 30%;">
  18. <div class="wddbrw_head">
  19. <h1>职务层次情况</h1>
  20. </div>
  21. <div class="box" style="height: calc(50% - 50px);">
  22. <div id="pieChart1" style="width: 100%; height: 100%;"></div>
  23. </div>
  24. <div class="wddbrw_head">
  25. <h1>政治面貌情况</h1>
  26. </div>
  27. <div class="box" style="height: calc(50% - 50px);display: flex;margin: 0 10px;">
  28. <div id="pieChart2" style="width: 50%; height: 100%;"></div>
  29. <div id="plotChart3" style="width:50%; height: 100%;"></div>
  30. </div>
  31. </div>
  32. <div style="width: 40%;">
  33. <div style="width:100%;display: flex;">
  34. <div class="arrange div1">
  35. <div>知联会干部在库数</div>
  36. <span>5321</span>
  37. </div>
  38. <div class="arrange div2">
  39. <div><img style="width: 40px;height: 40px;" src="/img/main/presidentOne.png"/></div>
  40. <div style="margin-left: 20px;">
  41. <div>正会长</div>
  42. <span><span style="margin-right: 20px;color: #FF620D;">1</span>人</span>
  43. </div>
  44. </div>
  45. <div class="arrange div3">
  46. <div><img style="width: 40px;height: 40px;" src="/img/main/presidentTwo.png"/></div>
  47. <div style="margin-left: 20px;">
  48. <div>副会长</div>
  49. <span><span style="margin-right: 20px;color: #016BFF;">5</span>人</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div style="width: 30%;">
  55. <div class="wddbrw_head">
  56. <h1>学历、学位情况</h1>
  57. </div>
  58. <div class="box" style="height: calc(100% - 20px);">
  59. <div style="display: flex;justify-content: center;">
  60. <div class="cut active" style="">全日制教育</div>
  61. <div class="cut">在职教育</div>
  62. </div>
  63. <div id="barChart2" style="width: 100%; height: calc(50% - 10px);"></div>
  64. <div id="pieChart3" style="width: 100%; height: calc(50% - 10px);"></div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="travel" style="height: 30%;">
  69. <div style="width: 30%;">
  70. <div class="wddbrw_head">
  71. <h1>性别及年龄分布</h1>
  72. </div>
  73. <div class="box" style="height: calc(100% - 30px);">
  74. <div id="barChart1" style="width: 100%; height: 100%;"></div>
  75. </div>
  76. </div>
  77. <div style="width: 70%;">
  78. <div class="wddbrw_head">
  79. <h1>单位类别情况</h1>
  80. </div>
  81. <div class="box" style="height: calc(100% - 30px);">
  82. <div id="barChart3" style="width: 100%; height: 100%;"></div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <script th:src="@{/js/jquery.min.js?v=3.6.3}"></script>
  88. <script th:src="@{/js/bootstrap.min.js?v=3.3.7}"></script>
  89. <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
  90. <script th:src="@{/ruoyi/js/common.js?v=4.7.3}"></script>
  91. <script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.3}"></script>
  92. <th:block th:include="include :: echarts-js" />
  93. <script type="text/javascript">
  94. var array1 = [
  95. {name:'数据1',value:235},
  96. {name:'数据2',value:274},
  97. {name:'数据3',value:310},
  98. {name:'数据4',value:335}
  99. ];
  100. $(".cut").click(function () {
  101. $('.cut').removeClass('active');
  102. $(this).addClass('active');
  103. });
  104. var grid = {left: '10%', right: '6%', bottom: '3%', top:'6%'}
  105. //饼图1
  106. pieChartMethod('pieChart1',array1,"职务层次情况",'60%',"",grid,"",true);
  107. //饼图2
  108. pieChartMethod('pieChart2',array1,"饼图2",['50%', '80%'],"",grid,"",true);
  109. //阶梯图
  110. var data = [
  111. { value: 8, name: '副部级' },
  112. { value: 23, name: '正局级' },
  113. { value: 100, name: '副局级' },
  114. { value: 699, name: '正处级' },
  115. { value: 1640, name: '副处级' }
  116. ]
  117. funnelPlot('plotChart3',data);
  118. //柱状图
  119. var yAxis = {
  120. type: 'category',
  121. data: ['30岁以下', '31-40岁', '41-50岁', '51-60岁', '61岁以上'],
  122. axisLine: {
  123. show: false,
  124. },
  125. axisTick: {
  126. show: false,
  127. }
  128. }
  129. var series = [{
  130. name: '男',
  131. type: 'bar',
  132. data: [1200, 900, 600, 300, 200],
  133. emphasis: {
  134. focus: 'series'
  135. }
  136. }, {
  137. name: '女',
  138. type: 'bar',
  139. data: [1100, 950, 650, 350, 250],
  140. emphasis: {
  141. focus: 'series'
  142. }
  143. }
  144. ]
  145. //柱状图1
  146. var grid1 = {left: '15%', right: '6%', bottom: '12%', top:'12%'};
  147. barChartMethod("barChart1",{trigger: 'axis'},{data: ['男', '女'],left: '3%',},{type: 'value', name: '人数',
  148. axisLine: {show: false,}, axisTick: {show: false,},splitLine: {show: false}},yAxis,grid1,series);
  149. grid1.top = '3%';
  150. series = [{
  151. name: '数据',
  152. type: 'bar',
  153. data: [120, 200, 150, 80, 70, 110, 130,120],
  154. itemStyle: {
  155. normal: {
  156. color: function(params) {
  157. var colors = ['#34b3a0', '#ff6347'];
  158. return colors[params.dataIndex % 2];
  159. }
  160. }
  161. }
  162. }];
  163. yAxis = {
  164. type: 'category',
  165. data: ['研究生', '大学', '大专', '中专', '职高','中央党校研究生','中央党校大学','其他']
  166. }
  167. //柱状图2
  168. barChartMethod("barChart2",{trigger: 'axis'},"",{type: 'value', name: '人数'},yAxis,grid1,series);
  169. var itemStyle = {borderColor: '#fff',borderWidth: 2}
  170. //饼图3
  171. pieChartMethod('pieChart3',array1,"饼图3",'60%',"",grid,"",true,itemStyle);
  172. //柱状图3
  173. var data1 = [120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70];
  174. var maxHeight = Math.max(...data1);
  175. var xAxis = {
  176. type: 'category',
  177. data: ['A', 'B', 'C', 'D', 'E', 'F', 'G','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
  178. }
  179. yAxis = {
  180. type: 'value'
  181. }
  182. var series1 = [{
  183. name: '灰色背景',
  184. type: 'bar',
  185. data: data1.map(value => maxHeight), // 使用最大高度填充
  186. itemStyle: {
  187. color: '#ccc', // 灰色
  188. opacity: 0.5 // 可选:使灰色柱子稍微透明
  189. },
  190. barGap: '-100%', // 使灰色柱子与实际数据柱子重叠
  191. tooltip: {
  192. show: false //禁用灰色柱子的 tooltip
  193. },
  194. silent: true //禁用柱子的悬停和点击事件
  195. }, {
  196. name: '数据',
  197. type: 'bar',
  198. data: data1,
  199. itemStyle: {
  200. color: '#73C9C8' // 实际数据的颜色
  201. }
  202. }];
  203. var grid3 = {left: '5%', right: '6%', bottom: '12%', top:'6%'}
  204. barChartMethod("barChart3","","",xAxis,yAxis,grid3,series1);
  205. //饼图-id-数据-名称-弧度-位置-grid-legend-是否需要线
  206. function pieChartMethod(id,array,name,radius,center,grid,legend,isLabel,itemStyle){
  207. var pieChart = echarts.init(document.getElementById(id));
  208. var pieOption = {
  209. tooltip: {
  210. trigger: 'item'
  211. },
  212. legend: legend,
  213. series: [{
  214. name: name,
  215. type: 'pie',
  216. data: array,
  217. labelLine: {
  218. length: 4,
  219. length2: 4
  220. },
  221. emphasis: {
  222. itemStyle: {
  223. shadowBlur: 10,
  224. shadowOffsetX: 0,
  225. shadowColor: 'rgba(0, 0, 0, 0.5)'
  226. }
  227. }
  228. }]
  229. };
  230. if (grid) pieOption.grid = grid;
  231. if (radius) pieOption.series[0].radius = radius;
  232. if (center) pieOption.series[0].center = center;
  233. if (!isLabel) {
  234. pieOption.series[0].label = {show: false};
  235. pieOption.series[0].labelLine = {show: false};
  236. }
  237. if (itemStyle) pieOption.series[0].itemStyle = itemStyle;
  238. pieChart.setOption(pieOption);
  239. }
  240. //漏斗图
  241. function funnelPlot(id,data){
  242. var myChart = echarts.init(document.getElementById(id));
  243. var changeData = handleData(data);
  244. var option = {
  245. // tooltip: {
  246. // trigger: 'item',
  247. // formatter: function(params) {
  248. // return params.name + ': ' + data[params.dataIndex].value;
  249. // }
  250. // },
  251. series: [{
  252. type: 'funnel',
  253. left: '5%',
  254. top: 10,
  255. bottom: 10,
  256. width: '90%',
  257. min: 0,
  258. max: 10,
  259. minSize: '0%',
  260. maxSize: '100%',
  261. sort: 'ascending',
  262. gap: 2,
  263. label: {
  264. show: true,
  265. position: 'inside'
  266. },
  267. labelLine: {
  268. length: 10,
  269. lineStyle: {
  270. width: 1,
  271. type: 'solid'
  272. }
  273. },
  274. itemStyle: {
  275. borderColor: '#fff',
  276. borderWidth: 1
  277. },
  278. emphasis: {
  279. label: {
  280. fontSize: 20
  281. }
  282. },
  283. data: changeData
  284. }
  285. ]
  286. };
  287. myChart.setOption(option);
  288. }
  289. //柱状图-id--tooltip-legend-xAxis-yAxis-grid-series
  290. function barChartMethod(id,tooltip,legend,xAxis,yAxis,grid,series){
  291. var barChart = echarts.init(document.getElementById(id));
  292. var barOption = {
  293. tooltip: {
  294. },
  295. };
  296. if (tooltip) barOption.tooltip = tooltip;
  297. if (legend) barOption.legend = legend;
  298. if (xAxis) barOption.xAxis = xAxis;
  299. if (yAxis) barOption.yAxis = yAxis;
  300. if (grid) barOption.grid = grid;
  301. if (series) barOption.series = series;
  302. barChart.setOption(barOption);
  303. }
  304. // 处理数据集合
  305. function handleData(data){
  306. return data.map((item,index) => {
  307. return {
  308. name: item.name+" "+item.value+" 人",
  309. value: (index+1)*2
  310. };
  311. });
  312. }
  313. </script>
  314. </body>
  315. </html>