From ca32cd934dcc16429370bb34ec8698739ef59852 Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Tue, 25 Jul 2017 10:49:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E7=8E=AF=E5=A2=83=E5=9F=9F=E5=90=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86http/https=E7=9A=84=E9=80=89=E6=8B=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectGroups/ProjectList/UpDateModal.js | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/client/containers/ProjectGroups/ProjectList/UpDateModal.js b/client/containers/ProjectGroups/ProjectList/UpDateModal.js index b82131bf..06514cbd 100644 --- a/client/containers/ProjectGroups/ProjectList/UpDateModal.js +++ b/client/containers/ProjectGroups/ProjectList/UpDateModal.js @@ -50,7 +50,8 @@ class UpDateModal extends Component { constructor(props) { super(props); this.state = { - protocol: 'http:\/\/' + protocol: 'http:\/\/', + envProtocolChange: 'http:\/\/' } } static propTypes = { @@ -84,18 +85,19 @@ class UpDateModal extends Component { e.preventDefault(); const { form, updateProject, changeUpdateModal, currGroup, projectList, handleUpdateIndex, fetchProjectList, changeTableLoading } = this.props; form.validateFields((err, values) => { - console.log(err); + console.log(values); if (!err) { - console.log(projectList[handleUpdateIndex]); + // console.log(projectList[handleUpdateIndex]); let assignValue = Object.assign(projectList[handleUpdateIndex], values); values.protocol = this.state.protocol.split(':')[0]; assignValue.env = assignValue.envs.map((item, index) => { + console.log(values['envs-protocol-'+index]); return { name: values['envs-name-'+index], - domain: values['envs-domain-'+index] + domain: values['envs-protocol-'+index] + values['envs-domain-'+index] } }); - console.log(assignValue); + // console.log(assignValue); changeTableLoading(true); updateProject(assignValue).then((res) => { @@ -119,6 +121,13 @@ class UpDateModal extends Component { }); } + envProtocolChange = (value) => { + console.log(value); + // this.setState({ + // envProtocolChange: value + // }) + } + // 项目的修改操作 - 删除一项环境配置 remove = (id) => { const { form } = this.props; @@ -174,7 +183,7 @@ class UpDateModal extends Component { getFieldDecorator('envs', { initialValue: envMessage }); const envs = getFieldValue('envs'); const formItems = envs.map((k, index) => { - console.log(k); + // console.log(k); const secondIndex = 'next' + index; // 为保证key的唯一性 return ( @@ -220,7 +229,7 @@ class UpDateModal extends Component { > {getFieldDecorator(`envs-domain-${index}`, { validateTrigger: ['onChange', 'onBlur'], - initialValue: envMessage.length !== 0 ? k.domain : '', + initialValue: envMessage.length !== 0 ? k.domain.split('\/\/')[1] : '', rules: [{ required: false, whitespace: true, @@ -240,7 +249,18 @@ class UpDateModal extends Component { } }] })( - + + + + + )}/> )}