Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
340ee2a5
提交
340ee2a5
authored
1月 16, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化:问题修复
上级
07a53563
流水线
#8028
已通过 于阶段
in 1 分 14 秒
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
19 行删除
+31
-19
index.tsx
src/pages/orderManage/demandOrder/orderList/index.tsx
+31
-19
没有找到文件。
src/pages/orderManage/demandOrder/orderList/index.tsx
浏览文件 @
340ee2a5
...
@@ -2,7 +2,7 @@ import SearchBox from '~/components/search-box';
...
@@ -2,7 +2,7 @@ import SearchBox from '~/components/search-box';
import
{
searchColumns
as
searchColumnsType
}
from
'~/components/search-box'
;
import
{
searchColumns
as
searchColumnsType
}
from
'~/components/search-box'
;
import
{
Button
,
Table
,
Tag
}
from
'antd'
;
import
{
Button
,
Table
,
Tag
}
from
'antd'
;
import
{
ColumnsType
}
from
'antd/es/table/InternalTable'
;
import
{
ColumnsType
}
from
'antd/es/table/InternalTable'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
createRef
,
useEffect
,
useState
}
from
'react'
;
import
{
useLocation
,
useNavigate
}
from
'react-router-dom'
;
import
{
useLocation
,
useNavigate
}
from
'react-router-dom'
;
import
{
OrderManageAPI
}
from
'~/api'
;
import
{
OrderManageAPI
}
from
'~/api'
;
import
{
InterDataType
,
InterListType
,
PaginationProps
}
from
'~/api/interface'
;
import
{
InterDataType
,
InterListType
,
PaginationProps
}
from
'~/api/interface'
;
...
@@ -21,22 +21,31 @@ const DemandOrderList = () => {
...
@@ -21,22 +21,31 @@ const DemandOrderList = () => {
// 表格数据
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
demandOrderListType
>
([]);
const
[
tableData
,
setTableData
]
=
useState
<
demandOrderListType
>
([]);
// 翻页数据
// 翻页数据
const
[
pagination
,
setPagination
]
=
useState
<
PaginationProps
&
{
totalCount
:
number
}
>
({
const
[
pagination
,
setPagination
]
=
useState
<
Array
<
PaginationProps
&
{
totalCount
:
number
}
>>
([
pageNo
:
1
,
{
pageSize
:
10
,
pageNo
:
1
,
totalCount
:
0
,
pageSize
:
10
,
});
totalCount
:
0
,
},
{
pageNo
:
1
,
pageSize
:
10
,
totalCount
:
0
,
},
]);
// 搜索数据
// 搜索数据
const
[
query
,
setQuery
]
=
useState
<
demandOrderListParameterType
>
();
const
[
query
,
setQuery
]
=
useState
<
demandOrderListParameterType
>
();
// 订单状态列表
// 订单状态列表
const
[
orderStatusList
,
setOrderStatusList
]
=
useState
<
{
label
:
string
;
value
:
string
}[]
>
([]);
const
[
orderStatusList
,
setOrderStatusList
]
=
useState
<
{
label
:
string
;
value
:
string
}[]
>
([]);
// 刷新子组件
// 刷新子组件
// const [refresh, setRefresh] = useState<boolean>(true);
// const [refresh, setRefresh] = useState<boolean>(true);
// 是否是派单
const
isPilotOrder
=
Number
(
location
?.
pathname
?.
split
(
'/'
)?.
at
(
-
1
));
// 获取需求订单列表
// 获取需求订单列表
const
getServiceOrderFormList
=
(
query
?:
demandOrderListParameterType
)
=>
{
const
getServiceOrderFormList
=
(
query
?:
demandOrderListParameterType
)
=>
{
OrderManageAPI
.
getServiceOrderFormList
({
OrderManageAPI
.
getServiceOrderFormList
({
pageNo
:
pagination
.
pageNo
,
pageNo
:
pagination
[
isPilotOrder
]
.
pageNo
,
pageSize
:
pagination
.
pageSize
,
pageSize
:
pagination
[
isPilotOrder
]
.
pageSize
,
isPilotOrder
:
Number
(
location
?.
pathname
?.
split
(
'/'
)?.
at
(
-
1
)),
isPilotOrder
:
Number
(
location
?.
pathname
?.
split
(
'/'
)?.
at
(
-
1
)),
...
query
,
...
query
,
}).
then
(({
result
})
=>
{
}).
then
(({
result
})
=>
{
...
@@ -45,7 +54,7 @@ const DemandOrderList = () => {
...
@@ -45,7 +54,7 @@ const DemandOrderList = () => {
childrenRequire
:
i
.
childrenRequire
?.
length
?
i
.
childrenRequire
:
undefined
,
childrenRequire
:
i
.
childrenRequire
?.
length
?
i
.
childrenRequire
:
undefined
,
}));
}));
setTableData
(
list
);
setTableData
(
list
);
pagination
.
totalCount
=
result
.
totalCount
;
pagination
[
isPilotOrder
]
.
totalCount
=
result
.
totalCount
;
setPagination
({
...
pagination
});
setPagination
({
...
pagination
});
});
});
};
};
...
@@ -55,15 +64,15 @@ const DemandOrderList = () => {
...
@@ -55,15 +64,15 @@ const DemandOrderList = () => {
};
};
//分页
//分页
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
pagination
.
pageNo
=
pageNo
;
pagination
[
isPilotOrder
]
.
pageNo
=
pageNo
;
pagination
.
pageSize
=
pageSize
;
pagination
[
isPilotOrder
]
.
pageSize
=
pageSize
;
getServiceOrderFormList
(
query
);
getServiceOrderFormList
(
query
);
};
};
// 筛选成功事件
// 筛选成功事件
const
searchSuccessEvent
=
(
value
:
any
)
=>
{
const
searchSuccessEvent
=
(
value
:
any
)
=>
{
setQuery
(
value
);
setQuery
(
value
);
pagination
.
pageNo
=
1
;
pagination
[
isPilotOrder
]
.
pageNo
=
1
;
pagination
.
pageSize
=
10
;
pagination
[
isPilotOrder
]
.
pageSize
=
10
;
getServiceOrderFormList
(
value
);
getServiceOrderFormList
(
value
);
};
};
// 获取订单进度条字典
// 获取订单进度条字典
...
@@ -77,16 +86,19 @@ const DemandOrderList = () => {
...
@@ -77,16 +86,19 @@ const DemandOrderList = () => {
);
);
}
}
};
};
// 创建子组件实例
const
SearchBoxRef
=
createRef
<
any
>
();
// 组件挂载
// 组件挂载
useEffect
(()
=>
{
useEffect
(()
=>
{
// 还原列表
// 还原列表
setTableData
([]);
setTableData
([]);
setQuery
(
undefined
);
SearchBoxRef
.
current
.
handleRestForm
();
// 还原分页
// 还原分页
setPagination
({
pageNo
:
1
,
pageSize
:
10
,
totalCount
:
0
});
//
setPagination({ pageNo: 1, pageSize: 10, totalCount: 0 });
// 获取数据
// 获取数据
getFlowDictionary
().
then
();
getFlowDictionary
().
then
();
getServiceOrderFormList
();
getServiceOrderFormList
();
// console.log('组件挂载 --->', );
},
[
location
]);
},
[
location
]);
const
searchColumns
:
searchColumnsType
[]
=
[
const
searchColumns
:
searchColumnsType
[]
=
[
{
{
...
@@ -226,7 +238,7 @@ const DemandOrderList = () => {
...
@@ -226,7 +238,7 @@ const DemandOrderList = () => {
];
];
return
(
return
(
<
div
className=
'demand-order'
>
<
div
className=
'demand-order'
>
<
SearchBox
search=
{
searchColumns
}
searchData=
{
searchSuccessEvent
}
/>
<
SearchBox
search=
{
searchColumns
}
searchData=
{
searchSuccessEvent
}
onRef=
{
SearchBoxRef
}
/>
<
Table
<
Table
columns=
{
tableColumns
}
columns=
{
tableColumns
}
bordered
bordered
...
@@ -238,9 +250,9 @@ const DemandOrderList = () => {
...
@@ -238,9 +250,9 @@ const DemandOrderList = () => {
}
}
}
}
scroll=
{
{
x
:
1000
}
}
scroll=
{
{
x
:
1000
}
}
pagination=
{
{
pagination=
{
{
total
:
pagination
.
totalCount
,
total
:
pagination
[
isPilotOrder
]
.
totalCount
,
pageSize
:
pagination
.
pageSize
,
pageSize
:
pagination
[
isPilotOrder
]
.
pageSize
,
current
:
pagination
.
pageNo
,
current
:
pagination
[
isPilotOrder
]
.
pageNo
,
showSizeChanger
:
true
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
showQuickJumper
:
true
,
onChange
:
(
page
:
number
,
pageSize
:
number
)
=>
paginationChange
(
page
,
pageSize
),
onChange
:
(
page
:
number
,
pageSize
:
number
)
=>
paginationChange
(
page
,
pageSize
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论