diff --git a/package-lock.json b/package-lock.json index 8a2f07af..46e45a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8694,6 +8694,14 @@ } } }, + "html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "requires": { + "void-elements": "3.1.0" + } + }, "html-webpack-plugin": { "version": "4.5.2", "resolved": "http://173.15.15.82:8081/repository/npm-all/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz", @@ -9140,6 +9148,29 @@ "resolved": "http://173.15.15.82:8081/repository/npm-all/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" }, + "i18next": { + "version": "23.4.5", + "resolved": "https://registry.npmmirror.com/i18next/-/i18next-23.4.5.tgz", + "integrity": "sha512-XXALnva7/5H+kg7TjDsmzY3jRypuSJvjR1eUWtt11yUgsOqjZFq/mnaujJ/XpVWhUJU75QhCUhrZqAarlYpOSQ==", + "requires": { + "@babel/runtime": "^7.22.5" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.11", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.22.11.tgz", + "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, "iconv-lite": { "version": "0.6.3", "resolved": "http://173.15.15.82:8081/repository/npm-all/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -14850,6 +14881,30 @@ } } }, + "react-i18next": { + "version": "13.2.0", + "resolved": "https://registry.npmmirror.com/react-i18next/-/react-i18next-13.2.0.tgz", + "integrity": "sha512-YD8xMc+I0jkHHLotd8ERMzZ53hMaCBVLCndbcbBveJn3FbppRP4jyYOAkmR8XItN01sTD9ilAjoEjpH1i42IgA==", + "requires": { + "@babel/runtime": "^7.22.5", + "html-parse-stringify": "^3.0.1" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.11", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.22.11.tgz", + "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, "react-infinite-scroller": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/react-infinite-scroller/-/react-infinite-scroller-1.2.6.tgz", @@ -19166,6 +19221,11 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, + "void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==" + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "http://173.15.15.82:8081/repository/npm-all/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index c75f9cb9..c549382c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "editor.md": "^1.5.0", "flv.js": "^1.5.0", "fs-extra": "3.0.1", + "i18next": "^23.4.5", "immutability-helper": "^2.6.6", "install": "^0.12.2", "intersection-observer": "^0.12.2", @@ -77,6 +78,7 @@ "react-dev-utils": "^9.2.0-next.80", "react-dom": "^16.13.1", "react-hot-loader": "^4.12.20", + "react-i18next": "^13.2.0", "react-infinite-scroller": "^1.2.4", "react-loadable": "^5.3.1", "react-monaco-editor": "0.37", diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index 73ec3aa1..b9897d4a 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -216,15 +216,15 @@ function Index(props) { setNewBranchError(undefined); const value = e.target.value; if (value) { - const str = '^*/'; + const str = '^*'; let reg = /\\/g; if(reg.test(value)){ - setNewBranchError('分支名不能包含下列任何字符:^ * \\ /'); + setNewBranchError('分支名不能包含下列任何字符:^ * \\ '); }else{ for(var i=0;i -1){ - setNewBranchError('分支名不能包含下列任何字符:^ * \\ /'); + setNewBranchError('分支名不能包含下列任何字符:^ * \\ '); return; }else{ setNewBranchName(e.target.value); diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 7ef9f2e8..d4a0b6fa 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -371,7 +371,8 @@ class MessageCount extends Component { const userLogin = current_user && current_user.login; const otherPre = data && data.pull_request && projectDetail && (userLogin === data.pull_request.fork_project_user && projectDetail.permission===""); const permissionByCodeReview = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission === "Manager" || projectDetail.permission === "Developer" || otherPre); - const operate = userLogin && projectDetail && pr_status === 0 && permission; + const operate = userLogin && projectDetail && pr_status === 0 && permission ; + const cancelOperate = userLogin && pr_status === 0 && ( permissionByCodeReview || otherPre); const open_blockchain = project && project.open_blockchain; return (
@@ -521,7 +522,7 @@ class MessageCount extends Component { )} - {operate && ( + {cancelOperate && ( } - - {/* 课题申请时间范围内: 申请课题 */} - {/* 第一次报名 */} - {round === 2 && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && } - {/* 第二次报名 锁定状态 */} - {round === 2 && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )} - - {/* 查看课题详情按钮 */} - +
= 2 + ? 'lastLineScroll' : listLen == 3 && + showTask && info.registrationTaskList.length >= 3 ? 'lastTwoScroll' : '' }> + {showTask && (info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{ + return
+
+
{window.location.href=`/glcc/${id}/subjects/detail/${item.id}`}}>{item.taskName}
+
导师姓名:   {item.tutorName}
+ {item.tutorMail &&
邮箱地址:   {item.tutorMail}
}
+
+
{item.taskDesc}
+ {item.taskUrl &&
课题链接:   {item.taskUrl}
} +
+ {/* 报名详情按钮 */} + {round === 2 && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && } + + {/* 课题申请时间范围内: 申请课题 */} + {/* 第一次报名 */} + {round === 2 && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && } + {/* 第二次报名 锁定状态 */} + {round === 2 && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )} + + {/* 查看课题详情按钮 */} + +
+
+
¥{item.taskReward}
-
¥{item.taskReward}
-
- }) : )} + }) : )} +
:
) } \ No newline at end of file diff --git a/src/glcc/project/projectList/index.jsx b/src/glcc/project/projectList/index.jsx index 4ae2a9e9..43732ea7 100644 --- a/src/glcc/project/projectList/index.jsx +++ b/src/glcc/project/projectList/index.jsx @@ -18,6 +18,7 @@ function ProjectList({ applyTaskId, location, match, applyTask, round, period, m const [keyword, setKeyword] = useState(openmmlab ? 'openmmlab' : undefined); const [data, setData] = useState([]); const [loading, setLoading] = useState(false); + const [listLen, setListLen] = useState(null); useEffect(() => { setLoading(true); @@ -67,11 +68,26 @@ function ProjectList({ applyTaskId, location, match, applyTask, round, period, m }) }, [keyword, round]) - function changeVisible(visible, item) { + function changeVisible(visible, item, index) { if (visible) { - let height = document.documentElement.clientWidth / 1920 * 500 + 70 + document.querySelector(`.${item.gitlinkLastUrl}`).offsetTop + item.registrationTaskList.length * 320; - document.querySelector('#taskList').style.height = height + 'px'; + // let height = document.documentElement.clientWidth / 1920 * 500 + 70 + document.querySelector(`.${item.gitlinkLastUrl}`).offsetTop + item.registrationTaskList.length * 320; + // document.querySelector('#taskList').style.height = height + 'px'; + document.querySelector('#taskList').style.height = 'auto'; + // 判断当前行数是否为最后两行,并添加滚动条样式 + if(data && data.length && data.length > 0){ + const len = data.length; + const num = len%3 == 0 ? 3 : len%3; + // 最后一行 + if(len - index <= num){ + setListLen(2) + } + // 最后两行 + if(len - index <= num + 3 && len - index > num){ + setListLen(3) + } + } } else { + setListLen(null) document.querySelector('#taskList').style.height = 'auto'; } } @@ -84,10 +100,10 @@ function ProjectList({ applyTaskId, location, match, applyTask, round, period, m
{data && data.map((item, index) => { return { changeVisible(visible, item) }} + onVisibleChange={(visible) => { changeVisible(visible, item, index) }} key={index} placement={(index + 1) % 3 === 0 ? 'bottomRight' : (index + 1) % 3 % 2 === 0 ? 'bottom' : 'bottomLeft'} - content={} + content={} trigger='click' overlayClassName='projectItemPopover' autoAdjustOverflow={false}