Geen omschrijving

anyangMap.js 27KB

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