refactor(数据大屏): 数据大屏批量设置样式调整

This commit is contained in:
wangjiahao 2024-07-25 16:18:37 +08:00
parent fb3fbf339b
commit 2e21e38cf9
2 changed files with 8 additions and 3 deletions

View File

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

View File

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