diff --git a/README.md b/README.md index 1ff6a3404..4ad59474d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# gitlink-ssr版本 - - +####星云版本:2024-6-20 更新版本,包含开通工作台、代码库、issue、等模块的版本更新,基本与forge一直,属于内网版本,邮件、协议签订等均已隐藏。 #### node版本 12.x/14.x #### ng配置 diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 4eb3c41ed..180379579 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -17,7 +17,7 @@ const TerserWebpackPlugin = require('terser-webpack-plugin'); const paths = require("./paths"); const getClientEnvironment = require("./env"); -let publicPath = "/build/"; +let publicPath = "/react/build/"; const publicUrl = publicPath.slice(0, -1); // const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; diff --git a/public/index.html b/public/index.html index ab8c095b9..140fd06af 100755 --- a/public/index.html +++ b/public/index.html @@ -2,24 +2,24 @@ - GitLink | 新一代开源创新服务平台 + 星云协同开发平台 - - - + + + - - - + + + - - - + + + diff --git a/src/App.js b/src/App.js index 66bc88fa9..21410c4a1 100644 --- a/src/App.js +++ b/src/App.js @@ -47,10 +47,10 @@ const ProjectDetail = Loadable({ loader: () => import("./forge/Main/DetailAdaptor"), loading: Loading, }); -const Information = Loadable({ - loader: () => import('./forge/Information/index'), - loading: Loading, -}) +// const Information = Loadable({ +// loader: () => import('./forge/Information/index'), +// loading: Loading, +// }) //forge安全设置 const Security = Loadable({ loader: () => import('./forge/SecuritySetting/Index'), @@ -93,7 +93,7 @@ const Search = Loadable({ }) const WikiPreview = Loadable({ - loader: () => import('./forge/Wiki/Preview'), + loader: () => import('./forge/Wiki/page/preview'), loading: Loading, }) @@ -127,10 +127,10 @@ const Teaching = Loadable({ loading: Loading, }) -const Glcc = Loadable({ - loader : () => import("./glcc"), - loading: Loading, -}) +// const Glcc = Loadable({ +// loader : () => import("./glcc"), +// loading: Loading, +// }) const ConfigurateBot = Loadable({ loader: () => import("./forge/SecuritySetting/bot/exploit/configuration"), loading: Loading, @@ -268,7 +268,6 @@ class App extends Component { this.setState({ mygetHelmetapi: undefined }); - // document.title = "GitLink | 确实开源"; var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; @@ -339,11 +338,11 @@ class App extends Component { {/* */} {/* wiki预览 */} - { return () } - } /> + } /> {/* svg */} )} > - { return () } }> - + */} {/*glcc */} - } > } - > + > */} {/* soft市场页 */} { +export default(({ header , nav, history })=>{ return(
    {header} @@ -13,11 +13,11 @@ export default(({ header , nav })=>{ return( !item.hide &&
  • - + { item.href.indexOf("https") !== -1 ? window.location.href = item.href : history.push(item.href)}}> {item.icon && } {item.img && } {item.name} - +

  • ) diff --git a/src/forge/Component/SiderBar.js b/src/forge/Component/SiderBar.js index b3900311b..eddb3b28b 100644 --- a/src/forge/Component/SiderBar.js +++ b/src/forge/Component/SiderBar.js @@ -159,7 +159,6 @@ function SiderBar(props) { {setFeedBackValue(e.target.value); e.target.value && e.target.value.length && setFailApply(undefined);}}/> {(feedBackValue && feedBackValue.length) || 0}/500 - {/* /Gitlink/forgeplus */} {failApply &&
    {failApply}
    } diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index d1b785097..6c32ff91c 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -7,7 +7,7 @@ import { notification , Dropdown ,Popover, Menu,Badge } from 'antd'; import { Link } from 'react-router-dom'; import LoginDialog from '../../modules/login/LoginDialog'; -import HeadSearch from '../Component/HeadSearch'; +// import HeadSearch from '../Component/HeadSearch'; import AddProjectModal from './AddProjectModal'; import '../../modules/tpm/TPMIndex.css'; @@ -302,7 +302,7 @@ class NewHeader extends Component { showSubMenu, zoneList } = this.state; - let search_url = settings && settings.common && settings.common.search; + // let search_url = settings && settings.common && settings.common.search; return (
    @@ -319,14 +319,14 @@ class NewHeader extends Component { {...this.props} {...this.state} /> : ""} -
    + {/*
    { publicNav && ccf } -
    +
    */} { settings && settings.nav_logo_url ? @@ -379,7 +379,7 @@ class NewHeader extends Component { } {/*
    */}
    - { search_url && } + {/* { search_url && } */} { current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)? diff --git a/src/forge/Index.js b/src/forge/Index.js index dc4bb8707..5a8d16175 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -60,18 +60,18 @@ class Index extends Component { )} > ( )} > - ( )} - > + > */}
    ); diff --git a/src/forge/Information/Component/TopEdition.jsx b/src/forge/Information/Component/TopEdition.jsx deleted file mode 100644 index e5e8be285..000000000 --- a/src/forge/Information/Component/TopEdition.jsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import Slider from 'react-slick'; -import { getImageUrl } from 'educoder'; -import Left from '../../../home/Img/left.png'; -import Right from '../../../home/Img/right.png'; -import banner from '../img/mainbanner.png' - - - -let setting={ - dots:true, - infinite: true, - speed: 2000, - slidesToShow: 1, - slidesToScroll: 1, - pauseOnDotsHover:true, - autoplaySpeed:5000, - pauseOnFocus:true, - autoplay:true, - arrows:true, - prevArrow: , - nextArrow: -} -function TopEdition(props) { - const { bannerList } = props - - - return( - - { - bannerList && bannerList.length > 0 ? - bannerList.map((i,k)=>{ - return( -
    -
    -
    - ) - }) - : -
    -
    - } -
    - ) -} -export default TopEdition; \ No newline at end of file diff --git a/src/forge/Information/Component/comments/editComment.jsx b/src/forge/Information/Component/comments/editComment.jsx deleted file mode 100644 index 1f1727a89..000000000 --- a/src/forge/Information/Component/comments/editComment.jsx +++ /dev/null @@ -1,167 +0,0 @@ -import React from 'react'; -import { Button, message } from 'antd'; -import { getImageUrl } from 'educoder'; -import MDEditor from "../../../../modules/tpm/challengesnew/tpm-md-editor"; -import Upload from "../../../../forge/Upload/Index"; -import Attachments from "../../../../forge/Upload/attachment"; -import UploadImg from "../../../../forge/Images/upload.png"; -import './list.scss'; -import '../../../../forge/Order/order.scss'; -import { useState } from 'react'; -import { Link } from 'react-router-dom'; -import axios from 'axios'; -import { addComment, editComment } from '../../api' - -function EditComment(props){ - const {owner, projectsId, index} = props.match.params; - const {current_user, current_user:{login}, docId, showNotification, reloadComment, cancelMd, parentId, replyId, updateId, showUserImg=true} = props; - const [content, setContent] = useState(props.content); - const [quillFlag, setQuillFlag] = useState(false); - // 确认评论按钮loading效果 - const [journalSpin, setJournalSpin] = useState(false); - const [atWhoLoginList, setAtWhoLoginList] = useState(undefined); - const [fileList, setFileList] = useState(undefined); - const [attachmentClean, setAttachmentClean] = useState(true); - const [ save , setSave ] = useState(undefined); - - useState(()=>{ - setSave(props.defaultFileList); - },[props.defaultFileList]) - - // 评论点击函数 - function addJournals(){ - if(!content){ - setQuillFlag(true); - return - } - setJournalSpin(true); - console.log(updateId) - if(updateId){ - // 修改评论 - const params = { - id: updateId, - notes: content, - attachmentIds: fileList, - receivers_login:atWhoLoginList - } - editComment(docId, params).then(res=>{ - if(res && res.data && res.data.data){ - // 刷新评论列表 - reloadComment(); - message.success('评论成功'); - cancelMd(); - setContent(undefined); - } - setJournalSpin(false); - }) - }else{ - // 新建评论 - const params = { - parentId: parentId, - replyId: replyId, - notes: content, - attachmentIds: fileList, - } - - addComment(docId, params).then(res=>{ - if(res && res.data && res.data.data){ - // 刷新评论列表 - reloadComment(); - message.success('评论成功'); - cancelMd(); - setContent(undefined); - } - setJournalSpin(false); - }) - } - }; - function deleteLoad(id){ - let arr = []; - let list = save; - if(list && list.length>0 ){ - arr = list.filter(i=>i.id !== id); - } - setFileList(arr.map(i=>{return i.id})); - setSave(arr); - } - function UploadFunc(f){ - let list = []; - let arr = []; - if(save && save.length>0 ){ - arr = save.map(i=>{return i.id}); - } - list = arr && arr.length>0 ? f.concat(arr) : f ; - setFileList(list); - }; - - return( -
    - - - -
    - {setQuillFlag(false);setContent(value);}} - changeAtWhoLoginList = {(loginList)=>{setAtWhoLoginList(loginList); setAttachmentClean(true)}} - owner = {owner} - projectsId = {projectsId} - > -

    - {quillFlag && 请输入评论内容} -

    - - } - size={100} - showNotification={showNotification} - // defaultFileList={props.defaultFileList} - /> - {props.defaultFileList && props.defaultFileList.length > 0 && - - } -

    - - -

    -
    -
    - ) -} -export default EditComment; \ No newline at end of file diff --git a/src/forge/Information/Component/comments/list.jsx b/src/forge/Information/Component/comments/list.jsx deleted file mode 100644 index 4014063d4..000000000 --- a/src/forge/Information/Component/comments/list.jsx +++ /dev/null @@ -1,226 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { Button, Popconfirm, Radio, Input, message, Tooltip, Spin, Pagination } from 'antd'; -import axios from 'axios'; -import { getImageUrl, timeAgo, isPhone } from 'educoder'; -import RenderHtml from '../../../../components/render-html'; -import Attachment from '../../../Upload/attachment'; -import EditComment from './editComment'; -import Nodata from '../../../Nodata'; -import CheckProfile from '../../../Component/ProfileModal/Profile'; -import './list.scss'; -import { Link } from 'react-router-dom'; -import { getCommentList, deleteComment } from '../../api' - -function IssueCommentList(props){ - const{docId, history: {location}, reload, reloadComment, showNotification, current_user:{login, admin, image_url, username}, isManager, showLoginDialog, author} = props; - const {owner, projectsId, index} = props.match.params; - const [category, setCategory] = useState('comment'); - const [journals, setJournals] = useState(undefined); - // 是否展示新建/编辑评论markdown部分新建评论1 编辑父级评论2 回复评论3 编辑回复内容4 回复子机评论5 - const [showEdit, setShowEdit] = useState(false); - const [parentId, setParentId] = useState(undefined); - const [replyId, setReplyId] = useState(undefined); - // 修改评论id - const [updateId, setUpdateId] = useState(undefined); - // 操作日志展开效果 - const [open, setOpen] = useState(undefined); - // 加载中效果(缓冲css 线条效果) - const [spin, setSpin] = useState(false); - // issue 评论总数 - const [journalsCount, setJournalsCount] = useState(undefined); - // 分页 - const limit = 50; - const [page, setPage] = useState(1); - const [totalCount, setTotalCount] = useState(undefined); - // 操作记录 icon - const journalsIcon ={ - 'issue': 'icon-chuangjianqianbao', - 'branch_name': 'icon-fenzhi3', - 'assigner': 'icon-chengyuan2', - 'status_id': 'icon-xiugaibaobiaomoban', - 'fixed_version_id': 'icon-lichengbeiicon2', - 'due_date': 'icon-riqi', - 'issue_tag': 'icon-biaoji2', - 'description': 'icon-xiugaibaobiaomoban', - 'subject': 'icon-xiugaibaobiaomoban', - 'start_date': 'icon-riqi', - 'priority_id': 'icon-youxian', - 'attachment': 'icon-xiugaibaobiaomoban' - } - - useEffect(()=>{ - setSpin(true); - let params = { - limit: limit, - page: page - } - getCommentList(docId, params).then(res=>{ - if(res && res.data && res.data.data){ - const {journals, total_comment_journals_count, total_count} = res.data.data; - if(category === 'all'){ - const array = []; - let start = undefined; - let isJournalCount = 0; - journals.map((item, index)=>{ - !isJournalCount && (start = index) - item.is_journal_detail && (isJournalCount++) - if(!item.is_journal_detail && isJournalCount < 10){ - isJournalCount = 0; - return - } - if(isJournalCount >= 10 && (!item.is_journal_detail || journals.length-1 === index)){ - array.push({start, count: isJournalCount}); - isJournalCount = 0; - } - }) - array.map((item, i)=>{ - journals[item.start].numCount = item.count-1; - for (let index = 0; index < item.count; index++) { - journals[item.start+index].start = journals[item.start].id; - journals[item.start+index].closeAndSpan = true; - } - }) - } - setTotalCount(total_count); - setJournalsCount(total_comment_journals_count); - setJournals(journals); - setSpin(false) - } - }) - }, [reload, category, page]) - - function commentCtx(v){ - return ; - }; - - // 删除评论内容 - function deleteCommentFunc(id){ - deleteComment(docId, id).then(res=>{ - if(res && res.data && !res.data.data.status){ - reloadComment(); - message.success('删除成功'); - } - }) - } - - // markdown 取消操作 - function cancelMd(){ - setShowEdit(false); - } - - return( - (isPhone() && journalsCount === 0) ? '' :
    - {/* 评论 */} -
    0 && 'pb15'}`}> -
    -
    -
    评论{ journalsCount > 0 && `(共${ journalsCount }条评论)` }
    -
    -
    - {/* 评论快速入口-仅有评论且登录时展示 */} - {login && category !== 'operate' && journalsCount > 0 && !isPhone() &&
    } - {/* 评论/操作日志 展示列表 */} - -
    - {journals && (journals.length > 0 && journals.map(item=>{return
    - {/* 评论 */} -
    - -
    - {/* 判断是否是编辑状态 */} - {(showEdit === 2 && updateId === item.id) ?
    :
    -
    -
    -
    - {item.user.name} - {timeAgo(item.created_at)} -
    - {login && !isPhone() &&
    - {/* 平台管理员/仓库管理员/发布评论者/issue创建者 */} - {(admin || isManager || login === item.user.login || username === author) && 0 ? '子评论也将被一起删除。' : ''}`} - okText="是" - cancelText="否" - onConfirm={() => deleteCommentFunc(item.id)} - > - - } - {/* 仅评论者可修改 */} - {login === item.user.login && } - {setParentId(item.id); setReplyId(item.id); setShowEdit(3)}}> -
    } -
    -
    {commentCtx(item.notes)}
    - {item && item.attachments && item.attachments.length > 0 &&
    } -
    -
    } - {showEdit === 3 && replyId === item.id &&
    } - {/* 评论回复部分 */} - {item.children_journals.map(i =>{ - return
    - {(showEdit === 4 && updateId === i.id) ?
    :
    -
    -
    - - {i.user.name} - {i.reply_user && 回复} - {i.reply_user && i.reply_user.name} - {timeAgo(i.created_at)} -
    - {login && !isPhone() &&
    - {/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */} - {(admin || isManager || login === i.user.login || (i.reply_user && login === i.reply_user.login) || username === author) && deleteCommentFunc(i.id)} - > - - } - {/* 仅回复评论者可修改 */} - {login === i.user.login && } - {setParentId(item.id);setReplyId(i.id); setShowEdit(5)}}> - - -
    } -
    -
    {commentCtx(i.notes)}
    - {i && i.attachments && i.attachments.length > 0 &&
    } -
    } - {showEdit === 5 && replyId === i.id &&
    } -
    })} -
    -
    }))} -
    -
    - {totalCount>limit &&
    - setPage(page)}/> -
    } - {/* 添加评论 */} - {category !== 'operate' && !isPhone() &&
    - {login ? showEdit === 1 ? :
    - -
    - {setShowEdit(1)}}> - - -
    -
    :
    - {/* 未登录用户 */} - {showLoginDialog()}}>登录并参与评论与回复 -
    } -
    } -
    - ) -} -export default IssueCommentList; \ No newline at end of file diff --git a/src/forge/Information/Component/comments/list.scss b/src/forge/Information/Component/comments/list.scss deleted file mode 100644 index 7c548915a..000000000 --- a/src/forge/Information/Component/comments/list.scss +++ /dev/null @@ -1,217 +0,0 @@ -.typeActionBox{ - display: flex; - align-items: center; - font-size: 16px; - .line { - width: 3px; - height: 14px; - background: var(--primary-color); - margin-right: 13px; - } -} -.commentUserImg{ - height: 28px; - width: 28px; - border-radius: 50%; - object-fit: cover; -} -.issueCommentsBox{ - .operationLog, .commentContentBox{ - position: relative; - min-height: 62px; - display: flex; - >.flexCenter, >a{ - z-index: 2; - } - &::before, &::after{ - content: ''; - width: 1px; - height: 50%; - position: absolute; - background: #eee; - left: 12px; - z-index: 1; - } - &::after{ - background: #eee; - top: 50%; - } - } - .commentContentBox+.operationLog .operationCommentBor, .operationLog+.commentContentBox .commentOperationBor{ - border-top: 1px solid #eee; - width: 98.5%; - position: absolute; - left: 12px; - } - .operationLog+.commentContentBox{ - &>a, &>.commentContentRight{ - margin-top: 25px; - } - } - .timeAgo{ - color:#acb0bf; - } - .operationLog:last-child::after, .operationLog:first-child::before, .commentContentBox:last-child::after, &.justComment .commentContentBox::before, &.justComment .commentContentBox::after{ - display: none; - } - .operationLog:first-child, .commentContentBox+.operationLog{ - margin-top: -15px; - } - .commentContentBox:last-child::before{ - height: 35%; - } - .flexCenter{ - display: flex; - align-items: center; - justify-content: space-between; - } - .commentRenderHtml.markdown-body p{ - font-size: 14px !important; - } - .commentReply{ - padding: 15px 0 0 20px; - background-color: hsla(225, 31%, 95%, 0.41); - &>div{ - padding-bottom: 5px; - } - &+.commentReply>div{ - margin-top: -15px; - padding-top: 15px; - border-top: 1px dashed #eee; - } - } - .opBox{ - justify-content: flex-start; - // flex: 1; - // width: 100%; - } - .commentContentBox{ - display: flex; - align-items: flex-start; - } - .commentContentRight{ - flex: 1; - background-color:#fafafc; - // border:1px solid var(--light-color-2); - border:1px solid rgba(42, 97, 255, 0.23); - border-radius:6px; - position: relative; - top: -6px; - padding: 10px 15px 16px; - width: 0; - &::before{ - content: ''; - display: block; - position: absolute; - top: 13px; - left: -14px; - width: 0; - height: 0; - overflow: hidden; - font-size: 0; - line-height: 0; - border: 7px; - border-style: solid; - border-color: transparent rgba(42, 97, 255, 0.23) transparent transparent; - } - &::after{ - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - font-size: 0; - line-height: 0; - border: 6px; - border-style: solid; - border-color: transparent #fafafc transparent transparent; - position: absolute; - top: 14px; - left: -11px; - } - } -} -.attachmentBox{ - margin-top: -8px; -} -.color-grey-89{ - color: #898d9d; - // &:hover { - // color: var(--primary-color); - // } -} -// 添加评论样式 -.unLoginComment{ - height:58px; - line-height: 58px; - background-color:var(--more-light-color); - border-radius:4px; - color: rgba(84, 87, 103, 1); - .loginBtn{ - color: var(--primary-color); - } -} -.quillFlagBox{ - color: red; - margin-bottom: 5px !important; - height: 28px; -} -.addComments{ - display: flex; - align-items: center; - background-color:var(--more-light-color); - border-radius:4px; - padding:7px 10px; - &>img{ - height: 28px; - width: 28px; - border-radius: 50%; - margin-right: 13px; - } -} -.addCommentBox{ - width: 100%; - height: 30px; - border: none; - &:focus { - border-color: var(--primary-color) !important; - } -} -.paginationIssueComment{ - text-align: center; -} -.gotoComment{ - // background-color:var(--more-light-color); - background-color:rgba(241, 243, 252, 0.55); - border-radius:4px; - color: rgba(172, 176, 191, 1); - padding: 8px 20px; - margin-top: -10px; - &>a{color: var(--primary-color);} -} -// .commentStyle { -// &:hover { -// border-color: var(--primary-color) !important; -// } -// } -.colorButton { - background-color: var(--primary-color); - border-color: var(--primary-color); - &:hover { - background-color: var(--light-color); - border-color: var(--primary-color); - } - &:focus { - background-color: var(--primary-color); - border-color: var(--primary-color); - } -} -.colorButton2 { - &:hover { - border-color: var(--primary-color); - color: var(--light-color); - } - &:focus { - color: var(--primary-color); - } -} \ No newline at end of file diff --git a/src/forge/Information/Component/contributor.jsx b/src/forge/Information/Component/contributor.jsx deleted file mode 100644 index 102a9ba26..000000000 --- a/src/forge/Information/Component/contributor.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import React , { useEffect, useState } from 'react'; -import Slider from 'react-slick'; -import { Link } from 'react-router-dom'; - -const settings = { - dots: true, - infinite: false, - speed: 500, - slidesToShow: 3, - slidesToScroll: 3, - arrows: false, - adaptiveHeight: true, -}; - -function Contributor(props) { - const { personList } = props - const [ showList, setShowList] = useState([]); - - function initList() { - if (personList.length % 3 !== 0) { - setShowList([].concat(personList, new Array(personList.length % 3 - 1).fill({}))) - } else { - setShowList( personList ) - } - } - - useEffect(()=>{ - initList(); - },[personList]) - - return( -
    - { - showList && showList.length > 0 ? - - { - showList.map((i,k)=>{ - return( -
    - { i.name && -
    - -
    {i.name}
    -

    {i.introduction || "暂无~"}

    -
    - } -
    - ) - }) - } -
    - :"" - } -
    - - ) -} -export default Contributor; \ No newline at end of file diff --git a/src/forge/Information/Component/defaultImg.jsx b/src/forge/Information/Component/defaultImg.jsx deleted file mode 100644 index 0ed489083..000000000 --- a/src/forge/Information/Component/defaultImg.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; - - -function DefaultImg({name,title}){ - - function randomNumberInRange(min, max) { - // ?️ 获取 min(含)和 max(含)之间的数字 - return Math.floor(Math.random() * (max - min + 1)) + min; - } - - return( -
    - - - - {name} - {/* {title} */} - -
    - ) -} -export default DefaultImg; \ No newline at end of file diff --git a/src/forge/Information/Component/hot.jsx b/src/forge/Information/Component/hot.jsx deleted file mode 100644 index 7bacc5b0d..000000000 --- a/src/forge/Information/Component/hot.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; - -function Hot({list , title, deptId, temp}){ - return( -
    -

    {title}

    - { - list && list.length>0 && -
      - { - list.map((i,k)=>{ - return( -
    • - {k+1} - {i.name} -
    • - ) - }) - } -
    - } -
    - ) -} -export default Hot; \ No newline at end of file diff --git a/src/forge/Information/Component/memberApply.jsx b/src/forge/Information/Component/memberApply.jsx deleted file mode 100644 index 2db9d8109..000000000 --- a/src/forge/Information/Component/memberApply.jsx +++ /dev/null @@ -1,80 +0,0 @@ -import React , {forwardRef, useEffect, useState} from 'react'; -import { Modal , Form , Input , Button, Icon } from 'antd'; -import UploadImage from '../../Team/Component/UploadImage'; -import { getImageUrlAbsolute, getZoneUrl } from 'educoder'; - -const { TextArea } = Input; - -function MemberApply(props){ - const { getFieldDecorator, validateFields , setFieldsValue } = props.form; - const { current_user, onOk, visible, onCancel } = props - const [imageUrl, setImageUrl] = useState(undefined) - - useEffect(()=>{ - if (current_user) { - setImageUrl(getImageUrlAbsolute(`/${current_user.image_url}`)); - } - },[current_user]) - - function onSure(){ - validateFields((error,values)=>{ - if(!error){ - values.imageUrl = imageUrl - onOk(values) - } - }) - } - - const layout = { - labelCol: { span: 5 }, - wrapperCol: { span: 18 }, - }; - return( - - - -
    - } - centered - > -
    -
    - - {getFieldDecorator("name", { - initialValue: current_user.nickname, - rules:[{ required:true,message:"请输入申请原因" }] - })( - - )} - - - setImageUrl(url) } url={ getImageUrlAbsolute(`/${current_user.image_url}`)} action={ getZoneUrl(`/api/cms/common/upload`) } /> - - - {getFieldDecorator("introduction",{ - rules:[{ required:true,message:"请输入会员简介" }] - })( -