Bez popisu

anyangMap.js 28KB

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