index2.js 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872
  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:${
  1679. e.borderColor
  1680. };"></span>${e.name} ${e.percent}%<br>${e.value}亿 ${
  1681. left1[that.industryLayout][e.seriesIndex].num
  1682. }个`;
  1683. },
  1684. backgroundColor: "rgba(50,50,50,0.7)", // 提示框浮层的背景颜色
  1685. textStyle: {
  1686. color: "#fff",
  1687. fontStyle: "normal", // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体)
  1688. fontWeight: "normal", // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
  1689. fontSize: "28", // 文字字体大小
  1690. },
  1691. },
  1692. legend: {
  1693. top: "center",
  1694. orient: "vertical",
  1695. left: "75%",
  1696. textStyle: {
  1697. color: "#fff",
  1698. fontSize: 28,
  1699. padding: [0, 20],
  1700. },
  1701. },
  1702. graphic: {
  1703. elements: [
  1704. {
  1705. type: "image", //需要填充图片,配置image,如果不需要图片可以配置其他的, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  1706. style: {
  1707. image: "./img/whiteCircle.png", //这里添加图片地址
  1708. width: 80,
  1709. height: 80,
  1710. },
  1711. left: "center", //
  1712. top: "middle", //配置图片居中
  1713. },
  1714. ],
  1715. },
  1716. series: [
  1717. {
  1718. name: "",
  1719. type: "pie",
  1720. radius: ["20%", "80%"],
  1721. labelLine: {
  1722. normal: {
  1723. lineStyle: {
  1724. width: 1,
  1725. },
  1726. },
  1727. },
  1728. label: {
  1729. normal: {
  1730. show: false,
  1731. textStyle: {
  1732. fontSize: 28,
  1733. color: "#fff",
  1734. },
  1735. },
  1736. },
  1737. roseType: "area",
  1738. data: dataList,
  1739. },
  1740. {
  1741. tooltip: {
  1742. show: false,
  1743. },
  1744. type: "pie",
  1745. radius: ["80%", "82%"],
  1746. hoverAnimation: false,
  1747. name: "",
  1748. data: [
  1749. {
  1750. name: "",
  1751. value: 0,
  1752. itemStyle: {
  1753. normal: {
  1754. color: "#345189",
  1755. },
  1756. },
  1757. },
  1758. ],
  1759. },
  1760. ],
  1761. };
  1762. //轮播
  1763. tools.loopShowTooltip(that.leftEcharts5, option, {
  1764. interval: 2000,
  1765. loopSeries: true,
  1766. });
  1767. //注册
  1768. that.leftEcharts5.setOption(option);
  1769. },
  1770. leftEcharts6Fun() {
  1771. let that = this;
  1772. this.leftEcharts6 = echarts.init(this.$refs["leftEcharts6"]);
  1773. var dataArr = 44;
  1774. var colorSet = {
  1775. color: "#22B95E",
  1776. };
  1777. var color1 = {
  1778. type: "linear",
  1779. x: 0,
  1780. y: 0,
  1781. x2: 1,
  1782. y2: 1,
  1783. colorStops: [
  1784. {
  1785. offset: 0,
  1786. color: "rgba(255,255,255,0.1)",
  1787. },
  1788. {
  1789. offset: 1,
  1790. color: "rgba(255,255,255,0.3)",
  1791. },
  1792. ],
  1793. global: false,
  1794. };
  1795. var color2 = {
  1796. type: "linear",
  1797. x: 0,
  1798. y: 0,
  1799. x2: 1,
  1800. y2: 1,
  1801. colorStops: [
  1802. {
  1803. offset: 0,
  1804. color: "#30DBBA",
  1805. },
  1806. {
  1807. offset: 1,
  1808. color: "#2DE696",
  1809. },
  1810. ],
  1811. global: false,
  1812. };
  1813. option = {
  1814. tooltip: {
  1815. formatter: "{a} <br/>{b} : {c}%",
  1816. },
  1817. series: [
  1818. {
  1819. name: "内部进度条",
  1820. type: "gauge",
  1821. // center: ['20%', '50%'],
  1822. radius: "50%",
  1823. splitNumber: 10,
  1824. axisLine: {
  1825. lineStyle: {
  1826. color: [
  1827. [dataArr / 100, "rgba(0,0,0,0)"],
  1828. [1, "rgba(0,0,0,0)"],
  1829. ],
  1830. width: 1,
  1831. },
  1832. },
  1833. axisLabel: {
  1834. show: false,
  1835. },
  1836. axisTick: {
  1837. show: false,
  1838. },
  1839. splitLine: {
  1840. show: false,
  1841. },
  1842. itemStyle: {
  1843. color: "#ffffff",
  1844. },
  1845. detail: {
  1846. formatter: function (value) {
  1847. if (value !== 0) {
  1848. var num = Math.round(value);
  1849. return parseInt(num).toFixed(0) + "%";
  1850. } else {
  1851. return 0;
  1852. }
  1853. },
  1854. offsetCenter: [0, 117],
  1855. textStyle: {
  1856. padding: [0, 0, 0, 0],
  1857. fontSize: 60,
  1858. color: "#58F7DF",
  1859. },
  1860. },
  1861. title: {
  1862. //标题
  1863. show: true,
  1864. offsetCenter: [0, 220], // x, y,单位px
  1865. textStyle: {
  1866. color: "#40A9FF",
  1867. fontSize: 34, //表盘上的标题文字大小
  1868. fontWeight: 400,
  1869. fontFamily: "MicrosoftYaHei",
  1870. },
  1871. },
  1872. data: [
  1873. {
  1874. name: "总额度:1,323.85亿",
  1875. value: dataArr,
  1876. itemStyle: {
  1877. fontSize: "50", //y轴上方单位的大小
  1878. color: "#FFF666",
  1879. fontFamily: "MicrosoftYaHei",
  1880. },
  1881. },
  1882. ],
  1883. pointer: {
  1884. show: true,
  1885. length: "100%",
  1886. radius: "20%",
  1887. width: 3, //指针粗细
  1888. },
  1889. animationDuration: 4000,
  1890. },
  1891. {
  1892. name: "内部阴影",
  1893. type: "gauge",
  1894. radius: "75%",
  1895. splitNumber: 10,
  1896. axisLine: {
  1897. lineStyle: {
  1898. color: [
  1899. [
  1900. dataArr / 100,
  1901. new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  1902. {
  1903. offset: 0,
  1904. color: "#081947",
  1905. },
  1906. {
  1907. offset: 0.5,
  1908. color: "#5DF5A9",
  1909. },
  1910. {
  1911. offset: 1,
  1912. color: "#F6F16A",
  1913. },
  1914. ]),
  1915. ],
  1916. [1, "#0E4889"],
  1917. ],
  1918. width: 70,
  1919. },
  1920. },
  1921. axisLabel: {
  1922. show: false,
  1923. },
  1924. axisTick: {
  1925. show: false,
  1926. },
  1927. splitLine: {
  1928. show: false,
  1929. },
  1930. itemStyle: {
  1931. show: false,
  1932. },
  1933. },
  1934. {
  1935. name: "外部刻度",
  1936. type: "gauge",
  1937. // center: ['20%', '50%'],
  1938. radius: "90%",
  1939. min: 0, //最小刻度
  1940. max: 100, //最大刻度
  1941. splitNumber: 5, //刻度数量
  1942. startAngle: 225,
  1943. endAngle: -45,
  1944. axisLine: {
  1945. show: true,
  1946. lineStyle: {
  1947. width: 1,
  1948. color: [[1, "rgba(0,0,0,0)"]],
  1949. },
  1950. }, //仪表盘轴线
  1951. axisLabel: {
  1952. show: false,
  1953. color: "#ffffff",
  1954. fontSize: 28,
  1955. fontFamily: "SourceHanSansSC-Regular",
  1956. fontWeight: "bold",
  1957. // position: "top",
  1958. distance: -45,
  1959. formatter: function (v) {
  1960. switch (v + "") {
  1961. case "0":
  1962. return "0";
  1963. case "10":
  1964. return "10";
  1965. case "20":
  1966. return "20";
  1967. case "30":
  1968. return "30";
  1969. case "40":
  1970. return "40";
  1971. case "50":
  1972. return "50";
  1973. case "60":
  1974. return "60";
  1975. case "70":
  1976. return "70";
  1977. case "80":
  1978. return "80";
  1979. case "90":
  1980. return "90";
  1981. case "100":
  1982. return "100";
  1983. }
  1984. },
  1985. }, //刻度标签。
  1986. axisTick: {
  1987. show: true,
  1988. splitNumber: 10,
  1989. lineStyle: {
  1990. color: "#3798D7", //用颜色渐变函数不起作用
  1991. width: 1,
  1992. },
  1993. length: -6,
  1994. }, //刻度样式
  1995. splitLine: {
  1996. show: true,
  1997. length: -12,
  1998. lineStyle: {
  1999. color: "#3798D7", //用颜色渐变函数不起作用
  2000. },
  2001. }, //分隔线样式
  2002. detail: {
  2003. show: false,
  2004. },
  2005. },
  2006. {
  2007. //指针上的圆
  2008. type: "pie",
  2009. tooltip: {
  2010. show: false,
  2011. },
  2012. hoverAnimation: false,
  2013. legendHoverLink: false,
  2014. radius: ["0%", "4%"],
  2015. center: ["50%", "50%"],
  2016. label: {
  2017. normal: {
  2018. show: false,
  2019. },
  2020. },
  2021. labelLine: {
  2022. normal: {
  2023. show: false,
  2024. },
  2025. },
  2026. data: [
  2027. {
  2028. value: 120,
  2029. itemStyle: {
  2030. normal: {
  2031. color: "#ffffff",
  2032. },
  2033. },
  2034. },
  2035. ],
  2036. },
  2037. ],
  2038. };
  2039. //轮播
  2040. // tools.loopShowTooltip(leftEcharts1, option, {
  2041. // interval: 2000,
  2042. // loopSeries: true,
  2043. // });
  2044. //注册
  2045. that.leftEcharts6.setOption(option);
  2046. },
  2047. leftEcharts7Fun() {
  2048. let that = this;
  2049. this.leftEcharts7 = echarts.init(this.$refs["leftEcharts7"]);
  2050. let option = {
  2051. title: {
  2052. text: "固定资产进度分布",
  2053. textStyle: {
  2054. color: "#fff",
  2055. fontSize: 28,
  2056. fontWeight: 500,
  2057. fontFamily: "Microsoft YaHei",
  2058. },
  2059. top: "20",
  2060. left: "220",
  2061. },
  2062. textStyle: {
  2063. color: "#fff",
  2064. },
  2065. tooltip: {
  2066. show: false,
  2067. trigger: "axis",
  2068. formatter: function (params) {
  2069. var tip =
  2070. params[0].axisValue +
  2071. "<br/>" +
  2072. params[0].marker +
  2073. params[0].data[1] +
  2074. ":" +
  2075. params[0].data[2] +
  2076. "个," +
  2077. params[0].data[3] +
  2078. "亿元" +
  2079. "<br/>" +
  2080. params[1].marker +
  2081. params[1].data[1] +
  2082. ":" +
  2083. params[1].data[2] +
  2084. "个," +
  2085. params[1].data[3] +
  2086. "亿元";
  2087. return tip;
  2088. },
  2089. textStyle: {
  2090. color: "#ffffff", // 文字的颜色
  2091. fontSize: "20", // 文字字体大小
  2092. fontFamily: "Microsoft YaHei",
  2093. },
  2094. axisPointer: {
  2095. // lineStyle: {
  2096. // type: 'dashed',
  2097. // width: 2,
  2098. // color: 'rgba(255,255,255,0.6)'
  2099. // },
  2100. animation: false,
  2101. },
  2102. },
  2103. grid: {
  2104. top: "0%",
  2105. right: "5%",
  2106. left: "15%",
  2107. bottom: "-10%",
  2108. },
  2109. yAxis: {
  2110. data: ["备案", "特别监管"],
  2111. splitLine: {
  2112. show: false,
  2113. lineStyle: {
  2114. color: "#68b4dd66",
  2115. type: "dashed",
  2116. },
  2117. },
  2118. axisLine: {
  2119. show: false,
  2120. },
  2121. axisLabel: {
  2122. show: true,
  2123. formatter: "{value}",
  2124. textStyle: {
  2125. color: function (data) {
  2126. if (data == "特别监管") {
  2127. return "#40A9FF";
  2128. } else if (data == "备案") {
  2129. return "#5BDCC8";
  2130. }
  2131. },
  2132. fontSize: 20,
  2133. padding: [0, -10, 0, 0],
  2134. fontFamily: "Microsoft YaHei",
  2135. },
  2136. },
  2137. nameTextStyle: {
  2138. color: "#ebf8ac",
  2139. fontSize: 16,
  2140. fontFamily: "Microsoft YaHei",
  2141. },
  2142. },
  2143. xAxis: {
  2144. data: ["项目储备", "项目立项", "可研论证", "投资决策"],
  2145. axisLine: {
  2146. show: true, //隐藏X轴轴线
  2147. lineStyle: {
  2148. color: "red",
  2149. width: 1,
  2150. },
  2151. },
  2152. axisTick: {
  2153. show: false, //隐藏X轴刻度
  2154. },
  2155. axisLabel: {
  2156. show: true,
  2157. textStyle: {
  2158. color: "#fff", //X轴文字颜色
  2159. fontSize: 20,
  2160. padding: [-80, 0, 0, 0],
  2161. fontFamily: "Microsoft YaHei",
  2162. },
  2163. },
  2164. },
  2165. series: [
  2166. {
  2167. name: "特别监管",
  2168. type: "scatter",
  2169. symbol: "circle", //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2170. symbolSize: function (data) {
  2171. return Math.sqrt(data[2]) * 5;
  2172. },
  2173. // label: {
  2174. // emphasis: {
  2175. // show: true,
  2176. // formatter: function (param) {
  2177. // return param.data[2];
  2178. // },
  2179. // position: 'top'
  2180. // }
  2181. // },
  2182. itemStyle: {
  2183. normal: {
  2184. color: "#69c0ff",
  2185. },
  2186. },
  2187. // data: left13[0]
  2188. },
  2189. {
  2190. name: "备案",
  2191. type: "scatter",
  2192. symbol: "circle", //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2193. symbolSize: function (data) {
  2194. return Math.sqrt(data[2]) * 5;
  2195. },
  2196. // label: {
  2197. // emphasis: {
  2198. // show: true,
  2199. // formatter: function (param) {
  2200. // return param.data[2];
  2201. // },
  2202. // position: 'top'
  2203. // }
  2204. // },
  2205. itemStyle: {
  2206. normal: {
  2207. color: "#957DFF",
  2208. },
  2209. },
  2210. // data: left13[1]
  2211. },
  2212. ],
  2213. };
  2214. //轮播
  2215. // tools.loopShowTooltip(leftEcharts1, option, {
  2216. // interval: 2000,
  2217. // loopSeries: true,
  2218. // });
  2219. //注册
  2220. that.leftEcharts7.setOption(option);
  2221. },
  2222. leftEcharts8Fun() {
  2223. let that = this;
  2224. this.leftEcharts8 = echarts.init(this.$refs["leftEcharts8"]);
  2225. let option = {
  2226. title: {
  2227. text: "固定资产进度分布",
  2228. textStyle: {
  2229. color: "#fff",
  2230. fontSize: 28,
  2231. fontWeight: 500,
  2232. fontFamily: "Microsoft YaHei",
  2233. },
  2234. top: "20",
  2235. left: "220",
  2236. },
  2237. textStyle: {
  2238. color: "#fff",
  2239. },
  2240. tooltip: {
  2241. show: false,
  2242. trigger: "axis",
  2243. formatter: function (params) {
  2244. var tip =
  2245. params[0].axisValue +
  2246. "<br/>" +
  2247. params[0].marker +
  2248. params[0].data[1] +
  2249. ":" +
  2250. params[0].data[2] +
  2251. "个," +
  2252. params[0].data[3] +
  2253. "亿元" +
  2254. "<br/>" +
  2255. params[1].marker +
  2256. params[1].data[1] +
  2257. ":" +
  2258. params[1].data[2] +
  2259. "个," +
  2260. params[1].data[3] +
  2261. "亿元";
  2262. return tip;
  2263. },
  2264. textStyle: {
  2265. color: "#ffffff", // 文字的颜色
  2266. fontSize: "20", // 文字字体大小
  2267. fontFamily: "Microsoft YaHei",
  2268. },
  2269. axisPointer: {
  2270. // lineStyle: {
  2271. // type: 'dashed',
  2272. // width: 2,
  2273. // color: 'rgba(255,255,255,0.6)'
  2274. // },
  2275. animation: false,
  2276. },
  2277. },
  2278. grid: {
  2279. top: "0%",
  2280. right: "5%",
  2281. left: "15%",
  2282. bottom: "-10%",
  2283. },
  2284. yAxis: {
  2285. data: ["备案", "特别监管"],
  2286. splitLine: {
  2287. show: false,
  2288. lineStyle: {
  2289. color: "#68b4dd66",
  2290. type: "dashed",
  2291. },
  2292. },
  2293. axisLine: {
  2294. show: false,
  2295. },
  2296. axisLabel: {
  2297. show: false,
  2298. formatter: "{value}",
  2299. textStyle: {
  2300. color: "#fff",
  2301. fontSize: 20,
  2302. padding: [0, -10, 0, 0],
  2303. fontFamily: "Microsoft YaHei",
  2304. },
  2305. },
  2306. nameTextStyle: {
  2307. color: "#ebf8ac",
  2308. fontSize: 16,
  2309. fontFamily: "Microsoft YaHei",
  2310. },
  2311. },
  2312. xAxis: {
  2313. data: ["项目储备", "项目立项", "可研论证", "投资决策"],
  2314. axisLine: {
  2315. show: true, //隐藏X轴轴线
  2316. lineStyle: {
  2317. color: "red",
  2318. width: 1,
  2319. },
  2320. },
  2321. axisTick: {
  2322. show: false, //隐藏X轴刻度
  2323. },
  2324. axisLabel: {
  2325. show: true,
  2326. textStyle: {
  2327. color: "#fff", //X轴文字颜色
  2328. fontSize: 20,
  2329. padding: [-80, 0, 0, 0],
  2330. fontFamily: "Microsoft YaHei",
  2331. },
  2332. },
  2333. },
  2334. series: [
  2335. {
  2336. name: "特别监管",
  2337. type: "scatter",
  2338. symbol: "circle", //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2339. symbolSize: function (data) {
  2340. return Math.sqrt(data[2]) * 5;
  2341. },
  2342. // label: {
  2343. // emphasis: {
  2344. // show: true,
  2345. // formatter: function (param) {
  2346. // return param.data[2];
  2347. // },
  2348. // position: 'top'
  2349. // }
  2350. // },
  2351. itemStyle: {
  2352. normal: {
  2353. color: "#69c0ff",
  2354. },
  2355. },
  2356. // data: left13[0]
  2357. },
  2358. {
  2359. name: "备案",
  2360. type: "scatter",
  2361. symbol: "circle", //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  2362. symbolSize: function (data) {
  2363. return Math.sqrt(data[2]) * 5;
  2364. },
  2365. // label: {
  2366. // emphasis: {
  2367. // show: true,
  2368. // formatter: function (param) {
  2369. // return param.data[2];
  2370. // },
  2371. // position: 'top'
  2372. // }
  2373. // },
  2374. itemStyle: {
  2375. normal: {
  2376. color: "#957DFF",
  2377. },
  2378. },
  2379. // data: left13[1]
  2380. },
  2381. ],
  2382. };
  2383. //轮播
  2384. // tools.loopShowTooltip(leftEcharts1, option, {
  2385. // interval: 2000,
  2386. // loopSeries: true,
  2387. // });
  2388. //注册
  2389. that.leftEcharts8.setOption(option);
  2390. },
  2391. chinaEchartsFun () {
  2392. let that = this
  2393. this.geoCoordMap = []
  2394. /*获取地图数据*/
  2395. this.shanxiMap = echarts.init(this.$refs["shanxi"]);
  2396. // echarts.registerMap('china', china)
  2397. echarts.registerMap("china", shanxi);
  2398. // var mapFeatures = echarts.getMap('china').geoJson.features
  2399. // mapFeatures.forEach(v => {
  2400. // // 地区名称
  2401. // var name = v.properties.name
  2402. // // 地区经纬度
  2403. // this.geoCoordMap[name] = v.properties.cp
  2404. // data.push({ name: v.properties.name, value: v.properties.cp[0], value2: v.properties.cp[1] })
  2405. // })
  2406. // var data = [
  2407. // { "name": "新疆", value: 29780 },
  2408. // { "name": "西藏", value: 2186 },
  2409. // { "name": "内蒙古", value: 1135 },
  2410. // { "name": "青海", value: 29780 },
  2411. // { "name": "四川", value: 2568 },
  2412. // { "name": "黑龙江", value: 29780 },
  2413. // { "name": "甘肃", value: 6959 },
  2414. // { "name": "云南", value: 5632 },
  2415. // { "name": "广西", value: 6707 },
  2416. // { "name": "湖南", value: 29780 },
  2417. // { "name": "陕西", value: 1894 },
  2418. // { "name": "广东", value: 15769 },
  2419. // { "name": "吉林", value: 8259 },
  2420. // { "name": "河北", value: 5741 },
  2421. // { "name": "湖北", value: 3030 },
  2422. // { "name": "贵州", value: 4542 },
  2423. // { "name": "山东", value: 19780 },
  2424. // { "name": "江西", value: 3157 },
  2425. // { "name": "河南", value: 6690 },
  2426. // { "name": "辽宁", value: 8678 },
  2427. // { "name": "山西", value: 5303 },
  2428. // { "name": "安徽", value: 29780 },
  2429. // { "name": "福建", value: 10259 },
  2430. // { "name": "浙江", value: 3016 },
  2431. // { "name": "江苏", value: 3202 },
  2432. // { "name": "重庆", value: 4540 },
  2433. // { "name": "宁夏", value: 19780 },
  2434. // { "name": "海南", value: 8626 },
  2435. // { "name": "台湾", value: 4361 },
  2436. // { "name": "北京", value: 20000 },
  2437. // { "name": "天津", value: 4080 },
  2438. // { "name": "上海", value: 19780 },
  2439. // { "name": "香港", value: 6991 },
  2440. // { "name": "澳门", value: 13873 },
  2441. // { "name": "南海诸岛", value: 0 }
  2442. // ];
  2443. // var geoCoordMap = {
  2444. // "新疆": [86.9023, 41.148],
  2445. // "西藏": [87.8695, 31.6846],
  2446. // "内蒙古": [110.5977, 41.3408],
  2447. // "青海": [95.2402, 35.4199],
  2448. // "四川": [102.9199, 30.1904],
  2449. // "黑龙江": [128.1445, 46.7156],
  2450. // "甘肃": [102.7129, 38.166],
  2451. // "云南": [101.0652, 24.6807],
  2452. // "广西": [108.7813, 23.6426],
  2453. // "湖南": [111.5332, 27.3779],
  2454. // "陕西": [108.5996, 33.7396],
  2455. // "广东": [113.8668, 22.8076],
  2456. // "吉林": [126.1746, 43.5938],
  2457. // "河北": [115.4004, 38.1688],
  2458. // "湖北": [112.2363, 30.8572],
  2459. // "贵州": [106.6113, 26.6385],
  2460. // "山东": [118.2402, 36.2307],
  2461. // "江西": [115.7156, 27.99],
  2462. // "河南": [113.0668, 33.8818],
  2463. // "辽宁": [123.0438, 41.0889],
  2464. // "山西": [112.44, 37.73],
  2465. // "安徽": [117.2461, 31.0361],
  2466. // "福建": [118.3008, 25.9277],
  2467. // "浙江": [120.498, 29.0918],
  2468. // "江苏": [119.8586, 32.915],
  2469. // "重庆": [107.7539, 29.8904],
  2470. // "宁夏": [105.9961, 37.1096],
  2471. // "海南": [109.9512, 19.2041],
  2472. // "台湾": [120.8254, 23.5986],
  2473. // "北京": [116.4551, 40.2539],
  2474. // "天津": [117.4219, 39.4189],
  2475. // "上海": [121.4648, 31.2891],
  2476. // "香港": [114.6178, 22.3242],
  2477. // "澳门": [113.5547, 21.6484],
  2478. // '南海诸岛': [128.8254, 21.5986]
  2479. // };
  2480. var data = [
  2481. { name: "大同市", value: 6035, value2: 28 },
  2482. { name: "朔州市", value: 3361, value2: 13 },
  2483. { name: "忻州市", value: 7335, value2: 25 },
  2484. { name: "吕梁市", value: 10904, value2: 45 },
  2485. { name: "太原市", value: 25167, value2: 113 },
  2486. { name: "阳泉市", value: 2512, value2: 28 },
  2487. { name: "晋中市", value: 14857, value2: 52 },
  2488. { name: "临汾市", value: 13055, value2: 30 },
  2489. { name: "长治市", value: 10300, value2: 23 },
  2490. { name: "运城市", value: 4106, value2: 23 },
  2491. { name: "晋城市", value: 4543, value2: 31 },
  2492. ];
  2493. var geoCoordMap = {
  2494. 太原市: [112.53, 37.87],
  2495. 大同市: [113.3, 40.12],
  2496. 阳泉市: [113.57, 37.85],
  2497. 长治市: [113.08, 36.18],
  2498. 晋城市: [112.83, 35.52],
  2499. 朔州市: [112.43, 39.33],
  2500. 晋中市: [112.94, 37.4],
  2501. 运城市: [110.97, 35.03],
  2502. 忻州市: [112.53, 38.72],
  2503. 临汾市: [111.5, 36.08],
  2504. 吕梁市: [111.13, 37.52],
  2505. };
  2506. var convertData = function (data) {
  2507. var res = [];
  2508. for (var i = 0; i < data.length; i++) {
  2509. var geoCoord = geoCoordMap[data[i].name];
  2510. if (geoCoord) {
  2511. res.push({
  2512. name: data[i].name,
  2513. value: geoCoord.concat(data[i].value),
  2514. });
  2515. }
  2516. }
  2517. return res;
  2518. };
  2519. var convertedData = [
  2520. convertData(data),
  2521. convertData(
  2522. data
  2523. .sort(function (a, b) {
  2524. return b.value - a.value;
  2525. })
  2526. .slice(0, 6)
  2527. ),
  2528. ];
  2529. data.sort(function (a, b) {
  2530. return a.value - b.value;
  2531. });
  2532. option = {
  2533. // backgroundColor: '#404a59',
  2534. animation: true,
  2535. animationDuration: 1000,
  2536. animationEasing: "cubicInOut",
  2537. animationDurationUpdate: 1000,
  2538. animationEasingUpdate: "cubicInOut",
  2539. geo: {
  2540. map: "china",
  2541. center: [112.53, 37.67],
  2542. zoom: 4.5,
  2543. label: {
  2544. emphasis: {
  2545. show: false,
  2546. },
  2547. },
  2548. tooltip: {
  2549. trigger: 'item',
  2550. className: 'custom-tooltip-box',
  2551. confine: true, // 不超出当前表
  2552. formatter: function (params) {
  2553. console.log(params)
  2554. return `<div class="bgTooltip" style="background: url('../img/shanxi/${params.name}.png') no-repeat center center;background-size: 100% 100%;font-size:36px">
  2555. <div class="flex items-center">
  2556. <img src="./img/yellowArrow.png" style="width: 12px;height: 22px;margin-right:10px" alt=""><span class="fb">${params.name}</span>
  2557. </div>
  2558. <div class="blueIcon flex items-center">项目数量:<span class="fb" style="color:#68BDFF;">26<span style="font-size:20px" class="fn">个</span></span></div>
  2559. <div class="blueIcon flex items-center">投资总额:<span class="fb" style="color:#68BDFF">180<span style="font-size:20px" class="fn">亿</span></span></div>
  2560. </div>`
  2561. },
  2562. },
  2563. roam: false,
  2564. itemStyle: {
  2565. normal: {
  2566. // borderColor: 'rgba(147, 235, 248, 1)',
  2567. borderColor: '#7fb3ff',
  2568. borderWidth: 3,
  2569. areaColor: {
  2570. type: 'radial',
  2571. x: 0.5,
  2572. y: 0.5,
  2573. r: 0.8,
  2574. colorStops: [{
  2575. offset: 0,
  2576. color: '#468ff8' // 0% 处的颜色
  2577. }, {
  2578. offset: 1,
  2579. color: '#0a2c6d' // 100% 处的颜色
  2580. }],
  2581. globalCoord: false // 缺省为 false
  2582. },
  2583. // shadowColor: 'rgba(128, 217, 248, 1)',
  2584. shadowColor: '#468ff8',
  2585. shadowOffsetX: -2,
  2586. shadowOffsetY: 2,
  2587. shadowBlur: 20
  2588. },
  2589. emphasis: {
  2590. areaColor: {
  2591. colorStops: [{
  2592. offset: 0,
  2593. color: '#3844aa' // 0% 处的颜色
  2594. }, {
  2595. offset: 1,
  2596. color: '#7284fc' // 100% 处的颜色
  2597. }],
  2598. },
  2599. borderColor: '#b3baff',
  2600. borderWidth: 5
  2601. }
  2602. },
  2603. // regions: [
  2604. // {
  2605. // name: "太原市",
  2606. // value: 2000,
  2607. // itemStyle: {
  2608. // emphasis: {
  2609. // borderColor: "#ffe036",
  2610. // borderWidth: 5,
  2611. // areaColor: {
  2612. // type: "radial",
  2613. // x: 0.5,
  2614. // y: 0.5,
  2615. // r: 0.8,
  2616. // colorStops: [
  2617. // {
  2618. // offset: 0,
  2619. // color: "#ffe036", // 0% 处的颜色
  2620. // },
  2621. // {
  2622. // offset: 1,
  2623. // color: "#7c732a", // 100% 处的颜色
  2624. // },
  2625. // ],
  2626. // globalCoord: false, // 缺省为 false
  2627. // },
  2628. // },
  2629. // },
  2630. // },
  2631. // {
  2632. // name: "南海诸岛",
  2633. // itemStyle: {
  2634. // // 隐藏地图
  2635. // normal: {
  2636. // opacity: 0, // 为 0 时不绘制该图形
  2637. // },
  2638. // },
  2639. // label: {
  2640. // show: false, // 隐藏文字
  2641. // },
  2642. // },
  2643. // ],
  2644. },
  2645. tooltip: {
  2646. trigger: "item",
  2647. className: "custom-tooltip-box",
  2648. confine: true, // 不超出当前表
  2649. // formatter: function (params) {
  2650. // console.log(params);
  2651. // return `<div class="bgTooltip" style="background: url('../img/shanxi/${params.name}.png') no-repeat center center;background-size: 100% 100%;font-size:36px">
  2652. // <div class="flex items-center">
  2653. // <img src="./img/yellowArrow.png" style="width: 12px;height: 22px;margin-right:10px" alt=""><span class="fb">${params.name}</span>
  2654. // </div>
  2655. // <div class="blueIcon flex items-center">项目数量:<span class="fb" style="color:#68BDFF;">26<span style="font-size:20px" class="fn">个</span></span></div>
  2656. // <div class="blueIcon flex items-center">投资总额:<span class="fb" style="color:#68BDFF">180<span style="font-size:20px" class="fn">亿</span></span></div>
  2657. // </div>`;
  2658. // },
  2659. formatter: (params, ticket, callback) => {
  2660. // 清空所有轮播
  2661. for (var k in this.geoCoordMap) {
  2662. that.shanxiMap.dispatchAction({
  2663. // type: 'geoUnSelect',
  2664. type: 'downplay',
  2665. name: k,
  2666. })
  2667. }
  2668. // 如果鼠标滑动到线线上面,则返回空
  2669. that.shanxiMap.dispatchAction({
  2670. // type: 'geoSelect',
  2671. type: 'highlight',
  2672. name: params.name,
  2673. })
  2674. if (params.componentSubType == 'lines') {
  2675. return
  2676. }
  2677. if (params.componentSubType == 'scatter') {
  2678. let tipHtml = `
  2679. <div class="tooltip-cont">
  2680. <p>项目数量:<span>${data[params.dataIndex].value2}个</span></p>
  2681. <p>总投资额:<span>${params.data.value[2]}亿</span></p>
  2682. </div>`
  2683. callback(ticket, tipHtml)
  2684. return tipHtml
  2685. }
  2686. if (params.componentSubType == 'map') {
  2687. let tipHtml = `
  2688. <div class="tooltip-cont">
  2689. <p>项目数量:<span>${data[params.dataIndex].value2}个</span></p>
  2690. <p>总投资额:<span>${params.data.value}亿</span></p>
  2691. </div>`
  2692. callback(ticket, tipHtml)
  2693. return tipHtml
  2694. }
  2695. },
  2696. },
  2697. xAxis: {
  2698. type: "value",
  2699. scale: true,
  2700. position: "top",
  2701. boundaryGap: false,
  2702. splitLine: {
  2703. show: false,
  2704. },
  2705. axisLine: {
  2706. show: false,
  2707. },
  2708. axisTick: {
  2709. show: false,
  2710. },
  2711. axisLabel: {
  2712. margin: 2,
  2713. textStyle: {
  2714. color: "#aaa",
  2715. },
  2716. },
  2717. },
  2718. yAxis: {
  2719. type: "category",
  2720. nameGap: 16,
  2721. axisLine: {
  2722. show: false,
  2723. lineStyle: {
  2724. color: "#ddd",
  2725. },
  2726. },
  2727. axisTick: {
  2728. show: false,
  2729. lineStyle: {
  2730. color: "#ddd",
  2731. },
  2732. },
  2733. axisLabel: {
  2734. interval: 0,
  2735. textStyle: {
  2736. color: "#ddd",
  2737. },
  2738. },
  2739. data: categoryData,
  2740. },
  2741. series: [
  2742. {
  2743. type: 'effectScatter',
  2744. coordinateSystem: 'geo',
  2745. data: convertedData[0],
  2746. symbolSize: function (val) {
  2747. return Math.max(val[2] / 500, 8);
  2748. },
  2749. showEffectOn: "render",
  2750. rippleEffect: {
  2751. brushType: "stroke",
  2752. },
  2753. hoverAnimation: true,
  2754. label: {
  2755. normal: {
  2756. formatter: "{b}",
  2757. position: "right",
  2758. show: true,
  2759. fontSize: "30",
  2760. color: "#fff",
  2761. },
  2762. },
  2763. itemStyle: {
  2764. normal: {
  2765. color: "#ffc809",
  2766. shadowBlur: 50,
  2767. shadowColor: "#ffc809",
  2768. fontSize: "500",
  2769. },
  2770. },
  2771. zlevel: 999
  2772. },
  2773. {
  2774. type: 'map',
  2775. map: 'china',
  2776. // center: [112.53, 37.67],
  2777. layoutCenter: ['50%', '50%'], //地图位置
  2778. zoom: 4.5,
  2779. geoIndex: 1,
  2780. // aspectScale: 1.5, //长宽比
  2781. showLegendSymbol: true, // 存在legend时显示
  2782. label: {
  2783. normal: {
  2784. show: true,
  2785. },
  2786. emphasis: {
  2787. show: true,
  2788. textStyle: {
  2789. color: 'red',
  2790. },
  2791. },
  2792. },
  2793. roam: false,
  2794. itemStyle: {
  2795. normal: {
  2796. // borderColor: 'rgba(147, 235, 248, 1)',
  2797. borderColor: '#7fb3ff',
  2798. borderWidth: 3,
  2799. areaColor: {
  2800. type: 'radial',
  2801. x: 0.5,
  2802. y: 0.5,
  2803. r: 0.8,
  2804. colorStops: [{
  2805. offset: 0,
  2806. color: '#468ff8' // 0% 处的颜色
  2807. }, {
  2808. offset: 1,
  2809. color: '#0a2c6d' // 100% 处的颜色
  2810. }],
  2811. globalCoord: false // 缺省为 false
  2812. },
  2813. // shadowColor: 'rgba(128, 217, 248, 1)',
  2814. shadowColor: '#468ff8',
  2815. shadowOffsetX: -2,
  2816. shadowOffsetY: 2,
  2817. shadowBlur: 20
  2818. },
  2819. emphasis: {
  2820. areaColor: {
  2821. colorStops: [{
  2822. offset: 0,
  2823. color: '#3844aa' // 0% 处的颜色
  2824. }, {
  2825. offset: 1,
  2826. color: '#7284fc' // 100% 处的颜色
  2827. }],
  2828. },
  2829. borderColor: '#b3baff',
  2830. borderWidth: 5
  2831. }
  2832. },
  2833. animation: true,
  2834. data: data,
  2835. },
  2836. ]
  2837. };
  2838. var categoryData = [];
  2839. var barData = [];
  2840. var sum = 0;
  2841. for (var i = 0; i < data.length; i++) {
  2842. categoryData.push(data[i].name);
  2843. barData.push(data[i].value);
  2844. sum += data[i].value;
  2845. }
  2846. // this.shanxiMap.on('click', function (params) {
  2847. // if (params.name == '山西') {
  2848. // that.shanxiMap.dispose()
  2849. // that.centerShow = true
  2850. // setTimeout(() => {
  2851. // })
  2852. // }
  2853. // })
  2854. tools.loopShowTooltip(this.shanxiMap, option, {
  2855. interval: 2000,
  2856. loopSeries: false,
  2857. });
  2858. this.shanxiMap.setOption(option);
  2859. },
  2860. },
  2861. });