Bez popisu

anyangMap.js 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. /*
  2. 一级大屏地图
  3. */
  4. var uploadedDataURL = "./json/format.1630046648889.js";
  5. var mapImg = './image/point.png';
  6. var myChart = echarts.init(document.getElementById('map'));
  7. var points = [{
  8. name: '安阳县',
  9. value: [114.164512, 36.180943]
  10. },
  11. {
  12. name: '北关区',
  13. value: [114.379621, 36.137115]
  14. },
  15. {
  16. name: '滑县',
  17. value: [114.667181, 35.465867]
  18. },
  19. {
  20. name: '龙安区',
  21. value: [114.254489, 36.044375]
  22. },
  23. {
  24. name: '林州市',
  25. value: [113.854634, 36.010256]
  26. },
  27. {
  28. name: '内黄县',
  29. value: [114.8165, 35.900576]
  30. },
  31. {
  32. name: '汤阴县',
  33. value: [114.455689, 35.902302]
  34. },
  35. {
  36. name: '文峰区(高新区)',
  37. value: [114.418257, 36.034251]
  38. },
  39. {
  40. name: '殷都区',
  41. value: [114.289197, 36.133648]
  42. }
  43. ];
  44. let mapWorkOrder = []//地区data
  45. let mapNum = 0;//高新区归纳于文峰区
  46. var maxNum = []//热力图最高范围
  47. let dataNum = [];
  48. // let arrowData = []
  49. let series = [];//地图内容
  50. let areaCount=[];//获取每个地图的受理量
  51. //地区坐标
  52. let hxData = [{
  53. name: '文峰区->滑县',
  54. coords: [
  55. [114.418257, 36.034251],
  56. [114.667181, 35.465867]
  57. ]
  58. }];
  59. let nhData = [{
  60. name: '文峰区->内黄县',
  61. coords: [
  62. [114.418257, 36.034251],
  63. [114.8165, 35.900576]
  64. ]
  65. }];
  66. let ayData = [{
  67. name: '文峰区->安阳县',
  68. coords: [
  69. [114.418257, 36.034251],
  70. [114.164512, 36.180943]
  71. ]
  72. }];
  73. let lzData = [{
  74. name: '文峰区->林州市',
  75. coords: [
  76. [114.418257, 36.034251],
  77. [113.854634, 36.010256]
  78. ]
  79. }];
  80. let tyData = [{
  81. name: '文峰区->汤阴县',
  82. coords: [
  83. [114.418257, 36.034251],
  84. [114.455689, 35.902302]
  85. ]
  86. }];
  87. let ydData = [{
  88. name: '文峰区->殷都区',
  89. coords: [
  90. [114.418257, 36.034251],
  91. [114.289197, 36.133648]
  92. ]
  93. }];
  94. let laData = [{
  95. name: '文峰区->龙安区',
  96. coords: [
  97. [114.418257, 36.034251],
  98. [114.254489, 36.044375]
  99. ]
  100. }];
  101. let bgData = [{
  102. name: '文峰区->北关区',
  103. coords: [
  104. [114.418257, 36.034251],
  105. [114.379621, 36.137115]
  106. ]
  107. }];
  108. //地区的受理量(工单量)
  109. let hxName = 0;//滑县
  110. let nhName =0;//内黄
  111. let ayName =0;//安阳
  112. let lzName =0;//林州
  113. let tyName =0;//汤阴
  114. let ydName =0;//殷都
  115. let laName =0;//龙安
  116. let bgName =0;//北关
  117. $(document).ready(function() {
  118. initData()//从后台获取每个区的受理状况
  119. getinitMap()//每增加一个工单就出现一个箭头
  120. setInterval(function(){
  121. mapWorkOrder = []
  122. mapNum = 0;
  123. maxNum = []
  124. dataNum = [];
  125. series = [];
  126. areaCount=[]
  127. initData()
  128. getinitMap();
  129. },30000)
  130. })
  131. function getinitMap(){
  132. for (i = 0; i < mapWorkOrder.length; i++) {
  133. for (j = 0; j < mapWorkOrder.length; j++) {
  134. if (mapWorkOrder[i].value > mapWorkOrder[j].value) {
  135. t = mapWorkOrder[i];
  136. mapWorkOrder[i] = mapWorkOrder[j];
  137. mapWorkOrder[j] = t;
  138. }
  139. }
  140. }
  141. series.push( //地图
  142. {
  143. type: 'map',
  144. mapType: 'js',
  145. geoIndex: -1,
  146. zoom: 1.29, //默认显示级别
  147. // left: 350,
  148. label: {
  149. show: false,
  150. color: '#222',
  151. // offset :[-200,-220],
  152. emphasis: {
  153. color: 'white',
  154. show: false
  155. }
  156. },
  157. itemStyle: {
  158. normal: {
  159. borderColor: '#2980b9',
  160. borderWidth: 1,
  161. areaColor: '#12235c'
  162. },
  163. emphasis: {
  164. // areaColor: '#FA8C16',
  165. borderWidth: 0,
  166. color: 'green'
  167. }
  168. },
  169. data: mapWorkOrder
  170. }, {
  171. type: 'effectScatter',
  172. coordinateSystem: 'geo',
  173. showEffectOn: 'render',
  174. rippleEffect: {
  175. period: 2,
  176. scale: 3,
  177. brushType: 'fill'
  178. },
  179. hoverAnimation: true,
  180. label: {
  181. formatter: '{b}',
  182. position: 'right',
  183. offset: [-20, -20],
  184. color: '#000000',
  185. fontWeight: 600,
  186. show: true
  187. },
  188. itemStyle: {
  189. normal: {
  190. color: '#00fcff',
  191. shadowBlur: 2,
  192. borderWidth: 2,
  193. shadowColor: '#00fcff'
  194. }
  195. },
  196. emphasis: {
  197. show: false,
  198. itemStyle: {
  199. opacity: 1, //线条宽度
  200. }
  201. },
  202. data: points
  203. })
  204. //每增加一个工单就出现一个箭头
  205. mapWorkOrder.forEach(function(v, n) {
  206. dataNum.push(v.value);
  207. if (v.name == '北关区' && v.value != 0) {
  208. if(bgName<v.value&&bgName!=0){
  209. bgData.push({
  210. name: '文峰区->北关区',
  211. coords: [
  212. [114.418257, 36.034251],
  213. [114.379621, 36.137115]
  214. ]
  215. })
  216. bgName=v.value
  217. }else{
  218. bgName=v.value
  219. }
  220. series.push({
  221. name: '供应商B',
  222. type: 'lines',
  223. zlevel: 2,
  224. symbol: ['none', 'arrow'],
  225. symbolSize: 7,
  226. effect: {
  227. show: true,
  228. period: n + 1,
  229. trailLength: 0.02,
  230. symbol: 'arrow',
  231. symbolSize: 6,
  232. color: '#23e9dc',
  233. loop:false
  234. },
  235. lineStyle: {
  236. color: '#23e9dc',
  237. // width: 1.5, //线条宽度
  238. opacity: 1, //尾迹线条透明度
  239. curveness: 0.3, //尾迹线条曲直度
  240. // shadowBlur: 10,
  241. },
  242. data:bgData
  243. })
  244. }
  245. if (v.name == '殷都区' && v.value != 0) {
  246. if(ydName<v.value&&ydName!=0){
  247. ydData.push({
  248. name: '文峰区->殷都区',
  249. coords: [
  250. [114.418257, 36.034251],
  251. [114.289197, 36.133648]
  252. ]
  253. })
  254. ydName=v.value
  255. }else{
  256. ydName=v.value
  257. }
  258. series.push({
  259. name: '供应商B',
  260. type: 'lines',
  261. zlevel: 2,
  262. symbol: ['none', 'arrow'],
  263. symbolSize: 7,
  264. effect: {
  265. show: true,
  266. period: n + 1,
  267. trailLength: 0.02,
  268. symbol: 'arrow',
  269. symbolSize: 6,
  270. color: '#23e9dc',
  271. loop:false
  272. },
  273. lineStyle: {
  274. color: '#23e9dc',
  275. // width: 1.5, //线条宽度
  276. opacity: 1, //尾迹线条透明度
  277. curveness: 0.3, //尾迹线条曲直度
  278. // shadowBlur: 10,
  279. },
  280. emphasis: {
  281. // lineStyle: {
  282. // width: 2, //线条宽度
  283. // }
  284. },
  285. data: ydData
  286. })
  287. }
  288. if (v.name == '龙安区' && v.value != 0) {
  289. if(laName<v.value&&laName!=0){
  290. laData.push({
  291. name: '文峰区->龙安区',
  292. coords: [
  293. [114.418257, 36.034251],
  294. [114.254489, 36.044375]
  295. ]
  296. })
  297. laName=v.value
  298. }else{
  299. alName=v.value
  300. }
  301. series.push({
  302. name: '供应商B',
  303. type: 'lines',
  304. zlevel: 2,
  305. symbol: ['none', 'arrow'],
  306. symbolSize: 7,
  307. effect: {
  308. show: true,
  309. period: n + 1,
  310. trailLength: 0.02,
  311. symbol: 'arrow',
  312. symbolSize: 6,
  313. color: '#23e9dc',
  314. loop:false
  315. },
  316. lineStyle: {
  317. color: '#23e9dc',
  318. // width: 1.5, //线条宽度
  319. opacity: 1, //尾迹线条透明度
  320. curveness: 0.3, //尾迹线条曲直度
  321. // shadowBlur: 10,
  322. },
  323. emphasis: {
  324. // lineStyle: {
  325. // width: 2, //线条宽度
  326. // }
  327. },
  328. data: laData
  329. })
  330. }
  331. if (v.name == '安阳县' && v.value != 0) {
  332. if(ayName<v.value&&ayName!=0){
  333. ayData.push({
  334. name: '文峰区->安阳县',
  335. coords: [
  336. [114.418257, 36.034251],
  337. [114.164512, 36.180943]
  338. ]
  339. })
  340. ayName=v.value
  341. }else{
  342. ayName=v.value
  343. }
  344. series.push({
  345. name: '供应商B',
  346. type: 'lines',
  347. zlevel: 2,
  348. symbol: ['none', 'arrow'],
  349. symbolSize: 7,
  350. effect: {
  351. show: true,
  352. period: n + 1,
  353. trailLength: 0.02,
  354. symbol: 'arrow',
  355. symbolSize: 6,
  356. color: '#23e9dc',
  357. loop:false
  358. },
  359. lineStyle: {
  360. color: '#23e9dc',
  361. // width: 1.5, //线条宽度
  362. opacity: 1, //尾迹线条透明度
  363. curveness: 0.3, //尾迹线条曲直度
  364. // shadowBlur: 10,
  365. },
  366. emphasis: {
  367. // lineStyle: {
  368. // width: 2, //线条宽度
  369. // }
  370. },
  371. data: ayData
  372. })
  373. }
  374. if (v.name == '汤阴县' && v.value != 0) {
  375. if(tyName<v.value&&tyName!=0){
  376. tyData.push({
  377. name: '文峰区->汤阴县',
  378. coords: [
  379. [114.418257, 36.034251],
  380. [114.455689, 35.902302]
  381. ]
  382. })
  383. tyName=v.value
  384. }else{
  385. tyName=v.value
  386. }
  387. series.push({
  388. name: '供应商B',
  389. type: 'lines',
  390. zlevel: 2,
  391. symbol: ['none', 'arrow'],
  392. symbolSize: 7,
  393. effect: {
  394. show: true,
  395. period: n + 1,
  396. trailLength: 0.02,
  397. symbol: 'arrow',
  398. symbolSize: 6,
  399. color: '#23e9dc',
  400. loop:false
  401. },
  402. lineStyle: {
  403. color: '#23e9dc',
  404. // width: 1.5, //线条宽度
  405. opacity: 1, //尾迹线条透明度
  406. curveness: 0.3, //尾迹线条曲直度
  407. // shadowBlur: 10,
  408. },
  409. emphasis: {
  410. // lineStyle: {
  411. // width: 2, //线条宽度
  412. // }
  413. },
  414. data: tyData
  415. })
  416. }
  417. if (v.name == '内黄县' && v.value != 0) {
  418. if(nhName<v.value&&nhName!=0){
  419. nhData.push({
  420. name: '文峰区->内黄县',
  421. coords: [
  422. [114.418257, 36.034251],
  423. [114.8165, 35.900576]
  424. ]
  425. })
  426. nhName=v.value
  427. }else{
  428. nhName=v.value
  429. }
  430. series.push({
  431. name: '供应商B',
  432. type: 'lines',
  433. zlevel: 2,
  434. symbol: ['none', 'arrow'],
  435. symbolSize: 7,
  436. effect: {
  437. show: true,
  438. period: n + 1,
  439. trailLength: 0.02,
  440. symbol: 'arrow',
  441. symbolSize: 6,
  442. color: '#23e9dc',
  443. loop:false
  444. },
  445. lineStyle: {
  446. color: '#23e9dc',
  447. // width: 1.5, //线条宽度
  448. opacity: 1, //尾迹线条透明度
  449. curveness: 0.3, //尾迹线条曲直度
  450. // shadowBlur: 10,
  451. },
  452. emphasis: {
  453. // lineStyle: {
  454. // width: 2, //线条宽度
  455. // }
  456. },
  457. data: nhData
  458. })
  459. }
  460. if (v.name == '滑县' && v.value != 0) {
  461. if(hxName<v.value&&hxName!=0){
  462. hxData.push({
  463. name: '文峰区->滑县',
  464. coords: [
  465. [114.418257, 36.034251],
  466. [114.667181, 35.465867]
  467. ]
  468. })
  469. hxName=v.value
  470. }else{
  471. hxName=v.value
  472. }
  473. series.push({
  474. name: '供应商B',
  475. type: 'lines',
  476. zlevel: 2,
  477. symbol: ['none', 'arrow'],
  478. symbolSize: 7,
  479. effect: {
  480. show: true,
  481. period: n + 1,
  482. trailLength: 0.02,
  483. symbol: 'arrow',
  484. symbolSize: 6,
  485. color: '#23e9dc',
  486. loop:false
  487. },
  488. lineStyle: {
  489. color: '#23e9dc',
  490. // width: 1.5, //线条宽度
  491. opacity: 1, //尾迹线条透明度
  492. curveness: 0.3, //尾迹线条曲直度
  493. // shadowBlur: 10,
  494. },
  495. emphasis: {
  496. // lineStyle: {
  497. // width: 2, //线条宽度
  498. // }
  499. },
  500. data: hxData
  501. })
  502. }
  503. if (v.name == '林州市' && v.value != 0) {
  504. if(lzName<v.value&&lzName!=0){
  505. lzData.push({
  506. name: '文峰区->林州市',
  507. coords: [
  508. [114.418257, 36.034251],
  509. [113.854634, 36.010256]
  510. ]
  511. })
  512. lzName=v.value
  513. }else{
  514. lzName=v.value
  515. }
  516. series.push({
  517. name: '供应商B',
  518. type: 'lines',
  519. zlevel: 2,
  520. symbol: ['none', 'arrow'],
  521. symbolSize: 7,
  522. effect: {
  523. show: true,
  524. period: n + 1,
  525. trailLength: 0.02,
  526. symbol: 'arrow',
  527. symbolSize: 6,
  528. color: '#23e9dc',
  529. loop:false
  530. },
  531. lineStyle: {
  532. color: '#23e9dc',
  533. // width: 1.5, //线条宽度
  534. opacity: 1, //尾迹线条透明度
  535. curveness: 0.3, //尾迹线条曲直度
  536. // shadowBlur: 10,
  537. },
  538. emphasis: {
  539. // lineStyle: {
  540. // width: 2, //线条宽度
  541. // }
  542. },
  543. data: lzData
  544. })
  545. }
  546. })
  547. maxNum.push(Math.max.apply(null, dataNum));
  548. getMap(mapWorkOrder, maxNum[0], series)
  549. }
  550. function initData(){
  551. $.ajax({
  552. type: "get",
  553. url: huayi.config.callcenter_url + "InfoNew/GetAreaCount",
  554. async: false,
  555. dataType: 'json',
  556. data: {token: $.cookie("token"),},
  557. success: function(res) {
  558. areaCount=res;
  559. res.forEach(function(v, n) {
  560. if (v.AreaName == "北关区" || v.AreaName == "殷都区" || v.AreaName == "龙安区" || v.AreaName ==
  561. "安阳县" || v.AreaName == "汤阴县" || v.AreaName == "内黄县" || v.AreaName == "滑县" || v
  562. .AreaName == "林州市") {
  563. mapWorkOrder.push({
  564. name: v.AreaName,
  565. value:v.DayCount
  566. })
  567. }
  568. if (v.AreaName == '高新区' || v.AreaName == '文峰区') {
  569. mapNum += v.DayCount
  570. }
  571. if (n == res.length - 1) {
  572. mapWorkOrder.push({
  573. name: '文峰区',
  574. value: mapNum
  575. })
  576. }
  577. })
  578. }
  579. });
  580. }
  581. function getMap(mapWorkOrder, maxNum) {
  582. var option = null;
  583. $.getJSON(uploadedDataURL, function(geoJson) {
  584. echarts.registerMap('js', geoJson);
  585. myChart.hideLoading();
  586. option = {
  587. tooltip: {
  588. trigger: 'item',
  589. textStyle: {
  590. color: '#fff',
  591. fontSize: '16',
  592. fontWeight: '600'
  593. },
  594. position: 'top',
  595. backgroundColor: 'rgba(250,250,250,0)',
  596. transitionDuration: 0.4,
  597. formatter: function(params) {
  598. let str=''
  599. areaCount.forEach(function(v,n){
  600. // debugger
  601. if(v.AreaName=='林州市'){
  602. $('.wrapp').css({
  603. 'top':'11px !important'
  604. })
  605. }
  606. if(v.AreaName==params.name){
  607. str='<div class="wrapp"><p>'+v.AreaName+'</p><ul class="mapWrap"><li><label>今日受理量:</label>'+
  608. v.DayCount+'</li><li><label>今日办理量:</label>'+v.dayblcount+'</li><li><label>今日办理率:</label>'+
  609. v.blrate+'</li><li><label>今日满意度:</label>'+v.mydrate+'</li></ul></div>'
  610. }
  611. })
  612. return str
  613. }
  614. },
  615. graphic: {
  616. elements: [{
  617. type: "image",
  618. z: 3,
  619. style: {
  620. image: mapImg,
  621. width: 30,
  622. height: 31
  623. },
  624. left: 390,
  625. top: 155
  626. }]
  627. },
  628. visualMap: {
  629. show: true,
  630. max: maxNum,
  631. seriesIndex: [0],
  632. // left: 185,
  633. calculable: true,
  634. textStyle: {
  635. color: '#fff'
  636. },
  637. inRange: {
  638. color: ['#fffb00', '#ff0100']
  639. }
  640. },
  641. geo: [{
  642. map: 'js',
  643. roam: false, //是否允许缩放
  644. zoom: 1.29, //默认显示级别
  645. // left: 350,
  646. scaleLimit: {
  647. min: 0,
  648. max: 3
  649. }, //缩放级别
  650. itemStyle: {
  651. normal: {
  652. // areaColor: '#013C62',
  653. shadowColor: '#013C62',
  654. shadowBlur: 20,
  655. shadowOffsetX: -5,
  656. shadowOffsetY: 15,
  657. }
  658. },
  659. tooltip: {
  660. show: false
  661. }
  662. }],
  663. series: series
  664. };
  665. myChart.setOption(option);
  666. })
  667. }
  668. //跳入二级地图
  669. myChart.on('click',function(params){
  670. let areaid=0;
  671. let areaChildrenId={};
  672. $('.secondLevel_map .regionMap').html('<div id="regionMap" style="width:1100px;height:800px;"></div>');
  673. $('.bulletFrame').show();
  674. $('.secondLevel_map').show();
  675. $('.secondLevel_map').siblings().hide()
  676. if ($('.bulletFrame').css('display') == 'block') {
  677. $('.body').css('opacity', '0.4')
  678. }
  679. // getTimes('.table_title .time')
  680. if(params.name=='汤阴县'){
  681. areaid=4970
  682. $('.table_title .region').text('安阳市/汤阴县');
  683. $('.secondLevel_map h3').text('汤阴县各个地区的数据');
  684. var points = [{
  685. name: '韩庄镇',
  686. value: [114.334991,35.927563]
  687. },
  688. {
  689. name: '宜沟镇',
  690. value: [114.323211,35.834913]
  691. },
  692. {
  693. name: '五陵镇',
  694. value: [114.596888,35.891651]
  695. },
  696. {
  697. name: '瓦岗乡',
  698. value: [114.483246,35.862893]
  699. },
  700. {
  701. name: '任固镇',
  702. value: [114.647119,35.969153]
  703. },
  704. {
  705. name: '白营镇',
  706. value: [114.420167,35.947903]
  707. },
  708. {
  709. name: '菜园镇',
  710. value: [114.537142,35.959174]
  711. },
  712. {
  713. name: '城关镇',
  714. value: [114.361279,35.909404]
  715. },
  716. {
  717. name: '伏道镇',
  718. value: [114.434838,35.885618]
  719. },{
  720. name: '古贤镇',
  721. value: [114.468908,35.952257]
  722. }
  723. ];
  724. getAreaChildrenDate("./json/second_mapjson/tyMap.js",areaid,params.name,2.1);
  725. }
  726. if(params.name=='北关区'){
  727. areaid=4966
  728. $('.table_title .region').text('安阳市/北关区');
  729. $('.secondLevel_map h3').text('北关区各个地区的数据');
  730. var points = [{
  731. name: '柏庄镇街道办事处',
  732. value: [114.376146,36.189086]
  733. },
  734. {
  735. name: '灯塔路街道办事处',
  736. value: [114.363224,36.103208]
  737. },
  738. {
  739. name: '豆腐营街道办事处',
  740. value: [114.367485,36.117054]
  741. },
  742. {
  743. name: '红旗路街道办事处',
  744. value: [114.352712,36.111018]
  745. },
  746. {
  747. name: '洹北街道办事处',
  748. value: [114.352576,36.126513]
  749. },
  750. {
  751. name: '解放路街道办事处',
  752. value: [114.337825,36.105418]
  753. },
  754. {
  755. name: '明航路街道办事处',
  756. value: [114.342118,36.116426]
  757. },
  758. {
  759. name: '曙光路街道办事处',
  760. value: [114.386033,36.11196]
  761. },
  762. {
  763. name: '彰北街道办事处',
  764. value: [114.348406,36.153483]
  765. },{
  766. name: '彰东街道办事处',
  767. value: [114.406294,36.122082]
  768. }
  769. ];
  770. // getAreaData("./json/second_mapjson/bg.js",areaid,1,points)
  771. getAreaChildrenDate("./json/second_mapjson/bg.js",areaid,params.name,1)
  772. }
  773. if(params.name=='林州市'){
  774. areaid=4973
  775. $('.table_title .region').text('安阳市/林州市');
  776. $('.secondLevel_map h3').text('林州市各个地区的数据');
  777. var points = [{
  778. name: '采桑镇',
  779. value: [113.887716,35.960656]
  780. },
  781. {
  782. name: '茶店镇',
  783. value: [113.777267,35.81841]
  784. },
  785. {
  786. name: '东岗镇',
  787. value: [113.931622,36.262622]
  788. },
  789. {
  790. name: '东姚镇',
  791. value: [113.96501,35.919831]
  792. },
  793. {
  794. name: '桂林镇',
  795. value: [113.849715,35.87905]
  796. },
  797. {
  798. name: '桂园街道',
  799. value: [113.845538,36.069393]
  800. },
  801. {
  802. name: '合涧镇',
  803. value: [113.75004,35.976737]
  804. },
  805. {
  806. name: '河顺镇',
  807. value: [113.934313,36.166682]
  808. },
  809. {
  810. name: '横水镇',
  811. value: [113.929042,36.059674]
  812. },{
  813. name: '黄华镇',
  814. value: [113.731985,36.055168]
  815. },{
  816. name: '开元街道',
  817. value: [113.779445,36.062924]
  818. },
  819. {
  820. name: '临淇镇',
  821. value: [113.810211,35.746358]
  822. },
  823. {
  824. name: '陵阳镇',
  825. value: [113.860306,36.108913]
  826. },
  827. {
  828. name: '龙山街道',
  829. value: [113.844116,36.036597]
  830. },{
  831. name: '任村镇',
  832. value: [113.819971,36.280505]
  833. },{
  834. name: '石板岩镇',
  835. value: [113.732406,36.171901]
  836. },
  837. {
  838. name: '五龙镇',
  839. value: [113.936786,35.768473]
  840. },{
  841. name: '姚村镇',
  842. value: [113.788672,36.163975]
  843. },{
  844. name: '原康镇',
  845. value: [113.733172,35.901168]
  846. },{
  847. name: '振林街道',
  848. value: [113.78518,36.028286]
  849. }
  850. ];
  851. // initSecondMap("./json/second_mapjson/lz.js",mapWorkOrder,points,0.8)
  852. // getAreaData("./json/second_mapjson/lz.js",areaid,0.8,points)
  853. getAreaChildrenDate("./json/second_mapjson/lz.js",areaid,params.name,0.8);
  854. }
  855. if(params.name=='龙安区'){
  856. areaid=4968
  857. $('.table_title .region').text('安阳市/龙安区');
  858. $('.secondLevel_map h3').text('龙安区各个地区的数据');
  859. var points = [{
  860. name: '东风乡',
  861. value: [114.263657,36.081646]
  862. },
  863. {
  864. name: '龙泉镇',
  865. value: [114.183266,36.066322]
  866. },
  867. {
  868. name: '马家乡',
  869. value: [114.033834,36.007366]
  870. },
  871. {
  872. name: '善应镇',
  873. value: [114.087244,36.052482]
  874. },
  875. {
  876. name: '马投涧',
  877. value: [114.265472,36.017159]
  878. },
  879. {
  880. name: '彰武街道',
  881. value: [114.126507,36.081671]
  882. },
  883. {
  884. name: '其他街道',
  885. value: [114.309283,36.086998]
  886. },
  887. {
  888. name: '田村街道',
  889. value: [114.325998,35.995775]
  890. }
  891. ];
  892. // initSecondMap("./json/second_mapjson/la.js",mapWorkOrder,points,1.7,1)
  893. getAreaChildrenDate("./json/second_mapjson/la.js",areaid,params.name,1.7)
  894. }
  895. if(params.name=='内黄县'){
  896. areaid=4971
  897. $('.table_title .region').text('安阳市/内黄县');
  898. $('.secondLevel_map h3').text('内黄县各个地区的数据');
  899. var points = [{
  900. name: '亳城乡',
  901. value: [114.791918,35.856879]
  902. },
  903. {
  904. name: '城关镇',
  905. value: [114.913482,35.921525]
  906. },
  907. {
  908. name: '楚旺镇',
  909. value: [114.861593,36.069981]
  910. },
  911. {
  912. name: '东庄镇',
  913. value: [114.799996,35.939528]
  914. },
  915. {
  916. name: '豆公镇',
  917. value: [114.731277,36.003302]
  918. },
  919. {
  920. name: '二安镇',
  921. value: [114.63051,35.830218]
  922. },
  923. {
  924. name: '高堤乡',
  925. value: [114.686809,35.926727]
  926. },
  927. {
  928. name: '后河镇',
  929. value: [114.886355,35.823831]
  930. },
  931. {
  932. name: '井店镇',
  933. value: [114.714754,35.824492]
  934. },{
  935. name: '梁庄镇',
  936. value: [114.790612,35.714601]
  937. },{
  938. name: '六村乡',
  939. value: [114.765365,35.818409]
  940. },
  941. {
  942. name: '马上乡',
  943. value: [114.923471,36.012246]
  944. },
  945. {
  946. name: '石盘屯乡',
  947. value: [114.795523,36.026423]
  948. },
  949. {
  950. name: '宋村乡',
  951. value: [114.874849,36.102626]
  952. },{
  953. name: '田氏镇',
  954. value: [114.768836,36.093927]
  955. },{
  956. name: '张龙乡',
  957. value: [114.836405,35.997405]
  958. },
  959. {
  960. name: '中召乡',
  961. value: [114.880941,35.672457]
  962. }
  963. ];
  964. // initSecondMap("./json/second_mapjson/nh.js",mapWorkOrder,points,0.9,1)
  965. // getAreaData("./json/second_mapjson/nh.js",areaid,0.9,points)
  966. getAreaChildrenDate("./json/second_mapjson/nh.js",areaid,params.name,0.9)
  967. }
  968. if(params.name=='安阳县'){
  969. areaid=4969
  970. $('.table_title .region').text('安阳市/安阳县');
  971. $('.secondLevel_map h3').text('安阳县各个地区的数据');
  972. var points = [{
  973. name: '白璧镇',
  974. value: [114.496084,36.085256]
  975. },
  976. {
  977. name: '北郭乡',
  978. value: [114.718712,36.092081]
  979. },
  980. {
  981. name: '崔家桥',
  982. value: [114.472922,36.127645]
  983. },
  984. {
  985. name: '高庄镇',
  986. value: [114.441733,36.022587]
  987. },
  988. {
  989. name: '韩陵镇',
  990. value: [114.426147,36.157893]
  991. },
  992. {
  993. name: '吕村镇',
  994. value: [114.63456,36.097088]
  995. },
  996. {
  997. name: '瓦店乡',
  998. value: [114.543443,36.030168]
  999. },
  1000. {
  1001. name: '辛村镇',
  1002. value: [114.649095,36.038501]
  1003. },{
  1004. name: '永和镇',
  1005. value: [114.556285,36.076409]
  1006. }
  1007. ];
  1008. // initSecondMap("./json/second_mapjson/an.js",mapWorkOrder,points,1.8,1)
  1009. getAreaChildrenDate("./json/second_mapjson/an.js",areaid,params.name,1.8)
  1010. }
  1011. if(params.name=='滑县'){
  1012. areaid=4972
  1013. $('.table_title .region').text('安阳市/滑县');
  1014. $('.secondLevel_map h3').text('滑县各个地区的数据');
  1015. var points = [{
  1016. name: '道口镇街道',
  1017. value: [114.521725,35.57908]
  1018. },
  1019. {
  1020. name: '城关镇',
  1021. value: [114.562491,35.536364]
  1022. },
  1023. {
  1024. name: '白道口镇',
  1025. value: [114.687202,35.610667]
  1026. },
  1027. {
  1028. name: '留固镇',
  1029. value: [114.707976,35.521489]
  1030. },
  1031. {
  1032. name: '上官镇',
  1033. value: [114.6566,35.408238]
  1034. },
  1035. {
  1036. name: '牛屯镇',
  1037. value: [114.432765,35.263399]
  1038. },
  1039. {
  1040. name: '万古镇',
  1041. value: [114.765123,35.425571]
  1042. },
  1043. {
  1044. name: '高平镇',
  1045. value: [114.762324,35.362734]
  1046. },
  1047. {
  1048. name: '王庄镇',
  1049. value: [114.452002,35.448025]
  1050. },{
  1051. name: '老店镇',
  1052. value: [114.519226,35.432093]
  1053. },{
  1054. name: '枣村乡',
  1055. value: [114.641436,35.586652]
  1056. },
  1057. {
  1058. name: '四间房镇',
  1059. value: [114.809686,35.644298]
  1060. },
  1061. {
  1062. name: '八里营镇',
  1063. value: [114.802761,35.526012]
  1064. },
  1065. {
  1066. name: '赵营镇',
  1067. value: [114.918496,35.558846]
  1068. },{
  1069. name: '大寨乡',
  1070. value: [114.922687,35.510747]
  1071. },{
  1072. name: '桑村乡',
  1073. value: [114.948336,35.40398]
  1074. },
  1075. {
  1076. name: '老爷庙乡',
  1077. value: [114.859358,35.417752]
  1078. },{
  1079. name: '慈周寨镇',
  1080. value: [114.656107,35.31389]
  1081. },{
  1082. name: '瓦岗寨乡',
  1083. value: [114.605103,35.337706]
  1084. },{
  1085. name: '焦虎镇',
  1086. value: [114.547843,35.324892]
  1087. },{
  1088. name:'半坡店镇',
  1089. value: [114.461749,35.357857]
  1090. },{
  1091. name:'小铺乡',
  1092. value: [114.462266,35.524934]
  1093. },{
  1094. name:'锦和街道',
  1095. value:[114.534026,35.55689]
  1096. }
  1097. ];
  1098. getAreaChildrenDate("./json/second_mapjson/hx.js",areaid,params.name,1.5)
  1099. }
  1100. if(params.name=='文峰区'){
  1101. areaid=4965
  1102. $('.table_title .region').text('安阳市/文峰区');
  1103. $('.secondLevel_map h3').text('文峰区各个地区的数据');
  1104. var points = [{
  1105. name: '紫薇大道街道办事处',
  1106. value: [114.377648,36.100414]
  1107. },
  1108. {
  1109. name: '中华路街道办事处',
  1110. value: [114.395717,36.077149]
  1111. },
  1112. {
  1113. name: '西关街道办事处',
  1114. value: [114.338148,36.084578]
  1115. },
  1116. {
  1117. name: '永明路街道办事处',
  1118. value: [114.399933,36.099202]
  1119. },
  1120. {
  1121. name: '银杏大街办事处',
  1122. value: [114.373121,36.064235]
  1123. },
  1124. {
  1125. name: '西大街街道办事处',
  1126. value: [114.34324,36.088201]
  1127. },
  1128. {
  1129. name: '头二三街道办事处',
  1130. value: [114.360524,36.094981]
  1131. },
  1132. {
  1133. name: '甜水井街道办事处',
  1134. value: [114.358959,36.099054]
  1135. },
  1136. {
  1137. name: '商颂大街办事处',
  1138. value: [114.382846,36.030264]
  1139. },
  1140. {
  1141. name: '南关街道办事处',
  1142. value: [114.349528,36.078638]
  1143. },{
  1144. name: '光华路街道办事处',
  1145. value: [114.375407,36.07955]
  1146. },{
  1147. name: '峨嵋大街办事处',
  1148. value: [114.336056,36.055329]
  1149. },
  1150. {
  1151. name: '东关街道办事处',
  1152. value: [114.372651,36.090796]
  1153. },
  1154. {
  1155. name: '东大街街道办事处',
  1156. value: [114.350048,36.091195]
  1157. },
  1158. {
  1159. name: '北大街街道办事处',
  1160. value: [114.34613,36.097237]
  1161. },{
  1162. name: '宝莲寺镇人民政府',
  1163. value: [114.375466,36.005516]
  1164. }
  1165. ];
  1166. getAreaChildrenDate("./json/second_mapjson/wf.js",areaid,params.name,1)
  1167. // initSecondMap("./json/second_mapjson/wf.js",mapWorkOrder,points,1)
  1168. }
  1169. if(params.name=='殷都区'){
  1170. areaid=4967
  1171. $('.table_title .region').text('安阳市/殷都区');
  1172. $('.secondLevel_map h3').text('殷都区各个地区的数据');
  1173. var points = [{
  1174. name: '其他街道',
  1175. value: [114.293737,36.139251]
  1176. },
  1177. {
  1178. name: '洪河屯乡',
  1179. value: [114.305236,36.177483]
  1180. },
  1181. {
  1182. name: '伦掌镇',
  1183. value: [114.139168,36.228247]
  1184. },
  1185. {
  1186. name: '水冶镇',
  1187. value: [114.137329,36.131261]
  1188. },
  1189. {
  1190. name: '许家沟乡',
  1191. value: [114.062848,36.123366]
  1192. },
  1193. {
  1194. name: '磊口乡',
  1195. value: [113.995755,36.155448]
  1196. },
  1197. {
  1198. name: '铜冶镇',
  1199. value: [114.078469,36.235819]
  1200. },
  1201. {
  1202. name: '都里镇',
  1203. value: [114.016636,36.272104]
  1204. },{
  1205. name: '安丰乡',
  1206. value: [114.268893,36.203905]
  1207. },{
  1208. name: '曲沟镇',
  1209. value: [114.21666,36.115853]
  1210. }
  1211. ];
  1212. // initSecondMap("./json/second_mapjson/yd.js",mapWorkOrder,points,1.5,1)
  1213. getAreaChildrenDate("./json/second_mapjson/nyd.js",areaid,params.name,1.5)
  1214. }
  1215. initTableMap(areaid)
  1216. //按钮样式
  1217. $('.type').css({
  1218. 'background': 'url(./image/second/btn1.png)'
  1219. })
  1220. $('.classify').css({
  1221. 'background': 'url(./image/second/btn2.png)'
  1222. })
  1223. $('#orderKeylist').hide()
  1224. function getAreaData(area,areaid,num,points,areaChildrenId){
  1225. new doAjax({
  1226. url:huayi.config.callcenter_url+'/InfoNew/GetAreaChildrenCount',
  1227. Type: 'get',
  1228. data: {
  1229. token: $.cookie("token"),
  1230. areaid :areaid
  1231. },
  1232. callBack: function (res) {
  1233. let mapWorkOrder=[];
  1234. let maxNum2=[];//二级热力图的最高范围
  1235. let dataNum2=[];
  1236. res.data.forEach(function(v,n){
  1237. dataNum2.push(v.count)
  1238. mapWorkOrder.push({
  1239. name:v.Name,
  1240. value:v.count
  1241. })
  1242. })
  1243. maxNum2.push(Math.max.apply(null, dataNum2));
  1244. initSecondMap(area,mapWorkOrder,points,num,maxNum2[0],areaChildrenId)
  1245. }
  1246. });
  1247. }
  1248. function getAreaChildrenDate(area,areaid,areaName,num){
  1249. new doAjax({
  1250. url:huayi.config.callcenter_url+'/InfoNew/GetTownshipCount',
  1251. Type: 'get',
  1252. async:false,
  1253. data: {
  1254. token: $.cookie("token"),
  1255. id:areaid
  1256. },
  1257. callBack: function (res) {
  1258. areaChildrenId={};
  1259. areaChildrenId.areaName=areaName;
  1260. areaChildrenId.data=res.data;
  1261. console.log(areaChildrenId)
  1262. getAreaData(area,areaid,num,points,areaChildrenId);
  1263. }
  1264. });
  1265. }
  1266. //二级地图的按钮切换左侧表格
  1267. $('.table_btn').click(function(e){
  1268. if(e.target.tagName == 'SPAN'){
  1269. if ($(e.target).attr('pos') == '0') {
  1270. //诉求分类
  1271. initTableMap(areaid)
  1272. $('#orderKeylist').hide()
  1273. $('#orderlist').show()
  1274. $('.type').css({
  1275. 'background': 'url(./image/second/btn1.png)',
  1276. 'color':'#f4d219'
  1277. })
  1278. $('.classify').css({
  1279. 'background': 'url(./image/second/btn2.png)',
  1280. 'color':'#0693be'
  1281. })
  1282. }else{
  1283. //问题分类前十
  1284. keyTable(areaid)
  1285. $('#orderlist').hide()
  1286. $('#orderKeylist').show()
  1287. $('.classify').css({
  1288. 'background': 'url(./image/second/btn1.png)',
  1289. 'color':'#f4d219'
  1290. })
  1291. $('.type').css({
  1292. 'background': 'url(./image/second/btn2.png)',
  1293. 'color':'#0693be'
  1294. })
  1295. }
  1296. }
  1297. e.stopPropagation()
  1298. })
  1299. })