config.vue 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <!-- 遍历 seriesList -->
  3. <CollapseItem v-for="(item, index) in config.series" :key="index" :name="`圆环`" :expanded="true">
  4. <SettingItemBox name="数据">
  5. <SettingItem name="数值">
  6. <n-input-number v-model:value="config.dataset" :min="0" :max="1" :step="0.01" size="small" placeholder="数值">
  7. </n-input-number>
  8. </SettingItem>
  9. </SettingItemBox>
  10. <!-- Echarts 全局设置 -->
  11. <SettingItemBox name="进度条">
  12. <SettingItem name="颜色">
  13. <n-color-picker size="small" :modes="['hex']" v-model:value="item.data[0].itemStyle.color"></n-color-picker>
  14. </SettingItem>
  15. <SettingItem name="阴影模糊等级">
  16. <n-input-number
  17. v-model:value="item.data[0].itemStyle.shadowBlur"
  18. :min="0"
  19. :max="50"
  20. :step="1"
  21. size="small"
  22. placeholder="阴影模糊等级"
  23. >
  24. </n-input-number>
  25. </SettingItem>
  26. <SettingItem name="阴影颜色">
  27. <n-color-picker
  28. size="small"
  29. :modes="['hex']"
  30. v-model:value="item.data[0].itemStyle.shadowColor"
  31. ></n-color-picker>
  32. </SettingItem>
  33. </SettingItemBox>
  34. <!-- 中心标题 -->
  35. <SettingItemBox v-if="config.title" name="标题">
  36. <SettingItem name="颜色">
  37. <n-color-picker size="small" :modes="['hex']" v-model:value="config.title.textStyle.color"></n-color-picker>
  38. </SettingItem>
  39. <SettingItem name="字体大小">
  40. <n-input-number
  41. v-model:value="config.title.textStyle.fontSize"
  42. :min="0"
  43. :step="1"
  44. size="small"
  45. placeholder="字体大小"
  46. >
  47. </n-input-number>
  48. </SettingItem>
  49. </SettingItemBox>
  50. <!-- 其他样式 -->
  51. <SettingItemBox name="轨道样式">
  52. <SettingItem name="颜色">
  53. <n-color-picker size="small" :modes="['hex']" v-model:value="item.data[1].itemStyle.color"></n-color-picker>
  54. </SettingItem>
  55. <SettingItem name="阴影模糊等级">
  56. <n-input-number
  57. v-model:value="item.data[1].itemStyle.shadowBlur"
  58. :min="0"
  59. :step="1"
  60. size="small"
  61. placeholder="阴影模糊等级"
  62. >
  63. </n-input-number>
  64. </SettingItem>
  65. <SettingItem name="阴影颜色">
  66. <n-color-picker
  67. size="small"
  68. :modes="['hex']"
  69. v-model:value="item.data[1].itemStyle.shadowColor"
  70. ></n-color-picker>
  71. </SettingItem>
  72. </SettingItemBox>
  73. </CollapseItem>
  74. </template>
  75. <script setup lang="ts">
  76. import { PropType, computed } from 'vue'
  77. // 以下是封装的设置模块布局组件,具体效果可在官网查看
  78. import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
  79. import { GlobalThemeJsonType } from '@/settings/chartThemes'
  80. const props = defineProps({
  81. optionData: {
  82. type: Object as PropType<GlobalThemeJsonType>,
  83. required: true
  84. }
  85. })
  86. const config = computed(() => {
  87. return props.optionData
  88. })
  89. </script>