king
2023-03-11 34e7681fd12b1c4e4994d3bea1a553870e10bc50
src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import { Row, Col, Icon, Radio, Input, Button } from 'antd'
import { Row, Col, Radio, Input, Button } from 'antd'
import { CheckOutlined } from '@ant-design/icons'
import './index.scss'
const { Search } = Input
@@ -10,18 +11,23 @@
    super(props)
    let _type = props.card.type
    if (props.type === 'columns') {
      if (_type === 'date' || _type === 'datetime') {
        _type = 'text'
    if (!props.card.origin) {
      if (props.type === 'columns') {
        if (_type !== 'number') {
          _type = 'text'
        }
      } else if (props.type === 'search') {
        if (_type !== 'select') {
          _type = 'text'
        }
      } else if (props.type === 'form') {
        if (_type === 'datetime' || _type === 'date') {
          _type = 'date'
        } else if (_type !== 'number') {
          _type = 'text'
        }
      }
    } else if (props.type === 'search') {
      if (_type === 'number') {
        _type = 'text'
      } else if (_type === 'datetime') {
        _type = 'daterange'
      }
    } else if (props.type === 'form') {
    }
    this.state = {
@@ -69,7 +75,7 @@
    return (
      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')  + (card.origin ? ' fixed' : '')} >
        <div className="base" onClick={this.changeSelect}>
          <Icon type="check" />
          <CheckOutlined />
          <p title={card.field}>字段: <span>{card.field}</span></p>
          <p title={card.label}>名称: <span>{card.label}</span></p>
        </div>
@@ -77,14 +83,12 @@
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
            <Radio value="text">text</Radio>
            <Radio value="select">select</Radio>
            <Radio value="daterange">dateRange</Radio>
          </Radio.Group> : null
        }
        {type === 'columns' ?
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
            <Radio value="text">text</Radio>
            <Radio value="number">number</Radio>
            <Radio value="picture">picture</Radio>
          </Radio.Group> : null
        }
        {type === 'form' ?
@@ -156,7 +160,7 @@
      <div className="common-modal-edit-card">
        <Row className="search-row">
          <Col span={8}>
            <Search placeholder="请输入字段" onSearch={value => {this.setState({searchKey: value})}} enterButton />
            <Search placeholder="请输入字段" autoFocus onSearch={value => {this.setState({searchKey: value})}} enterButton />
          </Col>
          <Col span={8}>
            <Button onClick={this.reset}>重置</Button>