investHome.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. let app = new Vue({
  2. el: '#app',
  3. data() {
  4. return {
  5. year: '2022',
  6. config1: {
  7. number: [100],
  8. content: '{nt}个',
  9. },
  10. storageRecordConfig: {
  11. header: ['项目名称', '投资金额', '所属产业', '项目进度', '完成比例'],
  12. headerBGC: '#05507b33',
  13. oddRowBGC: '#69c0ff0f',
  14. evenRowBGC: '',
  15. headerHeight: '40',
  16. rowNum: 4,
  17. align: ['center'],
  18. data: [
  19. ['工程建设项目', '21.2亿', '煤炭', '终止', '2.3%'],
  20. ['工程建设项目', '21.2亿', '煤炭', '退出', '2.3%'],
  21. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  22. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  23. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  24. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  25. ],
  26. },
  27. storageRecordConfig2: {
  28. header: ['项目名称', '投资金额', '所属产业', '项目进度', '完成比例'],
  29. headerBGC: '#05507b33',
  30. oddRowBGC: '#05507b33',
  31. evenRowBGC: '',
  32. headerHeight: '40',
  33. rowNum: 4,
  34. align: ['center'],
  35. data: [
  36. ['工程建设项目', '21.2亿', '煤炭', '终止', '2.3%'],
  37. ['工程建设项目', '21.2亿', '煤炭', '退出', '2.3%'],
  38. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  39. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  40. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  41. ['工程建设项目', '21.2亿', '煤炭', '进行中', '2.3%'],
  42. ],
  43. },
  44. companyList: [
  45. { name: '山西焦煤' },
  46. { name: '晋能控股' },
  47. { name: '华新燃气' },
  48. { name: '山西建投' },
  49. { name: '潞安化工' },
  50. { name: '华远陆港' },
  51. { name: '航产集团' },
  52. { name: '大地控股' },
  53. { name: '国新能源' },
  54. { name: '汾酒集团' },
  55. { name: '云时代' },
  56. { name: '神农科技' },
  57. { name: '华阳新材' },
  58. { name: '华舰体育' },
  59. { name: '交控集团' },
  60. { name: '文旅集团' },
  61. { name: '水控集团' },
  62. { name: '太重集团' },
  63. ],
  64. }
  65. },
  66. mounted() {
  67. // 左侧图表
  68. this.initChartL1()
  69. this.initChartL2()
  70. this.initChartR1()
  71. },
  72. methods: {
  73. initChartL1() {
  74. let myChart = echarts.init(this.$refs['echartL1'])
  75. let option = {
  76. grid: {
  77. left: '10%',
  78. top: '18%',
  79. bottom: '12%',
  80. right: '8%',
  81. },
  82. tooltip: {
  83. trigger: 'axis',
  84. axisPointer: {
  85. type: 'shadow',
  86. },
  87. },
  88. xAxis: {
  89. data: ['2018年', '2019年', '2020年', '2021年', '2022年', '2023年'],
  90. axisLine: {
  91. show: true, //隐藏X轴轴线
  92. lineStyle: {
  93. color: '#3D7495',
  94. width: 1,
  95. },
  96. },
  97. axisTick: {
  98. show: false, //隐藏X轴刻度
  99. },
  100. axisLabel: {
  101. show: true,
  102. textStyle: {
  103. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  104. },
  105. },
  106. },
  107. yAxis: [
  108. {
  109. type: 'value',
  110. name: '亿元',
  111. nameTextStyle: {
  112. color: '#FFF',
  113. },
  114. splitLine: {
  115. show: true,
  116. lineStyle: {
  117. color: '#68b4dd66',
  118. type: 'dashed',
  119. },
  120. },
  121. axisLine: {
  122. show: true,
  123. lineStyle: {
  124. color: '#3D7495'
  125. }
  126. },
  127. axisLabel: {
  128. show: true,
  129. textStyle: {
  130. color: 'rgba(250,250,250,0.6)',
  131. },
  132. },
  133. }
  134. ],
  135. series: [
  136. {
  137. type: 'pictorialBar',
  138. barCategoryGap: '0%',
  139. symbol: 'path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z',
  140. label: {
  141. show: true,
  142. position: 'top',
  143. distance: 5,
  144. color: '#08DFFE',
  145. fontSize: 12,
  146. },
  147. itemStyle: {
  148. normal: {
  149. color: {
  150. type: 'linear',
  151. x: 0,
  152. y: 0,
  153. x2: 0,
  154. y2: 1,
  155. colorStops: [
  156. {
  157. offset: 0,
  158. color: '#9A11FF',
  159. },
  160. {
  161. offset: 1,
  162. color: '#08DFFE',
  163. },
  164. ],
  165. global: false, // 缺省为 false
  166. },
  167. },
  168. emphasis: {
  169. opacity: 1,
  170. },
  171. },
  172. data: [123, 60, 25, 18, 12, 9],
  173. },
  174. ],
  175. }
  176. myChart.setOption(option)
  177. },
  178. initChartL2() {
  179. let myChart = echarts.init(this.$refs['echartL2'])
  180. let option = {
  181. tooltip: {
  182. trigger: 'axis',
  183. axisPointer: {
  184. type: 'shadow',
  185. },
  186. },
  187. grid: {
  188. top: '16%',
  189. right: '3%',
  190. left: '10%',
  191. bottom: '10%',
  192. },
  193. legend: {
  194. top: '1',
  195. right: '10',
  196. textStyle: {
  197. color: 'rgba(250,250,250,0.6)',
  198. },
  199. },
  200. xAxis: {
  201. data: ['山西焦煤', '山西文旅', '潞安化工', '晋能控股', '山西建投'],
  202. axisLine: {
  203. show: true, //隐藏X轴轴线
  204. lineStyle: {
  205. color: '#005094',
  206. width: 1,
  207. },
  208. },
  209. axisTick: {
  210. show: false, //隐藏X轴刻度
  211. },
  212. axisLabel: {
  213. show: true,
  214. textStyle: {
  215. color: 'rgba(255,255,255,0.6)', //X轴文字颜色
  216. },
  217. },
  218. },
  219. yAxis: [
  220. {
  221. type: 'value',
  222. nameTextStyle: {
  223. color: '#ebf8ac',
  224. },
  225. splitLine: {
  226. show: true,
  227. lineStyle: {
  228. color: '#68b4dd66',
  229. type: 'dashed',
  230. },
  231. },
  232. axisLine: {
  233. show: true,
  234. lineStyle: {
  235. color: '#3D7495'
  236. }
  237. },
  238. axisLabel: {
  239. show: true,
  240. textStyle: {
  241. color: 'rgba(250,250,250,0.6)',
  242. },
  243. },
  244. },
  245. ],
  246. series: [
  247. {
  248. name: '计划投资',
  249. type: 'bar',
  250. barWidth: 15,
  251. itemStyle: {
  252. normal: {
  253. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  254. {
  255. offset: 0,
  256. color: '#69c0ff',
  257. },
  258. {
  259. offset: 1,
  260. color: '#082550',
  261. },
  262. ]),
  263. },
  264. },
  265. data: [900, 600, 500, 450, 500],
  266. },
  267. {
  268. name: '实际投资',
  269. type: 'bar',
  270. barWidth: 15,
  271. itemStyle: {
  272. normal: {
  273. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  274. {
  275. offset: 0,
  276. color: '#957DFF',
  277. },
  278. {
  279. offset: 1,
  280. color: '#082550',
  281. },
  282. ]),
  283. },
  284. },
  285. data: [500, 900, 600, 800, 450],
  286. },
  287. ],
  288. }
  289. myChart.setOption(option)
  290. },
  291. initChartR1() {
  292. let myChart = echarts.init(this.$refs['echartR1'])
  293. let option = {
  294. tooltip: {
  295. trigger: 'item'
  296. },
  297. legend: {
  298. top: 'center',
  299. orient: 'vertical',
  300. right: '2%',
  301. textStyle: {
  302. color: '#9DB9EB'
  303. }
  304. },
  305. series: [
  306. {
  307. name: '',
  308. type: 'pie',
  309. radius: ['55%', '80%'],
  310. labelLine: {
  311. normal: {
  312. lineStyle: {
  313. width: 1
  314. }
  315. }
  316. },
  317. data: [
  318. { value: 1048, name: '煤炭' },
  319. { value: 735, name: '火电' },
  320. { value: 580, name: '焦化' },
  321. { value: 484, name: '风电' },
  322. ]
  323. }
  324. ]
  325. }
  326. myChart.setOption(option)
  327. },
  328. },
  329. })