diff --git a/src/App.js b/src/App.js index fe07cba21..08be79737 100644 --- a/src/App.js +++ b/src/App.js @@ -68,6 +68,11 @@ const SoftwareFactoryResourceDetailCommon= Loadable({ loading: Loading, }) +const SoftwareFactoryVersionDetail = Loadable({ + loader: () => import('./factory/resource/factoryVersion/detail/index'), + loading: Loading, +}) + const SoftwareFactoryNews = Loadable({ @@ -511,6 +516,15 @@ class App extends Component { }> + { + return () + } + }> + + { if (e.extendData) { extendData = JSON.parse(e.extendData) } - rows.push({ ...e, extendDataUrl: extendData.url, extendDataHeadImg: extendData.headImg }) + rows.push({ ...e, + extendDataUrl: extendData.url, + extendDataHeadImg: extendData.headImg, + isOpen: extendData.isOpen || false, + sharer: extendData.sharer + }) }); setResourceList3(rows.slice(0, 6)); @@ -279,7 +285,14 @@ const Resource = forwardRef(({ zoneId }, ref) => { diff --git a/src/factory/index.jsx b/src/factory/index.jsx index 0f1c2d378..379264866 100644 --- a/src/factory/index.jsx +++ b/src/factory/index.jsx @@ -208,7 +208,7 @@ function Index(props) {

{bannerInfo.desc}

- { window.location.href = bannerInfo.link }}> + { window.open(bannerInfo.link) }}>
立即体验
diff --git a/src/factory/lessons/detail/index.jsx b/src/factory/lessons/detail/index.jsx index 60185cf37..163cceef5 100644 --- a/src/factory/lessons/detail/index.jsx +++ b/src/factory/lessons/detail/index.jsx @@ -5,7 +5,7 @@ import imageBack1 from '../../../images/factory/resource/tools-detail-head-left. import imageGif from '../../../images/factory/resource/tools-detail-head-left2.webp' import { Link } from 'react-router-dom'; import RenderHtml from '../../../components/render-html'; -import { Breadcrumb } from 'antd'; +import { Breadcrumb, Tooltip } from 'antd'; import { getSourceDetail, httpUrl, getSourceList } from '../../api'; import { downloadFunc } from '../../../forge/Utils/utils' import { docId, standardId } from '../../../constants/factory' @@ -58,8 +58,12 @@ function Index(props) { {detail.name}
-

{detail.name}

-

{detail.summary}

+ +

{detail.name}

+
+ +

{detail.summary}

+
{ (detail.keywords === docId || detail.keywords===standardId) &&
更多热门工具
diff --git a/src/factory/resource/developmentTools/detail/index.jsx b/src/factory/resource/developmentTools/detail/index.jsx index 5882eedc8..2ec8f9781 100644 --- a/src/factory/resource/developmentTools/detail/index.jsx +++ b/src/factory/resource/developmentTools/detail/index.jsx @@ -6,7 +6,7 @@ import imageGif from '../../../../images/factory/resource/tools-detail-head-left import headIcon from '../../../../images/factory/resource/tools-detail-head-icon.webp' import { Link } from 'react-router-dom'; import RenderHtml from '../../../../components/render-html'; -import { Breadcrumb } from 'antd'; +import { Breadcrumb, Tooltip } from 'antd'; import { getSourceDetail, httpUrl, getSourceList } from '../../../api'; import { downloadFunc } from '../../../../forge/Utils/utils' import { factoryZoneId, } from '../../../../constants/factory' @@ -70,8 +70,12 @@ function Index(props) { {detail.name}
-

{detail.name}

-

{detail.summary}

+ +

{detail.name}

+
+ +

{detail.summary}

+
{detail.downloadCount} diff --git a/src/factory/resource/factoryVersion/detail/index.jsx b/src/factory/resource/factoryVersion/detail/index.jsx new file mode 100644 index 000000000..96e04ea5a --- /dev/null +++ b/src/factory/resource/factoryVersion/detail/index.jsx @@ -0,0 +1,147 @@ +import React, { useEffect, useState, useRef } from 'react'; +import './index.scss'; +import { TPMIndexHOC } from '../../../../modules/tpm/TPMIndexHOC'; +import imageBack1 from '../../../../images/factory/resource/tools-detail-head-left.webp' +import imageGif from '../../../../images/factory/resource/tools-detail-head-left2.webp' +import headIcon from '../../../../images/factory/resource/tools-detail-head-icon.webp' +import { Link } from 'react-router-dom'; +import RenderHtml from '../../../../components/render-html'; +import { Breadcrumb, Tooltip } from 'antd'; +import { getSourceDetail, httpUrl, getSourceList } from '../../../api'; +import { downloadFunc } from '../../../../forge/Utils/utils' +import { factoryZoneId, versionId } from '../../../../constants/factory' +import '../../../common.scss' +import { Base64 } from 'js-base64'; + + +function Index(props) { + const id = props.match.params.id + const [detail, setDetail] = useState({}) + const [content, setContent] = useState(); + const [otherList, setOtherList] = useState([]); + + useEffect(() => { + document.title = '工具详情-软件工厂专区'; + + }, []); + + useEffect(() => { + if (id !== detail.id) { + getDetail() + } + }, [id]); + + useEffect(() => { + if (detail.id) { + getOtherList() + } + }, [detail]) + + const getDetail = () => { + getSourceDetail(id).then(response => { + if (response) { + let extendData = {} + if (response.data.data.extendData) { + extendData = JSON.parse(response.data.data.extendData) + } + document.title = response.data.data.name + if (extendData.content) { + const base64content = Base64.decode(extendData.content) + setContent(base64content !== '


' ? base64content : '') + } + setDetail({ ...response.data.data, ...extendData }); + } + }).catch(error => { }) + } + + const getOtherList = () => { + getSourceList({ id: factoryZoneId, keywords: versionId, name: '文档' }).then(res => { + const detailName = detail.name.toLowerCase(); + + let filteredList = []; + + if (detailName.includes('docker')) { + filteredList = res.data.rows.filter(e => + e.id !== detail.id && e.name.toLowerCase().includes('docker') + ); + } else if (detailName.includes('k8s')) { + filteredList = res.data.rows.filter(e => + e.id !== detail.id && e.name.toLowerCase().includes('k8s') + ); + } else { + filteredList = res.data.rows.filter(e => e.id !== detail.id && e.name.toLowerCase().includes('x86')); + } + setOtherList(filteredList); + }); + }; + + return ( +
+ +
+ + 首页 + 工厂版本 + {detail.name} + +
+ +

{detail.name}

+
+ +

{detail.summary}

+
+
+
+ {detail.downloadCount} + 下载量 +
+
+ {detail.fileList && detail.fileList[0] ? detail.fileList[0].fileSizeInfo : 0} + 文件大小 +
+
+ {detail.domainName} + 工具类型 +
+
+ + { + detail.name && !detail.name.includes("文档") &&
相关文档
+ } +
+ { + otherList.length > 0 && otherList.map((e, index) => { + return + + {e.name} + + + }) + } +
+ +
+
+ + {!detail.headImg && } +
+
+
+
+
+ { + content && +
+ +
+ } +
+
+ ) +} +export default TPMIndexHOC(Index) \ No newline at end of file diff --git a/src/factory/resource/factoryVersion/detail/index.scss b/src/factory/resource/factoryVersion/detail/index.scss new file mode 100644 index 000000000..80a1c089f --- /dev/null +++ b/src/factory/resource/factoryVersion/detail/index.scss @@ -0,0 +1,278 @@ +.news-detail { + min-height: calc(100vh - 58px); + + .news-detail-header { + height: 752px; + width: 100%; + background-image: url("../../../../images/factory/resource/tools-detail-head.webp"); + background-repeat: no-repeat; + background-size: 100% 100%; + display: flex; + flex-direction: column; + align-items: center; + position: relative; + justify-content: flex-start; + + .ant-breadcrumb { + align-self: flex-start; + margin-top: 30px; + margin-left: calc((100vw - 1600px) / 2); + + a { + color: #1b58df; + } + + span { + color: #091221; + + .breacrumb-name { + max-width: 200px; + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + vertical-align: middle; + } + + } + } + + .header-content { + margin-top: 30px; + width: 1600px; + min-height: 481px; + position: relative; + border-radius: 16px; + padding: 60px 45px; + background: linear-gradient(106.16deg, #f7fbff 2.47%, #f5faff 95.98%); + border: 2px solid; + border-color: #ffffff; + + h3 { + line-height: 47px; + font-family: alibabaBold; + font-weight: 700; + color: #091221; + font-size: 34px; + max-width: 650px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + + p { + margin-top: 25px; + max-width: 650px; + line-height: 22px; + font-family: alibabareg; + color: #5d6a80; + font-size: 16px; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + } + + .tools-info { + display: flex; + margin-top: 35px; + + div { + display: flex; + flex-direction: column; + position: relative; + margin-right: 78px; + + span:nth-child(1) { + line-height: 32px; + font-family: alibabaBold; + font-weight: 700; + color: #164ce4; + font-size: 24px; + } + + span:nth-child(2) { + line-height: 20px; + font-family: alibabareg; + color: #5d6a80; + font-size: 14px; + margin-top: 8px; + } + + &:not(:last-child) { + &::after { + position: absolute; + content: ""; + width: 0px; + height: 60px; + right: -39px; + border-right: 1px dashed; + border-color: rgba(22, 76, 228, 0.15); + } + } + } + } + + button { + margin-top: 30px; + width: 110px; + height: 36px; + line-height: 36px; + cursor: pointer; + border-radius: 6px; + line-height: 20px; + font-family: alibaba; + font-weight: 500; + color: #ffffff; + font-size: 14px; + text-align: center; + background-color: #091221; + } + + h6 { + margin-top: 34px; + line-height: 22px; + font-family: alibabaBold; + font-weight: 700; + color: #091221; + font-size: 16px; + } + + .more-tools { + display: flex; + margin-top: 5px; + max-width: 800px; + flex-wrap: wrap; + + span { + cursor: pointer; + display: inline-block; + background: #e9f2ff; + border-radius: 4px; + padding: 13px 12px; + margin-right: 15px; + line-height: 19px; + font-family: alibaba; + color: #091221; + font-size: 15px; + margin-top: 15px !important; + + img { + width: 19px; + height: 19px; + margin-right: 15px; + } + } + } + + .header-img { + position: absolute; + top: 60px; + right: 60px; + width: 600px; + height: 360px; + background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%); + border-radius: 14px; + box-shadow: 0px 0px 18px rgba(0, 74, 168, 0.05); + display: flex; + align-items: center; + justify-content: center; + + &-wrapper { + width: 526px; + height: 300px; + border-radius: 10px; + overflow: hidden; + position: relative; + + + img { + width: 100%; + height: 100%; + object-fit: contain; + border-radius: 10px; + + &:nth-child(2) { + width: 120px; + height: 120px; + position: absolute; + right: 127px; + bottom: 15px; + } + } + } + + } + + &:hover { + .header-img .header-img-wrapper img { + &:nth-child(1) { + transform: scale(1.1); + transition: transform .4s cubic-bezier(.25, .46, .45, .94); + } + + } + } + } + } + + .news-detail-content { + width: 1600px; + height: 100%; + margin: 52px auto; + margin-top: -130px; + position: relative; + z-index: 1; + + .ant-breadcrumb { + line-height: 20px; + font-family: alibaba; + font-size: 14px; + margin-bottom: 20px; + + a { + color: #1b58df; + } + + span { + color: #091221; + } + } + + .news-detail-content-wrapper { + background-image: url('../../../../images/factory/resource/detail-bg.png'); + background-repeat: no-repeat; + background-size: 100% 100%; + padding: 30px; + border-radius: 16px; + margin-bottom: 60px; + } + + .news-detail-content-others { + width: 300px; + float: right; + + div { + background: #f2f6fa; + border-radius: 12px; + padding: 35px 30px; + + h4 { + line-height: 22px; + font-family: alibaba; + font-weight: 500; + color: #091221; + font-size: 16px; + } + + li { + line-height: 20px; + font-family: alibabareg; + color: #091221; + font-size: 14px; + margin-top: 20px; + } + } + } + } +} \ No newline at end of file diff --git a/src/factory/resource/factoryVersion/index.jsx b/src/factory/resource/factoryVersion/index.jsx index be5f74ec2..409c3bad3 100644 --- a/src/factory/resource/factoryVersion/index.jsx +++ b/src/factory/resource/factoryVersion/index.jsx @@ -8,6 +8,8 @@ import '../../common.scss' import { downloadFunc } from '../../../forge/Utils/utils' import manual1 from '../../../images/factory/lessons/manual-1.webp' import manual2 from '../../../images/factory/lessons/manual-2.webp' +import { Tooltip } from 'antd'; +import { Link } from "react-router-dom"; const sourceCode = { name: '软件工厂源码', @@ -28,12 +30,15 @@ function Index(props) { const getFullList = () => { getSourceList({ id: factoryZoneId, keywords: versionId }).then(res => { - setVersionList([...res.data.rows, sourceCode]); + if (res.data.rows) { + setVersionList([...res.data.rows, sourceCode]); + } }); }; const getManualList = () => { getSourceList({ id: factoryZoneId, keywords: manualId }).then(res => { + if (!res.data.rows) return const rows = [] res.data.rows.forEach(e => { let extendData = {} @@ -53,33 +58,38 @@ function Index(props) {
生产线安装包

标准化生产线快速迭代版本和稳定支持版本

-
-
- { - versionList.map((item, index) => { - return
-
- -
-
-
+
+ { + versionList.map((item, index) => { + return
+
+ +
+
+
+
-

{item.name}

- {index === 0 && } +

{item.name}

+ {index === 0 ? : item.id === 'code'? 源码 : 安装包}
-

{item.summary}

+

{item.summary}

{item.createTime}
-
+ { + item.id === 'code' ? + : + + + }
- }) - } -
+
+ }) + }

用户手册

diff --git a/src/factory/resource/factoryVersion/index.scss b/src/factory/resource/factoryVersion/index.scss index 9a743b336..672f3e4ac 100644 --- a/src/factory/resource/factoryVersion/index.scss +++ b/src/factory/resource/factoryVersion/index.scss @@ -29,28 +29,22 @@ font-size: 14px; } } - .scroller-wrapper { - margin-top: 59px; - margin-bottom: 90px; - height: 331px; - overflow: hidden; - transition: all 0.2s ease-in-out; - &:hover { - height: 341px; - margin-bottom: 80px; - } - } .version-content { + margin-top: 60px; width: 1600px; display: flex; justify-content: flex-start; - overflow-x: auto; + flex-wrap: wrap; .version-item { - width: 448px; display: flex; - margin-right: 30px; + margin-bottom: 60px; + margin-right: 39px; + + &:nth-child(3n) { + margin-right: 0; + } &:last-child { .item-data { @@ -62,7 +56,7 @@ display: flex; flex-direction: column; align-items: center; - margin-right: 29px; + margin-right: 39px; img { width: 42px; @@ -71,20 +65,27 @@ div { margin-top: -21px; - height: 310px; + height: 260px; border-left: 1px dashed rgba(22, 76, 228, 0.31); } } &-right { - flex-grow: 1; + width: 425px; display: flex; flex-direction: column; + + .version-item-wrapper { + &:hover { + .version-item-content { + background: linear-gradient(91.8deg,#f2f0ff 0.4%,rgba(230, 237, 255, 0.78) 99.5%); + } + } + } .version-item-title { display: flex; align-items: center; - width: 250px; h4 { line-height: 33px; @@ -101,6 +102,26 @@ width: 37.49px; margin-left: 10px; } + .version-tag, .code-tag { + margin-left: 10px; + width: 41.08px; + height: 21.5px; + line-height: 20px; + font-family: DouyinSansBold; + color: #ffffff; + font-size: 12px; + background-repeat: no-repeat; + background-size: 100% 100%; + flex-shrink: 0; + text-align: center; + } + .version-tag { + width: 46px; + background-image: url('../../../images/factory/resource/version-version.webp'); + } + .code-tag { + background-image: url('../../../images/factory/resource/version-code.webp'); + } } .version-item-content { @@ -182,12 +203,12 @@ } } - // &:not(:first-child) { - // button:hover { - // border-color: #164ce4; - // color: #164ce4; - // } - // } + &:not(:first-child) { + button:hover { + border-color: #164ce4; + color: #164ce4; + } + } } } .manual { diff --git a/src/images/factory/resource/version-code.webp b/src/images/factory/resource/version-code.webp new file mode 100644 index 000000000..ab680d110 Binary files /dev/null and b/src/images/factory/resource/version-code.webp differ diff --git a/src/images/factory/resource/version-version.webp b/src/images/factory/resource/version-version.webp new file mode 100644 index 000000000..ac5c3d4a4 Binary files /dev/null and b/src/images/factory/resource/version-version.webp differ