Merge pull request #11178 from dataease/pr@dev-v2@refactor_batch

Pr@dev v2@refactor batch
This commit is contained in:
王嘉豪 2024-07-25 16:28:11 +08:00 committed by GitHub
commit 48e3fe9da1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -34,7 +34,7 @@ const props = withDefaults(
const { themes, element, showStyle } = toRefs(props)
const dvMainStore = dvMainStoreWithOut()
const { dvInfo } = storeToRefs(dvMainStore)
const { dvInfo, batchOptStatus } = storeToRefs(dvMainStore)
const activeName = ref(element.value.collapseName)
const styleKeys = computed(() => {
@ -53,6 +53,11 @@ const onChange = () => {
const isIncludesColor = str => {
return str.toLowerCase().includes('color')
}
const positionComponentShow = computed(() => {
return !batchOptStatus.value && !dashboardActive.value
})
const dashboardActive = computed(() => {
return dvInfo.value.type === 'dashboard'
})
@ -123,7 +128,7 @@ const stopEvent = e => {
<template>
<div class="v-common-attr" ref="containerRef">
<el-collapse v-model="activeName" @change="onChange()">
<el-collapse-item :effect="themes" title="位置" name="position" v-if="!dashboardActive">
<el-collapse-item :effect="themes" title="位置" name="position" v-if="positionComponentShow">
<component-position :themes="themes" />
</el-collapse-item>

View File

@ -16,6 +16,8 @@ import { useEmitt } from '@/hooks/web/useEmitt'
import chartViewManager from '@/views/chart/components/js/panel'
import {
COMMON_COMPONENT_BACKGROUND_BASE,
COMMON_COMPONENT_BACKGROUND_DARK,
COMMON_COMPONENT_BACKGROUND_LIGHT,
defaultStyleValue,
findBaseDeFaultAttr
} from '@/custom-component/component-list'
@ -630,7 +632,11 @@ export const dvMainStore = defineStore('dataVisualization', {
mode: 'batchOpt',
render: batchAttachInfo.render,
type: batchAttachInfo.type,
commonBackground: deepCopy(COMMON_COMPONENT_BACKGROUND_BASE),
commonBackground: deepCopy(
this.curOriginThemes === 'light'
? COMMON_COMPONENT_BACKGROUND_LIGHT
: COMMON_COMPONENT_BACKGROUND_DARK
),
customAttr: this.changeProperties.customAttr,
customStyle: this.changeProperties.customStyle
}

View File

@ -33,7 +33,7 @@
:element="batchOptComponentInfo"
:show-style="mixProperties.includes('common-style')"
@onAttrChange="onStyleAttrChange"
themes="light"
:themes="themes"
></common-attr>
<el-row v-else class="view-selected-message-class">
<span class="select-view">请选择组件...</span>