CascadeView.js 1.21 KB
import React, {Component} from 'react';
import {
    View,
    Text,
    TextInput,
    Image,
    StyleSheet,
    TouchableOpacity,
} from 'react-native';

const defaultHeight = (62);
const titleViewHeight = (24);
const HPading = (16);
const VPading = (6);

/**
 * 级联
 */
export default class CascadeView extends Component {

    constructor(props) {
        super(props);
        this.attrData = this.props.attrData;
        // 组件控制数据
        this.extendData = JSON.parse(this.attrData.data);
    }

    render() {
        let {name, code, type, description, isRequired, isPreview} = this.attrData;
        // dataType固定:STATIC
        let {placeholder, dataType, dataContent, enableMultiple, enableFilter} = this.extendData;

        return (
            <View>
                <View style={{flexDirection: 'row',height:titleViewHeight,backgroundColor:'#fff'}}>
                    {isRequired&&<Text style={{ color: "#FF3030" }}>* {" "}</Text>}
                    {!isRequired&&<Text style={{ color: "#fff" }}>* {" "}</Text>}
                        <Text style={{fontSize: 16, color: 'rgba(0, 0, 0, 1)', marginBottom: 5}}>{name||""}</Text>
                    </View>
            </View>
        )
    }
}