Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
b4a76471
提交
b4a76471
authored
5月 23, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添-首页-布局修改
上级
bc0e29c8
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
93 行增加
和
25 行删除
+93
-25
index.tsx
components/contentBox/index.tsx
+1
-0
interface.ts
components/contentBox/interface.ts
+12
-2
index.tsx
components/contentBox/left/index.tsx
+27
-7
styled.tsx
components/contentBox/left/styled.tsx
+28
-0
index.tsx
pages/home/waterfallFlowBody/index.tsx
+25
-16
没有找到文件。
components/contentBox/index.tsx
浏览文件 @
b4a76471
...
@@ -10,6 +10,7 @@ export default function ContentBox(props: BoxProps) {
...
@@ -10,6 +10,7 @@ export default function ContentBox(props: BoxProps) {
boxIndex=
{
props
.
boxIndex
}
boxIndex=
{
props
.
boxIndex
}
leftRenderDom=
{
props
.
leftRenderDom
}
leftRenderDom=
{
props
.
leftRenderDom
}
leftcontentstyle=
{
props
.
leftcontentstyle
}
leftcontentstyle=
{
props
.
leftcontentstyle
}
leftWaterfallDom=
{
props
.
leftWaterfallDom
}
/>
/>
<
Right
rightRenderDom=
{
props
.
rightRenderDom
}
/>
<
Right
rightRenderDom=
{
props
.
rightRenderDom
}
/>
</
Box
>
</
Box
>
...
...
components/contentBox/interface.ts
浏览文件 @
b4a76471
...
@@ -5,9 +5,18 @@ export interface DomType {
...
@@ -5,9 +5,18 @@ export interface DomType {
}[];
}[];
pagination
?:
JSX
.
Element
;
pagination
?:
JSX
.
Element
;
}
}
export
interface
WaterfallType
{
columns
:
{
noFor
?:
boolean
;
type
?:
string
,
element
:
JSX
.
Element
;
}[];
pagination
?:
JSX
.
Element
;
}
export
interface
leftBoxProps
{
export
interface
leftBoxProps
{
boxIndex
:
number
;
boxIndex
:
number
;
leftRenderDom
:
DomType
;
leftRenderDom
?:
DomType
;
leftWaterfallDom
?:
WaterfallType
;
leftcontentstyle
?:
{
leftcontentstyle
?:
{
width
?:
string
;
width
?:
string
;
margin
?:
{
margin
?:
{
...
@@ -24,7 +33,8 @@ export interface rightBoxProps {
...
@@ -24,7 +33,8 @@ export interface rightBoxProps {
export
interface
BoxProps
{
export
interface
BoxProps
{
boxIndex
:
number
;
boxIndex
:
number
;
leftRenderDom
:
DomType
;
leftRenderDom
?:
DomType
;
leftWaterfallDom
?:
WaterfallType
;
leftcontentstyle
?:
{
leftcontentstyle
?:
{
width
?:
string
;
width
?:
string
;
margin
?:
{
margin
?:
{
...
...
components/contentBox/left/index.tsx
浏览文件 @
b4a76471
import
React
from
"react"
;
import
React
from
"react"
;
import
{
Empty
}
from
"antd"
;
import
{
Empty
}
from
"antd"
;
import
{
Box
}
from
"./styled"
;
import
{
Box
,
WaterfallBox
}
from
"./styled"
;
import
{
leftBoxProps
}
from
"../interface"
;
import
{
leftBoxProps
}
from
"../interface"
;
export
default
function
Left
(
props
:
leftBoxProps
)
{
export
default
function
Left
(
props
:
leftBoxProps
)
{
const
{
boxIndex
,
leftRenderDom
,
leftcontentstyle
}
=
props
;
const
{
boxIndex
,
leftRenderDom
,
leftcontentstyle
,
leftWaterfallDom
}
=
props
;
return
(
return
(
<
div
>
<
div
>
{
leftRenderDom
.
columns
.
map
((
item
)
=>
{
{
leftRenderDom
?
.
columns
.
map
((
item
)
=>
{
if
(
item
.
noFor
)
{
if
(
item
.
noFor
)
{
return
item
.
element
;
return
item
.
element
;
}
}
...
@@ -16,7 +15,7 @@ export default function Left(props: leftBoxProps) {
...
@@ -16,7 +15,7 @@ export default function Left(props: leftBoxProps) {
})
}
})
}
{
{
<
Box
index=
{
boxIndex
}
leftcontentstyle=
{
leftcontentstyle
}
>
<
Box
index=
{
boxIndex
}
leftcontentstyle=
{
leftcontentstyle
}
>
{
leftRenderDom
.
columns
.
map
((
item
)
=>
{
{
leftRenderDom
?
.
columns
.
map
((
item
)
=>
{
if
(
!
item
.
noFor
)
{
if
(
!
item
.
noFor
)
{
return
item
.
element
;
return
item
.
element
;
}
}
...
@@ -24,8 +23,29 @@ export default function Left(props: leftBoxProps) {
...
@@ -24,8 +23,29 @@ export default function Left(props: leftBoxProps) {
})
}
})
}
</
Box
>
</
Box
>
}
}
{
leftRenderDom
.
pagination
?
leftRenderDom
.
pagination
:
null
}
{
{
!
leftRenderDom
.
columns
.
length
?
(
<
WaterfallBox
index=
{
boxIndex
}
leftcontentstyle=
{
leftcontentstyle
}
>
{
<
div
className=
"left-columns"
>
{
leftWaterfallDom
?.
columns
.
map
((
item
)
=>
{
if
(
!
item
.
noFor
&&
item
.
type
===
"left"
)
{
return
item
.
element
}
return
null
})
}
</
div
>
}
{
<
div
className=
"right-columns"
>
{
leftWaterfallDom
?.
columns
.
map
((
item
)
=>
{
if
(
!
item
.
noFor
&&
item
.
type
===
"right"
)
{
return
item
.
element
}
return
null
})
}
</
div
>
}
</
WaterfallBox
>
}
{
leftRenderDom
?.
pagination
?
leftRenderDom
?.
pagination
:
null
}
{
!
leftRenderDom
?.
columns
.
length
&&
!
leftWaterfallDom
?.
columns
.
length
?
(
<
Empty
description=
{
"暂无数据"
}
/>
<
Empty
description=
{
"暂无数据"
}
/>
)
:
null
}
)
:
null
}
</
div
>
</
div
>
...
...
components/contentBox/left/styled.tsx
浏览文件 @
b4a76471
...
@@ -34,3 +34,30 @@ export const Box = styled.div<BoxProps>`
...
@@ -34,3 +34,30 @@ export const Box = styled.div<BoxProps>`
}
}
}
}
`
`
export const WaterfallBox = styled.div<BoxProps>`
box
-
sizing
:
border
-
box
;
display
:
flex
;
width
:
$
{
props
=>
props
.
leftcontentstyle
?.
width
?
props
.
leftcontentstyle
?.
width
:
"790px"
};
.
item
{
// 每个元素都要设置右边距margin-right(每个元素的左右间隙)
// 同时设置下边距margin-bottom(每个元素的上下间隙)
/* margin: 0 24px 15px 0; */
margin
:
$
{
props
=>
props
.
leftcontentstyle
?.
margin
?
(
`
${
props
.
leftcontentstyle
?.
margin
.
top
}
$
{
props
.
leftcontentstyle
?.
margin
.
right
}
$
{
props
.
leftcontentstyle
?.
margin
.
bottom
}
$
{
props
.
leftcontentstyle
?.
margin
.
left
}
`) : "0 24px 15px 0"};;
width: calc(( 100% -
${
props
=>
props
.
index
}
*
${
props
=>
props
.
leftcontentstyle
?.
margin
?
props
.
leftcontentstyle
?.
margin
.
right
:
"24px"
})
/
$
{
props
=>
props
.
index
});
// 这里一行显示index个,所以是/index,一行显示几个就除以几
// 这里的72px = (分布个数index-1)*间隙20px, 可以根据实际的分布个数和间隙区调整
min
-
width
:
calc
((
100
%
-
$
{
props
=>
props
.
index
}
*
$
{
props
=>
props
.
leftcontentstyle
?.
margin
?
props
.
leftcontentstyle
?.
margin
.
right
:
"24px"
})
/
$
{
props
=>
props
.
index
});
max
-
width
:
calc
((
100
%
-
$
{
props
=>
props
.
index
}
*
$
{
props
=>
props
.
leftcontentstyle
?.
margin
?
props
.
leftcontentstyle
?.
margin
.
right
:
"24px"
})
/
$
{
props
=>
props
.
index
});
// 每行最右侧的那个不设置右外边距
&
:
nth
-
child
(
$
{
props
=>
props
.
index
}
n
+
$
{
props
=>
props
.
index
})
{
margin
-
right
:
0
;
}
}
.
left
-
columns
{
}
.
right
-
columns
{
}
`
\ No newline at end of file
pages/home/waterfallFlowBody/index.tsx
浏览文件 @
b4a76471
...
@@ -96,16 +96,16 @@ export default function WaterfallFlowBody() {
...
@@ -96,16 +96,16 @@ export default function WaterfallFlowBody() {
router
:
"/mall"
,
router
:
"/mall"
,
},
},
{
{
title
:
"无人机
服务
"
,
title
:
"无人机
保险
"
,
router
:
"
/jobServices
"
,
router
:
""
,
},
},
{
{
title
:
"无人机培训"
,
title
:
"无人机培训"
,
router
:
"flyingHandService"
,
router
:
"flyingHandService"
,
},
},
{
{
title
:
"无人机
保险
"
,
title
:
"无人机
服务
"
,
router
:
""
,
router
:
"
/jobServices
"
,
},
},
{
{
title
:
"无人机工具软件"
,
title
:
"无人机工具软件"
,
...
@@ -114,7 +114,7 @@ export default function WaterfallFlowBody() {
...
@@ -114,7 +114,7 @@ export default function WaterfallFlowBody() {
];
];
const
[
leftDomList
,
setLeftDomList
]
=
useState
(
const
[
leftDomList
,
setLeftDomList
]
=
useState
(
Array
<
{
element
:
JSX
.
Element
}
>
Array
<
{
element
:
JSX
.
Element
,
type
?:
string
,
}
>
);
);
const
[
rightTopDomList
,
setRightTopDomList
]
=
useState
<
JSX
.
Element
>
();
const
[
rightTopDomList
,
setRightTopDomList
]
=
useState
<
JSX
.
Element
>
();
const
[
rightBottomDomList
,
setRightBottomDomList
]
=
useState
<
JSX
.
Element
>
();
const
[
rightBottomDomList
,
setRightBottomDomList
]
=
useState
<
JSX
.
Element
>
();
...
@@ -130,11 +130,12 @@ export default function WaterfallFlowBody() {
...
@@ -130,11 +130,12 @@ export default function WaterfallFlowBody() {
"modelId"
,
"modelId"
,
"qualityId"
,
"qualityId"
,
];
];
const
{
IndustryFlightSkills
}
=
flightSkillsApi
;
const
flightApiTypeList
=
[
"licenseId"
,
"flightSkillsId"
];
const
{
listAllIndustry
,
listAllAppType
}
=
jobServicesApi
;
const
{
listAllIndustry
,
listAllAppType
}
=
jobServicesApi
;
const
jobApiTypeList
=
[
"industryId"
,
"appTypeId"
];
const
jobApiTypeList
=
[
"industryId"
,
"appTypeId"
];
const
{
IndustryFlightSkills
}
=
flightSkillsApi
;
const
flightApiTypeList
=
[
"licenseId"
,
"flightSkillsId"
];
useEffect
(()
=>
{
useEffect
(()
=>
{
(
async
()
=>
{
(
async
()
=>
{
...
@@ -155,8 +156,8 @@ export default function WaterfallFlowBody() {
...
@@ -155,8 +156,8 @@ export default function WaterfallFlowBody() {
listAllParts
(),
listAllParts
(),
listAllQuality
(),
listAllQuality
(),
]);
]);
let
res3
=
await
Promise
.
all
([
listAllIndustry
(),
listAllAppType
()]);
let
res3
=
await
Promise
.
all
([
IndustryFlightSkills
()]);
let
res4
=
await
Promise
.
all
([
IndustryFlightSkills
()]);
let
res4
=
await
Promise
.
all
([
listAllIndustry
(),
listAllAppType
()]);
// let res4 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
// let res4 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
// let res6 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
// let res6 = await Promise.all([deviceCategory(),deviceBrand(),deviceModel()])
...
@@ -201,16 +202,22 @@ export default function WaterfallFlowBody() {
...
@@ -201,16 +202,22 @@ export default function WaterfallFlowBody() {
const
listValue
:
any
=
[
const
listValue
:
any
=
[
resValuelist1
,
resValuelist1
,
resValuelist2
,
resValuelist2
,
[],
resValuelist3
,
resValuelist3
,
resValuelist4
.
flat
(),
resValuelist4
.
flat
(),
[],
[],
[],
];
];
setMoreEqList
(
res1
.
map
((
item
)
=>
item
.
result
).
flat
());
setMoreEqList
(
res1
.
map
((
item
)
=>
item
.
result
).
flat
());
setLeftDomList
(
setLeftDomList
(
columns
.
map
((
item
,
index
)
=>
{
columns
.
map
((
item
,
index
)
=>
{
return
{
element
:
leftDom
(
item
,
index
,
listValue
)
};
if
(
index
<
3
)
{
console
.
log
(
"路由跳转"
,
index
);
return
{
element
:
leftDom
(
item
,
index
,
listValue
)
,
type
:
"left"
};
}
console
.
log
(
"路由跳转"
,
index
);
return
{
element
:
leftDom
(
item
,
index
,
listValue
)
,
type
:
"right"
};
})
})
);
);
...
@@ -220,6 +227,8 @@ export default function WaterfallFlowBody() {
...
@@ -220,6 +227,8 @@ export default function WaterfallFlowBody() {
},
[]);
},
[]);
const
routerPath
=
(
index
:
number
,
item
?:
AllType
)
=>
{
const
routerPath
=
(
index
:
number
,
item
?:
AllType
)
=>
{
console
.
log
(
index
);
if
(
item
)
{
if
(
item
)
{
router
.
push
({
router
.
push
({
pathname
:
columns
[
index
].
router
,
pathname
:
columns
[
index
].
router
,
...
@@ -260,7 +269,7 @@ export default function WaterfallFlowBody() {
...
@@ -260,7 +269,7 @@ export default function WaterfallFlowBody() {
</
div
>
</
div
>
<
div
className=
"item-body"
>
<
div
className=
"item-body"
>
<
Space
size=
{
[
15
,
0
]
}
wrap
>
<
Space
size=
{
[
15
,
0
]
}
wrap
>
{
index
===
4
{
index
===
2
?
list
.
map
((
item
,
index
)
=>
(
?
list
.
map
((
item
,
index
)
=>
(
<
div
<
div
key=
{
item
}
key=
{
item
}
...
@@ -282,12 +291,12 @@ export default function WaterfallFlowBody() {
...
@@ -282,12 +291,12 @@ export default function WaterfallFlowBody() {
{
item
}
{
item
}
</
div
>
</
div
>
))
))
:
resultList
[
index
].
map
((
item
,
index
)
=>
{
:
resultList
[
index
].
map
((
item
,
index
er
)
=>
{
return
(
return
(
<
div
<
div
key=
{
item
?.
name
||
item
?.
appName
||
item
?.
skillsName
}
key=
{
item
?.
name
||
item
?.
appName
||
item
?.
skillsName
}
className=
{
`item-bubble ${
className=
{
`item-bubble ${
index
=== 0 || index === 1 || index
=== 2
index
er === 0 || indexer === 1 || indexer
=== 2
? "active"
? "active"
: ""
: ""
}`
}
}`
}
...
@@ -380,12 +389,12 @@ export default function WaterfallFlowBody() {
...
@@ -380,12 +389,12 @@ export default function WaterfallFlowBody() {
return
(
return
(
<
Box
>
<
Box
>
<
ContentBox
<
ContentBox
boxIndex=
{
2
}
boxIndex=
{
1
}
//分为左右两列,每列一个,从上而下
leftcontentstyle=
{
{
leftcontentstyle=
{
{
width
:
"806px"
,
width
:
"806px"
,
margin
:
{
top
:
0
,
right
:
"10px"
,
bottom
:
"10px"
,
left
:
0
},
margin
:
{
top
:
0
,
right
:
"10px"
,
bottom
:
"10px"
,
left
:
0
},
}
}
}
}
left
Render
Dom=
{
{
left
Waterfall
Dom=
{
{
columns
:
[
columns
:
[
{
noFor
:
true
,
element
:
<
RotationChart
key=
{
45645645
}
/>
},
{
noFor
:
true
,
element
:
<
RotationChart
key=
{
45645645
}
/>
},
...
leftDomList
,
...
leftDomList
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论