This commit is contained in:
caishi 2026-01-12 12:14:21 +08:00
commit d09ae349d7
20 changed files with 118 additions and 44 deletions

View File

@ -136,7 +136,7 @@ export function getZoneUrl(path) {
let settings = localStorage.chromesetting&&JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone;
return `${actionUrl}${path?path:''}`
return `${actionUrl}/zoneAdmin${path?path:''}`
}
export function getUrlmys(path, goTest) {

View File

@ -4,7 +4,7 @@ const wx = window.wx
const appId = 'wxf8debe756b4a0309'
let settings = localStorage && localStorage.chromesetting && localStorage.chromesetting !== "undefined" && JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone +'/api';
let actionUrl = settings && settings.common.zone +'/zoneAdmin/api';
const service = axios.create({
baseURL: actionUrl,

View File

@ -44,7 +44,9 @@ function News(props) {
const getTopList = () => {
gethomePageDocList(factoryZoneId).then(res => {
setMainList(res.data.rows)
if (res && res.data && res.data.rows) {
setMainList(res.data.rows)
}
})
}
@ -59,7 +61,7 @@ function News(props) {
const getHotList = () => {
getNewsHotList(factoryZoneId, { pageSize: 1, pageNum: 1 }).then(res => {
if (res.data.rows && res.data.rows.length > 0) {
if (res && res.data.rows && res.data.rows.length > 0) {
setNews(res.data.rows[0])
}
})

View File

@ -12,7 +12,7 @@ import '../../common.scss'
gsap.registerPlugin(ScrollTrigger);
const resourceInfo = [
{ name: '项目', title: '工厂开源项目', icon: 'icon-xiangmu', desc: '标准化生产线核心代码及软件工厂开发工具源码', path: '/sf/resources/project' },
{ name: '项目', title: '工厂开源项目', icon: 'icon-xiangmu', desc: '基于标准化生产线开发的项目源码、依赖包源码、标准化生产线源码等', path: '/sf/resources/project' },
{ name: '版本', title: '生产线安装包', icon: 'icon-banben', desc: '标准化生产线快速迭代版本和稳定支持版本', path: '/sf/resources/releases' },
{ name: '工具', title: '共建共用工具', icon: 'icon-gongju', desc: '由菌工集团、科研院所、地方企业等提供,可免费共用的工具', path: '/sf/resources/commontools' },
{ name: '软件', title: '开源社区软件', icon: 'icon-gongju', desc: '来自开源社区,可按授权许可使用和复用的各类软件', path: '/sf/resources/devtools' },

View File

@ -130,7 +130,9 @@ const Resource2 = forwardRef(({ zoneId }, ref) => {
<div className="item-info">
<h4 title={ item.name }>{item.name}</h4>
<p title={ item.summary }>{item.summary}</p>
<button className="shiny-button" onClick={() => { window.open(item.extendDataUrl) }}>查看详情</button>
<Link to={`/sf/lessons/${ item.id }`}>
<button className="shiny-button">查看详情</button>
</Link>
</div>
</div>
})

View File

@ -102,6 +102,10 @@
font-weight: 700;
color: #091221;
font-size: 22px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
padding-right: 30px;
}
p {
@ -111,6 +115,9 @@
overflow: hidden;
color: #091221;
}
a {
margin-top: auto;
}
button {
cursor: pointer;
@ -125,7 +132,6 @@
color: #091221;
font-size: 14px;
text-align: center;
margin-top: auto;
// background: #ffffff !important;
background-image: linear-gradient(#ffffff, #ffffff);

View File

@ -62,23 +62,29 @@ function Index(props) {
<p title={detail.summary}>{detail.summary}</p>
{
(detail.keywords === docId || detail.keywords===standardId) &&
<button onClick={() => {
if (detail.fileIds) {
downloadFunc(`${httpUrl}/file/open/download/${detail.fileIds}`)
}
}} disabled={!detail.fileIds} className={`shiny-button ${!detail.fileIds && 'disabled'}`} >{detail.fileIds ? '立即下载' : '稍后下载'}</button>
<button onClick={() => {
if (detail.fileIds) {
downloadFunc(`${httpUrl}/file/open/download/${detail.fileIds}`)
}
}} disabled={!detail.fileIds} className={`shiny-button ${!detail.fileIds && 'disabled'}`} >{detail.fileIds ? '立即下载' : '稍后下载'}</button>
}
{
detail.url &&
<button className="shiny-button" onClick={() => {
window.scrollTo({left:0, top: document.body.scrollHeight, behavior: 'smooth'})
if (videoRef.current) {
videoRef.current.play()
}
}}>
detail.keywords !== docId && detail.url &&
<button className="shiny-button" onClick={() => {
window.scrollTo({ left: 0, top: document.body.scrollHeight, behavior: 'smooth' })
if (videoRef.current) {
videoRef.current.play()
}
}}>
立即观看
</button>
}
{
detail.keywords !== docId && detail.url2 &&
<button className="button2" onClick={() => { window.open(detail.url2) }}>查看慕课</button>
}
<div className="header-img">
<div className="header-img-wrapper">
<img src={detail.headImg || imageBack1} alt="" />
@ -96,7 +102,7 @@ function Index(props) {
}
{
detail.url && <div className="news-detail-content-wrapper">
<video ref={videoRef} src={ detail.url } controls={ true } poster={ detail.headImg || imageBack1 }></video>
<video ref={videoRef} src={detail.url} controls={true} poster={detail.headImg || imageBack1}></video>
</div>
}
</div>

View File

@ -128,6 +128,15 @@
text-align: center;
background-color: #091221;
}
.button2 {
margin-left: 20px;
border: 1px solid #091221;
font-family: alibaba;
font-weight: 500;
color: #091221;
font-size: 14px;
background-color: unset;
}
h6 {
margin-top: 34px;

View File

@ -148,7 +148,7 @@
text-overflow: ellipsis;
overflow: hidden;
padding-right: 30px;
width: 600px;
}
&::before {

View File

@ -65,7 +65,9 @@ function Index(props) {
const getHotList = () => {
getNewsHotList(factoryZoneId, { pageSize: 2, pageNum: 1 }).then(res => {
setHotList(res.data.rows)
if (res && res.data && res.data.rows) {
setHotList(res.data.rows)
}
})
}

View File

@ -97,7 +97,8 @@ function Index(props) {
<h5 className="item-title">{item.name}</h5>
</div>
<div className="item-tags">
<span>共建方</span> <div></div>{item.extendDataSharer}
<span>共建方</span> <div></div>
<span title={item.extendDataSharer}>{item.extendDataSharer}</span>
</div>
<div className="item-desc" title={ item.summary }>
{item.summary}

View File

@ -103,6 +103,13 @@
color: #091221;
font-size: 13px;
span {
max-width: 330px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
img {
width: 15px;
margin-right: 5px;

View File

@ -66,7 +66,7 @@ function Index(props) {
<div className="project-content-top">
<div className="project-content-top-left">
<p>标准化生产线核心代码及软件工厂开发工具源码</p>
<p>基于标准化生产线开发的项目源码依赖包源码标准化生产线源码等</p>
<div className="content-top-list">
{
contentList.map((item, index) => {
@ -90,7 +90,8 @@ function Index(props) {
})
} */}
<img src={ index % 3 === 0 ? user1 : user2} alt="" />
<span>共建方</span> <div></div>{project.name.split('/')[0]}
<span>共建方</span> <div></div>
<span title={ project.name.split('/')[0] }>{project.name.split('/')[0]}</span>
</div>
<div className="item-desc">
{project.description}
@ -140,7 +141,8 @@ function Index(props) {
})
} */}
<img src={user2} alt="" />
<span>共建方</span> <div></div>{project.name.split('/')[0]}
<span>共建方</span> <div></div>
<span title={ project.name.split('/')[0] }>{project.name.split('/')[0]}</span>
</div>
<div className="item-desc">

View File

@ -164,8 +164,8 @@
}
&-content {
background: linear-gradient(180deg,#f4f8fd6c 0%,#f4f8fd6c 80.62%,#f4f8fd 100%), #ffffff;
border-radius:80px 80px 0px 0px;
background: linear-gradient(180deg, #f4f8fd6c 0%, #f4f8fd6c 80.62%, #f4f8fd 100%), #ffffff;
border-radius: 80px 80px 0px 0px;
padding-top: 28px;
display: flex;
flex-direction: column;
@ -330,6 +330,13 @@
color: #091221;
font-size: 13px;
span {
max-width: 200px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
img {
width: 15px;
margin-right: 5px;
@ -349,19 +356,25 @@
margin-right: 32px;
}
&:nth-child(1), &:nth-child(4) {
&:nth-child(1),
&:nth-child(4) {
color: #ffffff;
h5, div {
h5,
div {
color: #ffffff;
}
.item-data {
span {
color: #ffffff;
&:after {
color: #ffffff;
}
}
}
.item-tags {
height: 32px;
background: rgba(179, 190, 252, 0.18);
@ -453,6 +466,13 @@
color: #091221;
font-size: 13px;
span {
max-width: 200px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
img {
width: 15px;
margin-right: 5px;

View File

@ -1,24 +1,41 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Menu } from 'antd';
import "./branch.scss";
import CopyTool from '../Component/CopyTool';
function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
const [ key , setKey ] = useState("HTTP");
function CloneAddress({ http_url, ssh_url, zip_url, tar_url }) {
const [key, setKey] = useState("HTTP");
const [cloneUrl, setCloneUrl] = useState("");
useEffect(() => {
if (!http_url) {
setCloneUrl('');
return;
}
const match = http_url.match(/:3000\/(.+)/);
if (match && match[1]) {
const path = match[1];
setCloneUrl(`${ window.location.protocol }//${window.location.hostname}:3000/${path}`);
} else {
setCloneUrl(http_url);
}
}, [http_url]);
return (
<div className="downMenu">
<div>
<Menu className="urlMenu" selectedKeys={[key]} mode={"horizontal"}>
<Menu.Item key="HTTP" onClick={(e)=>{setKey(e.key)}}>HTTP</Menu.Item>
{ssh_url && <Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>}
<Menu.Item key="HTTP" onClick={(e) => { setKey(e.key) }}>HTTP</Menu.Item>
{/* {ssh_url && <Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>} */}
</Menu>
<div className="gitAddressClone">
<input type="text" id="copy_rep_content" value={key==="HTTP" ? http_url:ssh_url} />
<CopyTool inputId="copy_rep_content" className="copytool"/>
<input type="text" id="copy_rep_content" value={cloneUrl} />
<CopyTool inputId="copy_rep_content" className="copytool" />
</div>
</div>
<Menu className="edu-txt-center">
{zip_url && <Menu.Item style={{borderTop:"1px solid #eee"}}><a href={zip_url}>下载 ZIP</a></Menu.Item>}
{zip_url && <Menu.Item style={{ borderTop: "1px solid #eee" }}><a href={zip_url}>下载 ZIP</a></Menu.Item>}
{tar_url && <Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>}
</Menu>
</div>

View File

@ -78,7 +78,7 @@ class NewHeader extends Component {
}
window._header_componentHandler = this;
this.getZoneList(settings && settings.common.zone +'/api')
this.getZoneList(settings && settings.common.zone +'/zoneAdmin/api')
try {
window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href))

View File

@ -49,7 +49,7 @@ function beforeFetch(actionUrl){
return service;
}
let settings = localStorage.chromesetting&& localStorage.chromesetting !=="undefined"&& JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone +'/api';
let actionUrl = settings && settings.common.zone +'/zoneAdmin/api';
const service = beforeFetch(actionUrl);
export const httpUrl = actionUrl;

View File

@ -155,7 +155,7 @@ function Banner({isVisible}) {
{/* 底部统计数据 */}
<div className="df stats-container pt10 pb25">
<div className="stat-item">
<div className="stat-number">24</div>
<div className="stat-number">35</div>
<div className="stat-label">开源项目</div>
</div>
<Divider type="vertical" style={{ height: '60px' }} className="mt10 opacity4" />
@ -165,7 +165,7 @@ function Banner({isVisible}) {
</div>
<Divider type="vertical" style={{ height: '60px' }} className="mt10 opacity4" />
<div className="stat-item">
<div className="stat-number">99</div>
<div className="stat-number">20000<span className='font-30 ml3'>+</span></div>
<div className="stat-label">已治理组件</div>
</div>
<Divider type="vertical" style={{ height: '60px' }} className="mt10 opacity4" />

View File

@ -56,7 +56,7 @@ function beforeFetch(actionUrl){
return service;
}
let settings = localStorage.chromesetting&& localStorage.chromesetting !=="undefined"&& JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone +'/api';
let actionUrl = settings && settings.common.zone +'/zoneAdmin/api';
const service = beforeFetch(actionUrl);
export const httpUrl = actionUrl;

View File

@ -6,7 +6,7 @@ let baseZoneUrl = `${zoneUrl}/api`
if (__CLIENT__ ) {
let settings = localStorage.chromesetting && localStorage.chromesetting !== 'undefined' &&JSON.parse(localStorage.chromesetting);
baseUrl = settings && settings.common && settings.common.main_site_url ? `${settings.common.main_site_url}/api` : baseUrl;
baseZoneUrl = settings ? `${settings && settings.common.zone}/api` : `${zoneUrl}/api`;
baseZoneUrl = settings ? `${settings && settings.common.zone}/zoneAdmin/api` : `${zoneUrl}/api`;
}
console.log("__CLIENT__",__CLIENT__,baseUrl);