|
@@ -745,8 +745,8 @@ export default {
|
|
|
{label:"音频下载A",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_audioDownload'),States:true,text:'ReportManage.smart_audio_download_btn'},
|
|
|
{label:"音频下载",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_audioDownload'),States:true,text:'ReportManage.smart_audio_download_btn'},
|
|
|
],
|
|
|
- systemUserInfo:null,
|
|
|
- isPdfImgExporting:null,
|
|
|
+ waterMarkStr:"",
|
|
|
+ publishReportCode:''
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -773,7 +773,7 @@ export default {
|
|
|
//点击显示下载音频弹窗
|
|
|
handleShowDownloadAudio(item) {
|
|
|
this.downloadAudio.show = true;
|
|
|
- this.downloadAudio.title = item.Title;
|
|
|
+ this.downloadAudio.title = item.Title;
|
|
|
this.downloadAudio.list = item.ChapterVideoList;
|
|
|
this.downloadAudio.select = [];
|
|
|
},
|
|
@@ -1003,6 +1003,7 @@ export default {
|
|
|
//发布报告
|
|
|
this.batches = [];
|
|
|
this.batches.push(item.Id);
|
|
|
+ this.publishReportCode = item.ReportCode
|
|
|
this.isDSFB=item.PrePublishTime?true:false
|
|
|
|
|
|
// 周报不需要弹窗直接发布
|
|
@@ -1050,7 +1051,7 @@ export default {
|
|
|
// 点击确认发布&推送报告
|
|
|
// 1 仅发布 2发布且推送
|
|
|
handlePublic(type) {
|
|
|
- reportpublish({ ReportIds: this.batches.join(",") }).then((res) => {
|
|
|
+ reportpublish({ ReportIds: this.batches.join(","),ReportUrl:this.generatePdfLinks(this.publishReportCode)}).then((res) => {
|
|
|
if (res.Ret == 200) {
|
|
|
if (type == 2) {
|
|
|
reportMessageSend({
|
|
@@ -1082,6 +1083,10 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ generatePdfLinks(Code){
|
|
|
+ const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
+ return `${baseUrl}/reportshare_pdf?code=${Code}&flag=${this.waterMarkStr}`
|
|
|
+ },
|
|
|
handleClosePublish() {
|
|
|
this.batches = [];
|
|
|
this.showPublish = false;
|
|
@@ -1275,38 +1280,40 @@ export default {
|
|
|
// 搞成前面一部分按钮,后面一部分按钮的形式
|
|
|
getbuttonList(row,type){
|
|
|
if(!type) return []
|
|
|
+
|
|
|
+ const commonFilter=(but)=>{
|
|
|
+ return but.permission &&
|
|
|
+ (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
+ ( row.CanEdit || (![1,3].includes(row.State)) )
|
|
|
+ }
|
|
|
let buttonArr=this.allButtons.filter(but =>{
|
|
|
+ const commonFilterPass=commonFilter(but)
|
|
|
if(but.label==='编辑中'){
|
|
|
return but.permission &&
|
|
|
(typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
(!row.CanEdit)
|
|
|
}else if(but.label==='推送消息'){
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
- row.MsgIsSend==0
|
|
|
+ return commonFilterPass && row.MsgIsSend==0
|
|
|
}else if(but.label==='已推送消息'){
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
- row.MsgIsSend!==0
|
|
|
- }else if(['音频上传','下载Pdf','下载长图'].includes(but.label)){
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
+ return commonFilterPass && row.MsgIsSend!==0
|
|
|
+ }else if(['音频上传'].includes(but.label)){
|
|
|
+ return commonFilterPass&&
|
|
|
(![this.$t('ReportManage.smart_btn.morning_paper'), this.$t('ReportManage.smart_btn.weekly')].includes(row.ClassifyNameFirst))
|
|
|
}else if(but.label==='音频下载A'){
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
+ return commonFilterPass &&
|
|
|
(![this.$t('ReportManage.smart_btn.morning_paper'), this.$t('ReportManage.smart_btn.weekly')].includes(row.ClassifyNameFirst))&&
|
|
|
row.VideoUrl
|
|
|
}else if(but.label==='音频下载'){
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
+ return commonFilterPass &&
|
|
|
[this.$t('ReportManage.smart_btn.morning_paper'), this.$t('ReportManage.smart_btn.weekly')].includes(row.ClassifyNameFirst)&&
|
|
|
row.ChapterVideoList.length > 0
|
|
|
+ }else if(but.label==='下载Pdf'){
|
|
|
+ return commonFilterPass && row.DetailPdfUrl
|
|
|
+ }else if(but.label==='下载长图'){
|
|
|
+ return commonFilterPass && row.DetailImgUrl
|
|
|
}
|
|
|
|
|
|
- return but.permission &&
|
|
|
- (typeof(but.States)=='boolean' || but.States.includes(row.State) ) &&
|
|
|
- ( row.CanEdit || (![1,3].includes(row.State)) )
|
|
|
+ return commonFilterPass
|
|
|
})
|
|
|
|
|
|
if(type=='f') return buttonArr.slice(0,2)
|
|
@@ -1357,38 +1364,23 @@ export default {
|
|
|
getSystemUserInfo(){
|
|
|
departInterence.systemUserInfo().then(res=>{
|
|
|
if(res.Ret===200){
|
|
|
- this.systemUserInfo=res.Data
|
|
|
+ const systemUserInfo=res.Data
|
|
|
+ // 设置水印文案
|
|
|
+ let waterMarkString=''
|
|
|
+ if(systemUserInfo){
|
|
|
+ waterMarkString=`${systemUserInfo.RealName}${systemUserInfo.Mobile?systemUserInfo.Mobile:systemUserInfo.Email}`
|
|
|
+ waterMarkString=encodeURIComponent(waterMarkString)
|
|
|
+ this.waterMarkStr=Base64.encode(waterMarkString)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
downloadPdfImg(row,type){
|
|
|
- (!this.isPdfImgExporting) && (this.isPdfImgExporting=this.$message({
|
|
|
- type:"info",
|
|
|
- message:'下载中···',
|
|
|
- duration:0,
|
|
|
- iconClass:'el-icon-loading'
|
|
|
- }))
|
|
|
- // 设置水印文案
|
|
|
- let waterMarkStr=''
|
|
|
- if(this.systemUserInfo){
|
|
|
- waterMarkStr=`${this.systemUserInfo.RealName}${this.systemUserInfo.Mobile?this.systemUserInfo.Mobile:this.systemUserInfo.Email}`
|
|
|
- waterMarkStr=encodeURIComponent(waterMarkStr)
|
|
|
- waterMarkStr=Base64.encode(waterMarkStr)
|
|
|
+ if(type == 1){
|
|
|
+ window.open(row.DetailPdfUrl,"_blank")
|
|
|
+ }else{
|
|
|
+ this.handleDownloadResource(row.DetailImgUrl,`${row.Title}`)
|
|
|
}
|
|
|
- const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
- let reportUrl = `${baseUrl}/reportshare_pdf?code=${row.ReportCode}&flag=${waterMarkStr}&viewType=!pdf!`
|
|
|
- report2PdfImg({ReportUrl:reportUrl,ReportCode:row.ReportCode,Type:type}).then(res=>{
|
|
|
- if(res.Ret == 200 && res.Data){
|
|
|
- if(res.Data.endsWith('.pdf')){
|
|
|
- window.open(res.Data,"_blank")
|
|
|
- }else{
|
|
|
- this.handleDownloadResource(res.Data,`${row.Title}`)
|
|
|
- }
|
|
|
- }
|
|
|
- }).finally(()=>{
|
|
|
- this.isPdfImgExporting.close()
|
|
|
- this.isPdfImgExporting=null
|
|
|
- })
|
|
|
}
|
|
|
},
|
|
|
};
|