123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737 |
- <template>
- <div class="autoBox box" style="min-height: 900px;position: relative;">
- <div class="crumbs">
- <div style="overflow: hidden">
- <el-breadcrumb separator-class="el-icon-arrow-right" style="float: left">
- <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'realTimeInfo1' }" class="pointer">{{$t('common.NewsData')}}</el-breadcrumb-item>
- <el-breadcrumb-item>{{$t('common.InfomationResults')}}</el-breadcrumb-item>
- </el-breadcrumb>
- <el-breadcrumb separator="/" style="float: right;">
- <span :class="screenIndex==index?'secNavActive':''"
- class="pointer"
- @click="screenChange(item,index)"
- v-for="(item,index) in resourceSharingScreen">
- {{ $t("common.InfomationResults")}}
- <span v-if="index+1!==resourceSharingScreen.length" style="color: #2c3e50">/</span></span>
- </el-breadcrumb>
- </div>
- </div>
- <div class="mainBody">
- <h4 style="color: #2C558A;font-size: 30px;margin: 64px 20px 30px 20px ">{{bookContent.name}}</h4>
- <div style="margin: 0 20px;background-color: #eff5fd;height: 40px;vertical-align: middle;">
- <div style="float: left">
- <span style="margin-left: 30px;font-size: 16px;line-height: 40px;color: #333333;">{{$t('common.resourceDetailsTheCategory')}}:{{bookContent.researchResultType}}</span>
- </div>
- <div style="float: right">
- <span style="margin-right: 30px;font-size: 16px;line-height: 40px;color: #333333;">{{$t('common.resourceDetailsReleaseTime')}}:{{bookContent.updateDate}}</span>
- </div>
- <div style="clear: both"></div>
- </div>
- <!-- 显示pdf-->
- <!-- <iframe :src="srcPdf" scrolling="no" frameborder="0" style="width: 100%;height: 1000px"></iframe>-->
- <!-- 显示图片-->
- <div v-if="bookImg['fileAddress']==undefined||bookImg.fileAddress==false||bookImg.fileAddress==''||bookImg.fileAddress=='null'||bookImg.fileAddress==null">
- <div style="text-align: center;height: 100px;border-bottom: 1px solid #eee;border-top: 1px solid #eee;">
- <span v-show="$i18n.locale=='en'" style="line-height: 100px;">no data</span>
- <span v-show="$i18n.locale=='zh'" style="line-height: 100px;">暂无数据</span>
- </div>
- </div>
- <div v-else>
- <div style="width: 100%;margin: 30px 0 0 0;text-align: center;">
- <img v-show="currentPage<=fileVisiblePages" :src="'api/file/pub/'+ bookImg.fileAddress + '\\' + currentPage +'.png'" alt="" style="min-width: 600px;max-width:900px;">
- <img v-show="currentPage>fileVisiblePages && isVip==true && isLogin==true" :src="'api/file/pub/'+ bookImg.fileAddress + '\\' + currentPage +'.png'" alt="" style="min-width: 600px;max-width:900px;">
- <div v-show="currentPage>=fileVisiblePages && isLogin==false && currentPage!=pageTotal" style="width: 100%;height: 100%">
- <span style="font-size: 20px;font-weight: 700">{{$t('common.resourceDetailsTryRead')}}</span>
- <div style="width: 190px;height: 37px;background-color: rgba(24, 144, 255, 1);margin: 15px auto;cursor: pointer;" @click="toLogin">
- <span style="font-size: 18px;font-weight: 400;color: #FFFFFF;line-height: 38px;" >{{$t('common.resourceLogIn')}}</span>
- </div>
- </div>
- <div v-show="currentPage>=fileVisiblePages && isVip==false && isLogin==true && currentPage!=pageTotal" style="width: 100%;height: 100%">
- <span style="font-size: 20px;font-weight: 700">{{$t('common.resourceDetailsTryRead')}}</span>
- <div style="width: 190px;height: 37px;background-color: rgba(24, 144, 255, 1);margin: 15px auto;">
- <span style="font-size: 18px;font-weight: 400;color: #FFFFFF;line-height: 38px;">{{$t('common.resourceDetailsVIP')}}</span>
- </div>
- </div>
- <div v-show="currentPage>=fileVisiblePages && currentPage==pageTotal" style="width: 100%;height: 100%;cursor: pointer;" @click="toDevelopmentCooperation">
- <span style="font-size: 20px;font-weight: 700">
- {{$i18n.locale=='zh'?'本文浏览结束,如需了解更多信息,请联系平台管理人员':'You have finished the reading of this article. For more information, please contact the customer manager.'}}
- </span>
- </div>
- </div>
- <div style="height: 100px;overflow: hidden;vertical-align: middle;margin: 0 auto 30px;">
- <div style="overflow:hidden;padding: 50px 400px 0; height: 100px;">
- <div style="min-width:30%; float: left;color: #333333;height: 100%;padding-top: 2px;box-sizing: border-box;">
- <!--下载-->
- <!-- <img src="../../assets/img/ResourceSharing/download.png" @click="downloads" alt="" style="margin-right: 3px;vertical-align: middle;cursor: pointer;width: 16px">
- <span style="margin-right: 20px;vertical-align: middle;cursor: pointer;" @click="downloads">{{$t('common.resourceDetailsDownload')}}</span>-->
- <!-- <img src="@/assets/img/ResourceSharing/heat.png" alt="" style="width: 16px;height: 16px;margin-right: 3px;vertical-align: middle;">-->
- <!-- <i class="el-icon-star-off" style="margin-right: 3px;vertical-align: middle;cursor: pointer;"></i>-->
- <!-- <img src="../../assets/img/ResourceSharing/collect.png" alt=""-->
- <!-- style="margin-right: 3px;vertical-align: middle;cursor: pointer;width: 16px;"-->
- <!-- :style="ifcommon?'backfround-color: #66b1ff;':''"-->
- <!-- @click="shareChange()"-->
- <!-- >-->
- <i class="el-icon-star-off" style="margin-right: 3px;vertical-align: middle;cursor: pointer;font-size: 18px"
- :style="ifcommon?'color: #66b1ff;':''"
- @click="shareChange()"></i>
- <span style="margin-right: 30px;vertical-align: middle;cursor: pointer;"
- :style="ifcommon?'color: #66b1ff;':''"
- @click="shareChange()"
- >{{$i18n.locale=='zh'?ifcommon?"已关注" : "关注":ifcommon?"Already collected":" Collection"}}</span>
- <!-- <span class="share cursor"-->
- <!-- :style="ifcommon?'color: #66b1ff;':''"-->
- <!-- style="margin-right: 20px;float: right;"-->
- <!-- @click="shareChange()">-->
- <!-- <i class="el-icon-star-off" :style="ifcommon?'color: #66b1ff;':''"></i>-->
- <!-- {{$i18n.locale=='zh'?ifcommon?"已收藏":"收藏":ifcommon?"Favorites":"Favorites"}}-->
- <!-- </span>-->
- </div>
- <div style="display: inline-block;width:154px; height: 100%;text-align: center;position: relative;" class="bottomPage">
- <button style="display: inline-block;width: 32px;height: 32px;background-color: white;border: 1px solid #ddd;position: absolute;top: 0;left: 0;cursor: pointer"
- @click="handleCurrentChangeLeft"><</button>
- <div style="display: inline-block;border: 1px solid #ddd;width: 86px;height: 30px;line-height: 30px;position: absolute;top: 0;left: 33px;">
- <!-- <span style="display: inline-block;width: 23px;height: 23px;text-align: center;line-height: 23px;background-color: #0091FF;border-radius: 6px;color: white">-->
- <!-- {{currentPage}}-->
- <!-- </span>-->
- <span style="display: inline-block;width: 23px;height: 23px;">
- <!-- <span style="display: inline-block;width: 23px;height: 23px;text-align: center;line-height: 23px;background-color: #0091FF;border-radius: 6px;color: white">-->
- <!-- {{currentPage}}-->
- <input type="text" v-model="inputPage" @change="inputPageChange()"
- style="width: 23px;height: 23px;border: none;padding: 0;background-color: #0091FF;text-align: center;line-height: 23px;border-radius: 6px;color: white"></input>
- </span>
- <span style="display: inline-block;width: 23px;height: 23px;text-align: center;line-height: 23px;">/</span>
- <span style="display: inline-block;width: 23px;height: 23px;text-align: center;line-height: 23px;">{{pageTotal}}</span>
- </div>
- <button style="display: inline-block;width: 32px;height: 32px;background-color: white;border: 1px solid #ddd;position: absolute;top: 0;left: 121px;cursor: pointer"
- @click="handleCurrentChangeRight">></button>
- </div>
- <!--<el-pagination
- background
- style="width:60%;float: left;height: 80px;margin-top:25px;"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-size="1"
- layout="prev, pager, next"
- :total="pageTotal-0"
- ></el-pagination>-->
- </div>
- </div>
- </div>
- </div>
- <!-- 登录提示-->
- <el-dialog
- :title="$i18n.locale=='zh'?'提示':'Reminder'"
- :visible.sync="toViewLogin"
- :width="$i18n.locale=='zh'?'500px':'750px'"
- :height="$i18n.locale=='zh'?'300px':'386px'"
- :before-close="toViewLoginChange"
- >
- <div style="width: 100%;height: 100%;">
- <img src="@/assets/img/loginTips.png" alt="" style="width: 180px;height: 180px;margin-left: 20px;">
- <div style="float: right;margin-right: 20px;" :style="$i18n.locale=='zh'?'width: 49%;margin-top: 10px;':'width: 453px;margin-top: -25px;'">
- <div style="font-size: 20px;font-weight: normal;color: #333333;
- font-family: HiraginoSansGB-W3, HiraginoSansGB;
- line-height: 40px;">
- {{$t('common.ReminderFirst')}}
- </div>
- <div style="font-size: 16px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
- font-weight: normal;color: #666666;line-height: 30px;">
- {{$t('common.ReminderSecond')}} <span style="color: #0091FF;font-size: 18px;">{{num}}</span> {{$t('common.ReminderThird')}}
- </div>
- <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
- font-weight: normal;color: #666666;line-height: 30px;">
- {{$t('common.ReminderForth')}}
- </div>
- <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
- height:33px;line-height:60px;font-weight: normal;color: #0091FF;">
- <span style="margin-left: 40px;" class="cursor" @click="toView('login')">
- {{$t('common.ReminderFifth')}}
- </span>
- <span style="margin-left: 10px;" class="cursor" @click="toView('Register')">
- {{$t('common.ReminderSixth')}}
- </span>
- </div>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { downloadDeductingIntegral } from "@/api/user";
- import Base from "@/views/base/Base";
- import { getDicts, getDictByTypeValue } from "@/api/dict";
- import {
- getBaseResearchResultViews,
- gateResearchResultViewById,
- gateResearchResultFileById,
- } from "@/api/research/baseResearchResultView";
- import { formatDate } from "@/utils/formatUtils";
- import { getToken, resetToken } from "@/utils/auth";
- import { getFollowModeNumlByModelIdAndUserId } from "@/api/operation/basePortalModelFollowInfo";
- import {
- getFollowModeNumlByModelId,
- getFollowModelNumByUser,
- saveFollowModel,
- } from "@/api/operation/basePortalModelFollowInfo";
- export default {
- name: "resourceSharingDetailsPreview",
- extends: Base,
- data() {
- return {
- ifcommon: false,
- isVip: false,
- isLogin: false,
- num: 5,
- timer: "",
- toViewLogin: false,
- currentPage: 1,
- inputPage: 1,
- pageTotal: "",
- fileVisiblePages: 0,
- params: {
- pageNo: 1,
- pageSize: 1,
- language: "",
- },
- screenIndex: 0, //研究成果、调研资源选中
- resourceSharingScreen: [
- {
- lable: "common.resource",
- value: "0",
- },
- // {
- // lable: "common.researchResource",
- // value: "1",
- // },
- ],
- bookContent: {},
- bookImg: {},
- };
- },
- mounted() {
- if (this.$route.query.key) {
- this.initData();
- } else {
- this.toView("resourceSharing", 0);
- }
- },
- watch: {
- "$i18n.locale"() {
- this.initData();
- },
- },
- methods: {
- initData() {
- this.getData();
- this.getMyCollecModel(); // 获取用户是否收藏
- },
- getMyCollecModel() {
- const that = this;
- if (this.$Cookies.get("token")) {
- let user = window.localStorage.getItem("user");
- var users = JSON.parse(user);
- let MyCollecModel = {
- modelType: "researchResult",
- userId: users.userId,
- modelEntityId: JSON.parse(that.$route.query.key).entityId,
- };
- getFollowModeNumlByModelIdAndUserId(
- JSON.parse(that.$route.query.key).entityId,
- "researchResult",
- this.userId
- ).then((res) => {
- this.ifcommon = res.data;
- });
- }
- },
- //收藏
- shareChange() {
- // if (this.ifcommon) {
- // this.Collection("uncollect");
- // } else {
- // this.Collection("collect");
- // }
- if (this.ifcommon) {
- this.saveFollowModelDo("unfollow");
- } else {
- this.saveFollowModelDo("follow");
- }
- },
- //关注操作方法
- saveFollowModelDo: function (followType) {
- let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- // this.$message.warning("请先登录");
- // this.$confirm('检测到您未登录,是否登录')
- // .then(_ => {
- // this.toView('login');
- // })
- // .catch(_ => {});
- this.toViewLogin = true;
- } else {
- var users = JSON.parse(user);
- var token = "" + getToken();
- var projectId = JSON.parse(this.$route.query.key).entityId;
- var userId = users.userId;
- // 接口逻辑
- this.submitHandler((token) => {
- saveFollowModel(
- projectId,
- "researchResult",
- userId,
- followType,
- token
- )
- .then((result) => {
- // console.log(result);
- /*if(followType=='unfollow'){
- if(this.$i18n.locale=='zh'){
- this.$message({
- message: '取消收藏',
- type: "success",
- });
- }else{
- this.$message({
- message: 'cancel coilection',
- type: "success",
- });
- }
- }else{
- if(this.$i18n.locale=='zh'){
- this.$message({
- message: '已收藏',
- type: "success",
- });
- }else{
- this.$message({
- message: 'Already collected',
- type: "success",
- });
- }
- }*/
- if (followType == "unfollow") {
- if (this.$i18n.locale == "zh") {
- this.$message({
- message: "取消关注",
- type: "success",
- });
- } else {
- this.$message({
- message: "Cancel concerned",
- type: "success",
- });
- }
- } else {
- if (this.$i18n.locale == "zh") {
- this.$message({
- message: "已关注",
- type: "success",
- });
- } else {
- this.$message({
- message: "Already concerned",
- type: "success",
- });
- }
- }
- this.ifcommon = !this.ifcommon;
- this.resetToken();
- })
- .catch((error) => {
- // 此处你的业务代码
- });
- });
- }
- },
- /*handleCurrentChange(val) {
- const that = this;
- that.currentPage = val;
- // if(that.bookImg.fileVisibleStatus == 'Y'){
- // that.pageTotal = that.bookImg.fileVisiblePages;
- // }
- },*/
- handleCurrentChangeLeft() {
- const that = this;
- if (that.currentPage > 1) {
- --that.currentPage;
- --that.inputPage;
- }
- },
- handleCurrentChangeRight() {
- const that = this;
- if (
- that.currentPage < that.pageTotal &&
- that.currentPage < that.fileVisiblePages
- ) {
- ++that.currentPage;
- ++that.inputPage;
- }
- },
- inputPageChange() {
- if (0 < this.inputPage - 0 < this.fileVisiblePages - 0) {
- this.currentPage = this.inputPage - 0;
- } else {
- this.inputPage = this.currentPage + "";
- }
- },
- screenChange(item, index) {
- this.toView("resourceSharing", item.value);
- },
- toDevelopmentCooperation() {
- this.toView("developmentCooperation");
- },
- toView(router, json) {
- if (router == "login" || router == "Register") {
- clearInterval(this.timer);
- }
- this.$router.push({ name: router, params: { key: json } });
- },
- getData() {
- let that = this;
- let param1 = {
- pageNo: 1,
- pageSize: 1,
- language: "",
- };
- let param2 = {
- pageNo: 1,
- pageSize: 1,
- language: "",
- };
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- param1.language = "ZH";
- param2.language = "ZH";
- } else if (this.$i18n.locale.toUpperCase() == "EN") {
- param1.language = "EN";
- param2.language = "EN";
- }
- if (that.$route.query.key) {
- param1.entityId = JSON.parse(that.$route.query.key).entityId;
- param2.entityId = JSON.parse(that.$route.query.key).entityId;
- }
- gateResearchResultViewById(param1).then((resulet) => {
- let data = resulet.data;
- if (data.baseResearchResultView) {
- that.bookContent = data.baseResearchResultView;
- that.bookContent.updateDate = that.bookContent.updateDate
- ? formatDate(that.bookContent.updateDate, "YYYY-MM-DD")
- : "";
- that.getDictValue();
- }
- });
- if (that.$route.query.key) {
- param2.researchResultFileId = JSON.parse(
- that.$route.query.key
- ).researchResultFileId;
- }
- gateResearchResultFileById(param2).then((resulet) => {
- let that = this;
- let data = resulet.data;
- if (data.baseResearchResultFile) {
- that.bookImg = data.baseResearchResultFile;
- that.bookImg.updateDate = that.bookImg.updateDate
- ? formatDate(that.bookContent.updateDate, "YYYY-MM-DD")
- : "";
- // if(that.bookImg.fileVisibleStatus == 'Y'){
- // that.pageTotal = that.bookImg.filePages;
- // }else{
- // that.pageTotal = that.bookImg.fileVisiblePages;
- // }
- that.pageTotal = that.bookImg.filePages;
- if (that.bookImg.fileVisibleStatus == "Y") {
- if (that.bookImg.fileVisiblePages == 0) {
- that.fileVisiblePages = that.pageTotal;
- } else {
- that.fileVisiblePages = that.bookImg.fileVisiblePages;
- if (this.$Cookies.get("token")) {
- that.isLogin = true;
- // let userType = JSON.parse(window.localStorage.getItem('user')).umsUser.userUsertype
- // if(userType == "普通用户账号"){
- // that.isVip = false;
- // console.log(that.bookImg.fileVisiblePages)
- // that.fileVisiblePages = that.bookImg.fileVisiblePages;
- // }else{
- that.isVip = true;
- that.fileVisiblePages = that.pageTotal;
- // }
- } else {
- that.isLogin = false;
- }
- }
- } else if (that.bookImg.fileVisibleStatus == "N") {
- that.fileVisiblePages = that.pageTotal;
- }
- }
- });
- if (this.$Cookies.get("token")) {
- that.isLogin = true;
- // let userType = JSON.parse(window.localStorage.getItem('user')).umsUser.userUsertype
- // if(userType == "普通用户账号"){
- // that.isVip = false;
- // console.log(that.bookImg.fileVisiblePages)
- // that.fileVisiblePages = that.bookImg.fileVisiblePages;
- // }else{
- that.isVip = true;
- that.fileVisiblePages = that.pageTotal;
- // }
- } else {
- that.isLogin = false;
- }
- },
- getDictValue() {
- const that = this;
- let aa = {
- typeCode:
- this.$i18n.locale == "zh"
- ? "RESEARCH_RESULT_TYPE_DICT"
- : "RESEARCH_RESULT_TYPE_DICT_EN",
- value: that.bookContent.researchResultType,
- };
- getDictByTypeValue(aa.typeCode, aa.value).then((resulet) => {
- // if (!resulet.data){
- // that.getDictValue()
- // }
- that.bookContent.researchResultType = resulet.data[0].label;
- });
- },
- /*downloads(path,fileName){
- const that = this;
- if(that.bookContent.securityStatus == 'N'){
- if(this.$Cookies.get('token')){
- let user = window.localStorage.getItem("user");
- var users = JSON.parse(user);
- var userId = users.userId;
- if(that.bookContent.informationVisibleStatus=='Y'){
- if(users.umsUser.userUsertype=="普通用户账号"){
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '该文件仅供会员可下载',
- type: 'warning'
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: 'This document is downloadable by members only',
- type: 'warning'
- });
- }
- }else{
- const link = document.createElement('a');
- link.href = "api/file/pub/" + this.bookContent.researchResultFile;
- link.download = this.bookContent.name; //下载的文件名
- link.click();
- }
- }else{
- const link = document.createElement('a');
- link.href = "api/file/pub/" + this.bookContent.researchResultFile;
- link.download = this.bookContent.name; //下载的文件名
- link.click();
- }
- }else{
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // alert('该文件暂不支持下载');
- this.$message({
- message: '请登录后下载',
- type: 'warning'
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: 'Please log in and download',
- type: 'warning'
- });
- }
- }
- }else{
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // alert('该文件暂不支持下载');
- this.$message({
- message: '该文件暂不支持下载',
- type: 'warning'
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: 'This file is not supported for download',
- type: 'warning'
- });
- }
- }
- },*/
- downloads(path, fileName) {
- const that = this;
- //资源是否保密
- if (that.bookContent.securityStatus == "N") {
- /*if(that.bookContent.fileVisibleStatus == 'N'){
- that.downfile();
- }else{
- if(this.$Cookies.get('token')){
- let user = window.localStorage.getItem("user");
- let users = JSON.parse(user);
- let userId = users.userId;
- that.downfile();
- }else{
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '请登录后下载',
- type: 'warning'
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: 'Please log in and download',
- type: 'warning'
- });
- }
- }
- }*/
- if (this.$Cookies.get("token")) {
- let user = window.localStorage.getItem("user");
- let users = JSON.parse(user);
- let userId = users.userId;
- that.downfile();
- } else {
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- this.$message({
- message: "请登录后下载",
- type: "warning",
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: "Please log in and download",
- type: "warning",
- });
- }
- }
- } else {
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- // alert('该文件暂不支持下载');
- this.$message({
- message: "该文件暂不支持下载",
- type: "warning",
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: "This file is not supported for download",
- type: "warning",
- });
- }
- }
- this.downloadMinusIntegral()
- },
-
- downfile() {
- const that = this;
- // if(that.bookContent.researchResultFile){
- const link = document.createElement("a");
- console.log("pdf");
- console.log(that.bookContent.researchResultFile);
- link.href = "api/file/pub/" + this.bookContent.researchResultFile;
- link.download = this.bookContent.name; //下载的文件名
- link.click();
- /*if(users.umsUser.userUsertype=="普通用户账号"){
- const link = document.createElement('a');
- link.href = "api/file/pub/" + this.bookContent.researchResultFile;
- link.download = this.bookContent.name; //下载的文件名
- link.click();
- }else{
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // alert('该文件暂不支持下载');
- this.$message({
- message: '该文件仅供会员可下载',
- type: 'warning'
- });
- } else {
- // alert('This file is not supported for download');
- this.$message({
- message: 'This document is downloadable by members only',
- type: 'warning'
- });
- }
- }*/
- // }else{
- // if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // this.$message({
- // message: '暂无文件',
- // type: 'warning'
- // });
- // } else {
- // // alert('This file is not supported for download');
- // this.$message({
- // message: 'No file',
- // type: 'warning'
- // });
- // }
- // }
- },
- toLogin() {
- this.toView("login");
- },
- toView(router, json) {
- this.$router.push({ name: router, params: { key: json } });
- },
- // 判断未登录跳转是否关闭
- toViewLoginChange(done) {
- this.toViewLogin = false;
- this.num = 5;
- clearInterval(this.timer);
- },
- loginTipsChange() {
- const that = this;
- this.num = 5;
- // clearInterval(timer_interval);
- this.timer = setInterval(function () {
- if (that.num > 0) {
- that.num--;
- } else {
- if (that.toViewLogin == true) {
- clearInterval(that.timer);
- that.toView("login");
- } else {
- clearInterval(that.timer);
- }
- }
- }, 1000);
- },
- },
- };
- </script>
- <style scoped>
- .pointer:hover {
- cursor: pointer;
- }
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin: 0 20px;
- }
- .secNavActive {
- color: #0091ff;
- }
- .mainBody {
- width: 100%;
- margin-top: 10px;
- box-sizing: border-box;
- }
- .bottomPage button:active {
- border-color: #0ab8ed;
- outline: 1px solid #0ab8ed;
- }
- .bottomPage button:focus {
- border-color: #0ab8ed;
- outline: 1px solid #0ab8ed;
- }
- .bottomPage input:focus {
- outline: none;
- border: none;
- box-shadow: none;
- }
- </style>
|