CommitteeInformationListDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <div class="autoBox box" style="min-height: 900px; position: relative">
  3. <div class="crumbs">
  4. <div style="overflow: hidden">
  5. <el-breadcrumb
  6. separator-class="el-icon-arrow-right"
  7. style="float: left"
  8. >
  9. <el-breadcrumb-item :to="{ path: 'home' }">{{
  10. $t("common.Home")
  11. }}</el-breadcrumb-item>
  12. <el-breadcrumb-item
  13. :to="{ path: 'nationalregionalCommittees' }"
  14. class="pointer"
  15. >{{ $t("common.committeeInformation") }}</el-breadcrumb-item
  16. >
  17. <el-breadcrumb-item>{{ $t("common.detail") }}</el-breadcrumb-item>
  18. </el-breadcrumb>
  19. </div>
  20. </div>
  21. <div class="content">
  22. <div class="title">
  23. <span>{{ this.detailList.title }}</span>
  24. </div>
  25. <div
  26. style="
  27. width: 79%;
  28. height: 40px;
  29. background-color: rgba(96, 160, 244, 0.1);
  30. "
  31. :style="this.$i18n.locale == 'en'?'width: 90%;':''"
  32. >
  33. <div style="float: left">
  34. <span
  35. style="
  36. margin-left: 30px;
  37. font-size: 16px;
  38. line-height: 40px;
  39. color: rgba(51, 51, 51, 1);
  40. "
  41. >{{ $t("common.belongCommittee") }}:{{
  42. $i18n.locale == "en" ? this.detailList.belongCommitteeEn : this.detailList.reserveFour
  43. }}</span
  44. >
  45. </div>
  46. <div style="float: left">
  47. <span
  48. style="
  49. margin-left: 30px;
  50. font-size: 16px;
  51. line-height: 40px;
  52. color: rgba(51, 51, 51, 1);
  53. "
  54. >{{ $t("common.resourceDetailsReleaseTime") }}:{{
  55. $i18n.locale == "en" ? this.detailList.uploadTime.replace("年","-").replace("月","-").replace("日","") : this.detailList.uploadTime
  56. }}</span
  57. >
  58. </div>
  59. <div style="float: right">
  60. <div
  61. style="float: left; line-height: 38px; color: rgba(51, 51, 51, 1)"
  62. >
  63. <!--下载-->
  64. <img
  65. @click="download"
  66. src="../../assets/img/ResourceSharing/download.png"
  67. alt=""
  68. style="
  69. margin-right: 3px;
  70. vertical-align: middle;
  71. cursor: pointer;
  72. width: 16px;
  73. "
  74. />
  75. <span
  76. @click="download"
  77. style="
  78. margin-right: 20px;
  79. vertical-align: middle;
  80. cursor: pointer;
  81. "
  82. >{{ $t("common.resourceDetailsDownload") }}</span
  83. >
  84. </div>
  85. </div>
  86. <div style="clear: both"></div>
  87. </div>
  88. <div class="preview">
  89. <div
  90. style="
  91. position: absolute;
  92. top: 0;
  93. right: 0;
  94. width: 240px;
  95. height: 290px;
  96. "
  97. >
  98. <div style="width: 240px; height: 290px; margin: auto">
  99. <div style="width: 240px; height: 290px; position: relative">
  100. <img
  101. :src="'data:image/jpeg;base64,' + imgurl"
  102. alt=""
  103. style="
  104. width: 100%;
  105. height: 100%;
  106. position: absolute;
  107. top: 0;
  108. left: 0;
  109. "
  110. />
  111. <p
  112. style="
  113. padding: 50px 9px 0 9px;
  114. width: 100%;
  115. height: 95px;
  116. box-sizing: border-box;
  117. margin: 0;
  118. text-align: center;
  119. position: absolute;
  120. top: 0;
  121. left: 0;
  122. color: #ffffff;
  123. font-size: 14px;
  124. "
  125. ></p>
  126. <p
  127. style="
  128. padding: 102px 7px 0 7px;
  129. width: 100%;
  130. height: 150px;
  131. box-sizing: border-box;
  132. margin: 0;
  133. text-align: center;
  134. position: absolute;
  135. top: 115px;
  136. left: 0;
  137. color: #002c6c;
  138. font-size: 12px;
  139. "
  140. ></p>
  141. </div>
  142. </div>
  143. <div
  144. style="
  145. position: absolute;
  146. bottom: 0;
  147. width: 100%;
  148. height: 49px;
  149. text-align: center;
  150. cursor: pointer;
  151. background: linear-gradient(
  152. 180deg,
  153. rgba(255, 255, 255, 0.64),
  154. rgba(0, 0, 0, 0.64)
  155. );
  156. "
  157. >
  158. <span
  159. @click="preview"
  160. class="active"
  161. style="
  162. color: #0079ef;
  163. font-size: 14px;
  164. font-weight: 600;
  165. line-height: 49px;
  166. opacity: 1;
  167. "
  168. >{{ $t("common.resourceDetailsPreview") }}</span
  169. >
  170. </div>
  171. </div>
  172. </div>
  173. <!-- <div class="abstract">-->
  174. <!-- <div style="margin: 39px 0 0 0">-->
  175. <!-- <h4-->
  176. <!-- style="-->
  177. <!-- font-size: 20px;-->
  178. <!-- color: rgba(44, 85, 138, 1);-->
  179. <!-- font-weight: 600;-->
  180. <!-- margin: 0;-->
  181. <!-- "-->
  182. <!-- >-->
  183. <!-- {{$i18n.locale == "en" ? 'Name' : '名称'}}-->
  184. <!-- </h4>-->
  185. <!-- <p-->
  186. <!-- style="-->
  187. <!-- font-size: 16px;-->
  188. <!-- line-height: 32px;-->
  189. <!-- margin: 14px 0;-->
  190. <!-- color: rgba(51, 51, 51, 1);-->
  191. <!-- text-indent: 2em;-->
  192. <!-- "-->
  193. <!-- >-->
  194. <!-- {{ this.detailList.name }}-->
  195. <!-- </p>-->
  196. <!-- </div>-->
  197. <!-- </div>-->
  198. <div class="abstract">
  199. <div style="padding-top: 30px;">
  200. <h4
  201. style="
  202. font-size: 20px;
  203. color: rgba(44, 85, 138, 1);
  204. font-weight: 600;
  205. margin: 0;
  206. "
  207. >
  208. {{ $t("common.abstract") }}
  209. </h4>
  210. <p
  211. style="
  212. font-size: 16px;
  213. line-height: 32px;
  214. margin: 14px 0;
  215. color: rgba(51, 51, 51, 1);
  216. text-indent: 2em;
  217. "
  218. >
  219. {{ this.detailList.abstractInfo }}
  220. </p>
  221. </div>
  222. </div>
  223. <!-- <div class="abstract" style="height:200px">-->
  224. <!-- <div style="margin: 39px 0 0 0">-->
  225. <!-- <h4-->
  226. <!-- style="-->
  227. <!-- font-size: 20px;-->
  228. <!-- color: rgba(44, 85, 138, 1);-->
  229. <!-- font-weight: 600;-->
  230. <!-- margin: 0;-->
  231. <!-- "-->
  232. <!-- >-->
  233. <!-- {{$i18n.locale == "en" ? 'Menu' : '目录'}}-->
  234. <!-- </h4>-->
  235. <!-- <img-->
  236. <!-- style="width: 130px; height: 170px; display: block"-->
  237. <!-- :src="'data:image/jpeg;base64,' + menuBase64"-->
  238. <!-- alt=""-->
  239. <!-- />-->
  240. <!-- </div>-->
  241. <!-- </div>-->
  242. </div>
  243. </div>
  244. </template>
  245. <script>
  246. import {
  247. getAllInformationDetail,
  248. getImg,
  249. downloadAttachment,
  250. } from "@/api/committee/committeeWorkSpace";
  251. import Base from "@/views/base/Base";
  252. import {uploadfile} from "@/api/committee/nrc";
  253. export default {
  254. name: "CommitteeInformationListDetail",
  255. extends: Base,
  256. data() {
  257. return {
  258. informationDetailId: "",
  259. detailList: {},
  260. imgurl: "",
  261. responseData: null,
  262. fileList:[],
  263. menuBase64:"",
  264. switchLanguage:'',
  265. };
  266. },
  267. mounted() {
  268. this.informationDetailId = this.$route.params.id;
  269. this.initData();
  270. },
  271. watch: {
  272. "$i18n.locale"() {
  273. },
  274. },
  275. methods: {
  276. initData() {
  277. this.accessToInformationAllDetails();
  278. // this.getContent();
  279. },
  280. // 获取全部资料详情
  281. accessToInformationAllDetails() {
  282. let id = this.informationDetailId;
  283. getAllInformationDetail(id).then((res) => {
  284. this.detailList = res.data.nrcMaterialStorehouse;
  285. this.detailList.uploadTime = this.detailList.uploadTime.substring(0,11)
  286. this.menuBase64 = this.detailList.menuBase64;
  287. this.getPhoto();
  288. });
  289. },
  290. // 获取图片
  291. getPhoto() {
  292. // let path = this.detailList.coverPath;
  293. this.imgurl = this.detailList.coverBase64;
  294. // getImg(path)
  295. // .then((res) => {
  296. // let src = window.URL.createObjectURL(res);
  297. // this.imgurl = src;
  298. // console.log("src>>>"+src);
  299. // })
  300. // .catch((error) => {
  301. // console.log(error);
  302. // });
  303. },
  304. // 获取内容
  305. getContent() {
  306. let id = this.informationDetailId;
  307. downloadAttachment(id).then((res) => {
  308. this.responseData = res;
  309. });
  310. },
  311. // 下载
  312. download() {
  313. if(this.$i18n.locale == 'zh'){
  314. this.$message.success("正在加载中");
  315. }else{
  316. this.$message.success("Loading");
  317. }
  318. let id = this.informationDetailId;
  319. downloadAttachment(id).then((res) => {
  320. const binaryData = [];
  321. binaryData.push(res);
  322. //获取blob链接
  323. var pdfUrl = window.URL.createObjectURL(
  324. new Blob(binaryData, { type: "application/pdf" })
  325. );
  326. let a = document.createElement("a");
  327. a.href = pdfUrl; // 这里的请求方式为get,如果需要认证,接口上需要带上token
  328. let path = this.detailList.attachmentPath;
  329. let name = path.substring(path.lastIndexOf("/") + 1);
  330. a.download = name;
  331. a.click();
  332. // this.$message.success("下载成功!");
  333. });
  334. },
  335. // 预览
  336. preview() {
  337. if(this.$i18n.locale == 'zh'){
  338. this.$message.success("正在加载中");
  339. }else{
  340. this.$message.success("Loading");
  341. }
  342. let id = this.informationDetailId;
  343. downloadAttachment(id).then((res) => {
  344. const binaryData = [];
  345. binaryData.push(res);
  346. //获取blob链接
  347. var pdfUrl = window.URL.createObjectURL(
  348. new Blob(binaryData, { type: "application/pdf" })
  349. );
  350. window.open(pdfUrl);
  351. });
  352. },
  353. },
  354. };
  355. </script>
  356. <style scoped>
  357. .oneLine {
  358. /* 隐藏溢出元素 */
  359. overflow: hidden;
  360. /* 单行显示 */
  361. white-space: nowrap;
  362. /* 溢出显示省略号 */
  363. text-overflow: ellipsis;
  364. }
  365. .threeLine {
  366. overflow: hidden;
  367. text-overflow: ellipsis;
  368. display: -webkit-box;
  369. -webkit-line-clamp: 3;
  370. -webkit-box-orient: vertical;
  371. }
  372. .pointer:hover {
  373. cursor: pointer;
  374. }
  375. .box {
  376. margin-top: 10px;
  377. background: #fff;
  378. /* height: 500px; */
  379. padding: 20px;
  380. box-sizing: border-box;
  381. }
  382. .secNavActive {
  383. color: #0091ff;
  384. }
  385. .content {
  386. /* background: #ddd; */
  387. width: 100%;
  388. min-height: 290px;
  389. margin: 52px 0 60px;
  390. overflow: hidden;
  391. }
  392. .content .title {
  393. font-family: "PingFang SC";
  394. font-style: normal;
  395. font-weight: 600;
  396. font-size: 30px;
  397. line-height: 42px;
  398. color: #375586;
  399. margin-bottom: 39px;
  400. }
  401. .content .abstract {
  402. float: left;
  403. width: 76%;
  404. height: 100px;
  405. }
  406. .content .preview {
  407. float: right;
  408. width: 24%;
  409. /*height: 100%;*/
  410. /*margin-top: 100px;*/
  411. height: 290px;
  412. position: relative;
  413. }
  414. .bookCatalog {
  415. width: 100%;
  416. /*height: 250px;*/
  417. min-height: 250px;
  418. max-height: 600px;
  419. background-color: #eff5fd;
  420. margin: 60px 0;
  421. }
  422. .bookCatalog .catalog {
  423. float: left;
  424. width: 6.5%;
  425. height: 100%;
  426. background-color: #60a0f4ff;
  427. text-align: center;
  428. }
  429. .bookCatalog .catalogList {
  430. float: right;
  431. width: 93.5%;
  432. height: 100%;
  433. display: flex;
  434. justify-content: space-around;
  435. align-items: center;
  436. }
  437. .bookCatalog .catalogList .catalogText {
  438. /*width: 228px;*/
  439. /*height:160px;*/
  440. width: auto;
  441. height: auto;
  442. border-right: 2px solid rgba(44, 85, 138, 0.4);
  443. padding-right: 80px;
  444. }
  445. .active:hover {
  446. color: red;
  447. }
  448. </style>