暫無描述

anyangMap.js 28KB

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