Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
1d511bc6
提交
1d511bc6
authored
7月 11, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
5b484f05
02c6aa83
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
9 行删除
+30
-9
index.tsx
components/filter/compoents/typeInfo/index.tsx
+26
-6
index.tsx
components/filter/index.tsx
+2
-1
next.config.js
next.config.js
+2
-2
没有找到文件。
components/filter/compoents/typeInfo/index.tsx
浏览文件 @
1d511bc6
...
...
@@ -46,7 +46,7 @@ export default function CategoryItem(props: Props) {
});
};
const
showCount
=
9
;
// 展示数量
const
showCount
=
10
;
// 展示数量
return
(
<
div
className=
{
styles
.
filterItem
}
>
...
...
@@ -87,12 +87,32 @@ export default function CategoryItem(props: Props) {
}
key=
'1'
>
<
Space
size=
{
40
}
>
{
data
.
slice
(
showCount
).
map
((
item
)
=>
{
<
Space
size=
{
[
10
,
0
]
}
wrap
>
{
data
.
slice
(
showCount
).
map
((
item
,
index
)
=>
{
return
(
<
Button
type=
'link'
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>
<
div
key=
{
item
.
id
}
className=
{
`${styles.filterItemContent} ${
props.currentItemIndex === index ? styles.filterItemContentHover : ''
}`
}
onMouseEnter=
{
()
=>
onMouseEnter
(
item
,
index
)
}
onMouseLeave=
{
props
.
categoryMouseLeave
}
>
<
Button
type=
'link'
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>
{
item
.
children
?
(
<
Image
src=
{
downArrowImg
}
className=
{
styles
.
filterItemIcon
}
width=
{
14
}
height=
{
14
}
alt=
'展开图标'
/>
)
:
(
''
)
}
</
div
>
);
})
}
</
Space
>
...
...
components/filter/index.tsx
浏览文件 @
1d511bc6
...
...
@@ -42,7 +42,7 @@ const Filter = (props: Props, ref: Ref<any>) => {
const
data
:
{
[
key
:
string
]:
FilterOptionResp
[]
|
FilterOptionResp
}
=
{};
if
(
type
===
'categoryId'
)
{
if
(
result
.
categoryId
)
{
data
[
type
]
=
[
...
result
.
categoryId
,
item
];
data
[
type
]
=
[
item
,
...
result
.
categoryId
];
const
map
=
new
Map
();
// 去重
data
[
type
]
=
(
data
[
type
]
as
InfoList
[]).
filter
((
v
)
=>
!
map
.
has
(
v
.
id
)
&&
map
.
set
(
v
.
id
,
1
));
...
...
@@ -133,6 +133,7 @@ const Filter = (props: Props, ref: Ref<any>) => {
if
(
obj
?.
children
)
{
obj
.
children
=
obj
.
children
.
filter
((
item
:
FilterOptionResp
)
=>
item
.
id
===
v
.
id
);
obj
.
name
+=
`/
${
v
.
name
}
`
;
console
.
log
(
'选中数据-->'
,
obj
);
onChange
(
obj
,
'categoryId'
);
}
};
...
...
next.config.js
浏览文件 @
1d511bc6
...
...
@@ -27,8 +27,8 @@ const nextConfig = {
return
[
{
source
:
'/local/:path*'
,
//
destination: 'https://www.iuav.shop/:path*',
destination
:
'https://test.iuav.shop/:path*'
,
destination
:
'https://www.iuav.shop/:path*'
,
//
destination: 'https://test.iuav.shop/:path*',
},
];
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论