|
@@ -1,58 +1,106 @@
|
|
|
<template>
|
|
|
<div class="edit-smart-report-page">
|
|
|
- <div class="left-wrap">
|
|
|
- <draggable
|
|
|
- :list="compList"
|
|
|
- :group="{ name: 'component', pull: 'clone', put: false }"
|
|
|
- class="temp-component-list"
|
|
|
- animation="300"
|
|
|
- tag="div"
|
|
|
- :sort="false"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="item"
|
|
|
- v-for="item in compList"
|
|
|
- :key="item.compId"
|
|
|
- :comp-type="item.compType"
|
|
|
- >{{item.compType}}</div>
|
|
|
- </draggable>
|
|
|
+ <!-- 顶部操作栏 -->
|
|
|
+ <div class="top-action-wrap">
|
|
|
+ <div class="title">标题</div>
|
|
|
+ <ul class="action-list">
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
+ <span>基础信息</span>
|
|
|
+ </li>
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon02.png" alt="">
|
|
|
+ <span>图表刷新 </span>
|
|
|
+ </li>
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon03.png" alt="">
|
|
|
+ <span>预览</span>
|
|
|
+ </li>
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
+ <span>存草稿</span>
|
|
|
+ </li>
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
+ <span>定时发布</span>
|
|
|
+ </li>
|
|
|
+ <li class="action-item">
|
|
|
+ <img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
+ <span>发布</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
<div class="main-wrap">
|
|
|
- <!-- <draggable
|
|
|
- :list="conList"
|
|
|
- :group="{ name: 'component', pull: true, put: true }"
|
|
|
- class="report-html-wrap"
|
|
|
- animation="300"
|
|
|
- tag="div"
|
|
|
- @add="handleAdd"
|
|
|
- >
|
|
|
- <template v-for="comp in conList">
|
|
|
- <component :is="getComponentName(comp)" :key="comp.id" :compData="comp" @childAdd="handleChildAdd"/>
|
|
|
- </template>
|
|
|
- </draggable> -->
|
|
|
- <draggable
|
|
|
- :list="conList"
|
|
|
- :group="{ name: 'component', pull: true, put: true }"
|
|
|
- class="report-html-wrap"
|
|
|
- animation="300"
|
|
|
- tag="div"
|
|
|
- @add="handleAdd"
|
|
|
- >
|
|
|
- <div class="report-drag-item-wrap " v-for="item in conList" :key="item.id">
|
|
|
+ <div class="report-action-wrap">
|
|
|
+ <ul class="top-type-list">
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon04.png" alt="">
|
|
|
+ <span>图库</span>
|
|
|
+ </li>
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon05.png" alt="">
|
|
|
+ <span>ETA表格</span>
|
|
|
+ </li>
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon06.png" alt="">
|
|
|
+ <span>统计分析</span>
|
|
|
+ </li>
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon07.png" alt="">
|
|
|
+ <span>商品价格曲线</span>
|
|
|
+ </li>
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon08.png" alt="">
|
|
|
+ <span>沙盘图</span>
|
|
|
+ </li>
|
|
|
+ <li class="item">
|
|
|
+ <img class="icon" src="~@/assets/img/smartReport/icon09.png" alt="">
|
|
|
+ <span>语义分析</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <!-- 公共组件 -->
|
|
|
+ <draggable
|
|
|
+ :list="compList"
|
|
|
+ :group="{ name: 'component', pull: 'clone', put: false }"
|
|
|
+ class="report-comp-wrap"
|
|
|
+ animation="300"
|
|
|
+ :sort="false"
|
|
|
+ tag="ul"
|
|
|
+ >
|
|
|
+ <li class="comp-item" :comp-type="comp.compType" v-for="comp in compList" :key="comp.id">
|
|
|
+ <img :src="comp.icon">
|
|
|
+ </li>
|
|
|
+ </draggable>
|
|
|
+
|
|
|
+ <div class="report-content-box">
|
|
|
<draggable
|
|
|
- :list="item.child"
|
|
|
+ :list="conList"
|
|
|
:group="{ name: 'component', pull: true, put: true }"
|
|
|
+ class="report-html-wrap"
|
|
|
animation="300"
|
|
|
tag="div"
|
|
|
- class="report-drag-item-wrap_child-wrap"
|
|
|
- @add="handleChildAdd"
|
|
|
+ @add="handleAdd"
|
|
|
>
|
|
|
- <div class="report-drag-item-wrap_child" v-for="child in item.child" :key="child.id">
|
|
|
- {{child.type}}
|
|
|
+ <div class="report-drag-item-wrap" v-for="item in conList" :key="item.id">
|
|
|
+ <draggable
|
|
|
+ :list="item.child"
|
|
|
+ :group="{ name: 'component', pull: true, put: true }"
|
|
|
+ animation="300"
|
|
|
+ tag="div"
|
|
|
+ class="report-drag-item-wrap_child-wrap"
|
|
|
+ @add="handleChildAdd"
|
|
|
+ >
|
|
|
+ <div class="report-drag-item-wrap_child" v-for="child in item.child" :key="child.id">
|
|
|
+ {{child.type}}
|
|
|
+ </div>
|
|
|
+ </draggable>
|
|
|
</div>
|
|
|
</draggable>
|
|
|
</div>
|
|
|
- </draggable>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-action-wrap">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -76,51 +124,18 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
compList:[
|
|
|
- {
|
|
|
- compId:0,
|
|
|
- compType:'wrap'
|
|
|
- },
|
|
|
{
|
|
|
compId:1,
|
|
|
- compType:'text'
|
|
|
- },
|
|
|
- {
|
|
|
- compId:2,
|
|
|
- compType:'chart'
|
|
|
+ compType:'text',
|
|
|
+ icon:require('@/assets/img/smartReport/icon10.png')
|
|
|
},
|
|
|
{
|
|
|
compId:3,
|
|
|
- compType:'img'
|
|
|
+ compType:'img',
|
|
|
+ icon:require('@/assets/img/smartReport/icon11.png')
|
|
|
},
|
|
|
],
|
|
|
- conList:[
|
|
|
- {
|
|
|
- id:1,
|
|
|
- child:[
|
|
|
- {
|
|
|
- id:'21324321',
|
|
|
- type:'1'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'21324re321',
|
|
|
- type:'4'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- id:2,
|
|
|
- child:[
|
|
|
- {
|
|
|
- id:'414214',
|
|
|
- type:'2'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'654432',
|
|
|
- type:'3'
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
+ conList:[]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -142,13 +157,14 @@ export default {
|
|
|
return type+new Date().getTime()
|
|
|
},
|
|
|
|
|
|
- handleChildAdd({list,data}){
|
|
|
- console.log(list,data);
|
|
|
- this.conList.forEach(item=>{
|
|
|
- if(item.id===data.id){
|
|
|
- item.child=list
|
|
|
- }
|
|
|
- })
|
|
|
+ handleChildAdd(e){
|
|
|
+ console.log('child-onAdd操作------------------->', e);
|
|
|
+ // console.log(list,data);
|
|
|
+ // this.conList.forEach(item=>{
|
|
|
+ // if(item.id===data.id){
|
|
|
+ // item.child=list
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
handleAdd(e){
|
|
@@ -166,6 +182,7 @@ export default {
|
|
|
id:this.getCompId(comp.compType),
|
|
|
child:[]
|
|
|
}
|
|
|
+ console.log(tempCompData);
|
|
|
this.conList.splice(newDraggableIndex,1,tempCompData)
|
|
|
}
|
|
|
},
|
|
@@ -177,27 +194,119 @@ div{
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.edit-smart-report-page{
|
|
|
- display: flex;
|
|
|
- .left-wrap{
|
|
|
- width: 300px;
|
|
|
+ .top-action-wrap{
|
|
|
+ position: sticky;
|
|
|
+ top: 0px;
|
|
|
background-color: #fff;
|
|
|
- min-height: 90vh;
|
|
|
- .temp-component-list{
|
|
|
- .item{
|
|
|
- margin-left: 10px;
|
|
|
- margin-bottom: 30px;
|
|
|
- width: 280px;
|
|
|
- height: 150px;
|
|
|
- background-color: beige;
|
|
|
+ box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.10);
|
|
|
+ height: 60px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-content: center;
|
|
|
+ .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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .main-wrap{
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+.report-action-wrap{
|
|
|
+ width: 800px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 90px;
|
|
|
+ margin-right: 60px;
|
|
|
+ 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: pointer;
|
|
|
+ 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: 50px;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid var(--gary-gy-5-line, #C8CDD9);
|
|
|
+ .item{
|
|
|
+ cursor: pointer;
|
|
|
+ flex: auto;
|
|
|
+ display: flex;
|
|
|
+ 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 64px;
|
|
|
+ height: 80vh;
|
|
|
+ position: relative;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
.main-wrap{
|
|
|
- background-color: #fff;
|
|
|
- width: 864px;
|
|
|
- min-height: 90vh;
|
|
|
- margin: 0 30px;
|
|
|
.report-html-wrap{
|
|
|
min-height: 50vh;
|
|
|
.report-drag-item-wrap{
|
|
@@ -216,6 +325,9 @@ div{
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
+ .blue-bg{
|
|
|
+ background: var(--brand-brand-1-light, #ECF2FE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|