11import React from 'react'
22import styles from './styles.module.css'
3- import { Col , Row , Card , Button , Divider } from 'antd'
3+ import {
4+ Col ,
5+ Row ,
6+ Card ,
7+ Button ,
8+ Divider
9+ } from 'antd'
410import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
511// 获取路由导航
612// 1. 打开 https://doc.dgiotcloud.cn/docs/product_doc/docs/deployment_details/index/
@@ -25,94 +31,125 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
2531// 3. 拷贝节点数据
2632// window.copy(JSON.stringify(nav))
2733function HomepageHeader ( ) {
28- // 下面打印函数可以拿到打印的path路径。但是无法拿到title,因为title是在组件中定义的。
29- // console.log(useDocusaurusContext().globalData['docusaurus-plugin-content-docs'].default.versions[0].docs)
30- // todo: 需要写link地址
31- const nav = [
32- {
33- text : '用户手册' ,
34- children : [
35- { text : '设备运维' , href :"/docs/user_manual/docs/equipment_operational/equipment_leasing" } ,
36- { text : '智慧园区' } ,
37- { text : '数字工厂' } ,
38- { text : '云检测' } ,
39- { text : '云压测' } ,
40- ] ,
41- } ,
42- {
43- text : '产品文档' ,
44- children : [
45- { text : '部署详情' } ,
46- { text : '简介' } ,
47- { text : '设备云' } ,
48- { text : '多租户' } ,
49- { text : '云运维' } ,
50- { text : '云函数' } ,
51- { text : '云系统' } ,
52- { text : '云检测' } ,
53- { text : '云日志' } ,
54- ] ,
55- } ,
56- {
57- text : '开发指南' ,
58- children : [
59- { text : '系统架构' } ,
60- { text : '后端技术' } ,
61- { text : '数据标识' } ,
62- { text : '前端技术' } ,
63- { text : '时序数据' } ,
64- ] ,
65- } ,
66- {
67- text : '实战教程' ,
68- children : [
69- { text : '基础知识' } ,
70- { text : '电表接入' } ,
71- { text : '视频教程' } ,
72- { text : 'PT100传感器接入教程' } ,
73- { text : '电力集抄教程' } ,
74- { text : 'DDZY1296电表接入教程' } ,
75- { text : '三合一传感器接入教程' } ,
76- { text : 'Mqtt设备接入教程' } ,
77- { text : '水泵性能曲线测量案例' } ,
78- { text : 'OPC-DA设备接入教程' } ,
79- { text : '摄像头接入' } ,
80- { text : '测试' } ,
81- ] ,
82- } ,
83- ]
84- // 维护时,只需维护该nav的数据
85- return nav . map ( ( item , index ) => (
86- < Card
87- style = { { marginBottom : '20px' } }
88- hoverable = { true }
89- key = { index }
90- xs = { 12 }
91- sm = { 6 }
92- >
93- { /*todo:循环中需要写src地址跳转*/ }
94- < Row >
95- < Col span = { 2 } >
96- < Button type = "primary" > { item . text } </ Button >
97- </ Col >
98- < Col span = { 20 } offset = { 1 } style = { { borderLeft : '1px solid #666' } } >
99- { /*循环item.children*/ }
100- { item . children . map ( ( i , index ) => (
101- < Button type = "link" href = { i . href } key = { index } >
102- { i . text }
103- </ Button >
104- ) ) }
105- </ Col >
106- </ Row >
107- </ Card >
108- ) )
34+ // 下面打印函数可以拿到打印的path路径。但是无法拿到title,因为title是在组件中定义的。
35+ // console.log(useDocusaurusContext().globalData['docusaurus-plugin-content-docs'].default.versions[0].docs)
36+ // todo: 需要写link地址
37+ const nav = [ {
38+ children : [
39+ {
40+ "text" : "设备运维" ,
41+ "content" : "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。" ,
42+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
43+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
44+ } ,
45+ {
46+ "text" : "智慧园区" ,
47+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
48+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
49+ } ,
50+ {
51+ "text" : "数字工厂" ,
52+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
53+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
54+ } ,
55+ {
56+ "text" : "云检测" ,
57+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
58+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
59+ } ,
60+ {
61+ "text" : "设备运维" ,
62+ "content" : "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。" ,
63+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
64+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
65+ } ,
66+ {
67+ "text" : "智慧园区" ,
68+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
69+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
70+ } ,
71+ {
72+ "text" : "数字工厂" ,
73+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
74+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
75+ } ,
76+ {
77+ "text" : "云检测" ,
78+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
79+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
80+ } ,
81+ {
82+ "text" : "设备运维" ,
83+ "content" : "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。" ,
84+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
85+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
86+ } ,
87+ {
88+ "text" : "智慧园区" ,
89+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
90+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
91+ } ,
92+ {
93+ "text" : "数字工厂" ,
94+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
95+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
96+ } ,
97+ {
98+ "text" : "云检测" ,
99+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
100+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
101+ } ,
102+ {
103+ "text" : "设备运维" ,
104+ "content" : "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。" ,
105+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
106+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
107+ } ,
108+ {
109+ "text" : "智慧园区" ,
110+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
111+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
112+ } ,
113+ {
114+ "text" : "数字工厂" ,
115+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
116+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
117+ } ,
118+ {
119+ "text" : "云检测" ,
120+ "cover" : "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png" ,
121+ "href" : "/docs/user_manual/docs/equipment_operational/equipment_leasing"
122+ }
123+ ]
124+ }
125+
126+ ]
127+ // 维护时,只需维护该nav的数据
128+ return nav . map ( ( item , index ) => (
129+ < div style = { { display : "flex" , flexWrap : "wrap" } } >
130+ { item . children . map ( ( i , index ) => (
131+ < Col key = { { index} } span = { 5 } offset = { 1 } style = { { border : '0px solid #666' } } >
132+ < a href = { i . href } >
133+ < Card
134+ hoverable = { true }
135+ key = { index }
136+ style = { { border : '0px solid #666' , margin : '0px 0px 10px 0px' } }
137+ >
138+ < img alt = "cover" href = { i . href } src = { i . cover } style = { { height : '80%' , width : '80%' , objectFit : 'cover' } } />
139+ </ Card >
140+ </ a >
141+ </ Col >
142+ ) ) }
143+ </ div >
144+ ) )
109145}
146+
110147export default function HomepageFeatures ( ) {
111- return (
112- < section className = { styles . features } >
148+ return (
149+ < section className = { styles . features } >
113150 < div className = "container" >
114151 < HomepageHeader />
115152 </ div >
116153 </ section >
117- )
118- }
154+ )
155+ }
0 commit comments