提交 b1245f1d authored 作者: taojinlong's avatar taojinlong

Merge branch 'v1.5' of github.com:dataease/dataease into v1.5

...@@ -4,6 +4,7 @@ export function tree(data) { ...@@ -4,6 +4,7 @@ export function tree(data) {
return request({ return request({
url: '/api/panelView/tree', url: '/api/panelView/tree',
method: 'post', method: 'post',
timeout: 30000,
data data
}) })
} }
...@@ -12,6 +13,7 @@ export function viewsWithIds(data) { ...@@ -12,6 +13,7 @@ export function viewsWithIds(data) {
return request({ return request({
url: '/api/panelView/viewsWithIds', url: '/api/panelView/viewsWithIds',
method: 'post', method: 'post',
timeout: 30000,
loading: true, loading: true,
data data
}) })
...@@ -21,6 +23,7 @@ export function findOne(id) { ...@@ -21,6 +23,7 @@ export function findOne(id) {
return request({ return request({
url: '/api/panelView/findOne/' + id, url: '/api/panelView/findOne/' + id,
method: 'get', method: 'get',
timeout: 30000,
loading: true loading: true
}) })
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<div <div
id="canvasInfoTemp" id="canvasInfoTemp"
ref="canvasInfoTemp" ref="canvasInfoTemp"
:style="[{height:mainHeight},screenShotStyle]"
class="main-class" class="main-class"
@mouseup="deselectCurComponent" @mouseup="deselectCurComponent"
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
...@@ -59,6 +60,10 @@ export default { ...@@ -59,6 +60,10 @@ export default {
event: 'change' event: 'change'
}, },
props: { props: {
screenShot: {
type: Boolean,
default: false
},
show: { show: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -119,6 +124,9 @@ export default { ...@@ -119,6 +124,9 @@ export default {
} }
return style return style
}, },
screenShotStyle() {
return this.screenShot ? this.customStyle : {}
},
// 此处单独计算componentData的值 不放入全局mapState中 // 此处单独计算componentData的值 不放入全局mapState中
componentDataInfo() { componentDataInfo() {
return this.componentDataShow return this.componentDataShow
...@@ -153,8 +161,14 @@ export default { ...@@ -153,8 +161,14 @@ export default {
erd.listenTo(mainDom, element => { erd.listenTo(mainDom, element => {
_this.$nextTick(() => { _this.$nextTick(() => {
_this.restore() _this.restore()
})
})
// 监听div变动事件
const tempCanvas = document.getElementById('canvasInfoTemp')
erd.listenTo(tempCanvas, element => {
_this.$nextTick(() => {
// 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题 // 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题
_this.mainHeight = mainDom.scrollHeight + 'px!important' _this.mainHeight = tempCanvas.scrollHeight + 'px!important'
}) })
}) })
eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog) eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog)
......
...@@ -813,6 +813,10 @@ export default { ...@@ -813,6 +813,10 @@ export default {
y: 18 y: 18
} }
} }
},
scrollTop: {
type: Number,
default: 0
} }
}, },
data() { data() {
...@@ -1251,9 +1255,8 @@ export default { ...@@ -1251,9 +1255,8 @@ export default {
} }
}, },
handleDragOver(e) { handleDragOver(e) {
// console.log('handleDragOver-Editor')
this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.x = e.pageX - 220
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth
this.dragComponentInfo.style.top = this.dragComponentInfo.shadowStyle.y / this.scalePointHeight this.dragComponentInfo.style.top = this.dragComponentInfo.shadowStyle.y / this.scalePointHeight
if (this.dragComponentInfo.auxiliaryMatrix) { if (this.dragComponentInfo.auxiliaryMatrix) {
......
...@@ -78,14 +78,6 @@ ...@@ -78,14 +78,6 @@
<el-input v-model="styleInfo.margin" type="number" size="mini" min="0" max="99" @change="styleChange" /> <el-input v-model="styleInfo.margin" type="number" size="mini" min="0" max="99" @change="styleChange" />
</div> </div>
<el-tooltip v-if="attrShow('padding')" :content="$t('panel.margin')">
<i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-margin" />
</el-tooltip>
<div v-if="attrShow('padding')" style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;">
<el-input v-model="styleInfo.padding" type="number" size="mini" min="0" max="99" @change="styleChange" />
</div>
<el-tooltip v-if="attrShow('opacity')" :content="$t('panel.opacity')"> <el-tooltip v-if="attrShow('opacity')" :content="$t('panel.opacity')">
<i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-touming" /> <i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-touming" />
</el-tooltip> </el-tooltip>
......
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
_this.panel.imageUrl = reader.result _this.panel.imageUrl = reader.result
this.commitStyle() this.commitStyle()
} }
this.$store.state.styleChangeTimes++
reader.readAsDataURL(file.raw) reader.readAsDataURL(file.raw)
}, },
upload(file) { upload(file) {
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
@mouseup="deselectCurComponent" @mouseup="deselectCurComponent"
@scroll="canvasScroll" @scroll="canvasScroll"
> >
<Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" /> <Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</div> </div>
<!--移动端画布区域 保持宽高比2.5--> <!--移动端画布区域 保持宽高比2.5-->
<el-row v-if="mobileLayoutStatus" class="mobile_canvas_main"> <el-row v-if="mobileLayoutStatus" class="mobile_canvas_main">
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
id="canvasInfoMobile" id="canvasInfoMobile"
class="this_mobile_canvas_main" class="this_mobile_canvas_main"
> >
<Editor ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" /> <Editor ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</el-row> </el-row>
<el-row class="this_mobile_canvas_bottom" /> <el-row class="this_mobile_canvas_bottom" />
</div> </div>
...@@ -661,8 +661,6 @@ export default { ...@@ -661,8 +661,6 @@ export default {
}, },
sureFilter() { sureFilter() {
this.currentFilterCom.options.value = [] this.currentFilterCom.options.value = []
const component = deepCopy(this.currentFilterCom)
this.$store.commit('setComponentWithId', component)
this.$store.commit('recordSnapshot', 'sureFilter') this.$store.commit('recordSnapshot', 'sureFilter')
this.closeFilter() this.closeFilter()
}, },
......
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
const contentWidth = canvas.width const contentWidth = canvas.width
const contentHeight = canvas.height const contentHeight = canvas.height
const pageData = canvas.toDataURL('image/jpeg', 1.0) const pageData = canvas.toDataURL('image/jpeg', 1.0)
const PDF = new JsPDF('l', 'px', [contentWidth, contentHeight]) const PDF = new JsPDF('p', 'pt', [contentWidth, contentHeight])
PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight)
PDF.save(_this.panelName + '.pdf') PDF.save(_this.panelName + '.pdf')
_this.$emit('closePreExport') _this.$emit('closePreExport')
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<el-row class="panel-design-preview"> <el-row class="panel-design-preview">
<div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%"> <div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%">
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="fullscreen"> <fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="fullscreen">
<Preview v-if="showMain" :in-screen="!fullscreen" :show-type="'width'" /> <Preview v-if="showMain" :in-screen="!fullscreen" :show-type="'width'" :screen-shot="dataLoading"/>
</fullscreen> </fullscreen>
</div> </div>
</el-row> </el-row>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论