forked from github/dataease
Merge pull request #9733 from dataease/pr@dev-v2@feat_hang-component
Pr@dev v2@feat hang component
This commit is contained in:
commit
d11dd04fed
@ -42,6 +42,7 @@ import PointShadow from '@/components/data-visualization/canvas/PointShadow.vue'
|
|||||||
import DragInfo from '@/components/visualization/common/DragInfo.vue'
|
import DragInfo from '@/components/visualization/common/DragInfo.vue'
|
||||||
import { activeWatermark } from '@/components/watermark/watermark'
|
import { activeWatermark } from '@/components/watermark/watermark'
|
||||||
import { personInfoApi } from '@/api/user'
|
import { personInfoApi } from '@/api/user'
|
||||||
|
import ComponentHangPopver from '@/custom-component/independent-hang/ComponentHangPopver.vue'
|
||||||
const snapshotStore = snapshotStoreWithOut()
|
const snapshotStore = snapshotStoreWithOut()
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const composeStore = composeStoreWithOut()
|
const composeStore = composeStoreWithOut()
|
||||||
|
@ -211,6 +211,7 @@ const list = [
|
|||||||
propValue: '',
|
propValue: '',
|
||||||
icon: 'other_text',
|
icon: 'other_text',
|
||||||
innerType: 'VQuery',
|
innerType: 'VQuery',
|
||||||
|
isHang: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 72,
|
sizeX: 72,
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hang-main" @keydown.stop @keyup.stop>
|
||||||
|
<div :key="index" v-for="(config, index) in hangComponentData">
|
||||||
|
<component
|
||||||
|
:is="findComponent(config['component'])"
|
||||||
|
:view="canvasViewInfo[config['id']]"
|
||||||
|
ref="component"
|
||||||
|
class="component"
|
||||||
|
:element="config"
|
||||||
|
:scale="deepScale"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, toRefs } from 'vue'
|
||||||
|
import findComponent from '@/utils/components'
|
||||||
|
const props = defineProps({
|
||||||
|
hangComponentData: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
canvasViewInfo: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
scale: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 100
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { hangComponentData, scale } = toRefs(props)
|
||||||
|
const deepScale = computed(() => scale.value / 100)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.hang-main {
|
||||||
|
overflow: auto;
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,58 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, toRefs } from 'vue'
|
||||||
|
import ComponentHang from '@/custom-component/independent-hang/ComponentHang.vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
componentData: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
canvasViewInfo: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
themes: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: 'dark'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { componentData, canvasViewInfo } = toRefs(props)
|
||||||
|
|
||||||
|
const hangComponentData = computed(() =>
|
||||||
|
componentData.value.filter(ele => {
|
||||||
|
return ele.component === 'VQuery' && ele.isHang === true
|
||||||
|
})
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-popover
|
||||||
|
width="300"
|
||||||
|
trigger="click"
|
||||||
|
:show-arrow="false"
|
||||||
|
:popper-class="'custom-popover-' + themes"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<div class="reference-position">
|
||||||
|
<el-button style="margin-right: 16px">隐藏按钮</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div>
|
||||||
|
<component-hang
|
||||||
|
:hang-component-data="hangComponentData"
|
||||||
|
:canvas-view-info="canvasViewInfo"
|
||||||
|
:scale="100"
|
||||||
|
>
|
||||||
|
</component-hang>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.reference-position {
|
||||||
|
position: absolute;
|
||||||
|
right: 100px;
|
||||||
|
top: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -9,6 +9,10 @@ const state = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
element: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
chart: {
|
chart: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
@ -24,7 +28,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
const predefineColors = COLOR_PANEL
|
const predefineColors = COLOR_PANEL
|
||||||
|
|
||||||
const { chart, commonBackgroundPop } = toRefs(props)
|
const { element, chart, commonBackgroundPop } = toRefs(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -33,6 +37,11 @@ const { chart, commonBackgroundPop } = toRefs(props)
|
|||||||
<el-collapse v-model="state.styleActiveNames" class="style-collapse">
|
<el-collapse v-model="state.styleActiveNames" class="style-collapse">
|
||||||
<el-collapse-item :effect="themes" name="component" :title="t('visualization.module')">
|
<el-collapse-item :effect="themes" name="component" :title="t('visualization.module')">
|
||||||
<el-form label-position="top">
|
<el-form label-position="top">
|
||||||
|
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
|
||||||
|
<el-checkbox :effect="themes" v-model="element.isHang" size="small">
|
||||||
|
隐藏组件
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
|
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:effect="themes"
|
:effect="themes"
|
||||||
|
@ -1512,15 +1512,20 @@ const drop = (ev: MouseEvent, type = 'xAxis') => {
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="!canvasCollapse.chartAreaCollapse" style="width: 240px" class="view-panel-row">
|
<div v-if="!canvasCollapse.chartAreaCollapse" style="width: 240px" class="view-panel-row">
|
||||||
<el-row class="editor-title">
|
<el-row class="editor-title">
|
||||||
<span class="name-area" @dblclick="editComponentName" id="component-name">{{
|
<span
|
||||||
view.title
|
class="name-area"
|
||||||
}}</span>
|
:class="{ 'component-name-dark': themes === 'dark' }"
|
||||||
|
@dblclick="editComponentName"
|
||||||
|
id="component-name"
|
||||||
|
>{{ view.title }}</span
|
||||||
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row style="height: calc(100vh - 110px); overflow-y: auto">
|
<el-row style="height: calc(100vh - 110px); overflow-y: auto">
|
||||||
<div class="query-style-tab" v-if="view.type === 'VQuery'">
|
<div class="query-style-tab" v-if="view.type === 'VQuery' && curComponent">
|
||||||
<div style="padding-top: 1px">
|
<div style="padding-top: 1px">
|
||||||
<VQueryChartStyle
|
<VQueryChartStyle
|
||||||
|
:element="curComponent"
|
||||||
:common-background-pop="curComponent?.commonBackground"
|
:common-background-pop="curComponent?.commonBackground"
|
||||||
:chart="view"
|
:chart="view"
|
||||||
:themes="themes"
|
:themes="themes"
|
||||||
@ -2889,6 +2894,7 @@ const drop = (ev: MouseEvent, type = 'xAxis') => {
|
|||||||
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
||||||
<Teleport v-if="componentNameEdit" :to="'#component-name'">
|
<Teleport v-if="componentNameEdit" :to="'#component-name'">
|
||||||
<input
|
<input
|
||||||
|
:effect="themes"
|
||||||
width="100%"
|
width="100%"
|
||||||
@change="onComponentNameChange"
|
@change="onComponentNameChange"
|
||||||
ref="componentNameInput"
|
ref="componentNameInput"
|
||||||
@ -4019,4 +4025,19 @@ span {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.component-name-dark {
|
||||||
|
input {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
color: @dv-canvas-main-font-color;
|
||||||
|
background-color: #050e21;
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid #295acc;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0 4px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -409,7 +409,7 @@ eventBus.on('handleNew', handleNew)
|
|||||||
<div style="width: auto; height: 100%" ref="leftSidebarRef">
|
<div style="width: auto; height: 100%" ref="leftSidebarRef">
|
||||||
<dv-sidebar
|
<dv-sidebar
|
||||||
v-if="commonPropertiesShow"
|
v-if="commonPropertiesShow"
|
||||||
:title="'属性'"
|
:title="curComponent['name']"
|
||||||
:width="240"
|
:width="240"
|
||||||
:side-name="'componentProp'"
|
:side-name="'componentProp'"
|
||||||
:aside-position="'right'"
|
:aside-position="'right'"
|
||||||
|
@ -93,7 +93,9 @@ public class DefaultCacheImpl implements DECacheService {
|
|||||||
@Override
|
@Override
|
||||||
public void keyRemove(String cacheName, String key) {
|
public void keyRemove(String cacheName, String key) {
|
||||||
Cache<Object, Object> cache = cacheManager.getCache(cacheName);
|
Cache<Object, Object> cache = cacheManager.getCache(cacheName);
|
||||||
cache.remove(key);
|
if(cache != null){
|
||||||
|
cache.remove(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
Loading…
Reference in New Issue
Block a user