| | |
| | | font-size: 16px; |
| | | flex: 1 1; |
| | | text-align: right; |
| | | padding-right: 15px; |
| | | } |
| | | .am-input-control.left { |
| | | text-align: left; |
| | |
| | | line-height: 24px; |
| | | } |
| | | .am-list-extra { |
| | | display: none; |
| | | position: absolute; |
| | | top: 30px; |
| | | right: 10px; |
| | | } |
| | | } |
| | | } |
| | |
| | | let _config = fromJS(this.state.config).toJS() |
| | | |
| | | if (list.length > _config.fields.length) { |
| | | _config.fields = list |
| | | this.setState({ |
| | | config: _config |
| | | }, () => { |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.select'], |
| | | label: '选择器', |
| | | subType: 'select', |
| | | url: '' |
| | | }, |
| | |
| | | |
| | | this.state = { |
| | | value, |
| | | minDate: config.minDate ? moment().add(config.minDate, 'days').endOf('day') : '', |
| | | maxDate: config.maxDate ? moment().add(config.maxDate, 'days').endOf('day') : '', |
| | | mode, |
| | | format |
| | | } |
| | |
| | | this.props.onChange(val ? moment(val).format(format) : '') |
| | | } |
| | | |
| | | disabledDate = (current) => { |
| | | const { minDate, maxDate } = this.state |
| | | |
| | | if (!current || (!maxDate && !minDate)) { |
| | | return false |
| | | } |
| | | |
| | | if (!maxDate) { |
| | | return current < minDate |
| | | } else if (!minDate) { |
| | | return current > maxDate |
| | | } else { |
| | | return current < minDate || current > maxDate |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { value, mode } = this.state |
| | | |
| | | if (mode === 'date') { |
| | | return <DatePicker defaultValue={value} disabled={config.readonly} onChange={this.onChange}/> |
| | | return <DatePicker defaultValue={value} disabledDate={this.disabledDate} disabled={config.readonly} onChange={this.onChange}/> |
| | | } else if (mode === 'month') { |
| | | return <MonthPicker defaultValue={value} disabled={config.readonly} onChange={this.onChange}/> |
| | | } else if (mode === 'datetime') { |
| | | return <DatePicker defaultValue={value} showTime disabled={config.readonly} onChange={this.onChange}/> |
| | | return <DatePicker defaultValue={value} disabledDate={this.disabledDate} showTime disabled={config.readonly} onChange={this.onChange}/> |
| | | } |
| | | } |
| | | } |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | {appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="点击空白处"> |
| | | {getFieldDecorator('clickouter', { |
| | | initialValue: config.setting.clickouter || 'unclose' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="需要通过数据源查询的选项,是否使用缓存。"> |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'minDate', |
| | | label: '最小值', |
| | | initVal: card.minDate || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: '无' |
| | | }, { |
| | | value: '0', |
| | | text: '当天' |
| | | }, { |
| | | value: '-1', |
| | | text: '前一天' |
| | | }, { |
| | | value: '-2', |
| | | text: '前两天' |
| | | }, { |
| | | value: '-3', |
| | | text: '前三天' |
| | | }, { |
| | | value: '-7', |
| | | text: '前七天' |
| | | }, { |
| | | value: '-30', |
| | | text: '前30天' |
| | | }, { |
| | | value: '-90', |
| | | text: '前90天' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'maxDate', |
| | | label: '最大值', |
| | | initVal: card.maxDate || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: '无' |
| | | }, { |
| | | value: '0', |
| | | text: '当天' |
| | | }, { |
| | | value: '1', |
| | | text: '后一天' |
| | | }, { |
| | | value: '2', |
| | | text: '后两天' |
| | | }, { |
| | | value: '3', |
| | | text: '后三天' |
| | | }, { |
| | | value: '7', |
| | | text: '后七天' |
| | | }, { |
| | | value: '30', |
| | | text: '后30天' |
| | | }, { |
| | | value: '90', |
| | | text: '后90天' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | min: 1, |
| | |
| | | key: 'place', |
| | | label: '排列', |
| | | initVal: card.place || 'left_right', |
| | | tooltip: '提示文字与输入框的位置关系。注:上下排列是会禁用扫码功能。', |
| | | tooltip: '提示文字与输入框的位置关系。', |
| | | forbid: appType !== 'mob', |
| | | options: [{ |
| | | value: 'left_right', |
| | |
| | | link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'splitline', 'marginTop', 'marginBottom'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'marginTop', 'marginBottom'], |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom'], |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |