Merge pull request #3933 from dataease/pr@dev@fix_fullscreen

fix(仪表板): 修复用户视图放大,组件下拉框在全屏状态无法显示的问题
This commit is contained in:
Junjun 2022-11-29 16:11:35 +08:00 committed by GitHub
commit ea73ef16e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 10 deletions

View File

@ -274,7 +274,7 @@ export default {
} else { } else {
return { return {
... ...
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
position: 'relative' position: 'relative'
} }
} }

View File

@ -95,6 +95,49 @@
@closePreExport="closePreExport" @closePreExport="closePreExport"
/> />
</el-dialog> </el-dialog>
<!--视图详情-->
<el-dialog
:visible.sync="chartDetailsVisible"
width="80%"
class="dialog-css"
:destroy-on-close="true"
:show-close="true"
:append-to-body="false"
top="5vh"
>
<span
v-if="chartDetailsVisible"
style="position: absolute;right: 70px;top:15px"
>
<el-button
v-if="showChartInfoType==='enlarge' && showChartInfo && showChartInfo.type !== 'symbol-map'"
class="el-icon-picture-outline"
size="mini"
@click="exportViewImg"
>
{{ $t('chart.export_img') }}
</el-button>
<el-button
v-if="showChartInfoType==='details'"
size="mini"
@click="exportExcel"
>
<svg-icon
icon-class="ds-excel"
class="ds-icon-excel"
/>{{ $t('chart.export') }}Excel
</el-button>
</span>
<user-view-dialog
v-if="chartDetailsVisible"
ref="userViewDialog-canvas-main"
:chart="showChartInfo"
:chart-table="showChartTableInfo"
:canvas-style-data="canvasStyleData"
:open-type="showChartInfoType"
/>
</el-dialog>
</div> </div>
</template> </template>
@ -117,10 +160,11 @@ import html2canvas from 'html2canvasde'
import { queryAll } from '@/api/panel/pdfTemplate' import { queryAll } from '@/api/panel/pdfTemplate'
import PDFPreExport from '@/views/panel/export/PDFPreExport' import PDFPreExport from '@/views/panel/export/PDFPreExport'
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey' import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
const erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
export default { export default {
components: { ComponentWrapper, CanvasOptBar, PDFPreExport }, components: { UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
model: { model: {
prop: 'show', prop: 'show',
event: 'change' event: 'change'
@ -189,6 +233,10 @@ export default {
}, },
data() { data() {
return { return {
chartDetailsVisible: false,
showChartInfo: {},
showChartTableInfo: {},
showChartInfoType: 'details',
mainHeightCount: null, mainHeightCount: null,
userInfo: null, userInfo: null,
previewMainDomId: 'preview-main-' + this.canvasId, previewMainDomId: 'preview-main-' + this.canvasId,
@ -381,6 +429,7 @@ export default {
if (this.terminal === 'mobile') { if (this.terminal === 'mobile') {
this.initMobileCanvas() this.initMobileCanvas()
} }
this.canvasId === 'canvas-main' && bus.$on('pcChartDetailsDialog', this.openChartDetailsDialog)
bus.$on('trigger-search-button', this.triggerSearchButton) bus.$on('trigger-search-button', this.triggerSearchButton)
bus.$on('trigger-reset-button', this.triggerResetButton) bus.$on('trigger-reset-button', this.triggerResetButton)
this.initPdfTemplate() this.initPdfTemplate()
@ -389,10 +438,19 @@ export default {
erd.uninstall(this.$refs[this.previewTempRefId]) erd.uninstall(this.$refs[this.previewTempRefId])
erd.uninstall(this.$refs[this.previewRefId]) erd.uninstall(this.$refs[this.previewRefId])
clearInterval(this.timer) clearInterval(this.timer)
this.canvasId === 'canvas-main' && bus.$off('pcChartDetailsDialog', this.openChartDetailsDialog)
bus.$off('trigger-search-button', this.triggerSearchButton) bus.$off('trigger-search-button', this.triggerSearchButton)
bus.$off('trigger-reset-button', this.triggerResetButton) bus.$off('trigger-reset-button', this.triggerResetButton)
}, },
methods: { methods: {
openChartDetailsDialog(paramInfo) {
if (this.canvasId === 'canvas-main') {
this.showChartInfo = paramInfo.showChartInfo
this.showChartTableInfo = paramInfo.showChartTableInfo
this.showChartInfoType = paramInfo.showChartInfoType
this.chartDetailsVisible = true
}
},
initWatermark(waterDomId = 'preview-main-canvas-main') { initWatermark(waterDomId = 'preview-main-canvas-main') {
if (this.panelInfo.watermarkInfo && this.canvasId === 'canvas-main') { if (this.panelInfo.watermarkInfo && this.canvasId === 'canvas-main') {
if (this.userInfo) { if (this.userInfo) {
@ -585,10 +643,10 @@ export default {
} }
}, },
exportExcel() { exportExcel() {
this.$refs['userViewDialog'].exportExcel() this.$refs['userViewDialog-canvas-main'].exportExcel()
}, },
exportViewImg() { exportViewImg() {
this.$refs['userViewDialog'].exportViewImg() this.$refs['userViewDialog-canvas-main'].exportViewImg()
}, },
deselectCurComponent(e) { deselectCurComponent(e) {
if (!this.isClickComponent) { if (!this.isClickComponent) {

View File

@ -232,6 +232,11 @@ export default {
ChartComponentG2 ChartComponentG2
}, },
props: { props: {
inScreen: {
type: Boolean,
required: false,
default: true
},
canvasId: { canvasId: {
type: String, type: String,
required: true required: true
@ -871,7 +876,13 @@ export default {
this.showChartInfo = this.chart this.showChartInfo = this.chart
this.showChartTableInfo = tableChart this.showChartTableInfo = tableChart
this.showChartInfoType = params.openType this.showChartInfoType = params.openType
if (this.terminal === 'pc') { if (!this.inScreen) {
bus.$emit('pcChartDetailsDialog', {
showChartInfo: this.showChartInfo,
showChartTableInfo: this.showChartTableInfo,
showChartInfoType: this.showChartInfoType
})
} else if (this.terminal === 'pc') {
this.chartDetailsVisible = true this.chartDetailsVisible = true
} else { } else {
this.mobileChartDetailsVisible = true this.mobileChartDetailsVisible = true

View File

@ -2,7 +2,7 @@
<div <div
ref="myContainer" ref="myContainer"
class="my-container" class="my-container"
:style="autoStyle" :style="inScreen?autoStyle:''"
> >
<div <div
ref="conditionMain" ref="conditionMain"

View File

@ -20,8 +20,8 @@ class DeWebsocket {
initialize() { initialize() {
this.connection() this.connection()
const _this = this const _this = this
this.timer = this.isLoginStatu() && setInterval(() => { this.timer = this.isLoginStatus() && setInterval(() => {
this.isLoginStatu() || this.destroy() this.isLoginStatus() || this.destroy()
try { try {
_this.client && _this.client.send('heart detection') _this.client && _this.client.send('heart detection')
} catch (error) { } catch (error) {
@ -41,12 +41,12 @@ class DeWebsocket {
this.initialize() this.initialize()
} }
isLoginStatu() { isLoginStatus() {
return store.state && store.state.user && store.state.user.user && store.state.user.user.userId return store.state && store.state.user && store.state.user.user && store.state.user.user.userId
} }
connection() { connection() {
if (!this.isLoginStatu()) { if (!this.isLoginStatus()) {
return return
} }
const socket = new SockJS(this.ws_url + '?userId=' + store.state.user.user.userId) const socket = new SockJS(this.ws_url + '?userId=' + store.state.user.user.userId)
@ -70,6 +70,7 @@ class DeWebsocket {
} }
).bind(this) ).bind(this)
} }
subscribe() { subscribe() {
this.channels.forEach(channel => { this.channels.forEach(channel => {
this.client.subscribe('/user/' + store.state.user.user.userId + channel.topic, res => { this.client.subscribe('/user/' + store.state.user.user.userId + channel.topic, res => {
@ -77,6 +78,7 @@ class DeWebsocket {
}) })
}) })
} }
disconnect() { disconnect() {
this.client && this.client.disconnect() this.client && this.client.disconnect()
} }