mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 修改组件展示,支持单个组件数据编辑
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
<template>
|
||||
<div class="go-chart-content-details">
|
||||
设置
|
||||
<GlobalSetting
|
||||
v-if="targetData"
|
||||
:data="targetData.option"
|
||||
:in-chart="true"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { loadAsyncComponent } from '@/utils'
|
||||
import { useChartEditStoreStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { GlobalSetting } from '@/components/ChartItemSetting/index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
|
||||
const GlobalSettingCom = loadAsyncComponent(() =>
|
||||
import('@/components/ChartItemSetting/index')
|
||||
)
|
||||
const chartEditStoreStore = useChartEditStoreStore()
|
||||
|
||||
const targetData = computed(() => {
|
||||
const list = chartEditStoreStore.getComponentList
|
||||
const targetIndex = chartEditStoreStore.fetchTargetIndex()
|
||||
return list[targetIndex]
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@include go('chart-content-details') {
|
||||
|
||||
@@ -94,7 +94,7 @@ const labelHandle = (e: HistoryItemType) => {
|
||||
return historyActionTypeName[HistoryTargetTypeEnum.CANVAS]
|
||||
}
|
||||
return `${historyActionTypeName[e.actionType]} - ${
|
||||
(e.historyData as CreateComponentType).chartData.title
|
||||
(e.historyData as CreateComponentType).chartConfig.title
|
||||
}`
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<component
|
||||
class="edit-content-chart"
|
||||
:is="item.key"
|
||||
:chartData="item"
|
||||
:chartConfig="item"
|
||||
:themeSetting="themeSetting"
|
||||
:themeColor="themeColor"
|
||||
:style="useSizeStyle(item.attr)"
|
||||
|
||||
@@ -39,7 +39,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { image, title } = toRefs(props.componentData.chartData)
|
||||
const { image, title } = toRefs(props.componentData.chartConfig)
|
||||
|
||||
// 计算当前选中目标
|
||||
const select = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user