Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
e24a6d20
提交
e24a6d20
authored
5月 19, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into caoyun
上级
b9ff9be8
167aba9b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
97 行增加
和
57 行删除
+97
-57
config.ts
api/config.ts
+7
-3
index.ts
components/filter/api/index.ts
+22
-0
index.tsx
components/filter/compoents/brandItem/index.tsx
+11
-3
index.tsx
components/filter/compoents/categoryItem/index.tsx
+11
-3
index.tsx
components/filter/compoents/modelItem/index.tsx
+11
-3
index.tsx
components/filter/compoents/partItem/index.tsx
+11
-3
index.tsx
components/filter/compoents/qualityItem/index.tsx
+11
-3
index.tsx
components/filter/compoents/regionItem/index.tsx
+1
-0
index.tsx
components/filter/compoents/resultItem/index.tsx
+2
-2
index.tsx
components/filter/index.tsx
+1
-12
next.config.js
next.config.js
+8
-0
_app.page.tsx
pages/_app.page.tsx
+0
-0
_document.page.tsx
pages/_document.page.tsx
+0
-0
icon.png
pages/home/waterfallFlowBody/assets/icon.png
+0
-0
index.tsx
pages/home/waterfallFlowBody/index.tsx
+0
-0
index.page.tsx
pages/mall/index.page.tsx
+0
-24
banner.png
pages/projectInfo/assets/banner.png
+0
-0
index.module.scss
pages/projectInfo/index.module.scss
+1
-1
没有找到文件。
api/config.ts
浏览文件 @
e24a6d20
const
config
=
{
const
dev
=
{
baseUrl
:
''
}
const
prod
=
{
baseUrl
:
'http://120.77.247.178'
}
export
default
config
;
\ No newline at end of file
export
default
process
.
env
.
NODE_ENV
===
'development'
?
dev
:
prod
;
\ No newline at end of file
components/filter/api/index.ts
浏览文件 @
e24a6d20
...
...
@@ -4,6 +4,28 @@ export interface FilterOptionResp {
id
:
number
,
name
:
string
}
export
default
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/category'
);
},
brand
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/brand'
);
},
model
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/model'
);
},
part
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/parts'
);
},
quality
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/quality'
);
},
region
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/getSecondDistrictInfo'
);
},
}
//商城接口
export
const
mallApi
=
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
...
...
components/filter/compoents/brandItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Button
,
Select
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
{
FilterOptionResp
}
from
"../../api"
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useEffect
,
useState
}
from
"react"
;
type
Props
=
{
data
:
Array
<
FilterOptionResp
>
;
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
BrandItem
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([])
useEffect
(()
=>
{
api
.
brand
().
then
(
res
=>
{
setData
(
res
?.
result
||
[]);
});
},
[])
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
...
...
@@ -21,7 +29,7 @@ export default function BrandItem(props: Props) {
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
40
}
>
{
props
?.
data
?
.
map
(
item
=>
{
data
.
map
(
item
=>
{
return
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>;
})
}
...
...
components/filter/compoents/categoryItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Button
,
Select
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
{
FilterOptionResp
}
from
"../../api"
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useState
,
useEffect
}
from
'react'
;
type
Props
=
{
data
:
Array
<
FilterOptionResp
>
;
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
CategoryItem
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([]);
useEffect
(()
=>
{
api
.
category
().
then
((
res
)
=>
{
setData
(
res
?.
result
||
[]);
});
},
[]);
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
...
...
@@ -21,7 +29,7 @@ export default function CategoryItem(props: Props) {
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
40
}
>
{
props
?.
data
?
.
map
(
item
=>
{
data
.
map
(
item
=>
{
return
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>;
})
}
...
...
components/filter/compoents/modelItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Button
,
Select
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
{
FilterOptionResp
}
from
"../../api"
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useEffect
,
useState
}
from
'react'
;
type
Props
=
{
data
:
Array
<
FilterOptionResp
>
;
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
ModelItem
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([]);
useEffect
(()
=>
{
api
.
model
().
then
((
res
)
=>
{
setData
(
res
?.
result
||
[]);
});
},
[]);
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
...
...
@@ -21,7 +29,7 @@ export default function ModelItem(props: Props) {
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
40
}
>
{
props
?.
data
?.
map
(
item
=>
{
data
?.
map
(
item
=>
{
return
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
</
Button
>;
})
}
...
...
components/filter/compoents/partItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Button
,
Select
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
{
FilterOptionResp
}
from
"../../api"
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useState
,
useEffect
}
from
'react'
;
type
Props
=
{
data
:
Array
<
FilterOptionResp
>
;
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
PartItem
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([]);
useEffect
(()
=>
{
api
.
part
().
then
((
res
)
=>
{
setData
(
res
?.
result
||
[]);
});
},
[]);
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
...
...
@@ -20,7 +28,7 @@ export default function PartItem(props: Props) {
<
div
className=
{
styles
.
filterItemTitle
}
>
部件:
</
div
>
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
40
}
>
{
props
?.
data
?.
map
((
item
)
=>
{
{
data
?.
map
((
item
)
=>
{
return
(
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
...
...
components/filter/compoents/qualityItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Button
,
Select
}
from
'antd'
;
import
styles
from
'../../index.module.scss'
;
import
{
FilterOptionResp
}
from
"../../api"
;
import
api
,
{
FilterOptionResp
}
from
"../../api"
;
import
{
useState
,
useEffect
}
from
'react'
;
type
Props
=
{
data
:
Array
<
FilterOptionResp
>
;
onChange
:
(
id
:
FilterOptionResp
)
=>
void
;
};
export
default
function
QualityItem
(
props
:
Props
)
{
const
[
data
,
setData
]
=
useState
<
FilterOptionResp
[]
>
([]);
useEffect
(()
=>
{
api
.
quality
().
then
((
res
)
=>
{
setData
(
res
?.
result
||
[]);
});
},
[]);
const
onClick
=
(
item
:
FilterOptionResp
)
=>
{
props
.
onChange
({
id
:
item
.
id
,
...
...
@@ -20,7 +28,7 @@ export default function QualityItem(props: Props) {
<
div
className=
{
styles
.
filterItemTitle
}
>
成色:
</
div
>
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
40
}
>
{
props
?.
data
?.
map
((
item
)
=>
{
{
data
?.
map
((
item
)
=>
{
return
(
<
Button
type=
"link"
key=
{
item
.
id
}
onClick=
{
(
e
)
=>
onClick
(
item
)
}
>
{
item
.
name
}
...
...
components/filter/compoents/regionItem/index.tsx
浏览文件 @
e24a6d20
import
{
Space
,
Select
}
from
'antd'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
styles
from
'../../index.module.scss'
;
import
api
from
'../../api'
;
export
default
function
RegionItem
(){
const
[
productList
,
setProductList
]
=
useState
(
Array
<
{}
>
);
...
...
components/filter/compoents/resultItem/index.tsx
浏览文件 @
e24a6d20
...
...
@@ -13,7 +13,7 @@ export default function ResultItem({data, onDel}: Props) {
<
div
className=
{
styles
.
filterItemMain
}
>
<
Space
size=
{
10
}
>
{
data
&&
Object
.
keys
(
data
).
map
((
key
,
i
)
=>
{
Object
.
keys
(
data
).
map
((
key
)
=>
{
//@ts-ignore
let
item
=
data
[
key
];
return
(
...
...
@@ -22,7 +22,7 @@ export default function ResultItem({data, onDel}: Props) {
onClose=
{
(
e
:
React
.
MouseEvent
<
HTMLElement
,
MouseEvent
>
)
=>
{
onDel
(
key
);
}
}
key=
{
i
}
key=
{
key
}
>
{
item
?.
name
}
</
Tag
>
...
...
components/filter/index.tsx
浏览文件 @
e24a6d20
...
...
@@ -16,14 +16,8 @@ export type FilterResult = {
type
itemType
=
"类目"
|
"地域"
|
"品牌"
|
"部件"
|
"型号"
|
"成色"
;
type
Props
=
{
types
:
[
itemType
,
itemType
,
itemType
,
itemType
,
itemType
,
itemType
];
//需要包含的筛选条件项
types
:
itemType
[];
//需要包含的筛选条件项
showResultItem
:
Boolean
;
//显示结果栏
categoryData
?:
Array
<
FilterOptionResp
>
;
regionData
?:
Array
<
FilterOptionResp
>
;
brandData
?:
Array
<
FilterOptionResp
>
;
modelData
?:
Array
<
FilterOptionResp
>
;
partData
?:
Array
<
FilterOptionResp
>
;
qualityData
?:
Array
<
FilterOptionResp
>
;
onChange
:
(
filterResult
:
FilterResult
)
=>
void
;
//筛选条件更改事件
};
export
default
function
Filter
(
props
:
Props
)
{
...
...
@@ -59,31 +53,26 @@ export default function Filter(props: Props) {
<
div
className=
{
styles
.
filterWrap
}
>
{
props
.
types
.
includes
(
"品牌"
)
&&
(
<
BrandItem
data=
{
props
.
brandData
||
[]
}
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"brand"
)
}
></
BrandItem
>
)
}
{
props
.
types
.
includes
(
"类目"
)
&&
(
<
CategoryItem
data=
{
props
.
categoryData
||
[]
}
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"category"
)
}
></
CategoryItem
>
)
}
{
props
.
types
.
includes
(
"部件"
)
&&
(
<
PartItem
data=
{
props
.
partData
||
[]
}
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"part"
)
}
></
PartItem
>
)
}
{
props
.
types
.
includes
(
"型号"
)
&&
(
<
ModelItem
data=
{
props
.
modelData
||
[]
}
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"model"
)
}
></
ModelItem
>
)
}
{
props
.
types
.
includes
(
"成色"
)
&&
(
<
QualityItem
data=
{
props
.
qualityData
||
[]
}
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"quality"
)
}
></
QualityItem
>
)
}
...
...
next.config.js
浏览文件 @
e24a6d20
...
...
@@ -11,6 +11,14 @@ const nextConfig = {
},
];
},
async
rewrites
()
{
return
[
{
source
:
"/pms/:path*"
,
destination
:
"http://120.77.247.178/pms/:path*"
,
},
];
},
pageExtensions
:
[
"page.tsx"
,
"page.ts"
,
"page.jsx"
,
"page.js"
],
};
...
...
pages/_app.tsx
→
pages/_app.
page.
tsx
浏览文件 @
e24a6d20
File moved
pages/_document.tsx
→
pages/_document.
page.
tsx
浏览文件 @
e24a6d20
File moved
pages/home/waterfallFlowBody/assets/icon.png
0 → 100644
浏览文件 @
e24a6d20
2.1 KB
pages/home/waterfallFlowBody/index.tsx
浏览文件 @
e24a6d20
差异被折叠。
点击展开。
pages/mall/index.page.tsx
浏览文件 @
e24a6d20
...
...
@@ -9,32 +9,13 @@ import { FilterOptionResp, mallApi } from "~/components/filter/api";
// 此函数在构建时被调用
export
async
function
getServerSideProps
()
{
//获取筛选数据,进行静态渲染
const
brand
=
Filter
.
mallApi
.
brand
();
const
category
=
Filter
.
mallApi
.
category
();
const
model
=
Filter
.
mallApi
.
model
();
const
part
=
Filter
.
mallApi
.
part
();
const
quality
=
Filter
.
mallApi
.
quality
();
const
res
=
await
Promise
.
all
([
brand
,
category
,
part
,
model
,
quality
]);
return
{
props
:
{
brandData
:
res
[
0
].
result
||
[],
categoryData
:
res
[
1
].
result
||
[],
partData
:
res
[
2
].
result
||
[],
modelData
:
res
[
3
].
result
||
[],
qualityData
:
res
[
4
].
result
||
[],
},
};
}
type
Props
=
{
brandData
:
Array
<
FilterOptionResp
>
;
categoryData
:
Array
<
FilterOptionResp
>
;
partData
:
Array
<
FilterOptionResp
>
;
modelData
:
Array
<
FilterOptionResp
>
;
qualityData
:
Array
<
FilterOptionResp
>
;
};
export
default
function
Mall
(
props
:
Props
)
{
...
...
@@ -49,11 +30,6 @@ export default function Mall(props: Props) {
<
Filter
types=
{
[
"类目"
,
"地域"
,
"品牌"
,
"部件"
,
"型号"
,
"成色"
]
}
showResultItem
brandData=
{
props
.
brandData
}
categoryData=
{
props
.
categoryData
}
partData=
{
props
.
partData
}
modelData=
{
props
.
modelData
}
qualityData=
{
props
.
qualityData
}
onChange=
{
onFilterChange
}
></
Filter
>
<
div
className=
{
styles
.
productList
}
>
...
...
pages/projectInfo/assets/banner.png
查看替换文件 @
b9ff9be8
浏览文件 @
e24a6d20
91.2 KB
|
W:
|
H:
83.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
pages/projectInfo/index.module.scss
浏览文件 @
e24a6d20
.bannerWrap
{
height
:
1
8
0px
;
height
:
1
6
0px
;
position
:
relative
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论