Index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <template>
  2. <section v-if="this.role_id==1" 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">
  8. 期刊总数 <br /><span class="count">{{
  9. form.journal_total
  10. }}</span></span
  11. >
  12. </div>
  13. <div class="item-img">
  14. <img src="../assets/network.png" alt="" />
  15. <span class="text">
  16. 文章发布量 <br /><span class="count">{{
  17. form.article_total
  18. }}</span></span
  19. >
  20. </div>
  21. </div>
  22. <div class="header-item">
  23. <div class="item-text">
  24. <div>
  25. <span class="text">会议举办次数</span
  26. ><span class="count">{{ form.conference_total }}</span>
  27. </div>
  28. <div>
  29. <span class="text">活动举办次数</span>
  30. <span class="count">{{ form.activity_total }}</span>
  31. </div>
  32. </div>
  33. <div class="item-text">
  34. <div>
  35. <span class="text">总阅读次数</span
  36. ><span class="count">{{ form.article_readnum }}</span>
  37. </div>
  38. <div>
  39. <span class="text">转发次数</span
  40. ><span class="count">{{ form.article_forwardnum }}</span>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="header-item" style="position: relative">
  45. <span style="position: absolute; top: 0; left: 5px; color: #666"
  46. >搜索热词</span
  47. >
  48. <wordcloud
  49. v-if="form.search_hot_word"
  50. style="width: 80%; height: 100px; margin-left: 20%"
  51. :data="form.search_hot_word"
  52. nameKey="name"
  53. :fontSize="[10, 24]"
  54. valueKey="value"
  55. :color="myColors"
  56. :showTooltip="false"
  57. >
  58. </wordcloud>
  59. </div>
  60. </div>
  61. <div class="index-main">
  62. <div class="main-item">
  63. <div class="item-title">期刊统计</div>
  64. <div class="item-more">查看更多>></div>
  65. </div>
  66. <div class="main-content">
  67. <div class="c1">
  68. <div class="c1-title">学科期刊分布</div>
  69. <div ref="subject" style="width: 100%; height: 250px"></div>
  70. </div>
  71. <div class="c2">
  72. <div class="c2-title">单位期刊统计</div>
  73. <div ref="company" style="width: 100%; height: 250px"></div>
  74. </div>
  75. <div class="c1">
  76. <div class="c1-title">期刊文章TOP5</div>
  77. <div ref="article" style="width: 100%; height: 250px"></div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="index-main">
  82. <div class="main-item">
  83. <div class="item-title">文章统计</div>
  84. <div class="item-more">查看更多>></div>
  85. </div>
  86. <div class="main-content">
  87. <div class="c1">
  88. <div class="c1-title">文章来源分析</div>
  89. <div ref="article_sorce" style="width: 100%; height: 250px"></div>
  90. </div>
  91. <div class="c2">
  92. <div class="c2-title">文章发布/时间统计</div>
  93. <div ref="article_time" style="width: 100%; height: 250px"></div>
  94. </div>
  95. <div class="c1">
  96. <div class="c1-title">文章阅读量TOP5</div>
  97. <div ref="article_ready" style="width: 100%; height: 250px">
  98. <div class="h2">
  99. <span>序号</span>
  100. <span>文章标题</span>
  101. <span>阅读次数</span>
  102. </div>
  103. <div
  104. class="con2"
  105. v-for="(item, index) in form.article_readnum_top5"
  106. :key="index"
  107. >
  108. <span>{{ index + 1 }}</span>
  109. <span class="a_title">{{ item.name }}</span>
  110. <span>{{ item.read_num }}</span>
  111. </div>
  112. <div></div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="index-main">
  118. <div class="main-item">
  119. <div class="item-title">会议统计</div>
  120. <div class="item-more">查看更多>></div>
  121. </div>
  122. <div class="main-content">
  123. <div class="c1">
  124. <div class="c1-title">会议主办方统计</div>
  125. <div ref="meet_count" style="width: 100%; height: 250px"></div>
  126. </div>
  127. <div class="c1">
  128. <div class="c2-title">会议发布/时间统计</div>
  129. <div ref="meet_time" style="width: 100%; height: 250px"></div>
  130. </div>
  131. </div>
  132. </div>
  133. </section>
  134. <!-- 期刊管理员首页 -->
  135. <section v-else>
  136. <CASCI></CASCI>
  137. </section>
  138. </template>
  139. <script>
  140. import echarts from "echarts";
  141. import wordcloud from "vue-wordcloud";
  142. import CASCI from '../components/CASCI'
  143. export default {
  144. data() {
  145. return {
  146. // chartData: [],
  147. form: {},
  148. list: [
  149. { article_header: "中国生态效率时空演化研究", count: "132" },
  150. { article_header: "中国生态效率时空演化研究", count: "132" },
  151. { article_header: "中国生态效率时空演化研究", count: "132" },
  152. { article_header: "中国生态效率时空演化研究", count: "132" },
  153. { article_header: "中国生态效率时空演化研究", count: "132" },
  154. ],
  155. myColors: ["#1f77b4", "#629fc9", "#94bedb", "#c9e0ef"],
  156. role_id:1
  157. };
  158. },
  159. components: {
  160. wordcloud,
  161. CASCI
  162. },
  163. computed: {},
  164. methods: {
  165. getEcharts() {
  166. var myChart = this.$echarts.init(this.$refs.subject);
  167. var myChart1 = this.$echarts.init(this.$refs.company);
  168. var myChart2 = this.$echarts.init(this.$refs.article);
  169. var myChart3 = this.$echarts.init(this.$refs.article_sorce);
  170. var myChart4 = this.$echarts.init(this.$refs.article_time);
  171. var myChart5 = this.$echarts.init(this.$refs.meet_count);
  172. var myChart6 = this.$echarts.init(this.$refs.meet_time);
  173. // 学科期刊
  174. let option = {
  175. backgroundColor: "#fff",
  176. // title: {
  177. // text: 'Customized Pie',
  178. // left: 'center',
  179. // top: 20,
  180. // textStyle: {
  181. // color: '#ccc'
  182. // }
  183. // },
  184. color: ["#9379ff", "#62A2FF", "#FFD053", "#FF9F41", "#FF542C"],
  185. tooltip: {
  186. trigger: "item",
  187. formatter: "{a} <br/>{b} : {c} ({d}%)",
  188. },
  189. // visualMap: {
  190. // show: false,
  191. // min: 80,
  192. // max: 600,
  193. // inRange: {
  194. // colorLightness: [0, 1]
  195. // }
  196. // },
  197. series: [
  198. {
  199. name: "期刊数量",
  200. type: "pie",
  201. radius: "55%",
  202. center: ["50%", "50%"],
  203. // data: [
  204. // { value: 335, name: "直接访问" },
  205. // { value: 310, name: "邮件营销" },
  206. // { value: 274, name: "联盟广告" },
  207. // { value: 235, name: "视频广告" },
  208. // { value: 400, name: "搜索引擎" },
  209. // ].sort(function (a, b) {
  210. // return a.value - b.value;
  211. // }),
  212. data: this.form.subject_journal.sort(function (a, b) {
  213. return a.value - b.value;
  214. }),
  215. roseType: "radius",
  216. label: {
  217. color: "rgba(102, 102, 102,1)",
  218. fontSize: 14,
  219. },
  220. labelLine: {
  221. lineStyle: {
  222. color: "rgba(000, 000, 000, 0.1)",
  223. },
  224. smooth: 0.2,
  225. length: 8,
  226. length2: 5,
  227. },
  228. itemStyle: {
  229. // color: '#c23531',
  230. // shadowBlur: 200,
  231. // shadowColor: 'rgba(0, 0, 0, 0.5)'
  232. },
  233. animationType: "scale",
  234. animationEasing: "elasticOut",
  235. animationDelay: function (idx) {
  236. return Math.random() * 200;
  237. },
  238. },
  239. ],
  240. };
  241. // 单位期刊统计
  242. let option1 = {
  243. color: ["#5066FF"],
  244. tooltip: {
  245. trigger: "axis",
  246. axisPointer: {
  247. // 坐标轴指示器,坐标轴触发有效
  248. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  249. },
  250. },
  251. grid: {
  252. left: "3%",
  253. right: "4%",
  254. bottom: "3%",
  255. top: "10%",
  256. containLabel: true,
  257. },
  258. xAxis: [
  259. {
  260. type: "category",
  261. // data: ["Mon", "Tue", "Wed", "Thu"],
  262. data: this.form.organizer_journal_x,
  263. axisTick: {
  264. alignWithLabel: true,
  265. },
  266. axisLine: {
  267. lineStyle: {
  268. color: "#D4D8EE",
  269. width: 2,
  270. type: "dotted",
  271. },
  272. },
  273. axisLabel: {
  274. formatter: function (val) {
  275. // return "中国科"; //对每个标签处理后的结果(通过js字符串方法处理)
  276. return val;
  277. },
  278. // x轴字体颜色
  279. textStyle: {
  280. color: "#999999",
  281. // lineHeight: 20,
  282. fontSize: 12,
  283. },
  284. align: "center",
  285. // padding:[10,0 ,0,-40],
  286. },
  287. },
  288. ],
  289. yAxis: [
  290. {
  291. type: "value",
  292. boundaryGap: ["0%", "20%"],
  293. axisTick: {
  294. show: false,
  295. },
  296. axisLine: {
  297. show: false,
  298. },
  299. axisLabel: {
  300. show: true,
  301. textStyle: {
  302. color: "#666666", //更改坐标轴文字颜色
  303. fontSize: 14, //更改坐标轴文字大小
  304. },
  305. },
  306. splitLine: {
  307. show: true,
  308. lineStyle: {
  309. type: "dashed",
  310. },
  311. },
  312. // data:['0' , '100' , '200' , '300,400]
  313. },
  314. ],
  315. series: [
  316. {
  317. name: "期刊数量",
  318. type: "bar",
  319. barWidth: "40%",
  320. // data: [10, 52, 200, 334],
  321. data: this.form.organizer_journal_y,
  322. itemStyle: {
  323. //柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
  324. normal: {
  325. //柱形图圆角,初始化效果
  326. barBorderRadius: [10, 10, 10, 10],
  327. },
  328. },
  329. },
  330. ],
  331. };
  332. // 期刊文章前5
  333. let option2 = {
  334. // title: {
  335. // text: '世界人口总量',
  336. // subtext: '数据来自网络'
  337. // },
  338. tooltip: {
  339. trigger: "axis",
  340. axisPointer: {
  341. type: "shadow",
  342. },
  343. },
  344. // legend: {
  345. // data: ['2011年', '2012年']
  346. // },
  347. grid: {
  348. left: "3%",
  349. right: "4%",
  350. bottom: "3%",
  351. top: "10%",
  352. containLabel: true,
  353. },
  354. xAxis: {
  355. type: "value",
  356. show: false,
  357. // boundaryGap: ['0', '50%']
  358. },
  359. yAxis: {
  360. // show:false,
  361. type: "category",
  362. axisTick: {
  363. show: false,
  364. },
  365. axisLine: {
  366. show: false,
  367. },
  368. // data: ["应用物理", "应用物理", "应用物理", "应用物理", "应用物理"],
  369. data: this.form.journal_article_x,
  370. },
  371. series: [
  372. // {
  373. // name: '2011年',
  374. // type: 'bar',
  375. // data: [18203, 23489, 29034, 104970, 131744]
  376. // },
  377. {
  378. name: "文章数量",
  379. type: "bar",
  380. // data: [19325, 23438, 31000, 121594, 134141],
  381. data: this.form.journal_article_y,
  382. barWidth: "30%",
  383. itemStyle: {
  384. //柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
  385. normal: {
  386. //柱形图圆角,初始化效果
  387. barBorderRadius: [10, 10, 10, 10],
  388. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  389. {
  390. offset: 0,
  391. color: "#FF852C",
  392. },
  393. {
  394. offset: 1,
  395. color: "#FFCF29",
  396. },
  397. ]),
  398. label: {
  399. show: true, //开启显示
  400. position: "right", //在上方显示
  401. textStyle: {
  402. //数值样式
  403. color: "#666666",
  404. fontSize: 14,
  405. },
  406. },
  407. },
  408. },
  409. },
  410. ],
  411. };
  412. // 文章来源分布
  413. let option3 = {
  414. backgroundColor: "#fff",
  415. // title: {
  416. // text: 'Customized Pie',
  417. // left: 'center',
  418. // top: 20,
  419. // textStyle: {
  420. // color: '#ccc'
  421. // }
  422. // },
  423. color: ["#FA9022", "#DCDB01", "#8C70F8", "#34A6FE", "#2A4AD1"],
  424. tooltip: {
  425. trigger: "item",
  426. formatter: "{a} <br/>{b} : {c} ({d}%)",
  427. },
  428. // visualMap: {
  429. // show: false,
  430. // min: 80,
  431. // max: 600,
  432. // inRange: {
  433. // colorLightness: [0, 1]
  434. // }
  435. // },
  436. series: [
  437. {
  438. name: "访问来源",
  439. type: "pie",
  440. radius: "55%",
  441. center: ["50%", "50%"],
  442. // data: [
  443. // { value: 335, name: "直接访问" },
  444. // { value: 310, name: "邮件营销" },
  445. // { value: 274, name: "联盟广告" },
  446. // { value: 235, name: "视频广告" },
  447. // { value: 400, name: "搜索引擎" },
  448. // ].sort(function (a, b) {
  449. // return a.value - b.value;
  450. // }),
  451. // data:this.form.journal_article.sort(function(a,b){return a.value-b.value}),
  452. data: this.form.journal_article,
  453. roseType: "radius",
  454. label: {
  455. color: "rgba(102, 102, 102,1)",
  456. fontSize: 14,
  457. },
  458. labelLine: {
  459. lineStyle: {
  460. color: "rgba(000, 000, 000, 0.1)",
  461. },
  462. smooth: 0.2,
  463. length: 8,
  464. length2: 5,
  465. },
  466. itemStyle: {
  467. // color: '#c23531',
  468. // shadowBlur: 200,
  469. // shadowColor: 'rgba(0, 0, 0, 0.5)'
  470. },
  471. animationType: "scale",
  472. animationEasing: "elasticOut",
  473. animationDelay: function (idx) {
  474. return Math.random() * 200;
  475. },
  476. },
  477. ],
  478. };
  479. // 文章分布/时间统计
  480. let option4 = {
  481. color: "#FFB81E",
  482. grid: {
  483. left: "3%",
  484. right: "4%",
  485. bottom: "3%",
  486. top: "10%",
  487. containLabel: true,
  488. },
  489. xAxis: {
  490. type: "category",
  491. boundaryGap: false,
  492. axisLine: {
  493. lineStyle: {
  494. color: "#D4D8EE",
  495. width: 2,
  496. // type:'dotted',
  497. },
  498. },
  499. // data: ["1", "2", "3", "", "", "", ""],
  500. data: this.form.pubtime_article_x,
  501. axisLabel: {
  502. formatter: function (val) {
  503. // return "中国科学院成都生物研究所 中国科学院成都生物研究所"; //对每个标签处理后的结果(通过js字符串方法处理)
  504. return val;
  505. },
  506. // x轴字体颜色
  507. textStyle: {
  508. color: "#999999",
  509. // lineHeight: 20,
  510. // fontSize: 12
  511. },
  512. align: "left",
  513. // padding:[10,0 ,0,-40],
  514. },
  515. },
  516. yAxis: {
  517. type: "value",
  518. splitLine: {
  519. show: true,
  520. lineStyle: {
  521. type: "dashed",
  522. },
  523. },
  524. axisTick: {
  525. show: false,
  526. interval: 100,
  527. },
  528. axisLine: {
  529. show: false,
  530. },
  531. boundaryGap: ["0%", "30%"],
  532. },
  533. series: [
  534. {
  535. // data: [50, 200, 20, 300, 150, 300, 100],
  536. data: this.form.pubtime_article_y,
  537. type: "line",
  538. symbol: "none", //取消折点圆圈
  539. areaStyle: {
  540. color: {
  541. type: "linear",
  542. x: 0,
  543. y: 0,
  544. x2: 0,
  545. y2: 1,
  546. colorStops: [
  547. {
  548. offset: 0,
  549. color: "#FFC765", // 0% 处的颜色
  550. },
  551. {
  552. offset: 1,
  553. color: "#ffffff", // 100% 处的颜色
  554. },
  555. ],
  556. global: false, // 缺省为 false
  557. },
  558. },
  559. smooth: true,
  560. },
  561. ],
  562. };
  563. // 会议主办方统计
  564. let option5 = {
  565. color: ["#5066FF"],
  566. tooltip: {
  567. trigger: "axis",
  568. axisPointer: {
  569. // 坐标轴指示器,坐标轴触发有效
  570. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  571. },
  572. },
  573. grid: {
  574. left: "3%",
  575. right: "4%",
  576. bottom: "3%",
  577. top: "10%",
  578. containLabel: true,
  579. },
  580. xAxis: [
  581. {
  582. type: "category",
  583. // data: ["", "", "", "", "", ""],
  584. data: this.form.organizer_conference_x,
  585. axisTick: {
  586. alignWithLabel: true,
  587. },
  588. axisLine: {
  589. lineStyle: {
  590. color: "#D4D8EE",
  591. width: 2,
  592. type: "dotted",
  593. },
  594. },
  595. axisLabel: {
  596. formatter: function (val) {
  597. // return "中国科"; //对每个标签处理后的结果(通过js字符串方法处理)
  598. return val;
  599. },
  600. // x轴字体颜色
  601. textStyle: {
  602. color: "#999999",
  603. // lineHeight: 20,
  604. fontSize: 12,
  605. },
  606. align: "center",
  607. // padding:[10,0 ,0,-40],
  608. },
  609. },
  610. ],
  611. yAxis: [
  612. {
  613. type: "value",
  614. boundaryGap: ["0%", "20%"],
  615. axisTick: {
  616. show: false,
  617. },
  618. axisLine: {
  619. show: false,
  620. },
  621. axisLabel: {
  622. show: true,
  623. textStyle: {
  624. color: "#666666", //更改坐标轴文字颜色
  625. fontSize: 14, //更改坐标轴文字大小
  626. },
  627. },
  628. splitLine: {
  629. show: true,
  630. lineStyle: {
  631. type: "dashed",
  632. },
  633. },
  634. // data:['0' , '100' , '200' , '300,400]
  635. },
  636. ],
  637. series: [
  638. {
  639. name: "会议数量",
  640. type: "bar",
  641. barWidth: "40%",
  642. // data: [50, 52, 200, 334, 45, 190, 240],
  643. data: this.form.organizer_conference_y,
  644. itemStyle: {
  645. //柱形图圆角,鼠标移上去效果,如果只是一个数字则说明四个参数全部设置为那么多
  646. normal: {
  647. //柱形图圆角,初始化效果
  648. barBorderRadius: [10, 10, 10, 10],
  649. },
  650. },
  651. },
  652. ],
  653. };
  654. // 会议发布/时间统计
  655. let option6 = {
  656. color: "#FFB81E",
  657. grid: {
  658. left: "3%",
  659. right: "4%",
  660. bottom: "3%",
  661. top: "10%",
  662. containLabel: true,
  663. },
  664. xAxis: {
  665. type: "category",
  666. boundaryGap: false,
  667. axisLine: {
  668. lineStyle: {
  669. color: "#D4D8EE",
  670. width: 2,
  671. // type:'dotted',
  672. },
  673. },
  674. // data: ["1", "1", "1", "1", "1", "1", "1"],
  675. data: this.form.pubtime_conference_x,
  676. axisLabel: {
  677. formatter: function (val) {
  678. return val;
  679. },
  680. // x轴字体颜色
  681. textStyle: {
  682. color: "#999999",
  683. // lineHeight: 20,
  684. // fontSize: 12
  685. },
  686. align: "left",
  687. // padding:[10,0 ,0,-40],
  688. },
  689. },
  690. yAxis: {
  691. type: "value",
  692. splitLine: {
  693. show: true,
  694. lineStyle: {
  695. type: "dashed",
  696. },
  697. },
  698. axisTick: {
  699. show: false,
  700. interval: 100,
  701. },
  702. axisLine: {
  703. show: false,
  704. },
  705. boundaryGap: ["0%", "30%"],
  706. },
  707. series: [
  708. {
  709. // data: [50, 200, 20, 300, 150, 300, 100],
  710. data: this.form.pubtime_conference_y,
  711. type: "line",
  712. symbol: "none", //取消折点圆圈
  713. areaStyle: {
  714. color: {
  715. type: "linear",
  716. x: 0,
  717. y: 0,
  718. x2: 0,
  719. y2: 1,
  720. colorStops: [
  721. {
  722. offset: 0,
  723. color: "#FFC765", // 0% 处的颜色
  724. },
  725. {
  726. offset: 1,
  727. color: "#ffffff", // 100% 处的颜色
  728. },
  729. ],
  730. global: false, // 缺省为 false
  731. },
  732. },
  733. smooth: true,
  734. },
  735. ],
  736. };
  737. myChart.setOption(option);
  738. myChart1.setOption(option1);
  739. myChart2.setOption(option2);
  740. myChart3.setOption(option3);
  741. myChart4.setOption(option4);
  742. myChart5.setOption(option5);
  743. myChart6.setOption(option6);
  744. },
  745. getData() {
  746. this.$api.getIndexData({}).then((res) => {
  747. this.form = res.data.data;
  748. this.form.search_hot_word = this.form.search_hot_word.concat(
  749. this.form.search_hot_word
  750. );
  751. let organizer_journal_x = [];
  752. let organizer_journal_y = [];
  753. let journal_article_x = [];
  754. let journal_article_y = [];
  755. let pubtime_article_x = [];
  756. let pubtime_article_y = [];
  757. let organizer_conference_x = [];
  758. let organizer_conference_y = [];
  759. let pubtime_conference_x = [];
  760. let pubtime_conference_y = [];
  761. this.form.organizer_journal.forEach((item, index) => {
  762. organizer_journal_x.push(item.name);
  763. organizer_journal_y.push(item.value);
  764. });
  765. this.form.journal_article_top5.forEach((item, index) => {
  766. journal_article_x.push(item.journal_name);
  767. journal_article_y.push(item.count);
  768. });
  769. this.form.pubtime_article.forEach((item, index) => {
  770. pubtime_article_x.push(item.publish_time);
  771. pubtime_article_y.push(item.count);
  772. });
  773. this.form.organizer_conference.forEach((item, index) => {
  774. organizer_conference_x.push(item.organizer_name);
  775. organizer_conference_y.push(item.count);
  776. });
  777. this.form.pubtime_conference.forEach((item, index) => {
  778. pubtime_conference_x.push(item.publish_time);
  779. pubtime_conference_y.push(item.count);
  780. });
  781. this.form.organizer_journal_x = organizer_journal_x;
  782. this.form.organizer_journal_y = organizer_journal_y;
  783. this.form.journal_article_x = journal_article_x.reverse();
  784. this.form.journal_article_y = journal_article_y.reverse();
  785. this.form.pubtime_article_x = pubtime_article_x;
  786. this.form.pubtime_article_y = pubtime_article_y;
  787. this.form.organizer_conference_x = organizer_journal_x;
  788. this.form.organizer_conference_y = organizer_journal_y;
  789. this.form.pubtime_conference_x = pubtime_conference_x;
  790. this.form.pubtime_conference_y = pubtime_conference_y;
  791. this.getEcharts();
  792. });
  793. },
  794. },
  795. mounted() {},
  796. beforeCreate(){
  797. this.$api.getAccountInfo().then((res) => {
  798. this.role_id = res.data.data.role_id;
  799. // this.getData();
  800. // var color = [];
  801. // for (let i = 0; i < 5; i++) {
  802. // let c =
  803. // "rgb(" +
  804. // [
  805. // Math.round(Math.random() * 160),
  806. // Math.round(Math.random() * 160),
  807. // Math.round(Math.random() * 160),
  808. // ].join(",") +
  809. // ")";
  810. // color.push(c);
  811. // }
  812. // this.myColors = color;
  813. });
  814. },
  815. created() {
  816. this.$api.getAccountInfo().then((res) => {
  817. this.role_id = res.data.data.role_id;
  818. this.getData();
  819. var color = [];
  820. for (let i = 0; i < 5; i++) {
  821. let c =
  822. "rgb(" +
  823. [
  824. Math.round(Math.random() * 160),
  825. Math.round(Math.random() * 160),
  826. Math.round(Math.random() * 160),
  827. ].join(",") +
  828. ")";
  829. color.push(c);
  830. }
  831. this.myColors = color;
  832. });
  833. },
  834. };
  835. </script>
  836. <style lang='scss' scoped>
  837. section {
  838. // width:100%;
  839. .index_header {
  840. background: #ffffff;
  841. height: 102px;
  842. border-radius: 10px;
  843. display: flex;
  844. align-items: center;
  845. .header-item {
  846. flex: 1;
  847. display: flex;
  848. justify-content: space-evenly;
  849. align-items: center;
  850. height: 56px;
  851. &:not(:last-child) {
  852. border-right: 1px solid #d8d8d8;
  853. }
  854. .text {
  855. font-size: 16px;
  856. color: #666666;
  857. }
  858. .count {
  859. font-size: 32px;
  860. }
  861. .item-img {
  862. display: flex;
  863. img {
  864. width: 56px;
  865. height: 56px;
  866. margin-right: 30px;
  867. }
  868. .text {
  869. position: relative;
  870. top: -8px;
  871. }
  872. .count {
  873. color: #208cfe;
  874. position: relative;
  875. bottom: -11px;
  876. }
  877. }
  878. .item-text {
  879. & > div {
  880. display: flex;
  881. align-items: center;
  882. .text {
  883. width: 120px;
  884. }
  885. }
  886. }
  887. }
  888. }
  889. .index-main {
  890. background: #ffffff;
  891. border-radius: 10px;
  892. margin-top: 20px;
  893. padding: 20px;
  894. .main-item {
  895. position: relative;
  896. .item-title {
  897. font-size: 18px;
  898. font-weight: bold;
  899. color: #333333;
  900. margin-bottom: 20px;
  901. }
  902. .item-more {
  903. position: absolute;
  904. top: 20px;
  905. right: 20px;
  906. font-size: 14px;
  907. color: #3895fe;
  908. }
  909. }
  910. .main-content {
  911. display: flex;
  912. & > div:not(:last-child) {
  913. border-right: 1px solid #eee;
  914. }
  915. .c1 {
  916. flex: 1;
  917. .h2 {
  918. font-size: 14px;
  919. color: #999999;
  920. height: 40px;
  921. line-height: 40px;
  922. width: 80%;
  923. span:nth-of-type(2) {
  924. margin-left: 20px;
  925. }
  926. span:last-child {
  927. float: right;
  928. }
  929. }
  930. .con2 {
  931. font-size: 14px;
  932. color: #333333;
  933. height: 36px;
  934. line-height: 36px;
  935. background: #fafafa;
  936. border-radius: 7px;
  937. margin-bottom: 8px;
  938. padding: 0 10px;
  939. display: flex;
  940. width: 80%;
  941. &:nth-of-type(2) {
  942. color: #ef3d3d;
  943. }
  944. &:nth-of-type(3) {
  945. color: #fdad23;
  946. }
  947. &:nth-of-type(4) {
  948. color: #56ccf6;
  949. }
  950. span:nth-of-type(2) {
  951. margin-left: 20px;
  952. }
  953. span:last-child {
  954. float: right;
  955. }
  956. .a_title {
  957. white-space: nowrap;
  958. text-overflow: ellipsis;
  959. overflow: hidden;
  960. width: 80%;
  961. }
  962. }
  963. }
  964. .c2 {
  965. flex: 1.5;
  966. }
  967. .c1,
  968. .c2 {
  969. width: 100%;
  970. // flex:1;
  971. padding: 10px;
  972. box-sizing: border-box;
  973. }
  974. .c1-title,
  975. .c2-title {
  976. font-size: 15px;
  977. font-weight: bold;
  978. color: #666666;
  979. // margin-top:20px;
  980. }
  981. }
  982. }
  983. }
  984. </style>