diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx index f314cfa80..cd3de57cf 100644 --- a/src/forge/Team/New.jsx +++ b/src/forge/Team/New.jsx @@ -1,15 +1,15 @@ import React,{ forwardRef , useCallback , useEffect, useState } from 'react'; import './Index.scss'; -import { Form , Input , Radio , Checkbox , Button, InputNumber } from "antd"; +import { Form , Input , Radio , Checkbox , Button } from "antd"; import UploadImage from './Component/UploadImage'; import axios from 'axios'; - +const port = window.location.port; +const hostname = window.location.hostname; export default Form.create()( forwardRef(({ form , showNotification , history })=>{ const [ image , setImage ] = useState(undefined); const [ imageFlag , setImageFlag] = useState(false); const { getFieldDecorator, validateFields , setFieldsValue } = form; - const radioStyle = { display: 'block', height: '30px', @@ -60,19 +60,44 @@ export default Form.create()( }) },[]) + function checkname(rule, value, callback){ + if(!value){ + callback(); + } + if(value && !value.match(/^[a-zA-Z][a-zA-Z\d]{3,14}$/)){ + callback("只能使用英文字母和数字,以字母开头,长度为4到15个字符"); + } + callback(); + } + return(

新建组织

{helper( - 组织名称:(组织名称应该简单明了), + 组织账号:, "name", + [ + { required: true, message: "请输入组织账号" }, + { + validator:checkname + } + ], + + )} + {helper( + 组织名称:, + "nickname", [{ required: true, message: "请输入组织名称" }], )} + {helper( '组织描述', "description", diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx index b161e5a10..1c44a150d 100644 --- a/src/forge/Team/Setting/TeamSettingCommon.jsx +++ b/src/forge/Team/Setting/TeamSettingCommon.jsx @@ -95,6 +95,15 @@ export default Form.create()( }) setVisible(false); } + function checkname(rule, value, callback){ + if(!value){ + callback(); + } + if(value && !value.match(/^[a-zA-Z][a-zA-Z\d]{3,14}$/)){ + callback("只能使用英文字母和数字,以字母开头,长度为4到15个字符"); + } + callback(); + } return(
@@ -102,8 +111,19 @@ export default Form.create()(
{helper( - "组织名称:", + "组织账号:", "name", + [ + { required: true, message: "请输入组织账号" }, + { + validator:checkname + } + ], + ,true + )} + {helper( + "组织名称:", + "nickname", [{ required: true, message: "请输入组织名称" }], ,true )} diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx index 3979c4c4f..bba0b7de8 100644 --- a/src/forge/Team/Sub/Detail.jsx +++ b/src/forge/Team/Sub/Detail.jsx @@ -78,7 +78,7 @@ function Detail(props){ detail && { detail && 组织成员{detail.num_users && {detail.num_users}} diff --git a/src/modules/courses/css/Courses.css b/src/modules/courses/css/Courses.css index 0e1eb09d3..f23de670d 100644 --- a/src/modules/courses/css/Courses.css +++ b/src/modules/courses/css/Courses.css @@ -1366,10 +1366,6 @@ samp { line-height: 40px; } -.courseForm .ant-input-group>.ant-input:first-child, -.ant-input-group-addon:first-child { - height: 40px; -} .courseForm .ant-select-selection, .courseForm .ant-select-selection-selected-value { @@ -1722,12 +1718,6 @@ samp { background-color: #fff !important; } -.ant-input-group-addon { - color: #666 !important; - font-size: 12px; - border: 1px solid #d9d9d9 !important; - border-left: none !important; -} .check_on { background: #4CACFF;