|
@@ -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)
|