From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 24 一月 2025 11:10:32 +0800 Subject: [PATCH] 2025-01-24 --- src/templates/sharecomponent/fieldscomponent/editcard/index.jsx | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx index f39eecc..14338af 100644 --- a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx @@ -13,16 +13,21 @@ let _type = props.card.type if (!props.card.origin) { - if (props.type === 'columns') { - if (_type !== 'number') { - _type = 'text' - } - } else if (props.type === 'search') { - if (_type !== 'select') { + // if (props.type === 'columns') { + // if (_type !== 'number') { + // _type = 'text' + // } + // } + if (props.type === 'search') { + if (_type === 'date' || _type === 'datetime') { + _type = 'date' + } else if (_type !== 'select') { _type = 'text' } } else if (props.type === 'form') { - if (_type !== 'number') { + if (_type === 'datetime' || _type === 'date') { + _type = 'date' + } else if (_type !== 'number') { _type = 'text' } } @@ -70,8 +75,11 @@ render() { const { card, type } = this.state + + let hasPadding = type === 'search' || type === 'form' + return ( - <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '') + (card.origin ? ' fixed' : '')} > + <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '') + (card.origin ? ' fixed' : '') + (hasPadding ? ' has-padding' : '')} > <div className="base" onClick={this.changeSelect}> <CheckOutlined /> <p title={card.field}>瀛楁锛� <span>{card.field}</span></p> @@ -81,14 +89,15 @@ <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="date">date</Radio> </Radio.Group> : null } - {type === 'columns' ? + {/* {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.Group> : null - } + } */} {type === 'form' ? <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}> <Radio value="text">text</Radio> -- Gitblit v1.8.0