index.js 79 KB

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