Commit a8e8af48 by gq777

Merge branch 'ncb' of https://gitee.com/zeng_hui/swifteditor into ncb

parents 6574e7a6 8dcb9aeb
import React, { Component } from 'react'
import { Form, Input, DatePicker, Row, Col, TimePicker, Button, Icon, Select } from 'antd';
import { InputSize, Currency, FormatAmount } from "./Utils"
const FormItem = Form.Item;
const Option = Select.Option
export default class T31G extends Component {
name = 'T31G'
desp = "(Code)(Common Reference)"
pattern = " 6!n/4!n/12a"
tno = -1
keys = [1, 2, 3]
onChange = (index, value) => {
let obj = {};
if (!value)
value = ""
let objtemp = this.props.value
objtemp = objtemp && objtemp.length ? objtemp[0] : {}
objtemp["s" + index] = value;
this.keys.forEach(i => {
obj['s' + i] = objtemp['s' + i]
});
let mval = "";
mval = `${obj.s1 || ''}${obj.s2 ? `/${obj.s2}` : ''}${obj.s3 ? `/${obj.s3}` : ''}`
this.props.onValue([obj, mval])
}
render() {
let value = this.props.value
let mval = value && value.length ? value[1] : ''
let errmsg = value && value.length == 3 ? value[2] : {}
value = value && value.length ? value[0] : {}
return (<Row>
<Col style={{ "minWidth": '100px' }} span={3}>
<FormItem
label="Date"
required={this.props.status == 'M' || mval ? 'required' : null}
help={errmsg.s1}
validateStatus={errmsg.s1 ? 'error' : null}
>
<DatePicker defaultValue="" format="yyMMdd" value={value.s1} onChange={(date, dateString) => this.onChange(1, dateString)} />
</FormItem>
</Col>
<Col style={{ "minWidth": '100px' }} span={3}>
<FormItem
label="Time"
required={this.props.status == 'M' || mval ? 'required' : null}
help={errmsg.s2}
validateStatus={errmsg.s2 ? 'error' : null}
>
<TimePicker defaultValue="" format="HHmm" value={value.s2} onChange={(date, dateString) => this.onChange(2, dateString)} />
</FormItem>
</Col>
<Col span={4}>
<FormItem
label="Location"
required={this.props.status == 'M' || mval ? 'required' : null}
help={errmsg.s3}
validateStatus={errmsg.s3 ? 'error' : null}
>
<Select allowClear={true} value={value.s3} style={{ width: "100%" }} placeholder="Location" onChange={(val) => this.onChange(3, val)}>
<Option value="ARBA">ARBA</Option>
<Option value="ATVI">ATVI</Option>
<Option value="AUME">AUME</Option>
<Option value="AUSY">AUSY</Option>
<Option value="BEBR">BEBR</Option>
<Option value="BRSP">BRSP</Option>
<Option value="CAMO">CAMO</Option>
<Option value="CATO">CATO</Option>
<Option value="CHGE">CHGE</Option>
<Option value="CHZU">CHZU</Option>
<Option value="CLSA">CLSA</Option>
<Option value="CNBE">CNBE</Option>
<Option value="CZPR">CZPR</Option>
<Option value="DECB">DECB</Option>
<Option value="DEFR">DEFR</Option>
<Option value="DKCO">DKCO</Option>
<Option value="EETA">EETA</Option>
<Option value="ESMA">ESMA</Option>
<Option value="EUTA">EUTA</Option>
<Option value="FIHE">FIHE</Option>
<Option value="FRPA">FRPA</Option>
<Option value="GBLO">GBLO</Option>
<Option value="GRAT">GRAT</Option>
<Option value="HKHK">HKHK</Option>
<Option value="HUBU">HUBU</Option>
<Option value="IDJA">IDJA</Option>
<Option value="IEDU">IEDU</Option>
<Option value="ILTA">ILTA</Option>
<Option value="INMU">INMU</Option>
<Option value="ITMI">ITMI</Option>
<Option value="ITRO">ITRO</Option>
<Option value="JPTO">JPTO</Option>
<Option value="KRSE">KRSE</Option>
<Option value="LBBE">LBBE</Option>
<Option value="LKCO">LKCO</Option>
<Option value="LULU">LULU</Option>
<Option value="MXMC">MXMC</Option>
<Option value="MYKL">MYKL</Option>
<Option value="NLAM">NLAM</Option>
<Option value="NOOS">NOOS</Option>
<Option value="NYFD">NYFD</Option>
<Option value="NYSE">NYSE</Option>
<Option value="NZAU">NZAU</Option>
<Option value="NZWE">NZWE</Option>
<Option value="PAPC">PAPC</Option>
<Option value="PHMA">PHMA</Option>
<Option value="PLWA">PLWA</Option>
<Option value="PTLI">PTLI</Option>
<Option value="ROBU">ROBU</Option>
<Option value="RUMO">RUMO</Option>
<Option value="SARI">SARI</Option>
<Option value="SEST">SEST</Option>
<Option value="SGSI">SGSI</Option>
<Option value="SKBR">SKBR</Option>
<Option value="THBA">THBA</Option>
<Option value="TRAN">TRAN</Option>
<Option value="TRIS">TRIS</Option>
<Option value="TWTA">TWTA</Option>
<Option value="USCH">USCH</Option>
<Option value="USGS">USGS</Option>
<Option value="USLA">USLA</Option>
<Option value="USNY">USNY</Option>
<Option value="VNHA">VNHA</Option>
<Option value="ZAJO">ZAJO</Option>
</Select>
</FormItem>
</Col>
</Row>)
}
}
\ No newline at end of file
...@@ -561,7 +561,8 @@ export default function(tag,props,onValue){ ...@@ -561,7 +561,8 @@ export default function(tag,props,onValue){
case "T50G" :return <T50G {...props} onValue={onValue} />; case "T50G" :return <T50G {...props} onValue={onValue} />;
case "T50H" :return <T50H {...props} onValue={onValue} />; case "T50H" :return <T50H {...props} onValue={onValue} />;
case "T25A" :return <T25A {...props} onValue={onValue} />; case "T25A" :return <T25A {...props} onValue={onValue} />;
case "T31G" :return <T31G {...props} onValue={onValue} />;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment