| | |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'radius', 'padding', 'url'], |
| | | icon: ['eleType', 'icon', 'datatype', 'fontSize', 'width', 'align', 'padding'], |
| | | link: ['eleType', 'datatype', 'labelfield', 'fontSize', 'width', 'height', 'align', 'padding', 'prefix'], |
| | | slider: ['eleType', 'field', 'width', 'color', 'padding', 'maxValue'], |
| | | slider: ['eleType', 'datatype', 'width', 'color', 'padding', 'maxValue'], |
| | | splitline: ['eleType', 'color', 'width', 'padding'], |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, config } = this.props |
| | | let _options = this.getOptions(card.eleType, card.datatype) |
| | | |
| | | |
| | | this.setState({ |
| | | eleType: card.eleType, |
| | | datatype: card.datatype, |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } else if (item.key === 'value' && card.eleType === 'slider') { |
| | | item.type = 'number' |
| | | item.label = '值' |
| | | } |
| | | |
| | | return item |
| | |
| | | getOptions = (eleType, datatype) => { |
| | | let _options = fromJS(cardTypeOptions[eleType]).toJS() // 选项列表 |
| | | |
| | | if (['text', 'number', 'picture', 'link'].includes(eleType)) { |
| | | if (['text', 'number', 'picture', 'link', 'slider'].includes(eleType)) { |
| | | if (datatype === 'dynamic') { |
| | | _options.push('field') |
| | | } else if (eleType !== 'picture') { |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } else if (item.key === 'value') { |
| | | if (value === 'slider') { |
| | | item.type = 'number' |
| | | item.label = '值' |
| | | } else { |
| | | item.type = 'text' |
| | | item.label = '内容' |
| | | } |
| | | } |
| | | |
| | | return item |