diff --git a/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js b/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js index 5d73fb64..3f660309 100755 --- a/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js +++ b/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js @@ -37,6 +37,7 @@ const confirm = Modal.confirm; import { nameLengthLimit, entries, trim } from '../../../../common'; import '../Setting.scss'; import _ from 'underscore'; +import ProjectTag from './ProjectTag.js'; // layout const formItemLayout = { labelCol: { @@ -106,12 +107,19 @@ class ProjectMessage extends Component { const { form, updateProject, projectMsg, groupList } = this.props; form.validateFields((err, values) => { if (!err) { - let assignValue = Object.assign(projectMsg, values); + let { tag } = this.tag.state; + // let tag = this.refs.tag; + tag = tag.filter(val => { + return val.name !== ''; + }); + let assignValue = Object.assign(projectMsg, values, { tag }); + values.protocol = this.state.protocol.split(':')[0]; const group_id = assignValue.group_id; const selectGroup = _.find(groupList, item => { return item._id == group_id; }); + updateProject(assignValue) .then(res => { if (res.payload.data.errcode == 0) { @@ -138,6 +146,10 @@ class ProjectMessage extends Component { }); }; + tagSubmit = tag => { + this.tag = tag; + }; + showConfirm = () => { let that = this; confirm({ @@ -221,8 +233,28 @@ class ProjectMessage extends Component { (location.port !== '' ? ':' + location.port : '') + `/mock/${projectMsg._id}${projectMsg.basepath}+$接口请求路径`; let initFormValues = {}; - const { name, basepath, desc, project_type, group_id, switch_notice, strice, is_json5 } = projectMsg; - initFormValues = { name, basepath, desc, project_type, group_id, switch_notice, strice , is_json5}; + const { + name, + basepath, + desc, + project_type, + group_id, + switch_notice, + strice, + is_json5, + tag + } = projectMsg; + initFormValues = { + name, + basepath, + desc, + project_type, + group_id, + switch_notice, + strice, + is_json5, + tag + }; const colorArr = entries(constants.PROJECT_COLOR); const colorSelector = ( @@ -358,6 +390,21 @@ class ProjectMessage extends Component { ] })(