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

This commit is contained in:
taojinlong 2021-12-01 17:14:25 +08:00
commit b1245f1d08
8 changed files with 28 additions and 17 deletions

View File

@ -4,6 +4,7 @@ export function tree(data) {
return request({
url: '/api/panelView/tree',
method: 'post',
timeout: 30000,
data
})
}
@ -12,6 +13,7 @@ export function viewsWithIds(data) {
return request({
url: '/api/panelView/viewsWithIds',
method: 'post',
timeout: 30000,
loading: true,
data
})
@ -21,6 +23,7 @@ export function findOne(id) {
return request({
url: '/api/panelView/findOne/' + id,
method: 'get',
timeout: 30000,
loading: true
})
}

View File

@ -4,6 +4,7 @@
<div
id="canvasInfoTemp"
ref="canvasInfoTemp"
:style="[{height:mainHeight},screenShotStyle]"
class="main-class"
@mouseup="deselectCurComponent"
@mousedown="handleMouseDown"
@ -59,6 +60,10 @@ export default {
event: 'change'
},
props: {
screenShot: {
type: Boolean,
default: false
},
show: {
type: Boolean,
default: false
@ -119,6 +124,9 @@ export default {
}
return style
},
screenShotStyle() {
return this.screenShot ? this.customStyle : {}
},
// componentData mapState
componentDataInfo() {
return this.componentDataShow
@ -153,8 +161,14 @@ export default {
erd.listenTo(mainDom, element => {
_this.$nextTick(() => {
_this.restore()
})
})
// div
const tempCanvas = document.getElementById('canvasInfoTemp')
erd.listenTo(tempCanvas, element => {
_this.$nextTick(() => {
// mainHeight px html2canvas
_this.mainHeight = mainDom.scrollHeight + 'px!important'
_this.mainHeight = tempCanvas.scrollHeight + 'px!important'
})
})
eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog)

View File

@ -813,6 +813,10 @@ export default {
y: 18
}
}
},
scrollTop: {
type: Number,
default: 0
}
},
data() {
@ -1251,9 +1255,8 @@ export default {
}
},
handleDragOver(e) {
// console.log('handleDragOver-Editor')
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.top = this.dragComponentInfo.shadowStyle.y / this.scalePointHeight
if (this.dragComponentInfo.auxiliaryMatrix) {

View File

@ -78,14 +78,6 @@
<el-input v-model="styleInfo.margin" type="number" size="mini" min="0" max="99" @change="styleChange" />
</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')">
<i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-touming" />
</el-tooltip>

View File

@ -106,6 +106,7 @@ export default {
_this.panel.imageUrl = reader.result
this.commitStyle()
}
this.$store.state.styleChangeTimes++
reader.readAsDataURL(file.raw)
},
upload(file) {

View File

@ -106,7 +106,7 @@
@mouseup="deselectCurComponent"
@scroll="canvasScroll"
>
<Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" />
<Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</div>
<!--移动端画布区域 保持宽高比2.5-->
<el-row v-if="mobileLayoutStatus" class="mobile_canvas_main">
@ -126,7 +126,7 @@
id="canvasInfoMobile"
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 class="this_mobile_canvas_bottom" />
</div>
@ -661,8 +661,6 @@ export default {
},
sureFilter() {
this.currentFilterCom.options.value = []
const component = deepCopy(this.currentFilterCom)
this.$store.commit('setComponentWithId', component)
this.$store.commit('recordSnapshot', 'sureFilter')
this.closeFilter()
},

View File

@ -96,7 +96,7 @@ export default {
const contentWidth = canvas.width
const contentHeight = canvas.height
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.save(_this.panelName + '.pdf')
_this.$emit('closePreExport')

View File

@ -75,7 +75,7 @@
<el-row class="panel-design-preview">
<div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%">
<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>
</div>
</el-row>