From b23db4e1b9e8bc813b4b3b95d35552e5e2e980c6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 01 二月 2021 18:51:00 +0800 Subject: [PATCH] 2021-02-01 --- src/menu/components/card/cardcellcomponent/elementform/index.jsx | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 7ffdfb7..f3507e3 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -1,7 +1,7 @@ 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' @@ -40,7 +40,6 @@ link: '' } - UNSAFE_componentWillMount () { const { card, config } = this.props let _options = this.getOptions(card.eleType, card.datatype, card.link) @@ -76,6 +75,8 @@ } 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' @@ -157,6 +158,8 @@ } 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 @@ -388,14 +391,14 @@ 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 { -- Gitblit v1.8.0