mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
目前看来 Repeat 组件有点多余
This commit is contained in:
parent
5cb489fac8
commit
a6a64f4ec2
@ -775,9 +775,43 @@ export default {
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: 'repeat',
|
||||
name: 'repeat',
|
||||
label: '时间频率'
|
||||
label: '时间频率',
|
||||
type: 'group',
|
||||
controls: [
|
||||
{
|
||||
name: 'repeatCount',
|
||||
type: 'range',
|
||||
label: false,
|
||||
visibleOn: 'data.repeatUnit != "none"'
|
||||
},
|
||||
|
||||
{
|
||||
type: 'select',
|
||||
name: 'repeatUnit',
|
||||
label: false,
|
||||
value: 'none',
|
||||
mode: 'inline',
|
||||
columnClassName: 'v-middle no-grow',
|
||||
options: [
|
||||
{
|
||||
label: '不重复',
|
||||
value: 'none'
|
||||
},
|
||||
{
|
||||
label: '年',
|
||||
value: 'year'
|
||||
},
|
||||
{
|
||||
label: '月',
|
||||
value: 'month'
|
||||
},
|
||||
{
|
||||
label: '日',
|
||||
value: 'day'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'divider'
|
||||
|
@ -1304,9 +1304,8 @@
|
||||
}
|
||||
|
||||
.v-middle {
|
||||
// display: inline-flex;
|
||||
// align-items: center;
|
||||
vertical-align: middle !important;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
|
@ -36,6 +36,7 @@ export interface Option {
|
||||
export interface Options extends Array<Option> {}
|
||||
|
||||
export interface OptionProps {
|
||||
className?: string;
|
||||
multi?: boolean;
|
||||
multiple?: boolean;
|
||||
valueField?: string;
|
||||
|
@ -138,14 +138,15 @@ export class ControlGroupRenderer extends React.Component<InputGroupProps> {
|
||||
|
||||
const columnWidth =
|
||||
control.columnRatio ||
|
||||
getWidthRate(control && control.columnClassName);
|
||||
getWidthRate(control && control.columnClassName, true);
|
||||
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className={cx(
|
||||
`${ns}Form-groupColumn`,
|
||||
columnWidth ? `${ns}Form-groupColumn--${columnWidth}` : ''
|
||||
columnWidth ? `${ns}Form-groupColumn--${columnWidth}` : '',
|
||||
control && control.columnClassName
|
||||
)}
|
||||
>
|
||||
{this.renderControl(control, index, {
|
||||
|
@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file filter
|
||||
* @author fex
|
||||
*
|
||||
* 不建议用,以后可能会删除。可以直接用组合出来,不需要新建一个组件。
|
||||
*/
|
||||
/* eslint fecs-indent: [0, "space", 2, 2] */
|
||||
|
||||
@ -189,7 +191,7 @@ export default class RepeatControl extends React.Component<RepeatProps, any> {
|
||||
<div className="col v-middle repeat-btn">
|
||||
<Select
|
||||
classPrefix={ns}
|
||||
className={input ? 'pull-right' : null}
|
||||
className={input ? 'pull-right' : ''}
|
||||
options={optionsArray}
|
||||
placeholder={placeholder}
|
||||
onChange={this.handleOptionChange}
|
||||
|
@ -1006,12 +1006,12 @@ export function camel(str?: string) {
|
||||
: '';
|
||||
}
|
||||
|
||||
export function getWidthRate(value: any): number {
|
||||
export function getWidthRate(value: any, strictMode = false): number {
|
||||
if (typeof value === 'string' && /\bcol\-\w+\-(\d+)\b/.test(value)) {
|
||||
return parseInt(RegExp.$1, 10);
|
||||
}
|
||||
|
||||
return value || 0;
|
||||
return strictMode ? 0 : value || 0;
|
||||
}
|
||||
|
||||
export function getLevelFromClassName(
|
||||
|
Loading…
Reference in New Issue
Block a user