Parallel.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import React from 'react'
  2. import { Row, Col, Checkbox, Select } from 'antd'
  3. const Option = Select.Option
  4. import { onSectionChange } from './util'
  5. import { ISpecConfig } from '../types'
  6. import styles from '../../../Workbench.less'
  7. interface ISpecSectionParallelProps {
  8. spec: ISpecConfig
  9. title: string
  10. onChange: (value: string | number, propPath: string | string[]) => void
  11. }
  12. function SpecSectionParallel (props: ISpecSectionParallelProps) {
  13. const { spec, title, onChange } = props
  14. const { smooth, layout } = spec
  15. return (
  16. <div className={styles.paneBlock}>
  17. <h4>{title}</h4>
  18. <div className={styles.blockBody}>
  19. <Row gutter={8} type="flex" align="middle" className={styles.blockRow}>
  20. <Col span={18}>
  21. <Checkbox checked={smooth} onChange={onSectionChange(onChange, 'smooth')}>
  22. 平滑曲线
  23. </Checkbox>
  24. </Col>
  25. </Row>
  26. <Row gutter={8} type="flex" align="middle" className={styles.blockRow}>
  27. <Col span={8}>坐标轴排列</Col>
  28. <Col span={10}>
  29. <Select
  30. placeholder="排列"
  31. className={styles.blockElm}
  32. value={layout}
  33. onChange={onSectionChange(onChange, 'layout')}
  34. >
  35. <Option key="horizontal" value="horizontal">
  36. 水平排列
  37. </Option>
  38. <Option key="vertical" value="vertical">
  39. 垂直排列
  40. </Option>
  41. </Select>
  42. </Col>
  43. </Row>
  44. </div>
  45. </div>
  46. )
  47. }
  48. export default SpecSectionParallel