Config.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="chart-config">
  3. <div class="config-tab">
  4. <Tabs v-model:activeKey="activeTab" size="small" centered>
  5. <TabPane key="1">
  6. <template #tab>
  7. <DatabaseOutlined />
  8. <span>数据设置</span>
  9. </template>
  10. </TabPane>
  11. <TabPane key="2">
  12. <template #tab>
  13. <SkinOutlined />
  14. <span>样式设置</span>
  15. </template>
  16. </TabPane>
  17. </Tabs>
  18. </div>
  19. <DataConfig v-if="activeTab === '1'" :dataSource="dataSource" @change="handleChange"/>
  20. <CusForm v-if="activeTab === '2'" :columns=""/>
  21. </div>
  22. </template>
  23. <script setup lang="ts">
  24. import { ref, defineProps, defineEmits } from 'vue';
  25. import { Tabs, TabPane } from 'ant-design-vue';
  26. import { DatabaseOutlined, SkinOutlined } from '@ant-design/icons-vue';
  27. import DataConfig from '@/components/Charts/DataConfig.vue';
  28. import { CusForm, IFormItem } from '@/components/CusForm';
  29. import { basicBarProps } from './props';
  30. const props = defineProps(basicBarProps);
  31. const activeTab = ref('1');
  32. const emit = defineEmits(['change']);
  33. const formItems: IFormItem[] = [
  34. {
  35. label: '标题',
  36. prop: 'title',
  37. type: 'group',
  38. children: [
  39. {
  40. label: '标题可见',
  41. prop: 'showTitle',
  42. type: 'checkbox',
  43. },
  44. {
  45. label: '文本',
  46. prop: 'titleText',
  47. type: 'input',
  48. },
  49. ]
  50. }
  51. ]
  52. const handleChange = (data: any) => {
  53. emit('change', {
  54. ...props,
  55. dataSource: data,
  56. });
  57. }
  58. </script>
  59. <style lang="less" scoped>
  60. .config-tab {
  61. text-align: center;
  62. margin-bottom: 12px;
  63. }
  64. </style>