| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, Tooltip, InputNumber, notification } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, Tooltip, InputNumber } from 'antd' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | link: '' |
| | | } |
| | | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, config } = this.props |
| | | let _options = this.getOptions(card.eleType, card.datatype, card.link) |
| | |
| | | } else if (card.eleType === 'number') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'YYYY-MM-DD') |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = card.eleType !== 'qrcode' |
| | | } |
| | | if (item.key === 'linkurl') { |
| | | item.type = card.link === 'dynamic' ? 'select' : 'text' |
| | |
| | | } else if (value === 'number') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'YYYY-MM-DD') |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = value !== 'qrcode' |
| | | } |
| | | |
| | | return item |
| | |
| | | values.uuid = this.props.card.uuid |
| | | values.marks = this.props.card.marks || null |
| | | |
| | | if (values.eleType === 'picture' && values.datatype === 'static' && !values.url) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未添加图片或图片上传失败,请重新添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | // if (values.eleType === 'picture' && values.datatype === 'static' && !values.url) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '尚未添加图片或图片上传失败,请重新添加!', |
| | | // duration: 5 |
| | | // }) |
| | | // return |
| | | // } |
| | | |
| | | resolve(values) |
| | | } else { |