ProcessManagement.js 7.68 KB
import React, {Component} from 'react';
import {
    View,
    Text,
    ScrollView, TouchableOpacity, Platform, Image
} from "react-native";
import {width} from "../utils/getSize";
import PickerView from "../components/PickerView";
import FiveStarView from "../components/FiveStarView";
import SliderView from "../components/SliderView";
import TextSingleEditView from "../components/TextSingleEditView";
import TextMultiEditView from "../components/TextMultiEditView";
import PhoneEditView from "../components/PhoneEditView";
import NumberEditView from "../components/NumberEditView";
import LocationTextView from "../components/LocationTextView";
import CalculatorView from "../components/CalculatorView";
import TabDetailView from "../components/TabDetailView";
import CheckboxView from "../components/CheckboxView";
import LabelLinkView from "../components/LabelLinkView";
import BooleanCheckView from "../components/BooleanCheckView";
import SelectItemView from "../components/SelectItemView";
import AttachmentUpdateView from "../components/AttachmentUpdateView";

export default class ProcessManagement extends Component {

    constructor(props) {
        super(props);
        this.state={
            querySwitch: 'Common',
            amount: 0,// 金额
        };
    }

    componentWillMount() {
        //设置头部
        this.props.navigation.setParams({
            isBack:true,
            title: '组件'
        });
    }

    renderDividerView() {
        return(
            <View style={{width: width, height: 5, backgroundColor: 'rgba(245, 245, 245, 1)'}}/>
        )
    }

    onChangeCalculate = (text) => {
        console.log("=--200==-", text);
    }

    onChangeAmount = (amount, type) => {
        if (this.refs.calculate) {
            this.refs.calculate.calculateValue(amount, type)
        }
    }

    render() {
        let singleData = {name: "单行输入", data:'{\"placeholder\": \"test\"}'};
        return (
            <View style={{flex: 1, backgroundColor: 'white'}}>
                <ScrollView
                    horizontal={false}
                >
                    <SelectItemView
                        modalTitle={'经营单元选择'}
                        attrData={{name: "经营单元", type: 'OPERATING_UNIT', data:'{\"placeholder\": \"请选择经营单元\", \"isActive\" : true}'}}
                    />
                    <SelectItemView
                        modalTitle={'岗位选择'}
                        attrData={{name: "岗位", type: 'POSITION', data:'{\"placeholder\": \"请选择合适的岗位\"}'}}
                    />
                    {this.renderDividerView()}
                    <LocationTextView
                        attrData={{name: "地点", type: 'LOCATION', data:'{\"placeholder\": \"请选择\"}'}}
                    />
                    <AttachmentUpdateView
                        attrData={{name: "附件", type: 'ATTACHMENT', data:'{\"placeholder\": \"请选择\"}'}}
                    />
                    {/*{this.renderDividerView()}
                    <SelectItemView
                        modalTitle={'部门选择'}
                        attrData={{name: "部门", type: 'ORGANIZATION', data:'{\"placeholder\": \"请注意填写格式\", \"multipleSelect\" : true}'}}
                    />
                    {this.renderDividerView()}
                    <BooleanCheckView
                        attrData={{name: "测试是否", type: 'BOOLEAN', data:'{\"booleanDefault\": true}'}}
                    />
                    {this.renderDividerView()}
                    <CheckboxView
                        attrData={{name: "单选框", type: 'SELECT', data:'{\"placeholder\": \"请选择\",\"options\":[{\"value\":\"标准采购订单\",\"checked\":true},{\"value\":\"内部采购订单\",\"checked\":false}]}'}}
                    />
                    <CheckboxView
                        attrData={{name: "多选框", type: 'CHECKBOX', data:'{\"placeholder\": \"请选择\", \"options\":[{\"value\":\"标准采购订单\",\"checked\":true},{\"value\":\"内部采购订单\",\"checked\":false}]}'}}
                    />
                    {this.renderDividerView()}
                    <PickerView
                        attrData={{name: "日期", type: 'DATE', data:'{\"placeholder\": \"请选择\"}'}}
                    />
                    {this.renderDividerView()}
                    <PickerView
                        attrData={{name: "日期区间", type: 'PERIOD', data:'{\"beginPlaceholder\": \"请选择请假开始日期\", \"endPlaceholder\": \"请选择请假结束日期\"}'}}
                    />
                    {this.renderDividerView()}
                    <PickerView
                        attrData={{name: "省市区", type: 'CITY', data:'{\"placeholder\": \"请选择\"}'}}
                    />
                    {this.renderDividerView()}
                    <FiveStarView
                        attrData={{name: "评分", data:'{\"placeholder\": \"请选择请\", \"default\": 5}'}}
                    />
                    {this.renderDividerView()}
                    <SliderView
                        attrData={{name: "滑块", data:'{\"step\":0.1}'}}
                    />
                    {this.renderDividerView()}
                    <NumberEditView
                        attrData={{name: "数字输入", data:'{\"placeholder\": \"请输入\"}', uom: '小时'}}
                        //onChangeText={this.onChangeAmount}
                    />
                    {this.renderDividerView()}
                    <NumberEditView
                        attrData={{name: "身份证", data:'{\"placeholder\": \"请输入\"}'}}
                        inputType={'default'}
                        //onChangeText={this.onChangeAmount}
                    />
                    {this.renderDividerView()}
                    <NumberEditView
                        attrData={{name: "金额(元)", data:'{\"placeholder\": \"请输入\"}'}}
                        onChangeText={this.onChangeAmount}
                    />
                    {this.renderDividerView()}
                    <CalculatorView
                        ref={'calculate'}
                        attrData={{name: "计算公式", data:'{\"placeholder\": \"test\"}'}}
                        editable={false}
                        onChangeText={this.onChangeCalculate}
                    />
                    {this.renderDividerView()}
                    <TextSingleEditView
                        attrData={singleData}
                        onChangeText={(text)=>{
                            singleData.value = text
                        }}
                    />
                    {this.renderDividerView()}
                    <PhoneEditView
                        attrData={{name: "电话", data:'{\"placeholder\": \"test\"}'}}
                    />
                    {this.renderDividerView()}
                    <TextMultiEditView
                        attrData={{name: "多行输入", data:'{\"placeholder\": \"test\"}'}}
                    />
                    {this.renderDividerView()}
                    <LocationTextView
                        attrData={{}}
                    />
                    {this.renderDividerView()}
                    <TabDetailView
                        attrData={{data:'{\"placeholder\": \"test\", \"buttonText\": \"添加\"}'}}
                    />
                    {this.renderDividerView()}
                    <LabelLinkView
                        attrData={{data:'{\"placeholder\": \"请注意填写格式\", \"hyperlink\": \"http://xiniunet.com\"}'}}
                    />
                    {this.renderDividerView()}*/}
                </ScrollView>
            </View>
        );
    }
}