Index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. <template>
  2. <section class='index-content'>
  3. <div class='index_header'>
  4. <div class='header-item'>
  5. <div class='item-img'>
  6. <img src="../assets/book.png" alt="">
  7. <span class='text'> 期刊总数 <br/><span class='count'>356</span></span>
  8. </div>
  9. <div class='item-img'>
  10. <img src="../assets/network.png" alt="">
  11. <span class='text'> 文章发布量 <br/><span class='count'>356</span></span>
  12. </div>
  13. </div>
  14. <div class='header-item'>
  15. <div class='item-text'>
  16. <div><span class='text'>活动举办次数</span> <span class='count'> 82</span></div>
  17. <div><span class='text'>活动参与次数</span><span class='count'> 82</span></div>
  18. </div>
  19. <div class='item-text'>
  20. <div><span class='text'>总阅读次数</span><span class='count'> 82</span></div>
  21. <div><span class='text'>转发次数</span><span class='count'> 82</span></div>
  22. </div>
  23. </div>
  24. <div class='header-item'>
  25. </div>
  26. </div>
  27. <div class='index-main'>
  28. <div class='main-item'>
  29. <div class='item-title'>期刊统计</div>
  30. <div class='item-more'>查看更多>></div>
  31. </div>
  32. <div class='main-content'>
  33. <div class='c1'>
  34. <div class='c1-title'>学期期刊分布</div>
  35. <div ref='subject' style="width:100%;height:250px;"></div>
  36. </div>
  37. <div class='c2'>
  38. <div class='c2-title'>单位期刊统计</div>
  39. <div ref='company' style="width:100%;height:250px;"></div>
  40. </div>
  41. <div class='c1'>
  42. <div class='c1-title'>期刊文章TOP5</div>
  43. <div ref='article' style="width:100%;height:250px;"></div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class='index-main'>
  48. <div class='main-item'>
  49. <div class='item-title'>文章统计</div>
  50. <div class='item-more'>查看更多>></div>
  51. </div>
  52. <div class='main-content'>
  53. <div class='c1'>
  54. <div class='c1-title'>文章来源分析</div>
  55. <div ref='article_sorce' style="width:100%;height:300px;"></div>
  56. </div>
  57. <div class='c2'>
  58. <div class='c2-title'>文章发布/时间统计</div>
  59. <div ref='article_time' style="width:100%;height:250px;"></div>
  60. </div>
  61. <div class='c1'>
  62. <div class='c1-title'>文章阅读量TOP5</div>
  63. <div ref='article_ready' style="width:100%;height:300px;"></div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class='index-main'>
  68. <div class='main-item'>
  69. <div class='item-title'>会议统计</div>
  70. <div class='item-more'>查看更多>></div>
  71. </div>
  72. <div class='main-content'>
  73. <div class='c1'>
  74. <div class='c1-title'>会议主办方统计</div>
  75. <div ref='meet_count' style="width:100%;height:300px;"></div>
  76. </div>
  77. <div class='c1'>
  78. <div class='c2-title'>会议发布/时间统计</div>
  79. <div ref='meet_time' style="width:100%;height:250px;"></div>
  80. </div>
  81. </div>
  82. </div>
  83. </section>
  84. </template>
  85. <script>
  86. import echarts from 'echarts';
  87. export default {
  88. data(){
  89. return {
  90. }
  91. },
  92. methods:{
  93. getEcharts(){
  94. var myChart = this.$echarts.init(this.$refs.subject);
  95. var myChart1 = this.$echarts.init(this.$refs.company);
  96. var myChart2 = this.$echarts.init(this.$refs.article);
  97. var myChart3 = this.$echarts.init(this.$refs.article_sorce);
  98. var myChart4 = this.$echarts.init(this.$refs.article_time);
  99. // var myChart5 = this.$echarts.init(this.$refs.article_ready);
  100. // 学科期刊
  101. let option = {
  102. // backgroundColor: '#fff',
  103. tooltip: {
  104. trigger: 'item',
  105. formatter: '{a} <br/>{b} : {c} ({d}%)'
  106. },
  107. // color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
  108. visualMap: {
  109. show: false,
  110. min: 80,
  111. max: 600,
  112. inRange: {
  113. // colorLightness: [0, 1]
  114. color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
  115. }
  116. },
  117. series: [
  118. {
  119. name: '访问来源',
  120. type: 'pie',
  121. radius: '55%',
  122. center: ['50%', '50%'],
  123. data: [
  124. {value: 335, name: '学术'},
  125. {value: 310, name: '学术'},
  126. {value: 274, name: '学术'},
  127. {value: 235, name: '学术'},
  128. {value: 400, name: '学术'}
  129. ].sort(function (a, b) { return a.value - b.value; }),
  130. roseType: 'radius',
  131. label: {
  132. color: 'rgba(102, 102, 102,1)',
  133. fontSize:14
  134. },
  135. labelLine: {
  136. lineStyle: {
  137. color: 'rgba(000, 000, 000, 0.1)'
  138. },
  139. smooth: 0.2,
  140. length: 8,
  141. length2: 5
  142. },
  143. // itemStyle: {
  144. // // color: '#c23531',
  145. // // shadowBlur: 200,
  146. // // shadowColor: 'rgba(0, 0, 0, 0.5)'
  147. // },
  148. animationType: 'scale',
  149. animationEasing: 'elasticOut',
  150. animationDelay: function (idx) {
  151. return Math.random() * 200;
  152. }
  153. }
  154. ]
  155. };
  156. // 单位期刊统计
  157. let option1 = {
  158. color: ['#5066FF'],
  159. tooltip: {
  160. trigger: 'axis',
  161. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  162. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  163. }
  164. },
  165. grid: {
  166. left: '3%',
  167. right: '4%',
  168. bottom: '3%',
  169. top:'10%',
  170. containLabel: true
  171. },
  172. xAxis: [
  173. {
  174. type: 'category',
  175. data: ['Mon', 'Tue', 'Wed', 'Thu'],
  176. axisTick: {
  177. alignWithLabel: true
  178. },
  179. axisLine: {
  180. lineStyle: {
  181. color: '#D4D8EE',
  182. width: 2 ,
  183. type:'dotted',
  184. }
  185. },
  186. axisLabel:{
  187. formatter:function(val) {
  188. console.log(val,"")
  189. return '中国科学院成都生物研究所 中国科学院成都生物研究所' //对每个标签处理后的结果(通过js字符串方法处理)
  190. },
  191. // x轴字体颜色
  192. textStyle: {
  193. color: '#999999',
  194. // lineHeight: 20,
  195. fontSize: 12
  196. },
  197. align:'left',
  198. padding:[10,0 ,0,-40],
  199. }
  200. }
  201. ],
  202. yAxis: [
  203. {
  204. type: 'value',
  205. boundaryGap: ['0%', '20%'],
  206. axisTick: {
  207. show: false
  208. },
  209. axisLine: {
  210. show: false,
  211. },
  212. axisLabel: {
  213. show: true,
  214. textStyle: {
  215. color: '#666666', //更改坐标轴文字颜色
  216. fontSize : 14 //更改坐标轴文字大小
  217. }
  218. },
  219. splitLine: {
  220. show: true,
  221. lineStyle:{
  222. type:'dashed'
  223. }
  224. }
  225. // data:['0' , '100' , '200' , '300,400]
  226. }
  227. ],
  228. series: [
  229. {
  230. name: '直接访问',
  231. type: 'bar',
  232. barWidth: '60%',
  233. data: [10, 52, 200, 334],
  234. itemStyle: {
  235. //柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
  236. normal: {
  237. //柱形图圆角,初始化效果
  238. barBorderRadius:[10, 10, 10, 10]
  239. }
  240. },
  241. }
  242. ]
  243. };
  244. // 期刊文章前5
  245. let option2 = {
  246. // title: {
  247. // text: '世界人口总量',
  248. // subtext: '数据来自网络'
  249. // },
  250. tooltip: {
  251. trigger: 'axis',
  252. axisPointer: {
  253. type: 'shadow'
  254. }
  255. },
  256. // legend: {
  257. // data: ['2011年', '2012年']
  258. // },
  259. grid: {
  260. left: '3%',
  261. right: '4%',
  262. bottom: '3%',
  263. top:'10%',
  264. containLabel: true
  265. },
  266. xAxis: {
  267. type: 'value',
  268. show:false,
  269. // boundaryGap: ['0', '50%']
  270. },
  271. yAxis: {
  272. // show:false,
  273. type: 'category',
  274. axisTick: {
  275. show: false
  276. },
  277. axisLine: {
  278. show: false,
  279. },
  280. data: ['应用物理', '应用物理', '应用物理', '应用物理', '应用物理']
  281. },
  282. series: [
  283. // {
  284. // name: '2011年',
  285. // type: 'bar',
  286. // data: [18203, 23489, 29034, 104970, 131744]
  287. // },
  288. {
  289. name: '2012年',
  290. type: 'bar',
  291. data: [19325, 23438, 31000, 121594, 134141],
  292. barWidth: '30%',
  293. itemStyle: {
  294. //柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
  295. normal: {
  296. //柱形图圆角,初始化效果
  297. barBorderRadius:[10, 10, 10, 10],
  298. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  299. offset: 0,
  300. color: '#FF852C'
  301. }, {
  302. offset: 1,
  303. color: '#FFCF29'
  304. }]),
  305. label: {
  306. show: true, //开启显示
  307. position: 'right', //在上方显示
  308. textStyle: { //数值样式
  309. color: '#666666',
  310. fontSize: 14
  311. }
  312. }
  313. },
  314. }
  315. }
  316. ]
  317. };
  318. // 文章来源分布
  319. let option3 = {
  320. // backgroundColor: '#fff',
  321. tooltip: {
  322. trigger: 'item',
  323. formatter: '{a} <br/>{b} : {c} ({d}%)'
  324. },
  325. // color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
  326. visualMap: {
  327. show: false,
  328. min: 80,
  329. max: 600,
  330. inRange: {
  331. // colorLightness: [0, 1]
  332. color:['yellow','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
  333. }
  334. },
  335. series: [
  336. {
  337. name: '访问来源',
  338. type: 'pie',
  339. radius: '55%',
  340. center: ['50%', '50%'],
  341. data: [
  342. {value: 300, name: '液晶与显示'},
  343. {value: 310, name: '化学进展'},
  344. {value: 274, name: '化学进展'},
  345. {value: 235, name: '化学进展'},
  346. {value: 400, name: '化学进展'}
  347. ].sort(function (a, b) { return a.value - b.value; }),
  348. roseType: 'radius',
  349. label: {
  350. color: 'rgba(102, 102, 102,1)',
  351. fontSize:14
  352. },
  353. labelLine: {
  354. lineStyle: {
  355. color: 'rgba(000, 000, 000, 0.1)'
  356. },
  357. smooth: 0.2,
  358. length: 8,
  359. length2: 5
  360. },
  361. // itemStyle: {
  362. // // color: '#c23531',
  363. // // shadowBlur: 200,
  364. // // shadowColor: 'rgba(0, 0, 0, 0.5)'
  365. // },
  366. animationType: 'scale',
  367. animationEasing: 'elasticOut',
  368. animationDelay: function (idx) {
  369. return Math.random() * 200;
  370. }
  371. }
  372. ]
  373. };
  374. // 文章分布/时间统计
  375. let option4 = {
  376. xAxis: {
  377. type: 'category',
  378. axisLine: {
  379. lineStyle: {
  380. color: '#D4D8EE',
  381. width: 2 ,
  382. type:'dotted',
  383. }
  384. },
  385. axisLabel:{
  386. formatter:function(val) {
  387. console.log(val,"")
  388. return '中国科学院成都生物研究所 中国科学院成都生物研究所' //对每个标签处理后的结果(通过js字符串方法处理)
  389. },
  390. // x轴字体颜色
  391. textStyle: {
  392. color: '#999999',
  393. // lineHeight: 20,
  394. fontSize: 12
  395. },
  396. align:'left',
  397. padding:[10,0 ,0,-40],
  398. }
  399. },
  400. yAxis: {
  401. type: 'value',
  402. splitLine: {
  403. show: true,
  404. lineStyle:{
  405. type:'dashed'
  406. }
  407. },
  408. axisTick: {
  409. show: false,
  410. interval:100,
  411. },
  412. axisLine: {
  413. show: false,
  414. },
  415. boundaryGap: ['0%', '10%'],
  416. },
  417. series: [{
  418. data: [20, 50, 100, 200, 250, 300, 200],
  419. type: 'line',
  420. smooth: true
  421. }]
  422. };
  423. myChart.setOption(option);
  424. myChart1.setOption(option1);
  425. myChart2.setOption(option2);
  426. myChart3.setOption(option3);
  427. myChart4.setOption(option4);
  428. }
  429. },
  430. mounted(){
  431. this.getEcharts();
  432. },
  433. created(){
  434. }
  435. }
  436. </script>
  437. <style lang='scss' scoped>
  438. /deep/.el-main{
  439. }
  440. section{
  441. width:100%;
  442. overflow:scroll;
  443. .index_header{
  444. background: #FFFFFF;
  445. height:102px;
  446. border-radius: 10px;
  447. display:flex;
  448. align-items: center;
  449. .header-item{
  450. flex:1;
  451. display:flex;
  452. justify-content: space-evenly;
  453. align-items: center;
  454. height:56px;
  455. &:not(:last-child){
  456. border-right:1px solid #d8d8d8;
  457. }
  458. .text{
  459. font-size: 16px;
  460. color: #666666;
  461. }
  462. .count{
  463. font-size: 32px;
  464. }
  465. .item-img{
  466. display:flex;
  467. img{
  468. width:56px;
  469. height:56px;
  470. margin-right:30px;
  471. }
  472. .text{
  473. position:relative;
  474. top:-8px;
  475. }
  476. .count{
  477. color: #208CFE;
  478. position:relative;
  479. bottom:-11px;
  480. }
  481. }
  482. .item-text{
  483. &>div{
  484. display:flex;
  485. align-items: center;
  486. .text{
  487. width:120px;
  488. }
  489. }
  490. }
  491. }
  492. }
  493. .index-main{
  494. background: #FFFFFF;
  495. border-radius: 10px;
  496. margin-top:20px;
  497. padding:20px;
  498. .main-item{
  499. position:relative;
  500. .item-title{
  501. font-size: 18px;
  502. font-weight: bold;
  503. color: #333333;
  504. margin-bottom:20px;
  505. }
  506. .item-more{
  507. position:absolute;
  508. top:20px;
  509. right:20px;
  510. font-size: 14px;
  511. color: #3895FE;
  512. }
  513. }
  514. .main-content{
  515. display:flex;
  516. &>div:not(:last-child){
  517. border-right:1px solid #eee;
  518. }
  519. .c1{
  520. flex:1;
  521. }
  522. .c2{
  523. flex:1.5;
  524. }
  525. .c1,.c2{
  526. width:100%;
  527. // flex:1;
  528. padding:10px;
  529. box-sizing: border-box;
  530. }
  531. .c1-title,.c2-title{
  532. font-size: 15px;
  533. font-weight: bold;
  534. color: #666666;
  535. // margin-top:20px;
  536. }
  537. }
  538. }
  539. }
  540. </style>