|
@@ -1,6 +1,8 @@
|
|
|
<script setup name="ReportPreview">
|
|
|
import { ref,computed, nextTick, reactive,toRefs } from 'vue'
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
+import {getSystemInfo,shareGenerate} from '@/api/common'
|
|
|
+import {Base64} from 'js-base64'
|
|
|
import apiReport from '@/api/report'
|
|
|
import AudioBox from './components/AudioBox.vue'
|
|
|
import {showToast} from 'vant'
|
|
@@ -19,6 +21,7 @@ const router=useRouter()
|
|
|
|
|
|
// 获取报告详情
|
|
|
let reportInfo=ref(null)
|
|
|
+let shareUrls=ref(null)
|
|
|
const smartState = reactive({
|
|
|
bgColor:'',
|
|
|
headImgStyle:null,//版头style
|
|
@@ -47,6 +50,8 @@ async function getReportDetail(){
|
|
|
smartState.layoutBaseInfo['研报标题']=reportInfo.value.Title
|
|
|
smartState.layoutBaseInfo['研报作者']=reportInfo.value.Author
|
|
|
smartState.layoutBaseInfo['创建时间']=[2,6].includes(reportInfo.value.State)?reportInfo.value.PublishTime:''
|
|
|
+
|
|
|
+ getSystemInfoFun()
|
|
|
}
|
|
|
}
|
|
|
if(route.query.id==-1){
|
|
@@ -62,23 +67,38 @@ const { bgColor,headImgStyle,endImgStyle,layoutBaseInfo } = toRefs(smartState)
|
|
|
|
|
|
|
|
|
const showImgPop = ref(false)
|
|
|
-const linkUrl = computed(() =>{
|
|
|
+const linkUrl = (waterMarkStr) =>{
|
|
|
console.log(publicSettingStore)
|
|
|
let str=''
|
|
|
+ let url=''
|
|
|
const baseUrl= publicSettingStore.publicSetting.ReportViewUrl;
|
|
|
if(reportInfo.value.ReportCode){
|
|
|
// 设置水印文案
|
|
|
- let waterMarkStr= '';
|
|
|
+ // let waterMarkStr= '';
|
|
|
|
|
|
str= reportInfo.value.ReportLayout===1
|
|
|
? `${baseUrl}/reportshare_crm_report?code=${reportInfo.value.ReportCode}&flag=${waterMarkStr}& ${reportInfo.value.Title}`
|
|
|
: `${baseUrl}/reportshare_smart_report?code=${reportInfo.value.ReportCode}& ${reportInfo.value.Title}`
|
|
|
+
|
|
|
+ const params={
|
|
|
+ "Url":str,
|
|
|
+ "ReportId":reportInfo.value.Id
|
|
|
+ }
|
|
|
+ shareGenerate(params).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ console.log(res)
|
|
|
+ if(location.port=='5173'){
|
|
|
+ url='http://8.136.199.33:8611'
|
|
|
+ }else{
|
|
|
+ url=location.origin
|
|
|
+ }
|
|
|
+ shareUrls.value=url+'/v1/share/'+res.Data.UrlToken
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
- return str
|
|
|
-})
|
|
|
+}
|
|
|
function handleCopyLink() {
|
|
|
- copyText(linkUrl.value,undefined,(error,event)=>{
|
|
|
+ copyText(shareUrls.value,undefined,(error,event)=>{
|
|
|
if(error){
|
|
|
showToast('复制链接成功')
|
|
|
|
|
@@ -88,6 +108,23 @@ function handleCopyLink() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+const waterMarkStr=ref('')
|
|
|
+const getSystemInfoFun=()=>{
|
|
|
+ getSystemInfo().then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ const systemUserInfo=res.Data
|
|
|
+ // 设置水印文案
|
|
|
+ let waterMarkString=''
|
|
|
+ if(systemUserInfo){
|
|
|
+ waterMarkString=`${systemUserInfo.RealName}${systemUserInfo.Mobile?systemUserInfo.Mobile:systemUserInfo.Email}`
|
|
|
+ waterMarkString=encodeURIComponent(waterMarkString)
|
|
|
+ waterMarkStr.value=Base64.encode(waterMarkString)
|
|
|
+ linkUrl(waterMarkStr.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|