diff --git a/client/actions/project.js b/client/actions/project.js index 6b74aec4..1760c1fc 100644 --- a/client/actions/project.js +++ b/client/actions/project.js @@ -37,10 +37,11 @@ const changeTableLoading = (data) => { }; const addProject = (data) => { - const { name, prd_host, basepath, desc, group_id } = data; + const { name, prd_host, basepath, desc, group_id, protocol } = data; const param = { name, prd_host, + protocol, basepath, desc, group_id @@ -53,10 +54,11 @@ const addProject = (data) => { }; const updateProject = (data) => { - const { name, prd_host, basepath, desc, _id } = data; + const { name, prd_host, basepath, desc, _id, protocol } = data; const param = { name, prd_host, + protocol, basepath, desc, id: _id diff --git a/client/containers/ProjectGroups/ProjectList/ProjectList.js b/client/containers/ProjectGroups/ProjectList/ProjectList.js index be116664..9170fe1a 100644 --- a/client/containers/ProjectGroups/ProjectList/ProjectList.js +++ b/client/containers/ProjectGroups/ProjectList/ProjectList.js @@ -27,7 +27,7 @@ const deleteConfirm = (id, handleDelete, currGroupId, handleFetchList) => { } return test; }; -// this.props.fetchProjectList, this.props.changeUpdateModal + const getColumns = (data, props) => { const { handleDelete, currGroup, fetchProjectList, changeUpdateModal, userInfo } = props; return [{ @@ -130,7 +130,7 @@ class ProjectList extends Component { }); } - // 确认修改 + // 确认添加项目 @autobind handleOk(e) { const { form, currGroup, changeTableLoading, addProject, fetchProjectList } = this.props; @@ -138,7 +138,7 @@ class ProjectList extends Component { e.preventDefault(); form.validateFields((err, values) => { if (!err) { - values.prd_host = this.state.protocol + values.prd_host; + values.protocol = this.state.protocol.split(':')[0]; // 获取当前分组id传入values values.group_id = currGroup._id; diff --git a/client/containers/ProjectGroups/ProjectList/UpDateModal.js b/client/containers/ProjectGroups/ProjectList/UpDateModal.js index bfb773ec..aa7da144 100644 --- a/client/containers/ProjectGroups/ProjectList/UpDateModal.js +++ b/client/containers/ProjectGroups/ProjectList/UpDateModal.js @@ -86,7 +86,7 @@ class UpDateModal extends Component { if (!err) { console.log(projectList[handleUpdateIndex]); let assignValue = Object.assign(projectList[handleUpdateIndex], values); - assignValue.prd_host = this.state.protocol + assignValue.prd_host; + values.protocol = this.state.protocol.split(':')[0]; assignValue.env = assignValue.envs.map((item) => { console.log(assignValue); const arr = assignValue['envs-'+item].split(',');