index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div class="go-chart-content-details" v-if="targetData">
  3. <div class="chart-config">
  4. <SettingItemBox name="名称">
  5. <n-input
  6. type="text"
  7. maxlength="6"
  8. show-count
  9. placeholder="请输入图表名称"
  10. size="small"
  11. v-model:value="targetData.chartConfig.title"
  12. />
  13. </SettingItemBox>
  14. </div>
  15. <GlobalSetting :data="targetData.option" :in-chart="true" />
  16. </div>
  17. </template>
  18. <script setup lang="ts">
  19. import { computed, Ref } from 'vue'
  20. import { loadAsyncComponent } from '@/utils'
  21. import { useChartEditStoreStore } from '@/store/modules/chartEditStore/chartEditStore'
  22. import { GlobalSetting } from '@/components/ChartItemSetting/index'
  23. import { CreateComponentType } from '@/packages/index.d'
  24. import { SettingItemBox } from '@/components/ChartItemSetting/index'
  25. const GlobalSettingCom = loadAsyncComponent(() =>
  26. import('@/components/ChartItemSetting/index')
  27. )
  28. const chartEditStoreStore = useChartEditStoreStore()
  29. const targetData: Ref<CreateComponentType> = computed(() => {
  30. const list = chartEditStoreStore.getComponentList
  31. const targetIndex = chartEditStoreStore.fetchTargetIndex()
  32. return list[targetIndex]
  33. })
  34. </script>
  35. <style lang="scss" scoped>
  36. @include go('chart-content-details') {
  37. .chart-config {
  38. padding: 20px 0;
  39. }
  40. }
  41. </style>