RealTimeInfoPeriodical.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <template>
  2. <div>
  3. <div class="autoBox box " style="padding-top: 0;">
  4. <!-- 主体部分 -->
  5. <Screen v-bind:screen1="screen1" :screen1def="screen1def" :screen2Item="screen2Item" :screen2="screen2" :screen6="screen6" @screenBack="screenBack"></Screen>
  6. </div>
  7. <div class="autoBox box" style="padding-top: 0;margin-top: 10px;height: 700px;">
  8. <div style="float: left;width: 18%;height: 100%;">
  9. <div style="width: 90%;height: 33px;line-height: 33px;text-align: center;background: #2c558a;font-size: 14px;color: #fff;margin:20px 0 0 10px">{{$t('common.JournalRecommendation')}}</div>
  10. <div>
  11. <div v-for="(item,index) in recommend" style="text-align: left;padding: 10px 0 0 15px;" @click="toView('RealTimeInfoJournaldetails',item.baseEntityId,index)">
  12. <img :src="'api/file/pub/'+ item.photo" alt="" style="width: 90%;height:170px;">
  13. <div style="font-size: 12px;color: #666;text-align:center">{{item.categoryName}}</div>
  14. </div>
  15. </div>
  16. </div>
  17. <div style="float: right;width: 81%;">
  18. <div style="width: 100%;height: 110px;border-bottom: 1px solid #ccc; position: relative;" class="select-input">
  19. <div class="select-input-position">
  20. <el-input :placeholder="$t('common.EnterContent')" v-model="title" class="input-with-select" maxlength="50" show-word-limit>
  21. <template slot="prepend">{{$t('common.Nameofpublication')}}</template>
  22. <!-- <el-select v-model="select" slot="prepend" :placeholder="$t('common.PleaseSelect')">
  23. <el-option :label="$t('common.Nameofpublication')" value="name"></el-option>
  24. <el-option label="$t('common.theme')" value="topic"></el-option>
  25. <el-option label="$t('common.Keywords')" value="label"></el-option>
  26. <el-option label="$t('common.Author')" value="author"></el-option>
  27. <el-option label="$t('common.Abstract')" value="abstractPoint"></el-option>
  28. <el-option label="$t('common.Source')" value="source"></el-option>
  29. </el-select> -->
  30. <el-button slot="append" @click="search">{{$t('common.Search')}}</el-button>
  31. </el-input>
  32. </div>
  33. <div class="select-input-realTime">
  34. {{$t('common.PeriodicalTotil')}} <span style="color: #2c558a;"> {{total}}</span> {{$t('common.PeriodicalJournal')}}
  35. </div>
  36. </div>
  37. <div style="width: 100%;margin-top: 10px;" class="select-input-realTime2">
  38. <ul>
  39. <li v-for="(i,index) in recommend2" @click="open(i.link)">
  40. <img :src="'api/file/pub/' + i.pictureUrl" alt="" style="height: 200px;width: 100%;" class="cursor" :title=i.name>
  41. <div style="font-size: 12px;color: #666;float: left;width: 160px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; ">
  42. <!-- <span style="width: 10px;height: 10px;background: #2c558a;display: inline-block;margin-right: 5px;"></span>-->
  43. {{i.name}}
  44. </div>
  45. </li>
  46. </ul>
  47. </div>
  48. <div v-if="total <=0" style="text-align: center;height: 60px;border-bottom: 1px solid #eee;border-top: 1px solid #eee;">
  49. <span v-if="$i18n.locale=='en'" style="line-height: 60px;">No data</span>
  50. <span v-else="$i18n.locale=='zh'" style="line-height: 60px;">暂无数据</span>
  51. </div>
  52. <div v-if="total >0" style="width: 100%;position: relative;height: 100px;">
  53. <div style="position: absolute;left: 50%;top: 30px;transform: translateX(-50%);">
  54. <el-pagination
  55. background
  56. layout="prev, pager, next"
  57. @current-change="handleCurrentChange"
  58. :total=total-0>
  59. </el-pagination>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import Screen from '@/components/screen'
  68. import { getDicts } from "@/api/dict";
  69. import {getInfoJournalViews,get,saveOrUpdate} from '@/api/realTimeInfo/infoJournalView'
  70. import {getJournalClassifications} from '@/api/realTimeInfo/journalClassification'
  71. export default {
  72. name: 'RealTimeInfoPeriodical',
  73. components:{Screen},
  74. data () {
  75. return {
  76. select:'name',
  77. title:'',
  78. total:0,
  79. screen2Item:null,
  80. screen1def:'',
  81. screen1:{
  82. value:'common.Journal',
  83. item:[]
  84. },
  85. screen2:{
  86. value:'common.Language',
  87. item:[]
  88. },
  89. screen6:{
  90. value:'common.Years',
  91. item:[{
  92. value:null,
  93. label:'common.All'
  94. },{
  95. value:'2021',
  96. label:'2021'
  97. },{
  98. value:'2020',
  99. label:'2020'
  100. },{
  101. value:'2019',
  102. label:'2019'
  103. },{
  104. value:'2018',
  105. label:'2018'
  106. }]
  107. },
  108. recommend:[],// 推荐期刊
  109. recommend2:[],
  110. screenData:{}
  111. }
  112. },
  113. mounted(){
  114. this.initData();
  115. },
  116. watch:{
  117. '$i18n.locale'(){
  118. this.initData();
  119. this.screenBack(this.screenData);
  120. },
  121. },
  122. methods:{
  123. initData(){
  124. getJournalClassifications({languageDict:this.$i18n.locale.toUpperCase()}).then(res =>{
  125. let data = res.data;
  126. let that = this;
  127. if(data){
  128. var typeDictValue = null;
  129. var screen1def = null;
  130. res.data.options.forEach(function (item) {
  131. if(that.$i18n.locale == 'zh'){
  132. if(item.label == '全球能源互联网(中文)' || item.label == 'Global Energy Interconnection(Chinese)'){
  133. typeDictValue = item.value;
  134. screen1def = item.value;
  135. that.screenData = {
  136. click1:item.value
  137. }
  138. }
  139. }
  140. if(that.$i18n.locale == 'en'){
  141. if(item.label == '全球能源互联网(英文)' || item.label == 'Global Energy Interconnection(English)'){
  142. typeDictValue = item.value;
  143. screen1def = item.value;
  144. that.screenData = {
  145. click1:item.value
  146. }
  147. }
  148. }
  149. })
  150. this.screen1def = screen1def;
  151. this.screen1.item=res.data.options;
  152. if(res.data.journalClassifications){
  153. this.recommend = res.data.journalClassifications.slice(0,3);
  154. }
  155. //2020-09-15 15:48:00要求英文版页面中英文放最上面
  156. if(this.$i18n.locale=='en'){
  157. var recommendLocal = this.recommend[0];
  158. this.recommend[0] = this.recommend[1];
  159. this.recommend[1] = recommendLocal;
  160. }
  161. this.screen1.item.unshift({
  162. label: "common.All",
  163. value: null,
  164. });
  165. let page={
  166. pageNo:1,
  167. pageSize:'10',
  168. typeDict:typeDictValue
  169. // language:this.$i18n.locale.toUpperCase()
  170. }
  171. this.getInitData(page);
  172. // this.getrecommendFlagList(page);// 获取推荐期刊
  173. }
  174. });
  175. getDicts(this.$i18n.locale=='zh'?"JOURNAL_DICT,JOURNAL_LANGUAGE_DICT":"JOURNAL_DICT_EN,JOURNAL_LANGUAGE_DICT_EN").then(res=>{
  176. console.log(res);
  177. // this.$i18n.locale=='en'?"CMS_INFORMATION_TYPE_DICT_EN":"CMS_INFORMATION_TYPE_DICT"
  178. //this.screen1.item=res.data[0];
  179. // this.recommend[0].label=res.data[0][0].label;
  180. // this.recommend[1].label=res.data[0][1].label;
  181. // this.recommend[2].label=res.data[0][2].label;
  182. this.screen2.item=res.data[1];
  183. this.screen2.item.unshift({
  184. label: "common.All",
  185. value: null,
  186. });
  187. });
  188. },
  189. // 字典值
  190. getList(){
  191. getJournalClassifications({languageDict:this.$i18n.locale.toUpperCase()}).then(res =>{
  192. let data = res.data;
  193. if(data){
  194. this.screen1.item=res.data.options;
  195. this.recommend = res.data.journalClassifications;
  196. this.screen1.item.unshift({
  197. label: "common.All",
  198. value: null,
  199. });
  200. }
  201. });
  202. getDicts(this.$i18n.locale=='zh'?"JOURNAL_DICT,JOURNAL_LANGUAGE_DICT":"JOURNAL_DICT_EN,JOURNAL_LANGUAGE_DICT_EN").then(res=>{
  203. console.log(res);
  204. // this.$i18n.locale=='en'?"CMS_INFORMATION_TYPE_DICT_EN":"CMS_INFORMATION_TYPE_DICT"
  205. //this.screen1.item=res.data[0];
  206. // this.recommend[0].label=res.data[0][0].label;
  207. // this.recommend[1].label=res.data[0][1].label;
  208. // this.recommend[2].label=res.data[0][2].label;
  209. this.screen2.item=res.data[1];
  210. this.screen2.item.unshift({
  211. label: "common.All",
  212. value: null,
  213. });
  214. })
  215. },
  216. // 展示数据
  217. getInitData(page){
  218. page.languageDict = this.$i18n.locale.toUpperCase()
  219. getInfoJournalViews(page).then(res=>{
  220. console.log(res)
  221. if(res.data){
  222. this.recommend2=res.data.infoJournalViews || [];
  223. this.total=res.data.page?res.data.page.totalCount : 0;
  224. // this.getrecommendFlagList(page);// 获取推荐期刊
  225. }
  226. })
  227. },
  228. // 获取推荐期刊
  229. // getrecommendFlagList(page){
  230. // page.recommendFlag='y';
  231. // page.pageSize=3;
  232. // //page.language=this.$i18n.locale.toUpperCase();
  233. // getInfoJournalViews(page).then(res=>{
  234. // if(res.data){
  235. // this.recommend=res.data.infoJournalViews || [];
  236. // }
  237. // })
  238. // },
  239. search(){
  240. if(!this.title){
  241. this.$message(this.$t("common.Pleasefillinthecontentfirst"));
  242. }
  243. let select=this.select;
  244. console.log(select)
  245. let list={
  246. pageNo:1,
  247. pageSize:'10'
  248. }
  249. list[select] = this.title
  250. this.getInitData(list);
  251. },
  252. open(url){
  253. window.open(url);//在另外新建窗口中打开窗口
  254. },
  255. handleCurrentChange(val){
  256. let data=this.screenData;
  257. let select=this.select;
  258. let page={
  259. pageNo:val,
  260. pageSize:'10',
  261. typeDict:data.click1?data.click1:'',
  262. languageDict:data.click2,
  263. // year:data.click3.click?data.click3.click:data.click3.input?data.click3.input:'',
  264. }
  265. page[select] = this.title;
  266. this.getInitData(page);
  267. },
  268. getIconUrl(url){
  269. return require("@/assets/img/realTimeInfo/"+url);
  270. },
  271. toView(router,json,index){
  272. this.$router.push({name:router,params:{key:json,index:index}})
  273. },
  274. screenBack(data){
  275. let page={
  276. pageNo:1,
  277. pageSize:'10',
  278. typeDict:data.click1?data.click1:'',
  279. languageDict:data.click2,
  280. year:data.click6.click?data.click6.click:data.click6.input?data.click6.input:''
  281. }
  282. this.screenData=data;
  283. this.getInitData(page);
  284. this.dataClick(data);
  285. console.log(data,'screenBackscreenBackscreenBackscreenBack',this.screen1.item);
  286. },
  287. dataClick(data){
  288. if(data.click1 && data.click1 == this.screen1.item[this.screen1.item.length-1].value){
  289. if(this.$i18n.locale=='zh'){
  290. this.screen2Item=this.screen2.item[1].value;
  291. }else {
  292. this.screen2Item=this.screen2.item[2].value;
  293. }
  294. }else {
  295. this.screen2Item=null;
  296. }
  297. },
  298. realTimeInfoScreensChange(i,index){
  299. this.realTimeInfoScreenItem=index
  300. },
  301. }
  302. }
  303. </script>
  304. <!-- Add "scoped" attribute to limit CSS to this component only -->
  305. <style scoped>
  306. ul{
  307. margin: 0;
  308. padding: 0;
  309. }
  310. .box,.boxs {
  311. margin-top: 10px;
  312. background: #fff;
  313. /* height: 500px; */
  314. padding-bottom: 10px;
  315. }
  316. .boxs {
  317. padding-bottom:30px;
  318. }
  319. body {
  320. margin: 0;
  321. }
  322. .screen1 {
  323. color:#2c5589;
  324. }
  325. .screen2 {
  326. font-size: 14px;
  327. color:#bebebe;
  328. }
  329. li {
  330. display: inline-block;
  331. margin-left: 6px;
  332. padding: 0 2px;
  333. color: #1251A7;
  334. }
  335. .el-select-dropdown__wrap {
  336. max-height: 500px;
  337. }
  338. .realTimeInfo_scree .span1,
  339. .realTimeInfo_scree .span2{
  340. color: #fff;
  341. padding: 0 10px;
  342. font-size: 13px;
  343. display: inline-block;
  344. height: 100%;
  345. background: #2c5589;
  346. /* margin-right: 30px; */
  347. width: 70px;
  348. text-align: center;
  349. }
  350. .realTimeInfo_scree .span2 {
  351. background: #fff;
  352. color: #1251A7;
  353. }
  354. .select-input >>>.el-input__inner {
  355. height: 50px !important;
  356. }
  357. .select-input-position {
  358. width: 80%;
  359. position: absolute;
  360. left: 20px;top: 35%;
  361. transform: translate(0,-50%);
  362. }
  363. .select-input-realTime {
  364. width: 70%;
  365. position: absolute;
  366. left: 10px;
  367. top: 75%;
  368. font-size: 14px;
  369. color:#ccc;
  370. }
  371. /* .select-input-realTime2{
  372. display: -webkit-flex;
  373. display: flex;
  374. justify-content:space-between;
  375. } */
  376. .select-input-realTime2 li {
  377. width: 160px;
  378. height: 210px;
  379. margin-right: 10px;
  380. margin-bottom: 16px;
  381. }
  382. .select-input >>>.el-input-group__prepend {
  383. background-color: #fff;
  384. color: #000;
  385. }
  386. /* .el-input-group {
  387. width: 80%;
  388. } */
  389. .el-input-group__append {
  390. color: #fff;
  391. border: 1px solid #2c5589;
  392. background: #2c5589;
  393. }
  394. .Information {
  395. border-bottom: 1px solid #bebebe;
  396. }
  397. .Information span {
  398. font-size: 14px;
  399. display: inline-block;
  400. padding: 6px 0;
  401. }
  402. .Information .dcp_infor {
  403. margin-right: 500px;
  404. color: #2c5589;
  405. font-weight: 700;
  406. font-size: 15px;
  407. padding-left: 20px;
  408. }
  409. .Information .dcp_infor2 {
  410. margin-right: 30px;
  411. }
  412. .lableStyle li {
  413. display: block;
  414. }
  415. .lableStyle1,
  416. .lableStyle2 {
  417. color: #666;
  418. font-size: 14px;
  419. line-height: 29px;
  420. padding-left: 10px;
  421. }
  422. .lableStyle1 {
  423. font-size: 16px;
  424. font-weight: 600;
  425. }
  426. .spot {
  427. display: inline-block;
  428. width: 6px;
  429. height: 6px;
  430. background-color: #999;
  431. margin-right: 5px;
  432. margin-bottom:2px;
  433. }
  434. .el-select{
  435. width: 110px;
  436. }
  437. .input-with-select .el-input-group__prepend {
  438. background-color: #fff;
  439. }
  440. .el-scrollbar__wrap li {
  441. display: block;
  442. color: #666;
  443. margin-left: 0;padding: 0 0;
  444. text-align: center;
  445. line-height: 48px;
  446. }
  447. .el-scrollbar__wrap li:hover{
  448. background: #0079ef;
  449. color: #fff;
  450. }
  451. .el-select-dropdown__item {
  452. height: 48px;
  453. }
  454. </style>