48 lines
1.6 KiB
Vue
Raw Normal View History

2022-01-08 21:01:52 +08:00
<template>
2022-03-09 09:21:47 +08:00
<div class="go-chart-configurations-setting" v-if="targetData">
2022-02-26 17:38:24 +08:00
<!-- 名称 -->
2022-02-25 21:26:56 +08:00
<SettingItemBox name="名称">
<n-input
type="text"
maxlength="6"
show-count
placeholder="请输入图表名称"
size="small"
v-model:value="targetData.chartConfig.title"
/>
</SettingItemBox>
2022-03-03 10:25:50 +08:00
<!-- 尺寸 -->
<SizeSetting :chartAttr="targetData.attr" />
2022-02-26 17:38:24 +08:00
<!-- 位置 -->
2022-03-09 17:37:32 +08:00
<PositionSetting :chartAttr="targetData.attr" :canvasConfig="chartEditStore.getEditCanvasConfig"/>
<!-- 样式 -->
<StylesSetting :chartStyles="targetData.styles" />
2022-02-26 17:38:24 +08:00
<!-- 自定义配置项 -->
2022-03-07 12:33:05 +08:00
<component :is="targetData.chartConfig.conKey" :optionData="targetData.option"></component>
2022-02-26 17:38:24 +08:00
<!-- 全局设置 -->
2022-02-25 15:51:19 +08:00
<GlobalSetting :optionData="targetData.option" :in-chart="true" />
2022-01-08 21:01:52 +08:00
</div>
</template>
<script setup lang="ts">
2022-02-24 20:11:38 +08:00
import { computed, Ref } from 'vue'
2022-03-04 20:57:36 +08:00
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
2022-03-09 17:37:32 +08:00
import { GlobalSetting, PositionSetting, SizeSetting, StylesSetting } from '@/components/ChartItemSetting/index'
import { CreateComponentType } from '@/packages/index.d'
2022-02-24 20:11:38 +08:00
import { SettingItemBox } from '@/components/ChartItemSetting/index'
2022-03-04 20:57:36 +08:00
const chartEditStore = useChartEditStore()
2022-02-24 20:11:38 +08:00
const targetData: Ref<CreateComponentType> = computed(() => {
2022-03-04 20:57:36 +08:00
const list = chartEditStore.getComponentList
const targetIndex = chartEditStore.fetchTargetIndex()
return list[targetIndex]
})
2022-03-10 17:55:59 +08:00
</script>
2022-01-08 21:01:52 +08:00
<style lang="scss" scoped>
2022-03-09 09:21:47 +08:00
@include go('chart-configurations-setting') {
2022-02-04 18:28:02 +08:00
}
2022-02-07 20:55:40 +08:00
</style>