From e0aeab0e2029290016a6f10fc0166788e513dc08 Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 9 Sep 2021 10:10:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8tip?= =?UTF-8?q?=E6=96=87=E6=A1=88-=E5=BE=85=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/IndexItem.js | 10 +++++----- src/forge/Team/RightBox.jsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 2265ac20..4a1dc671 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -41,22 +41,22 @@ class IndexItem extends Component { { !item.is_public && 私有 } { item.forked_from_project_id ? - + - + : "" } { item.type && item.type === 2 ? - + :"" } { item.type && item.type === 1 ? - + - :"" + :"" } diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx index 7616fd6c..5c85ae47 100644 --- a/src/forge/Team/RightBox.jsx +++ b/src/forge/Team/RightBox.jsx @@ -108,7 +108,7 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
{ (item.is_admin || item.is_member) ? - {item.name} + {item.nickname} : {item.name} } From a4475e995bf443cc3085644421b463a8bbcc3762 Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 9 Sep 2021 14:11:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=90=8C=E4=B8=8A,=E6=96=87=E6=A1=88?= =?UTF-8?q?=E5=B7=B2=E6=94=B9,=E9=A1=B9=E7=9B=AE=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=89=8D=E7=AB=AF=E4=BF=AE=E6=94=B9,wait?= =?UTF-8?q?=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/IndexItem.js | 4 +- src/forge/New/Index.js | 299 ++++++++++++++++------------ src/forge/New/{new.css => new.scss} | 30 ++- 3 files changed, 201 insertions(+), 132 deletions(-) rename src/forge/New/{new.css => new.scss} (68%) diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 4a1dc671..5b84bcb1 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -48,13 +48,13 @@ class IndexItem extends Component { } { item.type && item.type === 2 ? - + :"" } { item.type && item.type === 1 ? - + :"" } diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 7a9be5a5..f9f80b4d 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -2,9 +2,10 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd'; import { Base64 } from 'js-base64'; +import { AlignCenter } from '../Component/layout'; import '../css/index.scss'; -import './new.css' +import './new.scss' import axios from 'axios'; const Option = Select.Option; @@ -44,7 +45,12 @@ class Index extends Component { project_category_name: undefined, license_name: undefined, ignore_name: undefined, - descNum:0 + descNum:0, + + categoreFlag:false, + languageFlag:false, + ignoreFlag:false, + licenseFlag:false, } } componentDidMount = () => { @@ -189,6 +195,7 @@ class Index extends Component { subMitFrom = () => { this.props.form.validateFieldsAndScroll((err, values) => { + console.log(err); if (!err) { this.setState({ isSpin: true @@ -313,41 +320,28 @@ class Index extends Component { mirrorCheck, - descNum + descNum, + + ignoreFlag, + licenseFlag, + languageFlag, + categoreFlag } = this.state; return (
-
创建{projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目
+
{projectsType && projectsType === "mirror" ? "导入" : "新建"}项目
- - {getFieldDecorator('user_id', { - rules: [{ - required: true, message: '请选择拥有者' - },{ - validator:(rule, value, callback) => this.checkId(rule, value, callback, OwnerList, '拥有者') - }], - })( - this.ChangePlatform(value, e, 'owners', OwnerList)} - className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, OwnerList, "owners")} - > - {owners_list} - - )} - - { + + { projectsType && projectsType === "mirror" && {getFieldDecorator('clone_addr', { rules: [{ @@ -362,13 +356,13 @@ class Index extends Component { } { projectsType && projectsType === "mirror" && - +

需要授权验证 - 如果源项目为公有仓库,禁止填写用户名密码。如果源项目为私有仓库,则必须填写正确的用户名和密码!

+ 如果导入项目为私有仓库,则必须填写相应平台正确的用户名和密码

{ mirrorCheck && -
+
用户名
} - +
} + + + {getFieldDecorator('user_id', { + rules: [{ + required: true, message: '请选择拥有者' + },{ + validator:(rule, value, callback) => this.checkId(rule, value, callback, OwnerList, '拥有者') + }], + })( + this.ChangePlatform(value, e, 'owners', OwnerList)} + className="plateAutoComplete" + onBlur={(value) => this.blurCategory(value, OwnerList, "owners")} + > + {owners_list} + + )} + + / + + {getFieldDecorator('name', { + rules: [{ + required: true, message: '请填写项目名称' + }], + })( + + )} + + 项目标识 (项目url标识部分)} + colon={false} > - {getFieldDecorator('name', { + {getFieldDecorator('repository_name', { rules: [{ - required: true, message: '请填写项目名称' + required: true, message: '请填写项目标识' }], })( - + )}
{descNum}/200 {getFieldDecorator('description', { - rules: [{ - required: true, message: '请填写项目简介' - }], + rules: [], })( )}
- - {getFieldDecorator('repository_name', { - rules: [{ - required: true, message: '请填写仓库名称' - }], - })( - - )} - - - {getFieldDecorator('project_category', { - rules: [{ - required: true, message: '请选择大类别', - }, { - validator: (rule, value, callback) => this.checkId(rule, value, callback, CategoryList, '项目类别') - }], - })( - this.ChangePlatform(value, e, 'project_category', CategoryList)} - className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, CategoryList, "project_category")} - > - {project_category_list} - - )} - - - {getFieldDecorator('project_language', { - rules: [{ - required: true, message: '请选择项目语言' - }, { - validator: (rule, value, callback) => this.checkId(rule, value, callback, LanguageList, '项目语言') - }], - })( - this.ChangePlatform(value, e, 'project_language', LanguageList)} - className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, LanguageList, "project_language")} - > - {project_language_list} - - )} - + { (projectsType === "deposit" || !projectsType) && - {getFieldDecorator('ignore', { - rules: [{ - required: true, message: '请选择gitignore' - }, { - validator: (rule, value, callback) => this.checkId(rule, value, callback, GitignoreList, 'gitignore') - }], - })( - this.ChangePlatform(value, e, 'ignore', GitignoreList)} - className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, GitignoreList, "ignore")} - > - {ignore_list} - + {getFieldDecorator('ignoreFlag')( + .gitignore )} + { ignoreFlag && + + {getFieldDecorator('ignore', { + rules: [{ + required: ignoreFlag, message: '请选择gitignore' + }, { + validator: (rule, value, callback) => this.checkId(rule, value, callback, GitignoreList, 'gitignore') + }], + })( + this.ChangePlatform(value, e, 'ignore', GitignoreList)} + className="plateAutoComplete" + onBlur={(value) => this.blurCategory(value, GitignoreList, "ignore")} + > + {ignore_list} + + )} + + } - {getFieldDecorator('license', { - rules: [{ - required: true, message: '请选择开源许可证' - }, { - validator: (rule, value, callback) => this.checkId(rule, value, callback, LicensesList, '开源许可证') - }], - })( - this.ChangePlatform(value, e, 'license', LicensesList)} - className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, LicensesList, "license")} - > - {license_list} - + {getFieldDecorator('licenseFlag')( + 开源许可证 )} + { licenseFlag && + + {getFieldDecorator('license', { + rules: [{ + required: licenseFlag, message: '请选择开源许可证' + }, { + validator: (rule, value, callback) => this.checkId(rule, value, callback, LicensesList, '开源许可证') + }], + })( + this.ChangePlatform(value, e, 'license', LicensesList)} + className="plateAutoComplete" + onBlur={(value) => this.blurCategory(value, LicensesList, "license")} + > + {license_list} + + )} + + } } {getFieldDecorator('private')( - 将项目设为私有(只有项目所有人或拥有权限的项目成员才能看到) + 将项目设为私有(只有项目所有人或拥有权限的项目成员才能看到) )} { projectsType && projectsType === "mirror" && {getFieldDecorator('is_mirror')( @@ -537,7 +531,62 @@ class Index extends Component { )} } -
+ + {getFieldDecorator('categoreFlag')( + 项目类别 + )} + + {categoreFlag && + + {getFieldDecorator('project_category', { + rules: [{ + required: categoreFlag, message: '请选择大类别', + }, { + validator: (rule, value, callback) => this.checkId(rule, value, callback, CategoryList, '项目类别') + }], + })( + this.ChangePlatform(value, e, 'project_category', CategoryList)} + className="plateAutoComplete" + onBlur={(value) => this.blurCategory(value, CategoryList, "project_category")} + > + {project_category_list} + + )} + + } + + {getFieldDecorator('languageFlag')( + this.setState({languageFlag:e.target.checked})}>项目语言 + )} + + {languageFlag && + + {getFieldDecorator('project_language', { + rules: [{ + required: languageFlag, message: '请选择项目语言' + }, { + validator: (rule, value, callback) => this.checkId(rule, value, callback, LanguageList, '项目语言') + }], + })( + this.ChangePlatform(value, e, 'project_language', LanguageList)} + className="plateAutoComplete" + onBlur={(value) => this.blurCategory(value, LanguageList, "project_language")} + > + {project_language_list} + + )} + + } +
注: 为必填项,否则为选填
diff --git a/src/forge/New/new.css b/src/forge/New/new.scss similarity index 68% rename from src/forge/New/new.css rename to src/forge/New/new.scss index fcb6fa8c..daa3c8e5 100644 --- a/src/forge/New/new.css +++ b/src/forge/New/new.scss @@ -12,7 +12,13 @@ border-bottom: 1px solid #f0f0f0 } .newPanel_content{ - padding:1rem 2rem; + padding:2rem; +} +.newPanel_content form .ant-row.ant-form-item{ + margin-bottom: 25px; +} +.newPanel_content .ant-form-item-label label{ + font-size: 16px; } .newPanel_content .ant-form-item-control-wrapper{ flex: 1; @@ -25,7 +31,9 @@ height: 35px; line-height: 35px; } - +.newPanel_content .ant-form-explain{ + position: absolute; +} .newContent_inline{ display: flex; flex-wrap: wrap; @@ -36,13 +44,25 @@ .newContent_inline > .ant-form-item:nth-child(2){ margin-left: 20px; } -.newPanel_content .privatePart .ant-form-item-label{ - margin-left: 0px; +.privatePart{ + margin-bottom: 0px!important; + .ant-form-item-control{ + height: 28px; + line-height: 28px; + margin-top: 10px; + } + .ant-form-item-label{ + margin-left: 0px; + } } .newPanel_content .ant-form-item-label{ line-height: 25px; height: 25px; - margin-left: -0.8rem; +} +.plateAutoComplete{ + .ant-input{ + height: 34px!important; + } } @media screen and (max-width: 750px){ .newPanel_content{ From a24132412e84b32b961c0b2cf834074f2836aa3a Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 9 Sep 2021 16:35:02 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=92=E7=89=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/New/Index.js | 14 ++++++++------ src/forge/New/new.scss | 13 +++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index f9f80b4d..50859e30 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -377,7 +377,6 @@ class Index extends Component { 密码 {getFieldDecorator('password', { rules: [], @@ -394,6 +393,7 @@ class Index extends Component { label="拥有者" style={{width:"260px"}} colon={false} + className="explainPos" > {getFieldDecorator('user_id', { rules: [{ @@ -416,7 +416,7 @@ class Index extends Component { / {getFieldDecorator('name', { @@ -462,7 +462,7 @@ class Index extends Component { className="privatePart" > {getFieldDecorator('ignoreFlag')( - .gitignore + this.setState({ignoreFlag:e.target.checked})}>.gitignore )} { ignoreFlag && @@ -489,7 +489,7 @@ class Index extends Component { className="privatePart" > {getFieldDecorator('licenseFlag')( - 开源许可证 + this.setState({licenseFlag:e.target.checked})}>开源许可证 )} { licenseFlag && @@ -536,11 +536,13 @@ class Index extends Component { className="privatePart" > {getFieldDecorator('categoreFlag')( - 项目类别 + this.setState({categoreFlag:e.target.checked})}>项目类别 )} {categoreFlag && - + {getFieldDecorator('project_category', { rules: [{ required: categoreFlag, message: '请选择大类别', diff --git a/src/forge/New/new.scss b/src/forge/New/new.scss index daa3c8e5..15aca70b 100644 --- a/src/forge/New/new.scss +++ b/src/forge/New/new.scss @@ -31,26 +31,23 @@ height: 35px; line-height: 35px; } -.newPanel_content .ant-form-explain{ - position: absolute; -} .newContent_inline{ display: flex; flex-wrap: wrap; justify-content: space-between; align-items:flex-end } +.explainPos{ + .ant-form-explain{ + position: absolute; + } +} .newContent_inline > .ant-form-item:nth-child(2){ margin-left: 20px; } .privatePart{ margin-bottom: 0px!important; - .ant-form-item-control{ - height: 28px; - line-height: 28px; - margin-top: 10px; - } .ant-form-item-label{ margin-left: 0px; } From eb89f6a6a7e9dd2adcb8bc2e38ebb133358be1d8 Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 9 Sep 2021 16:49:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=AD=97=E7=9A=84=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Index.js | 8 ++++---- src/forge/Team/List.jsx | 4 ++-- src/forge/users/InfosUser.js | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index a08c3d3b..6ba2d34c 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -256,11 +256,11 @@ class Index extends Component { newItem = ()=>{ return( - - {this.props.history.push('/projects/mirror/new')}}>新建镜像项目 - - {this.props.history.push('/projects/deposit/new')}}>新建托管项目 + {this.props.history.push('/projects/deposit/new')}}>新建项目 + + + {this.props.history.push('/projects/mirror/new')}}>导入项目 ) diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx index 7e64c5de..5eebfc38 100644 --- a/src/forge/Team/List.jsx +++ b/src/forge/Team/List.jsx @@ -63,10 +63,10 @@ function List(props){ const menu_new=( - {props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建托管项目 + {props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建项目 - {props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>新建镜像项目 + {props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>导入项目 ) diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js index 276a0b1f..d6f30ee8 100644 --- a/src/forge/users/InfosUser.js +++ b/src/forge/users/InfosUser.js @@ -115,11 +115,11 @@ class InfosUser extends Component { newItem =()=> ( - - {this.props.history.push('/projects/mirror/new')}}>新建镜像项目 - - {this.props.history.push('/projects/deposit/new')}} >新建托管项目 + {this.props.history.push('/projects/deposit/new')}} >新建项目 + + + {this.props.history.push('/projects/mirror/new')}}>导入项目 );