create-antd-layout 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/antd-layout-vite-max/src/components/LanguageButton.tsx +0 -3
- package/templates/antd-layout-vite-max/src/components/PopoverPanel.tsx +37 -11
- package/templates/antd-layout-vite-max/src/layouts/index.tsx +1 -1
- package/templates/antd-layout-vite-max/src/layouts/menuData.tsx +1 -1
- package/templates/antd-layout-vite-max/src/locales/en-US/pages.ts +3 -0
- package/templates/antd-layout-vite-max/src/locales/zh-CN/pages.ts +3 -0
- package/templates/antd-layout-vite-max/src/pages/system/organizations/components.tsx +84 -3
- package/templates/antd-layout-vite-max/src/pages/system/organizations/dept.tsx +5 -4
- package/templates/antd-layout-vite-max/src/pages/system/organizations/user.tsx +14 -13
- package/templates/antd-layout-vite-max/src/pages/system/security/firewall.tsx +7 -6
- package/templates/antd-layout-vite-max/src/pages/system/security/permission.tsx +6 -5
- package/templates/antd-layout-vite-max/src/pages/system/security/role.tsx +6 -5
- package/templates/antd-layout-vite-max/src/pages/transaction/components.tsx +3 -1
- package/templates/antd-layout-vite-max/src/pages/transaction/order.tsx +7 -6
- package/templates/antd-layout-vite-max/src/pages/transaction/product.tsx +10 -9
- package/templates/antd-layout-vite-max/src/pages/workbench/monitoring/components.tsx +2 -1
- package/templates/antd-layout-vite-max/src/pages/workbench/notifications.tsx +3 -2
- package/templates/antd-layout-vite-max/src/pages/workbench/report/visit.tsx +5 -5
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Button, Flex, Popover,theme } from "antd"
|
|
2
2
|
import { useConfigAction, useConfigState } from "@adminui-dev/antd-layout"
|
|
3
3
|
import { Languages } from "lucide-react"
|
|
4
|
-
import { useIntl } from "react-intl"
|
|
5
4
|
import { useState } from "react"
|
|
6
5
|
const {useToken} = theme
|
|
7
6
|
|
|
@@ -15,9 +14,7 @@ function LanguageButton(){
|
|
|
15
14
|
const {locale,languages} = useConfigState()
|
|
16
15
|
const {setLocale} = useConfigAction()
|
|
17
16
|
const [open,setOpen] = useState<boolean>(false)
|
|
18
|
-
const intl = useIntl()
|
|
19
17
|
const {token} = useToken()
|
|
20
|
-
|
|
21
18
|
const onChangeLanguage=(value:string)=>{
|
|
22
19
|
setOpen(false)
|
|
23
20
|
setLocale(value)
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { Tag, Button, Divider, Space, theme } from "antd"
|
|
2
|
-
import {
|
|
1
|
+
import { Tag, Button, Divider, Space, theme, Popconfirm } from "antd"
|
|
2
|
+
import type {PopconfirmProps} from "antd"
|
|
3
3
|
import { useAvatarPopover,useConfigState,LazyAvatar, LazyImage, useBrandPopover } from "@adminui-dev/antd-layout";
|
|
4
|
+
import {ContactRound,Siren,CircleUserRound,CircleAlert,Crown,LogOut,Plus,Check,BrushCleaning} from "lucide-react";
|
|
4
5
|
import WardenLogo from "./WardenLogo";
|
|
6
|
+
import type { User } from "../pages/typings";
|
|
7
|
+
import { useProfileDrawer } from "@/pages/system/organizations/components";
|
|
8
|
+
import { useIntl } from "react-intl";
|
|
9
|
+
import { useNavigate } from "react-router";
|
|
5
10
|
|
|
6
11
|
const {useToken} = theme
|
|
7
12
|
|
|
@@ -53,7 +58,10 @@ function UserPopoverPanel(){
|
|
|
53
58
|
const {token} = useToken()
|
|
54
59
|
const { layoutConfig } = useConfigState()
|
|
55
60
|
const { close } = useAvatarPopover()
|
|
61
|
+
const navigate = useNavigate()
|
|
62
|
+
const intl = useIntl()
|
|
56
63
|
const { userInfo } = layoutConfig
|
|
64
|
+
const {detailsDrawer,showDetails} = useProfileDrawer()
|
|
57
65
|
|
|
58
66
|
const s1Style:React.CSSProperties = {
|
|
59
67
|
whiteSpace:"nowrap",
|
|
@@ -69,11 +77,16 @@ function UserPopoverPanel(){
|
|
|
69
77
|
overflow:"hidden",
|
|
70
78
|
color:token.colorTextSecondary
|
|
71
79
|
}
|
|
72
|
-
|
|
80
|
+
|
|
81
|
+
const fetchUserInfo=(uid:string):User | undefined=> {
|
|
82
|
+
console.log(`find uid is ${uid} for user`)
|
|
83
|
+
return {id:7,uid:"Scapegoat",realName:"Scapegoat",email:"zhouwenqi@me.com", deptId:3,deptName:"Marketing",roleId:3,roleName:"Query",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=8", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'}
|
|
84
|
+
}
|
|
73
85
|
|
|
74
86
|
if(!userInfo){
|
|
75
87
|
return <></>
|
|
76
88
|
}
|
|
89
|
+
const user = fetchUserInfo(userInfo.uid)
|
|
77
90
|
|
|
78
91
|
let faceElement:React.ReactNode = <></>
|
|
79
92
|
|
|
@@ -89,8 +102,19 @@ function UserPopoverPanel(){
|
|
|
89
102
|
close!()
|
|
90
103
|
}
|
|
91
104
|
|
|
105
|
+
const onProfileHandler=()=>{
|
|
106
|
+
showDetails(user)
|
|
107
|
+
close!()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const confirmHandler: PopconfirmProps['onConfirm'] = (e) => {
|
|
111
|
+
console.log(e)
|
|
112
|
+
navigate("/login")
|
|
113
|
+
}
|
|
114
|
+
|
|
92
115
|
return(
|
|
93
116
|
<div style={boxStyles}>
|
|
117
|
+
{detailsDrawer}
|
|
94
118
|
<div style={titleStyles}>
|
|
95
119
|
{faceElement}
|
|
96
120
|
<div style={titleText}>
|
|
@@ -100,14 +124,16 @@ function UserPopoverPanel(){
|
|
|
100
124
|
</div>
|
|
101
125
|
<Divider style={{marginTop:"12px",marginBottom:"4px"}} />
|
|
102
126
|
|
|
103
|
-
<Button onClick={
|
|
104
|
-
<Button onClick={onClickHandler} type="text" block icon={<
|
|
105
|
-
<Button onClick={onClickHandler} type="text" block icon={<
|
|
106
|
-
<Button onClick={onClickHandler} type="text" block icon={<
|
|
127
|
+
<Button onClick={onProfileHandler} type="text" block icon={<ContactRound size={14} />} styles={{root:btnRootStyle}}>Profile</Button>
|
|
128
|
+
<Button onClick={onClickHandler} type="text" block icon={<Siren size={14} />} styles={{root:btnRootStyle}}>Notice</Button>
|
|
129
|
+
<Button onClick={onClickHandler} type="text" block icon={<CircleUserRound size={14} />} styles={{root:btnRootStyle}}>Account</Button>
|
|
130
|
+
<Button onClick={onClickHandler} type="text" block icon={<BrushCleaning size={14} />} styles={{root:btnRootStyle}}><div style={{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}}>Cache clean<Tag color="warning" icon={<CircleAlert size={14} />}>2.8G</Tag></div></Button>
|
|
107
131
|
<Divider style={{marginTop:"4px",marginBottom:"4px"}} />
|
|
108
132
|
<Space style={{marginBottom:"0px"}} separator={<Divider orientation="vertical" />}>
|
|
109
|
-
<Button onClick={onClickHandler} type="text" block icon={<
|
|
110
|
-
<
|
|
133
|
+
<Button onClick={onClickHandler} type="text" block icon={<Crown size={14} />} styles={{root:btnRootStyle}}>Upgrade pro</Button>
|
|
134
|
+
<Popconfirm onConfirm={confirmHandler} title={intl.formatMessage({id:"profile.logout.confirm.title"})} description={intl.formatMessage({id:"profile.logout.confirm.description"})}>
|
|
135
|
+
<Button type="text" block icon={<LogOut size={14} />} styles={{root:btnRootStyle}}>Logout</Button>
|
|
136
|
+
</Popconfirm>
|
|
111
137
|
</Space>
|
|
112
138
|
</div>
|
|
113
139
|
)
|
|
@@ -145,7 +171,7 @@ function BrandPopoverPanel(){
|
|
|
145
171
|
<Divider style={{marginTop:"10px",marginBottom:"4px"}} />
|
|
146
172
|
{items}
|
|
147
173
|
<Divider style={{marginTop:"4px",marginBottom:"4px"}} />
|
|
148
|
-
<Button onClick={()=>{close!()}} type="text" block icon={<
|
|
174
|
+
<Button onClick={()=>{close!()}} type="text" block icon={<Plus size={14} />} styles={{root:btnRootStyle}}>Create team</Button>
|
|
149
175
|
</div>
|
|
150
176
|
)
|
|
151
177
|
}
|
|
@@ -173,7 +199,7 @@ function BrandItem(props:{team:BrandTeam,selected?:boolean}){
|
|
|
173
199
|
}
|
|
174
200
|
return(
|
|
175
201
|
<Button type="text" block icon={icon} styles={btnStyles}>
|
|
176
|
-
<div style={itemSytles}>{team.name}{selected? <
|
|
202
|
+
<div style={itemSytles}>{team.name}{selected? <Check size={14} /> : <></>}</div>
|
|
177
203
|
</Button>
|
|
178
204
|
)
|
|
179
205
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MenuData } from "@adminui-dev/antd-layout"
|
|
2
2
|
import {Badge} from "antd"
|
|
3
|
-
import {UsersRound,Contact,UserLock,Shield,BrickWallShield,FingerprintPattern,HeartHandshake,Gauge,MonitorCheck,Bell,ChartNoAxesCombined,TableProperties,BadgeDollarSign,Globe,ClipboardClock,ScanFace,NotebookPen,Scale,SquareChartGantt,Box,Cog,MonitorCog,
|
|
3
|
+
import {UsersRound,Contact,UserLock,Shield,BrickWallShield,FingerprintPattern,HeartHandshake,Gauge,MonitorCheck,Bell,ChartNoAxesCombined,TableProperties,BadgeDollarSign,Globe,ClipboardClock,ScanFace,NotebookPen,Scale,SquareChartGantt,Box,Cog,MonitorCog,Building2} from "lucide-react"
|
|
4
4
|
/**
|
|
5
5
|
* Menu data
|
|
6
6
|
* A menu corresponds to a route, and the root menu is not displayed, but it must correspond to a layout route because an item may have a layout.
|
|
@@ -155,4 +155,7 @@ export default {
|
|
|
155
155
|
"firewall.control.title":"Protection rules",
|
|
156
156
|
"firewall.option.control.white":"Whitelist",
|
|
157
157
|
"firewall.option.control.black":"Blacklist",
|
|
158
|
+
"profile.drawer.details.title":"Profile details",
|
|
159
|
+
"profile.logout.confirm.title":"Sign out",
|
|
160
|
+
"profile.logout.confirm.description":"Are you sure you want to log out of the system?",
|
|
158
161
|
}
|
|
@@ -155,4 +155,7 @@ export default {
|
|
|
155
155
|
"firewall.control.title":"防控机制",
|
|
156
156
|
"firewall.option.control.white":"白名单",
|
|
157
157
|
"firewall.option.control.black":"黑名单",
|
|
158
|
+
"profile.drawer.details.title":"个人资料",
|
|
159
|
+
"profile.logout.confirm.title":"登出",
|
|
160
|
+
"profile.logout.confirm.description":"确认退出系统吗?",
|
|
158
161
|
}
|
|
@@ -58,7 +58,7 @@ function DeptDetailsDrawer(props:DrawerProps&{dept?:Dept}){
|
|
|
58
58
|
]
|
|
59
59
|
return(
|
|
60
60
|
<>
|
|
61
|
-
<Drawer {...props} title={intl.formatMessage({id:"
|
|
61
|
+
<Drawer {...props} title={intl.formatMessage({id:"dept.drawer.details.title"})} extra={<Space><Button key="edit-btn" icon={<SquarePen size={14} />}>{intl.formatMessage({id:"global.edit"})}</Button></Space>}>
|
|
62
62
|
<Descriptions bordered items={items} />
|
|
63
63
|
</Drawer>
|
|
64
64
|
</>
|
|
@@ -139,7 +139,7 @@ function UserDetailsDrawer(props:DrawerProps&{user?:User}){
|
|
|
139
139
|
]
|
|
140
140
|
return(
|
|
141
141
|
<>
|
|
142
|
-
<Drawer {...props} title={intl.formatMessage({id:"
|
|
142
|
+
<Drawer {...props} title={intl.formatMessage({id:"user.drawer.details.title"})} extra={<Space><Button key="edit-btn" icon={<SquarePen size={14} />}>{intl.formatMessage({id:"global.edit"})}</Button></Space>}>
|
|
143
143
|
<Descriptions bordered items={items} />
|
|
144
144
|
</Drawer>
|
|
145
145
|
</>
|
|
@@ -157,4 +157,85 @@ function useUserDrawer(){
|
|
|
157
157
|
return {detailsDrawer,showDetails}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Drawer - profile details
|
|
162
|
+
* @param props
|
|
163
|
+
* @returns
|
|
164
|
+
*/
|
|
165
|
+
function ProfileDetailsDrawer(props:DrawerProps&{user?:User}){
|
|
166
|
+
const intl = useIntl()
|
|
167
|
+
const {user} = props
|
|
168
|
+
if(!user){
|
|
169
|
+
return<></>
|
|
170
|
+
}
|
|
171
|
+
const items: DescriptionsProps['items'] = [
|
|
172
|
+
{
|
|
173
|
+
key: '0',
|
|
174
|
+
label: intl.formatMessage({id:"user.column.avatar"}),
|
|
175
|
+
children: <LazyAvatar src={user.avatarUrl} size={64} />,
|
|
176
|
+
span:"filled",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
key: '1',
|
|
180
|
+
label: intl.formatMessage({id:"user.column.uid"}),
|
|
181
|
+
children: user.uid,
|
|
182
|
+
span:"filled",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: '2',
|
|
186
|
+
label: intl.formatMessage({id:"user.column.realName"}),
|
|
187
|
+
children: user.realName,
|
|
188
|
+
span:"filled",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
key: '3',
|
|
192
|
+
label: intl.formatMessage({id:"user.column.email"}),
|
|
193
|
+
children:user.email,
|
|
194
|
+
span:"filled",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
key: '4',
|
|
198
|
+
label: intl.formatMessage({id:"user.column.deptName"}),
|
|
199
|
+
children: user.deptName,
|
|
200
|
+
span:"filled",
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
key: '9',
|
|
204
|
+
label: intl.formatMessage({id:"user.column.roleName"}),
|
|
205
|
+
children:user.roleName,
|
|
206
|
+
span:"filled",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
key: '10',
|
|
210
|
+
label: intl.formatMessage({id:"user.column.lastDate"}),
|
|
211
|
+
children: user.createDate,
|
|
212
|
+
span:"filled",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
key: '11',
|
|
216
|
+
label: intl.formatMessage({id:"global.column.createDate"}),
|
|
217
|
+
children: user.createDate,
|
|
218
|
+
span:"filled",
|
|
219
|
+
},
|
|
220
|
+
]
|
|
221
|
+
return(
|
|
222
|
+
<>
|
|
223
|
+
<Drawer {...props} title={intl.formatMessage({id:"profile.drawer.details.title"})} extra={<Space><Button key="edit-btn" icon={<SquarePen size={14} />}>{intl.formatMessage({id:"global.edit"})}</Button></Space>}>
|
|
224
|
+
<Descriptions bordered items={items} />
|
|
225
|
+
</Drawer>
|
|
226
|
+
</>
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function useProfileDrawer(){
|
|
231
|
+
const [openDetails,setOpenDetails] = useState<boolean>(false)
|
|
232
|
+
const [detailsRecord,setDetailsRecord] = useState<User>()
|
|
233
|
+
const showDetails=(user?:User)=>{
|
|
234
|
+
setDetailsRecord(user)
|
|
235
|
+
setOpenDetails(true)
|
|
236
|
+
}
|
|
237
|
+
const detailsDrawer = <ProfileDetailsDrawer user={detailsRecord} open={openDetails} onClose={()=>{setOpenDetails(false)}} size={500} />
|
|
238
|
+
return {detailsDrawer,showDetails}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export { useDeptDrawer,useUserDrawer,useProfileDrawer }
|
|
@@ -55,7 +55,7 @@ export default function(){
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Dept> => ({
|
|
58
|
-
filterDropdown: ({
|
|
58
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
59
59
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
60
60
|
<Input
|
|
61
61
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -100,7 +100,7 @@ export default function(){
|
|
|
100
100
|
{
|
|
101
101
|
title: intl.formatMessage({id:"dept.column.name"}),
|
|
102
102
|
dataIndex: 'name',
|
|
103
|
-
render(value, record
|
|
103
|
+
render(value, record) {
|
|
104
104
|
return(<a onClick={()=>{showDetails(record)}}>{value}</a>)
|
|
105
105
|
},
|
|
106
106
|
...getColumnSearchProps('name'),
|
|
@@ -111,7 +111,7 @@ export default function(){
|
|
|
111
111
|
filterSearch: true,
|
|
112
112
|
sorter:true,
|
|
113
113
|
width:"160px",
|
|
114
|
-
render:(value
|
|
114
|
+
render:(value)=>{
|
|
115
115
|
return(
|
|
116
116
|
<Tag>{value}</Tag>
|
|
117
117
|
)
|
|
@@ -134,7 +134,8 @@ export default function(){
|
|
|
134
134
|
dataIndex: 'id',
|
|
135
135
|
width:"160px",
|
|
136
136
|
align:"right",
|
|
137
|
-
render(value,record
|
|
137
|
+
render(value,record){
|
|
138
|
+
console.log(value)
|
|
138
139
|
let buttons=[<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
139
140
|
<Button onClick={()=>{showDetails(record)}} type="text" icon={<Binoculars size={14} />} />
|
|
140
141
|
</Tooltip>,<Tooltip key="edit-btn" title={intl.formatMessage({id:"global.edit"})}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container, LazyAvatar
|
|
1
|
+
import { Container, LazyAvatar } from "@adminui-dev/antd-layout";
|
|
2
2
|
import { Button, Flex, Space, Table, Tag, Grid, theme, Input, Tooltip,App} from 'antd';
|
|
3
3
|
import type { TableColumnsType, TableProps,TableColumnType } from 'antd';
|
|
4
4
|
import type { User } from "@/pages/typings";
|
|
@@ -18,12 +18,12 @@ type DataIndex = keyof User
|
|
|
18
18
|
|
|
19
19
|
const userData:User[]=[
|
|
20
20
|
{id:1,uid:"Aneka",realName:"Aneka",email:"aneka@gmail.com", deptId:4,deptName:"Development",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=1", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
21
|
-
{id:
|
|
22
|
-
{id:
|
|
23
|
-
{id:
|
|
24
|
-
{id:
|
|
25
|
-
{id:
|
|
26
|
-
{id:
|
|
21
|
+
{id:2,uid:"Felix",realName:"Felix",email:"felix@gmail.com", deptId:8,deptName:"Testing",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=2", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
22
|
+
{id:3,uid:"Neutral",realName:"Neutral",email:"reutral@gmail.com", deptId:8,deptName:"Testing",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=3", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
23
|
+
{id:4,uid:"Adventurer",realName:"Adventurer",email:"Adventurer@gmail.com", deptId:4,deptName:"Development",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=4", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
24
|
+
{id:5,uid:"Lorelei",realName:"Lorelei",email:"Lorelei@gmail.com", deptId:8,deptName:"Testing",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=5", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
25
|
+
{id:6,uid:"Miniavs",realName:"Miniavs",email:"Miniavs@gmail.com", deptId:4,deptName:"Development",roleId:2,roleName:"Admin",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=6", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'},
|
|
26
|
+
{id:7,uid:"Scapegoat",realName:"Scapegoat",email:"zhouwenqi@me.com", deptId:3,deptName:"Marketing",roleId:3,roleName:"Query",avatarUrl:"https://api.dicebear.com/9.x/miniavs/svg?seed=8", lastDate:'2022/12/8 23:24',createDate:'2022/12/8 23:24'}
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -51,7 +51,7 @@ export default function(){
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<User> => ({
|
|
54
|
-
filterDropdown: ({
|
|
54
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
55
55
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
56
56
|
<Input
|
|
57
57
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -97,7 +97,7 @@ export default function(){
|
|
|
97
97
|
title: intl.formatMessage({id:"user.column.avatar"}),
|
|
98
98
|
dataIndex: 'avatarUrl',
|
|
99
99
|
filterSearch: true,
|
|
100
|
-
render:(value,record
|
|
100
|
+
render:(value,record)=>{
|
|
101
101
|
return(
|
|
102
102
|
<a onClick={()=>{showDetails(record)}}><LazyAvatar src={value} alt={record.uid} /></a>
|
|
103
103
|
)
|
|
@@ -108,7 +108,7 @@ export default function(){
|
|
|
108
108
|
dataIndex: 'uid',
|
|
109
109
|
filterSearch: true,
|
|
110
110
|
sorter:true,
|
|
111
|
-
render:(value,record
|
|
111
|
+
render:(value,record)=>{
|
|
112
112
|
return(
|
|
113
113
|
<a onClick={()=>{showDetails(record)}}>{value}</a>
|
|
114
114
|
)
|
|
@@ -129,7 +129,7 @@ export default function(){
|
|
|
129
129
|
title: intl.formatMessage({id:"user.column.roleName"}),
|
|
130
130
|
dataIndex: 'roleName',
|
|
131
131
|
width:"160px",
|
|
132
|
-
render(value
|
|
132
|
+
render(value) {
|
|
133
133
|
return(
|
|
134
134
|
<Tag>{value}</Tag>
|
|
135
135
|
)
|
|
@@ -140,7 +140,7 @@ export default function(){
|
|
|
140
140
|
title: intl.formatMessage({id:"user.column.deptName"}),
|
|
141
141
|
dataIndex: 'deptName',
|
|
142
142
|
width:"160px",
|
|
143
|
-
render(value
|
|
143
|
+
render(value) {
|
|
144
144
|
return(
|
|
145
145
|
<Tag>{value}</Tag>
|
|
146
146
|
)
|
|
@@ -164,7 +164,8 @@ export default function(){
|
|
|
164
164
|
dataIndex: 'id',
|
|
165
165
|
width:"160px",
|
|
166
166
|
align:"right",
|
|
167
|
-
render(value,record
|
|
167
|
+
render(value,record){
|
|
168
|
+
console.log(value)
|
|
168
169
|
let buttons=[<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
169
170
|
<Button type="text" onClick={()=>{showDetails(record)}} icon={<Binoculars size={14} />} />
|
|
170
171
|
</Tooltip>,<Tooltip key="edit-btn" title={intl.formatMessage({id:"global.edit"})}>
|
|
@@ -2,7 +2,7 @@ import { Container} from "@adminui-dev/antd-layout";
|
|
|
2
2
|
import { Button, Flex, Space, Table, Tag, Grid, theme, Input, Tooltip,App} from 'antd';
|
|
3
3
|
import type { TableColumnsType, TableProps,TableColumnType } from 'antd';
|
|
4
4
|
import type { Firewall } from "@/pages/typings";
|
|
5
|
-
import { Search,Download,Printer,Trash, Upload,Plus,SquarePen,Binoculars
|
|
5
|
+
import { Search,Download,Printer,Trash, Upload,Plus,SquarePen,Binoculars } from "lucide-react";
|
|
6
6
|
import { useRef, useState } from "react";
|
|
7
7
|
import { useIntl } from "react-intl";
|
|
8
8
|
import { printElement } from "@/utils/printUtil";
|
|
@@ -50,7 +50,7 @@ export default function(){
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Firewall> => ({
|
|
53
|
-
filterDropdown: ({
|
|
53
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
54
54
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
55
55
|
<Input
|
|
56
56
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -102,7 +102,7 @@ export default function(){
|
|
|
102
102
|
dataIndex: 'ip',
|
|
103
103
|
filterSearch: true,
|
|
104
104
|
sorter:true,
|
|
105
|
-
render:(value,record
|
|
105
|
+
render:(value,record)=>{
|
|
106
106
|
let sip = value[0] || ""
|
|
107
107
|
if(value.length>1){
|
|
108
108
|
sip += " - " + value[value.length-1]
|
|
@@ -118,7 +118,7 @@ export default function(){
|
|
|
118
118
|
dataIndex: 'description',
|
|
119
119
|
filterSearch: true,
|
|
120
120
|
sorter:true,
|
|
121
|
-
render:(value
|
|
121
|
+
render:(value)=>{
|
|
122
122
|
return(
|
|
123
123
|
<Tag>{value}</Tag>
|
|
124
124
|
)
|
|
@@ -131,7 +131,7 @@ export default function(){
|
|
|
131
131
|
width:"160px",
|
|
132
132
|
sorter:true,
|
|
133
133
|
filters:filterYesOrNo,
|
|
134
|
-
render(value
|
|
134
|
+
render(value) {
|
|
135
135
|
return(
|
|
136
136
|
<Tag color={value ? "red" : "green" }>{yesOrNo.find(item=>item.value == value)?.label}</Tag>
|
|
137
137
|
)
|
|
@@ -149,7 +149,8 @@ export default function(){
|
|
|
149
149
|
dataIndex: 'id',
|
|
150
150
|
width:"160px",
|
|
151
151
|
align:"right",
|
|
152
|
-
render(value,record
|
|
152
|
+
render(value,record){
|
|
153
|
+
console.log(value)
|
|
153
154
|
let buttons=[
|
|
154
155
|
<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
155
156
|
<Button type="text" onClick={()=>{showDetails(record)}} icon={<Binoculars size={14} />} />
|
|
@@ -45,7 +45,7 @@ export default function(){
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Permission> => ({
|
|
48
|
-
filterDropdown: ({
|
|
48
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
49
49
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
50
50
|
<Input
|
|
51
51
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -97,7 +97,7 @@ export default function(){
|
|
|
97
97
|
dataIndex: 'name',
|
|
98
98
|
filterSearch: true,
|
|
99
99
|
sorter:true,
|
|
100
|
-
render:(value,record
|
|
100
|
+
render:(value,record)=>{
|
|
101
101
|
return(
|
|
102
102
|
<a onClick={()=>{showDetails(record)}}>{value}</a>
|
|
103
103
|
)
|
|
@@ -109,7 +109,7 @@ export default function(){
|
|
|
109
109
|
dataIndex: 'value',
|
|
110
110
|
filterSearch: true,
|
|
111
111
|
sorter:true,
|
|
112
|
-
render:(value
|
|
112
|
+
render:(value)=>{
|
|
113
113
|
return(
|
|
114
114
|
<Tag>{value}</Tag>
|
|
115
115
|
)
|
|
@@ -122,7 +122,7 @@ export default function(){
|
|
|
122
122
|
width:"160px",
|
|
123
123
|
sorter:true,
|
|
124
124
|
filters:filterYesOrNo,
|
|
125
|
-
render(value
|
|
125
|
+
render(value) {
|
|
126
126
|
return(
|
|
127
127
|
<Tag color={value ? "red" : "green" }>{yesOrNo.find(item=>item.value == value)?.label}</Tag>
|
|
128
128
|
)
|
|
@@ -140,7 +140,8 @@ export default function(){
|
|
|
140
140
|
dataIndex: 'id',
|
|
141
141
|
width:"160px",
|
|
142
142
|
align:"right",
|
|
143
|
-
render(value,record
|
|
143
|
+
render(value,record){
|
|
144
|
+
console.log(value)
|
|
144
145
|
let buttons=[
|
|
145
146
|
<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
146
147
|
<Button type="text" onClick={()=>{showDetails(record)}} icon={<Binoculars size={14} />} />
|
|
@@ -50,7 +50,7 @@ export default function(){
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Role> => ({
|
|
53
|
-
filterDropdown: ({
|
|
53
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
54
54
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
55
55
|
<Input
|
|
56
56
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -102,7 +102,7 @@ export default function(){
|
|
|
102
102
|
dataIndex: 'name',
|
|
103
103
|
filterSearch: true,
|
|
104
104
|
sorter:true,
|
|
105
|
-
render:(value,record
|
|
105
|
+
render:(value,record)=>{
|
|
106
106
|
return(
|
|
107
107
|
<a onClick={()=>{showDetails(record)}}>{value}</a>
|
|
108
108
|
)
|
|
@@ -114,7 +114,7 @@ export default function(){
|
|
|
114
114
|
dataIndex: 'value',
|
|
115
115
|
filterSearch: true,
|
|
116
116
|
sorter:true,
|
|
117
|
-
render:(value
|
|
117
|
+
render:(value)=>{
|
|
118
118
|
return(
|
|
119
119
|
<Tag>{value}</Tag>
|
|
120
120
|
)
|
|
@@ -127,7 +127,7 @@ export default function(){
|
|
|
127
127
|
width:"160px",
|
|
128
128
|
sorter:true,
|
|
129
129
|
filters:filterYesOrNo,
|
|
130
|
-
render(value
|
|
130
|
+
render(value) {
|
|
131
131
|
return(
|
|
132
132
|
<Tag color={value ? "red" : "green" }>{yesOrNo.find(item=>item.value == value)?.label}</Tag>
|
|
133
133
|
)
|
|
@@ -145,7 +145,8 @@ export default function(){
|
|
|
145
145
|
dataIndex: 'id',
|
|
146
146
|
width:"160px",
|
|
147
147
|
align:"right",
|
|
148
|
-
render(value,record
|
|
148
|
+
render(value,record){
|
|
149
|
+
console.log(value)
|
|
149
150
|
let buttons=[
|
|
150
151
|
<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
151
152
|
<Button type="text" onClick={()=>{showDetails(record)}} icon={<Binoculars size={14} />} />
|
|
@@ -394,10 +394,12 @@ export function useOrderModel(){
|
|
|
394
394
|
setOpenPayment(true)
|
|
395
395
|
}
|
|
396
396
|
const deleteOrder=(order:Order)=>{
|
|
397
|
+
console.log(order)
|
|
397
398
|
message.success(intl.formatMessage({id:"order.confirm.create.success"}))
|
|
398
399
|
}
|
|
399
400
|
|
|
400
|
-
const verifyOrder=(order:Order)=>{
|
|
401
|
+
const verifyOrder=(order:Order)=>{
|
|
402
|
+
console.log(order)
|
|
401
403
|
message.info(intl.formatMessage({id:"order.confirm.verify.completed"}))
|
|
402
404
|
}
|
|
403
405
|
const detailsDrawer = <OrderDetailsDrawer zIndex={1} order={detailsRecord} size={500} open={openDetails} onClose={()=>{setOpenDetails(false)}} onEdit={showEditDrawer} onDelete={deleteOrder} onPayment={showPaymentModal} onVerify={verifyOrder} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container } from "@adminui-dev/antd-layout";
|
|
2
|
-
import { Button, Flex, Space, Table, Tag, Grid, theme, Input, Tooltip,App, Popconfirm
|
|
2
|
+
import { Button, Flex, Space, Table, Tag, Grid, theme, Input, Tooltip,App, Popconfirm } from 'antd';
|
|
3
3
|
import type { TableColumnsType, TableProps,TableColumnType,PopconfirmProps } from 'antd';
|
|
4
4
|
import type { Order } from "@/pages/typings";
|
|
5
5
|
import { Search,Download,Printer,Trash, PackageCheck,Plus,Check,SquarePen,Binoculars,WalletCards } from "lucide-react";
|
|
@@ -61,7 +61,7 @@ export default function(){
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Order> => ({
|
|
64
|
-
filterDropdown: ({
|
|
64
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
65
65
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
66
66
|
<Input
|
|
67
67
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -108,7 +108,7 @@ export default function(){
|
|
|
108
108
|
dataIndex: 'sn',
|
|
109
109
|
filterSearch: true,
|
|
110
110
|
sorter:true,
|
|
111
|
-
render:(value,record
|
|
111
|
+
render:(value,record)=>{
|
|
112
112
|
return(
|
|
113
113
|
<a onClick={()=>{showOrderDetails(record)}}>{value}</a>
|
|
114
114
|
)
|
|
@@ -136,7 +136,7 @@ export default function(){
|
|
|
136
136
|
dataIndex: 'orderStatus',
|
|
137
137
|
width:"160px",
|
|
138
138
|
filters:filterOrderStatus,
|
|
139
|
-
render(value
|
|
139
|
+
render(value) {
|
|
140
140
|
return(
|
|
141
141
|
<Tag color={getOrderStatusColor(value)} >{filterOrderStatus.find(item=>item.value == value)?.text}</Tag>
|
|
142
142
|
)
|
|
@@ -159,7 +159,7 @@ export default function(){
|
|
|
159
159
|
dataIndex: 'paymentStatus',
|
|
160
160
|
width:"180px",
|
|
161
161
|
filters:filterPaymentStatus,
|
|
162
|
-
render(value
|
|
162
|
+
render(value) {
|
|
163
163
|
const tagValue = filterPaymentStatus.find(item=>item.value == value)?.text
|
|
164
164
|
return(
|
|
165
165
|
value=="PAID" ? <Tag color={"green"} style={{display:"inline-flex", alignItems:"center",gap:"2px"}} icon={<Check size={14} />} >{tagValue}</Tag> : <Tag>{tagValue}</Tag>
|
|
@@ -178,7 +178,7 @@ export default function(){
|
|
|
178
178
|
dataIndex: 'id',
|
|
179
179
|
width:"160px",
|
|
180
180
|
align:"right",
|
|
181
|
-
render(
|
|
181
|
+
render(record){
|
|
182
182
|
let buttons=[<Tooltip key="details-btn" title={intl.formatMessage({id:"order.drawer.details.title"})}>
|
|
183
183
|
<Button onClick={()=>{showOrderDetails(record)}} type="text" icon={<Binoculars size={14} />} />
|
|
184
184
|
</Tooltip>]
|
|
@@ -206,6 +206,7 @@ export default function(){
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
const onConfirmDelete:PopconfirmProps["onConfirm"]=(e)=>{
|
|
209
|
+
console.log(e)
|
|
209
210
|
message.success(intl.formatMessage({id:"order.confirm.create.success"}))
|
|
210
211
|
}
|
|
211
212
|
|
|
@@ -55,7 +55,7 @@ export default function(){
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Product> => ({
|
|
58
|
-
filterDropdown: ({
|
|
58
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
59
59
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
60
60
|
<Input
|
|
61
61
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -102,7 +102,7 @@ export default function(){
|
|
|
102
102
|
dataIndex: 'image',
|
|
103
103
|
filterSearch: true,
|
|
104
104
|
sorter:true,
|
|
105
|
-
render:(value,record
|
|
105
|
+
render:(value,record)=>{
|
|
106
106
|
return(
|
|
107
107
|
<a><LazyImage style={{width:"60px"}} src={value} alt={record.name} /></a>
|
|
108
108
|
)
|
|
@@ -113,7 +113,7 @@ export default function(){
|
|
|
113
113
|
dataIndex: 'sn',
|
|
114
114
|
filterSearch: true,
|
|
115
115
|
sorter:true,
|
|
116
|
-
render:(value
|
|
116
|
+
render:(value)=>{
|
|
117
117
|
return(
|
|
118
118
|
<a>{value}</a>
|
|
119
119
|
)
|
|
@@ -141,7 +141,7 @@ export default function(){
|
|
|
141
141
|
dataIndex: 'categories',
|
|
142
142
|
width:"160px",
|
|
143
143
|
filters:filterProductCaties,
|
|
144
|
-
render(value
|
|
144
|
+
render(value) {
|
|
145
145
|
return(
|
|
146
146
|
<Tag>{productCaties.find(item=>item.value == value)?.label}</Tag>
|
|
147
147
|
)
|
|
@@ -158,7 +158,7 @@ export default function(){
|
|
|
158
158
|
dataIndex: 'arrive',
|
|
159
159
|
sorter:true,
|
|
160
160
|
filters:filterYesOrNo,
|
|
161
|
-
render(value
|
|
161
|
+
render(value) {
|
|
162
162
|
return(
|
|
163
163
|
<Tag color={value ? "green" : "default"}>{yesOrNo.find(item=>item.value == value)?.label}</Tag>
|
|
164
164
|
)
|
|
@@ -169,7 +169,7 @@ export default function(){
|
|
|
169
169
|
dataIndex: 'disabled',
|
|
170
170
|
sorter:true,
|
|
171
171
|
filters:filterYesOrNo,
|
|
172
|
-
render(value
|
|
172
|
+
render(value) {
|
|
173
173
|
return(
|
|
174
174
|
<Tag color={value ? "green" : "default"}>{yesOrNo.find(item=>item.value == value)?.label}</Tag>
|
|
175
175
|
)
|
|
@@ -186,10 +186,11 @@ export default function(){
|
|
|
186
186
|
dataIndex: 'id',
|
|
187
187
|
width:"160px",
|
|
188
188
|
align:"right",
|
|
189
|
-
render(value
|
|
190
|
-
|
|
189
|
+
render(value){
|
|
190
|
+
console.log(value)
|
|
191
|
+
let buttons=[<Tooltip key="details-btn" title={intl.formatMessage({id:"global.details"})}>
|
|
191
192
|
<Button type="text" icon={<Binoculars size={14} />} />
|
|
192
|
-
</Tooltip>,<Tooltip key="edit-btn" title={intl.formatMessage({id:"
|
|
193
|
+
</Tooltip>,<Tooltip key="edit-btn" title={intl.formatMessage({id:"product.button.edit"})}>
|
|
193
194
|
<Button type="text" icon={<SquarePen size={14} />} />
|
|
194
195
|
</Tooltip>]
|
|
195
196
|
return(
|
|
@@ -96,7 +96,8 @@ function AreaChartPanel(){
|
|
|
96
96
|
setEndTime(Date.now() + 60 * 5 * 1000)
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const onChangeHandler=(option:any,total:number,overly:boolean)=>{
|
|
99
|
+
const onChangeHandler=(option:any,total:number,overly:boolean)=>{
|
|
100
|
+
console.log(total)
|
|
100
101
|
if(!overly && appChart.current){
|
|
101
102
|
const ops = {grid:{left:intl.locale=='en-US'? '80px' : '40px'},...option}
|
|
102
103
|
appChart.current.setOption(ops)
|
|
@@ -91,9 +91,9 @@ export default function(){
|
|
|
91
91
|
title: 'ID',
|
|
92
92
|
dataIndex: 'avatar',
|
|
93
93
|
width:"60px",
|
|
94
|
-
render(value, record
|
|
94
|
+
render(value, record) {
|
|
95
95
|
return(
|
|
96
|
-
<LazyAvatar key={
|
|
96
|
+
<LazyAvatar key={record.id} size={"small"} src={value} />
|
|
97
97
|
)
|
|
98
98
|
},
|
|
99
99
|
},
|
|
@@ -145,6 +145,7 @@ export default function(){
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
const onConfirmClean:PopconfirmProps["onConfirm"]=(e)=>{
|
|
148
|
+
console.log(e)
|
|
148
149
|
message.success(intl.formatMessage({id:"notifications.clean.confirm.success"}))
|
|
149
150
|
}
|
|
150
151
|
const btnDisable = selectedRowKeys.length <= 0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Container} from "@adminui-dev/antd-layout";
|
|
2
2
|
import { Button, Flex, Space, Table, Tag, Grid, theme, Input, Tooltip,App } from 'antd';
|
|
3
|
-
import type { TableColumnsType,
|
|
3
|
+
import type { TableColumnsType, TableColumnType } from 'antd';
|
|
4
4
|
import type { Visit } from "@/pages/typings";
|
|
5
5
|
import { Search,Download,Printer,ChartPie } from "lucide-react";
|
|
6
|
-
import { useRef
|
|
6
|
+
import { useRef } from "react";
|
|
7
7
|
import { useIntl } from "react-intl";
|
|
8
8
|
import { printElement } from "@/utils/printUtil";
|
|
9
9
|
import useVisitChart from "./components";
|
|
@@ -96,7 +96,7 @@ export default function(){
|
|
|
96
96
|
]
|
|
97
97
|
|
|
98
98
|
const getColumnSearchProps = (dataIndex: DataIndex): TableColumnType<Visit> => ({
|
|
99
|
-
filterDropdown: ({
|
|
99
|
+
filterDropdown: ({ selectedKeys, close }) => (
|
|
100
100
|
<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
101
101
|
<Input
|
|
102
102
|
placeholder={`${intl.formatMessage({id:"global.search"})} ${dataIndex}`}
|
|
@@ -160,7 +160,7 @@ export default function(){
|
|
|
160
160
|
dataIndex: 'device',
|
|
161
161
|
width:"140px",
|
|
162
162
|
filters:filterDeviceOptions,
|
|
163
|
-
render(value
|
|
163
|
+
render(value) {
|
|
164
164
|
return(
|
|
165
165
|
<Tag>{value}</Tag>
|
|
166
166
|
)
|
|
@@ -172,7 +172,7 @@ export default function(){
|
|
|
172
172
|
dataIndex: 'os',
|
|
173
173
|
width:"140px",
|
|
174
174
|
filters:filterOsOptions,
|
|
175
|
-
render(value
|
|
175
|
+
render(value) {
|
|
176
176
|
return(
|
|
177
177
|
<Tag>{value}</Tag>
|
|
178
178
|
)
|