hbchen 10 luni în urmă
părinte
comite
be25df1602

+ 7 - 0
src/api/common.js

@@ -77,4 +77,11 @@ export function apiGetPublicSetting(){
  */
 export function apiCheckClassify(params){
     return post('/report_approve/classify/check_open',params)
+}
+
+/**
+ * 获取用户信息
+ */
+export function getSystemInfo(){
+    return get('/system/sysuser/detail')
 }

+ 39 - 8
src/views/report/AddReport.vue

@@ -6,6 +6,7 @@ import ReportInsertContent from './components/reportInsert/Index.vue'
 import ReportPublishTimeSet from './components/ReportPublishTimeSet.vue'
 import apiReport from '@/api/report'
 import apiChart from '@/api/chart'
+import {getSystemInfo} from '@/api/common'
 import moment from 'moment'
 import { showToast,showDialog  } from 'vant'
 import { useRouter } from 'vue-router'
@@ -13,6 +14,8 @@ import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
 import {usePublicSettingStore} from '@/store/modules/publicSetting'
 import {useReportApprove} from '@/hooks/useReportApprove'
+import {Base64} from 'js-base64'
+
 const cachedViewsStore=useCachedViewsStore()
 const publicSettingStore = usePublicSettingStore()
 const {isApprove,hasApproveFlow,getEtaConfig,checkClassifyNameArr} = useReportApprove()
@@ -26,10 +29,15 @@ const {lastFocusPosition,initFroalaEditor}=useInitFroalaEditor()
 let reportContentEditorIns=null//报告内容编辑器实例
 
 let reportId=0//报告id
+let reportCode=0//报告id
+
+// 水印
+const waterMarkStr=ref('')
 
 onMounted(() => {
     const el=document.getElementById('editor')
     reportContentEditorIns=initFroalaEditor('#editor',{height:el.offsetHeight-150})
+    getSystemInfoFun()
 })
 
 
@@ -211,7 +219,7 @@ async function handleReportOpt(type){
         if(hasTel==1){
             const res=await apiReport.reportAdd(params)
             if(res.Ret===200){
-                reportPublish(res.Data.ReportId)
+                reportPublish(res.Data.ReportId,res.Data.ReportCode)
             }
         }else{
             // 显示发布提示弹窗,提示推送客群
@@ -232,6 +240,7 @@ async function handleReportOpt(type){
         const res=await apiReport.reportAdd(params)
         if(res.Ret===200){
             reportId=res.Data.ReportId
+            reportCode=res.Data.ReportCode
             showDSFBTime.value=true
         }
     }
@@ -256,9 +265,9 @@ async function handleConfirmPublish(e){
     }
     const saveRes=await apiReport.reportAdd(params)
     if(e===1){//仅发布
-        reportPublish(saveRes.Data.ReportId)
+        reportPublish(saveRes.Data.ReportId,saveRes.Data.ReportCode)
     }else if(e===2){
-        const pubRes=await apiReport.reportPublish({ReportIds:saveRes.Data.ReportId.toString()})
+        const pubRes=await apiReport.reportPublish({ReportIds:saveRes.Data.ReportId.toString(),ReportUrl:generatePdfLinks(saveRes.Data.ReportCode)})
         if(pubRes.Ret!==200) return
         const msgRes=await apiReport.reportMessageSend({ReportId:saveRes.Data.ReportId})
         if(msgRes.Ret!==200) return
@@ -266,8 +275,12 @@ async function handleConfirmPublish(e){
     }
 }
 
-async function reportPublish(id){
-    const res=await apiReport.reportPublish({ReportIds:id.toString()})
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
+
+async function reportPublish(id,code){
+    const res=await apiReport.reportPublish({ReportIds:id.toString(),ReportUrl:generatePdfLinks(code)})
     if(res.Ret===200){
         console.log('back');
         router.back()
@@ -291,7 +304,8 @@ function onConfirmDSFBTime(time){
             apiReport.reportPublishTimeSet({
                 ReportId:reportId,
                 PrePublishTime:time,
-                PreMsgSend:0
+                PreMsgSend:0,
+                ReportUrl:generatePdfLinks(reportCode)
             }).then(res=>{
                 if(res.Ret===200){
                     showToast('定时发布成功!')
@@ -306,7 +320,8 @@ function onConfirmDSFBTime(time){
         apiReport.reportPublishTimeSet({
             ReportId:reportId,
             PrePublishTime:time,
-            PreMsgSend:1
+            PreMsgSend:1,
+            ReportUrl:generatePdfLinks(reportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('定时发布成功!')
@@ -321,7 +336,8 @@ function onConfirmDSFBTime(time){
         apiReport.reportPublishTimeSet({
             ReportId:reportId,
             PrePublishTime:time,
-            PreMsgSend:0
+            PreMsgSend:0,
+            ReportUrl:generatePdfLinks(reportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('定时发布成功!')
@@ -358,6 +374,21 @@ async function handleReportSubmit(params){
     })
 }
 
+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)
+          }
+        }
+    })
+}
+
 </script>
 
 <template>

+ 36 - 11
src/views/report/EditReport.vue

@@ -6,6 +6,7 @@ import ReportInsertContent from './components/reportInsert/Index.vue'
 import ReportPublishTimeSet from './components/ReportPublishTimeSet.vue'
 import apiReport from '@/api/report'
 import apiChart from '@/api/chart'
+import {getSystemInfo} from '@/api/common'
 import moment from 'moment'
 import { showToast,showDialog } from 'vant'
 import { useRoute, useRouter } from 'vue-router'
@@ -13,6 +14,8 @@ import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import {usePublicSettingStore} from '@/store/modules/publicSetting'
 import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
 import {useReportApprove} from '@/hooks/useReportApprove'
+import {Base64} from 'js-base64'
+
 const cachedViewsStore=useCachedViewsStore()
 const publicSettingStore = usePublicSettingStore()
 const {isApprove,hasApproveFlow,getEtaConfig,checkClassifyNameArr} = useReportApprove()
@@ -20,12 +23,12 @@ const router=useRouter()
 const route=useRoute()
 const {checkAuthBtn} = useAuthBtn()
 
-
-
 const {lastFocusPosition,initFroalaEditor,imgUploadFlag,frolaEditorContentChange}=useInitFroalaEditor()
 let reportContentEditorIns=null//报告内容编辑器实例
 
 let autoSaveTimer=null
+// 水印
+const waterMarkStr=ref('')
 
 onMounted(() => {
     const el=document.getElementById('editor')
@@ -35,6 +38,7 @@ onMounted(() => {
     autoSaveTimer=setInterval(() => {
         autoSaveReportContent()
     }, 6000);
+    getSystemInfoFun()
 })
 onUnmounted(()=>{
     clearInterval(autoSaveTimer)
@@ -334,10 +338,10 @@ async function handleConfirmPublish(e){
     }
     const saveRes=await apiReport.reportEdit(params)
     if(e===1){//仅发布
-        reportPublish(saveRes.Data.ReportId)
+        reportPublish(saveRes.Data.ReportId,saveRes.Data.ReportCode)
     }else if(e===2){
         if(reportData.value.MsgIsSend===1) return
-        const pubRes=await apiReport.reportPublish({ReportIds:saveRes.Data.ReportId.toString()})
+        const pubRes=await apiReport.reportPublish({ReportIds:saveRes.Data.ReportId.toString(),ReportUrl:generatePdfLinks(saveRes.Data.ReportCode)})
         if(pubRes.Ret!==200) return
         const msgRes=await apiReport.reportMessageSend({ReportId:saveRes.Data.ReportId})
         if(msgRes.Ret!==200) return
@@ -345,8 +349,12 @@ async function handleConfirmPublish(e){
     }
 }
 
-async function reportPublish(id){
-    const res=await apiReport.reportPublish({ReportIds:id.toString()})
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
+
+async function reportPublish(id,code){
+    const res=await apiReport.reportPublish({ReportIds:id.toString(),ReportUrl:generatePdfLinks(code)})
     if(res.Ret===200){
         console.log('back');
         router.back()
@@ -361,7 +369,8 @@ function onConfirmDSFBTime(time){
         apiReport.reportPublishTimeSet({
             ReportId:reportData.value.Id,
             PrePublishTime:time,
-            PreMsgSend:0
+            PreMsgSend:0,
+            ReportUrl:generatePdfLinks(reportData.value.ReportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('定时发布成功!')
@@ -384,7 +393,8 @@ function onConfirmDSFBTime(time){
             apiReport.reportPublishTimeSet({
                 ReportId:reportData.value.Id,
                 PrePublishTime:time,
-                PreMsgSend:0
+                PreMsgSend:0,
+                ReportUrl:generatePdfLinks(reportData.value.ReportCode)
             }).then(res=>{
                 if(res.Ret===200){
                     showToast('定时发布成功!')
@@ -399,7 +409,8 @@ function onConfirmDSFBTime(time){
         apiReport.reportPublishTimeSet({
             ReportId:reportData.value.Id,
             PrePublishTime:time,
-            PreMsgSend:1
+            PreMsgSend:1,
+            ReportUrl:generatePdfLinks(reportData.value.ReportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('定时发布成功!')
@@ -414,7 +425,8 @@ function onConfirmDSFBTime(time){
         apiReport.reportPublishTimeSet({
             ReportId:reportData.value.Id,
             PrePublishTime:time,
-            PreMsgSend:0
+            PreMsgSend:0,
+            ReportUrl:generatePdfLinks(reportData.value.ReportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('定时发布成功!')
@@ -445,7 +457,20 @@ async function handleReportSubmit(params){
     }).catch(()=>{})
 }
 
-
+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)
+          }
+        }
+    })
+}
 </script>
 
 <template>

+ 33 - 18
src/views/report/List.vue

@@ -1,6 +1,7 @@
 <script setup name="ReportList">
 import {computed, nextTick, onMounted, reactive,ref} from 'vue'
 import apiReport from '@/api/report'
+import {getSystemInfo} from '@/api/common'
 import moment from 'moment'
 import ListClassify from './components/ListClassify.vue'
 import ReportPublishPop from './components/ReportPublishPop.vue'
@@ -13,6 +14,7 @@ import {useDownLoadFile} from '@/hooks/useDownLoadFile'
 import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
 import {useReportApprove} from '@/hooks/useReportApprove'
 import {usePublicSettingStore} from '@/store/modules/publicSetting'
+import {Base64} from 'js-base64'
 
 const cachedViewsStore=useCachedViewsStore()
 const publicSettingStore = usePublicSettingStore()
@@ -68,6 +70,8 @@ function handleCleanFilter(){
 // 分类弹窗
 const showClassify=ref(false)
 
+// 水印
+const waterMarkStr=ref('')
 
 const listState = reactive({
     publishStatus:'',
@@ -145,7 +149,6 @@ let activeReportData=ref('')
 let showPublishPop=ref(false)
 async function handleReportPublish(item){
     activeReportData.value=item
-
     // 周报校验是否上传了音频
     if(item.ClassifyNameFirst=='周报'){
         const validRes=await apiReport.weekReportValidAudio({ReportId:Number(item.Id)})
@@ -182,7 +185,8 @@ async function handleReportPublish(item){
 }
 function publishReportApprove(){
     apiReport.reportPublish({
-        ReportIds:activeReportData.value.Id.toString()
+        ReportIds:activeReportData.value.Id.toString(),
+        ReportUrl:generatePdfLinks(activeReportData.value.ReportCode)
     }).then(res=>{
         if(res.Ret!==200) return 
         showToast('发布成功')
@@ -190,6 +194,10 @@ function publishReportApprove(){
     })
 }
 
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
+
 //提交报告
 function handleReportSubmit(item){
     showDialog({
@@ -224,21 +232,12 @@ function handleReportCancel(item){
 }
 // type 1-pdf 2-长图
 function downloadPdfImg(item,type){
-    console.log(item,type,'item,type');
     showReportItemOpt.value=false
-    showToast('开始下载')
-    // 设置水印文案
-    // let reportUrl = `${baseUrl}/reportshare_pdf?code=${item.ReportCode}&flag=${waterMarkStr}&viewType=!pdf!`
-    let reportUrl = `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${item.ReportCode}&viewType=!pdf!`
-    apiReport.report2PdfImg({ReportUrl:reportUrl,ReportCode:item.ReportCode,Type:type}).then(res=>{
-        if(res.Ret == 200 && res.Data){
-            if(res.Data.endsWith('.pdf')){
-                window.open(res.Data,"_blank")
-            }else{
-                startDownload(res.Data,`${item.Title}.${res.Data.split('.')[res.Data.split('.').length-1]}`)
-            }
-        }
-    })
+    if(type == 1){
+        window.open(item.DetailPdfUrl,"_blank")
+    }else{
+        startDownload(item.DetailImgUrl,`${item.Title}`)
+    }
 }
 
 // 发布弹窗关闭
@@ -517,8 +516,24 @@ async function handleReportEdit(e){
     })
 }
 
+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)
+          }
+        }
+    })
+}
+
 onMounted(async ()=>{
     getEtaConfig()
+    getSystemInfoFun()
 })
 
 </script>
@@ -720,9 +735,9 @@ onMounted(async ()=>{
                     @click="handleReportPublishCancle(activeItem)">撤销</div> <!-- 实际上是取消发布 -->
                 <div class="item" v-if="checkAuthBtn(reportManageBtn.reportManage_cancelPublish)&&activeItem.State===6"
                     @click="handleReportCancel(activeItem)">撤销</div>
-                <div class="item" v-if="checkAuthBtn(reportManageBtn.reportManage_exportPdf)"
+                <div class="item" v-if="checkAuthBtn(reportManageBtn.reportManage_exportPdf) && activeItem.DetailPdfUrl"
                     @click="downloadPdfImg(activeItem,1)">下载pdf</div>
-                <div class="item" v-if="checkAuthBtn(reportManageBtn.reportManage_exportImg)"
+                <div class="item" v-if="checkAuthBtn(reportManageBtn.reportManage_exportImg) && activeItem.DetailImgUrl"
                     @click="downloadPdfImg(activeItem,2)">下载长图</div>   
                 <div class="item" @click="handldReportMsgSend(activeItem)" v-if="activeItem.MsgIsSend==0&&checkAuthBtn(reportManageBtn.reportManage_sendMsg)">推送消息</div>
             </template>

+ 7 - 1
src/views/report/components/ReportPublishPop.vue

@@ -9,6 +9,7 @@ const props=defineProps({
         default:''
     }
 })
+
 const emits=defineEmits(['close'])
 
 // 确认发布报告
@@ -16,7 +17,8 @@ const emits=defineEmits(['close'])
 function handleConfirmPublish(type){
     if(type==2&&props.reportData.MsgIsSend==1) return
     apiReport.reportPublish({
-        ReportIds:props.reportData.Id.toString()
+        ReportIds:props.reportData.Id.toString(),
+        ReportUrl:generatePdfLinks(props.reportData.ReportCode)
     }).then(res=>{
         if(res.Ret==200){
             cachedViewsStore.removeCaches('ReportList')
@@ -39,6 +41,10 @@ function handleConfirmPublish(type){
     })
 }
 
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
+
 // 推送消息
 function handleReportMessageSend(publish){
     apiReport.reportMessageSend({

+ 32 - 6
src/views/reportEn/AddReport.vue

@@ -5,6 +5,7 @@ import ReportInsertContent from '../report/components/reportInsert/Index.vue'
 import ReportPublishTimeSet from '@/views/report/components/ReportPublishTimeSet.vue'
 import apiReportEn from '@/api/reportEn'
 import apiChart from '@/api/chart'
+import {getSystemInfo} from '@/api/common'
 import moment from 'moment'
 import { showToast,showDialog } from 'vant'
 import { useRoute, useRouter } from 'vue-router'
@@ -13,6 +14,7 @@ import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import {enReportManageBtn} from '@/hooks/useAuthBtn'
 import {usePublicSettingStore} from '@/store/modules/publicSetting'
 import {useReportApprove} from '@/hooks/useReportApprove'
+import {Base64} from 'js-base64'
 
 const cachedViewsStore=useCachedViewsStore()
 const router=useRouter()
@@ -28,6 +30,10 @@ let overviewContentIns=null//overview内容编辑器实例
 let autoSaveTimer=null//自动保存定时器
 
 let reportId=route.query.id||0//报告id
+let reportCode=''
+
+// 水印
+const waterMarkStr=ref('')
 
 onMounted(async () => {
     const el=document.getElementById('editor')
@@ -39,6 +45,7 @@ onMounted(async () => {
             autoSaveReportContent()
         }, 6000);
     }
+    getSystemInfoFun()
 })
 onUnmounted(()=>{
     clearInterval(autoSaveTimer)
@@ -63,6 +70,7 @@ async function getReportDetail(){
     const res=await apiReportEn.getReportDetail({ReportId:Number(route.query.id)})
     if(res.Ret===200){
         reportData.value=res.Data
+        return console.log(reportData.value);
         reportBaseInfoData.addType=res.Data.AddType
         reportBaseInfoData.classifyName=[
             {
@@ -300,6 +308,7 @@ async function handleReportOpt(e){
     :await apiReportEn.reportAdd(params)
     if(res.Ret!==200) return
     reportId=res.Data.ReportId
+    reportCode=res.Data.ReportCode
     cachedViewsStore.removeCaches('ReportEnList')
     if(e==='cg'){
         showToast('保存成功')
@@ -318,7 +327,7 @@ async function handleReportOpt(e){
             message: reportData.value?.PrePublishTime?'该报告已设置定时发布,是否修改为立即发布?':`是否确定立即发布报告?`,
             showCancelButton:true
         }).then(()=>{
-            reportPublish(res.Data.ReportId)
+            reportPublish(res.Data.ReportId,res.Data.ReportCode)
         })
         
     }
@@ -331,8 +340,8 @@ async function handleReportOpt(e){
 }
 
 // 发布报告
-function reportPublish(id){
-    apiReportEn.reportPublish({ReportIds:id.toString()}).then(res=>{
+function reportPublish(id,code){
+    apiReportEn.reportPublish({ReportIds:id.toString(),ReportUrl:generatePdfLinks(code)}).then(res=>{
         if(res.Ret===200){
             showToast('发布成功')
             setTimeout(() => {
@@ -342,14 +351,16 @@ function reportPublish(id){
     })
 }
 
-
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
 // 定时发布报告选择时间
 const showDSFBTime=ref(false)
 function onConfirmDSFBTime(time){
-    console.log(time);
     apiReportEn.reportPublishTimeSet({
         ReportId:reportId,
-        PrePublishTime:time
+        PrePublishTime:time,
+        ReportUrl:generatePdfLinks(reportCode)
     }).then(res=>{
         if(res.Ret===200){
             showToast('定时发布成功')
@@ -376,6 +387,21 @@ function handleReportSubmit(reportId){
         })
     }).catch(()=>{})
 }
+
+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)
+          }
+        }
+    })
+}
 </script>
 
 <template>

+ 33 - 19
src/views/reportEn/List.vue

@@ -2,6 +2,7 @@
 import {nextTick, reactive,ref,computed,onMounted} from 'vue'
 import apiReportEn from '@/api/reportEn'
 import apiReport from '@/api/report'
+import {getSystemInfo} from '@/api/common'
 import moment from 'moment'
 import ListClassify from './components/ListClassify.vue'
 import SendEmail from './components/SendEmail.vue';
@@ -14,6 +15,7 @@ import {usePublicSettingStore} from '@/store/modules/publicSetting'
 import {useDownLoadFile} from '@/hooks/useDownLoadFile'
 import {enReportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
 import {useReportApprove} from '@/hooks/useReportApprove'
+import {Base64} from 'js-base64'
 
 const cachedViewsStore=useCachedViewsStore()
 const publicSettingStore = usePublicSettingStore()
@@ -25,7 +27,8 @@ const {isApprove,isOtherApprove,getEtaConfig} = useReportApprove()
 const { width, height } = useWindowSize()
 
 const router=useRouter()
-
+// 水印
+const waterMarkStr=ref('')
 //是否显示一键清空选项
 const showCleanFilterBox=computed(()=>{
     if(isClickClose.value) return false
@@ -134,14 +137,14 @@ function handleReportDel(item){
 
 // 发布报告
 async function handleReportPublish(item){
-    console.log(item);
     showDialog({
         title: '提示',
         message: item.PrePublishTime?'该报告已设置定时发布,是否修改为立即发布?':`是否确定立即发布报告?`,
         showCancelButton:true
     }).then(()=>{
         apiReportEn.reportPublish({
-            ReportIds:item.Id.toString()
+            ReportIds:item.Id.toString(),
+            ReportUrl:generatePdfLinks(item.ReportCode)
         }).then(res=>{
             if(res.Ret===200){
                 showToast('发布成功')
@@ -153,6 +156,10 @@ async function handleReportPublish(item){
     
 }
 
+function generatePdfLinks(Code){
+    return `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr.value}`
+}
+
 // 取消发布
 function handleReportPublishCancle(item){
     showDialog({
@@ -171,21 +178,12 @@ function handleReportPublishCancle(item){
 
 // type 1-pdf 2-长图
 function downloadPdfImg(item,type){
-    console.log(item,type,'item,type');
     showReportItemOpt.value=false
-    showToast('开始下载')
-    // 设置水印文案
-    // let reportUrl = `${baseUrl}/reportshare_pdf?code=${item.ReportCode}&flag=${waterMarkStr}&viewType=!pdf!`
-    let reportUrl = `${publicSettingStore.publicSetting.ReportViewUrl}/reportshare_pdf?code=${item.ReportCode}&viewType=!pdf!`
-    apiReport.report2PdfImg({ReportUrl:reportUrl,ReportCode:item.ReportCode,Type:type}).then(res=>{
-        if(res.Ret == 200 && res.Data){
-            if(res.Data.endsWith('.pdf')){
-                window.open(res.Data,"_blank")
-            }else{
-                startDownload(res.Data,`${item.Title}.${res.Data.split('.')[res.Data.split('.').length-1]}`)
-            }
-        }
-    })
+    if(type == 1){
+        window.open(item.DetailPdfUrl,"_blank")
+    }else{
+        startDownload(item.DetailImgUrl,`${item.Title}`)
+    }
 }
 
 //提交报告
@@ -496,8 +494,24 @@ function handleGoEmailLog(e){
         }
     })
 }
+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)
+          }
+        }
+    })
+}
+
 onMounted(()=>{
     getEtaConfig()
+    getSystemInfoFun()
 })
 </script>
 
@@ -686,9 +700,9 @@ onMounted(()=>{
                     @click="handleReportPublishCancle(activeItem)">撤销</div> <!-- 实际上是取消发布 -->
                 <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_cancelPublish)&&activeItem.State===6"
                     @click="handleReportCancle(activeItem)">撤销</div>
-                <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_exportPdf)"
+                <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_exportPdf) && activeItem.DetailPdfUrl"
                     @click="downloadPdfImg(activeItem,1)">下载pdf</div>
-                <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_exportImg)"
+                <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_exportImg) && activeItem.DetailImgUrl"
                     @click="downloadPdfImg(activeItem,2)">下载长图</div>   
             </template>
             <!-- 待审批,已驳回 -->