Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
20fcdd58
提交
20fcdd58
authored
6月 01, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.mmcuav.cn:8222/root/sharefly-web-nextjs
into caoyun
上级
f6a00f1c
1bfb0609
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
84 行增加
和
8 行删除
+84
-8
index.ts
components/filter/api/index.ts
+3
-0
index.tsx
components/filter/compoents/category/index.tsx
+72
-0
index.tsx
components/filter/index.tsx
+3
-2
index.ts
pages/home/waterfallFlowBody/api/index.ts
+3
-3
index.tsx
pages/home/waterfallFlowBody/index.tsx
+3
-3
没有找到文件。
components/filter/api/index.ts
浏览文件 @
20fcdd58
...
...
@@ -18,6 +18,9 @@ export default {
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webProductMall/category"
);
},
categoryId
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webDevice/category"
);
},
brand
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webDevice/brand"
);
},
...
...
components/filter/compoents/category/index.tsx
0 → 100644
浏览文件 @
20fcdd58
import
{
Space
,
Button
,
Select
,
Collapse
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useState
,
useEffect
}
from
'react'
;
type
Props
=
{
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
Category
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([]);
useEffect
(()
=>
{
api
.
categoryId
().
then
((
res
)
=>
{
setData
(
res
?.
result
||
[]);
});
},
[]);
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
name
:
"类目:"
+
item
.
name
,
});
};
return
(
<
div
className=
{
styles
.
filterItem
}
>
<
div
className=
{
styles
.
filterItemTitle
}
>
类目:
</
div
>
<
div
className=
{
`${styles.filterItemMain} ${
data.length <= 10 && styles.disabled
}`
}
>
<
Collapse
ghost
collapsible=
"icon"
expandIconPosition=
"end"
>
<
Collapse
.
Panel
header=
{
<
Space
size=
{
40
}
>
{
data
.
slice
(
0
,
10
).
map
((
item
)
=>
{
return
(
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>
);
})
}
</
Space
>
}
key=
"1"
>
<
Space
size=
{
40
}
>
{
data
.
slice
(
10
).
map
((
item
)
=>
{
return
(
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>
);
})
}
</
Space
>
</
Collapse
.
Panel
>
</
Collapse
>
</
div
>
</
div
>
);
}
\ No newline at end of file
components/filter/index.tsx
浏览文件 @
20fcdd58
import
CategoryItem
from
"./compoents/categoryItem"
;
import
Category
from
"./compoents/category"
;
import
{
FilterOptionResp
,
RegionResp
}
from
"./api"
;
import
ResultItem
from
"./compoents/resultItem"
;
import
RegionItem
from
"./compoents/regionItem"
;
...
...
@@ -207,9 +208,9 @@ const Filter = (props: Props, ref: Ref<any>) => {
></
CategoryItem
>
)
}
{
props
.
types
.
includes
(
"设备类目"
)
&&
(
<
Category
Item
<
Category
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"categoryId"
)
}
></
Category
Item
>
></
Category
>
)
}
{
props
.
types
.
includes
(
"部件"
)
&&
(
<
PartItem
...
...
pages/home/waterfallFlowBody/api/index.ts
浏览文件 @
20fcdd58
...
...
@@ -42,12 +42,12 @@ export interface RegionResp {
}
export
const
equipmentLeasingApi
=
{
deviceCategory
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webProductMall/category"
);
},
deviceBrand
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webDevice/deviceBrand"
);
},
deviceCategory
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webDevice/category"
);
},
deviceModel
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
"/pms/webDevice/deviceModel"
);
},
...
...
pages/home/waterfallFlowBody/index.tsx
浏览文件 @
20fcdd58
...
...
@@ -109,8 +109,8 @@ export default function WaterfallFlowBody() {
const
[
rightTopDomList
,
setRightTopDomList
]
=
useState
<
JSX
.
Element
>
();
const
[
rightBottomDomList
,
setRightBottomDomList
]
=
useState
<
JSX
.
Element
>
();
const
{
device
Category
,
deviceBrand
,
deviceModel
}
=
equipmentLeasingApi
;
const
eqApiTypeList
=
[
"
categoryId"
,
"brand
Id"
,
"modelId"
];
const
{
device
Brand
,
deviceCategory
,
deviceModel
}
=
equipmentLeasingApi
;
const
eqApiTypeList
=
[
"
brandId"
,
"category
Id"
,
"modelId"
];
const
{
listAllModel
,
listAllBrand
,
listAllCategory
,
listAllParts
,
listAllQuality
}
=
mallApi
;
const
mallApiTypeList
=
[
...
...
@@ -138,8 +138,8 @@ export default function WaterfallFlowBody() {
useEffect
(()
=>
{
(
async
()
=>
{
let
res1
=
await
Promise
.
all
([
deviceCategory
(),
deviceBrand
(),
deviceCategory
(),
deviceModel
(),
]);
let
res2
=
await
Promise
.
all
([
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论