import {
	inject,
	observer,
} from 'mobx-react'
import {
	WeaFormItem,
	WeaUpload,
	WeaHelpfulTip,
	WeaLocaleProvider,
	WeaSelect
} from 'ecCom'
import {
	Button,
	message,
} from 'antd'
import {
	WeaSwitch
} from 'comsMobx'

import { toJS } from "mobx";
const getLabel = WeaLocaleProvider.getLabel

@inject('intelogin')
@observer
export default class LoginForm extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			list: [],
			upStatus: '',
		}
	}

	componentWillUnmount() {
		this.props.intelogin.refreshLoginForm();
	}

	getRenderDom = (field, form) => {
	  const key = field.domkey[0];
	  const {
		intelogin
	  } = this.props, {
		mailOutterSelect=[],
	  } = intelogin;
	  if("mailsyscode" === key) {
		return <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@9plp8c`} {...field} options={toJS(mailOutterSelect)} value={form.getFormParams().mailsyscode} onChange={value => {
		  form.updateFields({mailsyscode: value});
		  this.handleChange({mailsyscode: {value}});
		}} />;
	  }
	}

	getForm = () => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			source,
			exportlfSelectedValue,
			createSecretKey,
		} = intelogin, {
			form,
			condition,
			typename,
		} = loginForm, {
			isFormInit,
		} = form;

		let arr = [];

		isFormInit && condition.forEach((c, index) => {
			c && c.items && c.items.forEach(field => {
				const key = field.domkey[0];
				let dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@0lm3cx@integrationLoginForm${key}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={cb => this.handleChange(cb)}/>;
				//过滤表单标签
				if (this.filter({key, typename})) return;
				if (["mailsyscode"].includes(key)) {
				  dom = this.getRenderDom(field, form);
				}

				arr.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@qcqk0a@integrationLoginForm${key}`}
					label={`${field.label}`}
					labelCol={{span: 4, offset: 1}}
					wrapperCol={{span: 12}}
					error={form.getError(field)}
					tipPosition="bottom"
				>
					<nobr>
					  {dom}
					  {typename == '11' && key === "email163_pubkey" && <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@33e2vf@integrationLoginForm${key}`} style={{position: 'absolute', marginLeft: 30, marginTop: 25}} onClick={createSecretKey}>{getLabel('503390','生成公私钥')}</Button>}	
					</nobr>
				</WeaFormItem>);

				arr = [...arr, this.add({
					key,
					typename,
					form,
				})]
			})
		})

		if(source === 'tencentmail') {
		    exportlfSelectedValue({
			    val: '6',
			    key: 'typename'
		    });
		}else if (source === 'coremail') {
			exportlfSelectedValue({
				val: '8',
				key: 'typename'
			});
		}else if (source === 'NC') {
			exportlfSelectedValue({
				val: form.getFormParams().typename == 5 ? '5' : '1',
				key: 'typename'
			});
		}else if (source === 'EAS') {
			exportlfSelectedValue({
				val: '2',
				key: 'typename'
			});
		}else if (source === 'U8') {
			exportlfSelectedValue({
				val: '3',
				key: 'typename'
			});
		}else if (source === 'K3') {
			exportlfSelectedValue({
				val: '4',
				key: 'typename'
			});
		}

		return <div>{arr}</div>;
	}

	//过滤表单标签
	filter = (params) => {
		const {
			key,
			typename
		} = params;

		if (['imagewidth', 'imageheight', 'encrypttype', 'encryptclassId', 'result', 'baseparam1',
				'basetype1', 'urlparaencrypt1', 'encryptcode1', 'encryptiv1', 'autologin', 'ipaddress',
				'baseparam2', 'basetype2', 'urlparaencrypt2', 'encryptcode2', 'encryptiv2', 'requesttype',
				'urlencodeflag'
			].includes(key)) {
			return true
		}

		if (key == 'coremailType' && !(typename == '8')) {
			return true
		}

		if (key == 'accountcode' && !(typename == '1' || typename == '5')) {
			return true
		}

		if ((key == 'client_id' || key == 'client_secret') && (typename != '6')) {
			return true
		}

		if ((key == 'alssosecret' || key == 'alssokey') && (typename != '12')) {
			return true
		}

		if ((key == 'email263_domain' || key == 'email263_cid' || key == 'email263_key') && !(typename == '7')) {
			return true
		}

		if ((key == 'email163_domain' || key == 'email163_pubkey' || key == 'email163_key') && !(typename == '11')) {
			return true
		}

		if ((key == 'iurl' || key == 'ourl') && ['6', '12'].includes(typename)) {
			return true
		}

		if(key == "mailsyscode" && (!['12', '11'].includes(typename))) {
			return true;
		}

		// if (key == 'encodeflag' && (typename == '6' || typename == '7' || typename == '8' || typename == '11')) {
		// 	return true
		// }

		// if (key == 'entranceurl' &&(typename == '9' || typename == '10')) {
		// 	return true
		// }

		//encodeflag 登录系统编码
		if (key == 'encodeflag' && typename != '0') {
			return true
		}

	}

	//自定义增加表单标签
	add = (params) => {
		const {
			key,
			typename,
			form,
		} = params;

		let arr = [];
		if (key == 'name') {
			['linkIcon', 'iconSize'].map((f, i) => {
				arr.push(this[f](form));
			});
			//内外网自动登录
			if (!["6", "12"].includes(typename)) {
				['automaticLogin', 'ipAddresses'].map((f, i) => {
					arr.push(this[f](form));
				});
			}
		}

		if (!(typename == '6' || typename == '7' || typename == '8' || typename == '11')) {
			(key == 'ourl') && arr.push(this.requestType(form));
			(key == 'ourl') && arr.push(this.encryptionAlgorithm(form));
		}

		if (typename == '7' || typename == '11'|| typename == '9' || typename == '10' || typename == '5') {
			(key == 'ourl') && arr.push(this.accountParameter(form));
		} else if (typename == '8') {
			(key == 'ourl') && arr.push(this.passwordParameter(form));
		} else {
			//encodeflag 登录系统编码
			if (key == 'ourl')
			{
			   if(typename !== '6' && typename !== "2")
			   {
			      ['accountParameter', 'passwordParameter'].map((f, i) => {
                  arr.push(this[f](form));
               });
            }else if(typename === '2')
            {
               arr.push(this.accountParameter(form));
            }
			}
		}
		return arr;

	}

	handleChange = (cb) => {
		const {
			intelogin
		} = this.props, {
			exportlfSelectedValue,
			checkTableFieldValueUnique,
			loginForm,
		} = intelogin, {
			form,
		} = loginForm;

		Object.entries(cb).map(arr => {
			const key = arr[0],
				t = arr[1],
				val = Array.isArray(t.value) ? t.value[0] : t.value;

			exportlfSelectedValue({
				val,
				key
			});

			(key == 'sysid') && checkTableFieldValueUnique({
				tableName: 'outter_sys',
				fieldName: 'sysid',
				fieldValue: val.replace(/^(\s*)|(\s*)$/g, '')
			});

			if("logintype" == key) {
				form.updateFields({requesttype: "1"});
				exportlfSelectedValue({
					val: "1",
					key: "requesttype",
				});
			}
			if("typename" === key) {
				if(val != '0') {
					form.updateFields({requesttype: "1"});
					exportlfSelectedValue({
						val: "1",
						key: "requesttype",
					});
				}
			}
		});
	}

	linkIcon = () => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			exportExcelFileId,
			delPic,
		} = intelogin, {
			urllinkimagid
		} = loginForm, {
			upStatus,
			list
		} = this.state;

		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@83swkc`}
                label={getLabel(82627,'链接图标')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{!urllinkimagid ? (
	            	<div>
	                    <div style={{float: 'left'}}>
	                        <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@t39eqq`}
	                            uploadUrl='/api/doc/upload/uploadFile'
	                            category='string'
	                            limitType='gif,png,jpg,jpeg,ico,bmp'
	                            datas={upStatus === 'uploaded'  ? list : []}
	                            onChange={(id, list) => {this.setList(list); exportExcelFileId(id[0],list[0].filename)}}
	                            onUploading={status => this.onUploading(status)}
	                        >
	                            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@90ns4u`}>{getLabel(125333, '选择文件')}</Button>
	                        </WeaUpload>
	                    </div>
	                    <div style={{float: 'left', paddingLeft: 10, paddingTop: 6}}>
	                        { list.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : list.map(file => <p>{file.filename}</p>) }
	                    </div>
	                    <div style={{float: 'left', marginLeft: 10, paddingTop: 6}}>
	                    	<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@zvoye3`} title={`${getLabel(82744,'图片类型必须是')}gif,png,jpg,jpeg,ico,bmp`} width={238}/>
	                    </div>
	                </div>
            	):<div>
            		<img src={`${window.ecologyContentPath || ""}/weaver/weaver.file.FileDownload?fileid=${urllinkimagid}`} style={{width:32,height: 32,float:'left'}}  />
            		<a style={{display: 'block',float: 'left',padding: 8}} onClick={() => delPic()}>{getLabel(131966, '删除')}</a>
            	 </div>}
            </WeaFormItem>
		)
	}

	onUploading(upStatus) {
		this.setState({
			upStatus
		});

		this.setList((upStatus == 'uploading') ? [] : this.state.list);
	}

	setList = (list) => {
		this.setState({
			list
		});
	}

	iconSize = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm
		} = intelogin;

		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@q822yk`}
                label={getLabel(125422,'图标大小')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{loginForm.fields.map((field, index) => {
            		return (
            			<div style={{float:'left', width:150,marginLeft:(index == 1) ? 10 : 0 }}>
	            			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@26hbgl@integrationLoginForm${field.domkey[0]}`}
				                label={`${field.label}`}
				                labelCol={{span: 9}}
				                wrapperCol={{span: 15}}
				                error={form.getError(field)}
								tipPosition="bottom"
								style={{padding:0}}
	           				>
	           					<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@qyb1m7@integrationLoginForm${field.domkey[0]}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />
	           				</WeaFormItem>
           				</div>
            		)
            	})}
            </WeaFormItem>
		)
	}

	encryptionAlgorithm = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			openDialog,
			setIsSysAlgorithm,
		} = intelogin, {
			algorithms,
			encrypttype,
			encryptClassOptions
		} = loginForm;

		const temp = (encrypttype == '2') ? algorithms : [algorithms[0], algorithms[2]];

		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@s9u62y`}
                label={getLabel(32344, '加密算法')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{temp.map( (field, index) => {
					let key = field.domkey[0];
            		return (
            			<div style={{float:'left', width:105,marginLeft: (index == 0) ? 0 : (index == 1) ? 11 : 49}}>
						    {
								key == "encryptclassId"
								  ? <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@7e3z0n@integrationLoginForm${field.domkey[0]}`} 
								      {...field}
									  options={encryptClassOptions}
									  value={loginForm.form.getFormParams()[key]}
									  onChange={v => loginForm.form.updateFields({[key]: v})}
								    />
								  : <div>
										{index == 2 &&
											<a
												style={{position:'absolute', top: 6, left: 234}}
												onClick={() => {
													setIsSysAlgorithm({
														isSysAlgorithm: false
													});
													openDialog({type: 'encrypt_new', from: "quickAdd"});
												}}
											>
												{getLabel(365, '新建')}
											</a>}
										<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@u8arsv@integrationLoginForm${field.domkey[0]}`}
											fieldConfig={field}
											form={form}
											formParams={form.getFormParams()}
											onChange={cb => this.handleChange(cb)}
										/>
								    </div>
							}
            				
            			</div>
            		)
            	})}
            	<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@bi5owa`} style={{display: 'block',float:'left', marginLeft: 10,marginTop: 5}} title={getLabel(125496,'选择MD5加密时，我们会使用标准的MD5加密;选择PBE加密时，如果填写了加密密钥，将可以进行解密还原出明文；如果选择的是自定义加密算法，那么需要填写加密程序的路径以及方法，传递的参数将只有需要加密的需求本身，返回值必须是加密后的数据。')} />
            </WeaFormItem>
		)
	}

	accountParameter = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm
		} = intelogin, {
			accountParameter,
			urlparaencrypt1,
		} = loginForm;

		const temp = this.getShowComponents({
			tempArray: accountParameter,
		});

		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4as6sk`}
                label={getLabel(20965,'账号参数名')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	<div >
            		{temp.map( (field, index) => {
            			return (
            				<div style={{float:'left', width: (index==0)?105:(index==1)?214:(index==2)?100:125,marginLeft: (index==1||index==4)?11:0,paddingTop:(index==1)?1:0}} className={(index==3||index==4)?'integrated-login-account':''}>
            					{(index == 2) && <span style={{paddingRight: 5}}>{getLabel(28640,'是否加密')}</span>}
            					{(index == 3 && urlparaencrypt1 == '1') && <span>{getLabel(32348,'加密密钥')}</span>}
            					{(index == 4 && urlparaencrypt1 == '1') && <span>{getLabel(129315,'加密向量')}</span>}
            					{(index == 3 || index==4 ) &&  (urlparaencrypt1 == '0' || !urlparaencrypt1) ? <div></div> : <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@a256nw@integrationLoginForm${field.domkey[0]}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={cb => this.handleChange(cb)}/>}
            				</div>
            			)
            		})}
            		{(temp.length > 3 && urlparaencrypt1 == '1') && <div style={{float: 'left',margin: 6}}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@46q7ie`} title={getLabel(129590,'如果此处没有填写密钥和向量，则使用加密算法设置中的密钥和向量对参数进行加密，以下规则均如此！')} /></div>}
            	</div>
            </WeaFormItem>
		)
	}

	passwordParameter = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm
		} = intelogin, {
			passwordParameter,
			urlparaencrypt2,
		} = loginForm;

		const temp = this.getShowComponents({
			tempArray: passwordParameter,
		});
		const formParams = form.getFormParams();
		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@uj7ern`}
                label={getLabel(20966,'密码参数名')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{temp.map( (field, index) => {
            		return (
            			<div style={{float:'left', width: (index == 0) ? 105 : (index == 1) ? 214 : (index == 2) ? 100 : 125,marginLeft: (index==1||index==4)?11:0,paddingTop:(index==1)?1:0}} className={(index==3||index==4)?'integrated-login-account':''}>
            				{(index == 2) && <span style={{paddingRight: 5}}>{getLabel(28640,'是否加密')}</span>}
            				{(index == 3 && urlparaencrypt2 == '1') && <span>{getLabel(32348,'加密密钥')}</span>}
            				{(index == 4 && urlparaencrypt2 == '1') && <span>{getLabel(129315,'加密向量')}</span>}
            				{(index == 3 || index == 4 ) &&  (urlparaencrypt2 == '0' || !urlparaencrypt2) ? <div></div> : <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@9pn33u@integrationLoginForm${field.domkey[0]}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={cb => this.handleChange(cb)}/>}
            			</div>
            		)
            	})}
            	{(temp.length > 3  && urlparaencrypt2 == '1') && <div style={{float: 'left',margin: 6}}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@m4anay`} title={getLabel(129590,'如果此处没有填写密钥和向量，则使用加密算法设置中的密钥和向量对参数进行加密，以下规则均如此！')} /></div>}
				{(formParams.typename != "8" && formParams.basetype2 == 1 && formParams.requesttype == 1) ? <span style={{color: "red", lineHeight: "30px"}}>{getLabel('514847','请求方式为GET时,使用ecology密码,密码有泄漏的风险')}</span> : "" }
		    </WeaFormItem>
		)
	}

	getShowComponents = (params) => {
		const {
			intelogin
		} = this.props, {
			loginForm
		} = intelogin, {
			encrypttype,
			isneedpwd,
			isneediv,
			form
		} = loginForm, {
			tempArray,
		} = params;
		let temp, m1, m2, m3;
		const formParams = form.getFormParams();
		if (encrypttype == '0') {
			m1 = 0;
			m2 = 2;
		} else {
			if (isneedpwd == '0' && isneediv == '0') {
				m1 = 0;
				m2 = 3;
			}
			if (isneedpwd == '1' && isneediv == '0') {
				m1 = 0;
				m2 = 4;
			}
			if (isneedpwd == '1' && isneediv == '1') {
				m1 = 0;
			}
			if (isneedpwd == '0' && isneediv == '1') {
				m1 = 0;
				m2 = 3;
				m3 = 4;
			}
		}
		if(["7", "11", "8"].includes(formParams.typename)) {
			temp = tempArray.slice(0, 2);
		}else {
			if (m3) {
				temp = tempArray.slice(m1, m2).concat(tempArray.slice(m3))
			} else {
				temp = m2 ? tempArray.slice(m1, m2) : tempArray.slice(m1);
			}
		}

		return temp;
	}

	automaticLogin = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			setHRMNetworkListVisible,
		} = intelogin, {
			automaticLogin,
			autologin,
		} = loginForm;

		const temp = (autologin == '1') ? automaticLogin : automaticLogin.slice(0, 1);

		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@ar9qaj`}
                label={getLabel(125423,'内外网自动登录')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{temp.map( (field, index) => {
            		return (
            			<div style={{float:'left'}}>
            				<div style={{width: (index == 1 ? 218 : 50),float:'left'}}>
            					<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@qxh5z1@integrationLoginForm${field.domkey[0]}`}
            					   fieldConfig={field}
            					   form={form}
            					   formParams={form.getFormParams()}
            					   onChange={cb => this.handleChange(cb)}
            					  />
            				</div>
            				{index == '1' && <div style={{float:'left', margin: 5}}>
								<a
									style={{marginLeft:7,display:'none'}}
									onClick={() => this.AddSetPolicy()}
								>
									{getLabel(131201, '添加')}
								</a>


								<a
									style={{marginLeft: 5, marginTop: 2, display: 'inline-block'}}
									onClick={() => setHRMNetworkListVisible(true)}
									// onClick={() => openNetworkSegmentStrategy()}
								>
									{getLabel(83726,'网段策略')}
								</a>
								<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@i1hmre@integrationLoginForm${field.domkey[0]}`}
									width={225}
									style={{marginLeft: 5}}
									title={`${getLabel(18890,'点击')}[${getLabel(83726,'网段策略')}]${getLabel(125421,'可进入网段策略设置页面')}`}
								/>
            				</div>}
            			</div>
            		)
            	})}
            </WeaFormItem>
		)
	}

	AddSetPolicy = () => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			addIpAddress
		} = intelogin, {
			ipaddress,
			condition,
			ipAddresses,
		} = loginForm;

		const temp = condition[0].items.find(item => item.domkey[0] === 'ipaddress');
		if (!temp) {
			return
		}
		const option = temp.options.find(option => option.key === ipaddress);
		if (!option) {
			return
		}
		const showname = option.showname;
		if (ipAddresses.some(val => val === showname)) {
			message.warning(getLabel(125425, '不能重复添加此网段'));
			return
		}
		addIpAddress(showname);
	}

	requestType = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm
		} = intelogin, {
			requestType,
			requesttype,
			typename,
		} = loginForm;
		const {isRequestTypeEdit} = toJS(intelogin.status);
		let datas = [];
		toJS(requestType) && toJS(requestType).map(f => {
			if(f.domkey[0] === "requesttype") {
				f.viewAttr = isRequestTypeEdit?2:1;
				f.hasBorder = true;
				if (typename=='0') {
					if(form.getFormParams().logintype == '0') {
						f.viewAttr=2
					} else {
						f.viewAttr=1
					}
				}else {
					f.viewAttr=1
				}
			}
			datas.push(f);
		});

		const temp = (requesttype == '1') ? datas : datas.slice(0, 1);
		return (
			<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@qiamx0`}
                label={getLabel(32343,'请求方式')}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
				//className={isRequestTypeEdit ? 'specialCol2' : 'normalCol'}
            >
            	{temp.map( (field, index) => {

            		return (
            			<div style={{float:'left',width: (index==0)?100:156,marginLeft:(index==1)?10:0}}>
            				<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@nbrr13@integrationLoginForm${field.domkey[0]}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={cb => this.handleChange(cb)}/>
            			</div>
            		)
            	})}
            </WeaFormItem>
		)
	}

	ipAddresses = (form) => {
		const {
			intelogin
		} = this.props, {
			loginForm,
			deleteIpAddress,
		} = intelogin, {
			ipAddresses
		} = loginForm;

		if (ipAddresses.length > 0 && form.getFormParams().autologin == 1) {
			return (
				<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@bx0vz5`}
                label={''}
                colon={false}
                labelCol={{span: 4, offset: 1}}
                wrapperCol={{span: 19}}
            >
            	{ipAddresses.map( (ipAddress, index) => {
            		return (
            			<p style={{padding: index>0 ?'5px 0':0}}>
            				<span>{ipAddress}</span>
            				<span style={{marginLeft: 45}}>
            					<a onClick={() => deleteIpAddress(index)}>{getLabel(131966, '删除')}</a>
            				</span>
            			</p>
            		)
            	})}
            </WeaFormItem>
			)
		} else {
			return
		}
	}

	render() {
		return (
			<div className='integrated-login-form'>
			    {this.getForm()}
			</div>
		)

	}
}