diff --git a/src/constants/factory.js b/src/constants/factory.js index d5c5082a9..aaa9bf313 100644 --- a/src/constants/factory.js +++ b/src/constants/factory.js @@ -3,10 +3,11 @@ export const factoryZoneId = 102 export const dirId = 9 export const versionId = '工厂版本' export const lessonId = '学习资源' -// export const commontoolId = '社区软件' -export const commontoolId = '开发工具' +export const commontoolId = '社区软件' +// export const commontoolId = '开发工具' export const toolId = '开发工具' export const standardId = '标准规范' +export const docId = '文档资料' export const manualId = '用户手册' export const sceneId = '应用场景' export const factoryZoneName = 'tester' diff --git a/src/factory/components/News/index.jsx b/src/factory/components/News/index.jsx index 47cd233a5..fc7f908c5 100644 --- a/src/factory/components/News/index.jsx +++ b/src/factory/components/News/index.jsx @@ -84,8 +84,8 @@ function News(props) {
-

{item.name}

-

{item.summary}

+

{item.name}

+

{item.summary}

})} @@ -97,10 +97,10 @@ function News(props) {
-
{news.name}
+
{news.name}
-

{news.summary}

+

{news.summary}

@@ -108,10 +108,10 @@ function News(props) { subList.slice(0, 4).map(item => { return
-

{item.name}

+

{item.name}

-

{item.summary}

+

{item.summary}

}) } diff --git a/src/factory/components/Resource/index.jsx b/src/factory/components/Resource/index.jsx index 5cd93c4ce..509f0da71 100644 --- a/src/factory/components/Resource/index.jsx +++ b/src/factory/components/Resource/index.jsx @@ -5,7 +5,7 @@ import { ScrollTrigger } from 'gsap/ScrollTrigger'; import KFIcon from '../../../components/KFIcon'; import { Link } from 'react-router-dom'; import { getProjectsLists, getSourceList, httpUrl } from '../../api'; -import { factoryZoneId, lessonId, versionId, toolId, commontoolId } from '../../../constants/factory' +import { factoryZoneId, manualId, versionId, toolId, commontoolId } from '../../../constants/factory' import { downloadFunc } from '../../../forge/Utils/utils' import '../../common.scss' @@ -31,6 +31,7 @@ const Resource = forwardRef(({ zoneId }, ref) => { const [resourceList2, setResourceList2] = useState([]); const [resourceList3, setResourceList3] = useState([]); const [resourceList4, setResourceList4] = useState([]); + const [manualList, setManualList] = useState([]); useEffect(() => { if (!zoneId) return; @@ -42,6 +43,7 @@ const Resource = forwardRef(({ zoneId }, ref) => { setResourceList1(res.data.rows.slice(0, 6)); } }); + getManualList() }, [zoneId]); useEffect(() => { @@ -131,7 +133,7 @@ const Resource = forwardRef(({ zoneId }, ref) => { const getVersionList = () => { getSourceList({ id: factoryZoneId, keywords: versionId }).then(res => { - setResourceList2(res.data.rows.slice(0, 2)); + setResourceList2(res.data.rows.slice(0, 1)); }); } @@ -165,6 +167,20 @@ const Resource = forwardRef(({ zoneId }, ref) => { }); } + const getManualList = () => { + getSourceList({ id: factoryZoneId, keywords: manualId }).then(res => { + const rows = [] + res.data.rows.forEach(e => { + let extendData = {} + if (e.extendData) { + extendData = JSON.parse(e.extendData) + } + rows.push({ ...e, extendDataUrl: extendData.url, extendDataHeadImg: extendData.headImg }) + }); + setManualList(rows.slice(0, 2)); + }); + } + return (
{ { resourceList2.length > 0 && resourceList2.map((item, index) => { return
-
{item.name}
-
{item.summary}
+
{item.name}
+
{item.summary}
}) } + { + manualList.map((item, index) => { + return
+
{item.name}
+
{item.summary}
+ +
+ }) + } +
+
软件工厂源码
+
软件工厂源码即将开放,敬请期待
+ +
@@ -222,7 +252,7 @@ const Resource = forwardRef(({ zoneId }, ref) => { } } -
{projectProperties.description}
+
{projectProperties.description}
{projectProperties.forkedCount} {projectProperties.praisesCount} @@ -243,8 +273,8 @@ const Resource = forwardRef(({ zoneId }, ref) => { { resourceList3.length > 0 && resourceList3.map((item, index) => { return
-
{item.name}
-
{item.summary}
+
{item.name}
+
{item.summary}
@@ -264,8 +294,8 @@ const Resource = forwardRef(({ zoneId }, ref) => { { resourceList4.length > 0 && resourceList4.map((item, index) => { return
-
{item.name}
-
{item.summary}
+
{item.name}
+
{item.summary}
diff --git a/src/factory/components/Resource2/index.jsx b/src/factory/components/Resource2/index.jsx index 71546ddfd..0825fbfc8 100644 --- a/src/factory/components/Resource2/index.jsx +++ b/src/factory/components/Resource2/index.jsx @@ -8,7 +8,7 @@ import KFIcon from '../../../components/KFIcon'; import back1 from '../../../images/factory/back1.png' import '../../common.scss' import { getSourceList, httpUrl } from '../../api'; -import { factoryZoneId, manualId, standardId, lessonId } from '../../../constants/factory' +import { factoryZoneId, docId, standardId, lessonId, manualId } from '../../../constants/factory' import { downloadFunc } from '../../../forge/Utils/utils' import { Carousel } from 'antd'; @@ -18,6 +18,7 @@ const Resource2 = forwardRef(({ zoneId }, ref) => { const [isVisible, setIsVisible] = useState(false); const [standardList, setStandardList] = useState([]); const [manualList, setManualList] = useState([]); + const [docList, setDocList] = useState([]); const [chapterList, setChapterList] = useState([]); const carouselEL = useRef(null); const [current, setCurrent] = useState(0); @@ -31,6 +32,7 @@ const Resource2 = forwardRef(({ zoneId }, ref) => { }, { threshold: 0.1 }); getStandard() getManualList() + getDocList() getLessonList() if (ref.current) { @@ -63,7 +65,21 @@ const Resource2 = forwardRef(({ zoneId }, ref) => { } rows.push({ ...e, extendDataUrl: extendData.url, extendDataHeadImg: extendData.headImg }) }); - setManualList(rows.slice(0, 2)); + setManualList(rows.slice(0, 3)); + }); + } + + const getDocList = () => { + getSourceList({ id: factoryZoneId, keywords: docId }).then(res => { + const rows = [] + res.data.rows.forEach(e => { + let extendData = {} + if (e.extendData) { + extendData = JSON.parse(e.extendData) + } + rows.push({ ...e, extendDataUrl: extendData.url, extendDataHeadImg: extendData.headImg }) + }); + setDocList(rows.slice(0, 2)); }); } @@ -112,8 +128,8 @@ const Resource2 = forwardRef(({ zoneId }, ref) => { return
-

{item.name}

-

{item.summary}

+

{item.name}

+

{item.summary}

@@ -128,8 +144,8 @@ const Resource2 = forwardRef(({ zoneId }, ref) => { {manualList.map(item => { return
-

{item.name}

-

{item.summary}

+

{item.name}

+

{item.summary}

@@ -142,14 +158,14 @@ const Resource2 = forwardRef(({ zoneId }, ref) => {

文档资料

    - {manualList.map((item, index) => ( + {docList.map((item, index) => (
  • { downloadFunc(`${httpUrl}/file/open/download/${item.fileIds}`) }}> {item.name}
  • ))}
- {manualList.map(item => { + {docList.map(item => { return
diff --git a/src/factory/index.jsx b/src/factory/index.jsx index 612d3c7a5..d01f18ae1 100644 --- a/src/factory/index.jsx +++ b/src/factory/index.jsx @@ -18,7 +18,7 @@ import { getMainInfos } from './api' gsap.registerPlugin(ScrollTrigger); const info = { - title: `软件工厂,助力菌用软件研发新时代`, + title: `软件工厂,助力菌用软件敏捷迭代`, desc: '软件研发活动数字化转型,软件研发过程在线化协作,软件研发工具智能化升级', link: '/', forums: 'forums', diff --git a/src/factory/lessons/index.jsx b/src/factory/lessons/index.jsx index 439593990..3ef4361a3 100644 --- a/src/factory/lessons/index.jsx +++ b/src/factory/lessons/index.jsx @@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react'; import './index.scss'; import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC"; import KFIcon from '../../components/KFIcon/index'; -import { factoryZoneId, lessonId, manualId, standardId } from '../../constants/factory' +import { factoryZoneId, lessonId, manualId, standardId, docId } from '../../constants/factory' import { Carousel } from 'antd'; import back1 from '../../images/factory/back1.png' import back2 from '../../images/factory/back2.png' @@ -36,6 +36,7 @@ function Index(props) { getLessonList(); getStandardList(); getManualList(); + getDocList(); }, []); const getLessonList = () => { @@ -95,6 +96,20 @@ function Index(props) { }); } + const getDocList = () => { + getSourceList({ id: factoryZoneId, keywords: docId }).then(res => { + const rows = [] + res.data.rows.forEach(e => { + let extendData = {} + if (e.extendData) { + extendData = JSON.parse(e.extendData) + } + rows.push({ ...e, extendDataUrl: extendData.url, extendDataHeadImg: extendData.headImg }) + }); + setDocList(rows.slice(0,6)); + }); + } + return (
@@ -264,14 +279,14 @@ function Index(props) { docList.map((item, index) => { return
- +
-

{item.name}

+

{item.name}

{item.summary}

- {item.publishTime} - + {moment(item.createTime).format('YYYY/MM/DD')} + 查看详情 diff --git a/src/factory/lessons/index.scss b/src/factory/lessons/index.scss index 27ddc8b26..e3b99aea5 100644 --- a/src/factory/lessons/index.scss +++ b/src/factory/lessons/index.scss @@ -652,10 +652,8 @@ } .manual { - margin-top: -30px; width: 100%; height: 512px; - background: linear-gradient(180.65deg, #ffffff -1.79%, #f1f6fd 98.12%); border-radius: 16px; display: flex; flex-direction: column; @@ -786,80 +784,137 @@ } .docs { - .news-item { - width: 48%; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; - &:hover { - h3 { - color: #164ce4; - } + .docs-content { + margin-top: 50px; + display: flex; + flex-wrap: wrap; + width: 1600px; + justify-content: space-between; - svg { - left: 2px; - top: -20px; - } - } - - &-title { - margin-top: 27px; + .news-item { + width: 787.5px; + height: 260px; + background: #f1f6fd; + border-radius: 16px; display: flex; - justify-content: space-between; + padding: 30px 40px; + margin-bottom: 25px; - i { - flex-shrink: 0; - height: 28px; - width: 28px; - position: relative; - display: inline-block; + &-img { + width: 300px; + height: 200px; + border-radius: 14px; + margin-right: 32px; + overflow: hidden; - svg { - position: absolute; - left: -21px; - top: 4px; - transition: top .2s ease-out, left .2s ease-out; + img { + width: 300px; + height: 200px; + transition: transform .4s cubic-bezier(.25, .46, .45, .94); + } + } + + &-info { + width: 380px; + display: flex; + flex-direction: column; + + h3 { + line-height: 25px; + font-family: alibaba; + font-weight: 500; + color: #091221; + font-size: 22px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } - overflow: hidden; + p { + margin-top: 15px; + line-height: 30px; + font-family: alibabareg; + color: #091221; + font-size: 15px; + // 最多2行 + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + overflow: hidden; + word-break: break-all; + } + + &-bottom { + margin-top: auto; + display: flex; + flex-direction: column; + height: 30px; + overflow: hidden; + + a, + span { + transition: transform .4s cubic-bezier(.25, .46, .45, .94); + } + + a { + span { + margin-top: 14px; + line-height: 25px; + font-family: alibaba; + font-weight: 500; + color: #164ce4; + font-size: 18px; + } + + i { + margin-left: 4px; + height: 25px; + width: 25px; + position: relative; + display: inline-block; + overflow: hidden; + + svg { + position: absolute; + left: 2px; + top: -16px; + } + + } + } + } } - h3 { - line-height: 33px; - font-family: alibaba; - font-weight: 500; - color: #091221; - font-size: 22px; - max-width: 670px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; + &:hover { + h3 { + color: #164ce4; + } + + img { + transform: scale(1.1); + } + + .news-item-info-bottom { + span { + transform: translate(0, -30px); + } + + a { + transform: translate(0, -30px); + } + + } } } - - p { - margin-top: 22px; - line-height: 22px; - font-family: alibabareg; - color: #091221; - font-size: 16px; - max-width: 690px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - } - - // 前两个 - &:nth-child(-n+2) { - border-bottom: 1px solid #f0f0f0; - padding-bottom: 45px; - height: fit-content; - } - - // 最后两个 - &:nth-last-child(-n+2) { - display: flex; - justify-content: flex-end; - flex-direction: column; - } } + } } \ No newline at end of file