修改data-visualization\components\data-visualization
This commit is contained in:
parent
2564a859f6
commit
f56576b2c6
@ -59,7 +59,6 @@ const contextmenuStore = contextmenuStoreWithOut()
|
|||||||
const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState, mainScrollTop } =
|
const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState, mainScrollTop } =
|
||||||
storeToRefs(dvMainStore)
|
storeToRefs(dvMainStore)
|
||||||
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
||||||
const emits = defineEmits(['scrollCanvasAdjust'])
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
themes: {
|
themes: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -265,7 +264,7 @@ watch(
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => areaData.value.components.length,
|
() => areaData.value.components.length,
|
||||||
(val, oldVal) => {
|
() => {
|
||||||
groupAreaClickChange()
|
groupAreaClickChange()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -938,7 +937,7 @@ function removeItem(index) {
|
|||||||
dvMainStore.removeLinkageInfo(item['id'])
|
dvMainStore.removeLinkageInfo(item['id'])
|
||||||
if (isMainCanvas(canvasId.value)) {
|
if (isMainCanvas(canvasId.value)) {
|
||||||
// 主画布中存在隐藏组件 直接从原始componentData中进行删除
|
// 主画布中存在隐藏组件 直接从原始componentData中进行删除
|
||||||
dvMainStore.deleteComponentById(item.id)
|
dvMainStore.deleteComponentById(item.id, undefined, false)
|
||||||
} else {
|
} else {
|
||||||
componentData.value.splice(index, 1)
|
componentData.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,27 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getStyle } from '@/data-visualization/utils/style'
|
import { getStyle } from '@/data-visualization/utils/style'
|
||||||
import eventBus from '@/data-visualization/utils/eventBus'
|
import eventBus from '@/data-visualization/utils/eventBus'
|
||||||
import { ref, onMounted, toRefs, getCurrentInstance, computed, nextTick } from 'vue'
|
import { ref, toRefs, computed, nextTick } from 'vue'
|
||||||
import findComponent from '@/data-visualization/utils/components'
|
import findComponent from '@/data-visualization/utils/components'
|
||||||
import { downloadCanvas2, imgUrlTrans } from '@/data-visualization/utils/imgUtils'
|
import { downloadCanvas2, imgUrlTrans } from '@/data-visualization/utils/imgUtils'
|
||||||
|
|
||||||
|
import { useEmitt } from '@/data-visualization/hooks/web/useEmitt'
|
||||||
import Board from '@/data-visualization/components/de-board/Board.vue'
|
import Board from '@/data-visualization/components/de-board/Board.vue'
|
||||||
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
||||||
import { activeWatermarkCheckUser, removeActiveWatermark } from '@/data-visualization/components/watermark/watermark'
|
import { activeWatermarkCheckUser, removeActiveWatermark } from '@/data-visualization/components/watermark/watermark'
|
||||||
import { isMobile } from '@/data-visualization/utils/utils'
|
import { isMobile } from '@/data-visualization/utils/utils'
|
||||||
import { isDashboard } from '@/data-visualization/utils/canvasUtils'
|
import { isDashboard, isMainCanvas } from '@/data-visualization/utils/canvasUtils'
|
||||||
|
import { XpackComponent } from '@/data-visualization/components/plugin'
|
||||||
|
import DePreviewPopDialog from '@/data-visualization/components/visualization/DePreviewPopDialog.vue'
|
||||||
|
import Icon from '../../icon-custom/src/Icon.vue'
|
||||||
|
import replaceOutlined from '@/assets/svg/icon_replace_outlined.svg'
|
||||||
|
|
||||||
const componentWrapperInnerRef = ref(null)
|
const componentWrapperInnerRef = ref(null)
|
||||||
const componentEditBarRef = ref(null)
|
const componentEditBarRef = ref(null)
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const downLoading = ref(false)
|
const downLoading = ref(false)
|
||||||
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
|
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
|
||||||
|
const dePreviewPopDialogRef = ref(null)
|
||||||
const commonFilterAttrsFilterBorder = [
|
const commonFilterAttrsFilterBorder = [
|
||||||
'width',
|
'width',
|
||||||
'height',
|
'height',
|
||||||
@ -113,6 +121,11 @@ const props = defineProps({
|
|||||||
optType: {
|
optType: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
|
},
|
||||||
|
// 画布滚动距离
|
||||||
|
scrollMain: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const {
|
const {
|
||||||
@ -124,23 +137,25 @@ const {
|
|||||||
dvInfo,
|
dvInfo,
|
||||||
searchCount,
|
searchCount,
|
||||||
scale,
|
scale,
|
||||||
suffixId
|
suffixId,
|
||||||
|
scrollMain
|
||||||
} = toRefs(props)
|
} = toRefs(props)
|
||||||
let currentInstance
|
|
||||||
const component = ref(null)
|
const component = ref(null)
|
||||||
const emits = defineEmits(['userViewEnlargeOpen', 'datasetParamsInit', 'onPointClick'])
|
const emits = defineEmits(['userViewEnlargeOpen', 'datasetParamsInit', 'onPointClick'])
|
||||||
const wrapperId = 'wrapper-outer-id-' + config.value.id
|
const wrapperId = 'wrapper-outer-id-' + config.value.id
|
||||||
|
|
||||||
const viewDemoInnerId = computed(() => 'enlarge-inner-content-' + config.value.id)
|
const viewDemoInnerId = computed(() => 'enlarge-inner-content-' + config.value.id)
|
||||||
const htmlToImage = () => {
|
const htmlToImage = () => {
|
||||||
|
useEmitt().emitter.emit('l7-prepare-picture', config.value.id)
|
||||||
downLoading.value = true
|
downLoading.value = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const vueDom = componentWrapperInnerRef.value
|
const vueDom = document.getElementById(viewDemoInnerId.value)
|
||||||
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value / 100)
|
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value / 100)
|
||||||
downloadCanvas2('img', vueDom, '图表', () => {
|
downloadCanvas2('img', vueDom, '图表', () => {
|
||||||
// do callback
|
// do callback
|
||||||
removeActiveWatermark(viewDemoInnerId.value)
|
removeActiveWatermark(viewDemoInnerId.value)
|
||||||
downLoading.value = false
|
downLoading.value = false
|
||||||
|
useEmitt().emitter.emit('l7-unprepare-picture', config.value.id)
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
@ -149,20 +164,22 @@ const handleInnerMouseDown = e => {
|
|||||||
// do setCurComponent
|
// do setCurComponent
|
||||||
if (showPosition.value.includes('multiplexing')) {
|
if (showPosition.value.includes('multiplexing')) {
|
||||||
componentEditBarRef.value.multiplexingCheckOut()
|
componentEditBarRef.value.multiplexingCheckOut()
|
||||||
e.stopPropagation()
|
e?.stopPropagation()
|
||||||
e.preventDefault()
|
e?.preventDefault()
|
||||||
}
|
}
|
||||||
if (showPosition.value.includes('popEdit') || dvMainStore.mobileInPc) {
|
if (
|
||||||
|
(!['rich-text'].includes(config.value.innerType) &&
|
||||||
|
['popEdit', 'preview'].includes(showPosition.value)) ||
|
||||||
|
dvMainStore.mobileInPc
|
||||||
|
) {
|
||||||
onClick(e)
|
onClick(e)
|
||||||
|
if (e.target?.className?.includes('ed-input__inner')) return
|
||||||
|
e?.stopPropagation()
|
||||||
|
e?.preventDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
const onClick = () => {
|
||||||
currentInstance = getCurrentInstance()
|
|
||||||
const methodName = 'componentImageDownload-' + config.value.id
|
|
||||||
})
|
|
||||||
|
|
||||||
const onClick = e => {
|
|
||||||
// 将当前点击组件的事件传播出去
|
// 将当前点击组件的事件传播出去
|
||||||
eventBus.emit('componentClick')
|
eventBus.emit('componentClick')
|
||||||
dvMainStore.setInEditorStatus(true)
|
dvMainStore.setInEditorStatus(true)
|
||||||
@ -287,11 +304,20 @@ const eventEnable = computed(
|
|||||||
['indicator', 'rich-text'].includes(config.value.innerType)) &&
|
['indicator', 'rich-text'].includes(config.value.innerType)) &&
|
||||||
config.value.events &&
|
config.value.events &&
|
||||||
config.value.events.checked &&
|
config.value.events.checked &&
|
||||||
(isDashboard() || (!isDashboard() && !isMobile()))
|
(isDashboard() || (!isDashboard() && !isMobile())) &&
|
||||||
|
showPosition.value !== 'canvas-multiplexing'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const onWrapperClickCur = e => {
|
||||||
|
// 指标卡为内部触发
|
||||||
|
if (['indicator'].includes(config.value.innerType)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
onWrapperClick(e)
|
||||||
|
}
|
||||||
|
|
||||||
const onWrapperClick = e => {
|
const onWrapperClick = e => {
|
||||||
if (eventEnable.value && showPosition.value !== 'canvas-multiplexing') {
|
if (eventEnable.value) {
|
||||||
if (config.value.events.type === 'showHidden') {
|
if (config.value.events.type === 'showHidden') {
|
||||||
// 打开弹框区域
|
// 打开弹框区域
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@ -302,15 +328,9 @@ const onWrapperClick = e => {
|
|||||||
const jumpType = config.value.events.jump.type
|
const jumpType = config.value.events.jump.type
|
||||||
try {
|
try {
|
||||||
if ('newPop' === jumpType) {
|
if ('newPop' === jumpType) {
|
||||||
window.open(
|
dePreviewPopDialogRef.value.previewInit({ url, size: 'middle' })
|
||||||
url,
|
|
||||||
'_blank',
|
|
||||||
'width=800,height=600,left=200,top=100,toolbar=no,scrollbars=yes,resizable=yes,location=no'
|
|
||||||
)
|
|
||||||
} else if ('_blank' === jumpType) {
|
} else if ('_blank' === jumpType) {
|
||||||
console.info('DataEase Component Jump _blank value:' + window['originOpen'])
|
|
||||||
if (window['originOpen']) {
|
if (window['originOpen']) {
|
||||||
console.info('DataEase Component originOpen _blank')
|
|
||||||
window['originOpen'](url, '_blank')
|
window['originOpen'](url, '_blank')
|
||||||
} else {
|
} else {
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
@ -321,9 +341,15 @@ const onWrapperClick = e => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('url 格式错误:' + url)
|
console.warn('url 格式错误:' + url)
|
||||||
}
|
}
|
||||||
|
} else if (config.value.events.type === 'refreshDataV') {
|
||||||
|
useEmitt().emitter.emit('componentRefresh')
|
||||||
|
} else if (config.value.events.type === 'fullScreen') {
|
||||||
|
useEmitt().emitter.emit('canvasFullscreen')
|
||||||
|
} else if (config.value.events.type === 'download') {
|
||||||
|
useEmitt().emitter.emit('canvasDownload')
|
||||||
}
|
}
|
||||||
e.preventDefault()
|
e?.preventDefault()
|
||||||
e.stopPropagation()
|
e?.stopPropagation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,12 +365,47 @@ const initOpenHandler = newWindow => {
|
|||||||
}
|
}
|
||||||
const deepScale = computed(() => scale.value / 100)
|
const deepScale = computed(() => scale.value / 100)
|
||||||
const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc && props.active))
|
const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc && props.active))
|
||||||
|
|
||||||
|
const freezeFlag = computed(() => {
|
||||||
|
return (
|
||||||
|
isMainCanvas(props.canvasId) &&
|
||||||
|
config.value.freeze &&
|
||||||
|
scrollMain.value - config.value.style?.top > 0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
const commonParams = computed(() => {
|
||||||
|
return {
|
||||||
|
eventEnable: eventEnable.value,
|
||||||
|
eventType: config.value.events.type
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const showCheck = computed(() => {
|
||||||
|
return dvMainStore.mobileInPc && showPosition.value === 'edit'
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateFromMobile = (e, type) => {
|
||||||
|
if (type === 'syncPcDesign') {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
useEmitt().emitter.emit('onMobileStatusChange', {
|
||||||
|
type: type,
|
||||||
|
value: config.value.id
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="wrapper-outer"
|
class="wrapper-outer"
|
||||||
:class="showPosition + '-' + config.component"
|
:class="[
|
||||||
|
showPosition + '-' + config.component,
|
||||||
|
{
|
||||||
|
'freeze-component': freezeFlag
|
||||||
|
}
|
||||||
|
]"
|
||||||
:id="wrapperId"
|
:id="wrapperId"
|
||||||
@mousedown="handleInnerMouseDown"
|
@mousedown="handleInnerMouseDown"
|
||||||
@mouseenter="onMouseEnter"
|
@mouseenter="onMouseEnter"
|
||||||
@ -352,6 +413,16 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
element-loading-text="导出中..."
|
element-loading-text="导出中..."
|
||||||
element-loading-background="rgba(255, 255, 255, 1)"
|
element-loading-background="rgba(255, 255, 255, 1)"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
:title="$t('visualization.sync_pc_design')"
|
||||||
|
v-if="showCheck"
|
||||||
|
class="refresh-from-pc"
|
||||||
|
@click="updateFromMobile($event, 'syncPcDesign')"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Icon name="icon_replace_outlined"><replaceOutlined class="svg-icon" /></Icon>
|
||||||
|
</el-icon>
|
||||||
|
</div>
|
||||||
<component-edit-bar
|
<component-edit-bar
|
||||||
v-if="!showPosition.includes('canvas') && !props.isSelector"
|
v-if="!showPosition.includes('canvas') && !props.isSelector"
|
||||||
class="wrapper-edit-bar"
|
class="wrapper-edit-bar"
|
||||||
@ -361,6 +432,7 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
:element="config"
|
:element="config"
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
:class="{ 'wrapper-edit-bar-active': active }"
|
:class="{ 'wrapper-edit-bar-active': active }"
|
||||||
|
@componentImageDownload="htmlToImage"
|
||||||
@userViewEnlargeOpen="opt => emits('userViewEnlargeOpen', opt)"
|
@userViewEnlargeOpen="opt => emits('userViewEnlargeOpen', opt)"
|
||||||
@datasetParamsInit="() => emits('datasetParamsInit')"
|
@datasetParamsInit="() => emits('datasetParamsInit')"
|
||||||
></component-edit-bar>
|
></component-edit-bar>
|
||||||
@ -382,7 +454,7 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
class="wrapper-inner-adaptor"
|
class="wrapper-inner-adaptor"
|
||||||
:style="slotStyle"
|
:style="slotStyle"
|
||||||
:class="{ 'pop-wrapper-inner': showActive, 'event-active': eventEnable }"
|
:class="{ 'pop-wrapper-inner': showActive, 'event-active': eventEnable }"
|
||||||
@mousedown="onWrapperClick"
|
@mousedown="onWrapperClickCur"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
:is="findComponent(config['component'])"
|
:is="findComponent(config['component'])"
|
||||||
@ -406,7 +478,10 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
:is-edit="false"
|
:is-edit="false"
|
||||||
:suffix-id="suffixId"
|
:suffix-id="suffixId"
|
||||||
:font-family="fontFamily"
|
:font-family="fontFamily"
|
||||||
|
:active="active"
|
||||||
|
:common-params="commonParams"
|
||||||
@onPointClick="onPointClick"
|
@onPointClick="onPointClick"
|
||||||
|
@onComponentEvent="onWrapperClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!--边框背景-->
|
<!--边框背景-->
|
||||||
@ -426,12 +501,22 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
}
|
}
|
||||||
.wrapper-outer {
|
.wrapper-outer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
.refresh-from-pc {
|
||||||
|
position: absolute;
|
||||||
|
right: 38px;
|
||||||
|
top: 12px;
|
||||||
|
z-index: 2;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--ed-color-primary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.wrapper-inner {
|
.wrapper-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-size: 100% 100% !important;
|
background-size: 100% 100% !important;
|
||||||
|
padding: 0 !important;
|
||||||
.wrapper-inner-adaptor {
|
.wrapper-inner-adaptor {
|
||||||
position: relative;
|
position: relative;
|
||||||
transform-style: preserve-3d;
|
transform-style: preserve-3d;
|
||||||
@ -475,4 +560,11 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
.event-active {
|
.event-active {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.freeze-component {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
|
top: var(--top-show-offset) px !important;
|
||||||
|
left: var(--left-show-offset) px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -298,64 +298,73 @@ const editQueryCriteria = () => {
|
|||||||
<el-divider class="custom-divider" />
|
<el-divider class="custom-divider" />
|
||||||
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
||||||
</template>
|
</template>
|
||||||
<li
|
<template v-else>
|
||||||
v-show="!(!curComponent || curComponent['isLock'] || curComponent['component'] != 'Group')"
|
<li
|
||||||
@click="decompose()"
|
v-show="
|
||||||
>
|
!(!curComponent || curComponent['isLock'] || curComponent['component'] != 'Group')
|
||||||
{{ t('visualization.cancel_group') }}
|
"
|
||||||
</li>
|
@click="decompose()"
|
||||||
<el-divider class="custom-divider" v-show="composeDivider" />
|
>
|
||||||
<template v-if="curComponent">
|
{{ t('visualization.cancel_group') }}
|
||||||
<template v-if="!curComponent['isLock'] && curComponent.category === 'hidden'">
|
</li>
|
||||||
<li @click="categoryChange('base')">{{ t('visualization.move_to_screen_show') }}</li>
|
<el-divider class="custom-divider" v-show="composeDivider" />
|
||||||
<li @click="editQueryCriteria">{{ t('visualization.edit') }}</li>
|
<template v-if="curComponent">
|
||||||
<li v-if="activePosition === 'aside'" @click="rename">{{ t('visualization.rename') }}</li>
|
<template v-if="!curComponent['isLock'] && curComponent.category === 'hidden'">
|
||||||
<li @click="copy">{{ t('visualization.copy') }}</li>
|
<li @click="categoryChange('base')">{{ t('visualization.move_to_screen_show') }}</li>
|
||||||
<li @click="paste">{{ t('visualization.paste') }}</li>
|
<li @click="editQueryCriteria">{{ t('visualization.edit') }}</li>
|
||||||
<el-divider class="custom-divider" />
|
<li v-if="activePosition === 'aside'" @click="rename">
|
||||||
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
{{ t('visualization.rename') }}
|
||||||
|
</li>
|
||||||
|
<li @click="copy">{{ t('visualization.copy') }}</li>
|
||||||
|
<li @click="paste">{{ t('visualization.paste') }}</li>
|
||||||
|
<el-divider class="custom-divider" />
|
||||||
|
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
||||||
|
</template>
|
||||||
|
<template v-if="!curComponent['isLock'] && curComponent.category !== 'hidden'">
|
||||||
|
<li v-if="curComponent.component === 'VQuery'" @click="editQueryCriteria">
|
||||||
|
{{ t('visualization.edit') }}
|
||||||
|
</li>
|
||||||
|
<li @click="upComponent">{{ t('visualization.up_component') }}</li>
|
||||||
|
<li @click="downComponent">{{ t('visualization.down_component') }}</li>
|
||||||
|
<li @click="topComponent">{{ t('visualization.top_component') }}</li>
|
||||||
|
<li @click="bottomComponent">{{ t('visualization.bottom_component') }}</li>
|
||||||
|
<li @click="customSort" v-if="curComponent.component === 'DeTabs'">
|
||||||
|
{{ t('visualization.sort') }}
|
||||||
|
</li>
|
||||||
|
<xpack-component
|
||||||
|
:chart="curComponent"
|
||||||
|
is-screen
|
||||||
|
resource-table="snapshot"
|
||||||
|
jsname="L2NvbXBvbmVudC90aHJlc2hvbGQtd2FybmluZy9FZGl0QmFySGFuZGxlcg=="
|
||||||
|
/>
|
||||||
|
<li @click="categoryChange('hidden')" v-show="showMoveMenu">
|
||||||
|
{{ t('visualization.move_to_pop_area') }}
|
||||||
|
</li>
|
||||||
|
<el-divider class="custom-divider" />
|
||||||
|
<li @click="hide" v-show="curComponent['isShow']">{{ t('visualization.hidden') }}</li>
|
||||||
|
<li @click="show" v-show="!curComponent['isShow'] || isGroupArea">
|
||||||
|
{{ t('visualization.cancel_hidden') }}
|
||||||
|
</li>
|
||||||
|
<li @click="lock">{{ t('visualization.lock') }}</li>
|
||||||
|
<li v-if="curComponent['isLock'] || isGroupArea" @click="unlock">
|
||||||
|
{{ t('visualization.unlock') }}
|
||||||
|
</li>
|
||||||
|
<el-divider class="custom-divider" />
|
||||||
|
<li v-if="activePosition === 'aside'" @click="rename">
|
||||||
|
{{ t('visualization.rename') }}
|
||||||
|
</li>
|
||||||
|
<li @click="copy">{{ t('visualization.copy') }}</li>
|
||||||
|
<li @click="paste">{{ t('visualization.paste') }}</li>
|
||||||
|
<li @click="cut">{{ t('visualization.cut') }}</li>
|
||||||
|
<el-divider class="custom-divider" />
|
||||||
|
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
||||||
|
</template>
|
||||||
|
<li v-if="curComponent['isLock']" @click="unlock">{{ t('visualization.unlock') }}</li>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="!curComponent['isLock'] && curComponent.category !== 'hidden'">
|
<li v-else-if="!curComponent && !areaData.components.length" @click="paste">
|
||||||
<li v-if="curComponent.component === 'VQuery'" @click="editQueryCriteria">
|
{{ t('visualization.paste') }}
|
||||||
{{ t('visualization.edit') }}
|
</li>
|
||||||
</li>
|
|
||||||
<li @click="upComponent">{{ t('visualization.up_component') }}</li>
|
|
||||||
<li @click="downComponent">{{ t('visualization.down_component') }}</li>
|
|
||||||
<li @click="topComponent">{{ t('visualization.top_component') }}</li>
|
|
||||||
<li @click="bottomComponent">{{ t('visualization.bottom_component') }}</li>
|
|
||||||
<li @click="customSort" v-if="curComponent.component === 'DeTabs'">
|
|
||||||
{{ t('visualization.sort') }}
|
|
||||||
</li>
|
|
||||||
<xpack-component
|
|
||||||
:chart="curComponent"
|
|
||||||
is-screen
|
|
||||||
jsname="L2NvbXBvbmVudC90aHJlc2hvbGQtd2FybmluZy9FZGl0QmFySGFuZGxlcg=="
|
|
||||||
/>
|
|
||||||
<li @click="categoryChange('hidden')" v-show="showMoveMenu">
|
|
||||||
{{ t('visualization.move_to_pop_area') }}
|
|
||||||
</li>
|
|
||||||
<el-divider class="custom-divider" />
|
|
||||||
<li @click="hide" v-show="curComponent['isShow']">{{ t('visualization.hidden') }}</li>
|
|
||||||
<li @click="show" v-show="!curComponent['isShow'] || isGroupArea">
|
|
||||||
{{ t('visualization.cancel_hidden') }}
|
|
||||||
</li>
|
|
||||||
<li @click="lock">{{ t('visualization.lock') }}</li>
|
|
||||||
<li v-if="curComponent['isLock'] || isGroupArea" @click="unlock">
|
|
||||||
{{ t('visualization.unlock') }}
|
|
||||||
</li>
|
|
||||||
<el-divider class="custom-divider" />
|
|
||||||
<li v-if="activePosition === 'aside'" @click="rename">{{ t('visualization.rename') }}</li>
|
|
||||||
<li @click="copy">{{ t('visualization.copy') }}</li>
|
|
||||||
<li @click="paste">{{ t('visualization.paste') }}</li>
|
|
||||||
<li @click="cut">{{ t('visualization.cut') }}</li>
|
|
||||||
<el-divider class="custom-divider" />
|
|
||||||
<li @click="deleteComponent">{{ t('visualization.delete') }}</li>
|
|
||||||
</template>
|
|
||||||
<li v-if="curComponent['isLock']" @click="unlock">{{ t('visualization.unlock') }}</li>
|
|
||||||
</template>
|
</template>
|
||||||
<li v-else-if="!curComponent && !areaData.components.length" @click="paste">
|
|
||||||
{{ t('visualization.paste') }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { changeStyleWithScale } from '@/data-visualization/utils/translate'
|
import { getCanvasStyle, getShapeItemStyle } from '@/data-visualization/utils/translate'
|
||||||
import ComponentWrapper from './ComponentWrapper.vue'
|
import ComponentWrapper from './ComponentWrapper.vue'
|
||||||
import { getCanvasStyle, getShapeItemStyle } from '@/data-visualization/utils/style'
|
import { changeStyleWithScale } from '@/data-visualization/utils/translate'
|
||||||
|
|
||||||
import { computed, nextTick, ref, toRefs, watch, onBeforeUnmount, onMounted, reactive } from 'vue'
|
import { computed, nextTick, ref, toRefs, watch, onBeforeUnmount, onMounted, reactive } from 'vue'
|
||||||
import { changeRefComponentsSizeWithScalePoint } from '@/data-visualization/utils/changeComponentsSizeWithScale'
|
import { changeRefComponentsSizeWithScalePoint } from '@/data-visualization/utils/changeComponentsSizeWithScale'
|
||||||
|
|
||||||
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||||
import UserViewEnlarge from '@/data-visualization/components/visualization/UserViewEnlarge.vue'
|
import UserViewEnlarge from '@/data-visualization/components/visualization/UserViewEnlarge.vue'
|
||||||
|
import CanvasOptBar from '@/data-visualization/components/visualization/CanvasOptBar.vue'
|
||||||
import { isDashboard, isMainCanvas, refreshOtherComponent } from '@/data-visualization/utils/canvasUtils'
|
import { isDashboard, isMainCanvas, refreshOtherComponent } from '@/data-visualization/utils/canvasUtils'
|
||||||
import { activeWatermarkCheckUser } from '@/data-visualization/components/watermark/watermark'
|
import { activeWatermarkCheckUser } from '@/data-visualization/components/watermark/watermark'
|
||||||
|
import { XpackComponent } from '@/data-visualization/components/plugin'
|
||||||
|
|
||||||
import PopArea from '@/data-visualization/custom-component/pop-area/Component.vue'
|
import PopArea from '@/data-visualization/custom-component/pop-area/Component.vue'
|
||||||
|
// import CanvasFilterBtn from '@/data-visualization/custom-component/canvas-filter-btn/Component.vue'
|
||||||
|
import { useEmitt } from '@/data-visualization/hooks/web/useEmitt'
|
||||||
import DatasetParamsComponent from '@/data-visualization/components/visualization/DatasetParamsComponent.vue'
|
import DatasetParamsComponent from '@/data-visualization/components/visualization/DatasetParamsComponent.vue'
|
||||||
// import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
import DeFullscreen from '@/data-visualization/components/visualization/common/DeFullscreen.vue'
|
||||||
import EmptyBackground from '../../empty-background/src/EmptyBackground.vue'
|
import EmptyBackground from '../../empty-background/src/EmptyBackground.vue'
|
||||||
|
// import LinkOptBar from '@/data-visualization/components/data-visualization/canvas/LinkOptBar.vue'
|
||||||
import { isDesktop } from '@/data-visualization/utils/ModelUtil'
|
import { isDesktop } from '@/data-visualization/utils/ModelUtil'
|
||||||
import { isMobile } from '@/data-visualization/utils/utils'
|
import { isMobile } from '@/data-visualization/utils/utils'
|
||||||
|
import { useI18n } from '@/data-visualization/hooks/web/useI18n'
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { pcMatrixCount, curComponent, mobileInPc, canvasState, inMobile } = storeToRefs(dvMainStore)
|
const { pcMatrixCount, curComponent, mobileInPc, canvasState, inMobile } = storeToRefs(dvMainStore)
|
||||||
const openHandler = ref(null)
|
const openHandler = ref(null)
|
||||||
@ -30,6 +30,7 @@ const emits = defineEmits(['onResetLayout'])
|
|||||||
const fullScreeRef = ref(null)
|
const fullScreeRef = ref(null)
|
||||||
const isOverSize = ref(false)
|
const isOverSize = ref(false)
|
||||||
const isDesktopFlag = isDesktop()
|
const isDesktopFlag = isDesktop()
|
||||||
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
canvasStyleData: {
|
canvasStyleData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -93,6 +94,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'inherit'
|
default: 'inherit'
|
||||||
|
},
|
||||||
|
// 联动按钮位置
|
||||||
|
showLinkageButton: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,7 +131,8 @@ const dashboardActive = computed(() => {
|
|||||||
return dvInfo.value.type === 'dashboard'
|
return dvInfo.value.type === 'dashboard'
|
||||||
})
|
})
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
initState: true
|
initState: true,
|
||||||
|
scrollMain: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
const curSearchCount = computed(() => {
|
const curSearchCount = computed(() => {
|
||||||
@ -171,6 +178,7 @@ const canvasStyle = computed(() => {
|
|||||||
if (canvasStyleData.value?.screenAdaptor === 'keep') {
|
if (canvasStyleData.value?.screenAdaptor === 'keep') {
|
||||||
style['height'] = canvasStyleData.value?.height + 'px'
|
style['height'] = canvasStyleData.value?.height + 'px'
|
||||||
style['width'] = canvasStyleData.value?.width + 'px'
|
style['width'] = canvasStyleData.value?.width + 'px'
|
||||||
|
style['margin'] = 'auto'
|
||||||
} else {
|
} else {
|
||||||
style['height'] = dashboardActive.value
|
style['height'] = dashboardActive.value
|
||||||
? downloadStatus.value
|
? downloadStatus.value
|
||||||
@ -217,6 +225,30 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
useEmitt({
|
||||||
|
name: 'tabCanvasChange-' + canvasId.value,
|
||||||
|
callback: function () {
|
||||||
|
restore()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
useEmitt({
|
||||||
|
name: 'componentRefresh',
|
||||||
|
callback: function () {
|
||||||
|
if (isMainCanvas(canvasId.value)) {
|
||||||
|
refreshDataV()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
useEmitt({
|
||||||
|
name: 'canvasFullscreen',
|
||||||
|
callback: function () {
|
||||||
|
if (isMainCanvas(canvasId.value)) {
|
||||||
|
fullScreeRef.value.toggleFullscreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const resetLayout = () => {
|
const resetLayout = () => {
|
||||||
if (downloadStatus.value) {
|
if (downloadStatus.value) {
|
||||||
@ -446,6 +478,12 @@ const downloadAsPDF = () => {
|
|||||||
// test
|
// test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scrollPreview = () => {
|
||||||
|
state.scrollMain = previewCanvas.value.scrollTop
|
||||||
|
}
|
||||||
|
|
||||||
|
const showUnpublishFlag = computed(() => dvInfo.value?.status === 0 && isMainCanvas(canvasId.value))
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
restore
|
restore
|
||||||
})
|
})
|
||||||
@ -456,13 +494,18 @@ defineExpose({
|
|||||||
:id="domId"
|
:id="domId"
|
||||||
class="canvas-container"
|
class="canvas-container"
|
||||||
:style="canvasStyle"
|
:style="canvasStyle"
|
||||||
:class="{ 'de-download-custom': downloadStatus, 'datav-preview': dataVPreview }"
|
:class="{
|
||||||
|
'de-download-custom': downloadStatus,
|
||||||
|
'datav-preview': dataVPreview,
|
||||||
|
'datav-preview-unpublish': showUnpublishFlag
|
||||||
|
}"
|
||||||
ref="previewCanvas"
|
ref="previewCanvas"
|
||||||
@mousedown="handleMouseDown"
|
@mousedown="handleMouseDown"
|
||||||
|
@scroll="scrollPreview"
|
||||||
v-if="state.initState"
|
v-if="state.initState"
|
||||||
>
|
>
|
||||||
<!--弹框触发区域-->
|
<!--弹框触发区域-->
|
||||||
<!-- <canvas-filter-btn :is-fixed="isOverSize" v-if="filterBtnShow"></canvas-filter-btn> -->
|
<canvas-filter-btn :is-fixed="isOverSize" v-if="filterBtnShow"></canvas-filter-btn>
|
||||||
<!-- 弹框区域 -->
|
<!-- 弹框区域 -->
|
||||||
<PopArea
|
<PopArea
|
||||||
v-if="popAreaAvailable"
|
v-if="popAreaAvailable"
|
||||||
@ -475,8 +518,15 @@ defineExpose({
|
|||||||
:canvas-state="canvasState"
|
:canvas-state="canvasState"
|
||||||
:show-position="'preview'"
|
:show-position="'preview'"
|
||||||
></PopArea>
|
></PopArea>
|
||||||
<template v-if="renderReady">
|
<canvas-opt-bar
|
||||||
<ComponentWrapper
|
v-if="showLinkageButton"
|
||||||
|
:canvas-id="canvasId"
|
||||||
|
:canvas-style-data="canvasStyleData"
|
||||||
|
:component-data="baseComponentData"
|
||||||
|
:is-fixed="isOverSize"
|
||||||
|
></canvas-opt-bar>
|
||||||
|
<template v-if="renderReady && !showUnpublishFlag">
|
||||||
|
<component-wrapper
|
||||||
v-for="(item, index) in baseComponentData"
|
v-for="(item, index) in baseComponentData"
|
||||||
v-show="item.isShow"
|
v-show="item.isShow"
|
||||||
:active="item.id === (curComponent || {})['id']"
|
:active="item.id === (curComponent || {})['id']"
|
||||||
@ -493,16 +543,32 @@ defineExpose({
|
|||||||
:scale="mobileInPc && isDashboard() ? 100 : scaleMin"
|
:scale="mobileInPc && isDashboard() ? 100 : scaleMin"
|
||||||
:is-selector="props.isSelector"
|
:is-selector="props.isSelector"
|
||||||
:font-family="canvasStyleData.fontFamily || fontFamily"
|
:font-family="canvasStyleData.fontFamily || fontFamily"
|
||||||
|
:scroll-main="state.scrollMain"
|
||||||
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
|
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
|
||||||
@datasetParamsInit="datasetParamsInit(item)"
|
@datasetParamsInit="datasetParamsInit(item)"
|
||||||
@onPointClick="onPointClick"
|
@onPointClick="onPointClick"
|
||||||
|
:index="index"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<empty-background
|
||||||
|
v-if="showUnpublishFlag"
|
||||||
|
:description="t('visualization.resource_not_published')"
|
||||||
|
img-type="none"
|
||||||
|
>
|
||||||
|
</empty-background>
|
||||||
<user-view-enlarge ref="userViewEnlargeRef"></user-view-enlarge>
|
<user-view-enlarge ref="userViewEnlargeRef"></user-view-enlarge>
|
||||||
</div>
|
</div>
|
||||||
<empty-background v-if="!state.initState" description="参数不能为空" img-type="noneWhite" />
|
<empty-background v-if="!state.initState" description="参数不能为空" img-type="noneWhite" />
|
||||||
<!-- <de-fullscreen ref="fullScreeRef"></de-fullscreen> -->
|
<de-fullscreen ref="fullScreeRef"></de-fullscreen>
|
||||||
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
||||||
|
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
||||||
|
<link-opt-bar
|
||||||
|
v-if="linkOptBarShow"
|
||||||
|
ref="link-opt-bar"
|
||||||
|
:terminal="'pc'"
|
||||||
|
:canvas-style-data="canvasStyleData"
|
||||||
|
@link-export-pdf="downloadAsPDF"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@ -530,4 +596,8 @@ defineExpose({
|
|||||||
.datav-preview {
|
.datav-preview {
|
||||||
overflow-y: hidden !important;
|
overflow-y: hidden !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.datav-preview-unpublish {
|
||||||
|
background-color: inherit !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="shape"
|
class="shape"
|
||||||
:class="{ 'shape-group-area': isGroupArea }"
|
:class="{
|
||||||
|
'shape-group-area': isGroupArea,
|
||||||
|
'freeze-component': freezeFlag,
|
||||||
|
'freeze-component-fullscreen': freezeFlag && fullscreenFlag
|
||||||
|
}"
|
||||||
ref="shapeInnerRef"
|
ref="shapeInnerRef"
|
||||||
:id="domId"
|
:id="domId"
|
||||||
v-loading="downLoading"
|
v-loading="downLoading"
|
||||||
@ -55,6 +59,7 @@
|
|||||||
:element="element"
|
:element="element"
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
:canvas-id="canvasId"
|
:canvas-id="canvasId"
|
||||||
|
@componentImageDownload="htmlToImage"
|
||||||
@userViewEnlargeOpen="userViewEnlargeOpen"
|
@userViewEnlargeOpen="userViewEnlargeOpen"
|
||||||
@datasetParamsInit="datasetParamsInit"
|
@datasetParamsInit="datasetParamsInit"
|
||||||
@linkJumpSetOpen="linkJumpSetOpen"
|
@linkJumpSetOpen="linkJumpSetOpen"
|
||||||
@ -177,7 +182,8 @@ const {
|
|||||||
tabMoveOutComponentId,
|
tabMoveOutComponentId,
|
||||||
mobileInPc,
|
mobileInPc,
|
||||||
mainScrollTop,
|
mainScrollTop,
|
||||||
hiddenListStatus
|
hiddenListStatus,
|
||||||
|
fullscreenFlag
|
||||||
} = storeToRefs(dvMainStore)
|
} = storeToRefs(dvMainStore)
|
||||||
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
@ -326,6 +332,14 @@ const initialAngle = {
|
|||||||
}
|
}
|
||||||
const cursors = ref({})
|
const cursors = ref({})
|
||||||
|
|
||||||
|
const freezeFlag = computed(() => {
|
||||||
|
return (
|
||||||
|
isMainCanvas(canvasId.value) &&
|
||||||
|
element.value.freeze &&
|
||||||
|
mainScrollTop.value - defaultStyle.value.top > 0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
const showCheck = computed(() => {
|
const showCheck = computed(() => {
|
||||||
return mobileInPc.value && element.value.canvasId === 'canvas-main'
|
return mobileInPc.value && element.value.canvasId === 'canvas-main'
|
||||||
})
|
})
|
||||||
@ -386,7 +400,7 @@ const getPointList = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isActive = () => {
|
const isActive = () => {
|
||||||
return active.value && !element.value['isLock'] && isEditMode.value
|
return active.value && !element.value['isLock'] && isEditMode.value && !freezeFlag.value
|
||||||
}
|
}
|
||||||
|
|
||||||
const userViewEnlargeOpen = opt => {
|
const userViewEnlargeOpen = opt => {
|
||||||
@ -538,7 +552,8 @@ const handleMouseDownOnShape = e => {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
if (element.value['isLock'] || !isEditMode.value) return
|
// 锁定 非编辑状态 冻结状态 不进行移动
|
||||||
|
if (element.value['isLock'] || !isEditMode.value || freezeFlag.value) return
|
||||||
|
|
||||||
cursors.value = getCursor() // 根据旋转角度获取光标位置
|
cursors.value = getCursor() // 根据旋转角度获取光标位置
|
||||||
|
|
||||||
@ -897,30 +912,6 @@ const commonBackgroundSvgInner = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const padding3D = computed(() => {
|
|
||||||
const width = defaultStyle.value.width // 原始元素宽度
|
|
||||||
const height = defaultStyle.value.height // 原始元素高度
|
|
||||||
const rotateX = element.value['multiDimensional'].x // 旋转X角度
|
|
||||||
const rotateY = element.value['multiDimensional'].y // 旋转Y角度
|
|
||||||
|
|
||||||
// 将角度转换为弧度
|
|
||||||
const radX = (rotateX * Math.PI) / 180
|
|
||||||
const radY = (rotateY * Math.PI) / 180
|
|
||||||
|
|
||||||
// 计算旋转后新宽度和高度
|
|
||||||
const newWidth = Math.abs(width * Math.cos(radY)) + Math.abs(height * Math.sin(radX))
|
|
||||||
const newHeight = Math.abs(height * Math.cos(radX)) + Math.abs(width * Math.sin(radY))
|
|
||||||
|
|
||||||
// 计算需要的 padding
|
|
||||||
const paddingX = (newWidth - width) / 2
|
|
||||||
const paddingY = (newHeight - height) / 2
|
|
||||||
|
|
||||||
return {
|
|
||||||
paddingX: `${paddingX}px`,
|
|
||||||
paddingY: `${paddingY}px`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const componentBackgroundStyle = computed(() => {
|
const componentBackgroundStyle = computed(() => {
|
||||||
if (element.value.commonBackground && element.value.component !== 'GroupArea') {
|
if (element.value.commonBackground && element.value.component !== 'GroupArea') {
|
||||||
const {
|
const {
|
||||||
@ -1107,12 +1098,15 @@ const dragCollision = computed(() => {
|
|||||||
|
|
||||||
const htmlToImage = () => {
|
const htmlToImage = () => {
|
||||||
downLoading.value = true
|
downLoading.value = true
|
||||||
|
useEmitt().emitter.emit('l7-prepare-picture', element.value.id)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value)
|
activeWatermarkCheckUser(viewDemoInnerId.value, 'canvas-main', scale.value)
|
||||||
downloadCanvas2('img', componentInnerRef.value, '图表', () => {
|
const dom = document.getElementById(viewDemoInnerId.value)
|
||||||
|
downloadCanvas2('img', dom, '图表', () => {
|
||||||
// do callback
|
// do callback
|
||||||
removeActiveWatermark(viewDemoInnerId.value)
|
removeActiveWatermark(viewDemoInnerId.value)
|
||||||
downLoading.value = false
|
downLoading.value = false
|
||||||
|
useEmitt().emitter.emit('l7-unprepare-picture', element.value.id)
|
||||||
})
|
})
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
@ -1138,13 +1132,11 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
settingAttribute()
|
settingAttribute()
|
||||||
const methodName = 'componentImageDownload-' + element.value.id
|
const methodName = 'componentImageDownload-' + element.value.id
|
||||||
useEmitt().emitter.off(methodName)
|
if (!useEmitt().emitter.all.get(methodName)?.length) {
|
||||||
useEmitt({
|
useEmitt().emitter.on(methodName, () => {
|
||||||
name: methodName,
|
|
||||||
callback: () => {
|
|
||||||
htmlToImage()
|
htmlToImage()
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -1189,6 +1181,7 @@ onMounted(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-size: 100% 100% !important;
|
background-size: 100% 100% !important;
|
||||||
|
padding:0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shape-selected {
|
.shape-selected {
|
||||||
@ -1318,4 +1311,14 @@ onMounted(() => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
transform-style: preserve-3d;
|
transform-style: preserve-3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.freeze-component {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
|
top: 66px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeze-component-fullscreen {
|
||||||
|
top: 5px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user