hbchen il y a 10 mois
Parent
commit
52b82fe91e

+ 1 - 0
package.json

@@ -53,6 +53,7 @@
     "vue-clipboard2": "^0.3.3",
     "vue-codemirror": "^4.0.6",
     "vue-count-to": "^1.0.13",
+    "vue-drag-resize": "^1.5.4",
     "vue-froala-wysiwyg": "^3.1.0",
     "vue-giant-tree": "^1.0.0",
     "vue-i18n": "^8.28.2",

+ 7 - 1
src/api/modules/oldApi.js

@@ -341,6 +341,11 @@ const apiDownloadResource=params=>{
 	return http.get('/resource/file/download',params,'blob')
 }
 
+// 中英文研报、智能研报转pdf和长图
+const report2PdfImg=params=>{
+	return http.post('/smart_report/get_pdf_url',params)
+}
+
 export {
 	userLogin,
 	modifyPwd,
@@ -420,5 +425,6 @@ export {
 	setChapterSort,
 	getRealPublicSettings,
 	userLogOut,
-	apiDownloadResource
+	apiDownloadResource,
+	report2PdfImg
 }

+ 7 - 4
src/api/modules/smartReport.js

@@ -88,11 +88,14 @@ const apiSmartReport={
         return http.post('/smart_report/resource/add',params)
     },
 
-    //资源库图片重命名
-    imgReourceRename:params=>{
-        return http.post('/smart_report/resource/rename',params)
+    // //资源库图片重命名
+    // imgReourceRename:params=>{
+    //     return http.post('/smart_report/resource/rename',params)
+    // },
+    //资源库图片编辑
+    imgReourceEdit:params=>{
+        return http.post('/smart_report/resource/edit',params)
     },
-
     //资源库图片删除
     imgReourceDel:params=>{
         return http.post('/smart_report/resource/remove',params)

BIN
src/assets/img/icons/layout-option-icon.png


+ 4 - 0
src/lang/commonLang.js

@@ -60,6 +60,10 @@ export default {
     reset_btn: {
       en: 'Reset',
       zh: '重置'
+    },
+    complete_btn: {
+      en: 'Complete',
+      zh: '完成'
     }
   },
   Table: {

+ 1 - 1
src/lang/modules/ReportManagement/ReportList.js

@@ -14,7 +14,7 @@ export const ReportListEn = {
   designated_personnel: "Designated personnel",
   designated_sender_information: "Designated sender information:",
   please_select_personnel: "Please select personnel",
-  click_through_details: "点击量详情 Click through details",
+  click_through_details: "Click through details",
   customer_name: "Customer Name",
   email_address: "e-mail address",
   Last_click_time: "Last click time",

+ 4 - 0
src/lang/modules/ReportManagement/SmartReport.js

@@ -65,6 +65,8 @@ export const SmartReportEn = {
     submission: "Submission",
     editing: "Editing",
     withdraw: "Withdraw",
+    download_pdf: "Download PDF",
+    download_long_image: "Download Long Image",
     upload: "Upload",
     uploading: "Uploading",
     select_all: "Select All",
@@ -190,6 +192,8 @@ export const SmartReportZh = {
     submission: "提交",
     editing: "编辑中...",
     withdraw: "撤销",
+    download_pdf: "下载pdf",
+    download_long_image: "下载长图",
     upload: "上传",
     uploading: "上传中",
     select_all: "全选",

+ 31 - 0
src/lang/modules/systemManage/BaseConfig.js

@@ -60,9 +60,24 @@ export const BaseConfigEn = {
     resource_btn01:'Upload Image',
     resource_btn02:'Rename',
     resource_btn03:'Deselect/Deselect All',
+    resource_btn04:'Upload Layout',
+    resource_btn05:'Edit Layout',
     resource_des01:'has been selected',
     resource_label01:'Image Name',
     resource_label02:'Image Type',
+    report_title:"Report Title",
+    report_author:"Report Author",
+    report_creation_time:"Creation Time",
+    select_layout:"Select Layout",
+    edit_layout:"Edit Layout",
+    completed_step:"Completed Step",
+    text_style:"Text Style",
+    smart_layout_resource_library:"Intelligent Research Report Template Library",
+    style_font_w_normal:'normal',
+    style_font_w_bold:'body',
+    style_text_align_left:'left',
+    style_text_align_center:'center',
+    style_text_align_right:'right',
     upload_suggest:'Supports formats like jpg, jpeg, png, etc. It is recommended to upload headers of 800*200 and footers of 800*80',
     resource_del_msg:'Are you sure to delete the selected image?',
 
@@ -138,9 +153,25 @@ export const BaseConfigZh = {
     resource_btn01:'上传图片',
     resource_btn02:'重命名',
     resource_btn03:'取消选择',
+    resource_btn04:'上传版图',
+    resource_btn05:'编辑版图',
     resource_des01:'已选择',
     resource_label01:'图片名称',
     resource_label02:'图片类型',
+    report_title:"研报标题",
+    report_author:"研报作者",
+    report_creation_time:"创建时间",
+    select_layout:"选择版图",
+    edit_layout:"编辑版图",
+    completed_step:"已完成步骤",
+    text_style:"文字样式",
+    smart_layout_resource_library:"智能研报版图资源库",
+    // 样式
+    style_font_w_normal:'常规体',
+    style_font_w_bold:'加粗体',
+    style_text_align_left:'居左',
+    style_text_align_center:'居中',
+    style_text_align_right:'居右',
     upload_suggest:'支持jpg、jpeg、png等格式,建议上传版头800*200,版尾800*80',
     resource_del_msg:'是否确认删除选中图片?',
 

+ 7 - 0
src/utils/buttonConfig.js

@@ -24,6 +24,8 @@ export const reportManageBtn={
     reportManage_reportView_copyWechat:'reportManage:reportView:copyWechat',//研报预览页面-复制链接
     reportManage_audioDownload:'reportManage:audioDownload',//音频下载
     reportManage_audioUpload:'reportManage:audioUpload',//音频上传
+    reportManage_exportImg:'reportManage:exportImg',//下载长图
+    reportManage_exportPdf:'reportManage:exportPdf',//下载Pdf
     reportManage_reportDel:'reportManage:reportDel',//删除研报
     reportManage_reportEdit:'reportManage:reportEdit',//编辑研报
     reportManage_cancelPublish:'reportManage:cancelPublish',//取消发布
@@ -43,6 +45,7 @@ export const reportManageBtn={
     reportManage_reportView_wechartShare:'smartReportManage:reportView:wechartShare',//研报预览页面-微信分享
     reportManage_reportView_copyWechat:'smartReportManage:reportView:copyWechat',//研报预览页面-复制链接
     reportManage_exportImg:'smartReportManage:exportImg',//导出图片
+    reportManage_exportPdf:'smartReportManage:exportPdf',//下载Pdf
     reportManage_audioDownload:'smartReportManage:audioDownload',//音频下载
     reportManage_audioUpload:'smartReportManage:audioUpload',//音频上传
     reportManage_reportDel:'smartReportManage:reportDel',//删除研报
@@ -64,6 +67,8 @@ export const enReportManageBtn = {
     enReport_sendEmail:'enReport:sendEmail',//群发邮件/群发日志
     enReport_reportDel:'enReport:reportDel',//删除研报
     enReport_reportEdit:'enReport:reportEdit',//编辑研报
+    enReport_exportImg:'enReport:exportImg',//下载长图
+    enReport_exportPdf:'enReport:exportPdf',//下载Pdf
     enReport_cancelPublish:'enReport:cancelPublish',//取消发布
     enReport_publish:'enReport:publish',//发布研报
     enReport_syncPolicy:'enReport:syncPolicy',//同步策略报告
@@ -715,6 +720,8 @@ export const baseConfigPermission = {
     etaBaseConfig_login_systemLogo_pc:'baseSetting:loginSetting:systemLogo:pc',//系统logoPC端
     etaBaseConfig_login_websiteName_mobile:'baseSetting:loginSetting:websiteName:mobile',//网站名称移动端
     etaBaseConfig_login_websiteName_pc:'baseSetting:loginSetting:websiteName:pc',//网站名称移动端
+    etaBaseConfig_source_edit:'baseSetting:sourceSetting:edit',//资源库编辑
+    etaBaseConfig_source_del:'baseSetting:sourceSetting:del',//资源库删除
 }
 
 /*-----------外部链接配置-------- */

+ 33 - 2
src/views/approve_manage/approveDetail.vue

@@ -63,6 +63,7 @@ import Reportdtl from '@/views/report_manage/reportdtl.vue'
 import TimeLine from './components/timeLine.vue';
 import RejectDialog from './components/rejectDialog.vue';
 import {approveInterence} from '@/api/modules/approve.js';
+import {departInterence} from '@/api/api.js'
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 
 const ApproveType = ['','依次审批','会签','或签']
@@ -90,6 +91,7 @@ export default {
                 stateText:'pending',//审批状态对应图片文字:待审批(pending),已同意(passed),已驳回(reject),已撤回(return)
                 isCurrentApprover:false,//审批进行中的节点审批人是否是当前用户,控制通过&驳回按钮显示
             },
+            waterMarkStr:'',//水印
         };
     },
     computed:{
@@ -110,6 +112,7 @@ export default {
                 const {Report={},Approve={}} = res.Data||{}
                 this.reportInfo = {
                     reportId:Report.ReportId||0,
+                    reportCode:Report.ReportCode,
                     title:Report.ReportTitle||'',
                     classify:Report.ReportClassify||'',
                     approver:Approve.ApplyUserName||'',
@@ -270,13 +273,26 @@ export default {
             }
             if(type==='pass'){
                 res = await approveInterence.passApprove({
-                    ReportApproveId:Number(approveId)
+                    ReportApproveId:Number(approveId),
+                    ReportUrl:this.generatePdfLinks(this.reportInfo.reportCode,this.reportInfo.type)
                 })
             }
             if(res.Ret!==200) return 
             this.$message.success( type==='return'?this.$t('AprrovalPage.revoke_success') :this.$t('AprrovalDetailPage.passed_success'));
             type!=='reject'&&(this.$router.replace("/approveList"))
         },
+        generatePdfLinks(code,type){
+            if(type == 1){
+                const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+                return `${baseUrl}/reportshare_pdf?code=${code}&flag=${this.waterMarkStr}`
+            }else if(type == 2){
+                const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+                return `${baseUrl}/reportshare_pdf_en?code=${code}&flag=${this.waterMarkStr}`
+            }else if(type==3){
+                const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+                return `${baseUrl}/reportshare_smart_pdf?code=${code}`
+            }
+        },
         rejectApprove(reason){
             this.isDetailDialogShow = false
             approveInterence.rejectApprove({
@@ -287,10 +303,25 @@ export default {
                 this.$message.success(this.$t('AprrovalDetailPage.rejected_success') )
                 this.$router.replace("/approveList")
             })
-        }
+        },
+        getSystemUserInfo(){
+            departInterence.systemUserInfo().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)
+                        this.waterMarkStr=Base64.encode(waterMarkString)
+                    }
+                }
+            })
+        },
     },
     mounted(){
         this.getApproveDetail()
+        this.getSystemUserInfo()
     },
     components: { TimeLine, ReportDetail, Reportdtl, RejectDialog }
 };

+ 26 - 3
src/views/report_manage/addreportNew.vue

@@ -366,7 +366,8 @@ import {
 	getDraft,
 	dataBaseInterface,
 	sandInterface,
-	reportSetPrepublish
+	reportSetPrepublish,
+	departInterence
 } from '@/api/api.js';
 import http from '@/api/http.js';
 import VueFroala from 'vue-froala-wysiwyg';
@@ -437,6 +438,7 @@ export default {
 			},
 			lastEditRange: null,
 			report_draft_id: 0,
+			waterMarkStr:''
 		};
 	},
 	mounted() {
@@ -445,6 +447,7 @@ export default {
 		this.getreportauthor();
 		this.getSandTable();
 		this.getSheetList();
+		this.getSystemUserInfo()
 		this.timer = setInterval(() => {
 			this.autoSave();
 		}, 6000);
@@ -734,15 +737,19 @@ export default {
 				}
 			}
 		},
-		publishreport(id) {
+		publishreport(id,code) {
 			//发布报告
-			reportpublish({ ReportIds: String(id) }).then((res) => {
+			reportpublish({ ReportIds: String(id) ,ReportUrl:this.generatePdfLinks(code)}).then((res) => {
 				if (res.Ret == 200) {
 					this.isPublishloading = false;
 					this.$router.push({ path: '/reportlist' });
 				}
 			});
 		},
+		generatePdfLinks(Code){
+			const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+			return `${baseUrl}/reportshare_pdf?code=${Code}&flag=${this.waterMarkStr}`
+		},
 		// 定时发布报告
 		handleSetReportPrepublish(){
 			if(!this.taskTime){
@@ -771,6 +778,7 @@ export default {
 								ReportId:Number(this.report_draft_id),
 								PrePublishTime:this.taskTime,
 								PreMsgSend:0,
+								ReportUrl:this.generatePdfLinks(this.reportCode)
 							}).then(res=>{
 								if(res.Ret===200){
 									this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -784,6 +792,7 @@ export default {
 							ReportId:Number(this.report_draft_id),
 							PrePublishTime:this.taskTime,
 							PreMsgSend:isPost?1:0,
+							ReportUrl:this.generatePdfLinks(this.reportCode)
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -911,6 +920,20 @@ export default {
 				}
 			});
 		},
+		getSystemUserInfo(){
+      departInterence.systemUserInfo().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)
+            this.waterMarkStr=Base64.encode(waterMarkString)
+          }
+        }
+      })
+    },
 	},
 	components: {importMyChart,importSemantics},
 	watch: {

+ 27 - 3
src/views/report_manage/editreportNew.vue

@@ -362,7 +362,8 @@ import {
 	classifyIdDetail,
 	dataBaseInterface,
 	sandInterface,
-	reportSetPrepublish
+	reportSetPrepublish,
+	departInterence
 } from 'api/api.js';
 import VueFroala from 'vue-froala-wysiwyg';
 import urlSlug from 'url-slug';
@@ -448,6 +449,7 @@ export default {
 		this.getreportauthor();
 		this.getSandTable();
 		this.getSheetList();
+		this.getSystemUserInfo()
 		this.timer = setInterval(() => {
 			this.autoSave();
 		}, 6000);
@@ -727,15 +729,19 @@ export default {
 			// 	}
 			// });
 		},
-		publishreport(id) {
+		publishreport(id,code) {
 			//发布报告
-			reportpublish({ ReportIds: String(id) }).then((res) => {
+			reportpublish({ ReportIds: String(id) ,ReportCode:this.generatePdfLinks(code)}).then((res) => {
 				if (res.Ret == 200) {
 					this.isPublishloading = false;
 					this.$router.push({ path: '/reportlist' });
 				}
 			});
 		},
+		generatePdfLinks(Code){
+			const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+			return `${baseUrl}/reportshare_pdf?code=${Code}&flag=${this.waterMarkStr}`
+		},
 		// 定时发布报告
 		handleSetReportPrepublish(){
 			if(!this.taskTime){
@@ -747,12 +753,14 @@ export default {
 				this.$message.warning(this.$t('ReportManage.smart_msg.than_current_time'))
 				return
 			}
+			// return console.log(this.reportCode,'reportCode');
 			// 如果改报告已经推送过模板消息
 			if(this.ThsMsgIsSend==1){
 				reportSetPrepublish({
 					ReportId:Number(this.report_id),
 					PrePublishTime:this.taskTime,
 					PreMsgSend:0,
+					ReportUrl:this.generatePdfLinks(this.reportCode)
 				}).then(res=>{
 					if(res.Ret===200){
 						this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -777,6 +785,7 @@ export default {
 								ReportId:Number(this.report_id),
 								PrePublishTime:this.taskTime,
 								PreMsgSend:0,
+								ReportUrl:this.generatePdfLinks(this.reportCode)
 							}).then(res=>{
 								if(res.Ret===200){
 									this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -790,6 +799,7 @@ export default {
 							ReportId:Number(this.report_id),
 							PrePublishTime:this.taskTime,
 							PreMsgSend:isPost?1:0,
+							ReportUrl:this.generatePdfLinks(this.reportCode)
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -917,6 +927,20 @@ export default {
 				}
 			});
 		},
+		getSystemUserInfo(){
+      departInterence.systemUserInfo().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)
+            this.waterMarkStr=Base64.encode(waterMarkString)
+          }
+        }
+      })
+    },
 	},
 	components: {importMyChart,importSemantics},
 };

+ 9 - 6
src/views/report_manage/mixins/messagePush.js

@@ -7,6 +7,7 @@ export default {
     return {
       isMessagePost: false,
       isRightFormShow:true,
+      reportCode:''
     };
   },
   methods: {
@@ -14,6 +15,7 @@ export default {
       reportedit(params2).then(async (res) => {
         if (res.Ret == 200) {
           this.$message.success(res.Msg);
+          this.reportCode=res.Data.ReportCode
           if (tp == "yl") {
             // this.$router.push({name:'预览报告',query:{id:res.report_id}});
             let { href } = this.$router.resolve({
@@ -23,16 +25,16 @@ export default {
             window.open(href, "_blank");
           } else if (tp == "fb") {
             if(this.isApprove){
-                await this.publishreport(res.Data.ReportId);
+                await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
                 return 
             }
             if (this.isMessagePost) {
-              await this.publishreport(res.Data.ReportId);
+              await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
               await reportMessageSend({
                 ReportId: res.Data.ReportId,
               }).then(() => {});
             } else {
-              this.publishreport(res.Data.ReportId);
+              this.publishreport(res.Data.ReportId,res.Data.ReportCode);
             }
           } else if(tp=='dsfb'){
             this.showDSFB=true
@@ -48,6 +50,7 @@ export default {
         if (res.Ret == 200) {
           this.$message.success(res.Msg);
           this.report_draft_id = res.Data.ReportId;
+          this.reportCode=res.Data.ReportCode
           if (tp == "yl") {
             // this.$router.push({name:'预览报告',query:{id:res.report_id}});
             let { href } = this.$router.resolve({
@@ -57,16 +60,16 @@ export default {
             window.open(href, "_blank");
           } else if (tp == "fb") {
             if(this.isApprove){
-                await this.publishreport(res.Data.ReportId);
+                await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
                 return 
             }
             if (this.isMessagePost) {
-              await this.publishreport(res.Data.ReportId);
+              await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
               await reportMessageSend({
                 ReportId: res.Data.ReportId,
               }).then(() => {});
             } else {
-              this.publishreport(res.Data.ReportId);
+              this.publishreport(res.Data.ReportId,res.Data.ReportCode);
             }
           } else if(tp=='dsfb'){
             this.showDSFB=true

+ 28 - 5
src/views/report_manage/reportEn/reportEditor.vue

@@ -375,7 +375,8 @@
 import {
 	reportauthor,
 	dataBaseInterface,
-	sandInterface
+	sandInterface,
+	departInterence
 } from 'api/api.js';
 import {authorEn} from '@/api/modules/reportAuthorApi.js';
 import * as reportEnInterface from '@/api/modules/reportEnApi';
@@ -523,6 +524,8 @@ export default {
 				},
 				selectableRange:'00:00:00 - 23:59:59'
 			},
+			publishReportCode:'',
+			waterMarkStr:''
 		};
 	},
 	beforeRouteEnter(to, from, next) {
@@ -540,6 +543,7 @@ export default {
 		this.getreportauthor();
 		this.getSandTable();
 		this.getSheetList();
+		this.getSystemUserInfo()
 		this.timer = setInterval(() => {
 			this.autoSave();
 		}, 6000);
@@ -699,6 +703,7 @@ export default {
 						content: data.Content,
             overview:data.Overview||''
 					};
+					this.publishReportCode=res.Data.ReportCode
 					// 回显定时发布时间
 					if(data.PrePublishTime){
 						this.taskTime=data.PrePublishTime
@@ -818,15 +823,18 @@ export default {
 			})
 		},
 
-		publishreport(id) {
+		publishreport(id,code) {
 			//发布报告
-			reportEnInterface.reportPublish({ ReportIds: String(id) }).then((res) => {
+			reportEnInterface.reportPublish({ ReportIds: String(id),ReportUrl:this.generatePdfLinks(this.publishReportCode)}).then((res) => {
 				if (res.Ret !== 200) return
 				this.isPublishloading = false;
 				this.$router.push({ path: '/reportEnList' });
 			});
 		},
-
+		generatePdfLinks(Code){
+			const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+			return `${baseUrl}/reportshare_pdf_en?code=${Code}&flag=${this.waterMarkStr}`
+		},
 		//定时发布报告
 		handleConfirmDSFB(){
 			if(!this.taskTime){
@@ -842,7 +850,8 @@ export default {
 			}
 			reportEnInterface.enReportPrepblish({
 				ReportId:this.report_id,
-				PrePublishTime:this.taskTime
+				PrePublishTime:this.taskTime,
+				ReportUrl:this.generatePdfLinks(this.publishReportCode)
 			}).then(res=>{
 				if(res.Ret===200){
 					this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -996,6 +1005,20 @@ export default {
 				}
 			});
 		},
+		getSystemUserInfo(){
+			departInterence.systemUserInfo().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)
+						this.waterMarkStr=Base64.encode(waterMarkString)
+					}
+				}
+			})
+	},
 	},
 	components: {importMyChart,setEnNameDia,importSemantics},
 };

+ 220 - 51
src/views/report_manage/reportEn/reportlist.vue

@@ -149,6 +149,7 @@
 					align="center"
 					:prop="item.key"
 					:fixed="item.fixed?item.fixed:false"
+          :show-overflow-tooltip="item.key=='Abstract'"
 				>
           <template #header>
             <span v-if="item.key==='Pv'">
@@ -200,46 +201,96 @@
               </span>
 
               <span v-else-if="item.key==='handle'">
-                    <!-- 操作:未发布——发布、编辑、删除
-                    已发布——取消发布、群发邮件/群发日志
-                    待提交——提交、编辑、删除
-                    待审批——撤销
-                    已通过——撤销、群发邮件/群发日志
-                    已驳回——撤销 -->
-                    <template v-if="[1,3].includes(row.State)">
-                        <span class="editsty" @click="reportHandle(row,'publish')" v-if="row.CanEdit&&row.State===1
-                                &&permissionBtn.isShowBtn('enReportManageBtn','enReport_publish')">{{$t('ReportManage.smart_btn.publish')}}</span>
-                        <span class="editsty" @click="handleSubmitReport(row)" v-if="row.CanEdit&&row.State===3
-                                &&permissionBtn.isShowBtn('enReportManageBtn','enReport_publish')">{{$t('ReportManage.smart_btn.submission')}}</span>
-                        <span v-permission="permissionBtn.enReportManageBtn.enReport_reportEdit" class="editsty"
-                            @click="reportHandle(row,'edit')" v-if="row.CanEdit">{{$t('Table.edit_btn')}}</span>
-                        <span v-permission="permissionBtn.enReportManageBtn.enReport_reportEdit" class="editsty"
-                            @click="reportHandle(row,'edit')" v-else>{{row.Editor||''}}{{$t('ReportManage.smart_btn.editing')}}</span>
-                        <span v-permission="permissionBtn.enReportManageBtn.enReport_reportDel" class="deletesty"
-                            @click="reportHandle(row,'del')" v-if="row.CanEdit">{{$t('Table.delete_btn')}}</span>
-                    </template>
-                    <template v-if="[2,6].includes(row.State)">
-                        <span
-                            v-if="permissionBtn.isShowBtn('enReportManageBtn','enReport_cancelPublish')&&row.State===2"
-                            @click="reportHandle(row,'cancelPublish')" class="deletesty">{{$t('ReportManage.smart_btn.withdraw')}}</span><!-- 取消发布 -->
-                        <span
-                            v-if="permissionBtn.isShowBtn('enReportManageBtn','enReport_cancelPublish')&&row.State===6"
-                            @click="cancelApprove(row)" class="deletesty">{{$t('ReportManage.smart_btn.withdraw')}}</span>
-                        <span
-                            v-if="row.EmailState===0&&row.EmailAuth&&permissionBtn.checkPermissionBtn(permissionBtn.enReportManageBtn.enReport_sendEmail)"
-                            class="editsty copylink" @click="reportHandle(row,'sendEmail')">{{$t('ReportManage.smart_btn.send_email')}}</span>
-
-                        <span class="editsty copylink"
-                            v-if="row.EmailState===1&&row.EmailAuth&&permissionBtn.checkPermissionBtn(permissionBtn.enReportManageBtn.enReport_sendEmail)"
-                            @click="reportHandle(row,'view-log')" style="position: relative;">
-                            {{$t('ReportManage.smart_btn.send_log')}}
+                <!-- 操作 -->
+                                <!-- 未发布,待提交 -->
+                                <!-- <template v-if="[1,3].includes(scope.row.State)">
+                    <span class="editsty" @click="publishreport(scope.row)"
+                        v-if="scope.row.CanEdit&&scope.row.State===1
+                            &&permissionBtn.isShowBtn('reportManageBtn','reportManage_publish')"
+                    >{{$t('ReportManage.smart_btn.publish')}}</span>
+                    <span class="editsty" @click="handleSubmitReport(scope.row)"
+                        v-if="scope.row.CanEdit&&scope.row.State===3
+                            &&permissionBtn.isShowBtn('reportManageBtn','reportManage_publish')"
+                    >{{$t('ReportManage.smart_btn.submission')}}</span>
+                    <span v-permission="permissionBtn.reportManageBtn.reportManage_reportEdit" class="editsty"
+                        @click="editreport(scope.row, 'edit')" v-if="scope.row.CanEdit">{{$t('Table.edit_btn')}}</span>
+                    <span v-permission="permissionBtn.reportManageBtn.reportManage_reportEdit" class="editsty"
+                        @click="editreport(scope.row, 'editing')" v-else>{{ scope.row.Editor || "" }}{{$t('ReportManage.smart_btn.editing')}}</span>
+                    <span v-permission="permissionBtn.reportManageBtn.reportManage_reportDel" class="deletesty"
+                        @click="deleteitem(scope.row)" v-if="scope.row.CanEdit">{{$t('Table.delete_btn')}}</span>
+                </template> -->
+                <!-- 已发布,已通过 -->
+                <!-- <template v-if="[2,6].includes(scope.row.State)">
+                    <span v-if="scope.row.State===2&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
+                        @click="canclepublish(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
+                    <span v-if="scope.row.State===6&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
+                        @click="cancelReport(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
+                    <span
+                        v-if="scope.row.MsgIsSend == 0 && permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_sendMsg)"
+                        style="color: #4099ef; cursor: pointer" @click="messageSend(scope.row)">{{$t('ReportManage.smart_push_notification_btn')}}</span>
+                    <span
+                        v-else-if="scope.row.MsgIsSend != 0&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_sendMsg)"
+                        style="color: red">{{$t('ReportManage.smart_notification_pushed')}}</span>
+                </template> -->
+                <!-- 待审批,已驳回 -->
+                <!-- <template v-if="[4,5].includes(scope.row.State)">
+                    <span v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
+                        @click="cancelReport(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
+                </template> -->
+                <!-- 音频上传和下载,跟State无关 -->
+                <!-- <span style="color: #46c371; cursor: pointer"
+                    v-if="![$t('ReportManage.smart_btn.morning_paper'), $t('ReportManage.smart_btn.weekly')].includes(scope.row.ClassifyNameFirst)&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_audioUpload)"
+                    @click="openupload(scope.row.Id)">{{$t('ReportManage.smart_audio_upload_btn')}}</span>
+                <a v-permission="permissionBtn.reportManageBtn.reportManage_audioDownload"
+                    :href="hostapi + '?ReportId=' + parseInt(scope.row.Id)" v-if="
+                    scope.row.VideoUrl &&
+                    ![$t('ReportManage.smart_btn.morning_paper'), $t('ReportManage.smart_btn.weekly')].includes(scope.row.ClassifyNameFirst)
+                " :download="scope.row.VideoName" style="cursor: pointer; color: #4099ef">{{$t('ReportManage.smart_audio_download_btn')}}</a>
+                <span v-permission="permissionBtn.reportManageBtn.reportManage_audioDownload"
+                    style="cursor: pointer; color: #4099ef" v-if="
+                    [$t('ReportManage.smart_btn.morning_paper'), $t('ReportManage.smart_btn.weekly')].includes(scope.row.ClassifyNameFirst) &&
+                    scope.row.ChapterVideoList.length > 0
+                " @click="handleShowDownloadAudio(scope.row)">{{$t('ReportManage.smart_audio_download_btn')}}</span> -->
+                <!-- 前面的按钮 -->
+                <span v-for="bu in getbuttonList(row,'f')" :key="bu.label" 
+                :class="[['删除'].includes(bu.label)?'deletesty':'editsty',
+                        ['群发邮件','群发日志'].includes(bu.label) && 'copylink']"
+                :style="{
+                  color:['撤销','取消发布'].includes(bu.label)?'red':'',
+                  position:['群发日志'].includes(bu.label) && 'relative' 
+                }"
+                @click.stop="itemclickHandle({type:bu.label,data:row})">
+                  <template v-if="bu.label=='编辑中'">{{ row.Editor || "" }}{{$t(bu.text)}}</template>
+                  <template v-else-if="bu.label=='群发日志'">
+                    {{$t(bu.text)}}
+                    <span class="warn-tag" v-if="row.EmailHasFail"></span>
+                  </template>
+                  <template v-else>{{$t(bu.text)}}</template>
+                </span>
+                <!-- 后面的按钮 -->
+                <el-dropdown size="medium" placement="bottom-start" @command="itemclickHandle"
+                v-if="getbuttonList(row,'b').length" style="height: 16px;">
+                  <span class="el-dropdown-link">
+                    <i class="el-icon-more el-icon--right"></i>
+                    <el-dropdown-menu slot="dropdown">
+                      <el-dropdown-item :command="{type:bu.label,data:row}" 
+                      v-for="bu in getbuttonList(row,'b')" :key="bu.label">
+                        <span :class="[['删除','撤销','取消发布'].includes(bu.label)?'deletesty':'editsty',
+                        ['群发邮件','群发日志'].includes(bu.label) && 'copylink']"
+                        :style="{
+                          color:['撤销','取消发布'].includes(bu.label)?'red':'',
+                          position:['群发日志'].includes(bu.label) && 'relative' 
+                        }">
+                          <template v-if="bu.label=='群发日志'">
+                            {{$t(bu.text)}}
                             <span class="warn-tag" v-if="row.EmailHasFail"></span>
+                          </template>
+                          <template v-else>{{$t(bu.text)}}</template>
                         </span>
-                    </template>
-                    <template v-if="[4,5].includes(row.State)">
-                        <span v-if="permissionBtn.isShowBtn('enReportManageBtn','enReport_cancelPublish')"
-                            @click="cancelApprove(row)" class="deletesty">{{$t('ReportManage.smart_btn.withdraw')}}</span>
-                    </template>
+                      </el-dropdown-item>
+                    </el-dropdown-menu>
+                  </span>
+                </el-dropdown>
                  </span>
 
 							<span v-else>{{ row[item.key] || '' }}</span>
@@ -427,7 +478,8 @@
 
 <script>
 import * as reportEnInterface from '@/api/modules/reportEnApi';
-import {strategyReportInterence,reportVarietyENInterence,customInterence} from '@/api/api.js'
+import {strategyReportInterence,reportVarietyENInterence,customInterence,departInterence} from '@/api/api.js'
+import {report2PdfImg} from '@/api/modules/oldApi'
 import {approveInterence} from '@/api/modules/approve.js';
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 import mPage from '@/components/mPage.vue';
@@ -512,11 +564,33 @@ export default {
 
       isPull:false,//是否正在同步获取报告
       selectNum:1,
+      /**
+       * 未发布——发布、编辑、删除 1
+        已发布——取消发布、群发邮件/群发日志 2
+        待提交——提交、编辑、删除 3
+        待审批——撤销 4
+        已通过——撤销、群发邮件/群发日志 6
+        已驳回——撤销 5
+       */
+      allButtons:[{label:"发布",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_publish'),States:[1],text:'ReportManage.smart_btn.publish'},
+        {label:"提交",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_publish'),States:[3],text:'ReportManage.smart_btn.submission'},
+        {label:"编辑",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_reportEdit'),States:[1,3],text:'Table.edit_btn'},
+        {label:"编辑中",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_reportEdit'),States:[1,3],text:'ReportManage.smart_btn.editing',},
+        {label:"删除",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_reportDel'),States:[1,3],text:'Table.delete_btn'},
+        {label:"取消发布",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_cancelPublish'),States:[2],text:'ReportManage.smart_btn.withdraw'},
+        {label:"撤销",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_cancelPublish'),States:[4,5,6],text:'ReportManage.smart_btn.withdraw'},
+        {label:"下载Pdf",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_exportPdf'),States:[2,6],text:'ReportManage.smart_btn.download_pdf'},
+        {label:"下载长图",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_exportImg'),States:[2,6],text:'ReportManage.smart_btn.download_long_image'},
+        {label:"群发邮件",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_sendEmail'),States:[2,6],text:'ReportManage.smart_btn.send_email'},
+        {label:"群发日志",permission:this.permissionBtn.isShowBtn('enReportManageBtn','enReport_sendEmail'),States:[2,6],text:'ReportManage.smart_btn.send_log'}
+      ],
+      waterMarkStr:'',
     };
   },
   mounted() {
     this.getclassifylist();
     this.getTableData()
+    this.getSystemUserInfo()
   },
   computed:{
     tableColums(){
@@ -689,7 +763,7 @@ export default {
     publishReport(item) {
       this.$confirm(item.PrePublishTime? this.$t('ReportManage.smart_msg.is_publish_immediately'):this.$t('ReportManage.smart_msg.report_publish_immediately'),this.$t('Confirm.prompt'),{type: 'warning'}).then(()=>{
 
-				reportEnInterface.reportPublish({ReportIds:String(item.Id)}).then(res=>{
+				reportEnInterface.reportPublish({ReportIds:String(item.Id),ReportUrl:this.generatePdfLinks(item.ReportCode)}).then(res=>{
           if(res.Ret!==200) return
           this.$message.success(this.$t('MsgPrompt.publish_msg'));
           this.getTableData();
@@ -698,7 +772,10 @@ export default {
 			})
       
     },
-
+    generatePdfLinks(Code){
+			const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+			return `${baseUrl}/reportshare_pdf_en?code=${Code}&flag=${this.waterMarkStr}`
+		},
     /* 编辑报告 */
     editReport(item) {
       //编辑前mark一下
@@ -946,6 +1023,98 @@ export default {
         this.getTableData();
       }
     },
+    // 搞成前面一部分按钮,后面一部分按钮的形式
+    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 commonFilterPass && row.EmailState===0&&row.EmailAuth
+        }else if(but.label==='群发日志'){
+          return commonFilterPass && row.EmailState===1&&row.EmailAuth
+        }else if(but.label==='下载Pdf'){
+          return commonFilterPass && row.DetailPdfUrl    
+        }else if(but.label==='下载长图'){
+          return commonFilterPass && row.DetailImgUrl           
+        }
+
+        return commonFilterPass
+      })
+
+      if(type=='f') return buttonArr.slice(0,2)
+      else return buttonArr.slice(2)
+    },
+    itemclickHandle({type,data}){
+      switch (type) {
+        case '发布':
+          this.reportHandle(data,'publish')
+          break;
+        case '提交':
+          this.handleSubmitReport(data)
+          break;
+        case '编辑':
+          this.reportHandle(data, 'edit')
+          break;
+        case '编辑中':
+          this.reportHandle(data, 'edit')
+          break;
+        case '删除':
+          this.reportHandle(data,'del')
+          break;
+        case '取消发布':
+          this.reportHandle(data,'cancelPublish')
+          break;
+        case '撤销':
+          this.cancelApprove(data)
+          break;
+        case '群发邮件':
+          this.reportHandle(data,'sendEmail')
+          break;
+        case '群发日志':
+          this.reportHandle(data,'view-log')
+          break;
+        case '下载Pdf':
+          this.downloadPdfImg(data,1)
+          break;
+        case '下载长图':
+          this.downloadPdfImg(data,2)
+          break;
+        default:
+          break;
+      }
+    },
+    getSystemUserInfo(){
+      departInterence.systemUserInfo().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)
+            this.waterMarkStr=Base64.encode(waterMarkString)
+          }
+        }
+      })
+    },
+    downloadPdfImg(row,type){
+      if(type == 1){
+          window.open(row.DetailPdfUrl,"_blank")
+      }else{
+          this.handleDownloadResource(row.DetailImgUrl,`${row.Title}`)
+      }
+    }
   },
 };
 </script>
@@ -1009,16 +1178,16 @@ export default {
       margin: 0 3px;
     }
   }
-  .warn-tag { 
-    width: 6px;
-    height:6px;
-    border-radius: 50%;
-    background: #f00;
-    display: inline-block;
-    position: absolute;
-    right: -10px;
-    top: 30%;
-  }
+}
+.warn-tag { 
+  width: 6px;
+  height:6px;
+  border-radius: 50%;
+  background: #f00;
+  display: inline-block;
+  position: absolute;
+  right: -10px;
+  top: 30%;
 }
 .send-email-wrap{
   .addressee-box{

+ 1 - 1
src/views/report_manage/reportdtl.vue

@@ -83,7 +83,7 @@
 						waterMarkStr=`${this.systemUserInfo.RealName}${this.systemUserInfo.Mobile?this.systemUserInfo.Mobile:this.systemUserInfo.Email}`
 						const base64=new http.Base64()
 						waterMarkStr=encodeURIComponent(waterMarkStr)
-						waterMarkStr=Base64.encode(waterMarkStr)
+						waterMarkStr=base64.encode(waterMarkStr)
 					}
 					
 					if(this.$route.query.fromPage == 'en'){

+ 190 - 19
src/views/report_manage/reportlist.vue

@@ -202,6 +202,7 @@
             align="center"
             min-width="140"
             fixed="left"
+            show-overflow-tooltip
           ></el-table-column>
           <el-table-column :label="$t('ReportManage.smart_report_type')" align="center" min-width="140">
             <template slot-scope="scope"
@@ -309,17 +310,11 @@
             >
           </el-table-column>
           <el-table-column :label="$t('Table.column_operations')" align="center" min-width="130" fixed="right">
+            <!-- 操作 -->
             <template slot-scope="scope">
               <div class="opt-btns">
-                <!-- 操作:未发布——发布、编辑、删除
-                    已发布——取消发布、推送消息/已推送消息
-                    待提交——提交、编辑、删除
-                    待审批——撤销
-                    已通过——撤销、推送消息/已推送消息
-                    已驳回——撤销 
-                -->
-                <!-- 未发布,待提交 -->
-                <template v-if="[1,3].includes(scope.row.State)">
+                              <!-- 未发布,待提交 -->
+                              <!-- <template v-if="[1,3].includes(scope.row.State)">
                     <span class="editsty" @click="publishreport(scope.row)"
                         v-if="scope.row.CanEdit&&scope.row.State===1
                             &&permissionBtn.isShowBtn('reportManageBtn','reportManage_publish')"
@@ -334,11 +329,11 @@
                         @click="editreport(scope.row, 'editing')" v-else>{{ scope.row.Editor || "" }}{{$t('ReportManage.smart_btn.editing')}}</span>
                     <span v-permission="permissionBtn.reportManageBtn.reportManage_reportDel" class="deletesty"
                         @click="deleteitem(scope.row)" v-if="scope.row.CanEdit">{{$t('Table.delete_btn')}}</span>
-                </template>
+                </template> -->
                 <!-- 已发布,已通过 -->
-                <template v-if="[2,6].includes(scope.row.State)">
+                <!-- <template v-if="[2,6].includes(scope.row.State)">
                     <span v-if="scope.row.State===2&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
-                        @click="canclepublish(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span><!-- 取消发布 -->
+                        @click="canclepublish(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
                     <span v-if="scope.row.State===6&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
                         @click="cancelReport(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
                     <span
@@ -347,14 +342,14 @@
                     <span
                         v-else-if="scope.row.MsgIsSend != 0&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_sendMsg)"
                         style="color: red">{{$t('ReportManage.smart_notification_pushed')}}</span>
-                </template>
+                </template> -->
                 <!-- 待审批,已驳回 -->
-                <template v-if="[4,5].includes(scope.row.State)">
+                <!-- <template v-if="[4,5].includes(scope.row.State)">
                     <span v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_cancelPublish)"
                         @click="cancelReport(scope.row)" style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
-                </template>
+                </template> -->
                 <!-- 音频上传和下载,跟State无关 -->
-                <span style="color: #46c371; cursor: pointer"
+                <!-- <span style="color: #46c371; cursor: pointer"
                     v-if="![$t('ReportManage.smart_btn.morning_paper'), $t('ReportManage.smart_btn.weekly')].includes(scope.row.ClassifyNameFirst)&&permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_audioUpload)"
                     @click="openupload(scope.row.Id)">{{$t('ReportManage.smart_audio_upload_btn')}}</span>
                 <a v-permission="permissionBtn.reportManageBtn.reportManage_audioDownload"
@@ -366,7 +361,43 @@
                     style="cursor: pointer; color: #4099ef" v-if="
                     [$t('ReportManage.smart_btn.morning_paper'), $t('ReportManage.smart_btn.weekly')].includes(scope.row.ClassifyNameFirst) &&
                     scope.row.ChapterVideoList.length > 0
-                " @click="handleShowDownloadAudio(scope.row)">{{$t('ReportManage.smart_audio_download_btn')}}</span>
+                " @click="handleShowDownloadAudio(scope.row)">{{$t('ReportManage.smart_audio_download_btn')}}</span> -->
+                <!-- 前面的按钮 -->
+                <span v-for="bu in getbuttonList(scope.row,'f')" :key="bu.label" 
+                :class="['删除'].includes(bu.label)?'deletesty':'editsty'"
+                :style="{
+                  color:['撤销','取消发布','已推送消息'].includes(bu.label)?'red':
+                        ['音频上传'].includes(bu.label)?'#46c371':'',
+                  cursor:['已推送消息'].includes(bu.label)?'text':''
+                }"
+                @click.stop="itemclickHandle({type:bu.label,data:scope.row})">
+                  <template v-if="bu.label=='编辑中'">{{ scope.row.Editor || "" }}{{$t(bu.text)}}</template>
+                  <a :href="hostapi + '?ReportId=' + parseInt(scope.row.Id)" v-else-if="bu.label=='音频下载A'" 
+                    :download="scope.row.VideoName" style="cursor: pointer; color: #4099ef">{{$t('ReportManage.smart_audio_download_btn')}}</a>
+                  <template v-else>{{$t(bu.text)}}</template>
+                </span>
+                <!-- 后面的按钮 -->
+                <el-dropdown size="medium" placement="bottom-start" @command="itemclickHandle"
+                v-if="getbuttonList(scope.row,'b').length" style="height: 16px;">
+                  <span class="el-dropdown-link">
+                    <i class="el-icon-more el-icon--right"></i>
+                    <el-dropdown-menu slot="dropdown">
+                      <el-dropdown-item :command="{type:bu.label,data:scope.row}" 
+                      v-for="bu in getbuttonList(scope.row,'b')" :key="bu.label">
+                        <a :href="hostapi + '?ReportId=' + parseInt(scope.row.Id)" v-if="bu.label=='音频下载A'" 
+                        :download="scope.row.VideoName" style="cursor: pointer; color: #4099ef">{{$t('ReportManage.smart_audio_download_btn')}}</a>
+                        <span :class="['删除','撤销','取消发布'].includes(bu.label)?'deletesty':'editsty'" v-else
+                        :style="{
+                          color:['撤销','取消发布','已推送消息'].includes(bu.label)?'red':
+                                ['音频上传'].includes(bu.label)?'#46c371':'',
+                          cursor:['已推送消息'].includes(bu.label)?'text':''
+                        }">
+                          {{$t(bu.text)}}
+                        </span>
+                      </el-dropdown-item>
+                    </el-dropdown-menu>
+                  </span>
+                </el-dropdown>
               </div>
             </template>
           </el-table-column>
@@ -600,8 +631,10 @@ import {
   markReport,
   reportMessageSend,
   weekReportValidAudio,
+  departInterence
 } from "api/api.js";
 import {approveInterence} from '@/api/modules/approve.js';
+import {report2PdfImg} from '@/api/modules/oldApi'
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 export default {
   mixins:[reportApproveConfig],
@@ -687,6 +720,33 @@ export default {
       selectNum:1,
 
       submitId:0,//当前选择的报告id
+      // 列出所有的按钮
+      /*未发布——发布、编辑、删除 1
+        已发布——取消发布、推送消息/已推送消息 2
+        待提交——提交、编辑、删除 3
+        待审批——撤销 4
+        已通过——撤销、推送消息/已推送消息 6
+        已驳回——撤销 5
+
+        音频上传和下载,跟State无关
+      */
+      allButtons:[{label:"发布",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_publish'),States:[1],text:'ReportManage.smart_btn.publish'},
+        {label:"提交",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_publish'),States:[3],text:'ReportManage.smart_btn.submission'},
+        {label:"编辑",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_reportEdit'),States:[1,3],text:'Table.edit_btn'},
+        {label:"编辑中",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_reportEdit'),States:[1,3],text:'ReportManage.smart_btn.editing',},
+        {label:"删除",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_reportDel'),States:[1,3],text:'Table.delete_btn'},
+        {label:"取消发布",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_cancelPublish'),States:[2],text:'ReportManage.smart_btn.withdraw'},
+        {label:"撤销",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_cancelPublish'),States:[4,5,6],text:'ReportManage.smart_btn.withdraw'},
+        {label:"下载Pdf",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_exportPdf'),States:[2,6],text:'ReportManage.smart_btn.download_pdf'},
+        {label:"下载长图",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_exportImg'),States:[2,6],text:'ReportManage.smart_btn.download_long_image'},
+        {label:"推送消息",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_sendMsg'),States:[2,6],text:'ReportManage.smart_push_notification_btn'},
+        {label:"已推送消息",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_sendMsg'),States:[2,6],text:'ReportManage.smart_notification_pushed'},
+        {label:"音频上传",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_audioUpload'),States:true,text:'ReportManage.smart_audio_upload_btn'},
+        {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'},
+      ],
+      waterMarkStr:"",
+      publishReportCode:''
     };
   },
   mounted() {
@@ -700,6 +760,7 @@ export default {
     }
     this.getclassifylist();
     this.getlist();
+    this.getSystemUserInfo()
     // document.onkeydown=e=>{
     // 	// console.log(this.$route)
     // 	let keyval=window.event.keyCode;
@@ -712,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 = [];
     },
@@ -942,6 +1003,7 @@ export default {
       //发布报告
       this.batches = [];
       this.batches.push(item.Id);
+      this.publishReportCode = item.ReportCode
       this.isDSFB=item.PrePublishTime?true:false
 
       // 周报不需要弹窗直接发布
@@ -989,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({
@@ -1021,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;
@@ -1211,6 +1277,111 @@ 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 commonFilterPass && row.MsgIsSend==0
+        }else if(but.label==='已推送消息'){
+          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 commonFilterPass &&
+              (![this.$t('ReportManage.smart_btn.morning_paper'), this.$t('ReportManage.smart_btn.weekly')].includes(row.ClassifyNameFirst))&&
+              row.VideoUrl
+        }else if(but.label==='音频下载'){
+          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 commonFilterPass
+      })
+
+      if(type=='f') return buttonArr.slice(0,2)
+      else return buttonArr.slice(2)
+    },
+    itemclickHandle({type,data}){
+      switch (type) {
+        case '发布':
+          this.publishreport(data)
+          break;
+        case '提交':
+          this.handleSubmitReport(data)
+          break;
+        case '编辑':
+          this.editreport(data, 'edit')
+          break;
+        case '编辑中':
+          this.editreport(data, 'editing')
+          break;
+        case '删除':
+          this.deleteitem(data)
+          break;
+        case '取消发布':
+          this.canclepublish(data)
+          break;
+        case '撤销':
+          this.cancelReport(data)
+          break;
+        case '推送消息':
+          this.messageSend(data)
+          break;
+        case '音频上传':
+          this.openupload(data)
+          break;
+        case '音频下载':
+          this.handleShowDownloadAudio(data)
+          break;
+        case '下载Pdf':
+          this.downloadPdfImg(data,1)
+          break;
+        case '下载长图':
+          this.downloadPdfImg(data,2)
+          break;
+        default:
+          break;
+      }
+    },
+    getSystemUserInfo(){
+      departInterence.systemUserInfo().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)
+            this.waterMarkStr=Base64.encode(waterMarkString)
+          }
+        }
+      })
+    },
+    downloadPdfImg(row,type){
+      if(type == 1){
+          window.open(row.DetailPdfUrl,"_blank")
+      }else{
+          this.handleDownloadResource(row.DetailImgUrl,`${row.Title}`)
+      }
+    }
   },
 };
 </script>

+ 72 - 7
src/views/smartReport/editReport.vue

@@ -71,9 +71,15 @@
                 <div class="report-content-box" id="report-content-box" :style="{backgroundColor:bgColor}">
                     <div class="html-head-img-box">
                         <div class="opt-btn-box" style="display: none;">
-                            <div class="del-btn" @click.stop="headImg=''"></div>
+                            <div class="del-btn" @click.stop="deleteLayoutPic(1)"></div>
                         </div>
                         <img :src="headImg" alt="" style="display:block;width:100%">
+                        <div class="head-layout-item" v-for="item in headImgStyle" :key="item.label"
+                        :style="{fontFamily:item.family,fontSize:(item.size*2)+'px',fontWeight:item.weight,textAlign:item.align,color:item.color,
+                            width:item.width,height:item.height,left:item.left,top:item.top
+                        }">
+                            {{ layoutBaseInfo[item.label] }}
+                        </div>
                     </div>
                     <draggable
                         :list="conList"
@@ -148,11 +154,18 @@
                             </draggable>
                         </div>
                     </draggable>
+
                     <div class="html-end-img-box">
                         <div class="opt-btn-box" style="display: none;">
                             <div class="del-btn" @click.stop="endImg=''"></div>
                         </div>
                         <img :src="endImg" alt="" style="display:block;width:100%">
+                        <div class="head-layout-item" v-for="item in endImgStyle" :key="item.label"
+                        :style="{fontFamily:item.family,fontSize:(item.size*2)+'px',fontWeight:item.weight,textAlign:item.align,color:item.color,
+                            width:item.width,height:item.height,left:item.left,top:item.top
+                        }">
+                            {{ layoutBaseInfo[item.label] }}
+                        </div>
                     </div>
                 </div>
             </div>
@@ -351,6 +364,15 @@ export default {
             bgColor:'',//背景色
             headImg:'',//版头图片
             endImg:'',//版尾图片
+            headImgId:'',//版头Id
+            endImgId:'',//版尾Id
+            headImgStyle:'',//版头style
+            endImgStyle:'',//版尾style
+            layoutBaseInfo:{
+                研报标题:'',
+                研报作者:'',
+                创建时间:''
+            }
         }
     },
     methods: {
@@ -452,7 +474,7 @@ export default {
 
         // 跳转预览
         handlePreviewReport(){
-            const htmlStr=document.getElementById('report-content-box').outerHTML;
+            const htmlStr=document.getElementById('report-html-content').outerHTML;
             sessionStorage.setItem('smartReportContent', htmlStr);
             sessionStorage.setItem('smartReportContentBg', this.bgColor);
 			let { href } = this.$router.resolve({ 
@@ -757,7 +779,7 @@ export default {
 
         // 编辑保存报告
         handleReportEdit(e){
-            const html=document.getElementById('report-content-box').outerHTML;
+            const html=document.getElementById('report-html-content').outerHTML;
             const params={
                 SmartReportId:Number(this.$route.query.id)||0,
                 ...e,
@@ -765,6 +787,8 @@ export default {
                 ContentStruct:JSON.stringify(this.conList),
                 HeadImg:this.headImg,
                 EndImg:this.endImg,
+                HeadResourceId:this.headImgId,
+                EndResourceId:this.endImgId,
                 CanvasColor:this.bgColor
             }
             console.log(params);
@@ -776,6 +800,9 @@ export default {
                 if(res.Ret===200){
                     this.$message.success(this.$t('MsgPrompt.saved_msg'))
                     this.reportInfo.Title=params.Title
+                    this.layoutBaseInfo['研报标题']=params.Title
+                    this.layoutBaseInfo['研报作者']=params.Author
+                    this.layoutBaseInfo['创建时间']=params.CreateTime
                     this.showReportBaseInfo=false
                 }
             })
@@ -801,7 +828,15 @@ export default {
                     this.conList=res.Data.ContentStruct?JSON.parse(res.Data.ContentStruct):[]
                     this.headImg=res.Data.HeadImg
                     this.endImg=res.Data.EndImg
+                    this.headImgId=res.Data.HeadResourceId
+                    this.endImgId=res.Data.EndResourceId
+                    this.headImgStyle=res.Data.HeadStyle?JSON.parse(res.Data.HeadStyle):[]
+                    this.endImgStyle=res.Data.EndStyle?JSON.parse(res.Data.EndStyle):[]
                     this.bgColor=res.Data.CanvasColor
+
+                    this.layoutBaseInfo['研报标题']=res.Data.Title
+                    this.layoutBaseInfo['研报作者']=res.Data.Author
+                    this.layoutBaseInfo['创建时间']=res.Data.CreateTime
                     this.$nextTick(()=>{
                         this.contentChange=false
                     })
@@ -880,7 +915,7 @@ export default {
         
         // 自动/存草稿保存内容
         handleSaveContent({isAutoSave}){
-            const html=document.getElementById('report-content-box').outerHTML;
+            const html=document.getElementById('report-html-content').outerHTML;
             return new Promise((resolve,reject)=>{
                 const id=this.$route.query.id||0
                 if(!id) return
@@ -891,6 +926,8 @@ export default {
                     NoChange:this.contentChange?2:1,
                     HeadImg:this.headImg,
                     EndImg:this.endImg,
+                    HeadResourceId:this.headImgId,
+                    EndResourceId:this.endImgId,
                     CanvasColor:this.bgColor
                 }).then(res=>{
                     if(res.Ret===200){
@@ -988,7 +1025,8 @@ export default {
                 apiSmartReport.prePublishReport({
                     SmartReportId:Number(this.$route.query.id),
                     PrePublishTime:this.taskTime,
-                    PreMsgSend:0
+                    PreMsgSend:0,
+                    ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
                 }).then(res=>{
                     if(res.Ret===200){
                         this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1014,6 +1052,7 @@ export default {
 								SmartReportId:Number(this.$route.query.id),
 								PrePublishTime:this.taskTime,
 								PreMsgSend:0,
+                                ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
 							}).then(res=>{
 								if(res.Ret===200){
 									this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1027,6 +1066,7 @@ export default {
 							SmartReportId:Number(this.$route.query.id),
 							PrePublishTime:this.taskTime,
 							PreMsgSend:isPost?1:0,
+                            ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1043,7 +1083,8 @@ export default {
         reportPublish({sendMsg}){
             apiSmartReport.publishReport({
                 SmartReportId:Number(this.$route.query.id),
-                PublishState:2
+                PublishState:2,
+                ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
             }).then(res=>{
                 if(res.Ret===200){
                     if(sendMsg){
@@ -1053,7 +1094,10 @@ export default {
                 }
             })
         },
-
+        generatePdfLinks(Code){
+            const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+            return `${baseUrl}/reportshare_smart_pdf?code=${Code}`
+        },
         //报告消息推送
         reportSendMsg(){
             apiSmartReport.reportMsgSend({SmartReportId:Number(this.$route.query.id)}).then(res=>{})
@@ -1061,12 +1105,17 @@ export default {
 
         // 插入版头版尾
         handleInsertImgSource(e){
+            console.log(e,'eeee');
             if(e.type=='1'){
                 this.$message.success(this.$t('ReportManage.ReportList.header_setting_msg'))
                 this.headImg=e.data.ImgUrl
+                this.headImgId = e.data.ResourceId
+                this.headImgStyle=e.data.Style?JSON.parse(e.data.Style):[]
             }else{
                 this.$message.success(this.$t('ReportManage.ReportList.trailer_setting_msg'))
                 this.endImg=e.data.ImgUrl
+                this.endImgId = e.data.ResourceId
+                this.endImgStyle=e.data.Style?JSON.parse(e.data.Style):[]
             }
             this.contentChange=true
         },
@@ -1074,6 +1123,17 @@ export default {
         handleBgColorChange(e){
             this.bgColor=e||''
             this.contentChange=true
+        },
+        // 删除版头版尾
+        deleteLayoutPic(type){
+            if(type=='1'){
+                this.headImg=''
+                this.headImgId = 0
+            }else{
+                this.endImg=''
+                this.endImgId = 0
+            }
+            this.contentChange=true
         }
     },
     computed:{
@@ -1331,6 +1391,11 @@ div{
                     cursor: pointer;
                 }
             }
+            .head-layout-item{
+                position: absolute;
+                overflow: hidden;
+                box-sizing: border-box
+            }
         }
     }
 }

+ 71 - 4
src/views/smartReport/reportDetail.vue

@@ -8,7 +8,36 @@
                     <span>{{reportInfo&&reportInfo.PublishTime}}</span>
                 </div>
             </div> -->
+            <div class="html-head-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.HeadImg">
+                <img :src="reportInfo.HeadImg" alt="" style="display:block;width:100%">
+                <div class="head-layout-item" v-for="item in headImgStyle" :key="item.label"
+                :style="{fontFamily:item.family,fontSize:(item.size*2)+'px',fontWeight:item.weight,textAlign:item.align,color:item.color,
+                    width:item.width,height:item.height,left:item.left,top:item.top
+                }">
+                    {{ layoutBaseInfo[item.label] }}
+                </div>
+            </div>
+            <!-- 无版头版尾 -->
+            <div class="no-layout-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && (!reportInfo.HeadImg) && (!reportInfo.EndImg)">
+                <header>{{reportInfo.Title}}</header>
+                <div style=" box-sizing:border-box; color:#666; font-size:24px; overflow:hidden;">
+                    <span>{{ reportInfo.Author}}</span>
+                    <span style="float:right;">{{reportInfo.CreateTime}}</span>
+                </div>
+            </div>
+            <div class="abstract" v-if="reportInfo && !!reportInfo.NeedSplice">
+                <div>摘要: <span v-html="reportInfo.Abstract"></span></div> 
+            </div>
             <div class="html-wrap" v-html="content"></div>
+            <div class="html-end-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.EndImg">
+                <img :src="reportInfo.EndImg" alt="" style="display:block;width:100%">
+                <div class="head-layout-item" v-for="item in endImgStyle" :key="item.label"
+                :style="{fontFamily:item.family,fontSize:(item.size*2)+'px',fontWeight:item.weight,textAlign:item.align,color:item.color,
+                    width:item.width,height:item.height,left:item.left,top:item.top
+                }">
+                    {{ layoutBaseInfo[item.label] }}
+                </div>
+            </div> 
         </div>
         <div class="right-opt-box" v-if="$route.query.type!=='preview'&&!reportId">
             <div 
@@ -18,7 +47,7 @@
                 @click="copyHandle"
                 v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_copyWechat"
             >
-                <img src="~@/assets/img/icons/cop.png" alt="" style="width:30px;height:30px;marginRight:10px;">
+                <img src="~@/assets/img/icons/cop.png" alt="" style="width:30px;height:30px;margin-right:10px;">
                 <span>复制链接</span>
             </div>
             <div 
@@ -26,7 +55,7 @@
                 v-if="linkUrl"
                 v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_copyWechat"
             >
-                <img src="~@/assets/img/icons/wechat.png" alt="" style="width:30px;height:30px;marginRight:10px;">
+                <img src="~@/assets/img/icons/wechat.png" alt="" style="width:30px;height:30px;margin-right:10px;">
                 <span>微信分享</span>
                 <vue-qr 
                     :text="linkUrl" 
@@ -81,11 +110,21 @@ export default {
     },
     data() {
         return {
+            /**
+             * NeedSplice 0-不需要 1-需要
+             */
             reportInfo:null,
             content:'',
             bgColor:'',
             reportImgUrl:'',
-            showReportImg:false
+            showReportImg:false,
+            headImgStyle:null,//版头style
+            endImgStyle:null,//版尾style
+            layoutBaseInfo:{
+                研报标题:'',
+                研报作者:'',
+                创建时间:''
+            }
         }
     },
     created() {
@@ -102,7 +141,12 @@ export default {
             }).then(res=>{
                 this.$emit("reportEndLoading")
                 if(res.Ret===200){
-                    this.reportInfo=res.Data
+                    this.reportInfo=res.Data || {}
+                    this.headImgStyle=this.reportInfo.HeadStyle?JSON.parse(this.reportInfo.HeadStyle):[]
+                    this.endImgStyle=this.reportInfo.EndStyle?JSON.parse(this.reportInfo.EndStyle):[]
+                    this.layoutBaseInfo['研报标题']=this.reportInfo.Title
+                    this.layoutBaseInfo['研报作者']=this.reportInfo.Author
+                    this.layoutBaseInfo['创建时间']=this.reportInfo.CreateTime
                     if(this.$route.query.type==='preview'){
                        this.content=sessionStorage.getItem('smartReportContent')
                        this.bgColor=sessionStorage.getItem('smartReportContentBg')
@@ -247,6 +291,29 @@ div{
                 margin-bottom: 3px;
             }
         }
+        .html-head-img-box,.html-end-img-box{
+            position: relative;
+            .head-layout-item{
+                position: absolute;
+                overflow: hidden;
+                box-sizing: border-box
+            }
+        }
+        .no-layout-img-box{
+            header{
+                padding:10px 0; box-sizing:border-box; font-size:28px; font-weight:500; color:#333; background:#fff; 
+            }
+        }
+        .abstract{
+            padding:10px 0; box-sizing:border-box; font-size:22px; line-height:36px;
+            div{
+                padding: 10px 20px;
+                box-sizing: border-box;
+                background: rgba(20, 121, 253, 0.1);
+                color: #4099ef;
+                border-radius: 10px;
+            }
+        }
     }
     .report-img-box{
         position: fixed;

+ 153 - 22
src/views/smartReport/reportList.vue

@@ -162,6 +162,7 @@
                     align="center"
                     min-width="140"
                     fixed
+                    show-overflow-tooltip
                 ></el-table-column>
                 <el-table-column :label="$t('ReportManage.smart_report_type')" align="center" min-width="140">
                     <template slot-scope="scope"
@@ -258,15 +259,9 @@
                 <el-table-column :label="$t('Table.column_operations')" align="center" min-width="130" fixed="right">
                     <template slot-scope="scope">
                     <div class="opt-btns">
-                        <!-- 操作:
-                            已发布——取消发布、下载图片
-                            未发布——发布、编辑、删除
-                            待提交——提交、编辑、删除
-                            待审批——撤销
-                            已通过——撤销、下载图片、
-                            已驳回——撤销 -->
+                        <!-- 操作 -->
                         <!-- 未发布,待提交 -->
-                        <template v-if="[1,3].includes(scope.row.State)">
+                        <!-- <template v-if="[1,3].includes(scope.row.State)">
                             <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
                                 class="editsty" @click="handlePublishReportOpt(scope.row)"
                                 v-if="scope.row.CanEdit&&scope.row.State===1">{{$t('ReportManage.smart_btn.publish')}}</span>
@@ -282,12 +277,12 @@
                             <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
                                 class="deletesty" @click="handleDelReport(scope.row)"
                                 v-if="scope.row.CanEdit">{{$t('Table.delete_btn')}}</span>
-                        </template>
+                        </template> -->
                         <!-- 已发布,已通过 -->
-                        <template v-if="[2,6].includes(scope.row.State)">
+                        <!-- <template v-if="[2,6].includes(scope.row.State)">
                             <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')&&scope.row.State===2"
                                 @click="handleReportPublishCancel(scope.row)"
-                                style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span><!-- 取消发布 -->
+                                style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
                             <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')&&scope.row.State===6"
                                 @click="cancelReport(scope.row)"
                                 style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
@@ -295,22 +290,52 @@
                                 v-permission="permissionBtn.smartReportManageBtn.reportManage_exportImg"
                                 @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
                                 style="cursor: pointer; color: #4099ef;display:inline-block">{{$t('ReportManage.smart_btn.image_download')}}</span>
-                        </template>
+                        </template> -->
                         <!-- 待审批,已驳回 -->
-                        <template v-if="[4,5].includes(scope.row.State)">
+                        <!-- <template v-if="[4,5].includes(scope.row.State)">
                             <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')"
                                 @click="cancelReport(scope.row)"
                                 style="color: red; cursor: pointer">{{$t('ReportManage.smart_btn.withdraw')}}</span>
-                        </template>
+                        </template> -->
                         <!-- 音频上传、下载,与状态无关 -->
-                        <span style="color: #46c371; cursor: pointer;display:inline-block"
+                        <!-- <span style="color: #46c371; cursor: pointer;display:inline-block"
                             v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
                             @click="openupload(scope.row.SmartReportId)">{{$t('ReportManage.smart_audio_upload_btn')}}</span>
                         <span style="cursor: pointer; color: #4099ef;display:inline-block"
                             v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
                             v-if="scope.row.VideoUrl" @click="handleDownloadVoice(scope.row)">
                             {{$t('ReportManage.smart_audio_download_btn')}}
+                        </span> -->
+                        <!-- 前面的按钮 -->
+                        <span v-for="bu in getbuttonList(scope.row,'f')" :key="bu.label" 
+                        :class="['删除'].includes(bu.label)?'deletesty':'editsty'"
+                        :style="{
+                        color:['撤销','取消发布'].includes(bu.label)?'red':
+                                ['音频上传'].includes(bu.label)?'#46c371':''
+                        }"
+                        @click.stop="itemclickHandle({type:bu.label,data:scope.row})">
+                        <template v-if="bu.label=='编辑中'">{{ scope.row.Editor || "" }}{{$t(bu.text)}}</template>
+                        <template v-else>{{$t(bu.text)}}</template>
                         </span>
+                        <!-- 后面的按钮 -->
+                        <el-dropdown size="medium" placement="bottom-start" @command="itemclickHandle"
+                        v-if="getbuttonList(scope.row,'b').length" style="height: 16px;">
+                            <span class="el-dropdown-link">
+                                <i class="el-icon-more el-icon--right"></i>
+                                <el-dropdown-menu slot="dropdown">
+                                <el-dropdown-item :command="{type:bu.label,data:scope.row}" 
+                                v-for="bu in getbuttonList(scope.row,'b')" :key="bu.label">
+                                    <span :class="['删除','撤销','取消发布'].includes(bu.label)?'deletesty':'editsty'"
+                                    :style="{
+                                    color:['撤销','取消发布'].includes(bu.label)?'red':
+                                            ['音频上传'].includes(bu.label)?'#46c371':''
+                                    }">
+                                    {{$t(bu.text)}}
+                                    </span>
+                                </el-dropdown-item>
+                                </el-dropdown-menu>
+                            </span>
+                        </el-dropdown>
                     </div>
                     </template>
                 </el-table-column>
@@ -443,7 +468,8 @@
 </template>
 
 <script>
-import { voiceupload } from "api/api.js";
+import { voiceupload,departInterence } from "api/api.js";
+import {report2PdfImg} from '@/api/modules/oldApi'
 import {apiSmartReport}  from '@/api/modules/smartReport'
 import {approveInterence} from '@/api/modules/approve.js';
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
@@ -496,17 +522,40 @@ export default {
 
             showPublish:false,
             activeReportId:0,
+            publishReportCode:'',
             isDSFB:false,
 
             reportImgUrl:'',
             showReportImg:false,
-            selectNum:1
+            selectNum:1,
+            // 列出所有的按钮
+            /*
+                已发布——取消发布、下载PDF、下载长图 2
+                未发布——发布、编辑、删除 1
+                待提交——提交、编辑、删除 3
+                待审批——撤销 4
+                已通过——撤销、下载PDF、下载长图 6
+                已驳回——撤销 5
+                音频上传和下载,跟State无关
+            */
+            allButtons:[{label:"发布",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_publish'),States:[1],text:'ReportManage.smart_btn.publish'},
+                {label:"提交",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_publish'),States:[3],text:'ReportManage.smart_btn.Submission'},
+                {label:"编辑",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_reportEdit'),States:[1,3],text:'Table.edit_btn'},
+                {label:"编辑中",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_reportEdit'),States:[1,3],text:'ReportManage.smart_btn.editing',},
+                {label:"删除",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_reportDel'),States:[1,3],text:'Table.delete_btn'},
+                {label:"取消发布",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish'),States:[2],text:'ReportManage.smart_btn.withdraw'},
+                {label:"撤销",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish'),States:[4,5,6],text:'ReportManage.smart_btn.withdraw'},
+                {label:"下载Pdf",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_exportPdf'),States:[2,6],text:'ReportManage.smart_btn.download_pdf'},
+                {label:"下载长图",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_exportImg'),States:[2,6],text:'ReportManage.smart_btn.download_long_image'},
+                {label:"音频上传",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_audioUpload'),States:true,text:'ReportManage.smart_audio_upload_btn'},
+                {label:"音频下载",permission:this.permissionBtn.isShowBtn('smartReportManageBtn','reportManage_audioDownload'),States:true,text:'ReportManage.smart_audio_download_btn'},
+            ],
         }
     },
     methods:{
         // 下载报告图片
-        handleDownReportImg(imgUrl,title){
-            this.handleDownloadResource(imgUrl,title)
+        // handleDownReportImg(imgUrl,title){
+        //     this.handleDownloadResource(imgUrl,title)
             // let img=new Image()
             // img.setAttribute('crossOrigin', 'anonymous');
             // img.src=imgUrl
@@ -532,7 +581,7 @@ export default {
             //         this.showReportImg=true
             //     }
             // }
-        },
+        // },
 
         // 删除某个报告
         handleDelReport(item){
@@ -563,6 +612,7 @@ export default {
         // 发布报告
         handlePublishReportOpt(item){
             this.activeReportId=item.SmartReportId
+            this.publishReportCode=item.ReportCode
             // this.isDSFB=item.PrePublishTime?true:false
             // this.showPublish=true
             if(this.isApprove){
@@ -593,7 +643,7 @@ export default {
             )
         },
         handleConfirmPublishReport(){
-            apiSmartReport.publishReport({ SmartReportId: this.activeReportId,PublishState:2 }).then((res) => {
+            apiSmartReport.publishReport({ SmartReportId: this.activeReportId,ReportUrl:this.generatePdfLinks(this.publishReportCode),PublishState:2}).then((res) => {
                 if (res.Ret === 200) {
                     this.$message.success(res.Msg);
                     this.getReportList();
@@ -601,8 +651,13 @@ export default {
                 }
             });
         },
+        generatePdfLinks(Code){
+            const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
+            return `${baseUrl}/reportshare_smart_pdf?code=${Code}`
+        },
         handleClosePublish(){
             this.activeReportId=0
+            this.publishReportCode=""
             this.isDSFB=false
             this.showPublish=false
         },
@@ -882,7 +937,83 @@ export default {
             };
             x.send(); */
             this.handleDownloadResource(e.VideoUrl,e.VideoName+'.mp3')
-        }
+        },
+        // 搞成前面一部分按钮,后面一部分按钮的形式
+        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 commonFilterPass &&
+                    [this.$t('ReportManage.smart_btn.morning_paper'), this.$t('ReportManage.smart_btn.weekly')].includes(row.ClassifyNameFirst)&&
+                    row.VideoUrl             
+                }else if(but.label==='下载Pdf'){
+                    return commonFilterPass && row.DetailPdfUrl           
+                }else if(but.label==='下载长图'){
+                    return commonFilterPass && row.DetailImgUrl           
+                }
+
+                return commonFilterPass
+            })
+            if(type=='f') return buttonArr.slice(0,2)
+            else return buttonArr.slice(2)
+        },
+        itemclickHandle({type,data}){
+            switch (type) {
+                case '发布':
+                this.handlePublishReportOpt(data)
+                break;
+                case '提交':
+                this.handleSubmitReport(data)
+                break;
+                case '编辑':
+                this.editreport(data, 'edit')
+                break;
+                case '编辑中':
+                this.editreport(data, 'editing')
+                break;
+                case '删除':
+                this.handleDelReport(data)
+                break;
+                case '取消发布':
+                this.handleReportPublishCancel(data)
+                break;
+                case '撤销':
+                this.cancelReport(data)
+                break;
+                case '音频上传':
+                this.openupload(data)
+                break;
+                case '音频下载':
+                this.handleDownloadVoice(data)
+                break;
+                case '下载Pdf':
+                this.downloadPdfImg(data,1)
+                break;
+                case '下载长图':
+                this.downloadPdfImg(data,2)
+                break;
+                default:
+                break;
+            }
+        },
+        downloadPdfImg(row,type){
+            if(type == 1){
+                window.open(row.DetailPdfUrl,"_blank")
+            }else{
+                this.handleDownloadResource(row.DetailImgUrl,`${row.Title}`)
+            }
+        } 
     },
 
     created() {

+ 419 - 47
src/views/system_manage/components/smartReportImgSet.vue

@@ -6,7 +6,7 @@
                 <el-option :label="$t('SystemManage.BaseConfig.resource_type01')" :value="1"></el-option>
                 <el-option :label="$t('SystemManage.BaseConfig.resource_type02')" :value="2"></el-option>
             </el-select>
-            <el-button type="primary" style="float:right" @click="handleShowUploadPop" v-permission="permissionBtn.baseConfigPermission.etaBaseConfig_source_upload">{{$t('SystemManage.BaseConfig.resource_btn01')}}</el-button>
+            <el-button type="primary" style="float:right" @click="handleShowUploadPop" v-permission="permissionBtn.baseConfigPermission.etaBaseConfig_source_upload">{{$t('SystemManage.BaseConfig.resource_btn04')}}</el-button>
         </div>
 
         <div class="select-status-box" v-if="selectIds.length>0">
@@ -33,8 +33,8 @@
                         <img src="~@/assets/img/icons/more.png" alt="">
                     </div>
                     <el-dropdown-menu slot="dropdown">
-                        <el-dropdown-item :command="{type:'rename',data:item}">{{$t('SystemManage.BaseConfig.resource_btn02')}}</el-dropdown-item>
-                        <el-dropdown-item :command="{type:'del',data:item}">{{$t('Table.delete_btn')}}</el-dropdown-item>
+                        <el-dropdown-item :command="{type:'edit',data:item}">{{$t('Dialog.title_prefix_edit')}}</el-dropdown-item>
+                        <el-dropdown-item :command="{type:'del',data:item}" style="color: #AD352F;">{{$t('Table.delete_btn')}}</el-dropdown-item>
                     </el-dropdown-menu>
                     </el-dropdown>
                 </div>
@@ -57,13 +57,13 @@
         <!-- 上传图片弹窗 -->
         <el-dialog
             :visible.sync="uploadImgPop"
-            :title="formData.id?$t('SystemManage.BaseConfig.resource_btn02'):$t('SystemManage.BaseConfig.resource_btn01')"
+            :title="formData.id?$t('SystemManage.BaseConfig.resource_btn05'):$t('SystemManage.BaseConfig.resource_btn04')"
             :close-on-click-modal="false"
             :append-to-body="true"
             @close="cancelHandle"
             custom-class="classify-dialog"
             center
-            width="670px"
+            width="550px"
             v-dialogDrag
         >
             
@@ -74,45 +74,109 @@
                 label-width="120px" 
                 class="upload-img-form"
             >
-                <el-form-item :label="$t('SystemManage.BaseConfig.resource_label01')" prop="name">
-                    <el-input v-model="formData.name" :placeholder="$t('SystemManage.BaseConfig.resource_placeholder01')"></el-input>
-                </el-form-item>
-                <el-form-item :label="$t('SystemManage.BaseConfig.resource_label02')" prop="type">
-                    <el-radio-group v-model="formData.type" :disabled="formData.id">
-                        <el-radio :label="1">{{$t('SystemManage.BaseConfig.resource_type01')}}</el-radio>
-                        <el-radio :label="2">{{$t('SystemManage.BaseConfig.resource_type02')}}</el-radio>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item 
-                    :label="$t('SystemManage.BaseConfig.resource_btn01')" 
-                    prop="imgUrl"
-                >
-                    <el-upload 
-                        action="" 
-                        accept="image/*" 
-                        :http-request="handleUploadImg" 
-                        :show-file-list="false"
-                        :disabled="formData.id"
-                    >
-                        <div class="upload-box">
-                            <template v-if="!formData.imgUrl">
-                                <i class="el-icon-plus" style="font-size: 24px;"></i>
+                <div class="step-box">
+                    <div class="step-item" v-for="(item,index) in steps">
+                        <div class="step" :class="[step==(index+1) && 'active',step>(index+1) && 'finish']">
+                            <template v-if="!(step>(index+1))">
+                                <div class="step-number" >{{ index+1 }}</div>
+                                <span class="step-text">{{ item }}</span>
                             </template>
                             <template v-else>
-                                <img class="upload-img" :src="formData.imgUrl" alt="">
+                                <i class="el-icon-success" style="font-size: 18px;color: #0052D9;"></i>
+                                <span class="step-text" style="color: #333333;">{{$t('SystemManage.BaseConfig.completed_step')}}</span>
                             </template>
                         </div>
-                    </el-upload>
-                    <p>{{$t('SystemManage.BaseConfig.upload_suggest')}}</p>
-                </el-form-item>
-                <div style="text-align: center;padding: 30px 0;">
-                    <el-button type="primary" plain style="width:120px;" @click="handleCloseImgUpload">{{$t('Dialog.cancel_btn')}}</el-button>
-                    <el-button type="primary" style="margin-left:20px;width:120px;" @click="handleSave">{{$t('Dialog.confirm_btn')}}</el-button>
+                        <div class="line" v-if="index==0"></div>
+                    </div>
+                </div>
+                <template v-if="step==1">
+                    <el-form-item :label="$t('SystemManage.BaseConfig.resource_label01')" prop="name">
+                        <el-input v-model="formData.name" :placeholder="$t('SystemManage.BaseConfig.resource_placeholder01')"></el-input>
+                    </el-form-item>
+                    <el-form-item :label="$t('SystemManage.BaseConfig.resource_label02')" prop="type">
+                        <el-radio-group v-model="formData.type">
+                            <el-radio :label="1">{{$t('SystemManage.BaseConfig.resource_type01')}}</el-radio>
+                            <el-radio :label="2">{{$t('SystemManage.BaseConfig.resource_type02')}}</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                    <el-form-item 
+                        :label="$t('SystemManage.BaseConfig.resource_btn01')" 
+                        prop="imgUrl"
+                    >
+                        <el-upload 
+                            action="" 
+                            accept="image/*" 
+                            :http-request="handleUploadImg" 
+                            :show-file-list="false"
+                        >
+                            <div class="upload-box">
+                                <template v-if="!formData.imgUrl">
+                                    <i class="el-icon-plus" style="font-size: 24px;"></i>
+                                </template>
+                                <template v-else>
+                                    <img class="upload-img" :src="formData.imgUrl" alt="">
+                                </template>
+                            </div>
+                        </el-upload>
+                        <p>{{$t('SystemManage.BaseConfig.upload_suggest')}}</p>
+                    </el-form-item>
+                </template>
+                <template v-else>
+                    <draggable tag="div" class="layout-options" :sort="false" :list="layoutOptions" 
+                    :group="{ name: 'option', pull: 'clone', put: false }">
+                        <div class="option-item" v-for="item in layoutOptions" :key="item.label">
+                            <div class="option-item-title">{{ item.label }}</div>
+                            <img src="~@/assets/img/icons/layout-option-icon.png" class="option-item-icon" />
+                        </div>
+                    </draggable>
+                    <draggable class="layout-background" ghostClass="ghost-class" forceFallback handle=".cannomove"
+                    tag="div" animation="300" :group="{ name: 'component1', pull: false, put: true }" 
+                    @add="handleAddOption">
+                        <img :src="formData.imgUrl" class="layout-image" ref="layoutImage" />
+                        <vue-drag-resize :parentLimitation="true" :sticks="['bl','br']" :minw="10" :minh="10"
+                        :w="item.width" :h="item.height" @resizestop="(p)=>resizeStop(p,item.label)" @dragstop="(p)=>dragStop(p,item.label)"
+                        v-for="item in layoutItems" :key="item.label" :x="item.x" :y="item.y" :z="item.z" @clicked="()=>optionClick(item)">
+                            <div class="layout-item" @contextmenu.prevent="(e)=>rightClick(e,item)" @blur="blur" tabindex="-1"
+                            :style="{fontFamily:item.family,fontSize:item.size+'px',fontWeight:item.weight,textAlign:item.align,color:item.color}">{{ item.label }}</div>
+                        </vue-drag-resize>
+                        <div
+                        class="right-mouse-menu"
+                        v-if="rightMouseMenu.show"
+                        :style="{
+                            left: rightMouseMenu.left,
+                            top: rightMouseMenu.top,
+                        }"
+                        >
+                            <div class="item" @click="optionDel" style="color: #AD352F;">{{$t('Table.delete_btn')}}</div>
+                        </div>
+                    </draggable>
+                    <div class="layout-font">
+                        <div class="layout-font-title">{{$t('SystemManage.BaseConfig.text_style')}}</div>
+                        <div class="layout-font-options">
+                            <el-select v-model="layoutFont.family" class="font-options-row">
+                              <el-option :label="item" :value="item" v-for="item in layoutFontF" :key="item"></el-option>
+                            </el-select>
+                            <el-select v-model="layoutFont.size" class="font-options-row">
+                              <el-option :label="item" :value="item" v-for="item in layoutFontS" :key="item"></el-option>
+                            </el-select>
+                            <el-select v-model="layoutFont.weight" class="font-options-row">
+                              <el-option :label="item.label" :value="item.value" v-for="item in layoutFontW" :key="item.value"></el-option>
+                            </el-select>
+                            <el-select v-model="layoutFont.align" class="font-options-row">
+                              <el-option :label="item.label" :value="item.value" v-for="item in layoutFontAlign" :key="item.value"></el-option>
+                            </el-select>
+                            <el-color-picker v-model="layoutFont.color"></el-color-picker>
+                        </div>
+                    </div>
+                </template>
+                <div style="text-align: center;padding: 30px 0;margin-top: 60px;">
+                    <el-button type="primary" style="width:120px;" @click="Steptoggle('+')" v-if="step==1">{{$t('Dialog.next_step')}}</el-button>
+                    <el-button type="primary" plain style="width:120px;" @click="Steptoggle('-')" v-else>{{$t('Dialog.prev_step')}}</el-button>
+                    <el-button type="primary" style="margin-left:20px;width:120px;" @click="handleSave" v-if="step==2">{{$t('Dialog.complete_btn')}}</el-button>
                 </div>
             </el-form>
             
         </el-dialog>
-
         <el-image-viewer 
             v-if="showViewer" 
             :on-close="()=>{this.picShowList=[];this.showViewer = false}" 
@@ -125,8 +189,10 @@
 import {bannerupload} from '@/api/api.js';
 import {apiSmartReport}  from '@/api/modules/smartReport'
 import ElImageViewer from 'element-ui/packages/image/src/image-viewer';
+import draggable from 'vuedraggable'
+import VueDragResize from 'vue-drag-resize'
 export default {
-    components:{ElImageViewer},
+    components:{ElImageViewer,draggable,VueDragResize},
     data() {
         return {
             keyword:'',
@@ -141,17 +207,44 @@ export default {
                 id:0,
                 name:'',
                 type:'',
-                imgUrl:''
+                imgUrl:'',
+                layout:''
             },
             formRules:{
                 name:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder01')||'请输入图片名称', trigger: 'blur' }],
                 type:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder02')||'请选择图片类型', trigger: 'change' }],
                 imgUrl:[{ required: true, message: this.$t('SystemManage.BaseConfig.resource_placeholder03')||'请上传图片', trigger: 'change' }]
             },
-
+            step:1,
+            steps:[this.$t('SystemManage.BaseConfig.select_layout'),this.$t('SystemManage.BaseConfig.edit_layout')],
+            layoutOptions:[{label:this.$t('SystemManage.BaseConfig.report_title')},//研报标题
+                            {label:this.$t('SystemManage.BaseConfig.report_author')},//研报作者
+                            {label:this.$t('SystemManage.BaseConfig.report_creation_time')}],//创建时间
+            layoutItems:[],
+            // currentLayout:{},
+            layoutFont:{
+                family:'Arial',
+                size:'14',
+                weight:'normal',
+                align:'left',
+                color:'#333333'
+            },
+            rightMouseMenu:{
+                show: false,
+                left: '99999px',
+                top: '99999px',
+                label: '',
+            },
+            layoutFontF:['Arial','Georgia','Impact','Tahoma','Times New Roman','Verdana','思源宋体','思源黑体'],
+            layoutFontS:['12','13','14','15','16','18','20','24','28','32','36','40'],
+            layoutFontW:[{value:'normal',label:this.$t('SystemManage.BaseConfig.style_font_w_normal')},
+                        {value:'bold',label:this.$t('SystemManage.BaseConfig.style_font_w_bold')}],
+            layoutFontAlign:[{value:'left',label:this.$t('SystemManage.BaseConfig.style_text_align_left')},
+                            {value:'center',label:this.$t('SystemManage.BaseConfig.style_text_align_center')},
+                            {value:'right',label:this.$t('SystemManage.BaseConfig.style_text_align_right')}],
             showViewer:false,
             picShowList:[],
-
+            rigtMenuHideTimer:null,
             delIds:[],//要删除的id集合
             selectIds:[],
 
@@ -161,6 +254,9 @@ export default {
     },
     created() {
         this.getImgList()
+    },
+    mounted(){
+
     },
     methods: {
         handleSelectItem(e){
@@ -230,16 +326,33 @@ export default {
         handleSave(){
             this.$refs.ruleForm.validate((valid)=>{
                 if(valid){
+                    let backgroundWidth = this.$refs.layoutImage.width
+                    let backgroundGHeight = this.$refs.layoutImage.height
+                    let layoutStr = this.layoutItems.map(item =>{
+                        return {
+                            label:item.label,
+                            left:item.x/backgroundWidth*100+'%',
+                            top:item.y/backgroundGHeight*100+'%',
+                            width:item.width/backgroundWidth*100+'%',
+                            height:item.height/backgroundGHeight*100+'%',
+                            family:item.family,
+                            size:item.size,
+                            weight:item.weight,
+                            align:item.align,
+                            color:item.color,
+                        }
+                    })
                     const params={
                         Type:this.formData.type,
                         ImgUrl:this.formData.imgUrl,
-                        ImgName:this.formData.name
+                        ImgName:this.formData.name,
+                        Style:JSON.stringify(layoutStr)
                     }
                     if(this.formData.id){
                         // 编辑
-                        apiSmartReport.imgReourceRename({
+                        apiSmartReport.imgReourceEdit({
                             ResourceId:this.formData.id,
-                            ImgName:this.formData.name
+                            ...params
                         }).then(res=>{
                             if(res.Ret===200){
                                 this.$message.success(this.$t('MsgPrompt.edit_msg'))
@@ -264,10 +377,32 @@ export default {
 
         handleCloseImgUpload(){
             this.uploadImgPop=false
+        },
+        cancelHandle(){
+            this.step=1
             this.formData.id=0
-            this.$refs.ruleForm.resetFields()
+            this.formData.name=''
+            this.formData.type=''
+            this.formData.imgUrl=''
+            this.formData.layout=''
+            this.layoutItems=[]
+            this.layoutFont={
+                family:'Arial',
+                size:'14',
+                weight:'normal',
+                align:'left',
+                color:'#333333'
+            }
+            this.rightMouseMenu={
+                show: false,
+                left: '99999px',
+                top: '99999px',
+                label: '',
+            },
+            this.$nextTick(()=>{
+                this.$refs.ruleForm.clearValidate()
+            })
         },
-
         handleShowImgFull(e){
             console.log(e);
             this.picShowList=[e.ImgUrl]
@@ -279,20 +414,22 @@ export default {
                 this.delIds=[e.data.ResourceId]
                 this.handleImgDel()
             }
-            if(e.type==='rename'){
+            if(e.type==='edit'){
                 this.formData.id=e.data.ResourceId
                 this.formData.name=e.data.ImgName
                 this.formData.type=e.data.Type
                 this.formData.imgUrl=e.data.ImgUrl
+                this.formData.layout=e.data.Style
+
                 this.uploadImgPop=true
             }
         },
-
         handleShowUploadPop(){
             this.formData.id=0
             this.formData.name=''
             this.formData.type=''
             this.formData.imgUrl=''
+            this.formData.layout=''
             this.uploadImgPop=true
         },
 
@@ -315,12 +452,116 @@ export default {
                     }
                 })
             })
+        },
+        // 切换步骤
+        Steptoggle(t){
+            if(t=='+'){
+                this.$refs.ruleForm.validate((valid)=>{
+                    if(valid){
+                        this.step++
+                    }
+                })
+            }else{
+                this.step--
+            }
+            if(this.step==2){
+                this.setLayoutItems()
+            }
+        },
+        // 设置布局设置
+        setLayoutItems(){
+            this.$nextTick(()=>{
+                let backgroundWidth = this.$refs.layoutImage?this.$refs.layoutImage.width:400
+                let backgroundGHeight = this.$refs.layoutImage?this.$refs.layoutImage.height:100
+                try {
+                    this.layoutItems=JSON.parse(this.formData.layout).map(it =>{
+                        return {
+                            label:it.label,
+                            x:this.percent2Number(it.left,backgroundWidth),
+                            y:this.percent2Number(it.top,backgroundGHeight),
+                            z:1,
+                            width:this.percent2Number(it.width,backgroundWidth),
+                            height:this.percent2Number(it.height,backgroundGHeight),
+                            family:it.family,
+                            size:it.size,
+                            weight:it.weight,
+                            align:it.align,
+                            color:it.color,
+                        }
+                    })
+                } catch (error) {
+                    // console.log(error,'error');
+                    this.layoutItems=[]
+                }
+                // console.log(this.layoutItems,'this.layoutItems');
+            })
+        },
+        percent2Number(per,entirety){
+            per=per+''
+            let decimals = (+per.substring(0,per.length-1))/100
+            return entirety*decimals
+        },
+        handleAddOption(e){
+            let options = this.layoutOptions[e.oldIndex]
+            let layoutItem = this.layoutItems.find(it => it.label == options.label)
+            if(layoutItem){
+                layoutItem.z = Math.max(...this.layoutItems.map(t => t.z))+1
+                this.$message.warning(`已添加${options.label}!`)
+                return
+            }
+            this.layoutItems.push({
+                label:options.label,
+                x:e.originalEvent.layerX,
+                y:e.originalEvent.layerY,
+                z:1,
+                width:120,
+                height:20,
+                family:"Arial",
+                size:"14px",
+                weight:"normal",
+                align:"left",
+                color:'#333333'
+            })
+        },
+        resizeStop({width,height},label){
+            let item = this.layoutItems.find(it => it.label==label)
+            if(!item) return 
+            item.width=width
+            item.height=height
+        },
+        dragStop({left,top},label){
+            let item = this.layoutItems.find(it => it.label==label)
+            if(!item) return 
+            item.x=left
+            item.y=top
+        },
+        optionClick(op){
+            this.layoutFont = op
+        },
+        rightClick(e,item){
+            e.target.focus()
+            clearTimeout(this.rigtMenuHideTimer)
+            this.rightMouseMenu.left = e.clientX + "px";
+            this.rightMouseMenu.top = e.clientY + "px";
+            this.rightMouseMenu.label = item.label;
+            this.rightMouseMenu.show = true;
+        },
+        optionDel(){
+            this.layoutItems=this.layoutItems.filter(it => it.label!=this.rightMouseMenu.label)
+        },
+        blur(){
+            this.rigtMenuHideTimer=setTimeout(()=>{
+                this.rightMouseMenu.show=false
+            },80)
         }
     },
 }
 </script>
 
 <style lang="scss" scoped>
+.ghost-class{
+    display: none;
+}
 .smart-report-img-set-page{
     padding: 30px;
     padding-bottom: 100px;
@@ -460,5 +701,136 @@ export default {
             }
         }
     }
+    .step-box{
+        padding-left: 43px;
+        display: flex;
+        align-items: center;
+        margin-bottom: 25px;
+        .step-item{
+            display: flex;
+            align-items: center;
+            .step{
+                display: flex;
+                align-items: center;
+                .step-number{
+                    font-size: 14px;
+                    font-weight: 600;
+                    color: #C0C4CC;
+                    border-radius: 50%;
+                    width: 18px;
+                    height: 18px;
+                    box-sizing: border-box;
+                    border: solid 2px #C0C4CC;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                }
+                .step-text{
+                    margin-left: 10px;
+                    font-size: 16px;
+                    color: #C0C4CC;
+                    line-height: 24px;
+                }
+            }
+            .active{
+                .step-number{
+                    border: solid 2px #0052D9;
+                    color: white;
+                    background-color: #0052D9;
+                }
+                .step-text{
+                    color: #0052D9;
+                }
+            }
+            .line{
+                margin: 0 10px;
+                width: 40px;
+                height: 2px;
+                background-color: #C8CDD9;
+            }
+        }
+    }
+    .layout-options{
+        padding-left: 43px;
+        display: inline-flex;
+        align-items: center;
+        margin-bottom: 20px;
+        .option-item{
+            display: flex;
+            align-items: center;
+            flex-direction: column;
+            margin-right: 30px;
+            background-color: white;
+            .option-item-title{
+                font-size: 14px;
+                color: #333333;
+            }
+            .option-item-icon{
+                margin-top: 6px;
+                width: 32px;
+                height: 32px;
+            }
+        }
+    }
+    .layout-background{
+        background-color: #D9D9D9;
+        margin-left: 43px;
+        width: 400px;
+        text-align: center;
+        margin-bottom: 20px;
+        position: relative;
+        .layout-image{
+            vertical-align: bottom;
+            width: 100%;
+        }
+        .layout-item{
+            text-align: left;
+            cursor: move;
+            background-color: white;
+            border: dashed 1px #B2B9CB;
+            color: #C0C4CC;
+            border-radius: 2px;
+            width: 100%;
+            height: 100%;
+            overflow: hidden;
+            box-sizing: border-box
+        }
+    }
+    .layout-font{
+        padding-left: 43px;
+        .layout-font-title{
+            font-size: 14px;
+            font-weight: bold;
+            color: #333333;
+        }
+        .layout-font-options{
+            margin-top: 12px;
+            display: flex;
+            align-items: center;
+            gap: 16px;
+            .font-options-row{
+                width: 90px;
+            }
+        }
+    }
+}
+.right-mouse-menu{
+    position: fixed;
+    z-index: 9999999;
+    background: #ffffff;
+    border: 1px solid #ececec;
+    box-shadow: 0px 3px 6px rgba(143, 143, 143, 0.16);
+    border-radius: 4px;
+    color: #333;
+    font-size: 15px;
+    padding: 13px 0;
+    .item {
+        line-height: 30px;
+        padding: 0 20px;
+        cursor: pointer;
+        &:hover {
+            background-color: #f5f7fa;
+        }
+    }
 }
 </style>

+ 12 - 2
src/views/system_manage/etaBaseConfig.vue

@@ -458,8 +458,12 @@
         </el-form>
         
         </template>
-        <!-- 资源库 -->
-        <smartReportImgSet v-if="sectionType==2&&isShowSource"/>
+        <template v-if="sectionType==2&&isShowSource">
+            <div class="smart-report-title">{{$t('SystemManage.BaseConfig.smart_layout_resource_library')}}</div>
+            <!-- 资源库 -->
+            <smartReportImgSet />
+        </template>
+
 
         <el-image-viewer 
             v-if="showViewer" 
@@ -948,6 +952,12 @@ export default {
             border-bottom: 2px solid #0052D9;
         }
     }
+    .smart-report-title{
+        padding: 20px 30px 0;
+        font-size: 16px;
+        line-height: 22px;
+        color: #333333;
+    }
     .base-config-form{
         padding: 30px;
         .el-form-item{