|
@@ -0,0 +1,1857 @@
|
|
|
+<template>
|
|
|
+ <div class="edit-smart-box">
|
|
|
+ <!-- 章节编辑区 -->
|
|
|
+ <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"
|
|
|
+ @update="({Title}) => { reportInfo.Title=Title }"
|
|
|
+ />
|
|
|
+
|
|
|
+ <span
|
|
|
+ class="slide-btn-icon"
|
|
|
+ :class="{'slide-left':isLeftWrapShow,'slide-right':!isLeftWrapShow}"
|
|
|
+ @click="isLeftWrapShow = !isLeftWrapShow"
|
|
|
+ >
|
|
|
+ <i :class="{'el-icon-d-arrow-left':isLeftWrapShow,'el-icon-d-arrow-right':!isLeftWrapShow}"></i>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="edit-smart-report-page">
|
|
|
+ <!-- 章节报告默认 -->
|
|
|
+ <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({isAutoSave:false})"
|
|
|
+ @handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishOpt(type)}"
|
|
|
+ @update="()=>{$refs.chapterContRef&&$refs.chapterContRef.getChapterList()}"
|
|
|
+ />
|
|
|
+
|
|
|
+ <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="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;" 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="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>
|
|
|
+ <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
|
|
|
+ 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"/>
|
|
|
+ </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
|
|
|
+ :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>
|
|
|
+ </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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 报告基础信息 -->
|
|
|
+ <reportBaseInfo
|
|
|
+ v-model="showReportBaseInfo"
|
|
|
+ :reportInfo="reportCoopType===2?($refs.chapterContRef&&$refs.chapterContRef.reportBase):reportInfo"
|
|
|
+ :id="$route.query.id"
|
|
|
+ @save="handleReportEdit"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 定时发布弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ v-dialogDrag
|
|
|
+ :append-to-body="true"
|
|
|
+ :visible.sync="showDSFB"
|
|
|
+ width="500px"
|
|
|
+ :title="$t('ReportManage.ReportList.scheduled_publish_btn')"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <span>{{$t('ReportManage.ReportList.publish_time')}}</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="taskTime"
|
|
|
+ type="datetime"
|
|
|
+ :placeholder="$t('ReportManage.ReportList.select_date_and_time')"
|
|
|
+ value-format="yyyy-MM-dd HH:mm"
|
|
|
+ :picker-options="timePickerOpt"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <p style="margin:15px 0">{{$t('ReportManage.ReportList.the_report_will_be_posted_on_time')}}</p>
|
|
|
+ <div style="text-align:right;margin:20px 0">
|
|
|
+ <el-button type="primary" plain @click="showDSFB=false">{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
+ <el-button type="primary" @click="handleSetReportPrepublish">{{$t('Dialog.confirm_btn')}}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import draggable from 'vuedraggable'
|
|
|
+import TextComp from './components/TextComp.vue'
|
|
|
+import ChartComp from './components/ChartComp.vue'
|
|
|
+import ImgComp from './components/ImgComp.vue'
|
|
|
+import SheetComp from './components/SheetComp.vue'
|
|
|
+import _ from 'lodash'
|
|
|
+import TextEdit from './components/TextEdit.vue'
|
|
|
+import ImgEdit from './components/ImgEdit.vue'
|
|
|
+import ETAChart from './components/ETAChart.vue'
|
|
|
+import ETASheet from './components/ETASheet.vue'
|
|
|
+import { getPublicSettingsApi } from '@/api/modules/oldApi';
|
|
|
+import { dataBaseInterface } from "@/api/api.js";
|
|
|
+import {
|
|
|
+ autosave,
|
|
|
+ reportedit,
|
|
|
+ reportdetail,
|
|
|
+ reportpublish,
|
|
|
+ reportSetPrepublish,
|
|
|
+ chapterDetail,
|
|
|
+ saveChapterReport,
|
|
|
+ publishChapterReport,
|
|
|
+ reportMessageSend
|
|
|
+} from '@/api/modules/reportV2';
|
|
|
+import {approveInterence} from '@/api/modules/approve.js';
|
|
|
+import * as sheetInterface from '@/api/modules/sheetApi.js';
|
|
|
+import reportBaseInfo from '../components/reportBaseInfoDia.vue'
|
|
|
+import StatisticAnalysis from './components/StatisticAnalysis.vue'
|
|
|
+import ETAPriceChart from './components/ETAPriceChart.vue'
|
|
|
+import ETASandBox from './components/ETASandBox.vue'
|
|
|
+import SemanticAnalysis from './components/SemanticAnalysis.vue'
|
|
|
+import { getUrlParams } from '@/utils/common'
|
|
|
+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'
|
|
|
+import { GetQueryString } from '@/utils/common'
|
|
|
+export default {
|
|
|
+ mixins:[reportApproveConfig],
|
|
|
+ name:"smartReportEditV2",
|
|
|
+ components: {
|
|
|
+ draggable,
|
|
|
+ reportBaseInfo,
|
|
|
+ TextComp,
|
|
|
+ ChartComp,
|
|
|
+ ImgComp,
|
|
|
+ SheetComp,
|
|
|
+ TextEdit,
|
|
|
+ ImgEdit,
|
|
|
+ ETAChart,
|
|
|
+ ETASheet,
|
|
|
+ StatisticAnalysis,
|
|
|
+ ETAPriceChart,
|
|
|
+ ETASandBox,
|
|
|
+ SemanticAnalysis,
|
|
|
+ ImgSource,
|
|
|
+ editHeader,
|
|
|
+ chapterWrapper,
|
|
|
+ smartReportDetail
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ 'taskTime'(){
|
|
|
+ this.taskTime=this.$moment(this.taskTime).format('YYYY-MM-DD HH:mm')+':00'
|
|
|
+ const date = this.$moment(this.taskTime).startOf('day').format('x');
|
|
|
+ const nowDate = this.$moment().startOf('day').format('x');
|
|
|
+ // 如果选择的是今天 则需要禁用已经过去的时间节点
|
|
|
+ if (date <= nowDate) {
|
|
|
+ // 默认选择的最新时间 是当前时间的两分钟后 (留出2分钟的富裕时间)
|
|
|
+ this.timePickerOpt.selectableRange = (
|
|
|
+ `${this.$moment().add(2,'m').format('HH:mm:ss')} - 23:59:59`
|
|
|
+ );
|
|
|
+ }else {
|
|
|
+ // 如果是以后的日期,则不需要禁用时间节点
|
|
|
+ this.timePickerOpt.selectableRange = '00:00:00 - 23:59:59';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ conList:{
|
|
|
+ handler(n,o){
|
|
|
+ console.log('内容改变');
|
|
|
+ this.contentChange=true
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ reportInfo:{},
|
|
|
+ showReportBaseInfo:false,
|
|
|
+
|
|
|
+ compList:[
|
|
|
+ {
|
|
|
+ compId:1,
|
|
|
+ compType:'text',
|
|
|
+ icon:require('@/assets/img/smartReport/icon10.png')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ compId:2,
|
|
|
+ compType:'img',
|
|
|
+ icon:require('@/assets/img/smartReport/icon11.png')
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // compId:3,
|
|
|
+ // compType:'chart',
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // compId:4,
|
|
|
+ // compType:'sheet',
|
|
|
+ // }
|
|
|
+
|
|
|
+ ],
|
|
|
+ conList:[],
|
|
|
+ activeId:'',
|
|
|
+ activeContent:'',
|
|
|
+ activePindex:'',
|
|
|
+ activeCindex:'',
|
|
|
+ showRight:false,
|
|
|
+ rightType:'',
|
|
|
+
|
|
|
+ timer:null,//自动保存定时器
|
|
|
+
|
|
|
+ showDSFB:false,//显示定时发布弹窗
|
|
|
+ taskTime:'',//定时发布的时间
|
|
|
+ timePickerOpt:{
|
|
|
+ disabledDate(e){
|
|
|
+ return e.getTime()< new Date().getTime()-24 * 60 * 60 * 1000
|
|
|
+ },
|
|
|
+ selectableRange:'00:00:00 - 23:59:59',
|
|
|
+ format:'HH:mm'
|
|
|
+ },
|
|
|
+
|
|
|
+ contentChange:false,//内容是否发生变化
|
|
|
+
|
|
|
+ isDragResize:false,//是否正在拖动缩放
|
|
|
+
|
|
|
+ bgColor:'',//背景色
|
|
|
+ headImg:'',//版头图片
|
|
|
+ endImg:'',//版尾图片
|
|
|
+ headImgId:0,//版头Id
|
|
|
+ endImgId:0,//版尾Id
|
|
|
+ headImgStyle:'',//版头style
|
|
|
+ endImgStyle:'',//版尾style
|
|
|
+ layoutBaseInfo:{
|
|
|
+ 研报标题:'',
|
|
|
+ 研报作者:'',
|
|
|
+ 创建时间:''
|
|
|
+ },
|
|
|
+
|
|
|
+ isLeftWrapShow: true,//展开章节区
|
|
|
+
|
|
|
+ reportCoopType: 0,//协作类型 1单人 2章节报告
|
|
|
+ selectChapterId: 0, //选中章节Id
|
|
|
+ editChapterId: 0,//编辑章节Id
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 当前章节信息 */
|
|
|
+ handleChapterInfo({ selectChapterId,editChapterId }) {
|
|
|
+ this.timer && clearInterval(this.timer);
|
|
|
+
|
|
|
+ this.selectChapterId = selectChapterId;
|
|
|
+ this.editChapterId = editChapterId;
|
|
|
+ this.showRight = false;
|
|
|
+
|
|
|
+ this.getChapterDetail()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取章节报告详情 */
|
|
|
+ async getChapterDetail() {
|
|
|
+ if(!this.selectChapterId) return
|
|
|
+
|
|
|
+ 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):[]
|
|
|
+
|
|
|
+ $('.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
|
|
|
+ if(!document.getElementById('report-html-content')){
|
|
|
+ this.timer && clearInterval(this.timer);
|
|
|
+ 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:this.formatContentListElData(),
|
|
|
+ })
|
|
|
+ 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,
|
|
|
+ chapterId: this.reportInfo.ReportChapterId,
|
|
|
+ type:'previewChapter'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.open(href, '_blank');
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 单章节发布 */
|
|
|
+ async handlePublishChapter() {
|
|
|
+
|
|
|
+ const res = await publishChapterReport({
|
|
|
+ ReportChapterId: this.reportInfo.ReportChapterId
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.$message.success(this.$t('MsgPrompt.submit_msg'))
|
|
|
+
|
|
|
+ this.$refs.chapterContRef&&this.$refs.chapterContRef.getChapterList()
|
|
|
+
|
|
|
+ // this.$refs.chapterContRef.handleMarkOver(this.reportInfo.ReportChapterId)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.timer && clearInterval(this.timer);
|
|
|
+ // this.$router.replace({ path: '/reportNew' });
|
|
|
+ // }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 表格标题可修改,保存时获取每个sheet最新的title存进conList */
|
|
|
+ formatContentListElData() {
|
|
|
+ let newList = this.conList.map(_ => {
|
|
|
+ if(_.compId===4) {
|
|
|
+ let params = GetQueryString(_.content);
|
|
|
+ let titleText = ($(`.title_iframe${params.code}`)
|
|
|
+ &&$(`.title_iframe${params.code}`)[0])
|
|
|
+ ?$(`.title_iframe${params.code}`)[0].innerText
|
|
|
+ :'';
|
|
|
+
|
|
|
+ return {
|
|
|
+ ..._,
|
|
|
+ titleText
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return _
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // console.log(newList)
|
|
|
+ this.contentChange = JSON.stringify(newList)===JSON.stringify(this.conList) ? this.contentChange : true;
|
|
|
+ return JSON.stringify(newList)
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCheckClassifyNameArr(arr) {
|
|
|
+ this.checkClassifyNameArr(1,arr)
|
|
|
+ },
|
|
|
+
|
|
|
+ //清空内容
|
|
|
+ handleClearContent() {
|
|
|
+ document.getElementById('report-html-content').innerHTML = '';
|
|
|
+ this.conList = [];
|
|
|
+ this.bgColor =''//背景色
|
|
|
+ this.headImg = ''//版头图片
|
|
|
+ this.endImg = ''//版尾图片
|
|
|
+ this.headImgId = 0//版头Id
|
|
|
+ this.endImgId = 0//版尾Id
|
|
|
+ },
|
|
|
+
|
|
|
+ // 大盒子的高度缩放
|
|
|
+ handleResizeP(e,index){
|
|
|
+ this.isDragResize=true
|
|
|
+ e.preventDefault()
|
|
|
+ const parentBox=e.target.parentNode.parentNode
|
|
|
+ const parentBoxWidth=parentBox.offsetWidth
|
|
|
+
|
|
|
+ const targetBox=e.target.parentNode
|
|
|
+ const targetBoxHeight=targetBox.offsetHeight
|
|
|
+ const targetBoxWidth=targetBox.offsetWidth
|
|
|
+
|
|
|
+ const startY=e.clientY
|
|
|
+ const startX=e.clientX
|
|
|
+ document.onmousemove=(mouseEl)=>{
|
|
|
+ mouseEl.preventDefault()
|
|
|
+ const h=mouseEl.clientY-startY+targetBoxHeight
|
|
|
+ // targetBox.style.minHeight=`${h<50?50:h}px`
|
|
|
+ targetBox.style.height=`${h}px`
|
|
|
+
|
|
|
+ // 去除minhight
|
|
|
+ targetBox.style.minHeight=`10px`
|
|
|
+
|
|
|
+ // 计算宽度
|
|
|
+ const w=mouseEl.clientX-startX+targetBoxWidth
|
|
|
+ const resW= (w/parentBoxWidth)*100//计算出的百分比结果值
|
|
|
+ targetBox.style.width=`${resW>=100?100:resW}%`
|
|
|
+ }
|
|
|
+ document.onmouseup=(el)=>{
|
|
|
+ console.log(targetBox.style.cssText);
|
|
|
+ this.$set(this.conList[index],'style',targetBox.style.cssText)
|
|
|
+ el.preventDefault()
|
|
|
+ document.onmousemove=null
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isDragResize=false
|
|
|
+ }, 50);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 内部元素的缩放
|
|
|
+ handleResizeC(e,index,cindex,type){
|
|
|
+ this.isDragResize=true
|
|
|
+ e.preventDefault()
|
|
|
+ const parentBox=e.target.parentNode.parentNode
|
|
|
+ const parentBoxWidth=parentBox.offsetWidth
|
|
|
+ console.log(e);
|
|
|
+ const targetBox=e.target.parentNode
|
|
|
+ const targetBoxHeight=targetBox.offsetHeight
|
|
|
+ const targetBoxWidth=targetBox.offsetWidth
|
|
|
+ const startY=e.clientY
|
|
|
+ const startX=e.clientX
|
|
|
+ const initW=targetBoxWidth //拖动前要拖动盒子所占的宽度
|
|
|
+
|
|
|
+ let computerW=0//存放其他兄弟节点要改变的宽度的值
|
|
|
+
|
|
|
+ document.onmousemove=(mouseEl)=>{
|
|
|
+ mouseEl.preventDefault()
|
|
|
+ const h=mouseEl.clientY-startY+targetBoxHeight
|
|
|
+ // 计算宽度
|
|
|
+ const w=type==='rb'?mouseEl.clientX-startX+targetBoxWidth:startX-mouseEl.clientX+targetBoxWidth
|
|
|
+ const resW= (w/parentBoxWidth)*100//计算出的百分比结果值
|
|
|
+ targetBox.style.width=resW+'%'
|
|
|
+ targetBox.style.flex='none'
|
|
|
+
|
|
|
+ // 处理兄弟盒子的宽度
|
|
|
+ const changeW=w-initW //宽度变化值
|
|
|
+ computerW=changeW
|
|
|
+ if(parentBox.childNodes.length===3){
|
|
|
+ computerW=changeW/2
|
|
|
+ }
|
|
|
+ // console.log('改变的宽度',computerW);
|
|
|
+
|
|
|
+ // targetBox.style.height=`${h<50?50:h}px`
|
|
|
+ targetBox.style.height=`${h}px`
|
|
|
+ }
|
|
|
+ document.onmouseup=(el)=>{
|
|
|
+ if(document.onmousemove){
|
|
|
+ parentBox.childNodes.forEach(item=>{
|
|
|
+ if(item!==targetBox){
|
|
|
+ const temw=item.offsetWidth-computerW
|
|
|
+ item.style.width=((temw/parentBoxWidth)*100)+'%'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 存储修改的值
|
|
|
+ parentBox.childNodes.forEach((item,idx)=>{
|
|
|
+ this.$set(this.conList[index].child[idx],'style',item.style.cssText)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ el.preventDefault()
|
|
|
+ document.onmousemove=null
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isDragResize=false
|
|
|
+ document.onmouseup=null
|
|
|
+ }, 50);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 跳转预览
|
|
|
+ handlePreviewReport(){
|
|
|
+ sessionStorage.removeItem('smartReportContent');
|
|
|
+ sessionStorage.removeItem('smartReportContentBg');
|
|
|
+
|
|
|
+ if(document.getElementById('report-html-content')) {
|
|
|
+ const htmlStr=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
|
|
|
+ sessionStorage.setItem('smartReportContent', htmlStr);
|
|
|
+ sessionStorage.setItem('smartReportContentBg', this.bgColor);
|
|
|
+ }
|
|
|
+ let { href } = this.$router.resolve({
|
|
|
+ path: '/smartReportDetail',
|
|
|
+ query:{
|
|
|
+ id:this.$route.query.id,
|
|
|
+ type:'preview'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.open(href, '_blank');
|
|
|
+ },
|
|
|
+
|
|
|
+ // 批量插入myETA数据
|
|
|
+ handleImportMyChart(list){
|
|
|
+ const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
|
|
|
+ // console.log(list);
|
|
|
+ let arr=[]
|
|
|
+ // 分成两个一组
|
|
|
+ for (let index = 0; index < list.length; index+=2) {
|
|
|
+ const temarr=list.slice(index,index+2)
|
|
|
+ let resArr={child:[]}
|
|
|
+ if(temarr.length===1){//落单了
|
|
|
+ resArr={
|
|
|
+ compId:3,
|
|
|
+ compType:'chart',
|
|
|
+ content:`${LINK_CHART_URL}?code=${temarr[0].UniqueCode}&lang=${this.currentLang}`,
|
|
|
+ id:this.getCompId(`chart${temarr[0].UniqueCode}_`),
|
|
|
+ style:'height:350px',
|
|
|
+ child:[]
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ temarr.forEach(e => {
|
|
|
+ resArr.child.push({
|
|
|
+ compId:3,
|
|
|
+ compType:'chart',
|
|
|
+ content:`${LINK_CHART_URL}?code=${e.UniqueCode}`,
|
|
|
+ id:this.getCompId(`chart${e.UniqueCode}_`),
|
|
|
+ style:'height:350px',
|
|
|
+ child:[]
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ arr.push(resArr)
|
|
|
+ }
|
|
|
+ // console.log(arr);
|
|
|
+ this.conList=[...this.conList,...arr]
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // 设置sheet iframe 样式
|
|
|
+ setSheetIframeStyle(e){
|
|
|
+ const { height, code } = e.data;
|
|
|
+ // console.log(e.data);
|
|
|
+ let iframeDom = document.getElementsByClassName(`iframe${code}`);
|
|
|
+ // console.log(iframeDom);
|
|
|
+ iframeDom.forEach((ele) => {
|
|
|
+ ele.height = `${height}px`;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleParentAdd(e){
|
|
|
+ console.log('container-onAdd操作------------------->');
|
|
|
+
|
|
|
+ const {item,newDraggableIndex}=e
|
|
|
+
|
|
|
+ const hasid=item.getAttribute('data-id')
|
|
|
+ console.log(hasid);
|
|
|
+
|
|
|
+ this.conList.forEach(item=>{
|
|
|
+ if(item.id==hasid&&item.style){
|
|
|
+ const styleArr=item.style.split(';').filter(s=>s&&(s.indexOf('width')===-1&&s.indexOf('flex')===-1)).join(';')
|
|
|
+ item.style=styleArr
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(hasid) return
|
|
|
+
|
|
|
+ // 要添加的元素数据
|
|
|
+ const compData=JSON.parse(item.getAttribute('comp-data'))
|
|
|
+ // console.log(compData);
|
|
|
+ // 非注册组件返回
|
|
|
+ // if(!comp){
|
|
|
+ // this.conList.splice(newDraggableIndex,1)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ const tempCompData={
|
|
|
+ compId:compData.compId,
|
|
|
+ compType:compData.compType,
|
|
|
+ id:this.getCompId(compData.compType),
|
|
|
+ content:compData.content||'',
|
|
|
+ titleText: compData.compId===4?compData.title:'',
|
|
|
+ style:compData.compType==='chart'?'height:350px':'',
|
|
|
+ child:[]
|
|
|
+ }
|
|
|
+ // console.log(tempCompData);
|
|
|
+ this.conList.splice(newDraggableIndex,1,tempCompData)
|
|
|
+ // this.activeId=tempCompData.id
|
|
|
+ },
|
|
|
+
|
|
|
+ handleChildAdd(e,parent,parentIndex){
|
|
|
+ console.log('child-onAdd操作------------------->');
|
|
|
+ // console.log(parent);
|
|
|
+ const {item,newDraggableIndex}=e
|
|
|
+
|
|
|
+ const compData=JSON.parse(item.getAttribute('comp-data'))
|
|
|
+
|
|
|
+ console.log(compData,newDraggableIndex);
|
|
|
+
|
|
|
+ const index=parentIndex
|
|
|
+ // if(index>-1){
|
|
|
+ let obj=_.cloneDeep(this.conList[index])
|
|
|
+
|
|
|
+ console.log(obj);
|
|
|
+
|
|
|
+ if(obj.child&&obj.child.length===1&&obj.id){
|
|
|
+ if(compData){
|
|
|
+ obj={
|
|
|
+ child:[
|
|
|
+ {
|
|
|
+ compId:obj.compId,
|
|
|
+ compType:obj.compType,
|
|
|
+ id:obj.id,
|
|
|
+ content:obj.content,
|
|
|
+ titleText: obj.compId===4?obj.titleText:'',
|
|
|
+ style:obj.compType==='chart'?'height:350px':'',
|
|
|
+ child:[]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ compId:compData.compId,
|
|
|
+ compType:compData.compType,
|
|
|
+ content:compData.content||'',
|
|
|
+ id:this.getCompId(compData.compType),
|
|
|
+ titleText: compData.compId===4?compData.title:'',
|
|
|
+ style:compData.compType==='chart'?'height:350px':'',
|
|
|
+ child:[]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }else{//是内容区域拖动排序的
|
|
|
+ const temItem=_.cloneDeep(obj.child[0])
|
|
|
+ if(temItem.child.length>0){//如果拖动的盒子里面有子元素则不能进入
|
|
|
+ obj={
|
|
|
+ ...obj,
|
|
|
+ child:[]
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.conList.splice(index,0,temItem)
|
|
|
+ }, 50);
|
|
|
+ }else{
|
|
|
+ obj={
|
|
|
+ child:[
|
|
|
+ {
|
|
|
+ compId:obj.compId,
|
|
|
+ compType:obj.compType,
|
|
|
+ id:obj.id,
|
|
|
+ content:obj.content,
|
|
|
+ titleText: obj.compId===4?obj.titleText:'',
|
|
|
+ style:obj.compType==='chart'?'height:350px':'',
|
|
|
+ child:[]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ...temItem
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if(compData){//如果是从内容区域拖入的没有compData
|
|
|
+ obj.child.splice(newDraggableIndex,1,{
|
|
|
+ compId:compData.compId,
|
|
|
+ compType:compData.compType,
|
|
|
+ content:compData.content||'',
|
|
|
+ id:this.getCompId(compData.compType),
|
|
|
+ titleText: compData.compId===4?compData.title:'',
|
|
|
+ style:compData.compType==='chart'?'height:350px':'',
|
|
|
+ child:[]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(obj);
|
|
|
+
|
|
|
+ this.conList.splice(index,1,obj)
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleParentMove(e){
|
|
|
+ // console.log(e.draggedContext);
|
|
|
+ // console.log(e.relatedContext);
|
|
|
+ // // console.log(e.relatedContext.compType);
|
|
|
+ // console.log(e.draggedContext.element.child.length>0&&!e.relatedContext.compType);
|
|
|
+ // if(e.draggedContext.element.child.length>0&&(!e.relatedContext.compType||e.relatedContext.element.compType)) return false
|
|
|
+ },
|
|
|
+
|
|
|
+ // 移除事件
|
|
|
+ handleChildRemove(e,arr){
|
|
|
+ console.log('child-remove操作------------------->');
|
|
|
+ // 如果都移除了则删除这个
|
|
|
+ // this.conList=this.conList.filter(_item=>!(_item.child&&_item.child.length===0&&!_item.id))
|
|
|
+
|
|
|
+ // 如果当前移出的这个child还有两个的话则重置他们的宽度
|
|
|
+ arr.forEach(item=>{
|
|
|
+ if(item.style){
|
|
|
+ const styleArr=item.style.split(';').filter(s=>s&&(s.indexOf('width')===-1&&s.indexOf('flex')===-1)).join(';')
|
|
|
+ item.style=styleArr
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ // 如果child只剩一个了则移出来
|
|
|
+ this.conList=this.conList.map(_item=>{
|
|
|
+ if(_item.child&&_item.child.length===1){
|
|
|
+ const obj=_item.child[0]
|
|
|
+ if(obj.style){
|
|
|
+ const styleArr=obj.style.split(';').filter(s=>s&&(s.indexOf('width')===-1&&s.indexOf('flex')===-1)).join(';')
|
|
|
+ obj.style=styleArr
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ }else{
|
|
|
+ return _item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleParentRemove(e){
|
|
|
+ console.log('container-remove操作------------------->');
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击删除某个
|
|
|
+ handleDelItem(pindex,cindex){
|
|
|
+ if(cindex===-1){
|
|
|
+ this.conList.splice(pindex,1)
|
|
|
+ }else{//删除子盒子
|
|
|
+ this.conList[pindex].child.splice(cindex,1)
|
|
|
+ if(this.conList[pindex].child.length===1){//只剩一个子盒子了则变成一个大盒子
|
|
|
+ const styleArr=this.conList[pindex].child[0].style.split(';').filter(s=>s&&(s.indexOf('width')===-1&&s.indexOf('flex')===-1)).join(';')
|
|
|
+ this.conList[pindex]=this.conList[pindex].child[0]
|
|
|
+ this.conList[pindex].style=styleArr
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 富文本编辑组件/图片组件数据变化
|
|
|
+ handleTextChange(e){
|
|
|
+ console.log(e);
|
|
|
+ this.activeContent=e
|
|
|
+ if(this.activeCindex>=0&&this.activeCindex!==''){
|
|
|
+ if(this.conList[this.activePindex].child[this.activeCindex].content){
|
|
|
+ this.conList[this.activePindex].child[this.activeCindex].content=e
|
|
|
+ }else{
|
|
|
+ this.$set(this.conList[this.activePindex].child[this.activeCindex],'content',e)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(this.conList[this.activePindex].content){
|
|
|
+ this.conList[this.activePindex].content=e
|
|
|
+ }else{
|
|
|
+ this.$set(this.conList[this.activePindex],'content',e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 当前再编辑哪个
|
|
|
+ handleChoose(item,index,cindex){
|
|
|
+ //{item:数据,index:父序号,cindex:子序号}
|
|
|
+ if(!item.id||this.isDragResize||!['text','img'].includes(item.compType)) return
|
|
|
+ this.activeId=item.id
|
|
|
+ this.showRight=true
|
|
|
+ this.rightType=item.compType
|
|
|
+ this.activeContent=item.content||''
|
|
|
+ this.activePindex=index
|
|
|
+ this.activeCindex=cindex>=0?cindex:''
|
|
|
+ },
|
|
|
+
|
|
|
+ //点击顶部插入图或者图表等类型
|
|
|
+ handleShowRight(item){
|
|
|
+ this.rightType=item.type
|
|
|
+ this.activeId=''
|
|
|
+ this.activeContent=''
|
|
|
+ this.activePindex=''
|
|
|
+ this.activeCindex=''
|
|
|
+ this.showRight=true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 关闭右侧
|
|
|
+ handleCloseRight(){
|
|
|
+ this.activeId=''
|
|
|
+ this.activeContent=''
|
|
|
+ this.activePindex=''
|
|
|
+ this.activeCindex=''
|
|
|
+ this.showRight=false
|
|
|
+ this.rightType=''
|
|
|
+ },
|
|
|
+
|
|
|
+ getComponentName(item){
|
|
|
+ const temMap=new Map([
|
|
|
+ ['text',TextComp],
|
|
|
+ ['chart',ChartComp],
|
|
|
+ ['img',ImgComp],
|
|
|
+ ['sheet',SheetComp]
|
|
|
+ ])
|
|
|
+ return temMap.get(item.compType)
|
|
|
+ },
|
|
|
+ // 生产随机id
|
|
|
+ getCompId(type){
|
|
|
+ return type+new Date().getTime()
|
|
|
+ },
|
|
|
+
|
|
|
+ // 编辑保存信息
|
|
|
+ handleReportEdit(e){
|
|
|
+
|
|
|
+ const params={
|
|
|
+ ...e,
|
|
|
+ ReportId:Number(this.$route.query.id)||0
|
|
|
+ }
|
|
|
+ console.log(params);
|
|
|
+ //检查classifynameArr是否有审批流
|
|
|
+ let classify = [e.ClassifyIdFirst,e.ClassifyIdSecond,e.ClassifyIdThird]
|
|
|
+ this.handleCheckClassifyNameArr(classify)
|
|
|
+
|
|
|
+ reportedit({...params}).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success(this.$t('MsgPrompt.saved_msg'))
|
|
|
+
|
|
|
+ if(this.reportCoopType === 1) {
|
|
|
+ this.reportInfo.Title=params.Title
|
|
|
+ this.layoutBaseInfo['研报标题']=params.Title
|
|
|
+ this.layoutBaseInfo['研报作者']=params.Author
|
|
|
+ // this.layoutBaseInfo['创建时间']=params.PublishTime
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取动态配置 外部动态链接 */
|
|
|
+ async getPublicSettings() {
|
|
|
+ const res = await getPublicSettingsApi();
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.$store.commit('SET_DYNAMIC_LINK',res.Data)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取报告详情
|
|
|
+ getReportDetail(){
|
|
|
+ const id=this.$route.query.id||0
|
|
|
+ if(!id) return
|
|
|
+
|
|
|
+ reportdetail({
|
|
|
+ ReportId:Number(id)
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.reportInfo=res.Data
|
|
|
+
|
|
|
+ if(res.Data.PrePublishTime){
|
|
|
+ this.taskTime=res.Data.PrePublishTime
|
|
|
+ }
|
|
|
+
|
|
|
+ this.conList=res.Data.ContentStruct?JSON.parse(res.Data.ContentStruct):[]
|
|
|
+ this.headImg=res.Data.HeadImg
|
|
|
+ this.endImg=res.Data.EndImg
|
|
|
+ this.headImgId=res.Data.HeadResourceId
|
|
|
+ this.endImgId=res.Data.EndResourceId
|
|
|
+
|
|
|
+ this.headImgStyle=res.Data.HeadStyle?JSON.parse(res.Data.HeadStyle):[]
|
|
|
+ this.headImgStyle.map(st =>{
|
|
|
+ st.value=st.value || st.label
|
|
|
+ })
|
|
|
+ this.endImgStyle=res.Data.EndStyle?JSON.parse(res.Data.EndStyle):[]
|
|
|
+ this.endImgStyle.map(st =>{
|
|
|
+ st.value=st.value || st.label
|
|
|
+ })
|
|
|
+ this.bgColor=res.Data.CanvasColor
|
|
|
+ this.layoutBaseInfo['研报标题']=res.Data.Title
|
|
|
+ this.layoutBaseInfo['研报作者']=res.Data.Author
|
|
|
+ // this.layoutBaseInfo['创建时间']=res.Data.PublishTime
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.contentChange=false
|
|
|
+ })
|
|
|
+ let classify = [res.Data.ClassifyIdFirst,res.Data.ClassifyIdSecond]
|
|
|
+ this.handleCheckClassifyNameArr(classify)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 刷新所有图表和表格
|
|
|
+ handleRefreshAllChart: _.debounce ( async function() {
|
|
|
+ let code_arr = [];
|
|
|
+ let sheet_code_arr = []
|
|
|
+ $('iframe').each((k,i) => {
|
|
|
+ try {
|
|
|
+ let href = $(i).attr('src');
|
|
|
+ if(href.includes('chartshow')){
|
|
|
+ code_arr.push(getUrlParams(href,'code'));
|
|
|
+ }
|
|
|
+ if(href.includes('sheetshow')){
|
|
|
+ sheet_code_arr.push(getUrlParams(href,'code'))
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(!code_arr.length&&!sheet_code_arr.length) return this.$message.warning(this.$t('ReportManage.ReportList.insert_charts_msg'));
|
|
|
+
|
|
|
+ if(this.$route.query.id&&code_arr.length) {
|
|
|
+ let res = await dataBaseInterface.getReportrefreshStatus({
|
|
|
+ Source: 'report',
|
|
|
+ PrimaryId: Number(this.$route.query.id),
|
|
|
+ SubId: this.reportInfo.ReportChapterId
|
|
|
+ });
|
|
|
+
|
|
|
+ if(!res.Data.RefreshResult) return this.$message.warning(this.$t('ReportManage.ReportList.chart_refreshed_msg'))
|
|
|
+
|
|
|
+ const { Ret,Msg } = await dataBaseInterface.reportRefresh({
|
|
|
+ ChartInfoCode: code_arr,
|
|
|
+ Source: 'report',
|
|
|
+ PrimaryId: Number(this.$route.query.id),
|
|
|
+ SubId: this.reportInfo.ReportChapterId
|
|
|
+ })
|
|
|
+
|
|
|
+ if(Ret === 200) {
|
|
|
+ $('iframe').each((k,i) => {
|
|
|
+ let href = $(i).attr('src');
|
|
|
+ if(href.includes('chartshow')){
|
|
|
+ $(i).attr('src',$(i).attr('src'))
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$message.success(Msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.$route.query.id&&sheet_code_arr.length){
|
|
|
+ //获取刷新结果
|
|
|
+ let res = await sheetInterface.getRefreshResult({
|
|
|
+ Source: 'report',
|
|
|
+ PrimaryId: Number(this.$route.query.id),
|
|
|
+ SubId: this.reportInfo.ReportChapterId
|
|
|
+ });
|
|
|
+ if(!res.Data.RefreshResult) return this.$message.warning(/* '表格正在刷新中,请勿重复操作' */this.$t('ReportManage.ReportList.chart_refreshed_msg'))
|
|
|
+ const { Ret,Msg } = await sheetInterface.refreshSheet({
|
|
|
+ ExcelCodes: sheet_code_arr,
|
|
|
+ Source: 'report',
|
|
|
+ PrimaryId: Number(this.$route.query.id),
|
|
|
+ SubId: this.reportInfo.ReportChapterId
|
|
|
+ })
|
|
|
+
|
|
|
+ if(Ret === 200) {
|
|
|
+ $('iframe').each((k,i) => {
|
|
|
+ let href = $(i).attr('src');
|
|
|
+ if(href.includes('sheetshow')){
|
|
|
+ $(i).attr('src',$(i).attr('src'))
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$message.success(Msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },1000),
|
|
|
+
|
|
|
+ // 自动/存草稿保存内容
|
|
|
+ handleSaveContent({isAutoSave}){
|
|
|
+ const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
+ const id=this.$route.query.id||0
|
|
|
+ if(!id) return
|
|
|
+
|
|
|
+ let imgParams = {
|
|
|
+ HeadImg: this.reportCoopType===1?this.headImg:this.$refs.chapterContRef.reportBase.HeadImg,
|
|
|
+ EndImg:this.reportCoopType===1?this.endImg:this.$refs.chapterContRef.reportBase.EndImg,
|
|
|
+ HeadResourceId:this.reportCoopType===1?this.headImgId:this.$refs.chapterContRef.reportBase.HeadResourceId,
|
|
|
+ EndResourceId:this.reportCoopType===1?this.endImgId:this.$refs.chapterContRef.reportBase.EndResourceId,
|
|
|
+ CanvasColor:this.reportCoopType===1?this.bgColor:this.$refs.chapterContRef.reportBase.CanvasColor
|
|
|
+ }
|
|
|
+
|
|
|
+ autosave({
|
|
|
+ ReportId: Number(this.$route.query.id),
|
|
|
+ Content:html,
|
|
|
+ ContentStruct:this.formatContentListElData(),
|
|
|
+ NoChange:this.contentChange?2:1,
|
|
|
+ ...imgParams
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ resolve(true)
|
|
|
+ if(!isAutoSave){
|
|
|
+ this.$message.success(this.$t('MsgPrompt.saved_msg'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击定时发布/发布
|
|
|
+ async handlePublishOpt(type){
|
|
|
+ if(document.getElementById('report-html-content')) {
|
|
|
+ // 存一次草稿
|
|
|
+ const saveRes=await this.handleSaveContent({isAutoSave:true})
|
|
|
+ if(!saveRes) return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(type==='dsfb'){
|
|
|
+ this.showDSFB=true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 发布
|
|
|
+ if(type==='submit'){
|
|
|
+ this.submitReport()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //截止至ETA1.3.8 智能研报无推送模板消息,所有的reportInfo.MsgIsSend都为1
|
|
|
+ let sendMsg = this.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.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.reportPublish({sendMsg:false})
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //confirmButton
|
|
|
+ this.reportPublish({sendMsg:isPost?true:false})
|
|
|
+ }
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交报告
|
|
|
+ submitReport(){
|
|
|
+ this.$confirm(this.$t('ReportManage.smart_msg.submit_approval'),this.$t('Confirm.prompt'),{
|
|
|
+ confirmButtonText: this.$t('Dialog.confirm_btn'),
|
|
|
+ cancelButtonText: this.$t('Dialog.cancel_btn'),
|
|
|
+ type:'warning',
|
|
|
+ }).then(()=>{
|
|
|
+
|
|
|
+ approveInterence.reportCnSubmit({
|
|
|
+ ReportId:Number(this.$route.query.id)
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.$message.success(this.$t('ReportManage.smart_msg.submit_success'))
|
|
|
+ this.$router.replace({ path: '/reportNew' });
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 定时发布报告
|
|
|
+ async handleSetReportPrepublish(){
|
|
|
+ if(!this.taskTime){
|
|
|
+ this.$message.warning(this.$t('ReportManage.smart_msg.select_push_time'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const now=this.$moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ // console.log(now);
|
|
|
+ // console.log(this.taskTime);
|
|
|
+ if(this.$moment(this.taskTime).isBefore(now,'second')){
|
|
|
+ this.$message.warning(this.$t('ReportManage.smart_msg.than_current_time'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 如果该报告已经推送过模板消息
|
|
|
+ let sendMsg = this.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()
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
|
|
|
+ this.$router.replace({ path: '/reportNew' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 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'),
|
|
|
+ cancelButtonText: isPost?this.$t('ReportManage.smart_btn.not_push'):this.$t('Dialog.cancel_btn'),
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose:true,
|
|
|
+ beforeClose:(action, instance,done)=>{
|
|
|
+ console.log(action, instance);
|
|
|
+ if(action==='close'||action==='cancel') {
|
|
|
+ //右上角或者不推送
|
|
|
+ if(isPost){
|
|
|
+ reportSetPrepublish({
|
|
|
+ ReportId:Number(this.$route.query.id),
|
|
|
+ PrePublishTime:this.taskTime,
|
|
|
+ PreMsgSend:0,
|
|
|
+ ReportUrl:this.generatePdfLinks()
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
|
|
|
+ this.$router.replace({ path: '/reportNew' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //confirmButton
|
|
|
+ reportSetPrepublish({
|
|
|
+ ReportId:Number(this.$route.query.id),
|
|
|
+ PrePublishTime:this.taskTime,
|
|
|
+ PreMsgSend:isPost?1:0,
|
|
|
+ ReportUrl:this.generatePdfLinks()
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success(this.$t('ReportManage.smart_msg.timed_success'))
|
|
|
+ this.$router.replace({ path: '/reportNew' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 发布报告
|
|
|
+ reportPublish({sendMsg}){
|
|
|
+ reportpublish({
|
|
|
+ ReportIds:String(this.$route.query.id),
|
|
|
+ ReportUrl:this.generatePdfLinks()
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ if(sendMsg){
|
|
|
+ this.reportSendMsg()
|
|
|
+ }
|
|
|
+ this.$message.success(this.$t('MsgPrompt.publish_msg'))
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.replace({ path: '/reportNew' });
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ generatePdfLinks(){
|
|
|
+ const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
+ let waterMarkStr= localStorage.getItem('waterMarkStr') || '';
|
|
|
+
|
|
|
+ let code = this.reportCoopType===2?this.$refs.chapterContRef&&this.$refs.chapterContRef.reportBase.ReportCode:this.reportInfo.ReportCode
|
|
|
+
|
|
|
+ return `${baseUrl}/reportshare_smart_pdf?code=${code}&flag=${waterMarkStr}`
|
|
|
+ },
|
|
|
+ //报告消息推送
|
|
|
+ reportSendMsg(){
|
|
|
+ reportMessageSend({ReportId:Number(this.$route.query.id)}).then(res=>{})
|
|
|
+ },
|
|
|
+
|
|
|
+ // 插入版头版尾
|
|
|
+ handleInsertImgSource(e){
|
|
|
+ console.log(e,'eeee');
|
|
|
+ if(e.type=='1'){
|
|
|
+ this.$message.success(this.$t('ReportManage.ReportList.header_setting_msg'))
|
|
|
+ this.headImg=e.data.ImgUrl
|
|
|
+ this.headImgId = e.data.ResourceId
|
|
|
+ this.headImgStyle=e.data.Style?JSON.parse(e.data.Style):[]
|
|
|
+ }else{
|
|
|
+ this.$message.success(this.$t('ReportManage.ReportList.trailer_setting_msg'))
|
|
|
+ this.endImg=e.data.ImgUrl
|
|
|
+ this.endImgId = e.data.ResourceId
|
|
|
+ this.endImgStyle=e.data.Style?JSON.parse(e.data.Style):[]
|
|
|
+ }
|
|
|
+ this.contentChange=true
|
|
|
+ },
|
|
|
+
|
|
|
+ handleBgColorChange(e){
|
|
|
+ this.bgColor=e||''
|
|
|
+ this.contentChange=true
|
|
|
+ },
|
|
|
+ // 删除版头版尾
|
|
|
+ deleteLayoutPic(type){
|
|
|
+ if(type=='1'){
|
|
|
+ this.headImg=''
|
|
|
+ this.headImgId = 0
|
|
|
+ }else{
|
|
|
+ this.endImg=''
|
|
|
+ this.endImgId = 0
|
|
|
+ }
|
|
|
+ this.contentChange=true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ topTypeList(){
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ 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')
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+
|
|
|
+ //语言版本
|
|
|
+ currentLang() {
|
|
|
+ return this.$store.state.lang
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getPublicSettings()
|
|
|
+ this.reportCoopType = Number(this.$route.query.coopType)
|
|
|
+ this.reportCoopType===1 && this.getReportDetail()
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ window.addEventListener('message',this.setSheetIframeStyle)
|
|
|
+ if(this.reportCoopType===1) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.handleSaveContent({isAutoSave:true});
|
|
|
+ }, 6000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ window.removeEventListener('message',this.setSheetIframeStyle)
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ }
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+// 拖拽时的样式
|
|
|
+.edit-smart-report-page{
|
|
|
+.sortable-ghost{
|
|
|
+ position: relative !important;
|
|
|
+ &::before{
|
|
|
+ content: '' !important;
|
|
|
+ display: block !important;
|
|
|
+ width: 100% !important;
|
|
|
+ height: 10px !important;
|
|
|
+ background-color: rgba(64, 158, 255, 0.74) !important;
|
|
|
+ position: absolute !important;
|
|
|
+ left: 0 !important;
|
|
|
+ top: 0 !important;
|
|
|
+ }
|
|
|
+ // height: 5px !important;
|
|
|
+ // background-color: #0052D9 !important;
|
|
|
+ // overflow: hidden !important;
|
|
|
+ // padding: 0 !important;
|
|
|
+ // min-height: 0 !important;
|
|
|
+ // border: none !important;
|
|
|
+}
|
|
|
+
|
|
|
+.el-color-picker__trigger{
|
|
|
+ &::after{
|
|
|
+ content:'';
|
|
|
+ display: block;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .el-color-picker__color::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ position: absolute;
|
|
|
+ left: 7px;
|
|
|
+ top: 7px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon18.png');
|
|
|
+ background-size: cover;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ z-index: 10;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang='scss' scoped>
|
|
|
+div{
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.edit-smart-box {
|
|
|
+ display: flex;
|
|
|
+ overflow: hidden;
|
|
|
+ background: var(--unnamed, #F2F6FA);
|
|
|
+
|
|
|
+ .left-wrap {
|
|
|
+ position: relative;
|
|
|
+ .slide-btn-icon {
|
|
|
+ &.slide-left{
|
|
|
+ right:5px;
|
|
|
+ left: auto;
|
|
|
+ }
|
|
|
+ &.slide-right{
|
|
|
+ left: 0;
|
|
|
+ right: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.edit-smart-report-page{
|
|
|
+ /* min-width: 100vw; */
|
|
|
+ min-height: 100vh;
|
|
|
+ flex: 1;
|
|
|
+ overflow: auto;
|
|
|
+ .top-action-wrap{
|
|
|
+ position: sticky;
|
|
|
+ top: 0px;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.10);
|
|
|
+ height: 60px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-content: center;
|
|
|
+ padding: 0 24px;
|
|
|
+ .title{
|
|
|
+ line-height: 60px;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .action-list{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .action-item{
|
|
|
+ height: 36px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-right: 1px solid #C8CDD9;
|
|
|
+ padding: 0 30px;
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ img{
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ margin-right: 4px;
|
|
|
+ position: relative;
|
|
|
+ top: 2px;
|
|
|
+ }
|
|
|
+ &:last-child{
|
|
|
+ border-right: none;
|
|
|
+ }
|
|
|
+ &.disabled{
|
|
|
+ pointer-events: none;
|
|
|
+ cursor: not-allowed;
|
|
|
+ color:#999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .main-wrap{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+.report-action-wrap{
|
|
|
+ width: 800px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 90px;
|
|
|
+ margin-right: 60px;
|
|
|
+ margin-top: 30px;
|
|
|
+ position: relative;
|
|
|
+ .report-comp-wrap{
|
|
|
+ position: absolute;
|
|
|
+ left: -62px;
|
|
|
+ top: 72px;
|
|
|
+ width: 40px;
|
|
|
+ border: 1px solid var(--gary-gy-5-line, #C8CDD9);
|
|
|
+ background: var(--gary-gy-white, #FFF);
|
|
|
+ border-radius: 4px;
|
|
|
+ overflow: hidden;
|
|
|
+ .comp-item{
|
|
|
+ cursor: move;
|
|
|
+ height: 40px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-bottom: 1px solid var(--gary-gy-5-line, #C8CDD9);
|
|
|
+ &:last-child{
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+ img{
|
|
|
+ width: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .top-type-list{
|
|
|
+ margin-bottom: 20px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ background-color: #fff;
|
|
|
+ height: 80px;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid var(--gary-gy-5-line, #C8CDD9);
|
|
|
+ .item{
|
|
|
+ cursor: pointer;
|
|
|
+ flex: auto;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-right: 1px solid #C8CDD9;
|
|
|
+ font-size: 16px;
|
|
|
+ &:last-child{
|
|
|
+ border-right: none;
|
|
|
+ }
|
|
|
+ .icon{
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ // margin-right: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .report-content-box{
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid var(--gary-gy-5-line, #C8CDD9);
|
|
|
+ background: #FFF;
|
|
|
+ padding: 20px 20px 20px 44px;
|
|
|
+ height: calc(100vh - 210px);
|
|
|
+ position: relative;
|
|
|
+ overflow-y: auto;
|
|
|
+ .html-head-img-box,.html-end-img-box{
|
|
|
+ position: relative;
|
|
|
+ &:hover{
|
|
|
+ .opt-btn-box{
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .opt-btn-box{
|
|
|
+ position: absolute;
|
|
|
+ left: -36px;
|
|
|
+ padding-right: 8px;
|
|
|
+ top: 0;
|
|
|
+ .del-btn::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon13.png');
|
|
|
+ background-size: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .head-layout-item{
|
|
|
+ position: absolute;
|
|
|
+ overflow: hidden;
|
|
|
+ box-sizing: border-box
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+.main-wrap{
|
|
|
+ .report-html-wrap{
|
|
|
+ &::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ height: 300px;
|
|
|
+ }
|
|
|
+ min-height: 100%;
|
|
|
+ .report-drag-item-wrap{
|
|
|
+ width: 100%;
|
|
|
+ padding: 6px;
|
|
|
+ min-height: 80px;
|
|
|
+ border: 1px dashed #0052D9;
|
|
|
+ position: relative;
|
|
|
+ margin-bottom: 3px;
|
|
|
+ &:hover{
|
|
|
+ border-style: solid;
|
|
|
+ .opt-btn-box{
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ .resize-drag-box{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .opt-btn-box{
|
|
|
+ position: absolute;
|
|
|
+ left: -36px;
|
|
|
+ padding-right: 8px;
|
|
|
+ top: 0;
|
|
|
+ .drag-btn::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon12.png');
|
|
|
+ background-size: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .del-btn::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon13.png');
|
|
|
+ background-size: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .resize-drag-box{
|
|
|
+ position: absolute;
|
|
|
+ right: -4px;
|
|
|
+ bottom: -4px;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ display: none;
|
|
|
+ border: 1px solid #0052D9;
|
|
|
+ cursor: nw-resize;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .report-drag-item-out{
|
|
|
+ .report-drag-item-wrap_child-wrap{
|
|
|
+ position: absolute;
|
|
|
+ width: 40px;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .report-drag-item-wrap_child-wrap{
|
|
|
+ // min-height: 30px;
|
|
|
+ }
|
|
|
+ .report-drag-item-wrap_child_content{
|
|
|
+ min-height: 80px;
|
|
|
+ border: 1px dashed #0052D9;
|
|
|
+ flex: 1;
|
|
|
+ position: relative;
|
|
|
+ &:hover{
|
|
|
+ border-style: solid;
|
|
|
+ .opt-btn-box2{
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ .resize-drag-box_lt,
|
|
|
+ .resize-drag-box_lb,
|
|
|
+ .resize-drag-box_rt,
|
|
|
+ .resize-drag-box_rb{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .opt-btn-box2{
|
|
|
+ position: absolute;
|
|
|
+ right: -15px;
|
|
|
+ top: 0;
|
|
|
+ z-index: 10;
|
|
|
+ .drag-btn::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon12.png');
|
|
|
+ background-size: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .del-btn::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background-image: url('~@/assets/img/smartReport/icon13.png');
|
|
|
+ background-size: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .resize-drag-box_lt,
|
|
|
+ .resize-drag-box_lb,
|
|
|
+ .resize-drag-box_rt,
|
|
|
+ .resize-drag-box_rb{
|
|
|
+ position: absolute;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ display: none;
|
|
|
+ border: 1px solid #0052D9;
|
|
|
+ }
|
|
|
+ .resize-drag-box_lt{
|
|
|
+ left: -4px;
|
|
|
+ top: -4px;
|
|
|
+ cursor: nw-resize;
|
|
|
+ }
|
|
|
+ .resize-drag-box_lb{
|
|
|
+ left: -4px;
|
|
|
+ bottom: -4px;
|
|
|
+ cursor: ne-resize;
|
|
|
+ }
|
|
|
+ .resize-drag-box_rt{
|
|
|
+ right: -4px;
|
|
|
+ top: -4px;
|
|
|
+ cursor: ne-resize;
|
|
|
+ }
|
|
|
+ .resize-drag-box_rb{
|
|
|
+ right: -4px;
|
|
|
+ bottom: -4px;
|
|
|
+ cursor: nw-resize;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .blue-bg{
|
|
|
+ background: var(--brand-brand-1-light, #ECF2FE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.main-wrap{
|
|
|
+ .right-action-wrap{
|
|
|
+ height: calc(100vh - 60px);
|
|
|
+ overflow: hidden;
|
|
|
+ flex: 1;
|
|
|
+ position: relative;
|
|
|
+ padding-top: 30px;
|
|
|
+ padding-left: 75px;
|
|
|
+ padding-right: 30px;
|
|
|
+ padding-bottom: 30px;
|
|
|
+ &::before{
|
|
|
+ display: block;
|
|
|
+ content: '';
|
|
|
+ width: 1px;
|
|
|
+ height: 100vh;
|
|
|
+ background-color: #C8CDD9;
|
|
|
+ position: absolute;
|
|
|
+ left: 15px;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ .close-icon{
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #FFF;
|
|
|
+ box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ cursor: pointer;
|
|
|
+ position: absolute;
|
|
|
+ left: 5px;
|
|
|
+ top: 22px;
|
|
|
+ img{
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|