Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
3220f9f3
提交
3220f9f3
authored
6月 02, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:onSelect改为onClick
上级
db0faf09
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
193 行增加
和
13 行删除
+193
-13
App.scss
src/assets/style/App.scss
+25
-1
index.tsx
src/components/layout/menu/index.tsx
+5
-4
index.tsx
src/pages/orderManage/productOrder/detail/index.tsx
+21
-0
index.tsx
src/pages/orderManage/productOrder/index.tsx
+119
-3
router.tsx
src/router/router.tsx
+23
-5
没有找到文件。
src/assets/style/App.scss
浏览文件 @
3220f9f3
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
font-size
:
14px
;
font-size
:
14px
;
}
}
.ant-btn-link
{
.ant-btn-link
{
padding
:
0
;
padding
:
0
;
font-size
:
16px
!
important
;
font-size
:
16px
!
important
;
font-weight
:
bold
!
important
;
font-weight
:
bold
!
important
;
...
@@ -22,3 +22,27 @@
...
@@ -22,3 +22,27 @@
}
}
}
}
}
}
.ant-table-row
:nth-child
(
odd
)
{
background
:
#FCFCFC
;
}
.ant-table-row
:nth-child
(
odd
)
>
td
{
background
:
#FCFCFC
;
}
::-webkit-scrollbar
{
background-color
:
transparent
;
-webkit-border-radius
:
2em
;
-moz-border-radius
:
2em
;
border-radius
:
2em
;
width
:
7px
;
height
:
7px
;
}
::-webkit-scrollbar-thumb
{
background-color
:
#1677ff
;
-webkit-border-radius
:
2em
;
-moz-border-radius
:
2em
;
border-radius
:
2em
;
}
src/components/layout/menu/index.tsx
浏览文件 @
3220f9f3
...
@@ -24,9 +24,10 @@ export function MenuView() {
...
@@ -24,9 +24,10 @@ export function MenuView() {
const
onOpenChange
:
MenuProps
[
'onOpenChange'
]
=
(
keys
)
=>
{
const
onOpenChange
:
MenuProps
[
'onOpenChange'
]
=
(
keys
)
=>
{
setOpenKeys
([
keys
[
keys
.
length
-
1
]]);
setOpenKeys
([
keys
[
keys
.
length
-
1
]]);
};
};
// 点击侧边栏事件
// 点击侧边栏事件 onSelect改为onClick
const
onSelect
:
MenuProps
[
'onSelect'
]
=
(
keys
)
=>
{
const
onSelect
:
MenuProps
[
'onClick'
]
=
(
keys
)
=>
{
setSelectedKeys
(
keys
.
selectedKeys
);
setSelectedKeys
([
keys
.
key
]);
// setSelectedKeys(keys.selectedKeys);
const
id
=
Number
(
keys
.
key
);
const
id
=
Number
(
keys
.
key
);
const
current
=
GetRouteByID
(
id
,
routerList
);
const
current
=
GetRouteByID
(
id
,
routerList
);
// console.log(current?.path);
// console.log(current?.path);
...
@@ -74,7 +75,7 @@ export function MenuView() {
...
@@ -74,7 +75,7 @@ export function MenuView() {
<
Menu
<
Menu
openKeys=
{
openKeys
}
openKeys=
{
openKeys
}
selectedKeys=
{
selectedKeys
}
selectedKeys=
{
selectedKeys
}
on
Select
=
{
onSelect
}
on
Click
=
{
onSelect
}
onOpenChange=
{
onOpenChange
}
onOpenChange=
{
onOpenChange
}
mode=
'inline'
mode=
'inline'
items=
{
items
}
items=
{
items
}
...
...
src/pages/orderManage/productOrder/detail/index.tsx
0 → 100644
浏览文件 @
3220f9f3
import
React
,
{
useEffect
}
from
'react'
;
import
{
useLocation
}
from
'react-router-dom'
;
function
ProductOrderDetail
()
{
// 路由钩子
const
location
=
useLocation
();
// 接收参数
const
{
id
}
=
location
.
state
;
// componentDidMount
useEffect
(()
=>
{
console
.
log
(
'拿到的id是 --->'
,
id
);
},
[
id
]);
return
(
<
div
>
<
h2
>
ProductOrderDetail
</
h2
>
<
h3
>
{
id
}
</
h3
>
</
div
>
);
}
export
default
ProductOrderDetail
;
src/pages/orderManage/productOrder/index.tsx
浏览文件 @
3220f9f3
import
{
useState
}
from
'react'
;
import
{
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
}
from
'antd'
;
import
{
Button
,
Table
}
from
'antd'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
useNavigate
}
from
'react-router-dom'
;
// 表格数据类型
type
TableType
=
any
;
// 订单状态搜索列表
// 订单状态搜索列表
const
statusCodeButtonList
=
[
const
statusCodeButtonList
=
[
...
@@ -14,12 +19,105 @@ const statusCodeButtonList = [
...
@@ -14,12 +19,105 @@ const statusCodeButtonList = [
];
];
function
ProductOrderView
()
{
function
ProductOrderView
()
{
// 路由钩子
const
navigate
=
useNavigate
();
// 当前选择的是第几个按钮
// 当前选择的是第几个按钮
const
[
statusCodeButtonIndex
,
setStatusCodeButtonIndex
]
=
useState
<
number
>
(
0
);
const
[
statusCodeButtonIndex
,
setStatusCodeButtonIndex
]
=
useState
<
number
>
(
0
);
// 表格分页配置
const
[
pagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// 表格数据
const
[
tableData
]
=
useState
<
TableType
>
([{
id
:
1
}]);
// 订单状态筛选
// 订单状态筛选
const
statusChangeEvent
=
(
index
:
number
)
=>
{
const
statusChangeEvent
=
(
i
:
number
)
=>
{
setStatusCodeButtonIndex
(
index
);
console
.
log
(
'订单状态筛选 --->'
,
i
);
setStatusCodeButtonIndex
(
i
);
};
// 跳转订单详情
const
handleDetail
=
(
record
:
TableType
[
0
])
=>
{
navigate
(
`/orderManage/productOrder/detail`
,
{
state
:
{
id
:
record
.
id
}
});
console
.
log
(
'跳转订单详情 --->'
,
record
.
id
);
};
};
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'商品'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'单价(元)'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'数量'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'买家'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'订单状态'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'实收款'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'相关运营'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'推荐人'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'订单交期'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
align
:
'center'
,
fixed
:
'right'
,
render
:
(
_text
,
record
)
=>
(
<>
<
Button
type=
{
'link'
}
onClick=
{
()
=>
handleDetail
(
record
)
}
>
详情
</
Button
>
</>
),
},
];
return
(
return
(
<>
<>
<
SearchBox
<
SearchBox
...
@@ -68,6 +166,24 @@ function ProductOrderView() {
...
@@ -68,6 +166,24 @@ function ProductOrderView() {
</>
</>
}
}
/>
/>
<
Table
size=
'small'
dataSource=
{
tableData
}
columns=
{
columns
}
rowKey=
'id'
scroll=
{
{
x
:
1200
}
}
pagination=
{
{
total
:
pagination
.
total
,
pageSize
:
pagination
.
pageSize
,
current
:
pagination
.
current
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
showTotal
:
(
total
,
range
)
=>
`当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`
,
}
}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
</>
</>
);
);
}
}
...
...
src/router/router.tsx
浏览文件 @
3220f9f3
...
@@ -2,7 +2,14 @@ import React from 'react';
...
@@ -2,7 +2,14 @@ import React from 'react';
import
{
Navigate
,
RouteObject
}
from
'react-router-dom'
;
import
{
Navigate
,
RouteObject
}
from
'react-router-dom'
;
import
ErrorPage
from
'~/pages/common/error'
;
import
ErrorPage
from
'~/pages/common/error'
;
import
LayoutView
from
'~/components/layout'
;
import
LayoutView
from
'~/components/layout'
;
import
{
AccountBookOutlined
,
MacCommandOutlined
}
from
'@ant-design/icons'
;
import
{
AccountBookOutlined
,
BarsOutlined
,
MacCommandOutlined
,
ShopOutlined
,
CreditCardOutlined
,
ShoppingOutlined
,
}
from
'@ant-design/icons'
;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore
import
{
AgnosticIndexRouteObject
}
from
'@remix-run/router'
;
import
{
AgnosticIndexRouteObject
}
from
'@remix-run/router'
;
...
@@ -14,6 +21,7 @@ import PointDetailList from '~/pages/pointManage/pointDetail';
...
@@ -14,6 +21,7 @@ import PointDetailList from '~/pages/pointManage/pointDetail';
import
DivideOrder
from
'~/pages/pointManage/divideOrder'
;
import
DivideOrder
from
'~/pages/pointManage/divideOrder'
;
import
DivideRules
from
'~/pages/pointManage/divideRules'
;
import
DivideRules
from
'~/pages/pointManage/divideRules'
;
import
LoginView
from
'~/pages/common/login'
;
import
LoginView
from
'~/pages/common/login'
;
import
ProductOrderDetail
from
'~/pages/orderManage/productOrder/detail'
;
const
ProductOrderView
=
React
.
lazy
(()
=>
import
(
'src/pages/orderManage/productOrder'
));
//销售订单
const
ProductOrderView
=
React
.
lazy
(()
=>
import
(
'src/pages/orderManage/productOrder'
));
//销售订单
const
EquipmentOrderView
=
React
.
lazy
(()
=>
import
(
'src/pages/orderManage/equipmentOrder'
));
//设备订单
const
EquipmentOrderView
=
React
.
lazy
(()
=>
import
(
'src/pages/orderManage/equipmentOrder'
));
//设备订单
...
@@ -53,7 +61,7 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -53,7 +61,7 @@ export const routerList: Array<RouteObjectType> = [
errorElement
:
<
ErrorPage
/>,
errorElement
:
<
ErrorPage
/>,
meta
:
{
meta
:
{
id
:
10000
,
id
:
10000
,
icon
:
<
MacCommand
Outlined
/>,
icon
:
<
Bars
Outlined
/>,
title
:
'订单管理'
,
title
:
'订单管理'
,
},
},
children
:
[
children
:
[
...
@@ -63,7 +71,17 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -63,7 +71,17 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
meta
:
{
id
:
10010
,
id
:
10010
,
title
:
'商城订单'
,
title
:
'商城订单'
,
icon
:
<
MacCommandOutlined
/>,
icon
:
<
ShoppingOutlined
/>,
},
},
{
path
:
'/orderManage/productOrder/detail'
,
element
:
withLoadingComponent
(<
ProductOrderDetail
/>),
meta
:
{
id
:
10010
,
title
:
'商城订单 / 详情'
,
icon
:
<
ShoppingOutlined
/>,
hidden
:
true
,
},
},
},
},
{
{
...
@@ -72,7 +90,7 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -72,7 +90,7 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
meta
:
{
id
:
10020
,
id
:
10020
,
title
:
'租赁订单'
,
title
:
'租赁订单'
,
icon
:
<
MacCommand
Outlined
/>,
icon
:
<
Shop
Outlined
/>,
},
},
},
},
{
{
...
@@ -81,7 +99,7 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -81,7 +99,7 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
meta
:
{
id
:
10030
,
id
:
10030
,
title
:
'服务订单'
,
title
:
'服务订单'
,
icon
:
<
MacComman
dOutlined
/>,
icon
:
<
CreditCar
dOutlined
/>,
},
},
},
},
],
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论