mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
feat(图表): 树型展示的透视表行小计禁用维度配置
This commit is contained in:
parent
cc89ff4b72
commit
20d9e92a4c
@ -1,7 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, PropType, reactive, watch, ref, inject, nextTick } from 'vue'
|
import { onMounted, PropType, reactive, watch, ref, inject, nextTick } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { DEFAULT_TABLE_TOTAL } from '@/views/chart/components/editor/util/chart'
|
import {
|
||||||
|
DEFAULT_BASIC_STYLE,
|
||||||
|
DEFAULT_TABLE_TOTAL
|
||||||
|
} from '@/views/chart/components/editor/util/chart'
|
||||||
import { cloneDeep, defaultsDeep, find, includes } from 'lodash-es'
|
import { cloneDeep, defaultsDeep, find, includes } from 'lodash-es'
|
||||||
import CustomAggrEdit from './CustomAggrEdit.vue'
|
import CustomAggrEdit from './CustomAggrEdit.vue'
|
||||||
|
|
||||||
@ -46,7 +49,8 @@ const state = reactive({
|
|||||||
totalItem: {} as DeepPartial<CalcTotalCfg>,
|
totalItem: {} as DeepPartial<CalcTotalCfg>,
|
||||||
selectedSubTotalDimensionName: '',
|
selectedSubTotalDimensionName: '',
|
||||||
selectedSubTotalDimension: undefined as { name: string; checked: boolean },
|
selectedSubTotalDimension: undefined as { name: string; checked: boolean },
|
||||||
subTotalDimensionList: []
|
subTotalDimensionList: [],
|
||||||
|
basicStyleForm: JSON.parse(JSON.stringify(DEFAULT_BASIC_STYLE)) as ChartBasicStyle
|
||||||
})
|
})
|
||||||
|
|
||||||
function onSelectedSubTotalDimensionNameChange(name) {
|
function onSelectedSubTotalDimensionNameChange(name) {
|
||||||
@ -157,6 +161,10 @@ const init = () => {
|
|||||||
total.originName = totalCfg[0].originName
|
total.originName = totalCfg[0].originName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const basicStyle = cloneDeep(props.chart.customAttr.basicStyle)
|
||||||
|
state.basicStyleForm = defaultsDeep(basicStyle, cloneDeep(DEFAULT_BASIC_STYLE)) as ChartBasicStyle
|
||||||
|
|
||||||
initSubTotalDimensionList()
|
initSubTotalDimensionList()
|
||||||
}
|
}
|
||||||
const showProperty = prop => props.propertyInner?.includes(prop)
|
const showProperty = prop => props.propertyInner?.includes(prop)
|
||||||
@ -425,7 +433,7 @@ onMounted(() => {
|
|||||||
<el-select
|
<el-select
|
||||||
:effect="themes"
|
:effect="themes"
|
||||||
v-model="state.selectedSubTotalDimensionName"
|
v-model="state.selectedSubTotalDimensionName"
|
||||||
:disabled="chart.xAxis.length < 2"
|
:disabled="chart.xAxis.length < 2 || state.basicStyleForm.tableLayoutMode === 'tree'"
|
||||||
@change="onSelectedSubTotalDimensionNameChange"
|
@change="onSelectedSubTotalDimensionNameChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -444,7 +452,7 @@ onMounted(() => {
|
|||||||
<el-checkbox
|
<el-checkbox
|
||||||
:effect="themes"
|
:effect="themes"
|
||||||
v-model="state.selectedSubTotalDimension.checked"
|
v-model="state.selectedSubTotalDimension.checked"
|
||||||
:disabled="chart.xAxis.length < 2"
|
:disabled="chart.xAxis.length < 2 || state.basicStyleForm.tableLayoutMode === 'tree'"
|
||||||
@change="changeRowSubTableTotal"
|
@change="changeRowSubTableTotal"
|
||||||
>
|
>
|
||||||
{{ t('chart.show') }}
|
{{ t('chart.show') }}
|
||||||
|
Loading…
Reference in New Issue
Block a user