investHome.js 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. showTip: false,
  6. showTip2: false,
  7. tipTitle: '',
  8. tipTitle2: '',
  9. year: '2022',
  10. time: '',
  11. timer: '',
  12. mapName: 'shanxi',
  13. geoCoordMap: {},
  14. config1: {
  15. number: [100],
  16. content: '{nt}个',
  17. },
  18. storageRecordConfig: null,
  19. companyList: [
  20. { name: '山西焦煤' },
  21. { name: '晋能控股' },
  22. { name: '华新燃气' },
  23. { name: '山西建投' },
  24. { name: '潞安化工' },
  25. { name: '华远陆港' },
  26. { name: '航产集团' },
  27. { name: '大地控股' },
  28. { name: '国新能源' },
  29. { name: '汾酒集团' },
  30. { name: '云时代' },
  31. { name: '神农科技' },
  32. { name: '华阳新材' },
  33. { name: '华舰体育' },
  34. { name: '交控集团' },
  35. { name: '文旅集团' },
  36. { name: '水控集团' },
  37. { name: '太重集团' },
  38. ],
  39. amountList: amountList,
  40. amountTotal: 0,
  41. classOption: {
  42. step: 0.5
  43. }
  44. }
  45. },
  46. created () {
  47. this.amountList.map(item => {
  48. this.amountTotal += Number(item.value)
  49. })
  50. this.time = formatDate()
  51. this.timer = setInterval(() => {
  52. this.time = formatDate()
  53. }, 1000)
  54. },
  55. beforeDestroy () {
  56. if (this.timer) {
  57. clearInterval(this.timer);
  58. }
  59. },
  60. mounted () {
  61. setTimeout(() => {
  62. // 左侧图表
  63. //this.initChartTip()
  64. this.initChartTip2()
  65. this.initChartTip3()
  66. this.initChartTip4()
  67. this.initChartL1()
  68. this.initChartL2()
  69. this.initChartR1()
  70. this.initChinaChart()
  71. this.initProjectList()
  72. }, 0)
  73. },
  74. methods: {
  75. numFormat (value) {
  76. if (!value) return '0'
  77. var intPart = Number(value).toFixed(0) // 获取整数部分
  78. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
  79. var floatPart = '.00' // 预定义小数部分
  80. var value2Array = value.toString().split('.')
  81. // =2表示数据有小数位
  82. if (value2Array.length === 2) {
  83. floatPart = value2Array[1].toString() // 拿到小数部分
  84. if (floatPart.length === 1) {
  85. // 补0
  86. return intPartFormat + '.' + floatPart + '0'
  87. } else {
  88. return intPartFormat + '.' + floatPart
  89. }
  90. } else {
  91. return intPartFormat
  92. }
  93. },
  94. convertData (data) {
  95. var res = []
  96. for (var i = 0; i < data.length; i++) {
  97. var geoCoord = this.geoCoordMap[data[i].name]
  98. if (geoCoord) {
  99. res.push({
  100. name: data[i].name,
  101. value: geoCoord.concat(data[i].value),
  102. })
  103. }
  104. }
  105. return res
  106. },
  107. initChinaChart () {
  108. var data = [
  109. { name: '大同市', value: 60.35 },
  110. { name: '朔州市', value: 33.61 },
  111. { name: '忻州市', value: 73.35 },
  112. { name: '吕梁市', value: 109.04 },
  113. { name: '太原市', value: 251.67 },
  114. { name: '阳泉市', value: 25.12 },
  115. { name: '晋中市', value: 148.57 },
  116. { name: '临汾市', value: 130.55 },
  117. { name: '长治市', value: 103.00 },
  118. { name: '运城市', value: 41.06 },
  119. { name: '晋城市', value: 45.43 }
  120. ]
  121. var moveLine = {
  122. normal: [
  123. {
  124. fromName: '太原市',
  125. toName: '吕梁市',
  126. coords: [
  127. [112.3352, 37.9413],
  128. [111.3574, 37.7325],
  129. ],
  130. },
  131. {
  132. fromName: '太原市',
  133. toName: '忻州市',
  134. coords: [
  135. [112.3352, 37.9413],
  136. [112.4561, 38.8971],
  137. ],
  138. },
  139. {
  140. fromName: '太原市',
  141. toName: '临汾市',
  142. coords: [
  143. [112.3352, 37.9413],
  144. [111.4783, 36.1615],
  145. ],
  146. },
  147. {
  148. fromName: '太原市',
  149. toName: '阳泉市',
  150. coords: [
  151. [112.3352, 37.9413],
  152. [113.4778, 38.0951],
  153. ],
  154. },
  155. {
  156. fromName: '太原市',
  157. toName: '晋中市',
  158. coords: [
  159. [112.3352, 37.9413],
  160. [112.7747, 37.37],
  161. ],
  162. },
  163. {
  164. fromName: '太原市',
  165. toName: '运城市',
  166. coords: [
  167. [112.3352, 37.9413],
  168. [111.1487, 35.2002],
  169. ],
  170. },
  171. {
  172. fromName: '太原市',
  173. toName: '大同市',
  174. coords: [
  175. [112.3352, 37.9413],
  176. [113.7854, 39.8035],
  177. ],
  178. },
  179. {
  180. fromName: '太原市',
  181. toName: '晋城市',
  182. coords: [
  183. [112.3352, 37.9413],
  184. [112.7856, 35.6342],
  185. ],
  186. },
  187. {
  188. fromName: '太原市',
  189. toName: '长治市',
  190. coords: [
  191. [112.3352, 37.9413],
  192. [112.8625, 36.4746],
  193. ],
  194. },
  195. {
  196. fromName: '太原市',
  197. toName: '朔州市',
  198. coords: [
  199. [112.3352, 37.9413],
  200. [113.0713, 39.6991],
  201. ],
  202. },
  203. ],
  204. }
  205. /*获取地图数据*/
  206. let myChart = echarts.init(this.$refs['echarts-map'])
  207. echarts.registerMap('shanxi', {
  208. type: 'FeatureCollection',
  209. features: [
  210. {
  211. type: 'Feature',
  212. id: '1409',
  213. properties: { name: '忻州市', cp: [112.4561, 38.8971], childNum: 14 },
  214. geometry: {
  215. type: 'Polygon',
  216. coordinates: [
  217. '@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b',
  218. ],
  219. encodeOffsets: [[113614, 39657]],
  220. },
  221. },
  222. {
  223. type: 'Feature',
  224. id: '1411',
  225. properties: { name: '吕梁市', cp: [111.3574, 37.7325], childNum: 13 },
  226. geometry: {
  227. type: 'Polygon',
  228. coordinates: [
  229. '@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x',
  230. ],
  231. encodeOffsets: [[113614, 39657]],
  232. },
  233. },
  234. {
  235. type: 'Feature',
  236. id: '1410',
  237. properties: { name: '临汾市', cp: [111.4783, 36.1615], childNum: 17 },
  238. geometry: {
  239. type: 'Polygon',
  240. coordinates: [
  241. '@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX',
  242. ],
  243. encodeOffsets: [[113063, 37784]],
  244. },
  245. },
  246. {
  247. type: 'Feature',
  248. id: '1407',
  249. properties: { name: '晋中市', cp: [112.7747, 37.37], childNum: 11 },
  250. geometry: {
  251. type: 'Polygon',
  252. coordinates: [
  253. '@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@',
  254. ],
  255. encodeOffsets: [[114087, 37682]],
  256. },
  257. },
  258. {
  259. type: 'Feature',
  260. id: '1408',
  261. properties: { name: '运城市', cp: [111.1487, 35.2002], childNum: 13 },
  262. geometry: {
  263. type: 'Polygon',
  264. coordinates: [
  265. '@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„',
  266. ],
  267. encodeOffsets: [[113232, 36597]],
  268. },
  269. },
  270. {
  271. type: 'Feature',
  272. id: '1402',
  273. properties: { name: '大同市', cp: [113.7854, 39.8035], childNum: 8 },
  274. geometry: {
  275. type: 'Polygon',
  276. coordinates: [
  277. '@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl',
  278. ],
  279. encodeOffsets: [[115335, 41209]],
  280. },
  281. },
  282. {
  283. type: 'Feature',
  284. id: '1404',
  285. properties: { name: '长治市', cp: [112.8625, 36.4746], childNum: 12 },
  286. geometry: {
  287. type: 'Polygon',
  288. coordinates: [
  289. '@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ',
  290. ],
  291. encodeOffsets: [[116269, 37637]],
  292. },
  293. },
  294. {
  295. type: 'Feature',
  296. id: '1406',
  297. properties: { name: '朔州市', cp: [113.0713, 39.6991], childNum: 5 },
  298. geometry: {
  299. type: 'Polygon',
  300. coordinates: [
  301. '@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚',
  302. ],
  303. encodeOffsets: [[114615, 40562]],
  304. },
  305. },
  306. {
  307. type: 'Feature',
  308. id: '1405',
  309. properties: { name: '晋城市', cp: [112.7856, 35.6342], childNum: 6 },
  310. geometry: {
  311. type: 'Polygon',
  312. coordinates: [
  313. '@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°',
  314. ],
  315. encodeOffsets: [[115223, 36895]],
  316. },
  317. },
  318. {
  319. type: 'Feature',
  320. id: '1401',
  321. properties: { name: '太原市', cp: [112.3352, 37.9413], childNum: 5 },
  322. geometry: {
  323. type: 'Polygon',
  324. coordinates: [
  325. '@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°',
  326. ],
  327. encodeOffsets: [[114503, 39134]],
  328. },
  329. },
  330. {
  331. type: 'Feature',
  332. id: '1403',
  333. properties: { name: '阳泉市', cp: [113.4778, 38.0951], childNum: 3 },
  334. geometry: {
  335. type: 'Polygon',
  336. coordinates: [
  337. '@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb',
  338. ],
  339. encodeOffsets: [[115864, 39336]],
  340. },
  341. },
  342. ],
  343. UTF8Encoding: true,
  344. })
  345. var mapFeatures = echarts.getMap(this.mapName).geoJson.features
  346. mapFeatures.forEach(v => {
  347. // 地区名称
  348. var name = v.properties.name
  349. // 地区经纬度
  350. this.geoCoordMap[name] = v.properties.cp
  351. })
  352. // <p>当前阶段:<span>可论证阶段</span></p>
  353. // <p>时间节点:<span>2021.10-2022.10</span></p>
  354. let option = {
  355. tooltip: {
  356. padding: 15,
  357. enterable: true,
  358. transitionDuration: 1,
  359. formatter: (params, ticket, callback) => {
  360. // 清空所有轮播
  361. for (var k in this.geoCoordMap) {
  362. myChart.dispatchAction({
  363. // type: 'geoUnSelect',
  364. type: 'downplay',
  365. name: k,
  366. })
  367. }
  368. // 如果鼠标滑动到线线上面,则返回空
  369. myChart.dispatchAction({
  370. // type: 'geoSelect',
  371. type: 'highlight',
  372. name: params.name,
  373. })
  374. if (params.componentSubType == 'lines') {
  375. return
  376. }
  377. if (params.componentSubType == 'scatter') {
  378. let tipHtml = `
  379. <div class="tooltip-cont">
  380. <p>新开工:<span>工程建设项目</span></p>
  381. <p>总投资额:<span>${params.data.value[2]}亿</span></p>
  382. </div>`
  383. callback(ticket, tipHtml)
  384. return tipHtml
  385. }
  386. if (params.componentSubType == 'map') {
  387. let tipHtml = `
  388. <div class="tooltip-cont">
  389. <p>新开工:<span>工程建设项目</span></p>
  390. <p>总投资额:<span>${params.data.value}亿</span></p>
  391. </div>`
  392. callback(ticket, tipHtml)
  393. return tipHtml
  394. }
  395. },
  396. },
  397. visualMap: {
  398. show: false,
  399. min: 0,
  400. max: 300,
  401. right: 0,
  402. bottom: 0,
  403. text: ['高', '低'],
  404. textStyle: {
  405. color: '#f1f1f1'
  406. },
  407. realtime: false,
  408. calculable: false,
  409. inRange: {
  410. color: ['lightskyblue', '#2754b7']
  411. }
  412. },
  413. geo: {
  414. show: true,
  415. map: 'shanxi',
  416. layoutCenter: ['50%', '50%'], //地图位置
  417. layoutSize: '100%',
  418. label: {
  419. normal: {
  420. show: false,
  421. },
  422. emphasis: {
  423. show: false,
  424. },
  425. },
  426. roam: false,
  427. itemStyle: {
  428. normal: {
  429. areaColor: '#1946a8',
  430. shadowColor: '#1946a8',
  431. borderWidth: 1, //设置外层边框
  432. borderColor: '#1946a8',
  433. shadowOffsetX: 10,
  434. shadowOffsetY: 5,
  435. shadowBlur: 2,
  436. },
  437. emphasis: {
  438. areaColor: '#1946a8',
  439. borderColor: '#d4bc1d',
  440. borderWidth: 2, //设置外层边框
  441. },
  442. },
  443. },
  444. series: [
  445. {
  446. name: '散点',
  447. type: 'scatter',
  448. coordinateSystem: 'geo',
  449. data: this.convertData(data),
  450. symbolSize: function (val) {
  451. return 10
  452. },
  453. label: {
  454. normal: {
  455. formatter: '{b}',
  456. position: [10, 10],
  457. fontSize: 15,
  458. fontWeight: 600,
  459. fontStyle: 'italic',
  460. color: '#fff',
  461. show: true,
  462. },
  463. emphasis: {
  464. show: true,
  465. },
  466. },
  467. itemStyle: {
  468. normal: {
  469. color: '#000',
  470. borderWidth: 2,
  471. borderColor: '#fff',
  472. },
  473. },
  474. },
  475. {
  476. type: 'map',
  477. map: this.mapName,
  478. geoIndex: 0,
  479. aspectScale: 1.5, //长宽比
  480. showLegendSymbol: true, // 存在legend时显示
  481. label: {
  482. normal: {
  483. show: true,
  484. },
  485. emphasis: {
  486. show: false,
  487. textStyle: {
  488. color: '#fff',
  489. },
  490. },
  491. },
  492. roam: true,
  493. itemStyle: {
  494. normal: {
  495. areaColor: '#031525',
  496. borderColor: '#3B5077',
  497. },
  498. emphasis: {
  499. areaColor: '#2B91B7',
  500. },
  501. },
  502. animation: false,
  503. data: data,
  504. },
  505. {
  506. name: '点',
  507. type: 'scatter',
  508. coordinateSystem: 'geo',
  509. zlevel: 6,
  510. },
  511. {
  512. name: 'Top 5',
  513. type: 'effectScatter',
  514. coordinateSystem: 'geo',
  515. data: this.convertData(
  516. data
  517. .sort(function (a, b) {
  518. return b.value - a.value
  519. })
  520. .slice(0, 5)
  521. ),
  522. symbolSize: function (val) {
  523. return 15
  524. },
  525. showEffectOn: 'render',
  526. rippleEffect: {
  527. brushType: 'stroke',
  528. },
  529. hoverAnimation: true,
  530. label: {
  531. normal: {
  532. formatter: '{b}',
  533. position: 'left',
  534. show: false,
  535. },
  536. },
  537. itemStyle: {
  538. normal: {
  539. color: 'yellow',
  540. shadowBlur: 10,
  541. shadowColor: 'yellow',
  542. },
  543. },
  544. zlevel: 1000,
  545. },
  546. {
  547. name: '线路',
  548. type: 'lines',
  549. zlevel: 2,
  550. effect: {
  551. show: true,
  552. period: 4, //箭头指向速度,值越小速度越快
  553. trailLength: 0.02, //特效尾迹长度[0,1]值越大,尾迹越长重
  554. symbol: 'arrow', //箭头图标
  555. symbolSize: 5, //图标大小
  556. },
  557. lineStyle: {
  558. normal: {
  559. color: '#00FFFF',
  560. width: 1,
  561. type: 'dashed',
  562. opacity: 0.5, //尾迹线条透明度
  563. curveness: -0.3, //尾迹线条曲直度
  564. },
  565. },
  566. data: moveLine.normal,
  567. },
  568. ],
  569. }
  570. let that = this
  571. myChart.on('click', function (params) {
  572. console.log(params)
  573. if (params.name == '太原市') {
  574. that.showTip = true
  575. }
  576. // window.open('https://www.baidu.com')
  577. })
  578. tools.loopShowTooltip(myChart, option, {
  579. interval: 2000,
  580. loopSeries: false,
  581. });
  582. myChart.setOption(option)
  583. },
  584. // initChartTip(){
  585. // let myChart = echarts.init(this.$refs['echartTip'])
  586. // let option = {
  587. // tooltip: {
  588. // trigger: 'item',
  589. // },
  590. // color: ['#6682f5', '#69c0ff', '#43ede3','#8ba2ff'],
  591. // legend: {
  592. // top: '0',
  593. // orient: 'vertical',
  594. // left: '2%',
  595. // textStyle: {
  596. // color: '#9DB9EB',
  597. // },
  598. // },
  599. // series: [
  600. // {
  601. // name: '',
  602. // type: 'pie',
  603. // center: ['45%','40%'],
  604. // radius: ['35%', '50%'],
  605. // labelLine: {
  606. // normal: {
  607. // lineStyle: {
  608. // width: 1,
  609. // },
  610. // },
  611. // },
  612. // data: statusList,
  613. // },
  614. // ],
  615. // }
  616. // myChart.setOption(option)
  617. // tools.loopShowTooltip(myChart, option, {
  618. // nterval: 2000,
  619. // loopSeries: true,
  620. // })
  621. // myChart.on('click', function(param) {
  622. // console.log(param)
  623. // window.open('https://www.baidu.com')
  624. // })
  625. // },
  626. initChartTip2 () {
  627. let myChart = echarts.init(this.$refs['echartTip2'])
  628. let option = {
  629. tooltip: {
  630. trigger: 'axis',
  631. axisPointer: {
  632. type: 'cross',
  633. },
  634. },
  635. // dataZoom:[
  636. // {
  637. // // start: 9,//默认为@
  638. // // end: 100,//黑认认为1@0
  639. // type: "slider",
  640. // show: true,
  641. // // xAxisIndex: [0]
  642. // handlesize: 0,//滑动条的 左右2个滑动条的大小
  643. // startValue: 9,// 初始显示值
  644. // endValue: 6,// 结束显示值
  645. // height: 10,//组件高度
  646. // left:"5%",
  647. // right: "4%",//右边的距离
  648. // bottom: "25%",//底边的距离
  649. // borderColor:"#939",
  650. // fillerColor:"#269cdb",
  651. // borderRadius: 5,
  652. // backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
  653. // showDataShadow: false,//是否显示数据阴影
  654. // showDetail: false,//即拖拽时候是否显示详细数值信息
  655. // truerealtime: false,//是否实时更新
  656. // filterMode: "filter"
  657. // },{
  658. // type:'inside',
  659. // show: true,
  660. // start: 1,
  661. // end: 100
  662. // }
  663. // ],
  664. grid: {
  665. top: '10%',
  666. right: '3%',
  667. left: '10%',
  668. bottom: '30%',
  669. },
  670. legend: {
  671. top: '1',
  672. right: '20',
  673. textStyle: {
  674. color: 'rgba(250,250,250,0.6)',
  675. },
  676. },
  677. xAxis: {
  678. data: tipData.map(item => item.name),
  679. axisLine: {
  680. show: true, //隐藏X轴轴线
  681. lineStyle: {
  682. color: '#005094',
  683. width: 1,
  684. },
  685. },
  686. axisTick: {
  687. show: false, //隐藏X轴刻度
  688. },
  689. axisLabel: {
  690. show: true,
  691. rotate: 40,
  692. textStyle: {
  693. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  694. },
  695. },
  696. },
  697. yAxis: [
  698. {
  699. type: 'value',
  700. nameTextStyle: {
  701. color: '#ebf8ac',
  702. },
  703. splitLine: {
  704. show: true,
  705. lineStyle: {
  706. color: '#68b4dd66',
  707. type: 'dashed',
  708. },
  709. },
  710. axisLine: {
  711. show: true,
  712. lineStyle: {
  713. color: '#3D7495',
  714. },
  715. },
  716. axisLabel: {
  717. show: true,
  718. formatter: '{value} 亿',
  719. textStyle: {
  720. color: 'rgba(250,250,250,0.6)',
  721. },
  722. },
  723. },
  724. ],
  725. series: [
  726. {
  727. name: '投资金额',
  728. type: 'bar',
  729. barWidth: 15,
  730. itemStyle: {
  731. normal: {
  732. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  733. {
  734. offset: 0,
  735. color: '#69c0ff',
  736. },
  737. {
  738. offset: 1,
  739. color: '#082550',
  740. },
  741. ]),
  742. },
  743. },
  744. data: tipData.map(item => item.value),
  745. },
  746. // {
  747. // name: '实际投资',
  748. // type: 'bar',
  749. // barWidth: 10,
  750. // itemStyle: {
  751. // normal: {
  752. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  753. // {
  754. // offset: 0,
  755. // color: '#957DFF',
  756. // },
  757. // {
  758. // offset: 1,
  759. // color: '#082550',
  760. // },
  761. // ]),
  762. // },
  763. // },
  764. // data: executeList.map(item=>item.value2),
  765. // },
  766. ],
  767. }
  768. myChart.on('click', function (data) {
  769. if (data.name == '交控集团') {
  770. window.location.href = './investHomeChild.html?type=1'
  771. }
  772. })
  773. tools.loopShowTooltip(myChart, option, {
  774. nterval: 2000,
  775. loopSeries: true,
  776. })
  777. myChart.setOption(option)
  778. },
  779. initChartTip3 () {
  780. let myChart = echarts.init(this.$refs['echartTip3'])
  781. let option = {
  782. title: {
  783. //text : '产业类别',
  784. x: 'center',
  785. textStyle: {
  786. color: '#fff'
  787. }
  788. },
  789. tooltip: {
  790. trigger: 'axis',
  791. axisPointer: {
  792. type: 'cross',
  793. },
  794. },
  795. grid: {
  796. top: '15%',
  797. right: '3%',
  798. left: '10%',
  799. bottom: '30%',
  800. },
  801. legend: {
  802. top: '1',
  803. right: '15',
  804. textStyle: {
  805. color: 'rgba(250,250,250,0.6)',
  806. },
  807. },
  808. xAxis: {
  809. data: tipTopData.map(item => item.name),
  810. axisLine: {
  811. show: true, //隐藏X轴轴线
  812. lineStyle: {
  813. color: '#005094',
  814. width: 1,
  815. },
  816. },
  817. axisTick: {
  818. show: false, //隐藏X轴刻度
  819. },
  820. axisLabel: {
  821. show: true,
  822. rotate: 30,
  823. textStyle: {
  824. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  825. },
  826. },
  827. },
  828. yAxis: [
  829. {
  830. type: 'value',
  831. nameTextStyle: {
  832. color: '#ebf8ac',
  833. },
  834. splitLine: {
  835. show: true,
  836. lineStyle: {
  837. color: '#68b4dd66',
  838. type: 'dashed',
  839. },
  840. },
  841. axisLine: {
  842. show: true,
  843. lineStyle: {
  844. color: '#3D7495',
  845. },
  846. },
  847. axisLabel: {
  848. show: true,
  849. formatter: '{value} 亿',
  850. textStyle: {
  851. color: 'rgba(250,250,250,0.6)',
  852. },
  853. },
  854. },
  855. ],
  856. series: [
  857. {
  858. name: '2022年投资完成额',
  859. type: 'line',
  860. barWidth: 15,
  861. itemStyle: {
  862. normal: {
  863. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  864. {
  865. offset: 0,
  866. color: '#69c0ff',
  867. },
  868. {
  869. offset: 1,
  870. color: '#69c0ff',
  871. },
  872. ]),
  873. },
  874. },
  875. data: tipTopData.map(item => item.value),
  876. },
  877. // {
  878. // name: '实际投资',
  879. // type: 'bar',
  880. // barWidth: 10,
  881. // itemStyle: {
  882. // normal: {
  883. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  884. // {
  885. // offset: 0,
  886. // color: '#957DFF',
  887. // },
  888. // {
  889. // offset: 1,
  890. // color: '#082550',
  891. // },
  892. // ]),
  893. // },
  894. // },
  895. // data: executeList.map(item=>item.value2),
  896. // },
  897. ],
  898. }
  899. myChart.setOption(option)
  900. tools.loopShowTooltip(myChart, option, {
  901. nterval: 2000,
  902. loopSeries: true,
  903. })
  904. },
  905. initChartTip4 () {
  906. let myChart = echarts.init(this.$refs['echartTip4'])
  907. let option = {
  908. title: {
  909. //text : '投资项目列表',
  910. x: 'center',
  911. textStyle: {
  912. color: '#fff'
  913. }
  914. },
  915. tooltip: {
  916. trigger: 'axis',
  917. axisPointer: {
  918. type: 'cross',
  919. },
  920. },
  921. // dataZoom:[
  922. // {
  923. // // start: 9,//默认为@
  924. // // end: 100,//黑认认为1@0
  925. // type: "slider",
  926. // show: true,
  927. // // xAxisIndex: [0]
  928. // handlesize: 0,//滑动条的 左右2个滑动条的大小
  929. // startValue: 9,// 初始显示值
  930. // endValue: 6,// 结束显示值
  931. // height: 10,//组件高度
  932. // left:"5%",
  933. // right: "4%",//右边的距离
  934. // bottom: "25%",//底边的距离
  935. // borderColor:"#939",
  936. // fillerColor:"#269cdb",
  937. // borderRadius: 5,
  938. // backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
  939. // showDataShadow: false,//是否显示数据阴影
  940. // showDetail: false,//即拖拽时候是否显示详细数值信息
  941. // truerealtime: false,//是否实时更新
  942. // filterMode: "filter"
  943. // },{
  944. // type:'inside',
  945. // show: true,
  946. // start: 1,
  947. // end: 100
  948. // }
  949. // ],
  950. grid: {
  951. top: '15%',
  952. right: '3%',
  953. left: '10%',
  954. bottom: '20%',
  955. },
  956. legend: {
  957. top: '0',
  958. right: '20',
  959. textStyle: {
  960. color: 'rgba(250,250,250,0.6)',
  961. },
  962. },
  963. xAxis: {
  964. data: tipBottomData.map(item => item.name),
  965. axisLine: {
  966. show: true, //隐藏X轴轴线
  967. lineStyle: {
  968. color: '#005094',
  969. width: 1,
  970. },
  971. },
  972. axisTick: {
  973. show: false, //隐藏X轴刻度
  974. },
  975. axisLabel: {
  976. show: true,
  977. rotate: 30,
  978. textStyle: {
  979. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  980. },
  981. },
  982. },
  983. yAxis: [
  984. {
  985. type: 'value',
  986. nameTextStyle: {
  987. color: '#ebf8ac',
  988. },
  989. splitLine: {
  990. show: true,
  991. lineStyle: {
  992. color: '#68b4dd66',
  993. type: 'dashed',
  994. },
  995. },
  996. axisLine: {
  997. show: true,
  998. lineStyle: {
  999. color: '#3D7495',
  1000. },
  1001. },
  1002. axisLabel: {
  1003. show: true,
  1004. formatter: '{value} 亿',
  1005. textStyle: {
  1006. color: 'rgba(250,250,250,0.6)',
  1007. },
  1008. },
  1009. },
  1010. ],
  1011. series: [
  1012. {
  1013. name: '2022年投资完成额',
  1014. type: 'bar',
  1015. barWidth: 15,
  1016. itemStyle: {
  1017. normal: {
  1018. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1019. {
  1020. offset: 0,
  1021. color: '#69c0ff',
  1022. },
  1023. {
  1024. offset: 1,
  1025. color: '#082550',
  1026. },
  1027. ]),
  1028. },
  1029. },
  1030. data: tipBottomData.map(item => item.value),
  1031. },
  1032. ],
  1033. }
  1034. myChart.on('click', function (data) {
  1035. if (data.name == '华阳新材') {
  1036. window.location.href = './investHomeChild.html?type=2'
  1037. }
  1038. })
  1039. myChart.setOption(option)
  1040. tools.loopShowTooltip(myChart, option, {
  1041. nterval: 2000,
  1042. loopSeries: true,
  1043. })
  1044. },
  1045. initChartL1 () {
  1046. let myChart = echarts.init(this.$refs['echartR1'])
  1047. function getParametricEquation (startRatio, endRatio, isSelected, isHovered, k, h) {
  1048. // 计算
  1049. let midRatio = (startRatio + endRatio) / 2;
  1050. let startRadian = startRatio * Math.PI * 2;
  1051. let endRadian = endRatio * Math.PI * 2;
  1052. let midRadian = midRatio * Math.PI * 2;
  1053. // 如果只有一个扇形,则不实现选中效果。
  1054. if (startRatio === 0 && endRatio === 1) {
  1055. isSelected = false;
  1056. }
  1057. // 通过扇形内径/外径的值,换算出辅助参数 k(默认值 1/3)
  1058. k = typeof k !== 'undefined' ? k : 1 / 3;
  1059. // 计算选中效果分别在 x 轴、y 轴方向上的位移(未选中,则位移均为 0)
  1060. let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
  1061. let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
  1062. // 计算高亮效果的放大比例(未高亮,则比例为 1)
  1063. let hoverRate = isHovered ? 1.15 : 1;
  1064. // 返回曲面参数方程
  1065. return {
  1066. u: {
  1067. min: -Math.PI,
  1068. max: Math.PI * 3,
  1069. step: Math.PI / 32
  1070. },
  1071. v: {
  1072. min: 0,
  1073. max: Math.PI * 2,
  1074. step: Math.PI / 20
  1075. },
  1076. x: function (u, v) {
  1077. if (u < startRadian) {
  1078. return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  1079. }
  1080. if (u > endRadian) {
  1081. return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  1082. }
  1083. return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate;
  1084. },
  1085. y: function (u, v) {
  1086. if (u < startRadian) {
  1087. return offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  1088. }
  1089. if (u > endRadian) {
  1090. return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  1091. }
  1092. return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
  1093. },
  1094. z: function (u, v) {
  1095. if (u < -Math.PI * 0.5) {
  1096. return Math.sin(u);
  1097. }
  1098. if (u > Math.PI * 2.5) {
  1099. return Math.sin(u) * h * .1;
  1100. }
  1101. return Math.sin(v) > 0 ? 1 * h * .1 : -1;
  1102. }
  1103. };
  1104. }
  1105. // 生成模拟 3D 饼图的配置项
  1106. function getPie3D (pieData, internalDiameterRatio) {
  1107. let series = [];
  1108. let sumValue = 0;
  1109. let startValue = 0;
  1110. let endValue = 0;
  1111. let legendData = [];
  1112. let k = typeof internalDiameterRatio !== 'undefined' ? (1 - internalDiameterRatio) / (1 + internalDiameterRatio) : 1 / 3;
  1113. // 为每一个饼图数据,生成一个 series-surface 配置
  1114. for (let i = 0; i < pieData.length; i++) {
  1115. sumValue += pieData[i].value;
  1116. let seriesItem = {
  1117. name: typeof pieData[i].name === 'undefined' ? `series${i}` : pieData[i].name,
  1118. type: 'surface',
  1119. parametric: true,
  1120. wireframe: {
  1121. show: false
  1122. },
  1123. pieData: pieData[i],
  1124. pieStatus: {
  1125. selected: false,
  1126. hovered: false,
  1127. k: k
  1128. },
  1129. labelLine: {
  1130. color: "#f00",
  1131. emphasis: {
  1132. show: true
  1133. }
  1134. },
  1135. };
  1136. if (typeof pieData[i].itemStyle != 'undefined') {
  1137. let itemStyle = {};
  1138. typeof pieData[i].itemStyle.color != 'undefined' ? itemStyle.color = pieData[i].itemStyle.color : null;
  1139. typeof pieData[i].itemStyle.opacity != 'undefined' ? itemStyle.opacity = pieData[i].itemStyle.opacity : null;
  1140. pieData[i].normal = {
  1141. borderColor: 'rgba(1,31,6,0.7)',
  1142. borderWidth: 4
  1143. }
  1144. seriesItem.itemStyle = itemStyle;
  1145. }
  1146. series.push(seriesItem);
  1147. }
  1148. // 使用上一次遍历时,计算出的数据和 sumValue,调用 getParametricEquation 函数,
  1149. // 向每个 series-surface 传入不同的参数方程 series-surface.parametricEquation,也就是实现每一个扇形。
  1150. for (let i = 0; i < series.length; i++) {
  1151. endValue = startValue + series[i].pieData.value;
  1152. series[i].pieData.startRatio = startValue / sumValue;
  1153. series[i].pieData.endRatio = endValue / sumValue;
  1154. series[i].parametricEquation = getParametricEquation(series[i].pieData.startRatio, series[i].pieData.endRatio, false, false, k, series[i].pieData.value);
  1155. startValue = endValue;
  1156. legendData.push(series[i].name);
  1157. }
  1158. // 补充一个透明的圆环,用于支撑高亮功能的近似实现。
  1159. series.push({
  1160. name: 'mouseoutSeries',
  1161. type: 'surface',
  1162. parametric: true,
  1163. wireframe: {
  1164. show: false
  1165. },
  1166. itemStyle: {
  1167. opacity: 0
  1168. },
  1169. parametricEquation: {
  1170. u: {
  1171. min: 0,
  1172. max: Math.PI * 2,
  1173. step: Math.PI / 20
  1174. },
  1175. v: {
  1176. min: 0,
  1177. max: Math.PI,
  1178. step: Math.PI / 20
  1179. },
  1180. x: function (u, v) {
  1181. return Math.sin(v) * Math.sin(u) + Math.sin(u);
  1182. },
  1183. y: function (u, v) {
  1184. return Math.sin(v) * Math.cos(u) + Math.cos(u);
  1185. },
  1186. z: function (u, v) {
  1187. return Math.cos(v) > 0 ? 0.1 : -0.1;
  1188. }
  1189. }
  1190. });
  1191. //console.log(pieData) 线条配置
  1192. // series.push({
  1193. // name: 'pied',
  1194. // type: 'pie',
  1195. // label: {
  1196. // opacity: 1,
  1197. // fontSize: 13,
  1198. // lineHeight: 20,
  1199. // textStyle: {
  1200. // fontSize: 16,
  1201. // },
  1202. // // normal: {
  1203. // // formatter: function (params) {
  1204. // // console.log('par', params)
  1205. // // return params.name
  1206. // // //return `<span style="color:${params.itemStyle.color};">${params.name}:${params.value}</span>`;
  1207. // // },
  1208. // // }
  1209. // },
  1210. // labelLine: {
  1211. // length: 30,
  1212. // length2: 18,
  1213. // },
  1214. // startAngle: -30, //起始角度,支持范围[0, 360]。
  1215. // clockwise: false, //饼图的扇区是否是顺时针排布。上述这两项配置主要是为了对齐3d的样式
  1216. // radius: ['20%', '50%'],
  1217. // center: ['50%', '50%'],
  1218. // data: pieData,
  1219. // itemStyle: {
  1220. // opacity: 0,
  1221. // },
  1222. // });
  1223. // 准备待返回的配置项,把准备好的 legendData、series 传入。
  1224. let option = {
  1225. //animation: false,
  1226. legend: {
  1227. data: legendData,
  1228. top: '5%',
  1229. //orient: 'vertical',
  1230. textStyle: {
  1231. color: '#fff',
  1232. },
  1233. },
  1234. tooltip: {
  1235. formatter: params => {
  1236. if (params.seriesName !== 'mouseoutSeries') {
  1237. return `${params.seriesName}<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>${option.series[params.seriesIndex].pieData.value}`;
  1238. }
  1239. }
  1240. },
  1241. xAxis3D: {
  1242. min: -1,
  1243. max: 1
  1244. },
  1245. yAxis3D: {
  1246. min: -1,
  1247. max: 1
  1248. },
  1249. zAxis3D: {
  1250. min: -1,
  1251. max: 1
  1252. },
  1253. grid3D: {
  1254. show: false,
  1255. boxHeight: 0.4,
  1256. viewControl: {//3d效果可以放大、旋转等,请自己去查看官方配置
  1257. alpha: 40,
  1258. // beta: 40,
  1259. rotateSensitivity: 0,
  1260. zoomSensitivity: 0,
  1261. panSensitivity: 1,
  1262. autoRotate: true
  1263. },
  1264. //后处理特效可以为画面添加高光、景深、环境光遮蔽(SSAO)、调色等效果。可以让整个画面更富有质感。
  1265. postEffect: {//配置这项会出现锯齿,请自己去查看官方配置有办法解决
  1266. enable: true,
  1267. bloom: {
  1268. enable: true,
  1269. bloomIntensity: 0.2
  1270. },
  1271. SSAO: {
  1272. enable: true,
  1273. quality: 'medium',
  1274. radius: 1
  1275. }
  1276. }
  1277. },
  1278. series: series
  1279. };
  1280. return option;
  1281. }
  1282. // 传入数据生成 option
  1283. option = getPie3D([{
  1284. name: '传统产业投资',
  1285. value: 405.29,
  1286. itemStyle: {
  1287. color: '#f77b66'
  1288. }
  1289. }, {
  1290. name: '战略新兴产业投资',
  1291. value: 196.44,
  1292. itemStyle: {
  1293. color: '#3edce0'
  1294. }
  1295. }, {
  1296. name: '基础产业投资',
  1297. value: 722.34,
  1298. itemStyle: {
  1299. color: '#f94e76'
  1300. }
  1301. }], 0.39);
  1302. myChart.setOption(option);
  1303. // tools.loopShowTooltip(myChart, option, {
  1304. // nterval: 2000,
  1305. // loopSeries: true,
  1306. // })
  1307. // 监听鼠标事件,实现饼图选中效果(单选),近似实现高亮(放大)效果。
  1308. let selectedIndex = '';
  1309. let hoveredIndex = '';
  1310. // 监听点击事件,实现选中效果(单选)
  1311. let that = this
  1312. myChart.on('click', function (params) {
  1313. if (option.series[params.seriesIndex].name == '战略新兴产业投资') {
  1314. that.tipTitle2 = option.series[params.seriesIndex].name
  1315. that.showTip2 = true
  1316. }
  1317. // 从 option.series 中读取重新渲染扇形所需的参数,将是否选中取反。
  1318. // let isSelected = !option.series[params.seriesIndex].pieStatus.selected;
  1319. // let isHovered = option.series[params.seriesIndex].pieStatus.hovered;
  1320. // let k = option.series[params.seriesIndex].pieStatus.k;
  1321. // let startRatio = option.series[params.seriesIndex].pieData.startRatio;
  1322. // let endRatio = option.series[params.seriesIndex].pieData.endRatio;
  1323. // // 如果之前选中过其他扇形,将其取消选中(对 option 更新)
  1324. // if (selectedIndex !== '' && selectedIndex !== params.seriesIndex) {
  1325. // option.series[selectedIndex].parametricEquation = getParametricEquation(option.series[selectedIndex].pieData.startRatio, option.series[selectedIndex].pieData.endRatio, false, false, k, option.series[selectedIndex].pieData.value);
  1326. // option.series[selectedIndex].pieStatus.selected = false;
  1327. // }
  1328. // // 对当前点击的扇形,执行选中/取消选中操作(对 option 更新)
  1329. // option.series[params.seriesIndex].parametricEquation = getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, option.series[selectedIndex].pieData.value);
  1330. // option.series[params.seriesIndex].pieStatus.selected = isSelected;
  1331. // // 如果本次是选中操作,记录上次选中的扇形对应的系列号 seriesIndex
  1332. // isSelected ? selectedIndex = params.seriesIndex : null;
  1333. // 使用更新后的 option,渲染图表
  1334. myChart.setOption(option);
  1335. });
  1336. // 监听 mouseover,近似实现高亮(放大)效果
  1337. myChart.on('mouseover', function (params) {
  1338. // 准备重新渲染扇形所需的参数
  1339. let isSelected;
  1340. let isHovered;
  1341. let startRatio;
  1342. let endRatio;
  1343. let k;
  1344. // 如果触发 mouseover 的扇形当前已高亮,则不做操作
  1345. if (hoveredIndex === params.seriesIndex) {
  1346. return;
  1347. // 否则进行高亮及必要的取消高亮操作
  1348. } else {
  1349. // 如果当前有高亮的扇形,取消其高亮状态(对 option 更新)
  1350. if (hoveredIndex !== '') {
  1351. // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 false。
  1352. isSelected = option.series[hoveredIndex].pieStatus.selected;
  1353. isHovered = false;
  1354. startRatio = option.series[hoveredIndex].pieData.startRatio;
  1355. endRatio = option.series[hoveredIndex].pieData.endRatio;
  1356. k = option.series[hoveredIndex].pieStatus.k;
  1357. // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
  1358. option.series[hoveredIndex].parametricEquation = getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, option.series[hoveredIndex].pieData.value);
  1359. option.series[hoveredIndex].pieStatus.hovered = isHovered;
  1360. // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
  1361. hoveredIndex = '';
  1362. }
  1363. // 如果触发 mouseover 的扇形不是透明圆环,将其高亮(对 option 更新)
  1364. if (params.seriesName !== 'mouseoutSeries') {
  1365. // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
  1366. isSelected = option.series[params.seriesIndex].pieStatus.selected;
  1367. isHovered = true;
  1368. startRatio = option.series[params.seriesIndex].pieData.startRatio;
  1369. endRatio = option.series[params.seriesIndex].pieData.endRatio;
  1370. k = option.series[params.seriesIndex].pieStatus.k;
  1371. // 对当前点击的扇形,执行高亮操作(对 option 更新)
  1372. option.series[params.seriesIndex].parametricEquation = getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, option.series[params.seriesIndex].pieData.value + 5);
  1373. option.series[params.seriesIndex].pieStatus.hovered = isHovered;
  1374. // 记录上次高亮的扇形对应的系列号 seriesIndex
  1375. hoveredIndex = params.seriesIndex;
  1376. }
  1377. // 使用更新后的 option,渲染图表
  1378. myChart.setOption(option);
  1379. }
  1380. });
  1381. // 修正取消高亮失败的 bug
  1382. myChart.on('globalout', function () {
  1383. if (hoveredIndex !== '') {
  1384. // 从 option.series 中读取重新渲染扇形所需的参数,将是否高亮设置为 true。
  1385. isSelected = option.series[hoveredIndex].pieStatus.selected;
  1386. isHovered = false;
  1387. k = option.series[hoveredIndex].pieStatus.k;
  1388. startRatio = option.series[hoveredIndex].pieData.startRatio;
  1389. endRatio = option.series[hoveredIndex].pieData.endRatio;
  1390. // 对当前点击的扇形,执行取消高亮操作(对 option 更新)
  1391. option.series[hoveredIndex].parametricEquation = getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, option.series[hoveredIndex].pieData.value);
  1392. option.series[hoveredIndex].pieStatus.hovered = isHovered;
  1393. // 将此前记录的上次选中的扇形对应的系列号 seriesIndex 清空
  1394. hoveredIndex = '';
  1395. }
  1396. // 使用更新后的 option,渲染图表
  1397. myChart.setOption(option);
  1398. });
  1399. //var zrender = myChart.getZrender();
  1400. //var elements = zrender.storage._elements;
  1401. console.log('66', myChart);
  1402. },
  1403. // initChartL1 () {
  1404. // let myChart = echarts.init(this.$refs['echartR1'])
  1405. // let option = {
  1406. // tooltip: {
  1407. // trigger: 'item',
  1408. // formatter: params => {
  1409. // return `<span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${params.color}"></span> ${params.name}:${params.value} <br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${params.color}"></span> 投资占比:${params.percent}%`
  1410. // }, //+ '<br/>'+ '{a1}:{c1}' + '%',
  1411. // axisPointer: {
  1412. // type: 'cross',
  1413. // },
  1414. // },
  1415. // color: ['#6682f5', '#69c0ff', '#43ede3', '#8ba2ff'],
  1416. // legend: {
  1417. // top: 'center',
  1418. // orient: 'vertical',
  1419. // right: '2%',
  1420. // textStyle: {
  1421. // color: '#9DB9EB',
  1422. // },
  1423. // },
  1424. // series: [
  1425. // // {
  1426. // // hoverOffset: 0,
  1427. // // startAngle: 90,
  1428. // // type: "pie",
  1429. // // radius: [48, 55],
  1430. // // center: ["50%", "50%"],
  1431. // // itemStyle: {
  1432. // // normal: {
  1433. // // borderColor: 'rgba(1,31,6,0.7)',
  1434. // // borderWidth: 4
  1435. // // }
  1436. // // },
  1437. // // tooltip: {
  1438. // // show: false
  1439. // // },
  1440. // // labelLine: {
  1441. // // show: false
  1442. // // },
  1443. // // label: {
  1444. // // show: false
  1445. // // },
  1446. // // data: industryList
  1447. // // },
  1448. // {
  1449. // name: '',
  1450. // type: 'pie',
  1451. // radius: ['55%', '80%'],
  1452. // itemStyle: {
  1453. // normal: {
  1454. // borderColor: 'rgba(1,31,64,0.7)',
  1455. // borderWidth: 6
  1456. // }
  1457. // },
  1458. // labelLine: {
  1459. // normal: {
  1460. // lineStyle: {
  1461. // width: 1,
  1462. // },
  1463. // },
  1464. // },
  1465. // data: industryList,
  1466. // },
  1467. // ],
  1468. // }
  1469. // let that = this
  1470. // myChart.on('click', function (param) {
  1471. // console.log(param)
  1472. // if (param.name == '战略新兴产业投资') {
  1473. // that.tipTitle2 = param.name
  1474. // that.showTip2 = true
  1475. // }
  1476. // })
  1477. // myChart.setOption(option)
  1478. // tools.loopShowTooltip(myChart, option, {
  1479. // nterval: 2000,
  1480. // loopSeries: true,
  1481. // })
  1482. // },
  1483. initChartL2 () {
  1484. let myChart = echarts.init(this.$refs['echartL2'])
  1485. let option = {
  1486. tooltip: {
  1487. trigger: 'axis',
  1488. axisPointer: {
  1489. type: 'cross',
  1490. },
  1491. },
  1492. grid: {
  1493. top: '16%',
  1494. right: '3%',
  1495. left: '10%',
  1496. bottom: '23%',
  1497. },
  1498. legend: {
  1499. top: '1',
  1500. right: '10',
  1501. textStyle: {
  1502. color: 'rgba(250,250,250,0.6)',
  1503. },
  1504. },
  1505. xAxis: {
  1506. data: executeList.map(item => item.name),
  1507. axisLine: {
  1508. show: true, //隐藏X轴轴线
  1509. lineStyle: {
  1510. color: '#005094',
  1511. width: 1,
  1512. },
  1513. },
  1514. axisTick: {
  1515. show: false, //隐藏X轴刻度
  1516. },
  1517. axisLabel: {
  1518. show: true,
  1519. rotate: 40,
  1520. textStyle: {
  1521. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  1522. },
  1523. },
  1524. },
  1525. yAxis: [
  1526. {
  1527. type: 'value',
  1528. nameTextStyle: {
  1529. color: '#ebf8ac',
  1530. },
  1531. splitLine: {
  1532. show: true,
  1533. lineStyle: {
  1534. color: '#68b4dd66',
  1535. type: 'dashed',
  1536. },
  1537. },
  1538. axisLine: {
  1539. show: true,
  1540. lineStyle: {
  1541. color: '#3D7495',
  1542. },
  1543. },
  1544. axisLabel: {
  1545. show: true,
  1546. textStyle: {
  1547. color: 'rgba(250,250,250,0.6)',
  1548. },
  1549. },
  1550. },
  1551. ],
  1552. series: [
  1553. {
  1554. name: '计划投资',
  1555. type: 'bar',
  1556. barWidth: 10,
  1557. itemStyle: {
  1558. normal: {
  1559. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1560. {
  1561. offset: 0,
  1562. color: '#69c0ff',
  1563. },
  1564. {
  1565. offset: 1,
  1566. color: '#082550',
  1567. },
  1568. ]),
  1569. },
  1570. },
  1571. data: executeList.map(item => item.value),
  1572. },
  1573. {
  1574. name: '实际投资',
  1575. type: 'bar',
  1576. barWidth: 10,
  1577. itemStyle: {
  1578. normal: {
  1579. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1580. {
  1581. offset: 0,
  1582. color: '#957DFF',
  1583. },
  1584. {
  1585. offset: 1,
  1586. color: '#082550',
  1587. },
  1588. ]),
  1589. },
  1590. },
  1591. data: executeList.map(item => item.value2),
  1592. },
  1593. ],
  1594. }
  1595. myChart.setOption(option)
  1596. tools.loopShowTooltip(myChart, option, {
  1597. nterval: 2000,
  1598. loopSeries: true,
  1599. })
  1600. },
  1601. initChartR1 () {
  1602. let myChart = echarts.init(this.$refs['echartL1'])
  1603. let option = {
  1604. tooltip: {
  1605. trigger: 'axis',
  1606. formatter: '{a0}:{c0}' + '亿元', //+ '<br/>'+ '{a1}:{c1}' + '%',
  1607. axisPointer: {
  1608. type: 'cross',
  1609. },
  1610. },
  1611. grid: {
  1612. top: '16%',
  1613. right: '10%',
  1614. left: '10%',
  1615. bottom: '22%',
  1616. },
  1617. // legend: {
  1618. // top: '1',
  1619. // textStyle: {
  1620. // color: 'rgba(250,250,250,0.6)',
  1621. // },
  1622. // },
  1623. xAxis: {
  1624. data: statusList.map(item => item.name),
  1625. axisLine: {
  1626. show: true, //隐藏X轴轴线
  1627. lineStyle: {
  1628. color: '#005094',
  1629. width: 1,
  1630. },
  1631. },
  1632. axisTick: {
  1633. show: false, //隐藏X轴刻度
  1634. },
  1635. axisLabel: {
  1636. show: true,
  1637. rotate: 20,
  1638. textStyle: {
  1639. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  1640. },
  1641. },
  1642. },
  1643. yAxis: [
  1644. {
  1645. type: 'value',
  1646. name: '亿元',
  1647. nameTextStyle: {
  1648. color: 'rgba(255,255,255,0.6)',
  1649. },
  1650. splitLine: {
  1651. show: true,
  1652. lineStyle: {
  1653. color: '#68b4dd66',
  1654. type: 'dashed',
  1655. },
  1656. },
  1657. axisLine: {
  1658. show: true,
  1659. lineStyle: {
  1660. color: '#3D7495',
  1661. },
  1662. },
  1663. axisLabel: {
  1664. show: true,
  1665. textStyle: {
  1666. color: 'rgba(250,250,250,0.6)',
  1667. },
  1668. },
  1669. },
  1670. {
  1671. type: 'value',
  1672. axisLine: {
  1673. show: false,
  1674. },
  1675. splitLine: {
  1676. show: false,
  1677. },
  1678. axisLabel: {
  1679. show: true,
  1680. formatter: '{value} %',
  1681. textStyle: {
  1682. color: 'rgba(250,250,250,0.6)',
  1683. },
  1684. },
  1685. },
  1686. ],
  1687. series: [
  1688. {
  1689. type: 'bar',
  1690. name: '投资金额',
  1691. barWidth: 15,
  1692. itemStyle: {
  1693. normal: {
  1694. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1695. {
  1696. offset: 0,
  1697. color: '#69c0ff',
  1698. },
  1699. {
  1700. offset: 1,
  1701. color: '#082550',
  1702. },
  1703. ]),
  1704. },
  1705. },
  1706. data: statusList.map(item => item.value),
  1707. },
  1708. ],
  1709. }
  1710. myChart.setOption(option)
  1711. tools.loopShowTooltip(myChart, option, {
  1712. nterval: 2000,
  1713. loopSeries: true,
  1714. })
  1715. },
  1716. initProjectList () {
  1717. let dataList = []
  1718. projectList.map(item => {
  1719. dataList.push([item.name, item.office, item.value + '亿', item.status])
  1720. })
  1721. this.storageRecordConfig = {
  1722. header: ['项目名称', '企业集团', '投资金额', '项目进度'],
  1723. headerBGC: '#05507b33',
  1724. oddRowBGC: '#05507b33',
  1725. evenRowBGC: '',
  1726. headerHeight: '40',
  1727. rowNum: 5,
  1728. //columnWidth: [150],
  1729. align: ['center', 'center', 'center', 'center'],
  1730. data: dataList,
  1731. }
  1732. }
  1733. },
  1734. })