No Description

anyangMap.js 27KB

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