king
2023-08-29 4366981fbe7d406e90487fd94450fab6eb31120d
src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Select, DatePicker, Input, Popover, Form } from 'antd'
import { Select, DatePicker, Input, Popover, Form, Switch, Radio, Checkbox } from 'antd'
import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons'
import moment from 'moment'
@@ -113,6 +113,18 @@
  } else if (card.type === 'checkcard') {
    type = 'checkcard'
    formItem = <CheckCard config={card} />
  } else if (card.type === 'switch') {
    formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} checked={card.initval === card.openVal}/>)
  } else if (card.type === 'radio') {
    let options = card.options
    if (options.length === 0) {
      options = [{Value: '1', Text: '选项1'}, {Value: '2', Text: '选项2'}]
    }
    formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}>
      {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))}
    </Radio.Group>)
  } else if (card.type === 'check') {
    formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox>
  }
  let labelwidth = card.labelwidth || 33.3