RealTimeInfoItemdetails.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. <template>
  2. <div class="autoBox box" style="min-height: 600px">
  3. <div class="crumbs">
  4. <el-breadcrumb separator="/" style="float: left; margin: 15px">
  5. <el-breadcrumb-item :to="{ path: 'home' }">{{
  6. $t("common.Home")
  7. }}
  8. </el-breadcrumb-item>
  9. <el-breadcrumb-item :to="{ path: 'realTimeInfo1' }">{{
  10. $t("common.NewsData")
  11. }}
  12. </el-breadcrumb-item>
  13. <el-breadcrumb-item>{{
  14. informationgTypeDictsMap[initData.typeDict]
  15. }}
  16. </el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. <div style="justify-content: space-between; margin-top: 30px">
  20. <div
  21. style="margin-top: 20px; width: 73%; float: left; padding-left: 10px"
  22. >
  23. <div
  24. style="
  25. line-height: 50px;
  26. color: #666;
  27. font-size: 28px;
  28. font-weight: 700;
  29. "
  30. >
  31. <div style="margin: 0 10px; margin-bottom: 30px; text-align: center">
  32. {{ initData.title }}
  33. </div>
  34. </div>
  35. <div
  36. style="
  37. margin: 0 20px;
  38. padding: 0 10px;
  39. line-height: 50px;
  40. color: #333;
  41. font-size: 15px;
  42. border-bottom: 1px solid #333;
  43. "
  44. >
  45. <span
  46. >{{ $t("common.ReleaseTime") }}:{{
  47. formatDate(initData.publishDate)
  48. }}
  49. | {{ $t("common.Source") }}:{{ initData.auther }}</span
  50. >
  51. <span
  52. class="share cursor"
  53. :style="ifcommon ? 'color: #66b1ff;' : ''"
  54. style="margin-right: 20px; float: right"
  55. @click="shareChange()"
  56. >
  57. <i
  58. class="el-icon-star-off"
  59. :style="ifcommon ? 'color: #66b1ff;' : ''"
  60. ></i>
  61. {{ $i18n.locale == "zh" ? ifcommon ? "已收藏" : "收藏" : ifcommon ? "Already collected" : "Collection" }}
  62. </span>
  63. </div>
  64. <div style="padding: 0 20px;line-height: 40px;font-size: #666;vertical-align: top;"
  65. :class="$i18n.locale == 'zh' ? 'content' : ''"
  66. v-html="initData.contentHtml">
  67. </div>
  68. <!-- 附件下载-->
  69. <div style="padding:0 20px;line-height: 40px;font-size: #666;margin-top: 20px;">
  70. <div v-if="infoAttachments.length > 0" class="content">
  71. <div v-for="(item,index) in infoAttachments">
  72. <span>{{ $t('common.enclosure') }} {{ index + 1 }} :</span>
  73. <a style="cursor: pointer" @click="downloadEnclosure(item.attachmentName,item.attachmentSavePath)">{{ item.attachmentName }}</a>
  74. <div style="display:inline-block;height: 40px;background-color: #fff;margin-left: 20px">
  75. <a class="func example" style="margin-right: 15px;color: #0c27ff" @click="downloadEnclosure(item.attachmentName,item.attachmentSavePath)">{{ $t('common.download') }}</a>
  76. <a class="func" @click="downloadP(item.attachmentSavePath)" style="color: #0c27ff">{{ $t('common.preview') }}</a>
  77. </div>
  78. </div>
  79. </div>
  80. <div v-else>
  81. <div v-for="(item,index) in enclosureName" class="content">
  82. <div v-if="enclosureName.length >0">
  83. <span>{{ $t('common.enclosure') }} {{ index + 1 }} :</span>
  84. <a style="cursor: pointer" @click="downloadEnclosure()">{{ item }}</a>
  85. <div style="display:inline-block;height: 50px;background-color: #fff;margin-left: 20px">
  86. <a class="func example" style="margin-right: 15px;color: #0c27ff" @click="downloadEnclosure()">{{$t('common.download')}}</a>
  87. <a class="func" @click="downloadEnclosure()" style="color: #0c27ff">{{$t('common.preview')}}</a>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div style="margin: 10px 20px 0 20px;line-height: 24px;color: #888;padding-top: 10px;font-size: 14px;vertical-align: top;border-top: 1px dashed #000;">
  94. {{ $t("common.contentisreproduced") }}
  95. </div>
  96. <div>
  97. <div
  98. style="
  99. color: #315090;
  100. margin-left: 20px;
  101. margin-right: 20px;
  102. margin-top: 20px;
  103. padding-bottom: 10px;
  104. border-bottom: 1px solid #869bb6;
  105. font-weight: 700;
  106. "
  107. >
  108. {{ $t("common.RelatedInformation") }}
  109. </div>
  110. <div
  111. style="padding: 20px; height: 95px"
  112. v-for="(item, index) in initList"
  113. v-if="initData.id != item.id"
  114. class="cursor"
  115. @click="toView('realTimeInfoItemdetails', item.baseEntityId)"
  116. >
  117. <img
  118. :src="'api/file/pub/' + item.pictureUrl"
  119. alt=""
  120. style="width: 126px; height: 82px; float: left"
  121. v-if="item.pictureUrl"
  122. />
  123. <div
  124. :style="item.pictureUrl ? 'width: 690px;' : 'width: 100%;'"
  125. style="float: right; overflow: hidden"
  126. >
  127. <div
  128. style="
  129. color: #616161;
  130. font-weight: 700;
  131. font-size: 18px;
  132. margin-bottom: 10px;
  133. "
  134. >
  135. {{ item.title }}
  136. </div>
  137. <div
  138. style="
  139. height: 60px;
  140. overflow: hidden;
  141. line-height: 29px;
  142. color: #989898;
  143. font-size: 15px;
  144. -webkit-box-orient: vertical;
  145. position: relative;
  146. line-height: 1.4em;
  147. overflow: hidden;
  148. height: 2.8em;
  149. "
  150. class="plate"
  151. v-html="item.content"
  152. ></div>
  153. <div style="color: #dcdcdc; line-height: 38px">
  154. <span>{{ item.auther ? item.auther : "" }}</span>
  155. <span style="float: right; margin-right: 10px">{{
  156. formatDate(item.publishDate)
  157. }}</span>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <!--最新推荐和排行-->
  164. <div style="width: 300px; float: left; margin-top: 59px">
  165. <div style="padding-top: 35px">
  166. <!-- 热点新闻和最新推荐 -->
  167. <div
  168. style="
  169. color: #315090;
  170. margin-top: 20px;
  171. padding-bottom: 10px;
  172. border-bottom: 1px solid #869bb6;
  173. font-weight: 700;
  174. "
  175. >
  176. <div
  177. class="newsTitle"
  178. :class="titleIndex == 0 ? 'title1' : 'title2'"
  179. @click="changeTitle(0)"
  180. v-if="islogin"
  181. >
  182. {{ $t("common.IntelligentRecommendation") }}
  183. </div>
  184. <div
  185. class="newsTitle"
  186. :class="
  187. islogin ? (titleIndex == 1 ? 'title1' : 'title2') : 'title1'
  188. "
  189. @click="changeTitle(1)"
  190. >
  191. {{ $t("common.hotnews") }}
  192. </div>
  193. <!-- {{$t('common.hotnews')}}-->
  194. </div>
  195. <!--热点新闻-->
  196. <div
  197. style="padding: 5px 0 0 0"
  198. v-show="!islogin || titleIndex == 1"
  199. v-for="(item, index) in hotNews"
  200. class="cursor"
  201. @click="toView('realTimeInfoItemdetails', item.baseEntityId)"
  202. >
  203. <div style="width: 100%">
  204. <div
  205. style="
  206. color: #333;
  207. font-size: 16px;
  208. margin-bottom: 10px;
  209. line-height: 29px;
  210. "
  211. >
  212. <i class="hotInfoIndex">{{ index + 1 }}</i> {{ item.title }}
  213. </div>
  214. </div>
  215. <hr style="border-bottom: 1px solid #f5f6f7"/>
  216. </div>
  217. </div>
  218. <!-- 最新推荐 -->
  219. <div
  220. style="padding: 5px 0 0 0"
  221. class="cursor"
  222. v-show="islogin && titleIndex == 0"
  223. v-for="(item, index) in newRecommonList"
  224. @click="toView('realTimeInfoItemdetails', item.baseEntityId)"
  225. >
  226. <div style="width: 100%">
  227. <div
  228. style="
  229. color: #333;
  230. font-size: 16px;
  231. margin-bottom: 10px;
  232. line-height: 29px;
  233. "
  234. >
  235. <span class="hotInfoIndex">{{ index + 1 }}</span> {{ item.title }}
  236. </div>
  237. </div>
  238. </div>
  239. <!-- 点击排行 -->
  240. <div>
  241. <div
  242. style="
  243. color: #2c558a;
  244. margin-top: 20px;
  245. padding-bottom: 10px;
  246. border-bottom: 1px solid #869bb6;
  247. font-weight: 700;
  248. "
  249. >
  250. {{ $t("common.ClickRank") }}
  251. <div style="float: right; font-weight: 500">
  252. <span
  253. @click="changeClikRange('1')"
  254. :style="
  255. curClickType == '1'
  256. ? 'background-color: #0079ef;color:#fff'
  257. : 'background-color: white;'
  258. "
  259. style="cursor: pointer; padding: 5px 8px; border-radius: 8px"
  260. >{{ $t("common.infoDay") }}</span
  261. >
  262. <span> • </span>
  263. <span
  264. @click="changeClikRange('2')"
  265. :style="
  266. curClickType == '2'
  267. ? 'background-color: #0079ef;color:#fff'
  268. : 'background-color: white;'
  269. "
  270. style="cursor: pointer; padding: 5px 8px; border-radius: 8px"
  271. >{{ $t("common.infoWeek") }}</span
  272. >
  273. <span> • </span>
  274. <span
  275. @click="changeClikRange('3')"
  276. :style="
  277. curClickType == '3'
  278. ? 'background-color: #0079ef;color:#fff'
  279. : 'background-color: white;'
  280. "
  281. style="cursor: pointer; padding: 5px 8px; border-radius: 8px"
  282. >{{ $t("common.infoMonth") }}</span
  283. >
  284. </div>
  285. </div>
  286. <div
  287. style="padding: 5px 0 0 0"
  288. class="cursor"
  289. v-for="(item, index) in hitsList"
  290. v-if="informationMap[item]"
  291. @click="
  292. toView(
  293. 'realTimeInfoItemdetails',
  294. informationMap[item].baseEntityId
  295. )
  296. "
  297. >
  298. <div style="width: 100%">
  299. <div
  300. style="
  301. color: #333;
  302. font-size: 16px;
  303. margin-bottom: 10px;
  304. line-height: 29px;
  305. "
  306. v-if="!showMoreFlag && index < 5"
  307. >
  308. <span class="hotInfoIndex">{{ index + 1 }}</span>
  309. {{ informationMap[item] ? informationMap[item].title : "" }}
  310. </div>
  311. <div
  312. style="
  313. color: #333;
  314. font-size: 16px;
  315. margin-bottom: 10px;
  316. line-height: 29px;
  317. "
  318. v-if="showMoreFlag"
  319. >
  320. <span class="hotInfoIndex">{{ index + 1 }}</span>
  321. {{ informationMap[item] ? informationMap[item].title : "" }}
  322. </div>
  323. </div>
  324. </div>
  325. <span
  326. style="display: block; text-align: right; color: #7d7de1"
  327. class="cursor show-more dept-btn zk"
  328. @click="showMore()"
  329. >{{ !showMoreFlag ? $t("common.More") : $t("common.pickUp") }}
  330. <i
  331. :class="!showMoreFlag ? 'fa fa-angle-down' : 'fa fa-angle-up'"
  332. ></i>
  333. </span>
  334. </div>
  335. <!-- 资讯 -->
  336. <!-- <div style="position: relative;height:331px "
  337. v-show="$i18n.locale=='zh'">
  338. <img src="@/assets/img/realTimeInfo/zixun.png"
  339. width="100%"
  340. height="300px"
  341. style="position: absolute;left: 0;top: 0;"
  342. alt="">
  343. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 10px;position: absolute;left: 0;top: 0;
  344. font-weight: 700;padding-left: 15px;">{{$t('common.News')}}
  345. </div>
  346. <div style="padding: 5px 0 0 15px;font-weight: normal;color: #333333;
  347. line-height: 26px;font-size: 14px; position: absolute;left: 0;top: 50px;"
  348. class="cursor">
  349. 基于智能爬虫和自动化翻译技术,以联合国环境署、环球时报、中华人民共和国商务部等
  350. <span style="color: #0091FF;font-weight: 700;">1700</span>
  351. 余个全球主要新闻资讯
  352. 网站为数据来源,采集政治外交、经济社会、能源电力、气候环境等新闻资讯
  353. <span style="color: #0091FF;font-weight: 700;">150</span>
  354. 万余条。
  355. </div>
  356. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 1px;position: absolute;left: 0;top: 180px;
  357. margin-left: 15px;font-size: 14px;border-bottom: 1px solid #0091FF;"
  358. class="cursor"
  359. @click="openPDF(1)">
  360. 资讯网站采集列表
  361. </div>
  362. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 1px;position: absolute;left: 0;top: 210px;
  363. margin-left: 15px;font-size: 14px;border-bottom: 1px solid #0091FF;"
  364. class="cursor"
  365. @click="openPDF(2)">
  366. 资讯分类
  367. </div>
  368. </div>
  369. <div style="position: relative;height:279px "
  370. v-show="$i18n.locale=='zh'">
  371. <img src="@/assets/img/realTimeInfo/shuju.png"
  372. width="100%"
  373. height="300px"
  374. style="position: absolute;left: 0;top: 0;"
  375. alt="">
  376. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 10px;position: absolute;left: 0;top: 0;
  377. font-weight: 700;padding-left: 15px;">{{$t('common.DataInformation')}}
  378. </div>
  379. <div style="padding: 5px 0 0 15px;font-weight: normal;color: #333333;
  380. line-height: 26px;font-size: 14px; position: absolute;left: 0;top: 50px;"
  381. class="cursor">
  382. 拓展经济社会、能源电力、气候环境、科技创新等数据采集范围,涵盖国际能源署、世界银行、非洲能源数据库、美国能源信息署等
  383. <span style="color: #0091FF;font-weight: 700;">13</span>
  384. 个主要结构化数据源,采集与数据源同步更新的统计指标数据多达
  385. <span style="color: #0091FF;font-weight: 700;">900</span>
  386. 余类、
  387. <span style="color: #0091FF;font-weight: 700;">230</span>
  388. 亿余项。
  389. </div>
  390. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 1px;position: absolute;left: 0;top: 200px;
  391. margin-left: 15px;font-size: 14px;border-bottom: 1px solid #0091FF;"
  392. class="cursor"
  393. @click="openPDF(3)">
  394. 指标数据种类
  395. </div>
  396. <div style="color: #0091FF;margin-top: 20px;padding-bottom: 1px;position: absolute;left: 0;top: 230px;
  397. margin-left: 15px;font-size: 14px;border-bottom: 1px solid #0091FF;"
  398. class="cursor"
  399. @click="openPDF(4)">
  400. 数据来源单位
  401. </div>
  402. </div> -->
  403. </div>
  404. </div>
  405. <div style="clear: both"></div>
  406. <el-dialog
  407. :title="$i18n.locale == 'zh' ? '提示' : 'Reminder'"
  408. :visible.sync="toViewLogin"
  409. :width="$i18n.locale == 'zh' ? '30%' : '40%'"
  410. :height="$i18n.locale == 'zh' ? '300px' : '386px'"
  411. :before-close="toViewLoginChange"
  412. >
  413. <div style="width: 100%; height: 100%">
  414. <img
  415. src="@/assets/img/loginTips.png"
  416. alt=""
  417. style="width: 180px; height: 180px; margin-left: 20px"
  418. />
  419. <div
  420. style="float: right; margin-right: 20px"
  421. :style="
  422. $i18n.locale == 'zh'
  423. ? 'width: 49%;margin-top: 10px;'
  424. : 'width: 453px;margin-top: -25px;'
  425. "
  426. >
  427. <div
  428. style="
  429. font-size: 20px;
  430. font-weight: normal;
  431. color: #333333;
  432. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  433. line-height: 40px;
  434. "
  435. >
  436. {{ $t("common.ReminderFirst") }}
  437. </div>
  438. <div
  439. style="
  440. font-size: 16px;
  441. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  442. font-weight: normal;
  443. color: #666666;
  444. line-height: 30px;
  445. "
  446. >
  447. {{ $t("common.ReminderSecond") }}
  448. <span style="color: #0091ff; font-size: 18px">{{ num }}</span>
  449. {{ $t("common.ReminderThird") }}
  450. </div>
  451. <div
  452. style="
  453. font-size: 14px;
  454. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  455. font-weight: normal;
  456. color: #666666;
  457. line-height: 30px;
  458. "
  459. >
  460. {{ $t("common.ReminderForth") }}
  461. </div>
  462. <div
  463. style="
  464. font-size: 14px;
  465. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  466. height: 33px;
  467. line-height: 60px;
  468. font-weight: normal;
  469. color: #0091ff;
  470. "
  471. >
  472. <span
  473. style="margin-left: 40px"
  474. class="cursor"
  475. @click="toViewLoginCh('login')"
  476. >
  477. {{ $t("common.ReminderFifth") }}
  478. </span>
  479. <span
  480. style="margin-left: 10px"
  481. class="cursor"
  482. @click="toView('Register')"
  483. >
  484. {{ $t("common.ReminderSixth") }}
  485. </span>
  486. </div>
  487. </div>
  488. </div>
  489. </el-dialog>
  490. </div>
  491. </template>
  492. <script>
  493. import {getInformationById, getRecommendInformationList,} from "@/api/baseUnitView";
  494. import {getDicts} from "@/api/dict";
  495. import {cmsInformationViews, getHotInformationList, addCollectInfo, getPortalMyCollecModel, topClickList,} from "@/api/baseUnitView";
  496. import {saveFollowModel, getPortalMyCollectModelByResearch,} from "@/api/operation/basePortalModelFollowInfo";
  497. import Base from "@/views/base/Base";
  498. import {getToken, resetToken} from "@/utils/auth";
  499. import {addIntegral} from "@/utils/toCompleteTask";
  500. import {getUserPointPage} from "@/api/user";
  501. import {getAttaments, download} from '@/api/file'
  502. export default {
  503. name: "RealTimeInfoItemdetails",
  504. extends: Base,
  505. data() {
  506. return {
  507. initData: {},
  508. initList: [],
  509. hotNews: [],
  510. toViewLogin: false,
  511. timer: "",
  512. num: 0,
  513. page: {
  514. baseId: this.$route.query.key || this.$router.history.current.query,
  515. },
  516. list: "",
  517. ifcommon: false,
  518. informationgTypeDicts: [],
  519. hitsList: [],
  520. curClickType: "1",
  521. informationMap: {},
  522. showMoreFlag: false,
  523. topClickList: {},
  524. titleIndex: 0,
  525. newRecommonList: [],
  526. islogin: "",
  527. time: null,
  528. infoAttachments: [],
  529. enclosureName: [],
  530. };
  531. },
  532. created() {
  533. },
  534. computed: {
  535. informationgTypeDictsMap: function () {
  536. return this.informationgTypeDicts.array2Obj("value", "label");
  537. },
  538. },
  539. watch: {
  540. "$i18n.locale"() {
  541. this.getData();
  542. this.getHotList();
  543. this.getHitsList();
  544. this.getNewRecommed();
  545. },
  546. toViewLogin() {
  547. if (this.toViewLogin == true) {
  548. this.loginTipsChange();
  549. }
  550. },
  551. },
  552. mounted() {
  553. let locale = window.localStorage.getItem('locale')
  554. if(locale=='zh'){
  555. this.$i18n.locale='zh'
  556. }else{
  557. this.$i18n.locale='en'
  558. }
  559. // let arr = navigator.language || navigator.userLanguage;
  560. // console.log('----->',arr,locale);
  561. // if(arr.substr(0, 2)=='zh'){
  562. // this.$i18n.locale='zh'
  563. // }else{
  564. // this.$i18n.locale='en'
  565. // }
  566. this.getData();
  567. this.cofLogin();
  568. this.getHotList();
  569. this.getHitsList();
  570. this.getNewRecommed();
  571. this.initData1();
  572. },
  573. methods: {
  574. initData1() {
  575. let token = getToken()
  576. if (token) {
  577. getUserPointPage().then((res) => {
  578. if (res.data.umsUserPoints[0].pointStatus == "y") {
  579. let integral = function () {
  580. addIntegral("point_read_information", "2");
  581. };
  582. this.time = window.setTimeout(integral, 3000);
  583. }
  584. });
  585. } else {
  586. return
  587. }
  588. },
  589. changeClikRange(clickType) {
  590. this.curClickType = clickType;
  591. this.hitsList = this.topClickList[this.curClickType];
  592. },
  593. showMore() {
  594. this.showMoreFlag = !this.showMoreFlag;
  595. },
  596. // 未登录跳转
  597. loginTipsChange() {
  598. const that = this;
  599. this.num = 5;
  600. clearInterval(that.timer);
  601. this.timer = setInterval(function () {
  602. if (that.num > 0) {
  603. that.num--;
  604. } else {
  605. if (that.toViewLogin == true) {
  606. clearInterval(that.timer);
  607. that.toViewLoginCh("login");
  608. } else {
  609. clearInterval(that.timer);
  610. }
  611. }
  612. }, 1000);
  613. },
  614. // 判断未登录跳转是否关闭
  615. toViewLoginChange(done) {
  616. this.toViewLogin = false;
  617. this.num = 5;
  618. clearInterval(this.timer);
  619. this.$emit("LoginBack", false);
  620. },
  621. getHotList() {
  622. let list = {
  623. pageSize: 10,
  624. language: this.$i18n.locale.toUpperCase(),
  625. businessType: "information",
  626. };
  627. getHotInformationList(list).then((res) => {
  628. this.hotNews = res.data.cmsInformationView;
  629. });
  630. },
  631. getHitsList() {
  632. let list = {
  633. language: this.$i18n.locale.toUpperCase(),
  634. };
  635. topClickList(list).then((res) => {
  636. var data = res.data;
  637. if (data) {
  638. this.topClickList = data.topClickList;
  639. this.hitsList = this.topClickList[this.curClickType];
  640. this.informationMap = data.informationMap;
  641. }
  642. });
  643. },
  644. //下载附件
  645. downloadEnclosure(fileName, path) {
  646. if (this.$Cookies.get("token")) {
  647. if (fileName && path) {
  648. const link = document.createElement('a');
  649. link.href = "api/file/pub/" + path;
  650. link.download = fileName; //下载的文件名
  651. link.click();
  652. }
  653. } else {
  654. this.toViewLogin = true;
  655. }
  656. },
  657. downloadP(url) {
  658. let a = document.createElement('a');
  659. a.href = "api/file/pub/" + url;
  660. a.click();
  661. },
  662. //获取附件
  663. getEnclosureList() {
  664. getAttaments({
  665. attachmentBusinessId: this.initData.id,
  666. attachmentBusinessType: 'cms_information_info'
  667. }).then(res => {
  668. var data = res.data;
  669. if (data && data.attachmentInfos) {
  670. let attachments = [];
  671. data.attachmentInfos.forEach((element, index) => {
  672. attachments.push({
  673. attachmentBusinessId: element.attachmentBusinessId,
  674. attachmentId: element.id,
  675. attachmentName: element.attachmentName,
  676. attachmentSize: element.attachmentSize,
  677. attachmentStatement: element.attachmentStatement,
  678. attachmentSavePath: element.attachmentSavePath,
  679. fileFunctionTypeDict: element.fileFunctionTypeDict,
  680. sort: index,
  681. status: element.status,
  682. createBy: element.createBy,
  683. createDate: element.createDate,
  684. });
  685. });
  686. this.infoAttachments = attachments;
  687. }
  688. });
  689. },
  690. getData() {
  691. this.page.language = this.$i18n.locale.toUpperCase();
  692. getInformationById(this.page).then((res) => {
  693. this.initData = res.data.cmsInformationView;
  694. if (this.page.language === "EN" && this.initData.contentHtml) {
  695. this.initData.contentHtml = this.initData.contentHtml.replaceAll(
  696. /\r\n/g,
  697. "</p><p>"
  698. );
  699. this.initData.contentHtml = this.initData.contentHtml.replaceAll(
  700. /\n/g,
  701. "</p><p>"
  702. );
  703. this.initData.contentHtml = this.initData.contentHtml.replaceAll(
  704. "<p></p>",
  705. ""
  706. );
  707. }
  708. this.getRelevantList(
  709. this.initData.typeDict,
  710. this.$i18n.locale.toUpperCase()
  711. );
  712. this.getMyCollecModel(); // 获取用户是否收藏
  713. if (this.$Cookies.get('token')) {
  714. this.getEnclosureList();//获取附件
  715. }else {
  716. this.enclosureName = this.initData.remark ? this.initData.remark.split(',,') : [];
  717. }
  718. getDicts(
  719. this.$i18n.locale.toUpperCase() == "ZH"
  720. ? "DISPLAY_INFORMATION_SOURCE,CMS_INFORMATION_TYPE_DICT"
  721. : "DISPLAY_INFORMATION_SOURCE,CMS_INFORMATION_TYPE_DICT_EN"
  722. ).then((res) => {
  723. res.data[0].forEach((element) => {
  724. if (this.initData.sourceDict == element.value) {
  725. this.list = element.label;
  726. }
  727. });
  728. this.informationgTypeDicts = res.data[1] || [];
  729. });
  730. });
  731. },
  732. getRelevantList(type, language) {
  733. let page = {
  734. typeDict: type,
  735. language: language,
  736. pageSize: 8,
  737. pageNo: 1,
  738. businessType: "information",
  739. };
  740. cmsInformationViews(page).then((res) => {
  741. this.initList = res.data.allDataList || [];
  742. this.initList.forEach((element) => {
  743. element.content = element.content.replace(/<[^>]+>|&[^>]+;/g, "");
  744. // let wtWork=this.wtWorkTaskInfo.workTaskDesc.replace(/<[^>]+>|&[^>]+;/g, "")
  745. });
  746. });
  747. },
  748. getMyCollecModel() {
  749. const that = this;
  750. if (this.$Cookies.get("token")) {
  751. let user = window.localStorage.getItem("user");
  752. var users = JSON.parse(user);
  753. var modelType = "message";
  754. var userId = users.userId;
  755. var modelId = that.initData.baseEntityId;
  756. getPortalMyCollectModelByResearch(modelId, modelType, userId).then(
  757. (res) => {
  758. that.ifcommon = res.data.result;
  759. }
  760. );
  761. }
  762. },
  763. // 项目收藏改变
  764. shareChange() {
  765. // if (this.ifcommon) {
  766. // this.Collection("uncollect");
  767. // } else {
  768. // this.Collection("collect");
  769. // }
  770. if (!this.ifcommon) {
  771. this.Collection("collect");
  772. } else {
  773. this.Collection("uncollect");
  774. }
  775. },
  776. //收藏
  777. Collection: function (collectType) {
  778. let user = window.localStorage.getItem("user");
  779. if (!this.$Cookies.get("token")) {
  780. // this.$message.warning(this.$i18n.locale == 'zh' ? "请先登录" : "Please login first");
  781. this.toViewLogin = true;
  782. } else {
  783. var users = JSON.parse(user);
  784. var token = "" + getToken();
  785. this.userId = users.userId;
  786. var modelId = this.initData.baseEntityId;
  787. this.submitHandler((token) => {
  788. addCollectInfo(modelId, "message", this.userId, collectType, token)
  789. .then((res) => {
  790. if (res.status == 200) {
  791. if (!this.ifcommon) {
  792. this.$message({
  793. message:
  794. this.$i18n.locale == "zh" ? "已收藏" : "Liked of success",
  795. type: "success",
  796. });
  797. } else if (this.ifcommon) {
  798. this.$message({
  799. message:
  800. this.$i18n.locale == "zh"
  801. ? "取消收藏"
  802. : "Cancel the like",
  803. type: "success",
  804. });
  805. }
  806. }
  807. this.ifcommon = !this.ifcommon;
  808. this.resetToken();
  809. })
  810. .catch((error) => {
  811. this.resetToken();
  812. });
  813. });
  814. }
  815. },
  816. toViewLoginCh(router) {
  817. clearInterval(this.timer);
  818. this.$router.push(router);
  819. },
  820. toView(router, json) {
  821. this.$store.commit("modify", router);
  822. window.localStorage.setItem("router", router);
  823. const {href} = this.$router.resolve({
  824. name: router,
  825. query: {
  826. key: json,
  827. },
  828. });
  829. window.open(href, "_blank");
  830. },
  831. getIconUrl(url) {
  832. return require("@/assets/img/realTimeInfo/" + url);
  833. },
  834. screenBack(data) {
  835. console.log(data, "screenBackscreenBackscreenBackscreenBack");
  836. },
  837. screen(i) {
  838. this.index = i;
  839. },
  840. getInformation(num) {
  841. this.informationsClass = num;
  842. },
  843. //切换推荐和热点新闻
  844. changeTitle(i) {
  845. this.titleIndex = i;
  846. },
  847. //获取最新推荐
  848. getNewRecommed() {
  849. let list = {
  850. pageSize: this.$i18n.locale == "zh" ? 5 : 10,
  851. language: this.$i18n.locale.toUpperCase(),
  852. businessType: "information",
  853. };
  854. getRecommendInformationList(list).then((res) => {
  855. this.newRecommonList = res.data.cmsInformationView;
  856. });
  857. },
  858. cofLogin() {
  859. if (!this.$Cookies.get("token")) {
  860. this.islogin = false;
  861. } else {
  862. this.islogin = true;
  863. }
  864. },
  865. },
  866. // updated() {
  867. // clearTimeout(this.time);
  868. // },
  869. };
  870. </script>
  871. <!-- Add "scoped" attribute to limit CSS to this component only -->
  872. <style scoped>
  873. .box {
  874. margin-top: 10px;
  875. background: #fff;
  876. /* height: 500px; */
  877. padding: 20px 0;
  878. }
  879. .crumbs {
  880. margin-left: 20px;
  881. height: 30px;
  882. }
  883. body {
  884. margin: 0;
  885. }
  886. .swipers {
  887. position: absolute;
  888. top: 30px;
  889. left: 100px;
  890. width: 460px;
  891. height: 390px;
  892. }
  893. .details {
  894. position: absolute;
  895. top: 30px;
  896. left: 600px;
  897. width: 460px;
  898. height: 390px;
  899. }
  900. .swiper-container {
  901. width: 100%;
  902. height: 300px;
  903. margin-left: auto;
  904. margin-right: auto;
  905. }
  906. .swiper-slide {
  907. background-size: cover;
  908. background-position: center;
  909. }
  910. .gallery-top {
  911. height: 80%;
  912. width: 100%;
  913. }
  914. .gallery-thumbs {
  915. height: 20%;
  916. box-sizing: border-box;
  917. padding: 10px 0;
  918. }
  919. .gallery-thumbs .swiper-slide {
  920. width: 25%;
  921. height: 100%;
  922. opacity: 0.4;
  923. }
  924. .gallery-thumbs .swiper-slide-thumb-active {
  925. opacity: 1;
  926. }
  927. .initData_label {
  928. color: #6c8c9d;
  929. font-weight: 700;
  930. font-size: 18px;
  931. line-height: 42px;
  932. }
  933. .enterprise_style {
  934. line-height: 40px;
  935. color: #6c819d;
  936. /* padding-left: 100px; */
  937. font-size: 18px;
  938. /* font-weight: 700; */
  939. margin-top: 5px;
  940. margin-left: 100px;
  941. border-bottom: 1px solid #95d13e;
  942. }
  943. .enterprise_style_span {
  944. padding: 10px;
  945. text-align: center;
  946. height: 100%;
  947. background: #95d13e;
  948. color: #fff;
  949. /* border-bottom: 2px solid #6699ff; */
  950. }
  951. .enterprise_style_product tr {
  952. line-height: 30px;
  953. width: 100%;
  954. display: inline-block;
  955. border-bottom: 1px dashed #ccc;
  956. font-size: 14px;
  957. color: #6c819d;
  958. margin-bottom: 5px;
  959. }
  960. .recommend {
  961. margin-top: 15px;
  962. margin-left: 100px;
  963. }
  964. .recommend li {
  965. display: inline-block;
  966. width: 170px;
  967. /* height: 130px; */
  968. text-align: center;
  969. margin-right: 15px;
  970. }
  971. .information1 {
  972. display: inline-block;
  973. width: 123px;
  974. height: 100%;
  975. border: 1px solid rgba(228, 228, 228, 1);
  976. text-align: center;
  977. background: #f9f9f9;
  978. color: #999;
  979. }
  980. .information2 {
  981. display: inline-block;
  982. width: 123px;
  983. height: 100%;
  984. border-top: 3px solid #2c5589;
  985. text-align: center;
  986. color: #2c5589;
  987. }
  988. .information1:hover {
  989. color: #ff0036;
  990. }
  991. .hotInfoIndex {
  992. width: 20px;
  993. height: 19px;
  994. background: #d00;
  995. display: inline-block;
  996. text-align: center;
  997. margin-right: 5px;
  998. color: #fff;
  999. line-height: 19px;
  1000. position: relative;
  1001. font-style: normal;
  1002. }
  1003. .content,
  1004. .content >>> p {
  1005. /*text-indent: 2em;*/
  1006. }
  1007. .newsTitle {
  1008. display: inline-block;
  1009. width: 46%;
  1010. padding: 0 5px;
  1011. height: 30px;
  1012. text-align: center;
  1013. line-height: 30px;
  1014. border-radius: 5px;
  1015. overflow: hidden;
  1016. text-overflow: ellipsis;
  1017. white-space: nowrap;
  1018. }
  1019. .title1 {
  1020. background: #286fcf;
  1021. color: #fff;
  1022. }
  1023. .title2 {
  1024. background: #e9eef2;
  1025. color: #286fcf;
  1026. }
  1027. /* .content >>> p:before {
  1028. content: "\00A0\00A0\00A0\00A0\00A0\00A0\00A0\00A0";
  1029. } */
  1030. </style>