diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 7ada96f4..fa09777e 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -6703,4 +6703,10 @@ ul.count_ul li:not(:last-child):after { } input.ant-input-lg::placeholder{ font-size: 14px !important; +} +.toprightNum{ + position: absolute; + right: 0px; + top:4px; + color: #999; } \ No newline at end of file diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx new file mode 100644 index 00000000..dd947501 --- /dev/null +++ b/src/forge/Divert/DivertModal.jsx @@ -0,0 +1,174 @@ +import React ,{ forwardRef, useEffect, useState } from 'react'; +import { Modal , Form , Input , Radio , Select } from 'antd'; +import SearchUser from '../Component/SearchUser'; +import './Index.scss'; +import Axios from 'axios'; + +const { Option } = Select; +function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ + const { getFieldDecorator, validateFields , setFieldsValue } = form; + const [ cate , setCate ] = useState(0); + const [ value , setValue ] = useState(undefined); + + const [ organizations , setOrganizations ] = useState(undefined); + + useEffect(()=>{ + setFieldsValue({goal:cate}) + },[]) + + useEffect(()=>{ + if(owner && repo && visible===true){ + getTeam(); + } + if(!visible){ + setFieldsValue({ + owner_name:undefined, + identifier:undefined + }) + setValue(undefined) + } + },[repo,owner,visible]) + + function getTeam(){ + const url = `/${owner}/${repo}/applied_transfer_projects/organizations.json`; + Axios.get(url).then(result=>{ + if(result){ + setOrganizations(result.data.organizations); + } + }).catch(error=>{}) + } + + // 确认转移 + function onOk(){ + validateFields((error,values)=>{ + console.log(...values); + if(!error){ + const url = `/${owner}/${repo}/applied_transfer_projects.json`; + Axios.post(url,{ + ...values + }).then(result=>{ + if(result){ + onSuccess(result.data && result.data.owner); + } + }).catch(error=>{}) + } + }) + + } + function changeType(e){ + setCate(e.target.value); + setFieldsValue({ + owner_name:undefined + }) + } + + function checkIdentifier(rule, value, callback){ + if(!value){ + callback(); + } + if (repo && value !== repo) { + callback("请输入当前项目的标识!"); + } + callback(); + } + + const layout = { + labelCol: { span: 5 }, + wrapperCol: { span: 18 }, + }; + + function getUser(id){ + setValue(id); + setFieldsValue({ + owner_name:id + }) + } + return( + +
+ { + cate === 0 ? + + : + + } +
+ + {getFieldDecorator("goal",{ + rules:[] + })( + + 个人 + 组织 + + )} + + { + cate === 0 && + + {getFieldDecorator("owner_name",{ + rules:[{required:true,message:"请输入目标用户名"}] + })( + // + + )} + + } + { + cate === 1 && + + {getFieldDecorator("owner_name", + {rules:[{required:true,message:"请选择目标组织"}]} + )( + + )} + + } + + + {getFieldDecorator("identifier", + { + rules:[ + {required:true,message:"请输入仓库名称"}, + { + validator:checkIdentifier + } + ] + } + )( + + )} + +
+
+
+ ) +} +export default Form.create()(forwardRef(DivertModal)); \ No newline at end of file diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 7260d114..043e5323 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -2,16 +2,14 @@ import React, { Component } from 'react'; import AccountProfile from "../../modules/user/AccountProfile"; import { getImageUrl } from 'educoder' import axios from 'axios'; -import { Modal, Input, message, notification , Dropdown , Menu ,Divider } from 'antd'; +import { Modal, Input, message, notification , Dropdown , Menu } from 'antd'; import LoginDialog from '../../modules/login/LoginDialog'; import GotoQQgroup from '../../modal/GotoQQgroup' -// import 'antd/lib/modal/style/index.css'; -// import 'antd/lib/checkbox/style/index.css'; -// import 'antd/lib/radio/style/index.css'; -// import 'antd/lib/input/style/index.css'; + import '../../modules/tpm/TPMIndex.css'; import logo from '../../modules/tpm/images/logo.png'; + import './header.scss'; const $ = window.$ // TODO 这部分脚本从公共脚本中直接调用 diff --git a/src/forge/Head/header.scss b/src/forge/Head/header.scss index 130df4ca..0ae8f48e 100644 --- a/src/forge/Head/header.scss +++ b/src/forge/Head/header.scss @@ -5,7 +5,13 @@ background:#fff; border-radius: 3px; .ant-menu-vertical > .ant-menu-item{ - border:none + border:none; + height: 35px; + line-height: 35px; + margin:0px; + } + .ant-menu-vertical{ + border:none; } } diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 703e2cd3..381d7438 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -43,7 +43,8 @@ class Index extends Component { project_language_name: undefined, project_category_name: undefined, license_name: undefined, - ignore_name: undefined + ignore_name: undefined, + descNum:0 } } componentDidMount = () => { @@ -254,6 +255,13 @@ class Index extends Component { } } + changeDesc=(e)=>{ + let value = e.target.value; + this.setState({ + descNum:value ? value.length :0 + }) + } + render() { const { getFieldDecorator } = this.props.form; // 项目类型:deposit-托管项目,mirror-镜像项目 @@ -273,7 +281,9 @@ class Index extends Component { license_list, ignore_list, - mirrorCheck + mirrorCheck, + + descNum } = this.state; return (
@@ -364,18 +374,20 @@ class Index extends Component { )} - - - {getFieldDecorator('description', { - rules: [{ - required: true, message: '请填写项目简介' - }], - })( - - )} - +
+ {descNum}/200 + + {getFieldDecorator('description', { + rules: [{ + required: true, message: '请填写项目简介' + }], + })( + + )} + +
@@ -384,7 +396,7 @@ class Index extends Component { required: true, message: '请填写仓库名称' }], })( - + )} )} + })()}
, true )} - {helper( - 团队描述:(描述团队的目的或作用), - "description", - [], -