index.js 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. leftEcharts1: '',
  6. leftEcharts2: '',
  7. leftEcharts3: '',
  8. leftEcharts4: '',
  9. leftEcharts5: '',
  10. leftEcharts6: '',
  11. leftEcharts7: '',
  12. leftEcharts8: '',
  13. shanxiMap: '',// 山西地图
  14. industryProportion: 1, // 主辅业占比轮播
  15. industryLayout: 0,//产业布局分析
  16. time1: '', // 4秒定时器
  17. time2: '', // 针对投前产业布局分析的定时器
  18. meansList: [
  19. {
  20. label: "初步设计",
  21. value: "106",
  22. },
  23. {
  24. label: "详细设计",
  25. value: "103",
  26. },
  27. {
  28. label: "施工",
  29. value: "62",
  30. },
  31. {
  32. label: "完工",
  33. value: "35",
  34. },
  35. {
  36. label: "验收",
  37. value: "42",
  38. },
  39. {
  40. label: "结算",
  41. value: "33",
  42. },
  43. ],
  44. costList: [
  45. {
  46. num: 160,
  47. value: 284,
  48. status: "正偏差",
  49. },
  50. {
  51. num: 280,
  52. value: 129,
  53. status: "容差内",
  54. },
  55. {
  56. num: 103,
  57. value: 1082,
  58. status: "负偏差",
  59. },
  60. ],
  61. investData: {
  62. investList: [
  63. {
  64. name: "大地控股",
  65. yse: "26.79",
  66. yqhte: "9.64",
  67. czrde: "121.59",
  68. jse: "120.13",
  69. fke: "36.4",
  70. url: "./img/logos/logo15.png",
  71. },
  72. {
  73. name: "云时代",
  74. yse: "21.79",
  75. yqhte: "9.64",
  76. czrde: "121.59",
  77. jse: "120.13",
  78. fke: "36.4",
  79. url: "./img/logos/logo16.png",
  80. },
  81. {
  82. name: "华舰体育",
  83. yse: "26.79",
  84. yqhte: "9.64",
  85. czrde: "121.59",
  86. jse: "120.13",
  87. fke: "36.4",
  88. url: "./img/logos/logo17.png",
  89. },
  90. {
  91. name: "神农科技",
  92. yse: "26.79",
  93. yqhte: "9.64",
  94. czrde: "121.59",
  95. jse: "120.13",
  96. fke: "36.4",
  97. url: "./img/logos/logo18.png",
  98. },
  99. {
  100. name: "山西焦煤",
  101. yse: "26.79",
  102. yqhte: "9.64",
  103. czrde: "121.59",
  104. jse: "120.13",
  105. fke: "36.4",
  106. url: "./img/logos/logo1.png",
  107. },
  108. {
  109. name: "晋能控股",
  110. yse: "26.79",
  111. yqhte: "9.64",
  112. czrde: "121.59",
  113. jse: "120.13",
  114. fke: "36.4",
  115. url: "./img/logos/logo2.png",
  116. },
  117. {
  118. name: "华阳新材",
  119. yse: "26.79",
  120. yqhte: "9.64",
  121. czrde: "121.59",
  122. jse: "120.13",
  123. fke: "36.4",
  124. url: "./img/logos/logo3.png",
  125. },
  126. {
  127. name: "潞安化工",
  128. yse: "26.79",
  129. yqhte: "9.64",
  130. czrde: "121.59",
  131. jse: "120.13",
  132. fke: "36.4",
  133. url: "./img/logos/logo4.png",
  134. },
  135. {
  136. name: "华新燃气",
  137. yse: "26.79",
  138. yqhte: "9.64",
  139. czrde: "121.59",
  140. jse: "120.13",
  141. fke: "36.4",
  142. url: "./img/logos/logo5.png",
  143. },
  144. {
  145. name: "太重集团",
  146. yse: "26.79",
  147. yqhte: "9.64",
  148. czrde: "121.59",
  149. jse: "120.13",
  150. fke: "36.4",
  151. url: "./img/logos/logo6.png",
  152. },
  153. {
  154. name: "国际能源",
  155. yse: "26.79",
  156. yqhte: "9.64",
  157. czrde: "121.59",
  158. jse: "120.13",
  159. fke: "36.4",
  160. url: "./img/logos/logo7.png",
  161. },
  162. {
  163. name: "华远陆港",
  164. yse: "26.79",
  165. yqhte: "9.64",
  166. czrde: "121.59",
  167. jse: "120.13",
  168. fke: "36.4",
  169. url: "./img/logos/logo8.png",
  170. },
  171. {
  172. name: "水控集团",
  173. yse: "26.79",
  174. yqhte: "9.64",
  175. czrde: "121.59",
  176. jse: "120.13",
  177. fke: "36.4",
  178. url: "./img/logos/logo9.png",
  179. },
  180. {
  181. name: "文旅集团",
  182. yse: "26.79",
  183. yqhte: "9.64",
  184. czrde: "121.59",
  185. jse: "120.13",
  186. fke: "36.4",
  187. url: "./img/logos/logo10.png",
  188. },
  189. {
  190. name: "交控集团",
  191. yse: "26.79",
  192. yqhte: "9.64",
  193. czrde: "121.59",
  194. jse: "120.13",
  195. fke: "36.4",
  196. url: "./img/logos/logo11.png",
  197. },
  198. {
  199. name: "航产集团",
  200. yse: "26.79",
  201. yqhte: "9.64",
  202. czrde: "121.59",
  203. jse: "120.13",
  204. fke: "36.4",
  205. url: "./img/logos/logo12.png",
  206. },
  207. {
  208. name: "山西建投",
  209. yse: "26.79",
  210. yqhte: "9.64",
  211. czrde: "121.59",
  212. jse: "120.13",
  213. fke: "36.4",
  214. url: "./img/logos/logo13.png",
  215. },
  216. {
  217. name: "汾酒集团",
  218. yse: "26.79",
  219. yqhte: "9.64",
  220. czrde: "121.59",
  221. jse: "120.13",
  222. fke: "36.4",
  223. url: "./img/logos/logo14.png",
  224. },
  225. ],
  226. },
  227. inner: 0,
  228. innerDeg: 0,
  229. timer: null,
  230. witchs: 0,
  231. topIndex: 0,
  232. }
  233. },
  234. created () {
  235. },
  236. beforeDestroy () {
  237. clearInterval(this.timer);
  238. },
  239. mounted () {
  240. this.time4s()
  241. this.timeNs()
  242. this.filterLpData();
  243. this.lpRotate();
  244. setTimeout(() => {
  245. this.leftEcharts1Fun()
  246. this.leftEcharts2Fun()
  247. this.leftEcharts3Fun()
  248. this.leftEcharts4Fun()
  249. this.leftEcharts5Fun()
  250. this.leftEcharts6Fun()
  251. this.leftEcharts7Fun()
  252. this.leftEcharts8Fun()
  253. this.chinaEchartsFun()
  254. this.initChartR1();
  255. this.initChartR2();
  256. })
  257. },
  258. methods: {
  259. initChartR1 () {
  260. let that = this;
  261. let sumA = 42;
  262. let right5 = [[1, 2, 3, 4, 5, 6]];
  263. let commonCompany = [
  264. "山西焦煤",
  265. "山西焦煤",
  266. "山西焦煤",
  267. "山西焦煤",
  268. "山西焦煤",
  269. "山西焦煤",
  270. ];
  271. // 所有在100范围外的全部变成0,其他值相应增加/减少sumA
  272. // right5.forEach((item) => {
  273. // item.forEach((item2) => {
  274. // if (Number(item2[1]) < 0) {
  275. // item2[1] = that.$set(item2, 1, Number(that.numSub(item2[1], sumA)));
  276. // } else if (Number(item2[1]) > 0) {
  277. // item2[1] = that.$set(item2, 1, Number(item2[1]) + sumA);
  278. // }
  279. // if (Number(item2[1]) < -100 - sumA) {
  280. // item2[1] = that.$set(item2, 1, 0);
  281. // item2[1] = that.$set(item2, 2, 0);
  282. // } else if (Number(item2[1]) > 100 + sumA) {
  283. // item2[1] = that.$set(item2, 1, 0);
  284. // item2[1] = that.$set(item2, 2, 0);
  285. // }
  286. // });
  287. // });
  288. const itemStyle = {
  289. // opacity: 0.8,
  290. shadowBlur: 10,
  291. shadowOffsetX: 0,
  292. shadowOffsetY: 0,
  293. shadowColor: "rgba(0,0,0,0.3)",
  294. };
  295. that.right2Chart = echarts.init(this.$refs["echartR1"]);
  296. that.right2Chart.on("showTip", (params) => {
  297. // 如果是7或者15并且满足防抖则切换
  298. if (
  299. (params.dataIndex == 5 || params.dataIndex == 11) &&
  300. that.echartR2Fd
  301. ) {
  302. that.echartR2Fd = false;
  303. setTimeout(() => {
  304. option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6;
  305. option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6;
  306. that.right2Chart.setOption(option);
  307. // 防止勿刷新做的防抖
  308. setTimeout(() => {
  309. that.echartR2Fd = true;
  310. }, 2000);
  311. }, 1900);
  312. // 如果是17表示到了最后一个,那么重新来一遍
  313. } else if (params.dataIndex == 17 && that.echartR2Fd) {
  314. that.echartR2Fd = false;
  315. setTimeout(() => {
  316. option.dataZoom[0].endValue = 0;
  317. option.dataZoom[0].startValue = 5;
  318. that.right2Chart.setOption(option);
  319. // 防止勿刷新做的防抖
  320. setTimeout(() => {
  321. that.echartR2Fd = true;
  322. }, 2000);
  323. }, 1900);
  324. }
  325. });
  326. let option = {
  327. color: ["#04635E", "#697143", "#4A3042"],
  328. dataZoom: [
  329. {
  330. // start: 9,//默认为@
  331. // end: 100,//黑认认为1@0
  332. type: "slider",
  333. show: false,
  334. // xAxisIndex: [0]
  335. handlesize: 0, //滑动条的 左右2个滑动条的大小
  336. startValue: 5, // 初始显示值
  337. endValue: 0, // 结束显示值
  338. height: 10, //组件高度
  339. left: "5%",
  340. right: "4%", //右边的距离
  341. bottom: "25%", //底边的距离
  342. borderColor: "#939",
  343. fillerColor: "#269cdb",
  344. borderRadius: 5,
  345. backgroundColor: "#33384b", //两边未选中的滑动条区域的额色
  346. showDataShadow: false, //是否显示数据阴影
  347. showDetail: false, //即拖拽时候是否显示详细数值信息
  348. truerealtime: true, //是否实时更新
  349. filterMode: "filter",
  350. },
  351. {
  352. type: "inside",
  353. show: true,
  354. start: 1,
  355. end: 100,
  356. zoomOnMouseWheel: false, //滚轮是否触发缩放
  357. moveOnMouseMove: false, //鼠标滚轮触发滚动
  358. },
  359. ],
  360. legend: {
  361. selectedMode: false,
  362. top: 10,
  363. right: "6%",
  364. data: ["正偏差", "容差", "负偏差"],
  365. textStyle: {
  366. fontSize: 20,
  367. color: "#fff",
  368. fontFamily: "Microsoft YaHei",
  369. },
  370. },
  371. textStyle: {
  372. color: "#fff",
  373. },
  374. // tooltip: {
  375. // show: true,
  376. // trigger: "axis",
  377. // textStyle: {
  378. // color: "#FFF", // 文字的颜色
  379. // fontSize: "20", // 文字字体大小
  380. // fontFamily: "Microsoft YaHei",
  381. // },
  382. // formatter: (data) => {
  383. // return `${
  384. // data[0].value[0]
  385. // }<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
  386. // data[0].color
  387. // }"></span> ${data[0].seriesName}:${that.numFormat(
  388. // data[0].data[2]
  389. // )}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
  390. // data[1].color
  391. // }"></span> ${data[1].seriesName}:${that.numFormat(
  392. // data[1].data[2]
  393. // )}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
  394. // data[2].color
  395. // }"></span> ${data[2].seriesName}:${that.numFormat(
  396. // data[2].data[2]
  397. // )}亿`;
  398. // },
  399. // axisPointer: {
  400. // // // type: 'cross',',
  401. // },
  402. // },
  403. grid: {
  404. top: "10%",
  405. right: "7%",
  406. left: "7%",
  407. bottom: "6%",
  408. },
  409. yAxis: {
  410. min: -101 - sumA,
  411. max: 101 + sumA,
  412. maxInterval: 1,
  413. splitLine: {
  414. show: false,
  415. // interval:,
  416. lineStyle: {
  417. color: "#68b4dd66",
  418. type: "dashed",
  419. },
  420. },
  421. axisLine: {
  422. show: false,
  423. },
  424. axisTick: {
  425. show: false,
  426. },
  427. axisLabel: {
  428. show: true,
  429. // formatter: '{value}',
  430. formatter (data) {
  431. if (data == 100 + sumA) {
  432. return "100%";
  433. } else if (data == -100 - sumA) {
  434. return "-100%";
  435. } else if (data == -5 - sumA) {
  436. return "-5%";
  437. } else if (data == 5 + sumA) {
  438. return "5%";
  439. }
  440. },
  441. textStyle: {
  442. color: "#fff",
  443. fontSize: "20",
  444. fontFamily: "Microsoft YaHei",
  445. },
  446. },
  447. nameTextStyle: {
  448. color: "#fff",
  449. fontSize: 20,
  450. fontFamily: "Microsoft YaHei",
  451. },
  452. },
  453. xAxis: {
  454. data: commonCompany,
  455. axisLine: {
  456. show: false, //隐藏X轴轴线
  457. lineStyle: {
  458. color: "#005094",
  459. width: 1,
  460. },
  461. },
  462. splitLine: {
  463. show: true,
  464. lineStyle: {
  465. color: "#68b4dd66",
  466. type: "dashed",
  467. },
  468. },
  469. axisTick: {
  470. show: true, //隐藏X轴刻度
  471. },
  472. axisLabel: {
  473. show: true,
  474. rotate: -20,
  475. padding: [0, 0, 0, 0],
  476. textStyle: {
  477. color: "#fff", //X轴文字颜色
  478. fontSize: 20,
  479. fontFamily: "Microsoft YaHei",
  480. },
  481. },
  482. },
  483. series: [
  484. {
  485. name: "正偏差",
  486. type: "scatter",
  487. itemStyle: itemStyle,
  488. data: right5[0],
  489. symbolSize: function (data) {
  490. if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
  491. return 40;
  492. } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
  493. return 70;
  494. } else if (data[2] > 100) {
  495. return 100;
  496. }
  497. },
  498. markLine: {
  499. symbol: "none",
  500. data: [
  501. {
  502. name: "100%",
  503. yAxis: 100 + sumA,
  504. lineStyle: {
  505. // color: '#fff',
  506. },
  507. label: {
  508. show: false,
  509. formatter: "{b}",
  510. position: "right",
  511. color: "#fff",
  512. fontSize: 20,
  513. label: {
  514. show: false,
  515. },
  516. },
  517. },
  518. {
  519. name: "5%",
  520. yAxis: 5 + sumA,
  521. lineStyle: {
  522. // color: '#fff',
  523. },
  524. label: {
  525. show: false,
  526. formatter: "{b}",
  527. position: "right",
  528. color: "#fff",
  529. fontSize: 20,
  530. },
  531. },
  532. {
  533. name: "-5%",
  534. yAxis: -5 - sumA,
  535. lineStyle: {
  536. // color: '#fff',
  537. },
  538. label: {
  539. show: false,
  540. formatter: "{b}",
  541. position: "right",
  542. color: "#fff",
  543. fontSize: 20,
  544. },
  545. },
  546. {
  547. name: "100%",
  548. yAxis: -100 - sumA,
  549. lineStyle: {
  550. // color: '#fff',
  551. },
  552. label: {
  553. show: false,
  554. formatter: "{b}",
  555. position: "right",
  556. color: "#fff",
  557. fontSize: 20,
  558. },
  559. },
  560. ],
  561. },
  562. },
  563. {
  564. name: "容差",
  565. type: "scatter",
  566. itemStyle: itemStyle,
  567. data: right5[1],
  568. symbolSize: function (data) {
  569. if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
  570. return 40;
  571. } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
  572. return 70;
  573. } else if (data[2] > 100) {
  574. return 100;
  575. }
  576. },
  577. },
  578. {
  579. name: "负偏差",
  580. type: "scatter",
  581. itemStyle: itemStyle,
  582. data: right5[2],
  583. symbolSize: function (data) {
  584. if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
  585. return 40;
  586. } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
  587. return 70;
  588. } else if (data[2] > 100) {
  589. return 100;
  590. }
  591. },
  592. },
  593. ],
  594. };
  595. that.right2Chart.on("click", function (param) {
  596. if (that.versions) {
  597. that.rightAdd.modelName = 1;
  598. that.rightAdd.substraction =
  599. param.seriesName == "正偏差"
  600. ? 1
  601. : param.seriesName == "容差"
  602. ? 2
  603. : 3;
  604. that.rightAdd.projectStepCode = "";
  605. that.projectNum = 313;
  606. that.rightPenetrateTwo(
  607. 1,
  608. param.seriesName == "正偏差"
  609. ? 1
  610. : param.seriesName == "容差"
  611. ? 2
  612. : 3,
  613. that.findCode(param.name),
  614. "right"
  615. );
  616. } else {
  617. that.projectListTipShow = true;
  618. }
  619. });
  620. that.right2Chart.setOption(option);
  621. tools.loopShowTooltip(that.right2Chart, option, {
  622. interval: 2000,
  623. loopSeries: true,
  624. });
  625. },
  626. initChartR2 () {
  627. let that = this;
  628. that.right2Chart = echarts.init(this.$refs["echartR2"]);
  629. let option = {
  630. color: [
  631. {
  632. type: "linear",
  633. x: 0,
  634. y: 0,
  635. x2: 0,
  636. y2: 1,
  637. colorStops: [
  638. {
  639. offset: 0,
  640. color: "#91231F", // 0% 处的颜色
  641. },
  642. {
  643. offset: 1,
  644. color: "#F98784", // 100% 处的颜色
  645. },
  646. ],
  647. global: false, // 缺省为 false
  648. },
  649. {
  650. type: "linear",
  651. x: 0,
  652. y: 0,
  653. x2: 0,
  654. y2: 1,
  655. colorStops: [
  656. {
  657. offset: 0,
  658. color: "#9F7F00", // 0% 处的颜色
  659. },
  660. {
  661. offset: 1,
  662. color: "#FBE463", // 100% 处的颜色
  663. },
  664. ],
  665. global: false, // 缺省为 false
  666. },
  667. {
  668. type: "linear",
  669. x: 0,
  670. y: 0,
  671. x2: 0,
  672. y2: 1,
  673. colorStops: [
  674. {
  675. offset: 0,
  676. color: "#07806E", // 0% 处的颜色
  677. },
  678. {
  679. offset: 1,
  680. color: "#79FFEB", // 100% 处的颜色
  681. },
  682. ],
  683. global: false, // 缺省为 false
  684. },
  685. ],
  686. legend: {},
  687. grid: {
  688. left: "3%",
  689. right: "4%",
  690. bottom: "3%",
  691. containLabel: true,
  692. },
  693. xAxis: [
  694. {
  695. type: "category",
  696. data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
  697. },
  698. ],
  699. yAxis: [
  700. {
  701. type: "value",
  702. },
  703. ],
  704. series: [
  705. {
  706. name: "Email",
  707. type: "bar",
  708. stack: "Ad",
  709. barWidth: 14,
  710. emphasis: {
  711. focus: "series",
  712. },
  713. itemStyle: {
  714. barBorderRadius: [15, 15, 15, 15],
  715. },
  716. data: [120, 132, 101, 134, 90, 230, 210],
  717. },
  718. {
  719. name: "Union Ads",
  720. type: "bar",
  721. stack: "Ad",
  722. itemStyle: {
  723. barBorderRadius: [15, 15, 15, 15],
  724. },
  725. emphasis: {
  726. focus: "series",
  727. },
  728. data: [220, 182, 191, 234, 290, 330, 310],
  729. },
  730. {
  731. name: "Video Ads",
  732. type: "bar",
  733. stack: "Ad",
  734. itemStyle: {
  735. barBorderRadius: [15, 15, 15, 15],
  736. },
  737. emphasis: {
  738. focus: "series",
  739. },
  740. data: [150, 232, 201, 154, 190, 330, 410],
  741. },
  742. ],
  743. };
  744. that.right2Chart.setOption(option);
  745. },
  746. clickItem (index) {
  747. console.log(index);
  748. const angle = 360 / this.investData.investList.length;
  749. this.witchs = index;
  750. this.inner = index;
  751. this.innerDeg = this.witchs * angle;
  752. this.lpRotate();
  753. },
  754. lpRotate () {
  755. const angle = 360 / this.investData.investList.length;
  756. clearInterval(this.timer);
  757. this.timer = setInterval(() => {
  758. this.inner++;
  759. this.topIndex++;
  760. this.topIndex = this.topIndex % this.meansList.length;
  761. this.witchs = this.inner % this.investData.investList.length;
  762. this.innerDeg = this.inner * angle;
  763. }, 2000);
  764. },
  765. filterLpData () {
  766. const angle = 360 / this.investData.investList.length;
  767. for (let i in this.investData.investList) {
  768. this.investData.investList[i].deg = i * angle;
  769. this.$set(this.investData.investList, i, {
  770. ...this.investData.investList[i],
  771. deg: i * angle,
  772. });
  773. }
  774. },
  775. // 4秒定时器
  776. time4s () {
  777. let that = this
  778. // 4秒定时器
  779. this.time1 = setInterval(() => {
  780. that.industryProportion == 1 ? that.industryProportion = 2 : that.industryProportion = 1
  781. that.leftEcharts1.dispose()
  782. that.leftEcharts2.dispose()
  783. that.leftEcharts3.dispose()
  784. that.leftEcharts4.dispose()
  785. that.leftEcharts1Fun()
  786. that.leftEcharts2Fun()
  787. that.leftEcharts3Fun()
  788. that.leftEcharts4Fun()
  789. }, 4000);
  790. },
  791. // 针对投前产业布局分析的定时器
  792. timeNs () {
  793. let that = this
  794. this.time2 = setInterval(() => {
  795. if (that.industryLayout < 3) {
  796. that.industryLayout = that.industryLayout + 1
  797. } else {
  798. that.industryLayout = 0
  799. }
  800. this.time2 && clearInterval(this.time2)
  801. this.timeNs()
  802. that.leftEcharts5.dispose()
  803. that.leftEcharts5Fun()
  804. }, left1[that.industryLayout].length * 2000);
  805. },
  806. // 主辅业占比点击方法
  807. industryProportionChange (e) {
  808. let that = this
  809. this.industryProportion = e
  810. this.time1 && clearInterval(this.time1)
  811. that.leftEcharts1.dispose()
  812. that.leftEcharts2.dispose()
  813. that.leftEcharts3.dispose()
  814. that.leftEcharts4.dispose()
  815. that.leftEcharts1Fun()
  816. that.leftEcharts2Fun()
  817. that.leftEcharts3Fun()
  818. that.leftEcharts4Fun()
  819. this.time4s()
  820. },
  821. // 产业布局分析点击方法
  822. industryLayoutChange (e) {
  823. this.industryLayout = e
  824. },
  825. yuanChange (value) {
  826. return Number((value / 100000000).toFixed(2))
  827. },
  828. // 逢三折断
  829. numFormat (value) {
  830. if (!value) return '0'
  831. // var intPart = Number(value).toFixed(0) // 获取整数部分
  832. var intPart = parseInt(value)// 获取整数部分
  833. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
  834. var floatPart = '.00' // 预定义小数部分
  835. var value2Array = value.toString().split('.')
  836. // =2表示数据有小数位
  837. if (value2Array.length === 2) {
  838. floatPart = value2Array[1].toString() // 拿到小数部分
  839. if (floatPart.length === 1) {
  840. // 补0
  841. return intPartFormat + '.' + floatPart + '0'
  842. } else {
  843. floatPart = floatPart.slice(0, 2)
  844. return intPartFormat + '.' + floatPart
  845. }
  846. } else {
  847. return intPartFormat
  848. }
  849. },
  850. leftEcharts1Fun () {
  851. let that = this
  852. this.leftEcharts1 = echarts.init(this.$refs['leftEcharts1'])
  853. option = {
  854. title: {
  855. text: that.industryProportion == 1 ? '30%' : '70%',
  856. x: 'center',
  857. y: 'center',
  858. textStyle: {
  859. fontWeight: 'normal',
  860. color: '#68BDFF',
  861. fontSize: '20'
  862. }
  863. },
  864. color: ['#68BDFF', '#254F7F'],
  865. series: [{
  866. name: 'Line 1',
  867. type: 'pie',
  868. clockWise: true,
  869. radius: ['80%', '100%'],
  870. itemStyle: {
  871. normal: {
  872. label: {
  873. show: false
  874. },
  875. labelLine: {
  876. show: false
  877. }
  878. }
  879. },
  880. hoverAnimation: false,
  881. data: [{
  882. value: 80,
  883. name: '01',
  884. itemStyle: {
  885. normal: {
  886. label: {
  887. show: false
  888. },
  889. labelLine: {
  890. show: false
  891. }
  892. }
  893. }
  894. }, {
  895. name: '02',
  896. value: 20
  897. }]
  898. }]
  899. }
  900. //轮播
  901. // tools.loopShowTooltip(leftEcharts1, option, {
  902. // interval: 2000,
  903. // loopSeries: true,
  904. // });
  905. //注册
  906. that.leftEcharts1.setOption(option)
  907. },
  908. leftEcharts2Fun () {
  909. let that = this
  910. this.leftEcharts2 = echarts.init(this.$refs['leftEcharts2'])
  911. let nameList = ['a'];
  912. let valueList = that.industryProportion == 1 ? [30] : [70];
  913. let total = 100; // 数据总数
  914. var category = nameList.map((item, index) => {
  915. return {
  916. value: valueList[index],
  917. itemStyle: {
  918. color: new echarts.graphic.LinearGradient(
  919. 1,
  920. 0,
  921. 0,
  922. 1,
  923. [
  924. {
  925. offset: 0,
  926. color: '#40A9FF50',
  927. },
  928. {
  929. offset: 1,
  930. color: '#40A9FF',
  931. },
  932. ],
  933. false
  934. ),
  935. },
  936. };
  937. });
  938. var totalList = [];
  939. var totalBorderList = [];
  940. nameList.map((item, index) => {
  941. totalList.push({
  942. value: total,
  943. itemStyle: {
  944. color: 'rgba(51, 147, 236, 0.29)',
  945. },
  946. });
  947. totalBorderList.push({
  948. value: total,
  949. itemStyle: {
  950. borderColor: 'rgba(51, 147, 236, 0.29)',
  951. color: 'transparent',
  952. },
  953. });
  954. });
  955. var datas = [];
  956. category.forEach((value) => {
  957. datas.push(value.value);
  958. });
  959. option = {
  960. // backgroundColor: 'rgb(231,238,249)',
  961. xAxis: {
  962. max: total,
  963. splitLine: {
  964. show: false,
  965. },
  966. axisLine: {
  967. show: false,
  968. },
  969. axisLabel: {
  970. show: false,
  971. },
  972. axisTick: {
  973. show: false,
  974. },
  975. },
  976. grid: {
  977. left: '0%',
  978. top: '15%', // 设置条形图的边距
  979. right: '15%',
  980. bottom: '5%',
  981. },
  982. yAxis: [
  983. {
  984. type: 'category',
  985. inverse: false,
  986. data: nameList,
  987. axisLine: {
  988. show: false,
  989. },
  990. axisTick: {
  991. show: false,
  992. },
  993. axisLabel: {
  994. show: false,
  995. },
  996. },
  997. ],
  998. series: [
  999. {
  1000. // 内
  1001. type: 'bar',
  1002. barWidth: 16,
  1003. barGap: '20%',
  1004. silent: true,
  1005. // label: {
  1006. // normal: {
  1007. // formatter: (item) => {
  1008. // return `${item['name']}:${item['value']} `;
  1009. // },
  1010. // textStyle: {
  1011. // color: 'rgba(105, 120, 136, 1)',
  1012. // fontSize: 14,
  1013. // },
  1014. // position: [0, '-25px'],
  1015. // show: true,
  1016. // },
  1017. // },
  1018. data: category,
  1019. z: 1,
  1020. itemStyle: {
  1021. normal: {
  1022. color: new echarts.graphic.LinearGradient(
  1023. 1,
  1024. 0,
  1025. 0,
  1026. 1,
  1027. [
  1028. {
  1029. offset: 0,
  1030. color: 'rgba(81, 193, 156, 1)',
  1031. },
  1032. {
  1033. offset: 1,
  1034. color: 'rgba(234, 177, 100, 1)',
  1035. },
  1036. ],
  1037. false
  1038. ),
  1039. },
  1040. },
  1041. animationEasing: 'elasticOut',
  1042. },
  1043. {
  1044. // 分隔
  1045. type: 'pictorialBar',
  1046. itemStyle: {
  1047. normal: {
  1048. color: '#143362',
  1049. },
  1050. },
  1051. symbolRepeat: 'fixed',
  1052. symbolMargin: 8,
  1053. symbol: 'rect',
  1054. symbolClip: false,
  1055. symbolSize: [4, 20],
  1056. symbolPosition: 'start',
  1057. symbolOffset: [0, -2],
  1058. symbolBoundingData: total,
  1059. data: [total, total, total, total],
  1060. z: 2,
  1061. animationEasing: 'elasticOut',
  1062. },
  1063. {
  1064. // label
  1065. type: 'pictorialBar',
  1066. symbolBoundingData: total,
  1067. itemStyle: {
  1068. normal: {
  1069. color: 'none',
  1070. },
  1071. },
  1072. label: {
  1073. normal: {
  1074. formatter: (params) => {
  1075. var text;
  1076. text = `${((params['data'] * 100) / total).toFixed(2)}亿`;
  1077. return text;
  1078. },
  1079. textStyle: {
  1080. // 图列内容样式
  1081. fontSize: "20",
  1082. fontWeight: 800
  1083. },
  1084. position: 'right',
  1085. offset: [0, -3],
  1086. distance: 10, // 向右偏移位置
  1087. show: true,
  1088. color: '#68BDFF',
  1089. },
  1090. },
  1091. data: datas,
  1092. z: 0,
  1093. },
  1094. {
  1095. name: '外框',
  1096. type: 'bar',
  1097. barGap: '-130%', // 设置外框粗细
  1098. data: totalBorderList,
  1099. barWidth: 26,
  1100. itemStyle: {
  1101. normal: {
  1102. // barBorderRadius: [5, 5, 5, 5],
  1103. borderWidth: 1, // 边框宽度
  1104. borderColor: 'rgb(51, 147, 236)', // 边框色
  1105. color: 'rgb(231,238,249)'
  1106. },
  1107. },
  1108. z: 0,
  1109. }
  1110. ],
  1111. };
  1112. //轮播
  1113. // tools.loopShowTooltip(leftEcharts1, option, {
  1114. // interval: 2000,
  1115. // loopSeries: true,
  1116. // });
  1117. //注册
  1118. that.leftEcharts2.setOption(option)
  1119. },
  1120. leftEcharts3Fun () {
  1121. let that = this
  1122. this.leftEcharts3 = echarts.init(this.$refs['leftEcharts3'])
  1123. option = {
  1124. title: {
  1125. text: that.industryProportion == 1 ? '70%' : '30%',
  1126. x: 'center',
  1127. y: 'center',
  1128. textStyle: {
  1129. fontWeight: 'normal',
  1130. color: '#68BDFF',
  1131. fontSize: '20'
  1132. }
  1133. },
  1134. color: ['#5BDCC8', '#254F7F'],
  1135. series: [{
  1136. name: 'Line 1',
  1137. type: 'pie',
  1138. clockWise: true,
  1139. radius: ['80%', '100%'],
  1140. itemStyle: {
  1141. normal: {
  1142. label: {
  1143. show: false
  1144. },
  1145. labelLine: {
  1146. show: false
  1147. }
  1148. }
  1149. },
  1150. hoverAnimation: false,
  1151. data: [{
  1152. value: 80,
  1153. name: '01',
  1154. itemStyle: {
  1155. normal: {
  1156. label: {
  1157. show: false
  1158. },
  1159. labelLine: {
  1160. show: false
  1161. }
  1162. }
  1163. }
  1164. }, {
  1165. name: '02',
  1166. value: 20
  1167. }]
  1168. }]
  1169. }
  1170. //轮播
  1171. // tools.loopShowTooltip(leftEcharts1, option, {
  1172. // interval: 2000,
  1173. // loopSeries: true,
  1174. // });
  1175. //注册
  1176. that.leftEcharts3.setOption(option)
  1177. },
  1178. leftEcharts4Fun () {
  1179. let that = this
  1180. this.leftEcharts4 = echarts.init(this.$refs['leftEcharts4'])
  1181. let nameList = ['a'];
  1182. let valueList = that.industryProportion == 1 ? [70] : [30];
  1183. let total = 100; // 数据总数
  1184. var category = nameList.map((item, index) => {
  1185. return {
  1186. value: valueList[index],
  1187. itemStyle: {
  1188. color: new echarts.graphic.LinearGradient(
  1189. 1,
  1190. 0,
  1191. 0,
  1192. 1,
  1193. [
  1194. {
  1195. offset: 0,
  1196. color: '#5BDCC850',
  1197. },
  1198. {
  1199. offset: 1,
  1200. color: '#5BDCC8',
  1201. },
  1202. ],
  1203. false
  1204. ),
  1205. },
  1206. };
  1207. });
  1208. var totalList = [];
  1209. var totalBorderList = [];
  1210. nameList.map((item, index) => {
  1211. totalList.push({
  1212. value: total,
  1213. itemStyle: {
  1214. color: 'rgba(51, 147, 236, 0.29)',
  1215. },
  1216. });
  1217. totalBorderList.push({
  1218. value: total,
  1219. itemStyle: {
  1220. borderColor: 'rgba(51, 147, 236, 0.29)',
  1221. color: 'transparent',
  1222. },
  1223. });
  1224. });
  1225. var datas = [];
  1226. category.forEach((value) => {
  1227. datas.push(value.value);
  1228. });
  1229. option = {
  1230. // backgroundColor: 'rgb(231,238,249)',
  1231. xAxis: {
  1232. max: total,
  1233. splitLine: {
  1234. show: false,
  1235. },
  1236. axisLine: {
  1237. show: false,
  1238. },
  1239. axisLabel: {
  1240. show: false,
  1241. },
  1242. axisTick: {
  1243. show: false,
  1244. },
  1245. },
  1246. grid: {
  1247. left: '0%',
  1248. top: '15%', // 设置条形图的边距
  1249. right: '15%',
  1250. bottom: '5%',
  1251. },
  1252. yAxis: [
  1253. {
  1254. type: 'category',
  1255. inverse: false,
  1256. data: nameList,
  1257. axisLine: {
  1258. show: false,
  1259. },
  1260. axisTick: {
  1261. show: false,
  1262. },
  1263. axisLabel: {
  1264. show: false,
  1265. },
  1266. },
  1267. ],
  1268. series: [
  1269. {
  1270. // 内
  1271. type: 'bar',
  1272. barWidth: 16,
  1273. barGap: '20%',
  1274. silent: true,
  1275. // label: {
  1276. // normal: {
  1277. // formatter: (item) => {
  1278. // return `${item['name']}:${item['value']} `;
  1279. // },
  1280. // textStyle: {
  1281. // color: 'rgba(105, 120, 136, 1)',
  1282. // fontSize: 14,
  1283. // },
  1284. // position: [0, '-25px'],
  1285. // show: true,
  1286. // },
  1287. // },
  1288. data: category,
  1289. z: 1,
  1290. itemStyle: {
  1291. normal: {
  1292. color: new echarts.graphic.LinearGradient(
  1293. 1,
  1294. 0,
  1295. 0,
  1296. 1,
  1297. [
  1298. {
  1299. offset: 0,
  1300. color: 'rgba(81, 193, 156, 1)',
  1301. },
  1302. {
  1303. offset: 1,
  1304. color: 'rgba(234, 177, 100, 1)',
  1305. },
  1306. ],
  1307. false
  1308. ),
  1309. },
  1310. },
  1311. animationEasing: 'elasticOut',
  1312. },
  1313. {
  1314. // 分隔
  1315. type: 'pictorialBar',
  1316. itemStyle: {
  1317. normal: {
  1318. color: '#143362',
  1319. },
  1320. },
  1321. symbolRepeat: 'fixed',
  1322. symbolMargin: 8,
  1323. symbol: 'rect',
  1324. symbolClip: false,
  1325. symbolSize: [4, 20],
  1326. symbolPosition: 'start',
  1327. symbolOffset: [0, -2],
  1328. symbolBoundingData: total,
  1329. data: [total, total, total, total],
  1330. z: 2,
  1331. animationEasing: 'elasticOut',
  1332. },
  1333. {
  1334. // label
  1335. type: 'pictorialBar',
  1336. symbolBoundingData: total,
  1337. itemStyle: {
  1338. normal: {
  1339. color: 'none',
  1340. },
  1341. },
  1342. label: {
  1343. normal: {
  1344. formatter: (params) => {
  1345. var text;
  1346. text = `${((params['data'] * 100) / total).toFixed(2)}亿`;
  1347. return text;
  1348. },
  1349. textStyle: {
  1350. // 图列内容样式
  1351. fontSize: "20",
  1352. fontWeight: 800
  1353. },
  1354. position: 'right',
  1355. offset: [0, -3],
  1356. distance: 10, // 向右偏移位置
  1357. show: true,
  1358. color: '#68BDFF',
  1359. },
  1360. },
  1361. data: datas,
  1362. z: 0,
  1363. },
  1364. {
  1365. name: '外框',
  1366. type: 'bar',
  1367. barGap: '-130%', // 设置外框粗细
  1368. data: totalBorderList,
  1369. barWidth: 26,
  1370. itemStyle: {
  1371. normal: {
  1372. // barBorderRadius: [5, 5, 5, 5],
  1373. borderWidth: 1, // 边框宽度
  1374. borderColor: 'rgb(51, 147, 236)', // 边框色
  1375. color: 'rgb(231,238,249)'
  1376. },
  1377. },
  1378. z: 0,
  1379. }
  1380. ],
  1381. };
  1382. //轮播
  1383. // tools.loopShowTooltip(leftEcharts1, option, {
  1384. // interval: 2000,
  1385. // loopSeries: true,
  1386. // });
  1387. //注册
  1388. that.leftEcharts4.setOption(option)
  1389. },
  1390. leftEcharts5Fun () {
  1391. let that = this
  1392. this.leftEcharts5 = echarts.init(this.$refs['leftEcharts5'])
  1393. let dataList = []
  1394. left1[that.industryLayout].forEach((item, index) => {
  1395. dataList[index] = {
  1396. value: item.y,
  1397. name: item.name,
  1398. itemStyle: {
  1399. normal: {
  1400. color: new echarts.graphic.LinearGradient(1, 0, 0, 1, [
  1401. {
  1402. offset: 0,
  1403. color: commonColor2[index], //顶部颜色
  1404. },
  1405. {
  1406. offset: 1,
  1407. color: commonColor[index],// 底部颜色
  1408. },
  1409. ]),
  1410. borderColor: commonColor[index],
  1411. borderWidth: 3
  1412. }
  1413. }
  1414. }
  1415. })
  1416. let option = {
  1417. tooltip: {
  1418. trigger: 'item',
  1419. formatter: function (e) {
  1420. return `<span style="display:inline-block;margin-right:15px;border-radius:10px;width:20px;height:20px;background-color:${e.borderColor};"></span>${e.name} ${e.percent}%<br>${e.value}亿 ${left1[that.industryLayout][e.seriesIndex].num}个`
  1421. },
  1422. backgroundColor: 'rgba(50,50,50,0.7)', // 提示框浮层的背景颜色
  1423. textStyle: {
  1424. color: '#fff',
  1425. fontStyle: 'normal', // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体)
  1426. fontWeight: 'normal', // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
  1427. fontSize: '28', // 文字字体大小
  1428. },
  1429. },
  1430. legend: {
  1431. top: 'center',
  1432. orient: 'vertical',
  1433. left: '75%',
  1434. textStyle: {
  1435. color: '#fff',
  1436. fontSize: 28,
  1437. padding: [0, 20]
  1438. },
  1439. },
  1440. graphic: {
  1441. elements: [{
  1442. type: 'image',//需要填充图片,配置image,如果不需要图片可以配置其他的, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  1443. style: {
  1444. image: './img/whiteCircle.png', //这里添加图片地址
  1445. width: 80,
  1446. height: 80
  1447. },
  1448. left: 'center',//
  1449. top: 'middle' //配置图片居中
  1450. }]
  1451. },
  1452. series: [
  1453. {
  1454. name: '',
  1455. type: 'pie',
  1456. radius: ['20%', '80%'],
  1457. labelLine: {
  1458. normal: {
  1459. lineStyle: {
  1460. width: 1,
  1461. }
  1462. },
  1463. },
  1464. label: {
  1465. "normal": {
  1466. "show": false,
  1467. "textStyle": {
  1468. "fontSize": 28,
  1469. color: '#fff'
  1470. }
  1471. }
  1472. },
  1473. roseType: 'area',
  1474. data: dataList,
  1475. },
  1476. {
  1477. tooltip: {
  1478. show: false
  1479. },
  1480. type: 'pie',
  1481. radius: ["80%", "82%"],
  1482. hoverAnimation: false,
  1483. name: "",
  1484. data: [{
  1485. name: '',
  1486. value: 0,
  1487. itemStyle: {
  1488. normal: {
  1489. color: "#345189"
  1490. }
  1491. }
  1492. }]
  1493. },
  1494. ],
  1495. }
  1496. //轮播
  1497. tools.loopShowTooltip(that.leftEcharts5, option, {
  1498. interval: 2000,
  1499. loopSeries: true,
  1500. });
  1501. //注册
  1502. that.leftEcharts5.setOption(option)
  1503. },
  1504. leftEcharts6Fun () {
  1505. let that = this
  1506. this.leftEcharts6 = echarts.init(this.$refs['leftEcharts6'])
  1507. var dataArr = 44;
  1508. var colorSet = {
  1509. color: '#22B95E'
  1510. };
  1511. var color1 = {
  1512. type: "linear",
  1513. x: 0,
  1514. y: 0,
  1515. x2: 1,
  1516. y2: 1,
  1517. colorStops: [
  1518. {
  1519. offset: 0,
  1520. color: "rgba(255,255,255,0.1)"
  1521. },
  1522. {
  1523. offset: 1,
  1524. color: "rgba(255,255,255,0.3)"
  1525. }
  1526. ],
  1527. global: false
  1528. }
  1529. var color2 = {
  1530. type: "linear",
  1531. x: 0,
  1532. y: 0,
  1533. x2: 1,
  1534. y2: 1,
  1535. colorStops: [
  1536. {
  1537. offset: 0,
  1538. color: "#30DBBA"
  1539. },
  1540. {
  1541. offset: 1,
  1542. color: "#2DE696"
  1543. }
  1544. ],
  1545. global: false
  1546. }
  1547. option = {
  1548. tooltip: {
  1549. formatter: "{a} <br/>{b} : {c}%"
  1550. },
  1551. series: [
  1552. {
  1553. name: "内部进度条",
  1554. type: "gauge",
  1555. // center: ['20%', '50%'],
  1556. radius: '50%',
  1557. splitNumber: 10,
  1558. axisLine: {
  1559. lineStyle: {
  1560. color: [
  1561. [dataArr / 100, 'rgba(0,0,0,0)'],
  1562. [1, 'rgba(0,0,0,0)']
  1563. ],
  1564. width: 1
  1565. }
  1566. },
  1567. axisLabel: {
  1568. show: false,
  1569. },
  1570. axisTick: {
  1571. show: false,
  1572. },
  1573. splitLine: {
  1574. show: false,
  1575. },
  1576. itemStyle: {
  1577. color: "#ffffff"
  1578. },
  1579. detail: {
  1580. formatter: function (value) {
  1581. if (value !== 0) {
  1582. var num = Math.round(value);
  1583. return parseInt(num).toFixed(0) + "%";
  1584. } else {
  1585. return 0;
  1586. }
  1587. },
  1588. offsetCenter: [0, 117],
  1589. textStyle: {
  1590. padding: [0, 0, 0, 0],
  1591. fontSize: 60,
  1592. color: "#58F7DF"
  1593. }
  1594. },
  1595. title: { //标题
  1596. show: true,
  1597. offsetCenter: [0, 220], // x, y,单位px
  1598. textStyle: {
  1599. color: "#40A9FF",
  1600. fontSize: 34, //表盘上的标题文字大小
  1601. fontWeight: 400,
  1602. fontFamily: 'MicrosoftYaHei'
  1603. }
  1604. },
  1605. data: [{
  1606. name: "总额度:1,323.85亿",
  1607. value: dataArr,
  1608. itemStyle: {
  1609. fontSize: '50', //y轴上方单位的大小
  1610. color: "#FFF666",
  1611. fontFamily: "MicrosoftYaHei",
  1612. }
  1613. }],
  1614. pointer: {
  1615. show: true,
  1616. length: '100%',
  1617. radius: '20%',
  1618. width: 3 //指针粗细
  1619. },
  1620. animationDuration: 4000,
  1621. },
  1622. {
  1623. name: "内部阴影",
  1624. type: "gauge",
  1625. radius: '75%',
  1626. splitNumber: 10,
  1627. axisLine: {
  1628. lineStyle: {
  1629. color: [
  1630. [dataArr / 100, new echarts.graphic.LinearGradient(
  1631. 0, 1, 0, 0, [{
  1632. offset: 0,
  1633. color: '#081947',
  1634. }, {
  1635. offset: 0.5,
  1636. color: '#5DF5A9',
  1637. },
  1638. {
  1639. offset: 1,
  1640. color: '#F6F16A',
  1641. }
  1642. ]
  1643. )],
  1644. [
  1645. 1, '#0E4889'
  1646. ]
  1647. ],
  1648. width: 70
  1649. },
  1650. },
  1651. axisLabel: {
  1652. show: false,
  1653. },
  1654. axisTick: {
  1655. show: false,
  1656. },
  1657. splitLine: {
  1658. show: false,
  1659. },
  1660. itemStyle: {
  1661. show: false,
  1662. },
  1663. },
  1664. {
  1665. name: '外部刻度',
  1666. type: 'gauge',
  1667. // center: ['20%', '50%'],
  1668. radius: '90%',
  1669. min: 0, //最小刻度
  1670. max: 100, //最大刻度
  1671. splitNumber: 5, //刻度数量
  1672. startAngle: 225,
  1673. endAngle: -45,
  1674. axisLine: {
  1675. show: true,
  1676. lineStyle: {
  1677. width: 1,
  1678. color: [
  1679. [1, 'rgba(0,0,0,0)']
  1680. ]
  1681. }
  1682. }, //仪表盘轴线
  1683. axisLabel: {
  1684. show: false,
  1685. color: '#ffffff',
  1686. fontSize: 28,
  1687. fontFamily: 'SourceHanSansSC-Regular',
  1688. fontWeight: 'bold',
  1689. // position: "top",
  1690. distance: -45,
  1691. formatter: function (v) {
  1692. switch (v + '') {
  1693. case '0':
  1694. return '0';
  1695. case '10':
  1696. return '10';
  1697. case '20':
  1698. return '20';
  1699. case '30':
  1700. return '30';
  1701. case '40':
  1702. return '40';
  1703. case '50':
  1704. return '50';
  1705. case '60':
  1706. return '60';
  1707. case '70':
  1708. return '70';
  1709. case '80':
  1710. return '80';
  1711. case '90':
  1712. return '90';
  1713. case '100':
  1714. return '100';
  1715. }
  1716. }
  1717. }, //刻度标签。
  1718. axisTick: {
  1719. show: true,
  1720. splitNumber: 10,
  1721. lineStyle: {
  1722. color: '#3798D7', //用颜色渐变函数不起作用
  1723. width: 1,
  1724. },
  1725. length: -6
  1726. }, //刻度样式
  1727. splitLine: {
  1728. show: true,
  1729. length: -12,
  1730. lineStyle: {
  1731. color: '#3798D7', //用颜色渐变函数不起作用
  1732. }
  1733. }, //分隔线样式
  1734. detail: {
  1735. show: false
  1736. }
  1737. },
  1738. { //指针上的圆
  1739. type: 'pie',
  1740. tooltip: {
  1741. show: false
  1742. },
  1743. hoverAnimation: false,
  1744. legendHoverLink: false,
  1745. radius: ['0%', '4%'],
  1746. center: ['50%', '50%'],
  1747. label: {
  1748. normal: {
  1749. show: false
  1750. }
  1751. },
  1752. labelLine: {
  1753. normal: {
  1754. show: false
  1755. }
  1756. },
  1757. data: [{
  1758. value: 120,
  1759. itemStyle: {
  1760. normal: {
  1761. color: "#ffffff",
  1762. },
  1763. }
  1764. }]
  1765. },
  1766. ]
  1767. };
  1768. //轮播
  1769. // tools.loopShowTooltip(leftEcharts1, option, {
  1770. // interval: 2000,
  1771. // loopSeries: true,
  1772. // });
  1773. //注册
  1774. that.leftEcharts6.setOption(option)
  1775. },
  1776. leftEcharts7Fun () {
  1777. let that = this
  1778. this.leftEcharts7 = echarts.init(this.$refs['leftEcharts7'])
  1779. let option = {
  1780. title: {
  1781. text: '固定资产进度分布',
  1782. textStyle: {
  1783. color: '#fff',
  1784. fontSize: 28,
  1785. fontWeight: 500,
  1786. fontFamily: 'Microsoft YaHei'
  1787. },
  1788. top: '20',
  1789. left: '220'
  1790. },
  1791. textStyle: {
  1792. color: '#fff',
  1793. },
  1794. tooltip: {
  1795. show: false,
  1796. trigger: "axis",
  1797. formatter: function (params) {
  1798. var tip = params[0].axisValue + '<br/>' + params[0].marker + params[0].data[1] + ':' + params[0].data[2] + '个,' + params[0].data[3] + '亿元' + '<br/>' + params[1].marker + params[1].data[1] + ':' + params[1].data[2] + '个,' + params[1].data[3] + '亿元';
  1799. return tip
  1800. },
  1801. textStyle: {
  1802. color: '#ffffff', // 文字的颜色
  1803. fontSize: '20', // 文字字体大小
  1804. fontFamily: 'Microsoft YaHei'
  1805. },
  1806. axisPointer: {
  1807. // lineStyle: {
  1808. // type: 'dashed',
  1809. // width: 2,
  1810. // color: 'rgba(255,255,255,0.6)'
  1811. // },
  1812. animation: false
  1813. }
  1814. },
  1815. grid: {
  1816. top: '0%',
  1817. right: '5%',
  1818. left: '15%',
  1819. bottom: '-10%',
  1820. },
  1821. yAxis: {
  1822. data: ['备案', '特别监管'],
  1823. splitLine: {
  1824. show: false,
  1825. lineStyle: {
  1826. color: '#68b4dd66',
  1827. type: 'dashed',
  1828. },
  1829. },
  1830. axisLine: {
  1831. show: false
  1832. },
  1833. axisLabel: {
  1834. show: true,
  1835. formatter: '{value}',
  1836. textStyle: {
  1837. color: function (data) {
  1838. if (data == '特别监管') {
  1839. return '#40A9FF'
  1840. } else if (data == '备案') {
  1841. return '#5BDCC8'
  1842. }
  1843. },
  1844. fontSize: 20,
  1845. padding: [0, -10, 0, 0],
  1846. fontFamily: 'Microsoft YaHei',
  1847. },
  1848. },
  1849. nameTextStyle: {
  1850. color: '#ebf8ac',
  1851. fontSize: 16,
  1852. fontFamily: 'Microsoft YaHei'
  1853. },
  1854. },
  1855. xAxis: {
  1856. data: ['项目储备', '项目立项', '可研论证', '投资决策'],
  1857. axisLine: {
  1858. show: true, //隐藏X轴轴线
  1859. lineStyle: {
  1860. color: 'red',
  1861. width: 1,
  1862. },
  1863. },
  1864. axisTick: {
  1865. show: false, //隐藏X轴刻度
  1866. },
  1867. axisLabel: {
  1868. show: true,
  1869. textStyle: {
  1870. color: '#fff', //X轴文字颜色
  1871. fontSize: 20,
  1872. padding: [-80, 0, 0, 0],
  1873. fontFamily: 'Microsoft YaHei'
  1874. },
  1875. }
  1876. },
  1877. series: [
  1878. {
  1879. name: '特别监管',
  1880. type: 'scatter',
  1881. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1882. symbolSize: function (data) {
  1883. return Math.sqrt(data[2]) * 5;
  1884. },
  1885. // label: {
  1886. // emphasis: {
  1887. // show: true,
  1888. // formatter: function (param) {
  1889. // return param.data[2];
  1890. // },
  1891. // position: 'top'
  1892. // }
  1893. // },
  1894. itemStyle: {
  1895. normal: {
  1896. color: '#69c0ff'
  1897. }
  1898. },
  1899. // data: left13[0]
  1900. },
  1901. {
  1902. name: '备案',
  1903. type: 'scatter',
  1904. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1905. symbolSize: function (data) {
  1906. return Math.sqrt(data[2]) * 5;
  1907. },
  1908. // label: {
  1909. // emphasis: {
  1910. // show: true,
  1911. // formatter: function (param) {
  1912. // return param.data[2];
  1913. // },
  1914. // position: 'top'
  1915. // }
  1916. // },
  1917. itemStyle: {
  1918. normal: {
  1919. color: '#957DFF'
  1920. }
  1921. },
  1922. // data: left13[1]
  1923. },
  1924. ]
  1925. }
  1926. //轮播
  1927. // tools.loopShowTooltip(leftEcharts1, option, {
  1928. // interval: 2000,
  1929. // loopSeries: true,
  1930. // });
  1931. //注册
  1932. that.leftEcharts7.setOption(option)
  1933. },
  1934. leftEcharts8Fun () {
  1935. let that = this
  1936. this.leftEcharts8 = echarts.init(this.$refs['leftEcharts8'])
  1937. let option = {
  1938. title: {
  1939. text: '固定资产进度分布',
  1940. textStyle: {
  1941. color: '#fff',
  1942. fontSize: 28,
  1943. fontWeight: 500,
  1944. fontFamily: 'Microsoft YaHei'
  1945. },
  1946. top: '20',
  1947. left: '220'
  1948. },
  1949. textStyle: {
  1950. color: '#fff',
  1951. },
  1952. tooltip: {
  1953. show: false,
  1954. trigger: "axis",
  1955. formatter: function (params) {
  1956. var tip = params[0].axisValue + '<br/>' + params[0].marker + params[0].data[1] + ':' + params[0].data[2] + '个,' + params[0].data[3] + '亿元' + '<br/>' + params[1].marker + params[1].data[1] + ':' + params[1].data[2] + '个,' + params[1].data[3] + '亿元';
  1957. return tip
  1958. },
  1959. textStyle: {
  1960. color: '#ffffff', // 文字的颜色
  1961. fontSize: '20', // 文字字体大小
  1962. fontFamily: 'Microsoft YaHei'
  1963. },
  1964. axisPointer: {
  1965. // lineStyle: {
  1966. // type: 'dashed',
  1967. // width: 2,
  1968. // color: 'rgba(255,255,255,0.6)'
  1969. // },
  1970. animation: false
  1971. }
  1972. },
  1973. grid: {
  1974. top: '0%',
  1975. right: '5%',
  1976. left: '15%',
  1977. bottom: '-10%',
  1978. },
  1979. yAxis: {
  1980. data: ['备案', '特别监管'],
  1981. splitLine: {
  1982. show: false,
  1983. lineStyle: {
  1984. color: '#68b4dd66',
  1985. type: 'dashed',
  1986. },
  1987. },
  1988. axisLine: {
  1989. show: false
  1990. },
  1991. axisLabel: {
  1992. show: false,
  1993. formatter: '{value}',
  1994. textStyle: {
  1995. color: '#fff',
  1996. fontSize: 20,
  1997. padding: [0, -10, 0, 0],
  1998. fontFamily: 'Microsoft YaHei',
  1999. },
  2000. },
  2001. nameTextStyle: {
  2002. color: '#ebf8ac',
  2003. fontSize: 16,
  2004. fontFamily: 'Microsoft YaHei'
  2005. },
  2006. },
  2007. xAxis: {
  2008. data: ['项目储备', '项目立项', '可研论证', '投资决策'],
  2009. axisLine: {
  2010. show: true, //隐藏X轴轴线
  2011. lineStyle: {
  2012. color: 'red',
  2013. width: 1,
  2014. },
  2015. },
  2016. axisTick: {
  2017. show: false, //隐藏X轴刻度
  2018. },
  2019. axisLabel: {
  2020. show: true,
  2021. textStyle: {
  2022. color: '#fff', //X轴文字颜色
  2023. fontSize: 20,
  2024. padding: [-80, 0, 0, 0],
  2025. fontFamily: 'Microsoft YaHei'
  2026. },
  2027. }
  2028. },
  2029. series: [
  2030. {
  2031. name: '特别监管',
  2032. type: 'scatter',
  2033. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2034. symbolSize: function (data) {
  2035. return Math.sqrt(data[2]) * 5;
  2036. },
  2037. // label: {
  2038. // emphasis: {
  2039. // show: true,
  2040. // formatter: function (param) {
  2041. // return param.data[2];
  2042. // },
  2043. // position: 'top'
  2044. // }
  2045. // },
  2046. itemStyle: {
  2047. normal: {
  2048. color: '#69c0ff'
  2049. }
  2050. },
  2051. // data: left13[0]
  2052. },
  2053. {
  2054. name: '备案',
  2055. type: 'scatter',
  2056. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2057. symbolSize: function (data) {
  2058. return Math.sqrt(data[2]) * 5;
  2059. },
  2060. // label: {
  2061. // emphasis: {
  2062. // show: true,
  2063. // formatter: function (param) {
  2064. // return param.data[2];
  2065. // },
  2066. // position: 'top'
  2067. // }
  2068. // },
  2069. itemStyle: {
  2070. normal: {
  2071. color: '#957DFF'
  2072. }
  2073. },
  2074. // data: left13[1]
  2075. },
  2076. ]
  2077. }
  2078. //轮播
  2079. // tools.loopShowTooltip(leftEcharts1, option, {
  2080. // interval: 2000,
  2081. // loopSeries: true,
  2082. // });
  2083. //注册
  2084. that.leftEcharts8.setOption(option)
  2085. },
  2086. chinaEchartsFun () {
  2087. let that = this
  2088. this.geoCoordMap = []
  2089. /*获取地图数据*/
  2090. this.shanxiMap = echarts.init(this.$refs['shanxi'])
  2091. // echarts.registerMap('china', china)
  2092. echarts.registerMap('china', shanxi)
  2093. // var mapFeatures = echarts.getMap('china').geoJson.features
  2094. // mapFeatures.forEach(v => {
  2095. // // 地区名称
  2096. // var name = v.properties.name
  2097. // // 地区经纬度
  2098. // this.geoCoordMap[name] = v.properties.cp
  2099. // data.push({ name: v.properties.name, value: v.properties.cp[0], value2: v.properties.cp[1] })
  2100. // })
  2101. // var data = [
  2102. // { "name": "新疆", value: 29780 },
  2103. // { "name": "西藏", value: 2186 },
  2104. // { "name": "内蒙古", value: 1135 },
  2105. // { "name": "青海", value: 29780 },
  2106. // { "name": "四川", value: 2568 },
  2107. // { "name": "黑龙江", value: 29780 },
  2108. // { "name": "甘肃", value: 6959 },
  2109. // { "name": "云南", value: 5632 },
  2110. // { "name": "广西", value: 6707 },
  2111. // { "name": "湖南", value: 29780 },
  2112. // { "name": "陕西", value: 1894 },
  2113. // { "name": "广东", value: 15769 },
  2114. // { "name": "吉林", value: 8259 },
  2115. // { "name": "河北", value: 5741 },
  2116. // { "name": "湖北", value: 3030 },
  2117. // { "name": "贵州", value: 4542 },
  2118. // { "name": "山东", value: 19780 },
  2119. // { "name": "江西", value: 3157 },
  2120. // { "name": "河南", value: 6690 },
  2121. // { "name": "辽宁", value: 8678 },
  2122. // { "name": "山西", value: 5303 },
  2123. // { "name": "安徽", value: 29780 },
  2124. // { "name": "福建", value: 10259 },
  2125. // { "name": "浙江", value: 3016 },
  2126. // { "name": "江苏", value: 3202 },
  2127. // { "name": "重庆", value: 4540 },
  2128. // { "name": "宁夏", value: 19780 },
  2129. // { "name": "海南", value: 8626 },
  2130. // { "name": "台湾", value: 4361 },
  2131. // { "name": "北京", value: 20000 },
  2132. // { "name": "天津", value: 4080 },
  2133. // { "name": "上海", value: 19780 },
  2134. // { "name": "香港", value: 6991 },
  2135. // { "name": "澳门", value: 13873 },
  2136. // { "name": "南海诸岛", value: 0 }
  2137. // ];
  2138. // var geoCoordMap = {
  2139. // "新疆": [86.9023, 41.148],
  2140. // "西藏": [87.8695, 31.6846],
  2141. // "内蒙古": [110.5977, 41.3408],
  2142. // "青海": [95.2402, 35.4199],
  2143. // "四川": [102.9199, 30.1904],
  2144. // "黑龙江": [128.1445, 46.7156],
  2145. // "甘肃": [102.7129, 38.166],
  2146. // "云南": [101.0652, 24.6807],
  2147. // "广西": [108.7813, 23.6426],
  2148. // "湖南": [111.5332, 27.3779],
  2149. // "陕西": [108.5996, 33.7396],
  2150. // "广东": [113.8668, 22.8076],
  2151. // "吉林": [126.1746, 43.5938],
  2152. // "河北": [115.4004, 38.1688],
  2153. // "湖北": [112.2363, 30.8572],
  2154. // "贵州": [106.6113, 26.6385],
  2155. // "山东": [118.2402, 36.2307],
  2156. // "江西": [115.7156, 27.99],
  2157. // "河南": [113.0668, 33.8818],
  2158. // "辽宁": [123.0438, 41.0889],
  2159. // "山西": [112.44, 37.73],
  2160. // "安徽": [117.2461, 31.0361],
  2161. // "福建": [118.3008, 25.9277],
  2162. // "浙江": [120.498, 29.0918],
  2163. // "江苏": [119.8586, 32.915],
  2164. // "重庆": [107.7539, 29.8904],
  2165. // "宁夏": [105.9961, 37.1096],
  2166. // "海南": [109.9512, 19.2041],
  2167. // "台湾": [120.8254, 23.5986],
  2168. // "北京": [116.4551, 40.2539],
  2169. // "天津": [117.4219, 39.4189],
  2170. // "上海": [121.4648, 31.2891],
  2171. // "香港": [114.6178, 22.3242],
  2172. // "澳门": [113.5547, 21.6484],
  2173. // '南海诸岛': [128.8254, 21.5986]
  2174. // };
  2175. var data = [
  2176. { name: '大同市', value: 6035, value2: 28 },
  2177. { name: '朔州市', value: 3361, value2: 13 },
  2178. { name: '忻州市', value: 7335, value2: 25 },
  2179. { name: '吕梁市', value: 10904, value2: 45 },
  2180. { name: '太原市', value: 25167, value2: 113 },
  2181. { name: '阳泉市', value: 2512, value2: 28 },
  2182. { name: '晋中市', value: 14857, value2: 52 },
  2183. { name: '临汾市', value: 13055, value2: 30 },
  2184. { name: '长治市', value: 10300, value2: 23 },
  2185. { name: '运城市', value: 4106, value2: 23 },
  2186. { name: '晋城市', value: 4543, value2: 31 }
  2187. ]
  2188. var geoCoordMap = {
  2189. '太原市': [112.53, 37.87],
  2190. '大同市': [113.3, 40.12],
  2191. '阳泉市': [113.57, 37.85],
  2192. '长治市': [113.08, 36.18],
  2193. '晋城市': [112.83, 35.52],
  2194. '朔州市': [112.43, 39.33],
  2195. '晋中市': [112.94, 37.4],
  2196. '运城市': [110.97, 35.03],
  2197. '忻州市': [112.53, 38.72],
  2198. '临汾市': [111.5, 36.08],
  2199. '吕梁市': [111.13, 37.52],
  2200. }
  2201. var convertData = function (data) {
  2202. var res = [];
  2203. for (var i = 0; i < data.length; i++) {
  2204. var geoCoord = geoCoordMap[data[i].name];
  2205. if (geoCoord) {
  2206. res.push({
  2207. name: data[i].name,
  2208. value: geoCoord.concat(data[i].value)
  2209. });
  2210. }
  2211. }
  2212. return res;
  2213. };
  2214. var convertedData = [
  2215. convertData(data),
  2216. convertData(data.sort(function (a, b) {
  2217. return b.value - a.value;
  2218. }).slice(0, 6))
  2219. ];
  2220. data.sort(function (a, b) {
  2221. return a.value - b.value;
  2222. })
  2223. option = {
  2224. // backgroundColor: '#404a59',
  2225. animation: true,
  2226. animationDuration: 1000,
  2227. animationEasing: 'cubicInOut',
  2228. animationDurationUpdate: 1000,
  2229. animationEasingUpdate: 'cubicInOut',
  2230. geo: {
  2231. map: 'china',
  2232. center: [112.53, 37.67],
  2233. zoom: 4.5,
  2234. label: {
  2235. emphasis: {
  2236. show: false
  2237. }
  2238. },
  2239. tooltip: {
  2240. trigger: 'item',
  2241. className: 'custom-tooltip-box',
  2242. confine: true, // 不超出当前表
  2243. formatter: function (params) {
  2244. console.log(params)
  2245. return `<div class="bgTooltip" style="background: url('../img/shanxi/${params.name}.png') no-repeat center center;background-size: 100% 100%;font-size:36px">
  2246. <div class="flex items-center">
  2247. <img src="./img/yellowArrow.png" style="width: 12px;height: 22px;margin-right:10px" alt=""><span class="fb">${params.name}</span>
  2248. </div>
  2249. <div class="blueIcon flex items-center">项目数量:<span class="fb" style="color:#68BDFF;">26<span style="font-size:20px" class="fn">个</span></span></div>
  2250. <div class="blueIcon flex items-center">投资总额:<span class="fb" style="color:#68BDFF">180<span style="font-size:20px" class="fn">亿</span></span></div>
  2251. </div>`
  2252. },
  2253. },
  2254. roam: false,
  2255. // itemStyle: {
  2256. // normal: {
  2257. // // borderColor: 'rgba(147, 235, 248, 1)',
  2258. // borderColor: '#7fb3ff',
  2259. // borderWidth: 3,
  2260. // areaColor: {
  2261. // type: 'radial',
  2262. // x: 0.5,
  2263. // y: 0.5,
  2264. // r: 0.8,
  2265. // colorStops: [{
  2266. // offset: 0,
  2267. // color: '#468ff8' // 0% 处的颜色
  2268. // }, {
  2269. // offset: 1,
  2270. // color: '#0a2c6d' // 100% 处的颜色
  2271. // }],
  2272. // globalCoord: false // 缺省为 false
  2273. // },
  2274. // // shadowColor: 'rgba(128, 217, 248, 1)',
  2275. // shadowColor: '#468ff8',
  2276. // shadowOffsetX: -2,
  2277. // shadowOffsetY: 2,
  2278. // shadowBlur: 20
  2279. // },
  2280. // emphasis: {
  2281. // areaColor: {
  2282. // colorStops: [{
  2283. // offset: 0,
  2284. // color: '#3844aa' // 0% 处的颜色
  2285. // }, {
  2286. // offset: 1,
  2287. // color: '#7284fc' // 100% 处的颜色
  2288. // }],
  2289. // },
  2290. // borderColor: '#b3baff',
  2291. // borderWidth: 5
  2292. // }
  2293. // },
  2294. regions: [
  2295. {
  2296. name: '太原市',
  2297. value: 2000,
  2298. itemStyle: {
  2299. emphasis: {
  2300. borderColor: '#ffe036',
  2301. borderWidth: 5,
  2302. areaColor: {
  2303. type: 'radial',
  2304. x: 0.5,
  2305. y: 0.5,
  2306. r: 0.8,
  2307. colorStops: [{
  2308. offset: 0,
  2309. color: '#ffe036' // 0% 处的颜色
  2310. }, {
  2311. offset: 1,
  2312. color: '#7c732a' // 100% 处的颜色
  2313. }],
  2314. globalCoord: false // 缺省为 false
  2315. },
  2316. }
  2317. }
  2318. },
  2319. {
  2320. name: "南海诸岛",
  2321. itemStyle: {
  2322. // 隐藏地图
  2323. normal: {
  2324. opacity: 0, // 为 0 时不绘制该图形
  2325. }
  2326. },
  2327. label: {
  2328. show: false // 隐藏文字
  2329. }
  2330. }
  2331. ],
  2332. },
  2333. tooltip: {
  2334. trigger: 'item',
  2335. className: 'custom-tooltip-box',
  2336. confine: true, // 不超出当前表
  2337. formatter: function (params) {
  2338. console.log(params)
  2339. return `<div class="bgTooltip" style="background: url('../img/shanxi/${params.name}.png') no-repeat center center;background-size: 100% 100%;font-size:36px">
  2340. <div class="flex items-center">
  2341. <img src="./img/yellowArrow.png" style="width: 12px;height: 22px;margin-right:10px" alt=""><span class="fb">${params.name}</span>
  2342. </div>
  2343. <div class="blueIcon flex items-center">项目数量:<span class="fb" style="color:#68BDFF;">26<span style="font-size:20px" class="fn">个</span></span></div>
  2344. <div class="blueIcon flex items-center">投资总额:<span class="fb" style="color:#68BDFF">180<span style="font-size:20px" class="fn">亿</span></span></div>
  2345. </div>`
  2346. },
  2347. },
  2348. xAxis: {
  2349. type: 'value',
  2350. scale: true,
  2351. position: 'top',
  2352. boundaryGap: false,
  2353. splitLine: {
  2354. show: false
  2355. },
  2356. axisLine: {
  2357. show: false
  2358. },
  2359. axisTick: {
  2360. show: false
  2361. },
  2362. axisLabel: {
  2363. margin: 2,
  2364. textStyle: {
  2365. color: '#aaa'
  2366. }
  2367. },
  2368. },
  2369. yAxis: {
  2370. type: 'category',
  2371. nameGap: 16,
  2372. axisLine: {
  2373. show: false,
  2374. lineStyle: {
  2375. color: '#ddd'
  2376. }
  2377. },
  2378. axisTick: {
  2379. show: false,
  2380. lineStyle: {
  2381. color: '#ddd'
  2382. }
  2383. },
  2384. axisLabel: {
  2385. interval: 0,
  2386. textStyle: {
  2387. color: '#ddd'
  2388. }
  2389. },
  2390. data: categoryData
  2391. },
  2392. series: [
  2393. {
  2394. type: 'map',
  2395. map: 'china',
  2396. geoIndex: 1,
  2397. // aspectScale: 1.5, //长宽比
  2398. showLegendSymbol: true, // 存在legend时显示
  2399. label: {
  2400. normal: {
  2401. show: true,
  2402. },
  2403. emphasis: {
  2404. show: true,
  2405. textStyle: {
  2406. color: 'red',
  2407. },
  2408. },
  2409. },
  2410. roam: true,
  2411. itemStyle: {
  2412. normal: {
  2413. // borderColor: 'rgba(147, 235, 248, 1)',
  2414. borderColor: '#7fb3ff',
  2415. borderWidth: 3,
  2416. areaColor: {
  2417. type: 'radial',
  2418. x: 0.5,
  2419. y: 0.5,
  2420. r: 0.8,
  2421. colorStops: [{
  2422. offset: 0,
  2423. color: '#468ff8' // 0% 处的颜色
  2424. }, {
  2425. offset: 1,
  2426. color: '#0a2c6d' // 100% 处的颜色
  2427. }],
  2428. globalCoord: false // 缺省为 false
  2429. },
  2430. // shadowColor: 'rgba(128, 217, 248, 1)',
  2431. shadowColor: '#468ff8',
  2432. shadowOffsetX: -2,
  2433. shadowOffsetY: 2,
  2434. shadowBlur: 20
  2435. },
  2436. emphasis: {
  2437. areaColor: {
  2438. colorStops: [{
  2439. offset: 0,
  2440. color: '#3844aa' // 0% 处的颜色
  2441. }, {
  2442. offset: 1,
  2443. color: '#7284fc' // 100% 处的颜色
  2444. }],
  2445. },
  2446. borderColor: '#b3baff',
  2447. borderWidth: 5
  2448. }
  2449. },
  2450. animation: true,
  2451. data: data,
  2452. },
  2453. {
  2454. type: 'effectScatter',
  2455. coordinateSystem: 'geo',
  2456. data: convertedData[0],
  2457. symbolSize: function (val) {
  2458. return Math.max(val[2] / 500, 8);
  2459. },
  2460. showEffectOn: 'render',
  2461. rippleEffect: {
  2462. brushType: 'stroke'
  2463. },
  2464. hoverAnimation: true,
  2465. label: {
  2466. normal: {
  2467. formatter: '{b}',
  2468. position: 'right',
  2469. show: true,
  2470. fontSize: '30',
  2471. color: '#fff'
  2472. }
  2473. },
  2474. itemStyle: {
  2475. normal: {
  2476. color: '#ffc809',
  2477. shadowBlur: 50,
  2478. shadowColor: '#ffc809',
  2479. fontSize: "500",
  2480. }
  2481. },
  2482. // zlevel: 0
  2483. }
  2484. ]
  2485. };
  2486. var categoryData = [];
  2487. var barData = [];
  2488. var sum = 0;
  2489. for (var i = 0; i < data.length; i++) {
  2490. categoryData.push(data[i].name);
  2491. barData.push(data[i].value);
  2492. sum += data[i].value;
  2493. }
  2494. // this.shanxiMap.on('click', function (params) {
  2495. // if (params.name == '山西') {
  2496. // that.shanxiMap.dispose()
  2497. // that.centerShow = true
  2498. // setTimeout(() => {
  2499. // })
  2500. // }
  2501. // })
  2502. tools.loopShowTooltip(this.shanxiMap, option, {
  2503. interval: 2000,
  2504. loopSeries: false,
  2505. });
  2506. this.shanxiMap.setOption(option)
  2507. },
  2508. }
  2509. })