Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
3b483aff
提交
3b483aff
authored
1月 25, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:飞手列表
上级
95978296
流水线
#8130
已通过 于阶段
in 5 分 40 秒
变更
4
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
222 行增加
和
4 行删除
+222
-4
index.tsx
src/components/SearchBox/index.tsx
+147
-0
tabView05.tsx
src/components/home-comp/home-tab/comp/tabView05.tsx
+57
-4
index.tsx
src/pages/flyer/index.tsx
+17
-0
tailwind.config.js
tailwind.config.js
+1
-0
没有找到文件。
src/components/SearchBox/index.tsx
0 → 100644
浏览文件 @
3b483aff
import
React
from
'react'
;
import
{
ReloadOutlined
,
SearchOutlined
}
from
'@ant-design/icons'
;
import
{
App
,
Button
,
Form
,
Input
,
InputProps
,
Select
,
SelectProps
,
Space
,
}
from
'antd'
;
import
styled
from
'styled-components'
;
// 搜索类型
export
type
SearchColumns
=
{
type
:
'Input'
|
'Select'
;
label
?:
string
;
name
:
string
;
placeholder
:
string
;
maxlength
?:
number
;
width
?:
number
;
disable
?:
boolean
;
required
?:
boolean
;
options
?:
{
value
?:
any
;
label
?:
string
;
children
?:
{
value
?:
any
;
label
?:
string
;
children
?:
any
}[];
}[];
onSelect
?:
(
e
:
SelectProps
[
'onSelect'
])
=>
void
;
onChange
?:
(
e
:
InputProps
[
'onChange'
])
=>
void
;
};
// 组件传参
type
PropsType
=
{
columns
?:
SearchColumns
[];
onSearch
?:
(
e
:
any
)
=>
void
;
preFixChild
?:
React
.
ReactNode
;
sufFixChild
?:
React
.
ReactNode
;
children
?:
React
.
ReactNode
;
isReset
?:
boolean
;
isSearch
?:
boolean
;
initialValues
?:
any
;
// onRef?: any;
};
const
SearchBoxView
:
React
.
FC
<
PropsType
>
=
({
columns
,
initialValues
,
onSearch
,
isReset
=
true
,
isSearch
=
true
,
sufFixChild
,
})
=>
{
// app
const
{
message
}
=
App
.
useApp
();
// 表单钩子
const
[
formRef
]
=
Form
.
useForm
();
// 提交数据
const
handleSubmit
=
async
()
=>
{
const
values
=
await
formRef
.
validateFields
().
catch
((
e
)
=>
{
const
item
=
e
.
errorFields
?.[
0
];
message
.
warning
(
item
?.
errors
?.[
0
]);
});
if
(
!
values
)
return
;
onSearch
?.(
values
);
};
return
(
<
SearchBoxWrap
>
<
Form
form=
{
formRef
}
name=
"formRef"
// labelCol={{ span: 8 }}
// wrapperCol={{ span: 16 }}
style=
{
{
width
:
'100%'
}
}
initialValues=
{
initialValues
}
layout=
{
'inline'
}
// onFinish={handleFinish}
autoComplete=
"off"
// onChange={handleChange}
>
{
columns
?.
map
((
i
,
j
)
=>
(
<
Form
.
Item
label=
{
i
?.
label
}
name=
{
i
?.
name
}
key=
{
j
}
rules=
{
[
{
required
:
i
?.
required
||
false
,
message
:
i
?.
label
?
`请输入${i?.label}`
:
i
?.
placeholder
,
},
]
}
>
{
i
?.
type
===
'Input'
&&
(
<
Input
placeholder=
{
i
?.
placeholder
}
maxLength=
{
i
?.
maxlength
||
20
}
style=
{
{
width
:
i
?.
width
||
'200px'
}
}
disabled=
{
i
?.
disable
}
allowClear
/>
)
}
{
i
?.
type
===
'Select'
&&
(
<
Select
placeholder=
{
i
?.
placeholder
}
style=
{
{
width
:
i
?.
width
||
'200px'
}
}
disabled=
{
i
?.
disable
}
onSelect=
{
i
?.
onSelect
}
options=
{
i
?.
options
||
[]
}
allowClear
/>
)
}
</
Form
.
Item
>
))
}
<
Form
.
Item
>
<
Space
>
{
isSearch
&&
(
<
Button
type=
"primary"
icon=
{
<
SearchOutlined
/>
}
onClick=
{
handleSubmit
}
>
搜索
</
Button
>
)
}
{
isReset
&&
(
<
Button
type=
"default"
icon=
{
<
ReloadOutlined
/>
}
>
重置
</
Button
>
)
}
</
Space
>
</
Form
.
Item
>
</
Form
>
{
sufFixChild
&&
<
div
className=
"suf-fix-child"
>
{
sufFixChild
}
</
div
>
}
</
SearchBoxWrap
>
);
};
export
default
SearchBoxView
;
// 样式
const
SearchBoxWrap
=
styled
.
div
`
position: relative;
width: 100%;
box-sizing: border-box;
display: flex;
justify-content: flex-start;
align-items: flex-start;
`
;
src/components/home-comp/home-tab/comp/tabView05.tsx
浏览文件 @
3b483aff
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
RightOutlined
}
from
'@ant-design/icons'
;
import
{
RightOutlined
}
from
'@ant-design/icons'
;
import
{
Pagination
,
Rate
}
from
'antd'
;
import
{
Button
,
Pagination
,
Rate
}
from
'antd'
;
import
{
useRouter
}
from
'next/router'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterListType
,
InterReqType
}
from
'@/api/interface'
;
import
{
InterListType
,
InterReqType
}
from
'@/api/interface'
;
import
{
AppListPilotType
}
from
'@/api/interface/home'
;
import
{
AppListPilotType
}
from
'@/api/interface/home'
;
import
SearchBoxView
,
{
SearchColumns
}
from
'@/components/SearchBox'
;
// 列表类型
// 列表类型
type
ListType
=
InterListType
<
AppListPilotType
>
;
type
ListType
=
InterListType
<
AppListPilotType
>
;
...
@@ -12,12 +14,14 @@ type ListType = InterListType<AppListPilotType>;
...
@@ -12,12 +14,14 @@ type ListType = InterListType<AppListPilotType>;
type
ReqType
=
InterReqType
<
AppListPilotType
>
;
type
ReqType
=
InterReqType
<
AppListPilotType
>
;
const
TabView05
=
()
=>
{
const
TabView05
=
()
=>
{
// 路由钩子
const
router
=
useRouter
();
// 飞手列表
// 飞手列表
const
[
flyerList
,
setFlyerList
]
=
useState
<
ListType
>
([]);
const
[
flyerList
,
setFlyerList
]
=
useState
<
ListType
>
([]);
// 分页数据
// 分页数据
const
[
pagination
,
setPagination
]
=
useState
({
const
[
pagination
,
setPagination
]
=
useState
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
8
,
pageSize
:
6
,
totalPage
:
0
,
totalPage
:
0
,
totalCount
:
0
,
totalCount
:
0
,
});
});
...
@@ -42,12 +46,56 @@ const TabView05 = () => {
...
@@ -42,12 +46,56 @@ const TabView05 = () => {
// console.log('列表数据 --->', list, pageNo, totalPage);
// console.log('列表数据 --->', list, pageNo, totalPage);
}
}
};
};
// 跳转列表
const
handleMore
=
async
()
=>
{
await
router
.
push
(
'/flyer'
);
};
// 组件挂载
// 组件挂载
useEffect
(()
=>
{
useEffect
(()
=>
{
getFlyerList
().
then
();
getFlyerList
().
then
();
},
[]);
},
[]);
// 搜索列数据
const
searchColumns
:
SearchColumns
[]
=
[
{
type
:
'Input'
,
// label: '飞手姓名',
name
:
'userName'
,
placeholder
:
'请输入飞手姓名'
,
maxlength
:
20
,
width
:
120
,
},
{
type
:
'Select'
,
// label: '任务能力',
name
:
'auditStatus'
,
placeholder
:
'请选择任务能力'
,
width
:
120
,
options
:
[
{
value
:
1
,
label
:
'空闲'
,
},
{
value
:
2
,
label
:
'忙碌'
,
},
],
},
];
return
(
return
(
<
TabViewWrap
className=
{
'animate__animated animate__fast animate__fadeIn'
}
>
<
TabViewWrap
className=
{
'animate__animated animate__fast animate__fadeIn'
}
>
{
/* 搜索组件 */
}
<
SearchBoxView
columns=
{
searchColumns
}
sufFixChild=
{
<
div
className=
"flex"
onClick=
{
handleMore
}
>
<
Button
type=
{
'link'
}
className=
"px-0"
>
更多
</
Button
>
<
RightOutlined
className=
"text-primary"
/>
</
div
>
}
/>
<
div
className=
"tab-title flex-between"
>
<
div
className=
"tab-title flex-between"
>
<
div
className=
"title-name"
>
飞手约单
</
div
>
<
div
className=
"title-name"
>
飞手约单
</
div
>
</
div
>
</
div
>
...
@@ -133,10 +181,12 @@ const TabViewWrap = styled.div`
...
@@ -133,10 +181,12 @@ const TabViewWrap = styled.div`
position: relative;
position: relative;
width: 100%;
width: 100%;
flex-wrap: wrap;
flex-wrap: wrap;
margin-top: 0.5rem;
.list-item {
.list-item {
position: relative;
position: relative;
box-sizing: border-box;
box-sizing: border-box;
width: 14.13rem;
width: calc(50% - 1rem);
//width: 14.13rem;
min-height: 5.54rem;
min-height: 5.54rem;
background: #ffffff;
background: #ffffff;
border-radius: 0.25rem;
border-radius: 0.25rem;
...
@@ -162,6 +212,7 @@ const TabViewWrap = styled.div`
...
@@ -162,6 +212,7 @@ const TabViewWrap = styled.div`
}
}
.head-content {
.head-content {
position: relative;
position: relative;
width: calc(100% - 4rem);
.content-title {
.content-title {
align-items: baseline;
align-items: baseline;
margin-bottom: 0.2rem;
margin-bottom: 0.2rem;
...
@@ -186,6 +237,7 @@ const TabViewWrap = styled.div`
...
@@ -186,6 +237,7 @@ const TabViewWrap = styled.div`
.content-tag {
.content-tag {
flex-wrap: wrap;
flex-wrap: wrap;
margin-bottom: 0.33rem;
margin-bottom: 0.33rem;
min-height: 0.79rem;
.tag-item {
.tag-item {
min-width: 2.42rem;
min-width: 2.42rem;
height: 0.79rem;
height: 0.79rem;
...
@@ -204,7 +256,8 @@ const TabViewWrap = styled.div`
...
@@ -204,7 +256,8 @@ const TabViewWrap = styled.div`
content: '';
content: '';
bottom: 0;
bottom: 0;
left: 0;
left: 0;
width: 8.21rem;
width: 100%;
//width: 8.21rem;
height: 0.02rem;
height: 0.02rem;
background: #dedede;
background: #dedede;
}
}
...
...
src/pages/flyer/index.tsx
0 → 100644
浏览文件 @
3b483aff
import
React
from
'react'
;
import
styled
from
'styled-components'
;
import
LayoutView
from
'@/components/layout'
;
const
FlyerPageView
=
()
=>
{
return
(
<
LayoutView
>
<
FlyerPageWrap
>
<
div
>
FlyerPageWrap
</
div
>
</
FlyerPageWrap
>
</
LayoutView
>
);
};
export
default
FlyerPageView
;
// 样式
const
FlyerPageWrap
=
styled
.
div
``
;
tailwind.config.js
浏览文件 @
3b483aff
...
@@ -22,6 +22,7 @@ module.exports = {
...
@@ -22,6 +22,7 @@ module.exports = {
999
:
'#999'
,
999
:
'#999'
,
aaa
:
'#aaa'
,
aaa
:
'#aaa'
,
tag
:
'#001D85'
,
tag
:
'#001D85'
,
primary
:
'#ff552d'
,
},
},
},
},
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论