Browse Source

章节报告智能布局新增,发布,提交

Karsa 1 year ago
parent
commit
1861dc18dd

+ 30 - 1
src/api/modules/reportV2.js

@@ -49,8 +49,37 @@ export const reportV2Interface = {
 	 * @returns 
 	 */
 	removeChapter: params => {
-		return http.post('/report/chapter/del')
+		return http.post('/report/chapter/del',params)
+	},
+
+	/**
+	 * 添加章节
+	 * 
+	 * @param {* Title  ReportId PermissionIdList AdminIdList} params 
+	 * @returns 
+	 */
+	addChapter: params => {
+		return http.post('/report/chapter/add',params)
+	},
+
+	/**
+	 * 上传章节音频
+	 * @param {*ReportChapterId File} params 
+	 * @returns 
+	 */
+	uploadChpterAudio: params => {
+		return http.post('/report/chapter/voice/upload',params)
+	},
+
+	/**
+	 * 校验所有章节是否发布
+	 * @param {*ReportId} params 
+	 * @returns 
+	 */
+	checkChaterPublishState: params => {
+		return http.get('/report/chapter/un_publish/list',params)
 	}
+
 }
 
 

File diff suppressed because it is too large
+ 1 - 0
src/assets/img/icons/baseinfo_ico.svg


+ 4 - 0
src/assets/img/icons/preview_ico.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.93819 5.46945V3.40708C2.93819 3.14802 3.14818 2.93806 3.40728 2.93806H5.46994C5.72904 2.93806 5.93903 2.72809 5.93903 2.46903C5.93903 2.20996 5.72904 2 5.46994 2H2.46909C2.20999 2 2 2.20996 2 2.46903V5.46945C2 5.72852 2.20999 5.93848 2.46909 5.93848C2.7265 5.93848 2.93819 5.72852 2.93819 5.46945ZM10.5334 2.93806H12.5927C12.8518 2.93806 13.0618 3.14802 13.0618 3.40708V5.46945C13.0618 5.72852 13.2718 5.93848 13.5309 5.93848C13.79 5.93848 14 5.72852 14 5.46945V2.46903C14 2.20996 13.79 2 13.5309 2H10.5334C10.2743 2 10.0644 2.20996 10.0644 2.46903C10.0644 2.72809 10.276 2.93806 10.5334 2.93806ZM5.46825 13.0603H3.40728C3.14818 13.0603 2.93819 12.8503 2.93819 12.5912V10.5322C2.93819 10.2732 2.7282 10.0632 2.46909 10.0632C2.20999 10.0632 2 10.2732 2 10.5322V13.5293C2 13.7883 2.20999 13.9983 2.46909 13.9983H5.46825C5.72735 13.9983 5.93734 13.7883 5.93734 13.5293C5.93734 13.2702 5.72735 13.0603 5.46825 13.0603ZM13.0618 10.5322V12.5929C13.0618 12.852 12.8518 13.0619 12.5927 13.0619H10.5334C10.2743 13.0619 10.0644 13.2719 10.0644 13.531C10.0644 13.79 10.2743 14 10.5334 14H13.5309C13.79 14 14 13.79 14 13.531V10.5339C14 10.2749 13.79 10.0649 13.5309 10.0649C13.2718 10.0632 13.0618 10.2732 13.0618 10.5322Z" fill="#0052D9"/>
+<path d="M8 5.59888C9.5061 5.59888 10.8019 6.58141 11.4093 8H12C11.3605 6.2408 9.81237 5 8 5C6.18931 5 4.64114 6.2408 4 8H4.59066C5.19815 6.58328 6.49558 5.59888 8 5.59888ZM8 10.4011C6.4939 10.4011 5.19815 9.41859 4.59066 8H4C4.64114 9.7592 6.18931 11 8 11C9.81069 11 11.3605 9.75733 12 8H11.4093C10.8035 9.41859 9.5061 10.4011 8 10.4011ZM6.56121 8C6.56121 8.88334 7.20572 9.60012 8 9.60012C8.79428 9.60012 9.43879 8.88334 9.43879 8C9.43879 7.11666 8.79428 6.39988 8 6.39988C7.20572 6.39988 6.56121 7.11666 6.56121 8ZM8.90029 8C8.90029 8.55209 8.49811 9.00125 8 9.00125C7.50358 9.00125 7.10139 8.55396 7.10139 8C7.10139 7.44791 7.50358 6.99875 8 6.99875C8.49811 7.00062 8.90029 7.44791 8.90029 8Z" fill="#0052D9"/>
+</svg>

+ 5 - 0
src/assets/img/icons/save_ico.svg

@@ -0,0 +1,5 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.7723 1.1297C15.0455 1.3226 15.0776 1.6633 14.8429 1.88887L10.1474 6.41202C10.0917 6.4657 10.0237 6.50979 9.94727 6.54177C9.87088 6.57375 9.78761 6.593 9.70221 6.59842C9.61681 6.60383 9.53095 6.59531 9.44954 6.57334C9.36813 6.55137 9.29276 6.51637 9.22773 6.47036C9.1627 6.42434 9.10929 6.3682 9.07054 6.30514C9.0318 6.24209 9.00848 6.17335 9.00192 6.10285C8.99535 6.03236 9.00568 5.96148 9.0323 5.89428C9.05891 5.82708 9.10131 5.76486 9.15705 5.71118L13.8535 1.18804C13.9092 1.13434 13.9772 1.09024 14.0536 1.05825C14.13 1.02625 14.2133 1.007 14.2987 1.00158C14.3841 0.996165 14.47 1.00469 14.5514 1.02667C14.6328 1.04866 14.7082 1.08366 14.7732 1.1297H14.7723Z" fill="#0052D9"/>
+<path d="M3.01946 1.00082C2.48401 1.00082 1.97047 1.21872 1.59177 1.60661C1.21307 1.9945 1.00021 2.52063 1 3.0693V12.9299C0.999896 13.2017 1.05205 13.4709 1.15349 13.722C1.25493 13.9732 1.40367 14.2014 1.59121 14.3936C1.77874 14.5859 2.0014 14.7384 2.24646 14.8424C2.49153 14.9464 2.7542 15 3.01946 15H11.9789C12.2443 15.0002 12.5071 14.9468 12.7522 14.843C12.9974 14.7391 13.2203 14.5867 13.4079 14.3945C13.5956 14.2023 13.7445 13.9741 13.8461 13.723C13.9477 13.4718 14 13.2026 14 12.9307V5.63025C14 5.4805 13.9419 5.33689 13.8386 5.23101C13.7353 5.12512 13.5951 5.06563 13.449 5.06563C13.3028 5.06563 13.1627 5.12512 13.0594 5.23101C12.956 5.33689 12.898 5.4805 12.898 5.63025V12.9307C12.898 13.4501 12.4866 13.8708 11.9797 13.8708H3.02026C2.77687 13.8708 2.54343 13.7718 2.37126 13.5955C2.19908 13.4192 2.10224 13.1801 2.10203 12.9307V3.07012C2.10203 2.54994 2.51261 2.12923 3.01946 2.12923H11.1355C11.2817 2.12923 11.4218 2.06974 11.5251 1.96386C11.6285 1.85797 11.6865 1.71436 11.6865 1.56461C11.6865 1.41487 11.6285 1.27126 11.5251 1.16537C11.4218 1.05949 11.2817 1 11.1355 1H3.01946V1.00082Z" fill="#0052D9"/>
+<path d="M3.52554 5C3.38626 5 3.25268 5.05824 3.1542 5.16191C3.05571 5.26558 3.00038 5.40619 3.00038 5.5528C3.00038 5.69941 3.05571 5.84002 3.1542 5.94369C3.25268 6.04736 3.38626 6.1056 3.52554 6.1056H6.25562C6.3949 6.1056 6.52848 6.04736 6.62697 5.94369C6.72545 5.84002 6.78078 5.69941 6.78078 5.5528C6.78078 5.40619 6.72545 5.26558 6.62697 5.16191C6.52848 5.05824 6.3949 5 6.25562 5H3.52554ZM3 8.4996C3 8.19466 3.23509 7.9472 3.52554 7.9472H6.88506C7.02434 7.9472 7.15791 8.00544 7.2564 8.10911C7.35489 8.21278 7.41022 8.35339 7.41022 8.5C7.41022 8.64661 7.35489 8.78722 7.2564 8.89089C7.15791 8.99456 7.02434 9.0528 6.88506 9.0528H3.52554C3.4565 9.0529 3.38811 9.03867 3.32431 9.0109C3.2605 8.98314 3.20253 8.9424 3.15371 8.89101C3.10488 8.83962 3.06618 8.77859 3.0398 8.71142C3.01343 8.64426 2.9999 8.57228 3 8.4996ZM3.52554 10.8944C3.38626 10.8944 3.25268 10.9526 3.1542 11.0563C3.05571 11.16 3.00038 11.3006 3.00038 11.4472C3.00038 11.5938 3.05571 11.7344 3.1542 11.8381C3.25268 11.9418 3.38626 12 3.52554 12H9.47484C9.61412 12 9.7477 11.9418 9.84618 11.8381C9.94467 11.7344 10 11.5938 10 11.4472C10 11.3006 9.94467 11.16 9.84618 11.0563C9.7477 10.9526 9.61412 10.8944 9.47484 10.8944H3.52554Z" fill="#0052D9"/>
+</svg>

+ 4 - 0
src/assets/img/icons/submit_ico.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M9 3V5H10V2.5C10 2.22386 9.77614 2 9.5 2H1.5C1.22386 2 1 2.22386 1 2.5V13.5C1 13.7761 1.22386 14 1.5 14H9.5C9.77614 14 10 13.7761 10 13.5V11H9V13H2V3H9Z" fill="#0052D9"/>
+<path d="M11.2316 5.25423L13.4774 7.50001L5.99994 7.49999L5.99994 8.49999L13.4774 8.50001L11.2316 10.7458L11.9387 11.4529L15.038 8.35356C15.2333 8.1583 15.2333 7.84172 15.038 7.64646L11.9387 4.54712L11.2316 5.25423Z" fill="#0052D9"/>
+</svg>

+ 4 - 0
src/lang/commonLang.js

@@ -358,6 +358,10 @@ export default {
       en: 'No Charts',
       zh: '暂无图表'
     },
+    no_cont_msg: {
+      en: 'No Content',
+      zh: '暂无内容'
+    },
     exp_excel: {
       en: ' Export Excel',
       zh: '导出excel',

+ 12 - 0
src/lang/modules/ReportManagement/ReportList.js

@@ -39,6 +39,7 @@ export const ReportListEn = {
   preview_btn: "Preview",
   save_draft_btn: "Draft",
   scheduled_publish_btn: "Schedule",
+  submit_chapter_btn:'Submit Section',
   publish_btn: "Publish",
   submission_btn: "Submission",
   new_method_btn: "New method",
@@ -154,6 +155,11 @@ export const ReportListEn = {
   ph_report_tit: 'Please input the report title',
   check_report_len: 'Only one report can be selected',
   ph_select_user: 'Please select user',
+  del_chapter_msg: 'Are you sure you want to delete this section?',
+  report_empty_msg:'Please input the report content',
+  img_set_btn: 'Layout Settings',
+  no_chapter_msg:'No section information available',
+  chapter_nosubmit_msg:'{name},the content of the section has not been submitted'
 };
 
 /* 中文 */
@@ -193,6 +199,7 @@ export const ReportListZh = {
   preview_btn: "预览",
   save_draft_btn: "存草稿",
   scheduled_publish_btn: "定时发布",
+  submit_chapter_btn:'提交章节',
   publish_btn: "发布",
   submission_btn: "提交",
   new_method_btn: "新增方式",
@@ -308,4 +315,9 @@ export const ReportListZh = {
   ph_report_tit: '请输入报告标题',
   check_report_len: '只能选择一篇报告',
   ph_select_user: '请选择用户',
+  del_chapter_msg: '是否确认删除该章节?',
+  report_empty_msg:'请输入报告内容',
+  img_set_btn: '版图设置',
+  no_chapter_msg:'暂无章节信息',
+  chapter_nosubmit_msg:'{name}章节内容未提交'
 };

+ 417 - 114
src/views/report_manage/reportV2/components/chapterEditWrapper.vue

@@ -1,21 +1,54 @@
 <template>
   <div class="left-chapter-box">
     <div class="box-top">
-      <h3>研报标题</h3>
+      <h3>{{reportBase.Title}}</h3>
 
       <ul class="handle-list">
-        <li>
+        <li v-if="reportBase.ReportLayout===2">
+          <img src="~@/assets/img/icons/submit_ico.svg" alt="">
+          <el-button type="text"><!-- 版图设置 -->{{$t('ReportManage.ReportList.img_set_btn')}}</el-button>
+        </li>
+
+        <li @click="$emit('openBaseInfo')" v-if="isCreator">
+          <img src="~@/assets/img/icons/baseinfo_ico.svg" alt="">
           <el-button type="text"><!-- 基础信息 -->{{$t('ReportManage.ReportList.information_title')}}</el-button>
         </li>
-        <li>
+        <li @click="$emit('handlePreviewReport')">
+          <img src="~@/assets/img/icons/preview_ico.svg" alt="">
           <el-button type="text"><!-- 预览 -->{{$t('ReportManage.ReportList.preview_btn')}}</el-button>
         </li>
-        <li>
-          <el-button type="text"><!-- 存草稿 -->{{$t('ReportManage.ReportList.save_draft_btn')}}</el-button>
-        </li>
-        <li>
-          <el-button type="text"><!-- 提交 -->{{$t('ReportManage.ReportList.submission_btn')}}</el-button>
-        </li>
+        
+        <template v-if="!isApprove||!hasApproveFlow">
+            <li 
+                class="action-item" 
+                :class="{'disabled':puiblishLoading}"
+                @click="handlePublishReport('dsfb')"
+                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)&&isCreator"
+                >
+                <img src="~@/assets/img/icons/submit_ico.svg" alt="">
+                <el-button type="text">{{$t('ReportManage.ReportList.scheduled_publish_btn')}}</el-button>
+            </li>
+            <li 
+                class="action-item" 
+                :class="{'disabled':puiblishLoading}"
+                @click="handlePublishReport('fb')"
+                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)&&isCreator"
+            >
+                <img src="~@/assets/img/icons/submit_ico.svg" alt="">
+                <el-button type="text">{{$t('ReportManage.ReportList.publish_btn')}}</el-button>
+            </li>
+        </template>
+        <template v-if="isApprove&&hasApproveFlow">
+            <li 
+                class="action-item" 
+                :class="{'disabled':puiblishLoading}"
+                @click="handlePublishReport('submit')"
+                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)&&isCreator"
+            >
+                <img src="~@/assets/img/icons/submit_ico.svg" alt="">
+                <el-button type="text"><!--提交  -->{{$t('ReportManage.ReportList.submission_btn')}}</el-button>
+            </li>
+        </template>
       </ul>
     </div>
 
@@ -26,25 +59,38 @@
           type="primary" 
           size="small" 
           @click="openAddChapter"
+          v-if="isCreator"
         ><!-- 添加章节 -->{{$t('ReportManage.ReportList.btn_add_chap')}}</el-button>
       </div>
       
-      <ul class="chapter-list">
+      <ul class="chapter-list" v-if="chapterList.length">
         <draggable
             v-model="chapterList"
             animation="300"
             @start="dragStartHandler"
             @update="dragenter"
             @end="dragOverHandler"
+            :disabled="!isCreator"
+          >
+          <li 
+            v-for="item in chapterList" 
+            :key="item.ReportChapterId" 
+            @click="chooseChapter(item)"
+            :class="selectChapterId===item.ReportChapterId&&'act'"
           >
-          <li v-for="(item,index) in chapterList" :key="index">
+            <div class="type-name" v-if="item.TypeName">{{item.TypeName}}</div>
+
             <div class="card-top">
-              <span>{{item.title}}</span>
-              <span class="editsty"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
+              <span style="font-size: 16px;">{{item.Title}}</span>
+              <span class="editsty" v-if="item.CanEdit&&item.IsAuth" @click.stop="chooseChapter(item,'edit')"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
             </div>
             
             <div class="card-bottom">
-              <span class="editsty">{{item.status}}</span>
+              <span 
+                :style="{color:item.PublishState===2&&'#67C23A'}" 
+                v-if="item.CanEdit"
+              >{{item.PublishState===2 ? $t('ReportManage.smart_published') : $t('ReportManage.smart_unpublished') }}</span>
+              <span v-else style="color:#E37318">{{item.Editor}}<!-- 编辑中... -->{{$t('ReportManage.smart_btn.editing')}}</span>
               <div>
                 <img
                   src="~@/assets/img/data_m/move_ico.png"
@@ -52,20 +98,30 @@
                   style="width: 14px; height: 14px; margin-right: 8px"
                 />
                 
-                <el-dropdown trigger="click" @command="handleChapterItem">
+                <el-dropdown 
+                  trigger="click" 
+                  @command="handleChapterItem"
+                  v-if="item.IsAuth"
+                >
                   <span class="el-dropdown-link">
                     <i class="el-icon-more"></i>
                   </span>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item :command="{type:'beseInfo',item}"><!-- 基础信息 -->{{$t('ReportManage.ReportList.information_title')}}</el-dropdown-item>
-                    <el-dropdown-item :command="{type:'del',item}"><!-- 删除 -->{{$t('Table.delete_btn')}}</el-dropdown-item>
+                    <el-dropdown-item 
+                      :command="{type:'beseInfo',item}"
+                      v-if="isCreator"
+                    ><!-- 基础信息 -->{{$t('ReportManage.ReportList.information_title')}}</el-dropdown-item>
+                    <el-dropdown-item 
+                      :command="{type:'del',item}"
+                      v-if="isCreator"
+                    ><!-- 删除 -->{{$t('Table.delete_btn')}}</el-dropdown-item>
                     <el-dropdown-item 
                       :command="{type:'adTag',item}" 
                       v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportMange_chapter_editTag)"><!-- 添加标签 -->{{$t('ReportManage.ReportList.add_labels_section')}}</el-dropdown-item>
                     <el-dropdown-item :command="{type:'upAudio',item}"><!-- 上传录音 -->{{$t('ReportManage.ReportList.up_recording_lable')}}</el-dropdown-item>
                     <el-dropdown-item 
                       :command="{type:'wxShare',item}"
-                      v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportMange_chapter_share)"
+                      v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportMange_chapter_share)&&item.PublishState===2"
                     ><!-- 微信分享 -->{{$t('ReportManage.ReportList.weChat_share')}}</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -74,6 +130,10 @@
           </li>
         </draggable>  
       </ul>
+
+      <div class="chapter-list" v-else>
+       <tableNoData :text="$t('ReportManage.ReportList.no_chapter_msg')" size="mini"/>
+      </div>
     </div>
 
     <!-- 添加章节弹窗 -->
@@ -135,8 +195,8 @@
               collapse-tags
               filterable
               :props="{
-                value:'ItemId',
-                label:'ItemName',
+                value:'AdminId',
+                label:'AdminName',
                 children:'Children',
                 emitPath: false,
                 multiple: true
@@ -167,82 +227,108 @@
     <m-dialog
       :show.sync="isOpenChapterTag"
       :title="$t('ReportManage.ReportList.set_tags_title')"
-      width="400px"
+      width="450px"
+    >
+      <div class="edit-tag-wrap">
+          <span style="margin-right: 20px">{{chapterInfo.chapterName}}</span>
+          <el-select
+            v-model="chapterInfo.tags"
+            filterable
+            allow-create
+            default-first-option
+            :placeholder="$t('ReportManage.ReportList.select_ipt_pld')">
+            <el-option
+                v-for="item in tagOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+            </el-option>
+          </el-select>
+          <div style="margin:30px 0;text-align:center">
+              <el-button type="primary" plain @click="isOpenChapterTag=false">{{$t('Dialog.cancel_btn')}}</el-button>
+              <el-button type="primary" @click="handleSaveChapterTag">{{$t('Dialog.confirm_btn')}}</el-button>
+          </div>
+      </div>
+    </m-dialog>
+
+
+    <!-- 上传音频弹窗 -->
+    <m-dialog
+      :show.sync="isOpenUploadAudio"
+      :title="$t('ReportManage.smart_audio_upload_btn')"
+      width="450px"
     >
         <div class="edit-tag-wrap">
-            <span>{{chapterInfo.title}}</span>
-            <el-select
-              v-model="chapterInfo.tags"
-              filterable
-              allow-create
-              default-first-option
-              :placeholder="$t('ReportManage.ReportList.select_ipt_pld')">
-              <el-option
-                  v-for="item in tagOptions"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-              </el-option>
-            </el-select>
-            <div style="margin:30px 0;text-align:center">
-                <el-button type="primary" plain @click="isOpenChapterTag=false">{{$t('Dialog.cancel_btn')}}</el-button>
-                <el-button type="primary" @click="handleSaveChapterTag">{{$t('Dialog.confirm_btn')}}</el-button>
+            <div>
+              <el-input
+                v-model="chapterInfo.audioName"
+                readonly
+                style="width: 65%"
+                :placeholder="$t('ReportManage.ReportList.upload_audio_file')"
+              ></el-input>
+              <el-upload
+                style="display: inline-block; margin-left: 10px"
+                action=""
+                accept=".mp3,.m4a"
+                :http-request="handleUpload"
+                :before-upload="handelBeforeUploadAudio"
+                :show-file-list="false"
+                :disabled="startUploadAudio"
+              >
+                <el-button type="primary" :loading="startUploadAudio"
+                  >{{$t('ReportManage.ReportList.up_recording_lable')}}</el-button
+                >
+              </el-upload>
+
+              <p style="color: #999; font-size: 12px;margin-top: 10px;">
+                {{$t('ReportManage.ReportList.note_audio_minutes')}}
+              </p>
+            </div>
+            <div style="margin-top:30px;text-align:center">
+                <el-button type="primary" plain @click="isOpenUploadAudio=false">{{$t('Dialog.cancel_btn')}}</el-button>
+                <el-button type="primary" @click="handleSaveAudio">{{$t('Dialog.confirm_btn')}}</el-button>
             </div>
         </div>
-      </m-dialog>
-
+    </m-dialog>
   </div>
+
 </template>
 <script>
 import draggable from 'vuedraggable';
 import mDialog from '@/components/mDialog.vue';
-import {reportVarietyInterence} from '@/api/modules/reportVariety';
-import { dataAuthInterface,chapterTrendTagList } from '@/api/api.js';
+import { chapterTrendTagList } from '@/api/api.js';
 import { 
   dayWeekChapterList,
-  reportV2Interface
+  reportV2Interface,
+  chapterQRCodeImg,
+  editChapterTrendTag,
+  markReport
 } from '@/api/modules/reportV2'
 export default {
   components: { draggable,mDialog },
+  props: {
+    isApprove: {
+      type: Boolean
+    },
+    hasApproveFlow: {
+      type: Boolean
+    }
+  },
+  computed: {
+    isCreator() {
+      let roleId = Number(localStorage.getItem('AdminId'))
+      return roleId === this.reportBase.AdminId;
+    }
+  },
   data() {
     return {
-      chapterList: [
-        { 
-          title: '章节1',
-          status: '已提交',
-        },
-        { 
-          title: '章节2',
-          status: '已提交',
-        },
-        { 
-          title: '章节3',
-          status: '已提交',
-        },
-        { 
-          title: '章节4',
-          status: '已提交',
-        },
-        { 
-          title: '章节4',
-          status: '已提交',
-        },
-        { 
-          title: '章节4',
-          status: '已提交',
-        },
-        { 
-          title: '章节4',
-          status: '已提交',
-        },
-      ],
-
-      reportBase: {},
+      chapterList: [],
 
       startIndex: 0,
       preIndex: 0,
       nextIndex: 0,
-      
+
+      reportBase: {},
       selectChapterId: 0, //选中章节Id
       editChapterId: 0,//编辑章节Id
 
@@ -251,10 +337,13 @@ export default {
       reportVarietyOpts: [],
       userOpts: [],
       chapterInfo: {
+        id: 0,
         varietys:[],
         editors:[],
         chapterName:'',
-        tags: []
+        tags: '',
+        audioName:'',
+        audioFile: ''
       },
       chapterRules: {
         chapterName: [{
@@ -267,23 +356,213 @@ export default {
 
       /* 标签弹窗 */
       isOpenChapterTag: false,
-      tagOptions: []
+      tagOptions: [],
+
+      /* 上传录音弹窗 */
+      isOpenUploadAudio: false
     }
   },
   mounted(){
     this.getChapterList();
-    this.getReportBaseInfo()
-    // this.getChapterTrendTagList();
+    this.getReportBaseInfo();
+    this.getChapterTrendTagList()
   },
   methods:{
+    /* 发布总报告 */
+    async handlePublishReport(tp) {
+      //校验章节是否都已发布
+      let res = await reportV2Interface.checkChaterPublishState({
+        ReportId: Number(this.$route.query.id)
+      })
+      if(res.Data&&res.Data.length>0){
+        let str = res.Data.map(_ =>_.Title).join(',')
+        return this.$message.warning(this.$t('ReportManage.ReportList.chapter_nosubmit_msg',{name: str}))
+      } 
+
+      this.$emit('handlePublish',tp)
+    },
+
+
+    //选择章节 预览
+    async chooseChapter(item,type='') {
+      this.selectChapterId = item.ReportChapterId;
+      this.editChapterId = type==='edit'?item.ReportChapterId:0;
+
+      if(type === 'edit') {
+         //编辑前标记一下
+          const res = await markReport({
+            Status: 1,
+            ReportId: Number(this.$route.query.id),
+            ReportChapterId: this.editChapterId
+          });
+          
+          if (res.Ret === 200) {
+            if (res.Data.Status == 1) {
+              this.$message.warning(res.Data.Msg || "该研报正在编辑,不可重复编辑");
+              item.CanEdit = false;
+              item.Editor = res.Data.Editor || "";
+              return;
+            } else if (res.Data.Status == 0) {
+              item.CanEdit = true;
+              item.Editor = res.Data.Editor || "";
+            }
+          } else {
+            this.$message.error(res.ErrMsg || "未知错误,请稍后重试");
+            return;
+          }
+      }
+
+      this.$emit('change',{ selectChapterId: this.selectChapterId,editChapterId:this.editChapterId })
+    },
+
     //添加章节弹窗
-    openAddChapter() {
+    openAddChapter(item=null) {
+      console.log(item)
+      if(item.ReportChapterId) {
+        this.chapterInfo = {
+          id: item.ReportChapterId,
+          varietys:item.PermissionIdList,
+          editors:item.GrandAdminIdList,
+          chapterName:item.Title,
+          tags: ''
+        }
+      }else {
+        this.chapterInfo = {
+          id: 0,
+          varietys:[],
+          editors:[],
+          chapterName:'',
+          tags: ''
+        }
+      }
+
       this.isOpenChapterDia = true;
     },
 
     /* 保存章节编辑 */
-    handleSaveChapter() {
+    async handleSaveChapter() {
+      let params = {
+        Title: this.chapterInfo.chapterName,
+        PermissionIdList: this.chapterInfo.varietys,
+        AdminIdList: this.chapterInfo.editors
+      }
+
+      const res = this.chapterInfo.id 
+        ? await reportV2Interface.editChapterBase({
+          ReportChapterId: this.chapterInfo.id,
+          ...params
+        })
+        : await reportV2Interface.addChapter({
+            ReportId: this.reportBase.Id,
+            ...params
+          })
+      if(res.Ret !== 200) return
+
+      this.$message.success(res.Msg)
+      this.isOpenChapterDia = false;
+      this.getChapterList();
+    },
+
+    /* 删除章节 */
+    handleDelChapter(item) {
+      this.$confirm(this.$t('ReportManage.ReportList.del_chapter_msg'),this.$t('Confirm.prompt'),{
+        type: 'warning'
+      }).then( async() => {
+          const res = await reportV2Interface.removeChapter({
+            ReportChapterId: item.ReportChapterId
+          })
+    
+          if(res.Ret!==200) return
+          this.$message.success(this.$t('MsgPrompt.delete_msg'))
+          this.chapterList.splice(this.chapterList.findIndex(_=>_.ReportChapterId===item.ReportChapterId),1)
+
+          this.selectChapterId = 0;
+          this.editChapterId = 0;
+          this.$emit('change',{ selectChapterId: this.selectChapterId,editChapterId:this.editChapterId })
+
+      }).catch(() =>{})
+
+    },
+
+    /* 获取章节分享太阳码 */
+    async handleGetWechatImg(item) {
+      if(item.QRCodeImg) return
+      
+      const res=await chapterQRCodeImg({
+        CodeScene:JSON.stringify({chapterId:item.ReportChapterId.toString()}),
+        CodePage:'pages-report/chapterDetail'
+      })
+      if(res.Ret!==200) return
+
+      this.$set(this.chapterList,this.chapterList.findIndex(_ => _.ReportChapterId===item.ReportChapterId),{...item,QRCodeImg:res.Data})
+    },
+
+    //添加章节标签
+    openAddChapterTag(item) {
+      this.chapterInfo = {
+        id: item.ReportChapterId,
+        varietys:[],
+        editors:[],
+        chapterName: item.Title,
+        tags: item.Trend
+      }
+      this.isOpenChapterTag = true;
+    },
+
+    /* 保存关联章节标签 */
+    async handleSaveChapterTag() {
+      const res = await editChapterTrendTag({
+          ReportChapterId:Number(this.chapterInfo.id),
+          Trend: this.chapterInfo.tags
+      })
+
+      if(res.Ret!==200) return
+
+      this.$message.success(res.Msg)
+      this.isOpenChapterTag=false
+
+      this.getChapterList()
+    },
+
+    /* 上传音频 */
+    openUploadAudio(item) {
+      this.chapterInfo.id= item.ReportChapterId,
+      this.chapterInfo.audioName = item.VideoName,
+      this.chapterInfo.audioFile = '',
+        
+      this.isOpenUploadAudio = true;
+    },
+
+    handelBeforeUploadAudio(e) {
+      if (
+        e.name.indexOf(".mp3") == -1 &&
+        e.name.indexOf(".wav") == -1 &&
+        e.name.indexOf(".wma") == -1 &&
+        e.name.indexOf(".m4a") == -1
+      ) {
+        // this.$message.warning("上传失败,上传音频格式不正确");
+        this.$message.warning(this.$t('ReportManage.ReportList.upload_audio_error_msg'));
+        upload_audio_error_msg
+        return false;
+      }
+    },
+
+    async handleUpload(e) {
+      this.chapterInfo.audioName = e.file.name;
+      this.chapterInfo.audioFile  = e.file;
+    },
+
+    async handleSaveAudio() {
       
+      let params = new FormData();
+        params.append("file", this.chapterInfo.audioFile);
+        params.append("ReportChapterId", this.chapterInfo.id);
+      const res = await reportV2Interface.uploadChpterAudio(params)
+
+      if(res.Ret !== 200) return
+      this.isOpenUploadAudio = false;
+
+      this.getChapterList()
     },
 
     /* 章节操作 */
@@ -294,26 +573,20 @@ export default {
           this.openAddChapter(item);
           break
         case 'del':
+          this.handleDelChapter(item)
           break
         case 'adTag': 
-          this.openAddChapterTag()
+          this.openAddChapterTag(item)
           break
         case 'upAudio': 
+          this.openUploadAudio(item)
           break
         case 'wxShare':
+          this.handleGetWechatImg(item)
           break
       }
     },
 
-
-    openAddChapterTag() {
-      this.isOpenChapterTag = true;
-    },
-    /* 保存关联章节标签 */
-    handleSaveChapterTag() {
-      
-    },
-
     /* 获取章节列表 */
     async getChapterList() {
       if(!this.$route.query.id) return 
@@ -321,10 +594,14 @@ export default {
       const res = await dayWeekChapterList({
         ReportId: Number(this.$route.query.id)
       })
+      if(res.Ret !== 200) return 
+
+      this.chapterList = res.Data || []
     },
 
-    /* 获取报告基础信息用户范围 品种范围 */
-    async getReportBaseInfo() {
+
+     /* 获取报告基础信息用户范围 品种范围 */
+    async getReportBaseInfo(type='init') {
       if(!this.$route.query.id) return 
 
       const res = await reportV2Interface.getRportBase({
@@ -334,11 +611,16 @@ export default {
       if(res.Ret!==200) return
       this.reportBase = res.Data;
 
+      if(type!=='notCheck') {
+        let classify = [res.Data.ClassifyIdFirst,res.Data.ClassifyIdSecond,res.Data.ClassifyIdThird]
+        this.$emit('checkClassifyNameArr',classify)
+      }
+
       this.reportVarietyOpts = res.Data.PermissionList||[];
       this.userOpts = res.Data.GrandAdminList||[];
 
     },
-
+    
 
      //获取章节标签数据(仅在获取章节列表成功后获取一次)
     async getChapterTrendTagList(){
@@ -352,28 +634,26 @@ export default {
 
     /* 拖动开始 记录位置 */
     dragStartHandler({ oldIndex }) {
-      this.startIndex = this.chapterList[oldIndex].Id;
+      this.startIndex = this.chapterList[oldIndex].ReportChapterId;
     },
 
     /* 拖动结束 替换  */
-    dragOverHandler() {
-      // mychartInterface
-      //   .move({
-      //     MyChartId: this.startIndex,
-      //     MyChartClassifyId: this.select_classify,
-      //     PrevMyChartId: this.preIndex || 0,
-      //     NextMyChartId: this.nextIndex || 0,   
-      //   })
-      //   .then((res) => {
-      //     if (res.Ret !== 200) return;
-      //   });
+    async dragOverHandler() {
+      const res = await reportV2Interface.moveChapter({
+          ReportChapterId: this.startIndex,
+          PrevReportChapterId: this.preIndex,
+          NextReportChapterId: this.nextIndex
+      })
+      
+      if (res.Ret !== 200) return;
+      this.$message.success(res.Msg)
     },
 
     /* 移动后的上一个位置id 若移到第一位则取0 获取后一个id 若是最后一个取0*/
     dragenter({ newIndex }) {
       console.log(newIndex)
-      this.preIndex = newIndex > 0 ? this.chapterList[newIndex - 1].Id : 0;
-      this.nextIndex = newIndex ===  this.chapterList.length - 1 ? 0 : this.chapterList[newIndex + 1].Id
+      this.preIndex = newIndex > 0 ? this.chapterList[newIndex - 1].ReportChapterId : 0;
+      this.nextIndex = newIndex ===  this.chapterList.length - 1 ? 0 : this.chapterList[newIndex + 1].ReportChapterId
     },
   },
 }
@@ -381,7 +661,7 @@ export default {
 <style scoped lang='scss'>
 *{box-sizing: border-box;}
 .left-chapter-box {
-  width: 300px;
+  width: 350px;
   margin-right: 20px;
   background: #fff;
   .box-top,.box-main {
@@ -393,7 +673,16 @@ export default {
     .handle-list {
       margin-top: 30px;
       display: flex;
-      gap: 20px;
+      /* flex-wrap: wrap; */
+      gap: 0 10px;
+      li { 
+        cursor: pointer;display: flex;align-items: center;
+          &.disabled {
+              pointer-events: none;
+              cursor: not-allowed;
+              color:#999;
+          }
+    }
     }
   }
   .box-main {
@@ -410,13 +699,27 @@ export default {
   .chapter-list {
     margin-top: 20px;
     padding-right: 15px;
-    height: calc(100vh - 200px);
+    height: calc(100vh - 210px);
     overflow-y: auto;
     li {
       padding: 15px;
-      background: #eee;
-      border-radius: 4px;
+      background: #F8F8F8;
+      border-radius: 6px;
       margin-bottom: 15px;
+      border: 1px solid #C8CDD9;
+      &.act {
+        background: #ECF2FE;
+        border: 1px solid #0052D9;
+      }
+
+      .type-name {
+        background: #000;
+        padding: 2px 10px;
+        color: #FCDDC3;
+        border-radius: 10px;
+        width: fit-content;
+        margin-bottom: 10px;
+      }
 
       .card-top {
         display: flex;

+ 9 - 5
src/views/report_manage/reportV2/components/reportBaseInfoDia.vue

@@ -113,7 +113,7 @@
 
           <el-button 
             type="text" 
-            v-if="formData.cooperationType===2&&!id"
+            v-if="formData.cooperationType===2"
             style="margin-left: 20px"
             @click="handleChooseCooper"
           ><!-- 选择协作人 -->{{$t('ReportManage.ReportList.choose_cooper')}}</el-button>
@@ -235,12 +235,13 @@ export default {
             frequency: this.reportInfo.Frequency,
             time: this.reportInfo.CreateTime,
             cooperationType: this.reportInfo.CollaborateType,//协作方式
-            cooperationUsers: [],
+            cooperationUsers: this.reportInfo.GrandAdminList?this.reportInfo.GrandAdminList.map(_ => ({
+              NodeId: _.AdminId,
+              NodeName: _.AdminName
+            })):[],
             reportLayout: this.reportInfo.ReportLayout,//报告布局
             isPublcPublish: this.reportInfo.IsPublicPublish
           }
-
-          console.log(this.formData)
       }
     },
   },
@@ -381,7 +382,10 @@ export default {
             path: this.formData.reportLayout===1 
               ? '/reportEditV2'
               : "/smpartReportEditV2",
-            query: { id: res.Data.ReportId },
+            query: { 
+              id: res.Data.ReportId,
+              coopType: params.CollaborateType
+            },
           });
           window.open(href, "_blank");
 

+ 46 - 29
src/views/report_manage/reportV2/components/reportEditHeader.vue

@@ -10,7 +10,7 @@
               <img src="~@/assets/img/smartReport/icon01.png" alt="">
               <span><!-- 一键清空内容 -->{{$t('ReportManage.ReportList.click_clear_btn')}}</span>
           </li>
-          <li class="action-item" @click="$emit('openBaseInfo')">
+          <li v-if="!reportInfo.ReportChapterId" class="action-item" @click="$emit('openBaseInfo')">
               <img src="~@/assets/img/smartReport/icon01.png" alt="">
               <span>{{$t('ReportManage.ReportList.information_title')}}</span>
           </li>
@@ -26,37 +26,54 @@
               <img src="~@/assets/img/smartReport/icon01.png" alt="">
               <span>{{$t('ReportManage.ReportList.save_draft_btn')}}</span>
           </li>
-          <template v-if="!isApprove||!hasApproveFlow">
-              <li 
+        
+        <!-- 章节报告,只有提交 提交即是发布 -->
+        <template v-if="reportInfo&&reportInfo.ReportChapterId">
+            <li 
                 class="action-item" 
                 :class="{'disabled':checkLoading}"
-                @click="$emit('handlePublishOpt','dsfb')"
-                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
+                @click="$emit('handlePublishOpt')"
+            >
+                <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                <span>{{$t('ReportManage.ReportList.submit_chapter_btn')}}</span>
+            </li>
+        </template>
+
+        <!-- 单人报告 -->
+        <template v-else>
+            <template v-if="!isApprove||!hasApproveFlow">
+                <li 
+                    class="action-item" 
+                    :class="{'disabled':checkLoading}"
+                    @click="$emit('handlePublishOpt','dsfb')"
+                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
+                    >
+                    <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                    <span>{{$t('ReportManage.ReportList.scheduled_publish_btn')}}</span>
+                </li>
+                <li 
+                    class="action-item" 
+                    :class="{'disabled':checkLoading}"
+                    @click="$emit('handlePublishOpt','fb')"
+                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
                 >
-                  <img src="~@/assets/img/smartReport/icon01.png" alt="">
-                  <span>{{$t('ReportManage.ReportList.scheduled_publish_btn')}}</span>
-              </li>
-              <li 
-                class="action-item" 
-                :class="{'disabled':checkLoading}"
-                @click="$emit('handlePublishOpt','fb')"
-                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
-              >
-                  <img src="~@/assets/img/smartReport/icon01.png" alt="">
-                  <span>{{$t('ReportManage.ReportList.publish_btn')}}</span>
-              </li>
-          </template>
-          <template v-if="isApprove&&hasApproveFlow">
-              <li 
-                class="action-item" 
-                :class="{'disabled':checkLoading}"
-                @click="$emit('handlePublishOpt','submit')"
-                v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
-              >
-                  <img src="~@/assets/img/smartReport/icon01.png" alt="">
-                  <span>{{$t('ReportManage.ReportList.submission_btn')}}</span>
-              </li>
-          </template>
+                    <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                    <span>{{$t('ReportManage.ReportList.publish_btn')}}</span>
+                </li>
+            </template>
+            <template v-if="isApprove&&hasApproveFlow">
+                <li 
+                    class="action-item" 
+                    :class="{'disabled':checkLoading}"
+                    @click="$emit('handlePublishOpt','submit')"
+                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_publish)"
+                >
+                    <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                    <span>{{$t('ReportManage.ReportList.submission_btn')}}</span>
+                </li>
+            </template>
+        </template>
+
           
       </ul>
   </div>

+ 0 - 41
src/views/report_manage/reportV2/list.vue

@@ -909,19 +909,6 @@ export default {
         this.$message.error(res.ErrMsg || "未知错误,请稍后重试");
         return;
       }
-      // 晨报周报
-      // if (["day", "week"].includes(item.ChapterType)) {
-      //   sessionStorage.setItem("dayWeek", JSON.stringify(item));
-      //   this.$router.push({
-      //     path: "/dayorweek",
-      //     query: {
-      //       reportid: item.Id,
-      //       isEdit: true,
-      //       type: item.ChapterType,
-      //     },
-      //   });
-      //   return;
-      // }
 
       sessionStorage.setItem("searchform", JSON.stringify(this.searchform));
       sessionStorage.setItem("PageIndex", this.PageIndex);
@@ -945,34 +932,6 @@ export default {
       this.publishReportCode = item.ReportCode
       this.isDSFB=item.PrePublishTime?true:false
 
-      // 周报不需要弹窗直接发布
-      // 2023/3/6 研报后台5.5中修改 周报校验是否上传了音频
-      if (item.ClassifyNameFirst == "周报") {
-        const validRes = await weekReportValidAudio({
-          ReportId: Number(item.Id),
-        });
-        if (validRes.Ret === 200) {
-          if (validRes.Data) {
-            this.$confirm(
-              `${this.$t('ReportManage.smart_msg.report_recording')}:${validRes.Data.join("、")},${this.$t('ReportManage.smart_msg.publish_it')}`,
-              this.$t('ReportManage.smart_msg.release_prompt'),
-              {
-                confirmButtonText: this.$t('Dialog.confirm_btn'),
-                cancelButtonText: this.$t('Dialog.cancel_btn'),
-                type: "warning",
-              }
-            )
-              .then(() => {
-                this.showPublish = true;
-              })
-              .catch(() => {});
-          } else {
-            this.showPublish = true;
-          }
-        }
-
-        return;
-      }
       if(this.isApprove){
         this.handlePublic(1)
         return

+ 206 - 159
src/views/report_manage/reportV2/normalReport/editReport.vue

@@ -5,7 +5,14 @@
 		<div class="left-wrap" v-if="reportCoopType===2">
 			<chapterWrapper
 				v-show="isLeftWrapShow"
+				ref="chapterContRef"
+				:isApprove="isApprove"
+				:hasApproveFlow="hasApproveFlow"
 				@change="handleChapterInfo"
+				@checkClassifyNameArr="handleCheckClassifyNameArr"
+				@openBaseInfo="showReportBaseInfo=true"
+				@handlePreviewReport="handlePreviewReport"
+				@handlePublish="handlePublishReport"
 			/>
 
 			<span
@@ -20,9 +27,19 @@
 		<div class="editor-wrapper">
 
 			<!-- 章节报告默认 -->
-			<template v-if="reportCoopType===2">
+			<template v-if="reportCoopType===2&&!selectChapterId">
+				<div style="padding-top: 20%;">
+					<tableNoData :text="$t('Common.no_cont_msg')"/>
+				</div>
+			</template>
+
+			<!-- 章节报告预览 -->
+			<template v-else-if="reportCoopType===2&&selectChapterId&&!editChapterId">
 				<div>
-					
+					<reportDetail
+						v-if="reportInfo.ReportChapterId"
+						:info="reportInfo"
+					/>
 				</div>
 			</template>
 
@@ -32,13 +49,13 @@
 					<editHeader
 						:isApprove="isApprove"
 						:hasApproveFlow="hasApproveFlow"
-						:reportInfo="{Title: reportInfo.Title}"
+						:reportInfo="reportInfo"
 						@handleClearContent="handleClearContent"
 						@openBaseInfo="showReportBaseInfo=true"
 						@handleRefreshAllChart="refreshReport"
-						@handlePreviewReport="handlePreviewReport"
-						@handleSaveContent="handleSaveContent"
-						@handlePublishOpt="clickreportadd"
+						@handlePreviewReport="reportInfo.ReportChapterId?handlePreviewChapter():handlePreviewReport()"
+						@handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleAutoSave('save')"
+						@handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishReport(type)}"
 					/>
 
 					<div class="editor-main">
@@ -83,7 +100,7 @@
 		<!-- 报告基础信息 -->
     <reportBaseInfo  
 			v-model="showReportBaseInfo" 
-			:reportInfo="reportInfo" 
+			:reportInfo="reportCoopType===2?($refs.chapterContRef&&$refs.chapterContRef.reportBase):reportInfo" 
 			:id="$route.query.id"
 			@save="handleReportEdit"
 		/>
@@ -124,7 +141,13 @@ import {
 	reportdetail,
 	classifylist,
 	reportpublish,
-	reportSetPrepublish
+	reportSetPrepublish,
+	reportV2Interface,
+	chapterDetail,
+	saveChapterReport,
+	publishChapterReport,
+	getChapterReportIsLast,
+	reportMessageSend
 } from '@/api/modules/reportV2';
 import http from '@/api/http.js';
 import mixinMsg from './mixins/messagePush'
@@ -134,9 +157,10 @@ import editHeader from '../components/reportEditHeader.vue';
 import insertContent from './components/insertContent.vue';
 import chapterWrapper from '../components/chapterEditWrapper.vue'
 import reportBaseInfo from '../components/reportBaseInfoDia.vue';
+import reportDetail from '../normalReport/reportdtl.vue';
 export default {
 	mixins:[ mixinMsg,reportMixin,reportApproveConfig ],
-	components: { editHeader,insertContent,chapterWrapper,reportBaseInfo },
+	components: { editHeader,insertContent,chapterWrapper,reportBaseInfo,reportDetail },
 	data() {
 		var that = this;
 		return {
@@ -147,7 +171,7 @@ export default {
 			selectChapterId: 0, //选中章节Id
       editChapterId: 0,//编辑章节Id
 
-			reportInfo: {},
+			reportInfo: {}, //个人报告详情或章节报告详情
 
 			optionsArr: [],
 
@@ -164,10 +188,9 @@ export default {
 		this.reportCoopType = Number(this.$route.query.coopType)
 	},
 	mounted() {
-		//章节报告默认不获取详情
-		if(this.reportCoopType===1) {
+		
+		if(this.reportCoopType===1) {	
 			this.getreportdetail();
-	
 			this.timer = setInterval(() => {
 				this.handleAutoSave();
 			}, 6000);
@@ -195,52 +218,108 @@ export default {
 		},
 
 		/* 获取章节报告详情 */
-		getChapterDetail() {
-			if(!this.editChapterId) return
+		async getChapterDetail() {
 			
+			const res = await chapterDetail({
+				ReportChapterId: this.selectChapterId
+			})
+			
+			if(res.Ret !== 200) return
+			this.reportInfo = res.Data;
+			
+			$('.editor-wrapper')[0].scrollTop = 0;
+			if(this.editChapterId) {
+				this.timer = setInterval(() => {
+					this.handleAutoSaveChapter();
+				}, 6000);
+			}
 		},
 
-		/* 保存章节内容 存草稿 */
-		handleSaveChapterContent() {
+		/* 章节自动保存 存草稿*/
+		async handleAutoSaveChapter(type='auto') {
+			
+			if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
 
+			//如果富文本中有未上传完成的图片,去除这个dom
+			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
+			const res = await saveChapterReport({
+				ReportChapterId: this.reportInfo.ReportChapterId,
+				Title: this.reportInfo.Title,
+				Content: $('.fr-element').html()
+			})
+			if(res.Ret !== 200) return 
+
+			this.lastsavetime = http.dateFormatter(new Date(), true);
+			type==='save' && this.$message.success(res.Msg);
 		},
 
-		/* 单章节发布 */
-		handlePublishChapter() {
+		/* 章节预览 */
+		handlePreviewChapter() {
 
+      sessionStorage.setItem("reportdtl", JSON.stringify(this.reportInfo));
+      let { href } = this.$router.resolve({ path: "/reportdtlV2" });
+      window.open(href, "_blank");
 		},
 
+		/* 单章节发布 */
+		async handlePublishChapter() {
+			if(!$('.fr-element').html()) return this.$message.warning(/* '请输入报告内容' */this.$t('ReportManage.ReportList.report_empty_msg'))
+
+			if(!this.autoSaveFlag){
+				this.$message.error(this.$t('ReportManage.smart_msg.img_wait'))
+				return false
+			}
+			//如果富文本中有未上传完成的图片,去除这个dom
+			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
+
+			const res = await publishChapterReport({
+        ReportChapterId: this.reportInfo.ReportChapterId
+      });
+      if (res.Ret === 200) {
+        this.$message.success(this.$t('MsgPrompt.publish_msg'))
+
+        setTimeout(() => {
+          this.$router.go(-1);
+        }, 1000);
+      }
+		},
 
 
+		handleCheckClassifyNameArr(arr){
+			this.checkClassifyNameArr(1,arr)
+		},
 		// 编辑基础信息
 		handleReportEdit(e){
 
 				const params={
 						...e,
-						ReportId: parseInt(this.report_id),
-						Content: $('.fr-element').html(),
+						ReportId: parseInt(this.report_id)
 				}
 				
 				console.log(params);
 				//检查classifynameArr是否有审批流
 				let classify = [e.ClassifyIdFirst,e.ClassifyIdSecond,e.ClassifyIdThird]
-				this.checkClassifyNameArr(1,classify)
+				this.handleCheckClassifyNameArr(classify)
 
 				reportedit(params).then(res=>{
 						if(res.Ret===200){
 								this.$message.success(this.$t('MsgPrompt.saved_msg'))
 
-								this.reportInfo.Title=params.Title;
-								this.reportInfo.ClassifyIdFirst=params.ClassifyIdFirst;
-								this.reportInfo.ClassifyIdSecond=params.ClassifyIdSecond;
-								this.reportInfo.ClassifyIdThird=params.ClassifyIdThird;
-								this.reportInfo.ClassifyNameFirst=params.ClassifyNameFirst;
-								this.reportInfo.ClassifyNameSecond=params.ClassifyNameSecond;
-								this.reportInfo.ClassifyNameThird=params.ClassifyNameThird;
-								this.reportInfo.Abstract=params.Abstract;
-								this.reportInfo.Author=params.Author;
-								this.reportInfo.CreateTime=params.CreateTime;
-								this.reportInfo.IsPublicPublish=params.IsPublicPublish;
+								if(this.reportCoopType === 1) {
+									this.reportInfo.Title=params.Title;
+									this.reportInfo.ClassifyIdFirst=params.ClassifyIdFirst;
+									this.reportInfo.ClassifyIdSecond=params.ClassifyIdSecond;
+									this.reportInfo.ClassifyIdThird=params.ClassifyIdThird;
+									this.reportInfo.ClassifyNameFirst=params.ClassifyNameFirst;
+									this.reportInfo.ClassifyNameSecond=params.ClassifyNameSecond;
+									this.reportInfo.ClassifyNameThird=params.ClassifyNameThird;
+									this.reportInfo.Abstract=params.Abstract;
+									this.reportInfo.Author=params.Author;
+									this.reportInfo.CreateTime=params.CreateTime;
+									this.reportInfo.IsPublicPublish=params.IsPublicPublish;
+								}else {
+									this.$refs.chapterContRef.getReportBaseInfo('notCheck')
+								}
 								
 								this.showReportBaseInfo=false
 						}
@@ -253,7 +332,7 @@ export default {
 			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
 
 			let { href } = this.$router.resolve({
-				path: '/reportdtl',
+				path: '/reportdtlV2',
 				query:{
 					id:this.$route.query.id
 				}
@@ -261,153 +340,120 @@ export default {
 			window.open(href, '_blank');
 		},
 
-		/* 保存 存草稿*/
-		handleSaveContent() {
-			//如果富文本中有未上传完成的图片,去除这个dom
-			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
-			
-			//章节报告
-			if(this.reportCoopType===2) return this.handleSaveChapterContent()
-
-			autosave({
-				ReportId: Number(this.$route.query.id),
-				Content: $('.fr-element').html(),
-				NoChange:this.ischange?0:1
-			}).then((res) => {
-				if (res.Ret === 200) {
-					this.$message.success(res.Msg);
-
-					this.report_id = res.Data.ReportId;
-					this.lastsavetime = http.dateFormatter(new Date(), true);
-				}
-			});
-		},
-
-		// 每十秒自动保存
-		handleAutoSave() {
+		// 每十秒自动保存 存草稿
+		handleAutoSave(type='auto') {
 
 			if(!this.autoSaveFlag) return
 			//如果富文本中有未上传完成的图片,去除这个dom
 			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
-			autosave({
-				ReportId: Number(this.$route.query.id),
-				Content: $('.fr-element').html(),
-				NoChange:this.ischange?0:1
-			}).then((res) => {
-				if (res.Ret === 200) {
-					this.report_id = res.Data.ReportId;
-					this.lastsavetime = http.dateFormatter(new Date(), true);
-				}
-			});
-			this.ischange = false;
+			return new Promise((resolve,reject)=>{
+				autosave({
+					ReportId: Number(this.$route.query.id),
+					Content: $('.fr-element').html(),
+					NoChange:this.ischange?0:1
+				}).then((res) => {
+					if (res.Ret === 200) {
+						resolve(true)
+
+						this.lastsavetime = http.dateFormatter(new Date(), true);
+						type==='save' && this.$message.success(res.Msg);
+					}
+				});
+				this.ischange = false;
+			})
 		},
 
 		/* 报告详情 */
-		getreportdetail() {
-			reportdetail({ ReportId: parseInt(this.report_id) }).then(res=> {
-				if (res.Ret !== 200) return
+		async getreportdetail() {
+			
+			const res = await reportdetail({ ReportId: parseInt(this.report_id) })
 
-				this.reportInfo = res.Data;
-				let data = res.Data;
+			if (res.Ret !== 200) return
+			this.reportInfo = res.Data;
+			
+			let data = res.Data;
 
-				this.ThsMsgIsSend=data.ThsMsgIsSend
-				// 回显定时发布时间
-				if(data.PrePublishTime){
-					this.taskTime=data.PrePublishTime
-				}
-				let classify = [data.ClassifyIdFirst,data.ClassifyIdSecond,data.ClassifyIdThird]
-				this.checkClassifyNameArr(1,classify)
-				
-			});
+			this.ThsMsgIsSend=data.MsgIsSend
+			// 回显定时发布时间
+			if(data.PrePublishTime){
+				this.taskTime=data.PrePublishTime
+			}
+			let classify = [data.ClassifyIdFirst,data.ClassifyIdSecond,data.ClassifyIdThird]
+			this.handleCheckClassifyNameArr(classify)
 		},
+		
+		/* 发布报告 */
+		async handlePublishReport(tp) {
 
-		clickreportadd(tp) {
+			const saveRes = await this.handleAutoSave('auto');
+			if(!saveRes) return
 
-			if(!this.autoSaveFlag){
-				this.$message.error(this.$t('ReportManage.smart_msg.img_wait'))
-				return false
+			if(tp==='dsfb'){
+        this.showDSFB=true
+				return
+			}else if(tp==='submit'){
+				this.handleSubmitReport(Number(this.$route.query.id))
+				return
 			}
-			//如果富文本中有未上传完成的图片,去除这个dom
-			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
-			let params = {
-				ReportId: parseInt(this.report_id),
-				AddType: this.reportInfo.AddType,
-				ClassifyIdFirst: this.reportInfo.ClassifyIdFirst,
-				ClassifyNameFirst: this.reportInfo.ClassifyNameFirst,
-				ClassifyIdSecond: this.reportInfo.ClassifyIdSecond,
-				ClassifyNameSecond: this.reportInfo.ClassifyNameSecond,
-				ClassifyIdThird: this.reportInfo.ClassifyIdThird,
-				ClassifyNameThird: this.reportInfo.ClassifyNameThird,
-				Title: this.reportInfo.Title,
-				Abstract: this.reportInfo.Abstract,
-				Author: this.reportInfo.Author,
-				Frequency: this.reportInfo.Frequency,
-				Content: $('.fr-element').html(),
-				CreateTime: this.reportInfo.CreateTime,
-				State: 1
-			};
 
+			this.isPublishloading = true;
 
-			if(tp=='fb'||tp=='submit'){
-				this.isPublishloading = true;
-			}
-			const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)&&(!this.hasApproveFlow)
-			if (tp == 'fb') {
-				// 判断是否要推送客群
-				let hasTel=0
-
-				console.log(hasTel);
-				if(hasTel==1||this.ThsMsgIsSend==1){
-					this.isMessagePost = false; 
-					this.reporteditMsg(params,tp)
-				}else if(isPost){
-					this.$confirm(this.$t('ReportManage.smart_msg.publishing_messages'), this.$t('ReportManage.smart_release_prompt_btn'), {
-								confirmButtonText: this.$t('ReportManage.smart_btn.push'),
-								cancelButtonText: this.$t('ReportManage.smart_btn.not_push'),
-								type: 'warning',
-						    distinguishCancelAndClose:true,
-						    beforeClose:(action, instance,done)=>{
-						        console.log(action, instance);
-						        if(action==='close') {
-						            //右上角
-											this.isPublishloading = false;
-						        } else if(action==='cancel') {
-						            //cancelButton
-												this.isMessagePost = false; 
-												this.reporteditMsg(params,tp)
-						        }else {
-						           //confirmButton
-											this.isMessagePost = true; 
-											this.reporteditMsg(params,tp)
-						        }
-						        done()
-						    }
-					})
-				}else{
-					this.isMessagePost = false; 
-					this.reporteditMsg(params,tp)
-				}
+			let sendMsg = this.$route.query.reportCoopType===2 ? this.$refs.chapterContRef.reportBase.MsgIsSend : this.ThsMsgIsSend;
+			if(sendMsg===1){
+				this.publishreport({sendMsg: false})
 			}else {
-				this.reporteditMsg(params,tp)
-			}
+				const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)
+
+				this.$confirm(
+						isPost?this.$t('ReportManage.smart_msg.publishing_messages'):this.$t('ReportManage.smart_msg.should_published_immediately'), 
+						this.$t('ReportManage.smart_release_prompt_btn'), 
+						{
+								confirmButtonText: isPost?this.$t('ReportManage.smart_btn.push'):this.$t('ReportManage.smart_btn.publish'),
+								cancelButtonText: isPost?this.$t('ReportManage.smart_btn.not_push'):this.$t('Dialog.cancel_btn'),
+								type: 'warning',
+								distinguishCancelAndClose:true,
+						
+								beforeClose:(action, instance,done)=>{
+										if(action==='close') {
+												//右上角
+												this.isPublishloading = false;
+										} else if(action==='cancel') {
+												//cancelButton
+												if(isPost) this.publishreport({sendMsg: false});
+										}else {
+												//confirmButton
+												this.publishreport({sendMsg: isPost?true:false})
+										}
+										done()
+								}
+						}
+				)
 
+			}
 		},
 
 		//发布报告
-		publishreport(id,code) {
-			reportpublish({ ReportIds: String(id) ,ReportUrl:this.generatePdfLinks(code)}).then((res) => {
-				if (res.Ret == 200) {
-					this.isPublishloading = false;
-					this.$router.push({ path: '/reportNew' });
-				}
+		publishreport({sendMsg}) {
+			reportpublish({ 
+				ReportIds: String(this.$route.query.id),
+				ReportUrl:this.generatePdfLinks()
+			}).then((res) => {
+				this.isPublishloading = false;
+
+				if (res.Ret !== 200) return
+
+				sendMsg && reportMessageSend({ReportId: Number(this.$route.query.id)})
+				this.$router.push({ path: '/reportNew' });
 			});
 		},
 
-		generatePdfLinks(Code){
+		generatePdfLinks(){
 			const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
 			let waterMarkStr= localStorage.getItem('waterMarkStr') || '';
 
-			return `${baseUrl}/reportshare_pdf?code=${Code}&flag=${waterMarkStr}`
+			let code = this.reportCoopType===2?this.$refs.chapterContRef&&this.$refs.chapterContRef.reportBase.ReportCode:this.reportInfo.ReportCode
+
+			return `${baseUrl}/reportshare_pdf?code=${code}&flag=${waterMarkStr}`
 		},
 
 		// 定时发布报告
@@ -423,12 +469,13 @@ export default {
 			}
 			// return console.log(this.reportCode,'reportCode');
 			// 如果改报告已经推送过模板消息
-			if(this.ThsMsgIsSend==1){
+			let sendMsg = this.$route.query.reportCoopType===2 ? this.$refs.chapterContRef.reportBase.MsgIsSend : this.ThsMsgIsSend;
+			if(sendMsg===1){
 				reportSetPrepublish({
 					ReportId:Number(this.report_id),
 					PrePublishTime:this.taskTime,
 					PreMsgSend:0,
-					ReportUrl:this.generatePdfLinks(this.reportCode)
+					ReportUrl:this.generatePdfLinks()
 				}).then(res=>{
 					if(res.Ret===200){
 						this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -453,7 +500,7 @@ export default {
 								ReportId:Number(this.report_id),
 								PrePublishTime:this.taskTime,
 								PreMsgSend:0,
-								ReportUrl:this.generatePdfLinks(this.reportCode)
+								ReportUrl:this.generatePdfLinks()
 							}).then(res=>{
 								if(res.Ret===200){
 									this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -467,7 +514,7 @@ export default {
 							ReportId:Number(this.report_id),
 							PrePublishTime:this.taskTime,
 							PreMsgSend:isPost?1:0,
-							ReportUrl:this.generatePdfLinks(this.reportCode)
+							ReportUrl:this.generatePdfLinks()
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))

+ 2 - 29
src/views/report_manage/reportV2/normalReport/mixins/messagePush.js

@@ -12,33 +12,6 @@ export default {
     };
   },
   methods: {
-    reporteditMsg(params2, tp) {
-      reportedit(params2).then(async (res) => {
-        if (res.Ret == 200) {
-          this.$message.success(res.Msg);
-          this.reportCode=res.Data.ReportCode
-
-          if (tp == "fb") {
-            if(this.hasApproveFlow){
-                await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
-                return 
-            }
-            if (this.isMessagePost) {
-              await this.publishreport(res.Data.ReportId,res.Data.ReportCode);
-              await reportMessageSend({
-                ReportId: res.Data.ReportId,
-              }).then(() => {});
-            } else {
-              this.publishreport(res.Data.ReportId,res.Data.ReportCode);
-            }
-          } else if(tp=='dsfb'){
-            this.showDSFB=true
-          }else if(tp=='submit'){
-            this.handleSubmitReport(res.Data.ReportId)
-          }
-        }
-      });
-    },
 
     //刷报告中的所有图表和表格
     refreshReport: _.debounce ( async function() {
@@ -116,7 +89,7 @@ export default {
           type:'warning',
         }).then(()=>{
             this.submitReport("submit")
-        })
+        }).catch(()=>{})
         
     },
     //提交审批
@@ -128,7 +101,7 @@ export default {
                 if(res.Ret!==200) return
                 this.$message.success(this.$t('ReportManage.smart_msg.submit_success'))
                 this.isPublishloading = false;
-                this.$router.push({ path: '/reportlist' });
+                this.$router.push({ path: '/reportNew' });
             })
         /* } */
     }

+ 16 - 1
src/views/report_manage/reportV2/normalReport/reportdtl.vue

@@ -13,7 +13,7 @@
 			<block v-if="reportInfo.CollaborateType===2">
 				<div class="chapter-item" v-for="item in reportInfo.ChapterList" :key="item.ReportChapterId">
 					<div style="margin-bottom:10px">
-						<span class="type">{{item.TypeName}}</span>
+						<span class="type" v-if="item.TypeName">{{item.TypeName}}</span>
 						<span class="title">{{item.Title}}</span>
 					</div>
 					<div id="resetcss" style="overflow:hidden;" v-html="item.Content"></div>
@@ -72,11 +72,19 @@
 				type:Number,
 				default:0
 			},
+			info: {
+				type:Object
+			},
 			isEn:{
 				type:Boolean,
 				default:false
 			}
 		},
+		watch:{
+			info(nval) {
+				this.reportInfo = nval
+			}
+		},
 		data() {
 			return {
 				id:parseInt(this.$route.query.id),
@@ -91,6 +99,13 @@
 			vueQr
 		},
 		mounted() {
+			//内嵌章节预览
+			if(this.info) {
+				this.reportInfo = this.info;
+				this.isshow=true;
+				return 
+			}
+
 			if(this.$route.query.id||this.reportId) {
 				this.getreportdetail();
 			}else {

+ 341 - 207
src/views/report_manage/reportV2/smartReport/editReport.vue

@@ -1,9 +1,17 @@
 <template>
     <div class="edit-smart-box">
         <!-- 章节编辑区 -->
-		<div class="left-wrap" v-if="reportInfo&&reportInfo.CollaborateType===2">
+		<div class="left-wrap" v-if="reportCoopType===2">
 			<chapterWrapper
 				v-show="isLeftWrapShow"
+                ref="chapterContRef"
+                :isApprove="isApprove"
+				:hasApproveFlow="hasApproveFlow"
+				@change="handleChapterInfo"
+				@checkClassifyNameArr="handleCheckClassifyNameArr"
+				@openBaseInfo="showReportBaseInfo=true"
+				@handlePreviewReport="handlePreviewReport"
+                @handlePublish="handlePublishOpt"
 			/>
 
 			<span
@@ -17,191 +25,211 @@
 
 
         <div class="edit-smart-report-page">
-            <!-- 顶部操作栏 -->
-            <editHeader
-                :isApprove="isApprove"
-				:hasApproveFlow="hasApproveFlow"
-                :reportInfo="{Title: reportInfo&&reportInfo.title}"
-                @handleClearContent="handleClearContent"
-                @openBaseInfo="showReportBaseInfo=true"
-                @handleRefreshAllChart="handleRefreshAllChart"
-                @handlePreviewReport="handlePreviewReport"
-                @handleSaveContent="handleSaveContent"
-                @handlePublishOpt="handlePublishOpt"
-            />
-            
-            <div class="main-wrap">
-                <div class="report-action-wrap">
-                    <ul class="top-type-list">
-                        <li class="item" v-for="item in topTypeList" :key="item.name" @click="handleShowRight(item)">
-                            <img class="icon" :src="item.icon" alt="">
-                            <span>{{item.name}}</span>
-                        </li>
-                    </ul>
-                    <!-- 公共组件 -->
-                    <draggable
-                        :list="compList"
-                        :group="{ name: 'component', pull: 'clone', put: false }"
-                        class="report-comp-wrap"
-                        animation="300"
-                        :sort="false"
-                        tag="ul"
-                        filter='.unDrag'
-                    >
-                        <li class="comp-item" :comp-data="JSON.stringify(comp)" v-for="comp in compList" :key="comp.id">
-                            <img :src="comp.icon">
-                        </li>
-                        <li class="comp-item unDrag" style="cursor: pointer;">
-                            <el-color-picker v-model="bgColor" @change="handleBgColorChange"></el-color-picker>
-                        </li>
-                    </draggable>
-
-                    <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="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.value"
-                            :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.value] }}
-                            </div>
-                        </div>
+            <!-- 章节报告默认 -->
+			<template v-if="reportCoopType===2&&!selectChapterId">
+				<div style="padding-top: 20%;">
+                    <tableNoData :text="$t('Common.no_cont_msg')"/>
+                </div>
+			</template>
+
+			<!-- 章节报告预览 -->
+			<template v-else-if="reportCoopType===2&&selectChapterId&&!editChapterId">
+				<div style="max-height:100vh;overflow-y:auto;">
+					<smartReportDetail
+						v-if="reportInfo&&reportInfo.ReportChapterId"
+						:info="reportInfo"
+					/>
+				</div>
+			</template>
+
+            <!-- 非章节报告或章节报告编辑 -->
+            <template v-else>
+                <!-- 顶部操作栏 -->
+                <editHeader
+                    :isApprove="isApprove"
+                    :hasApproveFlow="hasApproveFlow"
+                    :reportInfo="reportInfo"
+                    @handleClearContent="handleClearContent"
+                    @openBaseInfo="showReportBaseInfo=true"
+                    @handleRefreshAllChart="handleRefreshAllChart"
+                    @handlePreviewReport="reportInfo.ReportChapterId?handlePreviewChapter():handlePreviewReport()"
+                    @handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleSaveContent()"
+                    @handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishOpt(type)}"
+                />
+                
+                <div class="main-wrap">
+                    <div class="report-action-wrap">
+                        <ul class="top-type-list">
+                            <li class="item" v-for="item in topTypeList" :key="item.name" @click="handleShowRight(item)" v-show="item.visable">
+                                <img class="icon" :src="item.icon" alt="">
+                                <span>{{item.name}}</span>
+                            </li>
+                        </ul>
+                        <!-- 公共组件 -->
                         <draggable
-                            :list="conList"
-                            :group="{ name: 'component', pull: true, put: true }"
-                            class="report-html-wrap"
-                            id="report-html-content"
+                            :list="compList"
+                            :group="{ name: 'component', pull: 'clone', put: false }"
+                            class="report-comp-wrap"
                             animation="300"
-                            tag="div"
-                            handle=".drag-btn_p"
-                            @add="handleParentAdd"
-                            @remove="handleParentRemove"
-                            :move="handleParentMove"
+                            :sort="false"
+                            tag="ul"
+                            filter='.unDrag'
                         >
-                            <div 
-                                :class="[
-                                    'report-drag-item-wrap',
-                                    activeId===item.id?'blue-bg':'',
-                                    item.child&&!item.child.length?'report-drag-item-out':''
-                                ]"
-                                v-for="item,index in conList" 
-                                :key="item.id"
-                                :comp-type="item.compType"
-                                @click="handleChoose(item,index)"
-                                :style="item.style"
-                            >
-                                <!-- 缩放的盒子 -->
-                                <div class="resize-drag-box" @mousedown.stop="handleResizeP($event,index)"></div>
+                            <li class="comp-item" :comp-data="JSON.stringify(comp)" v-for="comp in compList" :key="comp.id">
+                                <img :src="comp.icon">
+                            </li>
+                            <li class="comp-item unDrag" style="cursor: pointer;" v-if="!reportInfo.ReportChapterId">
+                                <el-color-picker v-model="bgColor" @change="handleBgColorChange"></el-color-picker>
+                            </li>
+                        </draggable>
+
+                        <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="drag-btn drag-btn_p"></div>
-                                    <div class="del-btn" @click.stop="handleDelItem(index,-1)"></div>
+                                    <div class="del-btn" @click.stop="deleteLayoutPic(1)"></div>
                                 </div>
-                                <div 
-                                    v-if="item.child&&!item.child.length"
-                                    class="report-drag-item-wrap_content"
-                                    style="width:100%;height:100%"
-                                    :data-id="item.id"
-                                >
-                                    <component :is="getComponentName(item)" :compData="item"/>
+                                <img :src="headImg" alt="" style="display:block;width:100%">
+                                <div class="head-layout-item" v-for="item in headImgStyle" :key="item.value"
+                                :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.value] }}
                                 </div>
-                                <draggable
-                                    :list="item.child"
-                                    :group="{ name: 'component', pull: true, put: item.child&&item.child.length<3?true:false }"
-                                    animation="300"
-                                    tag="div"
-                                    class="report-drag-item-wrap_child-wrap"
-                                    @add="handleChildAdd($event,item,index)"
-                                    @remove="handleChildRemove($event,item.child)"
-                                    handle=".drag-btn_c"
-                                    style="display: flex;gap: 3px;align-items: flex-start;"
+                            </div>
+                            <draggable
+                                :list="conList"
+                                :group="{ name: 'component', pull: true, put: true }"
+                                class="report-html-wrap"
+                                id="report-html-content"
+                                animation="300"
+                                tag="div"
+                                handle=".drag-btn_p"
+                                @add="handleParentAdd"
+                                @remove="handleParentRemove"
+                                :move="handleParentMove"
+                            >
+                                <div 
+                                    :class="[
+                                        'report-drag-item-wrap',
+                                        activeId===item.id?'blue-bg':'',
+                                        item.child&&!item.child.length?'report-drag-item-out':''
+                                    ]"
+                                    v-for="item,index in conList" 
+                                    :key="item.id"
+                                    :comp-type="item.compType"
+                                    @click="handleChoose(item,index)"
+                                    :style="item.style"
                                 >
+                                    <!-- 缩放的盒子 -->
+                                    <div class="resize-drag-box" @mousedown.stop="handleResizeP($event,index)"></div>
+                                    <div class="opt-btn-box" style="display: none;">
+                                        <div class="drag-btn drag-btn_p"></div>
+                                        <div class="del-btn" @click.stop="handleDelItem(index,-1)"></div>
+                                    </div>
                                     <div 
-                                        :class="['report-drag-item-wrap_child_content',activeId===child.id?'blue-bg':'']" 
-                                        v-for="child,cindex in item.child" 
-                                        :key="child.id"
-                                        :comp-type="child.compType"
-                                        :data-id="child.id"
-                                        @click.stop="handleChoose(child,index,cindex)"
-                                        style="flex:1"
-                                        :style="child.style"
+                                        v-if="item.child&&!item.child.length"
+                                        class="report-drag-item-wrap_content"
+                                        style="width:100%;height:100%"
+                                        :data-id="item.id"
                                     >
-                                        <div class="opt-btn-box2" style="display: none;">
-                                            <div class="drag-btn drag-btn_c"></div>
-                                            <div class="del-btn" @click.stop="handleDelItem(index,cindex)"></div>
-                                        </div>
-                                        <!-- 拖动按钮 -->
-                                        <div class="resize-drag-box_lb" @mousedown.stop="handleResizeC($event,index,cindex,'lb')"></div>
-                                        <div class="resize-drag-box_rb" @mousedown.stop="handleResizeC($event,index,cindex,'rb')"></div>
-                                        <component :is="getComponentName(child)" :compData="child"/>
-                                        <!--  -->
-                                        <div class="mark-box" v-if="isDragResize" style="position: absolute;left:0;right:0;top:0;bottom: 0;z-index: 10;"></div>
+                                        <component :is="getComponentName(item)" :compData="item"/>
                                     </div>
-                                </draggable>
-                            </div>
-                        </draggable>
+                                    <draggable
+                                        :list="item.child"
+                                        :group="{ name: 'component', pull: true, put: item.child&&item.child.length<3?true:false }"
+                                        animation="300"
+                                        tag="div"
+                                        class="report-drag-item-wrap_child-wrap"
+                                        @add="handleChildAdd($event,item,index)"
+                                        @remove="handleChildRemove($event,item.child)"
+                                        handle=".drag-btn_c"
+                                        style="display: flex;gap: 3px;align-items: flex-start;"
+                                    >
+                                        <div 
+                                            :class="['report-drag-item-wrap_child_content',activeId===child.id?'blue-bg':'']" 
+                                            v-for="child,cindex in item.child" 
+                                            :key="child.id"
+                                            :comp-type="child.compType"
+                                            :data-id="child.id"
+                                            @click.stop="handleChoose(child,index,cindex)"
+                                            style="flex:1"
+                                            :style="child.style"
+                                        >
+                                            <div class="opt-btn-box2" style="display: none;">
+                                                <div class="drag-btn drag-btn_c"></div>
+                                                <div class="del-btn" @click.stop="handleDelItem(index,cindex)"></div>
+                                            </div>
+                                            <!-- 拖动按钮 -->
+                                            <div class="resize-drag-box_lb" @mousedown.stop="handleResizeC($event,index,cindex,'lb')"></div>
+                                            <div class="resize-drag-box_rb" @mousedown.stop="handleResizeC($event,index,cindex,'rb')"></div>
+                                            <component :is="getComponentName(child)" :compData="child"/>
+                                            <!--  -->
+                                            <div class="mark-box" v-if="isDragResize" style="position: absolute;left:0;right:0;top:0;bottom: 0;z-index: 10;"></div>
+                                        </div>
+                                    </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.value"
-                            :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.value] }}
+                            <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.value"
+                                :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.value] }}
+                                </div>
                             </div>
                         </div>
                     </div>
-                </div>
 
-                <div class="right-action-wrap" v-show="showRight">
-                    <div class="close-icon" @click="handleCloseRight">
-                        <img src="~@/assets/img/smartReport/icon14.png" alt="">
-                    </div>
-                    <div style="overflow-x:auto;height:calc(100% + 12px);">
-                    <div style="min-width:800px;height: 100%;">
-                    <TextEdit 
-                        v-if="rightType==='text'"
-                        :key="activeId"
-                        :content="activeContent" 
-                        @textChange="handleTextChange" 
-                    />
-                    <ImgEdit 
-                        v-if="rightType==='img'"
-                        :key="activeId"
-                        :content="activeContent" 
-                        @imgChange="handleTextChange" 
-                    />
-                    <!-- 图库插入 -->
-                    <ETAChart 
-                        v-if="rightType==='etaChart'"
-                        @handleImportMyChart="handleImportMyChart"
-                    />
-                    <!-- ETA表格 -->
-                    <ETASheet v-if="rightType==='etaSheet'"/>
-                    <!-- 统计分析 -->
-                    <StatisticAnalysis v-if="rightType==='statisticAnalysis'"/>
-                    <!-- 商品价格曲线 -->
-                    <ETAPriceChart v-if="rightType==='etaPriceChart'"/>
-                    <!-- 沙盘图 -->
-                    <ETASandBox v-if="rightType==='etaSandBox'"/>
-                    <!-- 语义分析 -->
-                    <SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
-                    <!-- 版图资源库 -->
-                    <ImgSource v-if="rightType==='imgSource'" @change="handleInsertImgSource" @close="handleCloseRight"/>
-                    </div>
+                    <div class="right-action-wrap" v-show="showRight">
+                        <div class="close-icon" @click="handleCloseRight">
+                            <img src="~@/assets/img/smartReport/icon14.png" alt="">
+                        </div>
+                        <div style="overflow-x:auto;height:calc(100% + 12px);">
+                        <div style="min-width:800px;height: 100%;">
+                        <TextEdit 
+                            v-if="rightType==='text'"
+                            :key="activeId"
+                            :content="activeContent" 
+                            @textChange="handleTextChange" 
+                        />
+                        <ImgEdit 
+                            v-if="rightType==='img'"
+                            :key="activeId"
+                            :content="activeContent" 
+                            @imgChange="handleTextChange" 
+                        />
+                        <!-- 图库插入 -->
+                        <ETAChart 
+                            v-if="rightType==='etaChart'"
+                            @handleImportMyChart="handleImportMyChart"
+                        />
+                        <!-- ETA表格 -->
+                        <ETASheet v-if="rightType==='etaSheet'"/>
+                        <!-- 统计分析 -->
+                        <StatisticAnalysis v-if="rightType==='statisticAnalysis'"/>
+                        <!-- 商品价格曲线 -->
+                        <ETAPriceChart v-if="rightType==='etaPriceChart'"/>
+                        <!-- 沙盘图 -->
+                        <ETASandBox v-if="rightType==='etaSandBox'"/>
+                        <!-- 语义分析 -->
+                        <SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
+                        <!-- 版图资源库 -->
+                        <ImgSource v-if="rightType==='imgSource'" @change="handleInsertImgSource" @close="handleCloseRight"/>
+                        </div>
+                        </div>
                     </div>
                 </div>
-            </div>
+            </template>
 
             <!-- 报告基础信息 -->
             <reportBaseInfo  
                 v-model="showReportBaseInfo" 
-                :reportInfo="reportInfo" 
+                :reportInfo="reportCoopType===2?($refs.chapterContRef&&$refs.chapterContRef.reportBase):reportInfo"
                 :id="$route.query.id"
                 @save="handleReportEdit"
             />
@@ -255,7 +283,11 @@ import {
 	reportedit,
 	reportdetail,
 	reportpublish,
-	reportSetPrepublish
+	reportSetPrepublish,
+    chapterDetail,
+	saveChapterReport,
+	publishChapterReport,
+    reportMessageSend
 } from '@/api/modules/reportV2';
 import {approveInterence} from '@/api/modules/approve.js';
 import * as sheetInterface from '@/api/modules/sheetApi.js';
@@ -269,6 +301,7 @@ import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 import ImgSource from './components/ImgSource.vue'
 import editHeader from '../components/reportEditHeader.vue';
 import chapterWrapper from '../components/chapterEditWrapper.vue';
+import smartReportDetail from './reportDetail.vue'
 export default {
     mixins:[reportApproveConfig],
     name:"smartReportEditV2",
@@ -289,7 +322,8 @@ export default {
         SemanticAnalysis,
         ImgSource,
         editHeader,
-        chapterWrapper
+        chapterWrapper,
+        smartReportDetail
     },
     watch:{
         'taskTime'(){
@@ -317,7 +351,7 @@ export default {
     },
     data() {
         return {
-            reportInfo:null,
+            reportInfo:{},
             showReportBaseInfo:false,
 
             compList:[
@@ -379,9 +413,96 @@ export default {
             },
 
             isLeftWrapShow: true,//展开章节区
+
+            reportCoopType: 0,//协作类型 1单人 2章节报告
+			selectChapterId: 0, //选中章节Id
+            editChapterId: 0,//编辑章节Id
         }
     },
     methods: {
+        /* 当前章节信息 */
+		handleChapterInfo({ selectChapterId,editChapterId }) {
+			this.selectChapterId = selectChapterId;
+			this.editChapterId = editChapterId;
+			
+			this.getChapterDetail()
+		},
+
+		/* 获取章节报告详情 */
+		async getChapterDetail() {
+			const res = await chapterDetail({
+				ReportChapterId: this.selectChapterId
+			})
+			
+			if(res.Ret !== 200) return
+			this.reportInfo = res.Data;
+
+            this.conList=res.Data.ContentStruct?JSON.parse(res.Data.ContentStruct):[]
+
+            this.layoutBaseInfo['研报标题']=res.Data.Title
+            this.layoutBaseInfo['研报作者']=res.Data.Author
+            this.layoutBaseInfo['创建时间']=res.Data.CreateTime
+			
+			$('.edit-smart-report-page')[0].scrollTop = 0;
+			if(this.editChapterId) {
+				this.timer = setInterval(() => {
+					this.handleAutoSaveChapter();
+				}, 6000);
+			}
+		},
+
+		/* 章节自动保存 存草稿*/
+		async handleAutoSaveChapter(type='auto') {
+			
+			if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
+
+			const htmlStr=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
+			const res = await saveChapterReport({
+				ReportChapterId: this.reportInfo.ReportChapterId,
+				Title: this.reportInfo.Title,
+				Content: htmlStr,
+                ContentStruct:JSON.stringify(this.conList),
+			})
+			if(res.Ret !== 200) return 
+
+			type==='save' && this.$message.success(res.Msg);
+		},
+
+		/* 章节预览 */
+		handlePreviewChapter() {
+            
+            const htmlStr=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
+            sessionStorage.setItem('smartReportContent', htmlStr);
+            sessionStorage.setItem('smartReportContentBg', '');
+			let { href } = this.$router.resolve({ 
+                path: '/smartReportDetail',
+                query:{
+                    id:this.$route.query.id,
+                    type:'preview'
+                }
+            });
+			window.open(href, '_blank');
+		},
+
+		/* 单章节发布 */
+		async handlePublishChapter() {
+
+			const res = await publishChapterReport({
+                ReportChapterId: this.reportInfo.ReportChapterId
+            });
+            if (res.Ret === 200) {
+                this.$message.success(this.$t('MsgPrompt.publish_msg'))
+
+                setTimeout(() => {
+                    this.$router.go(-1);
+                }, 1000);
+            }
+		},
+
+        handleCheckClassifyNameArr(arr) {
+            this.checkClassifyNameArr(1,arr)
+        },
+
         //清空内容 
         handleClearContent() {
             document.getElementById('report-html-content').innerHTML = '';
@@ -795,33 +916,31 @@ export default {
             return type+new Date().getTime()
         },
 
-        // 编辑保存报告
+        // 编辑保存信息
         handleReportEdit(e){
-            const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
             
             const params={
                 ...e,
-                ReportId:Number(this.$route.query.id)||0,
-                Content:html,
-                ContentStruct:JSON.stringify(this.conList),
-                HeadImg:this.headImg,
-                EndImg:this.endImg,
-                HeadResourceId:this.headImgId,
-                EndResourceId:this.endImgId,
-                CanvasColor:this.bgColor
+                ReportId:Number(this.$route.query.id)||0
             }
             console.log(params);
             //检查classifynameArr是否有审批流
             let classify = [e.ClassifyIdFirst,e.ClassifyIdSecond,e.ClassifyIdThird]
-            this.checkClassifyNameArr(1,classify)
+            this.handleCheckClassifyNameArr(classify)
 
             reportedit({...params}).then(res=>{
                 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
+
+                    if(this.reportCoopType === 1) {
+                        this.reportInfo.Title=params.Title
+                        this.layoutBaseInfo['研报标题']=params.Title
+                        this.layoutBaseInfo['研报作者']=params.Author
+                        this.layoutBaseInfo['创建时间']=params.CreateTime
+                    }else {
+                        this.$refs.chapterContRef.getReportBaseInfo('notCheck')
+                    }
+
                     this.showReportBaseInfo=false
                 }
             })
@@ -868,7 +987,7 @@ export default {
                         this.contentChange=false
                     })
                     let classify = [res.Data.ClassifyIdFirst,res.Data.ClassifyIdSecond]
-                    this.checkClassifyNameArr(3,classify)
+                    this.handleCheckClassifyNameArr(classify)
                 }
             })
         },
@@ -894,9 +1013,9 @@ export default {
 
             if(this.$route.query.id&&code_arr.length) {
                 let res = await dataBaseInterface.getReportrefreshStatus({
-                Source: 'smart_report',
-                ReportId: Number(this.$route.query.id),
-                ReportChapterId: 0
+                    Source: 'smart_report',
+                    ReportId: Number(this.$route.query.id),
+                    ReportChapterId: Number(this.reportInfo.ReportChapterId)
                 });
                 
                 if(!res.Data.RefreshResult) return this.$message.warning(this.$t('ReportManage.ReportList.chart_refreshed_msg'))
@@ -963,18 +1082,18 @@ export default {
                             this.$message.success(this.$t('MsgPrompt.saved_msg'))
                         }
                     }
-                    if(res.Msg==='报告已发布, 不允许编辑'){
-                        this.$router.replace({ path: '/reportNew' });
-                    }
                 })
             })
         },
 
         // 点击定时发布/发布
         async handlePublishOpt(type){
-            // 存一次草稿
-            const saveRes=await this.handleSaveContent({isAutoSave:true})
-            if(!saveRes) return
+            if(document.getElementById('report-html-content')) { 
+                // 存一次草稿
+                const saveRes=await this.handleSaveContent({isAutoSave:true})
+                if(!saveRes) return
+            }
+
             if(type==='dsfb'){
                 this.showDSFB=true
                 return
@@ -985,10 +1104,11 @@ export default {
                 return
             }
             //截止至ETA1.3.8 智能研报无推送模板消息,所有的reportInfo.MsgIsSend都为1
-            if(this.reportInfo.MsgIsSend==1){//该报告已经推送过模板消息
+            let sendMsg = this.$route.query.reportCoopType===2 ? this.$refs.chapterContRef.reportBase.MsgIsSend : this.reportInfo.MsgIsSend;
+            if(sendMsg===1){//该报告已经推送过模板消息
                 this.reportPublish({sendMsg:false})
             }else{
-                const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.smartReportManageBtn.reportManage_sendMsg)
+                const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)
                 this.$confirm(
                     isPost?this.$t('ReportManage.smart_msg.publishing_messages'):this.$t('ReportManage.smart_msg.should_published_immediately'), 
                     this.$t('ReportManage.smart_release_prompt_btn'), 
@@ -1049,12 +1169,13 @@ export default {
 				return
 			}
             // 如果该报告已经推送过模板消息
-            if(this.reportInfo.MsgIsSend==1){
+            let sendMsg = this.$route.query.reportCoopType===2 ? this.$refs.chapterContRef.reportBase.MsgIsSend : this.reportInfo.MsgIsSend;
+            if(sendMsg===1){
                 reportSetPrepublish({
                     ReportId:Number(this.$route.query.id),
                     PrePublishTime:this.taskTime,
                     PreMsgSend:0,
-                    ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
+                    ReportUrl:this.generatePdfLinks()
                 }).then(res=>{
                     if(res.Ret===200){
                         this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1064,7 +1185,7 @@ export default {
                 return
             }
 
-            const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.smartReportManageBtn.reportManage_sendMsg)
+            const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)
 
            this.$confirm(isPost?this.$t('ReportManage.smart_msg.push_report_msg'):this.$t('ReportManage.smart_msg.is_push_timed'), this.$t('ReportManage.smart_release_prompt_btn'), {
 				confirmButtonText: isPost?this.$t('ReportManage.smart_btn.push'):this.$t('ReportManage.smart_btn.publish'),
@@ -1080,7 +1201,7 @@ export default {
 								ReportId:Number(this.$route.query.id),
 								PrePublishTime:this.taskTime,
 								PreMsgSend:0,
-                                ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
+                                ReportUrl:this.generatePdfLinks()
 							}).then(res=>{
 								if(res.Ret===200){
 									this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1094,7 +1215,7 @@ export default {
 							ReportId:Number(this.$route.query.id),
 							PrePublishTime:this.taskTime,
 							PreMsgSend:isPost?1:0,
-                            ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
+                            ReportUrl:this.generatePdfLinks()
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
@@ -1111,7 +1232,7 @@ export default {
         reportPublish({sendMsg}){
             reportpublish({
                 ReportIds:String(this.$route.query.id),
-                ReportUrl:this.generatePdfLinks(this.reportInfo.ReportCode)
+                ReportUrl:this.generatePdfLinks()
             }).then(res=>{
                 if(res.Ret===200){
                     if(sendMsg){
@@ -1121,9 +1242,12 @@ export default {
                 }
             })
         },
-        generatePdfLinks(Code){
+        generatePdfLinks(){
             const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
-            return `${baseUrl}/reportshare_smart_pdf?code=${Code}`
+
+            let code = this.reportCoopType===2?this.$refs.chapterContRef&&this.$refs.chapterContRef.reportBase.ReportCode:this.reportInfo.ReportCode
+
+            return `${baseUrl}/reportshare_smart_pdf?code=${code}`
         },
         //报告消息推送
         reportSendMsg(){
@@ -1169,36 +1293,43 @@ export default {
                 {
                     name:this.$t('ReportManage.ReportList.library_top_type'),
                     type:'imgSource',
+                    visable: this.reportCoopType!==2,
                     icon:require('@/assets/img/smartReport/icon04.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.chart_top_type'),
                     type:'etaChart',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon04.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.eta_top_type'),
                     type:'etaSheet',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon05.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.statistical_top_type'),
                     type:'statisticAnalysis',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon06.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.price_curve_radio'),
                     type:'etaPriceChart',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon07.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.sandbox_top_type'),
                     type:'etaSandBox',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon08.png')
                 },
                 {
                     name:this.$t('ReportManage.ReportList.semantic_top_type'),
                     type:'semanticAnalysis',
+                    visable:true,
                     icon:require('@/assets/img/smartReport/icon09.png')
                 }
             ]
@@ -1206,13 +1337,16 @@ export default {
     },
     created() {
         this.getPublicSettings()
-        this.getReportDetail()
+        this.reportCoopType = Number(this.$route.query.coopType)
+        this.reportCoopType===1 && this.getReportDetail()
     },
     mounted () {
         window.addEventListener('message',this.setSheetIframeStyle)
-        this.timer = setInterval(() => {
-			this.handleSaveContent({isAutoSave:true});
-		}, 6000);
+        if(this.reportCoopType===1) {
+            this.timer = setInterval(() => {
+                this.handleSaveContent({isAutoSave:true});
+            }, 6000);
+        }
     },
     destroyed() {
 		window.removeEventListener('message',this.setSheetIframeStyle)

+ 21 - 0
src/views/report_manage/reportV2/smartReport/reportDetail.vue

@@ -113,6 +113,18 @@ export default {
         reportId:{//审批详情-预览报告
             type:Number,
             default:0
+        },
+        info: { //章节预览
+            type: Object
+        }
+    },
+    watch:{
+        info(nval) {
+            this.reportInfo = nval;
+            this.layoutBaseInfo['研报标题']=this.reportInfo.Title
+            this.layoutBaseInfo['研报作者']=this.reportInfo.Author
+            this.layoutBaseInfo['创建时间']=this.reportInfo.CreateTime
+            this.content=this.reportInfo.Content
         }
     },
     data() {
@@ -135,6 +147,15 @@ export default {
         }
     },
     created() {
+        //内嵌章节预览
+        if(this.info) {
+            this.reportInfo = this.info;
+            this.layoutBaseInfo['研报标题']=this.reportInfo.Title
+            this.layoutBaseInfo['研报作者']=this.reportInfo.Author
+            this.layoutBaseInfo['创建时间']=this.reportInfo.CreateTime
+            this.content=this.reportInfo.Content
+            return 
+        }
         this.getReportDetail()
     },
     methods: {

Some files were not shown because too many files changed in this diff