Commit b9cb4054 by fukai

修复缺陷

parent 9164dc19
......@@ -136,7 +136,13 @@ export class SWFPage extends Component
mty = mty.toUpperCase()
if(mty!='103'&& mty!='202' && mty!='202COV')
gpistr= ''
message = `:MT:${mty}\r\n:IO:${this.props.rcv_bic_info.rcv_bic}\r\n:II:${this.props.snd_bic_info.snd_bic}\r\n:MP:N\r\n${gpistr}:EOH:\r\n${message}\r\n-\r\n`
let s119 = ''
if(mty=='202COV')
{
mty='202'
s119=':119:COV\r\n'
}
message = `:MT:${mty}\r\n:IO:${this.props.rcv_bic_info.rcv_bic}\r\n:II:${this.props.snd_bic_info.snd_bic}\r\n:MP:N\r\n${s119}${gpistr}:EOH:\r\n${message}\r\n-\r\n`
}
console.log(message)
this.props.actions.updateSwiftMessage(message)
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T39C extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency,FormatAmount} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -54,7 +57,7 @@ export default class T41D extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type="textarea" maxLength={140} rows={4} cols={35} value={value.s1} onChange={e=>this.onChange(1,e.target.value)} style={{imeMode:'disabled'}} placeholder="Name and Address"/>
<TextArea type="textarea" maxLength={140} rows={4} cols={35} value={value.s1} onChange={e=>this.onChange(1,e.target.value)} style={{imeMode:'disabled'}} placeholder="Name and Address"/>
</FormItem>
</Col>
</Row>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T42C extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={105} cols={35} rows={3} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={105} cols={35} rows={3} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -96,7 +99,7 @@ export default class T42D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} />} type= "textarea" rows={4} cols={35} maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} />} type= "textarea" rows={4} cols={35} maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +35,7 @@ export default class T42M extends Component
>
<Input type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T42P extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +36,7 @@ export default class T44D extends Component
>
<Input type= "textarea" maxLength={390} cols={65} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={390} cols={65} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T45A extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Description of Goods and/or Services" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Description of Goods and/or Services" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T45B extends Component
>
<Input type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +36,7 @@ export default class T71D extends Component
>
<Input type= "textarea" maxLength={150*65} cols={65} rows={15} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={150*65} cols={65} rows={15} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T46A extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Documents Required" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Documents Required" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T46B extends Component
>
<Input type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T47A extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Additional Conditions" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Additional Conditions" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T47B extends Component
>
<Input type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +34,7 @@ export default class T49G extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={25} style={{imeMode:'disabled'}} placeholder="Special Payment Conditions for Beneficiary" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={25} style={{imeMode:'disabled'}} placeholder="Special Payment Conditions for Beneficiary" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T49H extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Special Payment Conditions for Receiving Bank" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt700' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Special Payment Conditions for Receiving Bank" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T49M extends Component
>
<Input type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T49N extends Component
>
<Input type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={this.props.mty=='mt707' ?65*800 : 65*100} cols={65} rows={20} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -35,7 +38,7 @@ export default class T50 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" addonAfter={ <YBIC onSelect={obj=>this.onChange(obj.name)} /> } maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" addonAfter={ <YBIC onSelect={obj=>this.onChange(obj.name)} /> } maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -35,7 +35,7 @@ export default class T50A extends Component
let mval = `${obj.s2}`
if(obj.s1)
mval = `${obj.s1}\r\n${obj.s2}`
mval = `/${obj.s1}\r\n${obj.s2}`
this.props.onValue([obj,mval])
}
......
......@@ -2,6 +2,8 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import YBIC from './YBIC'
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -35,7 +37,7 @@ export default class T50B extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -19,6 +22,8 @@ export default class T50A extends Component
keys = [1,2]
onChange=(index,value)=>
{
if(index==2)
this.fisrt_temp = undefined
let obj = {};
if(!value)
value = ""
......@@ -39,7 +44,13 @@ export default class T50A extends Component
this.props.onValue([obj,mval])
}
componentWillMount()
{
// if(this.props.action == 'edit')
// {
// this.fisrt_temp = '1/(Name of Beneficiary Customer)\r2/(Address Line)\r3/(Country and Town)'
// }
}
render()
{
let value =this.props.value
......@@ -69,7 +80,7 @@ export default class T50A extends Component
help={errmsg.s2}
validateStatus={errmsg.s2?'error':null}
>
<Input type="textarea" onChange={e=>this.onChange(2,e.target.value)} value={value.s2} style={{imeMode:'disabled'}} placeholder="Number/Name and Address" rows={4} cols={35} maxLength={140}/>
<TextArea type="textarea" onChange={e=>this.onChange(2,e.target.value)} value={value.s2} style={{imeMode:'disabled'}} placeholder="Number/Name and Address" rows={4} cols={35} maxLength={140}/>
</FormItem>
</Col>
</Row>
......
......@@ -2,6 +2,8 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
import YBIC from './YBIC'
......@@ -72,7 +74,7 @@ export default class T50A extends Component
help={errmsg.s2}
validateStatus={errmsg.s2?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(2,obj.name)} /> } type="textarea" value={value.s2} onChange={e=>this.onChange(2,e.target.value)} style={{imeMode:'disabled'}} placeholder="Name and Address" rows={4} cols={35} maxLength={140}/>
<TextArea addonAfter={ <YBIC onSelect={obj=>this.onChange(2,obj.name)} /> } type="textarea" value={value.s2} onChange={e=>this.onChange(2,e.target.value)} style={{imeMode:'disabled'}} placeholder="Name and Address" rows={4} cols={35} maxLength={140}/>
</FormItem>
</Col>
</Row>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -93,7 +96,7 @@ export default class T51D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -97,7 +100,7 @@ export default class T52D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input type= "textarea" addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea cols={35} rows={4} type= "textarea" addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -97,7 +100,7 @@ export default class T53D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea cols={35} rows={4} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -97,7 +100,7 @@ export default class T54D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.bic)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.bic)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -96,7 +99,7 @@ export default class T55D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -3,6 +3,7 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
......@@ -97,7 +98,7 @@ export default class T56D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -96,7 +99,7 @@ export default class T57D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -96,7 +99,7 @@ export default class T58D extends Component
validateStatus={errmsg.s3?'error':null}
>
<Input addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(3,obj.name)} /> } type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address" value={value.s3} onChange={(e)=>this.onChange(3,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -5,6 +5,7 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import YBIC from './YBIC'
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -76,7 +77,7 @@ export default class T59 extends Component
validateStatus={errmsg.s2?'error':null}
>
<Input rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(2,obj.name)} /> } value={value.s2} onChange={(e)=>this.onChange(2,e.target.value)} type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address"/>
<TextArea rows={4} cols={35} addonAfter={ <YBIC onSelect={obj=>this.onChange(2,obj.name)} /> } value={value.s2} onChange={(e)=>this.onChange(2,e.target.value)} type= "textarea" maxLength={140} style={{imeMode:'disabled'}} placeholder="Name and Address"/>
</FormItem>
</Col>
</Row>
......
......@@ -17,7 +17,7 @@ export default class T59A extends Component
pattern = ""
tno = -1
keys=[1,2,3]
keys=[1,2]
onChange=(index,value)=>
{
......@@ -38,10 +38,10 @@ export default class T59A extends Component
if(obj.s1)
mval = '/' + obj.s1
// if(obj.s2)
// mval = mval +'/' + obj.s2
if(obj.s2)
mval = mval +'/' + obj.s2
if(obj.s3)
mval = mval?`${mval}\r\n${obj.s3}`:obj.s3
mval = mval?`${mval}\r\n${obj.s2}`:obj.s2
this.props.onValue([obj,mval])
}
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
import YBIC from './YBIC'
const FormItem = Form.Item;
......@@ -20,6 +23,8 @@ export default class T59F extends Component
keys = [1,2]
onChange=(index,value)=>
{
if(index == 2)
this.fisrt_temp = undefined
let obj = {};
if(!value)
value = ""
......@@ -34,13 +39,19 @@ export default class T59F extends Component
});
let mval = ''
if(obj.s1)
mval = `${obj.s1}\r\n`
mval = `/${obj.s1}\r\n`
if(obj.s2 )
mval = `${mval}${obj.s2}`
this.props.onValue([obj,mval])
}
componentWillMount()
{
if(this.props.action == 'edit')
{
this.fisrt_temp = '1/(Name of Beneficiary Customer)\r2/(Address Line)\r3/(Country and Town)'
}
}
render()
{
let value =this.props.value
......@@ -68,10 +79,10 @@ export default class T59F extends Component
<FormItem
label="Number/Name and Address"
required={this.props.status=='M' || mval?'required':null}
help={errmsg.s2}
validateStatus={errmsg.s2?'error':null}
help={errmsg.s2||'请替换模板为正常内容'}
validateStatus={errmsg.s2?'error':'warning'}
>
<Input type="textarea" onChange={e=>this.onChange(2,e.target.value)} value={value.s2} style={{imeMode:'disabled'}} placeholder="Number/Name and Address" rows={4} cols={35} maxLength={140}/>
<TextArea type="textarea" onChange={e=>this.onChange(2,e.target.value)} value={value.s2||this.fisrt_temp} style={{imeMode:'disabled'}} placeholder="Number/Name and Address" rows={4} cols={35} maxLength={140}/>
</FormItem>
</Col>
</Row>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T70 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={140} cols={35} rows={4} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +35,7 @@ export default class T71B extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder={this.props.desp} value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder={this.props.desp} value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +35,7 @@ export default class T71D extends Component
>
<Input type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative Structured Text" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -3,6 +3,7 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -81,7 +82,7 @@ export default class T71N extends Component
validateStatus={errmsg.s2?'error':null}
>
<Input type= "textarea" maxLength={210} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s2} onChange={(e)=>this.onChange(2,e.target.value)}/>
<TextArea rows={6} cols={35} type= "textarea" maxLength={210} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s2} onChange={(e)=>this.onChange(2,e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select,Switch} from 'antd
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -36,7 +39,7 @@ export default class T72 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select,Switch} from 'antd
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -36,7 +39,7 @@ export default class T72Z extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -34,7 +37,7 @@ export default class T73A extends Component
>
<Input type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={210} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select,Switch} from 'antd
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -36,7 +39,7 @@ export default class T75 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select,Switch} from 'antd
import {InputSize,Currency} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -38,7 +41,7 @@ export default class T76 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T77 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={700} cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Description of Goods and/or Services" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={700} cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Description of Goods and/or Services" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T77A extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={20*35} cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={20*35} cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -4,6 +4,9 @@ import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import {InputSize,Currency,COUNTRY} from "./Utils"
import TextArea from './ZTextArea'
const FormItem = Form.Item;
const Option = Select.Option
......@@ -35,7 +38,7 @@ export default class T77B extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={3*35} cols={35} rows={3} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={3*35} cols={35} rows={3} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T77C extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={150*65} cols={65} rows={15} style={{imeMode:'disabled'}} placeholder={this.props.desp} value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={150*65} cols={65} rows={15} style={{imeMode:'disabled'}} placeholder={this.props.desp} value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T77J extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={3500} cols={50} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={3500} cols={50} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T77T extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type="textarea" cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Envelope Contents" maxLength={9000} value={value.s1} onChange={e=>this.onChange(e.target.value)} />
<TextArea type="textarea" cols={35} rows={10} style={{imeMode:'disabled'}} placeholder="Envelope Contents" maxLength={9000} value={value.s1} onChange={e=>this.onChange(e.target.value)} />
</FormItem>
</Col>
</Row>)
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T78 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={65*12} cols={65} rows={12} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={65*12} cols={65} rows={12} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -33,7 +36,7 @@ export default class T79 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input wrap="physical" type= "textarea" maxLength={1750} cols={50} rows={35} style={{imeMode:'disabled'}} placeholder="Narrative Description of the Original Message to Which the Answer Relates" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea wrap="physical" type= "textarea" maxLength={1750} cols={50} rows={35} style={{imeMode:'disabled'}} placeholder="Narrative Description of the Original Message to Which the Answer Relates" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -32,7 +35,7 @@ export default class T79Z extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={35*50} cols={50} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={35*50} cols={50} rows={10} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
......@@ -2,6 +2,9 @@ import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
import TextArea from './ZTextArea'
const FormItem = Form.Item;
......@@ -28,7 +31,7 @@ export default class T86 extends Component
validateStatus={errmsg.s1?'error':null}
>
<Input type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
<TextArea type= "textarea" maxLength={6*35} cols={35} rows={6} style={{imeMode:'disabled'}} placeholder="Narrative" value={value.s1} onChange={(e)=>this.onChange(e.target.value)}/>
</FormItem>
</Col>
......
import React,{Component} from 'react'
import {Input} from 'antd'
export default class ZTextArea extends Component
{
onChange=(e)=>
{
const rows = this.props.maxLength/this.props.cols
replace2(this.eibs.refs.input,e.nativeEvent,rows,this.props.cols,this.props.value)
this.props.onChange && this.props.onChange(e)
}
render()
{
const rows = this.props.maxLength/this.props.cols
return <Input ref={ref=>this.eibs=ref} {...this.props} onChange={this.onChange}
maxLength={this.props.maxLength+rows}
/>
}
}
function keyCode(evt) {
return evt.keyCode || evt.charCode;
}
function replace(obj,evt,func)
{
if (evt.altKey)
return;
var k = keyCode(evt);
if (evt.ctlKey && k != 'v' && k != 'x')
return;
if (k < 46 && k != 13 && k != 8)// BS=8,DEL=46,CR=13
return;
var result = obj.value;
if(result)
{
result = result.replace(/\n/g,'')
obj.value = result
}
if (func)
result = func(result);
var cols = obj.cols;
var rows = obj.rows;
// var wr = document.selection.createRange(); // Store caret
// obj.select();
// var ar = document.selection.createRange();
// wr.setEndPoint("StartToStart", ar);
// var position = wr.text.replace(/\n/g, '').length;
var position = getTxtCursorPosition(obj)
if (k == 13 || (k == 8 && position % cols == 1))
position++;
// wr.collapse(false);
// wr.select(); // End of store caret
var s = obj.scrollTop;
if (result && cols && rows && rows > 1) {
var value = result;
result = "";
var line = "";
for ( var i = 0; i < rows; i++) {
var idx = value.indexOf('\r');
if (idx >= 0) {
line = value.substring(0, idx);
value = value.substring(idx + 1);
} else
line = value;
while (i < rows && line.length > cols) {
result = result + (i == 0 ? "" : '\r')
+ line.substring(0, cols);
line = line.substring(cols);
i++;
position++;
}
if (i < rows)
result = result + (i == 0 ? "" : '\r') + line;
if (idx < 0)
break;
}
}
obj.value = result;
// var tr = obj.createTextRange();
// tr.collapse(true);
// tr.moveStart('character', position);
// tr.s();
obj.scrollTop = s;
// evt.stop();
setTxtCursorPosition(obj,position)
}
const SpChar = '卐'
const LineChar = '\r'
function replace2(obj,evt,rows,cols,oldval)
{
let result = obj.value;
result = result.replace(/[\r\n]{1,2}/g,'\r')
let position = getTxtCursorPosition(obj)
result = result.substring(0,position) + SpChar+ result.substring(position) //插入特殊符号
let arr = result.split(/\r/g)
let buf = []
for(let p =0;p<arr.length;p++)
{
let item = arr[p]
if(item.length <= cols || (item.length==cols+1 && item.charAt(cols)==SpChar))
{
buf.push(item)
if(buf.length >= rows)
break;
continue
}
if(arr.length >= rows) //原本行数已经到达数量,那么当前行不应超标,当前字符不允许被插入,直接返回
{
obj.value = oldval
setTxtCursorPosition(obj,position-1)
return
}
let temp = ''
let cnt = 0
for(let i=0;i<item.length;i++)
{
let c = item.charAt(i)
if(c != SpChar)
cnt++
temp = temp + c
if(cnt == cols)
{
buf.push(temp)
temp = '' //标记清零
cnt = 0
if(buf.length >= rows)
break;
}
else if(i==item.length - 1) //最后一个字符,此段的最后一行
{
if(cnt==0 && oldval.length > result.length - 1) //删除下的末尾光标字符不应新增
{
}
else
buf.push(temp)
}
}
if(buf.length >= rows)
break;
}
let msg = buf.join(LineChar)
position = msg.indexOf(SpChar)
if(position >= 0 )
{
msg = msg.substring(0,position) + msg.substring(position+1)
// if(position < msg.length - 1)
// position--
}
else
position = msg.length
obj.value=msg
setTxtCursorPosition(obj,position)
}
function setTxtCursorPosition(txtObj, pos) {
var tempObj = txtObj;
var cursurPosition = -1;
if (tempObj.selectionStart != undefined) { //非IE浏览器
tempObj.setSelectionRange(pos, pos);
} else { //IE
var range = tempObj.createTextRange();
range.move("character", pos);
range.select();
}
}
function getTxtCursorPosition(txtObj) {
var tempObj = txtObj;
var cursurPosition = -1;
if (tempObj.selectionStart != undefined) { //非IE浏览器
cursurPosition = tempObj.selectionStart;
} else { //IE
var range = document.selection.createRange();
range.moveStart("character", -tempObj.value.length);
cursurPosition = range.text.length;
}
return cursurPosition;
}
\ 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