index.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /**
  2. *
  3. */
  4. // 案件处理情况分析
  5. function indexChar(){
  6. var myChart = echarts.init($(".boxCentterRight")[0]);
  7. option = {
  8. title : {
  9. text: '人口构成占比',
  10. x:'center',
  11. y:"bottom",
  12. textStyle: {
  13. fontSize: 14,
  14. color: '#00f0ff' // 主标题文字颜色
  15. },
  16. },
  17. tooltip : {
  18. trigger: 'item',
  19. formatter: "{a} <br/>{b} : {c} ({d}%)"
  20. },
  21. calculable : false,
  22. series : [
  23. {
  24. name:'人口占比',
  25. type:'pie',
  26. radius : '65%',
  27. center: ['50%', '38%'],
  28. itemStyle: {
  29. normal: {
  30. label: {
  31. show: false
  32. },
  33. labelLine: {
  34. show: false
  35. }
  36. }},
  37. data:[
  38. {value:335, name:'幼儿'},
  39. {value:310, name:'儿童'},
  40. {value:234, name:'青年'},
  41. {value:135, name:'中年'},
  42. {value:1548, name:'老年'}
  43. ]
  44. }
  45. ]
  46. };
  47. myChart.setOption(option);
  48. };
  49. // 车辆,人员,地名地址切换
  50. function nav(){
  51. $(".con02TopUL li").each(function(index){
  52. $(this).click(function(){
  53. $(".con02TopUL li").removeClass("con02liAcitve");
  54. $(this).addClass("con02liAcitve");
  55. $(".boxRithtChangeBox .boxChangeCon").eq(index).show().siblings(".boxChangeCon").stop().hide();
  56. })
  57. })
  58. }
  59. // 警员信息滚动
  60. function scoll() {
  61. $('.boxLeftAlamCon').liMarquee({
  62. direction: 'down',
  63. scrollamount: 20
  64. });
  65. }
  66. //显示时间
  67. function dispalyDate() {
  68. var show_week=new Array('星期一','星期二','星期三','星期四','星期五','星期六','星期日');
  69. var nowDate=new Date();
  70. var week=nowDate.getDay();
  71. var years=nowDate.getFullYear();
  72. var month=nowDate.getMonth()+1;
  73. var date=nowDate.getDate();
  74. var hour=nowDate.getHours();
  75. var min=nowDate.getMinutes();
  76. var now=years+'年'+time(month)+'月'+time(date)+"日"+time(hour)+":"+time(min)+" "+show_week[week-1];
  77. $("#nowTime").text(now);
  78. }
  79. function time(s) {
  80. return s<10?'0'+s:s;
  81. }
  82. function page() {
  83. $("#pageAll li:gt(2)").hide();//初始化,前面4条数据显示,其他的数据隐藏。
  84. var total_q = $("#pageAll li").index() + 1;//总数据
  85. var current_page = 3;//每页显示的数据
  86. var current_num = 1;//当前页数
  87. var total_page;
  88. if(total_q%current_page==0){
  89. total_page=total_q/current_page;
  90. }
  91. else{
  92. total_page=Math.ceil(total_q/current_page);
  93. }
  94. var next = $(".next");//下一页
  95. var prev = $(".prev");//上一页
  96. $(".total").text(total_page);//显示总页数
  97. $(".current_page").text(current_num);//当前的页数
  98. //下一页
  99. $(".next").click(function () {
  100. if (current_num == total_page) {
  101. return false;//如果大于总页数就禁用下一页
  102. }
  103. else {
  104. $(".current_page").text(++current_num);//点击下一页的时候当前页数的值就加1
  105. $.each($('#pageAll li'), function (index, item) {
  106. var start = current_page * (current_num - 1);//起始范围
  107. var end = current_page * current_num;//结束范围
  108. if (index >= start && index < end) {//如果索引值是在start和end之间的元素就显示,否则就隐
  109. $(this).show();
  110. } else {
  111. $(this).hide();
  112. }
  113. });
  114. }
  115. });
  116. //上一页方法
  117. $(".prev").click(function () {
  118. if (current_num == 1) {
  119. return false;
  120. } else {
  121. $(".current_page").text(--current_num);
  122. $.each($('#pageAll li'), function (index, item) {
  123. var start = current_page * (current_num - 1);//起始范围
  124. var end = current_page * current_num;//结束范围
  125. if (index >= start && index < end) {//如果索引值是start和end之间的元素就显示,否则就隐藏
  126. $(this).show();
  127. } else {
  128. $(this).hide();
  129. }
  130. });
  131. }
  132. })
  133. }
  134. function page01() {
  135. $("#pageAll01 li:gt(2)").hide();//初始化,前面4条数据显示,其他的数据隐藏。
  136. var total_q = $("#pageAll01 li").index() + 1;//总数据
  137. var current_page = 3;//每页显示的数据
  138. var current_num = 1;//当前页数
  139. var total_page;
  140. if(total_q%current_page==0){
  141. total_page=total_q/current_page;
  142. }
  143. else{
  144. total_page=Math.ceil(total_q/current_page);
  145. }
  146. var next = $("#next02");//下一页
  147. var prev = $("#prev02");//上一页
  148. $("#total02").text(total_page);//显示总页数
  149. $("#current_page02").text(current_num);//当前的页数
  150. //下一页
  151. $("#next02").click(function () {
  152. if (current_num == total_page) {
  153. return false;//如果大于总页数就禁用下一页
  154. }
  155. else {
  156. $("#current_page02").text(++current_num);//点击下一页的时候当前页数的值就加1
  157. $.each($('#pageAll01 li'), function (index, item) {
  158. var start = current_page * (current_num - 1);//起始范围
  159. var end = current_page * current_num;//结束范围
  160. if (index >= start && index < end) {//如果索引值是在start和end之间的元素就显示,否则就隐
  161. $(this).show();
  162. } else {
  163. $(this).hide();
  164. }
  165. });
  166. }
  167. });
  168. //上一页方法
  169. $("#prev02").click(function () {
  170. if (current_num == 1) {
  171. return false;
  172. } else {
  173. $("#current_page02").text(--current_num);
  174. $.each($('#pageAll01 li'), function (index, item) {
  175. var start = current_page * (current_num - 1);//起始范围
  176. var end = current_page * current_num;//结束范围
  177. if (index >= start && index < end) {//如果索引值是start和end之间的元素就显示,否则就隐藏
  178. $(this).show();
  179. } else {
  180. $(this).hide();
  181. }
  182. });
  183. }
  184. })
  185. }
  186. function page02() {
  187. $("#pageAll02 li:gt(7)").hide();//初始化,前面4条数据显示,其他的数据隐藏。
  188. var total_q = $("#pageAll02 li").index() + 1;//总数据
  189. var current_page = 8;//每页显示的数据
  190. var current_num = 1;//当前页数
  191. var total_page;
  192. if(total_q%current_page==0){
  193. total_page=total_q/current_page;
  194. }
  195. else{
  196. total_page=Math.ceil(total_q/current_page);
  197. }
  198. var next = $("#next03");//下一页
  199. var prev = $("#prev03");//上一页
  200. $("#total03").text(total_page);//显示总页数
  201. $("#current_page03").text(current_num);//当前的页数
  202. //下一页
  203. $("#next03").click(function () {
  204. if (current_num == total_page) {
  205. return false;//如果大于总页数就禁用下一页
  206. }
  207. else {
  208. $("#current_page03").text(++current_num);//点击下一页的时候当前页数的值就加1
  209. $.each($('#pageAll02 li'), function (index, item) {
  210. var start = current_page * (current_num - 1);//起始范围
  211. var end = current_page * current_num;//结束范围
  212. if (index >= start && index < end) {//如果索引值是在start和end之间的元素就显示,否则就隐
  213. $(this).show();
  214. } else {
  215. $(this).hide();
  216. }
  217. });
  218. }
  219. });
  220. //上一页方法
  221. $("#prev03").click(function () {
  222. if (current_num == 1) {
  223. return false;
  224. } else {
  225. $("#current_page03").text(--current_num);
  226. $.each($('#pageAll02 li'), function (index, item) {
  227. var start = current_page * (current_num - 1);//起始范围
  228. var end = current_page * current_num;//结束范围
  229. if (index >= start && index < end) {//如果索引值是start和end之间的元素就显示,否则就隐藏
  230. $(this).show();
  231. } else {
  232. $(this).hide();
  233. }
  234. });
  235. }
  236. })
  237. }