diff --git a/package-lock.json b/package-lock.json index 68c9f20a2..40bb3472a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -160,7 +160,7 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "resolved": "https://registry.nlark.com/source-map/download/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } @@ -1296,13 +1296,13 @@ "dependencies": { "inherits": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "resolved": "https://registry.nlark.com/inherits/download/inherits-2.0.1.tgz", "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "https://registry.nlark.com/util/download/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -2561,7 +2561,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "resolved": "https://registry.nlark.com/define-property/download/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { "is-descriptor": "^1.0.0" @@ -2869,7 +2869,7 @@ "dependencies": { "resolve": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" } } @@ -3661,7 +3661,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.nlark.com/define-property/download/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { "is-descriptor": "^0.1.0" @@ -6386,7 +6386,7 @@ }, "path-to-regexp": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "resolved": "https://registry.nlark.com/path-to-regexp/download/path-to-regexp-0.1.7.tgz?cache=0&sync_timestamp=1618847046445&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", "dev": true }, @@ -6859,7 +6859,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmmirror.com/core-js/download/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" }, "promise": { @@ -8069,7 +8069,7 @@ "dependencies": { "pify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "resolved": "https://registry.nlark.com/pify/download/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" } } @@ -11630,7 +11630,7 @@ }, "punycode": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "resolved": "https://registry.nlark.com/punycode/download/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true } @@ -16594,7 +16594,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.nlark.com/jsesc/download/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -17517,7 +17517,7 @@ "dependencies": { "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "resolved": "https://registry.npmmirror.com/ms/download/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } @@ -17629,7 +17629,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { "is-extendable": "^0.1.0" @@ -18110,7 +18110,7 @@ }, "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.nlark.com/define-property/download/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { "is-descriptor": "^0.1.0" @@ -18118,7 +18118,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { "is-extendable": "^0.1.0" @@ -18126,7 +18126,7 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "resolved": "https://registry.nlark.com/source-map/download/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } @@ -18143,7 +18143,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "resolved": "https://registry.nlark.com/define-property/download/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { "is-descriptor": "^1.0.0" @@ -20018,7 +20018,7 @@ "dependencies": { "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "resolved": "https://registry.nlark.com/inherits/download/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true } @@ -20394,7 +20394,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -20575,7 +20575,7 @@ }, "fill-range": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { @@ -20587,7 +20587,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -20653,7 +20653,7 @@ }, "is-number": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "resolved": "https://registry.nlark.com/is-number/download/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { @@ -20662,7 +20662,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 8e911f346..9cface5a9 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2340181 */ - src: url('iconfont.woff2?t=1680498859493') format('woff2'), - url('iconfont.woff?t=1680498859493') format('woff'), - url('iconfont.ttf?t=1680498859493') format('truetype'); + src: url('iconfont.woff2?t=1682403222759') format('woff2'), + url('iconfont.woff?t=1682403222759') format('woff'), + url('iconfont.ttf?t=1682403222759') format('truetype'); } .iconfont { @@ -13,6 +13,38 @@ -moz-osx-font-smoothing: grayscale; } +.icon-cangkuyuyanicon:before { + content: "\e962"; +} + +.icon-dongtaiicon1:before { + content: "\e963"; +} + +.icon-jingxuanxiangmu:before { + content: "\e964"; +} + +.icon-zuzhichengyuan1:before { + content: "\e965"; +} + +.icon-zuzhijieshao:before { + content: "\e966"; +} + +.icon-zuzhituandui:before { + content: "\e967"; +} + +.icon-shezhi6:before { + content: "\e968"; +} + +.icon-zidingyi:before { + content: "\e969"; +} + .icon-a-zu37:before { content: "\e961"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index 3f3eaec7c..26c9209ee 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2340181='',function(c){var a=(a=document.getElementsByTagName("script"))[a.length-1],l=a.getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(l&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}}(window); \ No newline at end of file +window._iconfont_svg_string_2340181='',function(c){var a=(a=document.getElementsByTagName("script"))[a.length-1],l=a.getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(l&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}}(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 04f995369..c21fd868d 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,62 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "34965902", + "name": "仓库语言icon", + "font_class": "cangkuyuyanicon", + "unicode": "e962", + "unicode_decimal": 59746 + }, + { + "icon_id": "34965903", + "name": "动态icon", + "font_class": "dongtaiicon1", + "unicode": "e963", + "unicode_decimal": 59747 + }, + { + "icon_id": "34965904", + "name": "精选项目", + "font_class": "jingxuanxiangmu", + "unicode": "e964", + "unicode_decimal": 59748 + }, + { + "icon_id": "34965905", + "name": "组织成员", + "font_class": "zuzhichengyuan1", + "unicode": "e965", + "unicode_decimal": 59749 + }, + { + "icon_id": "34965906", + "name": "组织介绍", + "font_class": "zuzhijieshao", + "unicode": "e966", + "unicode_decimal": 59750 + }, + { + "icon_id": "34965907", + "name": "组织团队", + "font_class": "zuzhituandui", + "unicode": "e967", + "unicode_decimal": 59751 + }, + { + "icon_id": "34965908", + "name": "设置", + "font_class": "shezhi6", + "unicode": "e968", + "unicode_decimal": 59752 + }, + { + "icon_id": "34965909", + "name": "自定义", + "font_class": "zidingyi", + "unicode": "e969", + "unicode_decimal": 59753 + }, { "icon_id": "34875122", "name": "组 37", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 6a5a417bf..3a879e105 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index de9899f07..ec894a8ce 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index 7c5a61f6c..3d4905eed 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss index 22f073f85..2326076cb 100644 --- a/src/forge/Team/Index.scss +++ b/src/forge/Team/Index.scss @@ -1,7 +1,6 @@ .top-orz{ background-color:#f9fbfe; box-shadow:0px 8px 20px rgba(17, 35, 146, 0.06); - margin-bottom: 40px; .box{ width: 1200px; display: flex; @@ -84,19 +83,79 @@ margin:0px auto; padding-top:18px; } +.content-orz{ + background-color:#f3f5f8; +} .content-orz .list{ display: flex; align-items: flex-start; width: 1200px; margin:0px auto; + padding-top: 40px; .list-l{ background-color: #fff; + background-image: url('./images/left-bc.png'); + background-size: 100%; max-width: 860px; width: 72%; margin-bottom: 30px; - border:1px solid #eee; + padding:30px; + .newstatus{ + padding-bottom: 20px; + border-bottom: 1px dashed rgba(170, 175, 190, 1); + .desc{ + color:#4c5876; + font-size:14px; + line-height:26px; + } + .title{ + height:22px; + line-height:22px; + color:#1f2329; + font-size:16px; + margin:20px auto 14px!important; + } + .name{ + height:24px; + span{ + font-weight:700; + color:#1f2329; + font-size:17px; + } + i{ + margin-right: 4px; + color:rgba(31, 35, 41, 1); + } + } + } + .sepment{ + text-align: center; + margin:30px auto 20px; + .ant-radio-group{ + box-shadow:0px 0px 10px rgba(30, 47, 162, 0.09); + .ant-radio-button-wrapper{ + border:none; + background-color: #fff; + line-height: 34px; + &:first-child{ + padding:3px 0px 3px 3px; + } + &:last-child{ + padding:3px 3px 3px 0px; + } + span{ + background-color:rgba(30, 47, 162, 0.09) ; + display: block; + } + } + .ant-radio-button-wrapper-checked{ + background-color:#466aff; + color: #fff; + } + } + } .head{ - padding:16px 32px; + padding:16px 0px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; @@ -116,7 +175,6 @@ } } .team{ - padding:0px 32px; min-height: 450px; .team_project{ padding:22px 0px; @@ -459,4 +517,13 @@ } } } +} +.overviewcontent{ + .ConcentrateTip{ + margin:20px 0px 0px 0px!important; + } + .concentrateUl li{ + border-color:#cddbeb!important; + border-radius:4px; + } } \ No newline at end of file diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx index 7c4a2601e..5eed4bf1e 100644 --- a/src/forge/Team/List.jsx +++ b/src/forge/Team/List.jsx @@ -7,7 +7,8 @@ import Item from './ListItem'; import Right from './RightBox'; import NoData from '../Nodata'; import CheckProfile from '../Component/ProfileModal/Profile'; -import { Menu , Pagination , Dropdown , Spin } from 'antd'; +import { Menu , Pagination , Dropdown , Spin , Tabs , Radio } from 'antd'; +import ConcentrateProject from '../users/GeneralView/ConcentrateProject'; import { getImageUrl } from 'educoder'; import axios from 'axios'; @@ -20,8 +21,11 @@ function List(props){ const [ page , setPage ] = useState(1); const [ sortBy , setSortBy ] = useState("updated_on"); const [ organizeDetail , setOrganizeDetail ] = useState(undefined); + const [ mode , setMode ] = useState("overview"); const OIdentifier = props.match.params.OIdentifier; + const { current_user } = props; + console.log(props); useEffect(()=>{ if(OIdentifier){ @@ -47,11 +51,11 @@ function List(props){ },[organizeDetail]) useEffect(()=>{ - if(OIdentifier){ + if(OIdentifier && mode==="subject"){ setIsSpin(true); getProject(); } - },[OIdentifier,sortBy,page,search]) + },[OIdentifier,sortBy,page,search,mode]) function getProject(){ const url = `/organizations/${OIdentifier}/projects.json`; @@ -92,8 +96,14 @@ function List(props){ ) + + function changeRadio(e){ + setMode(e.target.value); + } + return( + organizeDetail ?
@@ -111,43 +121,94 @@ function List(props){
-
-
-
- -
-

- { organizeDetail && organizeDetail.can_create_project ? - - + 新建项目 - - :""} - - 排序 - -

+ { + organizeDetail.news_title && +
+

新闻动态

+

+ {organizeDetail.news_title} +

+
+ {organizeDetail.news_content}
- -
- { - list && list.length>0 ? list.map((item,key)=>{ - return( - - ) - }) - : - - } -
-
- { - totalCount > limit && -
- setPage(page)}/> -
- } + } +
+ + 概览 + 仓库 +
+ { + mode === "overview" && +
+ + + 精选项目 +

+ } + btn={ + 自定义 + } + userLogin={OIdentifier} + type="organizations" + current={organizeDetail.is_admin} + /> +
+

+ + 组织介绍 +

+
{organizeDetail.description}
+
+
+ } + { + mode === "subject" && +
+
+
+
+ +
+

+ { organizeDetail && organizeDetail.can_create_project ? + + + 新建项目 + + :""} + + 排序 + +

+
+ +
+ { + list && list.length>0 ? list.map((item,key)=>{ + return( + + ) + }) + : + + } +
+
+
+ { + totalCount > limit && +
+ setPage(page)}/> +
+ } +
+ } + +
+ :"" ) } export default List; \ No newline at end of file diff --git a/src/forge/Team/images/left-bc.png b/src/forge/Team/images/left-bc.png new file mode 100644 index 000000000..c42ab3b93 Binary files /dev/null and b/src/forge/Team/images/left-bc.png differ diff --git a/src/forge/users/GeneralView/ConcentrateBox.jsx b/src/forge/users/GeneralView/ConcentrateBox.jsx index 0bc04a716..bc31dc16e 100644 --- a/src/forge/users/GeneralView/ConcentrateBox.jsx +++ b/src/forge/users/GeneralView/ConcentrateBox.jsx @@ -5,7 +5,7 @@ import CheckProfile from '../../Component/ProfileModal/Profile'; const { Search } = Input; const limit = 20; -function ConcentrateBox({ visible , onCancel , onSure , username , choosed , history , showCompeleteDialog , completeProfile }) { +function ConcentrateBox({ visible , onCancel , onSure , type , username , choosed , history , showCompeleteDialog , completeProfile }) { const [ page , setPage ]= useState(1); const [ total , setTotal ]= useState(0); const [ pageSize , setPageSize ] = useState(false); @@ -54,7 +54,7 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed , his },[value]) function getProjectList(p,s) { - const url = `/users/${username}/projects.json`; + const url = `/${type || `users`}/${username}/projects.json`; Axios.get(url,{ params:{ page:p,limit,is_public: "public",search:s,choosed @@ -152,15 +152,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed , his { copyList && copyList.length >0 && copyList.map((i,k)=>{ return( - j === i.id).length===0)}>{i.author && i.author.name}/{i.name} + j === i.id).length===0)}>{i.author && `${i.author.name}/`}{i.name} ) }) } { list && list.length > 0 && list.map((i,k)=>{ + console.log(i); let c = copyList && copyList.length >0 && copyList.filter(j=>j.id === i.id).length !== 0; return( - !c && j === i.id).length===0)}>{i.author && i.author.name}/{i.name} + !c && j === i.id).length===0)}>{i.author && `${i.author.name}/`}{i.name} ) }) } diff --git a/src/forge/users/GeneralView/ConcentrateProject.jsx b/src/forge/users/GeneralView/ConcentrateProject.jsx index 9fe436ead..d68095040 100644 --- a/src/forge/users/GeneralView/ConcentrateProject.jsx +++ b/src/forge/users/GeneralView/ConcentrateProject.jsx @@ -3,8 +3,18 @@ import { FlexAJ , AlignCenter } from '../../Component/layout'; import { Link } from 'react-router-dom'; import axios from 'axios'; import Box from './ConcentrateBox'; +import './Index.scss'; -function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfile,history}) { +function ConcentrateProject({ + userLogin, + current, + showCompeleteDialog, + completeProfile, + history, + type, + title, + btn +}) { const [ list , setList ] = useState(undefined); const [ visible , setVisible ] = useState(false); const [ value , setValue ] = useState([]); @@ -14,7 +24,7 @@ function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfi },[]) function getList() { - const url = `/users/${userLogin}/is_pinned_projects.json`; + const url = `/${type || `users`}/${userLogin}/is_pinned_projects.json`; axios.get(url).then(result=>{ if(result && result.data){ let p = result.data.projects; @@ -33,7 +43,7 @@ function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfi if(is_pinned_project_ids && is_pinned_project_ids.length===0){ setValue([]); } - const url = `/users/${userLogin}/is_pinned_projects/pin.json`; + const url = `/${type || `users`}/${userLogin}/is_pinned_projects/pin.json`; axios.post(url,{ is_pinned_project_ids }).then(result=>{ @@ -54,14 +64,21 @@ function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfi completeProfile={completeProfile} showCompeleteDialog={showCompeleteDialog} history={history} + type={type} /> - { - list && list.length>0 &&
- 精选项目 - { current && setVisible(true)}>自定义精选项目 } + { + title || 精选项目 + } + { current && + setVisible(true)}> + {btn || "自定义精选项目"} + + } + { + list && list.length>0 &&
    { @@ -71,12 +88,12 @@ function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfi {i.name}

    {i.description}

    {/* 项目标签 */} - {i.topics &&
    + {i.topics &&
    {i.topics.map(item=>{item.name})}
    } { i.category && {i.category.name} } - {i.watchers_count} + {i.watchers_count} {i.forked_count} @@ -85,8 +102,8 @@ function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfi }
-
} +
{ list && list.length === 0 && current &&
你还没有设置精选项目,setVisible(true)}>点击设置
} diff --git a/src/forge/users/GeneralView/Index.scss b/src/forge/users/GeneralView/Index.scss index 5615c22af..5a3879e91 100644 --- a/src/forge/users/GeneralView/Index.scss +++ b/src/forge/users/GeneralView/Index.scss @@ -18,14 +18,16 @@ } .name{ font-size: 16px; - // color: #4CACFF; color: $primary-color; + height: 20px; + line-height: 20px; &:hover{ color: $primary-color-hover; } } .desc{ color: #999; + line-height: 21px; } .tagName{ display: block; @@ -36,6 +38,7 @@ height: 22px; line-height: 22px; font-size: 13px; + margin-right: 20px; } .pariseCount,.forkCount{ i{ @@ -43,7 +46,7 @@ margin-right: 4px; } color: #999; - margin-left: 20px; + margin-right: 20px; } } } @@ -152,13 +155,13 @@ display: flex; flex-wrap: wrap; .viewProListTopic{ - background-color:#f3f8ff; + background-color:rgba(70, 106, 255, 0.12); border-radius: 4px; max-width: 158px; padding: 0 10px; height: 24px; line-height: 24px; - color: #4c5b76; + color:#466aff; margin-bottom: 5px !important; } } \ No newline at end of file