Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
64e50d1e
Commit
64e50d1e
authored
Feb 03, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signed-off-by: cellee <893264950@qq.com>
parent
059303cf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
92 deletions
+87
-92
proxy.ts
config/proxy.ts
+6
-6
VisitorRecord.ts
src/models/CommunityManagement/VisitorRecord.ts
+2
-3
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+1
-1
VisitorRecord.tsx
...pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
+39
-41
VisitorRecord.tsx
...pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
+39
-41
No files found.
config/proxy.ts
View file @
64e50d1e
...
...
@@ -86,15 +86,15 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
// '/tos/': {
// target: 'http://47.74.233.180:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
'/tos/'
:
{
target
:
'http://
192.168.1.28
:8651'
,
target
:
'http://
47.74.233.180
:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
// '/tos/': {
// target: 'http://192.168.1.28:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},
};
src/models/CommunityManagement/VisitorRecord.ts
View file @
64e50d1e
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-02-03 1
7:43:00
* @LastEditTime: 2021-02-03 1
9:55:13
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\VisitorRecord.ts
...
...
@@ -53,8 +53,7 @@ export default {
case
26
:
{
// 总数据
let
Data
=
resp
.
data
.
rows
;
console
.
log
(
'??'
);
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
...
...
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
64e50d1e
...
...
@@ -673,7 +673,7 @@ const Account = (props: any) => {
};
const
AccountProps
=
(
state
:
any
)
=>
{
console
.
log
(
state
.
loading
);
//
console.log(state.loading);
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
SubResult
,
Permission
,
Info
}
=
state
.
Account
;
const
loading
=
state
.
loading
.
global
;
const
{
user
}
=
state
;
...
...
src/pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
View file @
64e50d1e
import
React
,
{
useEffect
}
from
'react'
;
import
{
Input
,
Form
,
Button
,
DatePicker
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Input
,
Form
,
Button
,
DatePicker
,
Pagination
}
from
'antd'
;
import
{
connect
}
from
'umi'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
...
...
@@ -14,16 +14,12 @@ const module = 'VisitorRecord';
const
VisitorRecord
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
,
DataSave
,
loading
,
CommunityList
}
=
props
;
const
[
term
,
setTerm
]
=
useState
({
communityNames
:
CommunityList
,
pageNum
:
1
});
// 搜索条件
// 新增搜索的时间 原来时间是时间戳格式
useEffect
(()
=>
{
if
(
Data
!=
null
&&
CommunityList
!=
null
)
{
// Data.forEach((item: any) => {
// item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
// });
}
else
{
RA
(
26
,
{
communityNames
:
CommunityList
},
module
,
dispatch
);
}
},
[
Data
,
CommunityList
]);
RA
(
26
,
term
,
module
,
dispatch
);
},
[
1
]);
// 表头
const
columns
:
any
=
[
...
...
@@ -32,7 +28,6 @@ const VisitorRecord = (props: any) => {
{
title
:
'Security Guard'
,
dataIndex
:
'securityGuardName'
},
{
title
:
'Car Number'
,
dataIndex
:
'numberPlate'
},
{
title
:
'Telephone'
,
dataIndex
:
'inviterPhone'
},
// 隐藏的搜索框
{
title
:
'Visiting Time'
,
dataIndex
:
'updateTime'
,
...
...
@@ -47,39 +42,32 @@ const VisitorRecord = (props: any) => {
];
const
[
form
]
=
Form
.
useForm
();
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
// total: Data != null ? Data.length : 0,
defaultPageSize
:
15
,
showSizeChanger
:
false
,
showTitle
:
false
,
showTotal
:
false
,
size
:
'default'
,
};
// 多条件筛选
//@param condition 过滤条件
//@param data 需要过滤的数据
let
filter
=
(
condition
:
any
,
data
:
any
)
=>
{
return
data
.
filter
((
item
:
any
)
=>
{
return
Object
.
keys
(
condition
).
every
((
key
)
=>
{
return
String
(
item
[
key
])
.
toLowerCase
()
.
includes
(
String
(
condition
[
key
]).
trim
().
toLowerCase
());
});
});
};
// 点击搜索
const
onSubmitForm
=
(
value
:
any
)
=>
{
console
.
log
(
value
);
let
obj
=
{
communityNames
:
value
.
community
.
value
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
''
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
''
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
null
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
null
,
pageNum
:
1
,
};
setTerm
({
...
term
,
...
obj
});
// SA(obj, module, dispatch);
RA
(
26
,
obj
,
module
,
dispatch
);
};
// 页面切换
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
// // 要看是哪里分页
// let mlist = { ...DataSaveDetail };
// mlist.pageNum = page;
// // 把内容存进去
// SA(DetailPage(mlist), module, dispatch);
let
obj
=
{
...
term
,
pageNum
:
page
,
};
SA
(
obj
,
module
,
dispatch
);
setTerm
({
...
obj
}
);
RA
(
26
,
obj
,
module
,
dispatch
);
};
...
...
@@ -122,10 +110,9 @@ const VisitorRecord = (props: any) => {
<
ProTable
loading=
{
loading
}
rowKey=
"id"
dataSource=
{
Data
!=
null
?
Data
.
rows
:
''
}
dataSource=
{
Data
!=
null
?
Data
.
list
:
null
}
columns=
{
columns
}
pagination=
{
pagination
}
// pagination={{ current: 1, total: Data.total}}
pagination=
{
false
}
// 隐藏默认分页
search=
{
false
}
toolBarRender=
{
false
}
headerTitle=
"Visitor List"
...
...
@@ -133,6 +120,17 @@ const VisitorRecord = (props: any) => {
onSubmit=
{
onSubmitForm
}
/>
</
div
>
<
div
style=
{
{
textAlign
:
'right'
,
padding
:
15
}
}
>
<
Pagination
current=
{
Data
?
Data
.
page
.
currentPage
:
0
}
total=
{
Data
?
Data
.
page
.
totalRow
:
0
}
onChange=
{
paginationHandler
}
showSizeChanger=
{
false
}
// showSizeChanger={false}
pageSize=
{
Data
?
Data
.
page
.
curPageSize
:
10
}
/>
</
div
>
</>
);
};
...
...
src/pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
View file @
64e50d1e
import
React
,
{
useEffect
}
from
'react'
;
import
{
Input
,
Form
,
Button
,
DatePicker
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Input
,
Form
,
Button
,
DatePicker
,
Pagination
}
from
'antd'
;
import
{
connect
}
from
'umi'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
...
...
@@ -14,16 +14,12 @@ const module = 'VisitorRecord';
const
VisitorRecord
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
,
DataSave
,
loading
,
CommunityList
}
=
props
;
const
[
term
,
setTerm
]
=
useState
({
communityNames
:
CommunityList
,
pageNum
:
1
});
// 搜索条件
// 新增搜索的时间 原来时间是时间戳格式
useEffect
(()
=>
{
if
(
Data
!=
null
&&
CommunityList
!=
null
)
{
// Data.forEach((item: any) => {
// item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
// });
}
else
{
RA
(
26
,
{
communityNames
:
CommunityList
},
module
,
dispatch
);
}
},
[
Data
,
CommunityList
]);
RA
(
26
,
term
,
module
,
dispatch
);
},
[
1
]);
// 表头
const
columns
:
any
=
[
...
...
@@ -32,7 +28,6 @@ const VisitorRecord = (props: any) => {
{
title
:
'Security Guard'
,
dataIndex
:
'securityGuardName'
},
{
title
:
'Car Number'
,
dataIndex
:
'numberPlate'
},
{
title
:
'Telephone'
,
dataIndex
:
'inviterPhone'
},
// 隐藏的搜索框
{
title
:
'Visiting Time'
,
dataIndex
:
'updateTime'
,
...
...
@@ -47,39 +42,32 @@ const VisitorRecord = (props: any) => {
];
const
[
form
]
=
Form
.
useForm
();
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
// total: Data != null ? Data.length : 0,
defaultPageSize
:
15
,
showSizeChanger
:
false
,
showTitle
:
false
,
showTotal
:
false
,
size
:
'default'
,
};
// 多条件筛选
//@param condition 过滤条件
//@param data 需要过滤的数据
let
filter
=
(
condition
:
any
,
data
:
any
)
=>
{
return
data
.
filter
((
item
:
any
)
=>
{
return
Object
.
keys
(
condition
).
every
((
key
)
=>
{
return
String
(
item
[
key
])
.
toLowerCase
()
.
includes
(
String
(
condition
[
key
]).
trim
().
toLowerCase
());
});
});
};
// 点击搜索
const
onSubmitForm
=
(
value
:
any
)
=>
{
console
.
log
(
value
);
let
obj
=
{
communityNames
:
value
.
community
.
value
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
''
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
''
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
null
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
null
,
pageNum
:
1
,
};
setTerm
({
...
term
,
...
obj
});
// SA(obj, module, dispatch);
RA
(
26
,
obj
,
module
,
dispatch
);
};
// 页面切换
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
// // 要看是哪里分页
// let mlist = { ...DataSaveDetail };
// mlist.pageNum = page;
// // 把内容存进去
// SA(DetailPage(mlist), module, dispatch);
let
obj
=
{
...
term
,
pageNum
:
page
,
};
SA
(
obj
,
module
,
dispatch
);
setTerm
({
...
obj
}
);
RA
(
26
,
obj
,
module
,
dispatch
);
};
...
...
@@ -122,10 +110,9 @@ const VisitorRecord = (props: any) => {
<
ProTable
loading=
{
loading
}
rowKey=
"id"
dataSource=
{
Data
!=
null
?
Data
.
rows
:
''
}
dataSource=
{
Data
!=
null
?
Data
.
list
:
null
}
columns=
{
columns
}
pagination=
{
pagination
}
// pagination={{ current: 1, total: Data.total}}
pagination=
{
false
}
// 隐藏默认分页
search=
{
false
}
toolBarRender=
{
false
}
headerTitle=
"Visitor List"
...
...
@@ -133,6 +120,17 @@ const VisitorRecord = (props: any) => {
onSubmit=
{
onSubmitForm
}
/>
</
div
>
<
div
style=
{
{
textAlign
:
'right'
,
padding
:
15
}
}
>
<
Pagination
current=
{
Data
?
Data
.
page
.
currentPage
:
0
}
total=
{
Data
?
Data
.
page
.
totalRow
:
0
}
onChange=
{
paginationHandler
}
showSizeChanger=
{
false
}
// showSizeChanger={false}
pageSize=
{
Data
?
Data
.
page
.
curPageSize
:
10
}
/>
</
div
>
</>
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment