|
@@ -8,23 +8,23 @@
|
|
|
<img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
<span>基础信息</span>
|
|
|
</li>
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="handleRefreshAllChart">
|
|
|
<img src="~@/assets/img/smartReport/icon02.png" alt="">
|
|
|
<span>图表刷新 </span>
|
|
|
</li>
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="handlePreviewReport">
|
|
|
<img src="~@/assets/img/smartReport/icon03.png" alt="">
|
|
|
<span>预览</span>
|
|
|
</li>
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="handleSaveContent">
|
|
|
<img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
<span>存草稿</span>
|
|
|
</li>
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="handlePublishOpt('dsfb')">
|
|
|
<img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
<span>定时发布</span>
|
|
|
</li>
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="handlePublishOpt('fb')">
|
|
|
<img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
<span>发布</span>
|
|
|
</li>
|
|
@@ -69,10 +69,13 @@
|
|
|
:key="item.id"
|
|
|
:comp-type="item.compType"
|
|
|
@click="handleChoose(item,index)"
|
|
|
+ :style="item.style"
|
|
|
>
|
|
|
- <div class="opt-btn-box">
|
|
|
+ <!-- 缩放的盒子 -->
|
|
|
+ <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"></div>
|
|
|
+ <div class="del-btn" @click.stop="handleDelItem(index,-1)"></div>
|
|
|
</div>
|
|
|
<div
|
|
|
v-if="item.child&&!item.child.length"
|
|
@@ -88,8 +91,9 @@
|
|
|
tag="div"
|
|
|
class="report-drag-item-wrap_child-wrap"
|
|
|
@add="handleChildAdd($event,item)"
|
|
|
- @remove="handleChildRemove"
|
|
|
+ @remove="handleChildRemove($event,item.child)"
|
|
|
handle=".drag-btn_c"
|
|
|
+ style="display: flex;gap: 20px;align-items: flex-start;"
|
|
|
>
|
|
|
<div
|
|
|
:class="['report-drag-item-wrap_child_content',activeId===child.id?'blue-bg':'']"
|
|
@@ -98,11 +102,16 @@
|
|
|
: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">
|
|
|
+ <div class="opt-btn-box2" style="display: none;">
|
|
|
<div class="drag-btn drag-btn_c"></div>
|
|
|
- <div class="del-btn"></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>
|
|
|
</draggable>
|
|
@@ -147,6 +156,34 @@
|
|
|
|
|
|
<!-- 报告基础信息 -->
|
|
|
<BaseInfo v-model="showReportBaseInfo" :id="$route.query.id" @save="handleReportEdit" />
|
|
|
+
|
|
|
+ <!-- 定时发布弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ v-dialogDrag
|
|
|
+ :append-to-body="true"
|
|
|
+ :visible.sync="showDSFB"
|
|
|
+ width="500px"
|
|
|
+ title="定时发布"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <span>发送时间</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="taskTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期时间"
|
|
|
+ value-format="yyyy-MM-dd HH:mm"
|
|
|
+ :picker-options="timePickerOpt"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <p style="margin:15px 0">设置成功之后,研报将定时进行发送。</p>
|
|
|
+ <div style="text-align:right;margin:20px 0">
|
|
|
+ <el-button type="primary" plain @click="showDSFB=false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleSetReportPrepublish">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -162,13 +199,14 @@ 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 {apiSmartReport} from '@/api/modules/smartReport'
|
|
|
import BaseInfo from './components/BaseInfo.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'
|
|
|
export default {
|
|
|
name:"smartReportEdit",
|
|
|
components: {
|
|
@@ -187,6 +225,30 @@ export default {
|
|
|
ETASandBox,
|
|
|
SemanticAnalysis
|
|
|
},
|
|
|
+ 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:null,
|
|
@@ -251,11 +313,120 @@ export default {
|
|
|
activePindex:'',
|
|
|
activeCindex:'',
|
|
|
showRight:false,
|
|
|
- rightType:''
|
|
|
+ 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,//是否正在拖动缩放
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 大盒子的高度缩放
|
|
|
+ handleResizeP(e,index){
|
|
|
+ this.isDragResize=true
|
|
|
+ e.preventDefault()
|
|
|
+ const targetBox=e.target.parentNode
|
|
|
+ const targetBoxHeight=targetBox.offsetHeight
|
|
|
+ const startY=e.clientY
|
|
|
+ document.onmousemove=(mouseEl)=>{
|
|
|
+ mouseEl.preventDefault()
|
|
|
+ const h=mouseEl.clientY-startY+targetBoxHeight
|
|
|
+ targetBox.style.minHeight=`${h<50?50:h}px`
|
|
|
+ }
|
|
|
+ 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`
|
|
|
+ }
|
|
|
+ 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(){
|
|
|
+ const htmlStr=$('.report-html-wrap').html()
|
|
|
+ sessionStorage.setItem('smartReportContent', htmlStr);
|
|
|
+ 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';
|
|
@@ -309,6 +480,13 @@ export default {
|
|
|
|
|
|
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
|
|
|
|
|
|
// 要添加的元素数据
|
|
@@ -337,6 +515,7 @@ export default {
|
|
|
const {item,newDraggableIndex}=e
|
|
|
|
|
|
const compData=JSON.parse(item.getAttribute('comp-data'))
|
|
|
+ if(!compData) return//如果是从内容里面拖入的则不用处理
|
|
|
|
|
|
console.log(compData,newDraggableIndex);
|
|
|
|
|
@@ -398,25 +577,32 @@ export default {
|
|
|
|
|
|
this.conList.splice(index,1,obj)
|
|
|
}
|
|
|
- // console.log(this.conList);
|
|
|
-
|
|
|
- // console.log(list,data);
|
|
|
- // this.conList.forEach(item=>{
|
|
|
- // if(item.id===data.id){
|
|
|
- // item.child=list
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
|
|
|
// 移除事件
|
|
|
- handleChildRemove(e){
|
|
|
+ handleChildRemove(e,arr){
|
|
|
console.log('child-remove操作------------------->');
|
|
|
// 如果都移除了则删除这个
|
|
|
- this.conList=this.conList.filter(_item=>!(_item.child&&_item.child.length===0&&!_item.id))
|
|
|
+ // 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){
|
|
|
- return _item.child[0]
|
|
|
+ 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
|
|
|
}
|
|
@@ -427,6 +613,18 @@ export default {
|
|
|
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){
|
|
|
+ this.conList[pindex]=this.conList[pindex].child[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 富文本编辑组件/图片组件数据变化
|
|
|
handleTextChange(e){
|
|
|
console.log(e);
|
|
@@ -449,7 +647,7 @@ export default {
|
|
|
// 当前再编辑哪个
|
|
|
handleChoose(item,index,cindex){
|
|
|
//{item:数据,index:父序号,cindex:子序号}
|
|
|
- if(!item.id) return
|
|
|
+ if(!item.id||this.isDragResize) return
|
|
|
this.activeId=item.id
|
|
|
this.showRight=true
|
|
|
this.rightType=item.compType
|
|
@@ -492,7 +690,7 @@ export default {
|
|
|
return type+new Date().getTime()
|
|
|
},
|
|
|
|
|
|
- // 编辑报告
|
|
|
+ // 编辑保存报告
|
|
|
handleReportEdit(e){
|
|
|
const params={
|
|
|
SmartReportId:Number(this.$route.query.id)||0,
|
|
@@ -528,10 +726,197 @@ export default {
|
|
|
if(res.Ret===200){
|
|
|
this.reportInfo=res.Data
|
|
|
this.conList=res.Data.ContentStruct?JSON.parse(res.Data.ContentStruct):[]
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.contentChange=false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 刷新所有图表
|
|
|
+ handleRefreshAllChart: _.debounce ( async function() {
|
|
|
+ let code_arr = [];
|
|
|
+ $('iframe').each((k,i) => {
|
|
|
+ try {
|
|
|
+ let href = $(i).attr('src');
|
|
|
+ code_arr.push(getUrlParams(href,'code'));
|
|
|
+ } catch (err) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(!code_arr.length) return this.$message.warning('请插入图表');
|
|
|
+
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '刷新中..',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.02)'
|
|
|
+ });
|
|
|
+
|
|
|
+ const { Ret } = await dataBaseInterface.reportRefresh({
|
|
|
+ ChartInfoCode: code_arr
|
|
|
+ })
|
|
|
|
|
|
+ loading.close();
|
|
|
+
|
|
|
+ if(Ret === 200) {
|
|
|
+ $('iframe').each((k,i) => {
|
|
|
+ $(i).attr('src',$(i).attr('src'))
|
|
|
+ });
|
|
|
+ this.$message.success('刷新成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ },1000),
|
|
|
+
|
|
|
+ // 自动/存草稿保存内容
|
|
|
+ handleSaveContent({isAutoSave}){
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
+ const id=this.$route.query.id||0
|
|
|
+ if(!id) return
|
|
|
+ apiSmartReport.saveReportContent({
|
|
|
+ SmartReportId:Number(id),
|
|
|
+ Content:$('.report-html-wrap').html(),
|
|
|
+ ContentStruct:JSON.stringify(this.conList),
|
|
|
+ NoChange:this.contentChange?2:1,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ resolve(true)
|
|
|
+ if(!isAutoSave){
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击定时发布/发布
|
|
|
+ async handlePublishOpt(type){
|
|
|
+ // 存一次草稿
|
|
|
+ const saveRes=await this.handleSaveContent({isAutoSave:true})
|
|
|
+ if(!saveRes) return
|
|
|
+ if(type==='dsfb'){
|
|
|
+ this.showDSFB=true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 发布
|
|
|
+ if(this.reportInfo.MsgIsSend==1){//该报告已经推送过模板消息
|
|
|
+ this.reportPublish({sendMsg:false})
|
|
|
+ }else{
|
|
|
+ this.$confirm(
|
|
|
+ '发布后,是否推送模板消息?',
|
|
|
+ '发布提示',
|
|
|
+ {
|
|
|
+ confirmButtonText: '推送',
|
|
|
+ cancelButtonText: '不推送',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose:true,
|
|
|
+
|
|
|
+ beforeClose:(action, instance,done)=>{
|
|
|
+ if(action==='close') {
|
|
|
+ //右上角
|
|
|
+ // this.isPublishloading = false;
|
|
|
+ } else if(action==='cancel') {
|
|
|
+ //cancelButton
|
|
|
+ this.reportPublish({sendMsg:false})
|
|
|
+ }else {
|
|
|
+ //confirmButton
|
|
|
+ this.reportPublish({sendMsg:true})
|
|
|
+ }
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 定时发布报告
|
|
|
+ async handleSetReportPrepublish(){
|
|
|
+ if(!this.taskTime){
|
|
|
+ this.$message.warning('请选择定时发布的时间')
|
|
|
+ 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('定时发布不得早于当前时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 如果该报告已经推送过模板消息
|
|
|
+ if(this.reportInfo.MsgIsSend==1){
|
|
|
+ apiSmartReport.prePublishReport({
|
|
|
+ SmartReportId:Number(this.$route.query.id),
|
|
|
+ PrePublishTime:this.taskTime,
|
|
|
+ PreMsgSend:0
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success('定时发布成功!')
|
|
|
+ this.$router.replace({ path: '/smartReportList' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.smartReportManageBtn.reportManage_sendMsg)
|
|
|
+
|
|
|
+ this.$confirm(isPost?'是否发布定时报告,并推送模板消息?':'是否发布定时报告?', '发布提示', {
|
|
|
+ confirmButtonText: isPost?'推送':'发布',
|
|
|
+ cancelButtonText: isPost?'不推送':'取消',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose:true,
|
|
|
+ beforeClose:(action, instance,done)=>{
|
|
|
+ console.log(action, instance);
|
|
|
+ if(action==='close'||action==='cancel') {
|
|
|
+ //右上角或者不推送
|
|
|
+ if(isPost){
|
|
|
+ apiSmartReport.prePublishReport({
|
|
|
+ SmartReportId:Number(this.$route.query.id),
|
|
|
+ PrePublishTime:this.taskTime,
|
|
|
+ PreMsgSend:0,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success('定时发布成功!')
|
|
|
+ this.$router.replace({ path: '/smartReportList' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //confirmButton
|
|
|
+ apiSmartReport.prePublishReport({
|
|
|
+ SmartReportId:Number(this.$route.query.id),
|
|
|
+ PrePublishTime:this.taskTime,
|
|
|
+ PreMsgSend:isPost?1:0,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success('定时发布成功!')
|
|
|
+ this.$router.replace({ path: '/smartReportList' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 发布报告
|
|
|
+ reportPublish({sendMsg}){
|
|
|
+ apiSmartReport.publishReport({
|
|
|
+ SmartReportId:Number(this.$route.query.id),
|
|
|
+ PublishState:2
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ if(sendMsg){
|
|
|
+ this.reportSendMsg()
|
|
|
+ }
|
|
|
+ this.$router.replace({ path: '/smartReportList' });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //报告消息推送
|
|
|
+ reportSendMsg(){
|
|
|
+ apiSmartReport.reportMsgSend({SmartReportId:Number(this.$route.query.id)}).then(res=>{})
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.getPublicSettings()
|
|
@@ -539,9 +924,15 @@ export default {
|
|
|
},
|
|
|
mounted () {
|
|
|
window.addEventListener('message',this.setSheetIframeStyle)
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.handleSaveContent({isAutoSave:true});
|
|
|
+ }, 6000);
|
|
|
},
|
|
|
destroyed() {
|
|
|
window.removeEventListener('message',this.setSheetIframeStyle)
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -549,6 +940,14 @@ export default {
|
|
|
div{
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
+// .sortable-ghost{
|
|
|
+// height: 5px !important;
|
|
|
+// background-color: #0052D9 !important;
|
|
|
+// overflow: hidden !important;
|
|
|
+// padding: 0 !important;
|
|
|
+// min-height: 0 !important;
|
|
|
+// border: none !important;
|
|
|
+// }
|
|
|
.edit-smart-report-page{
|
|
|
background: var(--unnamed, #F2F6FA);
|
|
|
min-width: 100vw;
|
|
@@ -676,13 +1075,17 @@ div{
|
|
|
min-height: 80px;
|
|
|
border: 1px dashed #0052D9;
|
|
|
position: relative;
|
|
|
+ margin-bottom: 10px;
|
|
|
&:hover{
|
|
|
+ border-style: solid;
|
|
|
.opt-btn-box{
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ .resize-drag-box{
|
|
|
display: block;
|
|
|
}
|
|
|
}
|
|
|
.opt-btn-box{
|
|
|
- display: none;
|
|
|
position: absolute;
|
|
|
left: -36px;
|
|
|
padding-right: 8px;
|
|
@@ -706,11 +1109,19 @@ div{
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
+ .resize-drag-box{
|
|
|
+ position: absolute;
|
|
|
+ right: -4px;
|
|
|
+ bottom: -4px;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ display: none;
|
|
|
+ border: 1px solid #0052D9;
|
|
|
+ cursor: n-resize;
|
|
|
+ }
|
|
|
}
|
|
|
.report-drag-item-wrap_child-wrap{
|
|
|
- display: flex;
|
|
|
- gap: 20px;
|
|
|
- min-height: 10px;
|
|
|
+ min-height: 30px;
|
|
|
}
|
|
|
.report-drag-item-wrap_child_content{
|
|
|
min-height: 80px;
|
|
@@ -718,12 +1129,18 @@ div{
|
|
|
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{
|
|
|
- display: none;
|
|
|
position: absolute;
|
|
|
right: -15px;
|
|
|
top: 0;
|
|
@@ -746,6 +1163,36 @@ div{
|
|
|
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);
|