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
059303cf
Commit
059303cf
authored
Feb 03, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signed-off-by: cellee <893264950@qq.com>
parent
e349b94b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
277 deletions
+46
-277
config.ts
config/config.ts
+10
-10
index.jsx
src/components/SelectOptions/index.jsx
+3
-2
VisitorRecord.ts
src/models/CommunityManagement/VisitorRecord.ts
+2
-3
AccountAdds.tsx
src/pages/AccountManagement/account/AccountAdds.tsx
+1
-1
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+2
-1
VisitorRecord.tsx
...pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
+14
-130
VisitorRecord.tsx
...pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
+14
-130
No files found.
config/config.ts
View file @
059303cf
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-0
1-30 15:56:31
* @LastEditTime: 2021-0
2-03 15:41:15
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
...
...
@@ -201,7 +201,7 @@ export default defineConfig({
{
path
:
'./'
,
component
:
'./CommercialService/PropertyServices'
},
{
path
:
'./Detail'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./Edit'
,
component
:
'./CommercialService/Detail'
},
]
]
,
},
{
path
:
'./RenovationApplication'
,
...
...
@@ -226,10 +226,10 @@ export default defineConfig({
path
:
'./ReportOnline'
,
name
:
'reportonline'
,
routes
:
[
{
path
:
"./"
,
component
:
'./CommercialService/PropertyServices'
},
{
path
:
'./'
,
component
:
'./CommercialService/PropertyServices'
},
{
path
:
'./Detail'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./Edit'
,
component
:
'./CommercialService/Detail'
},
]
]
,
},
{
path
:
'./ShelfLifeService'
,
...
...
@@ -244,12 +244,12 @@ export default defineConfig({
{
path
:
'./OwnerComplaints/Edit'
,
component
:
'./CommercialService/Detail'
},
],
},
{
path
:
'/OrderManagement'
,
name
:
'ordermanagement'
,
icon
:
'ContainerOutlined'
,
routes
:
[{
path
:
'./'
,
component
:
'./OrderManagement/Order'
}],
},
//
{
//
path: '/OrderManagement',
//
name: 'ordermanagement',
//
icon: 'ContainerOutlined',
//
routes: [{ path: './', component: './OrderManagement/Order' }],
//
},
{
path
:
'/ContractManagement'
,
name
:
'contractmanagement'
,
...
...
src/components/SelectOptions/index.jsx
View file @
059303cf
...
...
@@ -74,6 +74,7 @@ class SelectOptions extends React.PureComponent {
flag
:
false
,
lastValue
:
null
,
};
console
.
log
(
this
.
state
);
}
else
{
this
.
state
=
{
menuList
:
ArrayToPingYin
.
get
(
list
),
...
...
@@ -102,13 +103,13 @@ class SelectOptions extends React.PureComponent {
componentDidUpdate
(
prevProps
)
{
if
(
this
.
props
.
show
!=
null
)
{
if
(
this
.
props
.
show
==
this
.
state
.
flag
)
{
console
.
log
(
this
.
props
.
show
);
//
console.log(this.props.show);
if
(
this
.
props
.
show
==
false
)
{
this
.
setState
({
componetVisible
:
this
.
state
.
selectoptionsOpen
,
flag
:
true
});
}
else
{
this
.
setState
({
componetVisible
:
this
.
state
.
selectoptionsPutItAway
,
flag
:
false
});
}
console
.
log
(
this
.
state
.
componetVisible
);
//
console.log(this.state.componetVisible);
}
// if (this.props.list.length > this.state.checkedList.length) {
// }
...
...
src/models/CommunityManagement/VisitorRecord.ts
View file @
059303cf
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 202
0-12-04 17:24:27
* @LastEditTime: 202
1-02-03 17:43:00
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\VisitorRecord.ts
...
...
@@ -54,9 +54,8 @@ export default {
{
// 总数据
let
Data
=
resp
.
data
.
rows
;
let
DataSave
=
resp
.
data
.
rows
;
console
.
log
(
'??'
)
;
yield
put
({
type
:
'returnPage'
,
Data
});
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
}
break
;
}
...
...
src/pages/AccountManagement/account/AccountAdds.tsx
View file @
059303cf
...
...
@@ -389,7 +389,7 @@ const Account = (props: any) => {
const
AccountProps
=
(
state
:
any
)
=>
{
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
SubResult
,
Info
}
=
state
.
Account
;
const
loading
=
state
.
loading
.
models
.
Account
||
false
;
const
loading
=
state
.
loading
.
global
;
const
{
user
}
=
state
;
return
{
Data
,
...
...
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
059303cf
...
...
@@ -673,8 +673,9 @@ const Account = (props: any) => {
};
const
AccountProps
=
(
state
:
any
)
=>
{
console
.
log
(
state
.
loading
);
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
SubResult
,
Permission
,
Info
}
=
state
.
Account
;
const
loading
=
state
.
loading
.
models
.
Account
||
false
;
const
loading
=
state
.
loading
.
global
;
const
{
user
}
=
state
;
return
{
Data
,
...
...
src/pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
View file @
059303cf
...
...
@@ -17,9 +17,9 @@ const VisitorRecord = (props: any) => {
// 新增搜索的时间 原来时间是时间戳格式
useEffect
(()
=>
{
if
(
Data
!=
null
&&
CommunityList
!=
null
)
{
Data
.
forEach
((
item
:
any
)
=>
{
item
.
showTime
=
moment
(
item
.
updateTime
).
format
(
'YYYY-MM-DD'
);
});
//
Data.forEach((item: any) => {
//
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
//
});
}
else
{
RA
(
26
,
{
communityNames
:
CommunityList
},
module
,
dispatch
);
}
...
...
@@ -50,7 +50,7 @@ const VisitorRecord = (props: any) => {
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
total
:
Data
!=
null
?
Data
.
length
:
0
,
//
total: Data != null ? Data.length : 0,
defaultPageSize
:
15
,
showSizeChanger
:
false
,
showTitle
:
false
,
...
...
@@ -73,116 +73,16 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const
onSubmitForm
=
(
value
:
any
)
=>
{
// 小区更换为数组
// value.visitorCommunity = value.community.value;
let
visitorCommunity
=
value
.
community
.
value
;
delete
value
.
community
;
if
(
value
.
showTime
)
{
value
.
showTime
=
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
);
}
// 有的话需要先转换 否则会被清除
// 清除 undefind
let
info
=
JSON
.
parse
(
stringifyNoEmptyField
(
value
));
if
(
info
.
showTime
)
{
info
.
showTime
=
moment
(
info
.
showTime
).
format
(
'YYYY-MM-DD'
);
}
// 所有字符串条件检索出来的结果
let
Datas
=
filter
(
info
,
DataSave
);
let
newArr
=
[];
// 开始数组处理
if
(
visitorCommunity
.
length
>
0
)
{
for
(
let
i
in
Datas
)
{
if
(
visitorCommunity
.
indexOf
(
Datas
[
i
].
visitorCommunity
)
!=
-
1
)
{
newArr
.
push
(
Datas
[
i
]);
}
}
}
else
{
// 没有选小区
newArr
=
Datas
;
}
SA
(
newArr
,
module
,
dispatch
);
console
.
log
(
value
);
let
obj
=
{
communityNames
:
value
.
community
.
value
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
''
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
''
,
};
// 点击重置
const
onResetFrom
=
()
=>
{
form
.
resetFields
();
onReset
();
};
// 刷新
const
onReset
=
()
=>
{
SA
(
DataSave
,
module
,
dispatch
);
RA
(
26
,
{
communityNames
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
)
},
module
,
dispatch
,
);
SA
(
obj
,
module
,
dispatch
);
RA
(
26
,
obj
,
module
,
dispatch
);
};
// 去掉null undefined 无效字段
function
removeEmptyField
(
obj
:
any
)
{
var
newObj
=
{};
if
(
typeof
obj
==
'string'
)
{
obj
=
JSON
.
parse
(
obj
);
}
if
(
obj
instanceof
Array
)
{
newObj
=
[];
}
if
(
obj
instanceof
Object
)
{
for
(
var
attr
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
attr
)
&&
obj
[
attr
]
!==
''
&&
obj
[
attr
]
!==
null
&&
obj
[
attr
]
!==
undefined
)
{
if
(
obj
[
attr
]
instanceof
Object
)
{
newObj
[
attr
]
=
removeEmptyField
(
obj
[
attr
]);
}
else
if
(
typeof
obj
[
attr
]
==
'string'
&&
((
obj
[
attr
].
indexOf
(
'{'
)
>
-
1
&&
obj
[
attr
].
indexOf
(
'}'
)
>
-
1
)
||
(
obj
[
attr
].
indexOf
(
'['
)
>
-
1
&&
obj
[
attr
].
indexOf
(
']'
)
>
-
1
))
)
{
try
{
var
attrObj
=
JSON
.
parse
(
obj
[
attr
]);
if
(
attrObj
instanceof
Object
)
{
newObj
[
attr
]
=
removeEmptyField
(
attrObj
);
}
}
catch
(
e
)
{
newObj
[
attr
]
=
obj
[
attr
];
}
}
else
{
newObj
[
attr
]
=
obj
[
attr
];
}
}
}
}
return
newObj
;
}
function
stringifyNoEmptyField
(
obj
:
any
)
{
var
newObj
=
removeEmptyField
(
obj
);
for
(
var
attr
in
newObj
)
{
if
(
newObj
.
hasOwnProperty
(
attr
)
&&
newObj
[
attr
]
instanceof
Array
)
{
newObj
[
attr
]
=
JSON
.
stringify
(
newObj
[
attr
]);
}
}
return
JSON
.
stringify
(
newObj
);
}
// 选择小区名字并赋值
// const opname = (value: any) => {
// form.setFieldsValue({
// visitorCommunity: value,
// });
// };
return
(
<>
<
div
className=
"VisitorRecord"
>
...
...
@@ -210,16 +110,6 @@ const VisitorRecord = (props: any) => {
<
Button
type=
"primary"
htmlType=
"submit"
icon=
{
<
SearchOutlined
/>
}
loading=
{
loading
}
>
Search
{
' '
}
</
Button
>
{
/* <Button
htmlType="button"
onClick={onReset}
style={{ marginLeft: '15px' }}
icon={<ClearOutlined />}
loading={loading}
>
{' '}
Reset
</Button> */
}
</
Form
.
Item
>
<
div
style=
{
{
marginTop
:
24
,
marginRight
:
-
16
,
width
:
'calc(100% + 16px)'
}
}
>
<
Form
.
Item
name=
"community"
label=
""
>
...
...
@@ -232,20 +122,14 @@ const VisitorRecord = (props: any) => {
<
ProTable
loading=
{
loading
}
rowKey=
"id"
dataSource=
{
Data
!=
null
?
Data
:
''
}
dataSource=
{
Data
!=
null
?
Data
.
rows
:
''
}
columns=
{
columns
}
pagination=
{
pagination
}
// pagination={{ current: 1, total: Data.total}}
search=
{
false
}
toolBarRender=
{
false
}
options=
{
{
density
:
false
,
fullScreen
:
false
,
reload
:
false
,
setting
:
false
,
}
}
headerTitle=
"Visitor List"
onReset=
{
onResetFrom
}
//
onReset={onResetFrom}
onSubmit=
{
onSubmitForm
}
/>
</
div
>
...
...
src/pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
View file @
059303cf
...
...
@@ -17,9 +17,9 @@ const VisitorRecord = (props: any) => {
// 新增搜索的时间 原来时间是时间戳格式
useEffect
(()
=>
{
if
(
Data
!=
null
&&
CommunityList
!=
null
)
{
Data
.
forEach
((
item
:
any
)
=>
{
item
.
showTime
=
moment
(
item
.
updateTime
).
format
(
'YYYY-MM-DD'
);
});
//
Data.forEach((item: any) => {
//
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
//
});
}
else
{
RA
(
26
,
{
communityNames
:
CommunityList
},
module
,
dispatch
);
}
...
...
@@ -50,7 +50,7 @@ const VisitorRecord = (props: any) => {
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
total
:
Data
!=
null
?
Data
.
length
:
0
,
//
total: Data != null ? Data.length : 0,
defaultPageSize
:
15
,
showSizeChanger
:
false
,
showTitle
:
false
,
...
...
@@ -73,116 +73,16 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const
onSubmitForm
=
(
value
:
any
)
=>
{
// 小区更换为数组
// value.visitorCommunity = value.community.value;
let
visitorCommunity
=
value
.
community
.
value
;
delete
value
.
community
;
if
(
value
.
showTime
)
{
value
.
showTime
=
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
);
}
// 有的话需要先转换 否则会被清除
// 清除 undefind
let
info
=
JSON
.
parse
(
stringifyNoEmptyField
(
value
));
if
(
info
.
showTime
)
{
info
.
showTime
=
moment
(
info
.
showTime
).
format
(
'YYYY-MM-DD'
);
}
// 所有字符串条件检索出来的结果
let
Datas
=
filter
(
info
,
DataSave
);
let
newArr
=
[];
// 开始数组处理
if
(
visitorCommunity
.
length
>
0
)
{
for
(
let
i
in
Datas
)
{
if
(
visitorCommunity
.
indexOf
(
Datas
[
i
].
visitorCommunity
)
!=
-
1
)
{
newArr
.
push
(
Datas
[
i
]);
}
}
}
else
{
// 没有选小区
newArr
=
Datas
;
}
SA
(
newArr
,
module
,
dispatch
);
console
.
log
(
value
);
let
obj
=
{
communityNames
:
value
.
community
.
value
,
inviterName
:
value
.
inviterName
?
value
.
inviterName
:
''
,
showTime
:
value
.
showTime
?
moment
(
value
.
showTime
).
format
(
'YYYY-MM-DD'
)
:
''
,
};
// 点击重置
const
onResetFrom
=
()
=>
{
form
.
resetFields
();
onReset
();
};
// 刷新
const
onReset
=
()
=>
{
SA
(
DataSave
,
module
,
dispatch
);
RA
(
26
,
{
communityNames
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
)
},
module
,
dispatch
,
);
SA
(
obj
,
module
,
dispatch
);
RA
(
26
,
obj
,
module
,
dispatch
);
};
// 去掉null undefined 无效字段
function
removeEmptyField
(
obj
:
any
)
{
var
newObj
=
{};
if
(
typeof
obj
==
'string'
)
{
obj
=
JSON
.
parse
(
obj
);
}
if
(
obj
instanceof
Array
)
{
newObj
=
[];
}
if
(
obj
instanceof
Object
)
{
for
(
var
attr
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
attr
)
&&
obj
[
attr
]
!==
''
&&
obj
[
attr
]
!==
null
&&
obj
[
attr
]
!==
undefined
)
{
if
(
obj
[
attr
]
instanceof
Object
)
{
newObj
[
attr
]
=
removeEmptyField
(
obj
[
attr
]);
}
else
if
(
typeof
obj
[
attr
]
==
'string'
&&
((
obj
[
attr
].
indexOf
(
'{'
)
>
-
1
&&
obj
[
attr
].
indexOf
(
'}'
)
>
-
1
)
||
(
obj
[
attr
].
indexOf
(
'['
)
>
-
1
&&
obj
[
attr
].
indexOf
(
']'
)
>
-
1
))
)
{
try
{
var
attrObj
=
JSON
.
parse
(
obj
[
attr
]);
if
(
attrObj
instanceof
Object
)
{
newObj
[
attr
]
=
removeEmptyField
(
attrObj
);
}
}
catch
(
e
)
{
newObj
[
attr
]
=
obj
[
attr
];
}
}
else
{
newObj
[
attr
]
=
obj
[
attr
];
}
}
}
}
return
newObj
;
}
function
stringifyNoEmptyField
(
obj
:
any
)
{
var
newObj
=
removeEmptyField
(
obj
);
for
(
var
attr
in
newObj
)
{
if
(
newObj
.
hasOwnProperty
(
attr
)
&&
newObj
[
attr
]
instanceof
Array
)
{
newObj
[
attr
]
=
JSON
.
stringify
(
newObj
[
attr
]);
}
}
return
JSON
.
stringify
(
newObj
);
}
// 选择小区名字并赋值
// const opname = (value: any) => {
// form.setFieldsValue({
// visitorCommunity: value,
// });
// };
return
(
<>
<
div
className=
"VisitorRecord"
>
...
...
@@ -210,16 +110,6 @@ const VisitorRecord = (props: any) => {
<
Button
type=
"primary"
htmlType=
"submit"
icon=
{
<
SearchOutlined
/>
}
loading=
{
loading
}
>
Search
{
' '
}
</
Button
>
{
/* <Button
htmlType="button"
onClick={onReset}
style={{ marginLeft: '15px' }}
icon={<ClearOutlined />}
loading={loading}
>
{' '}
Reset
</Button> */
}
</
Form
.
Item
>
<
div
style=
{
{
marginTop
:
24
,
marginRight
:
-
16
,
width
:
'calc(100% + 16px)'
}
}
>
<
Form
.
Item
name=
"community"
label=
""
>
...
...
@@ -232,20 +122,14 @@ const VisitorRecord = (props: any) => {
<
ProTable
loading=
{
loading
}
rowKey=
"id"
dataSource=
{
Data
!=
null
?
Data
:
''
}
dataSource=
{
Data
!=
null
?
Data
.
rows
:
''
}
columns=
{
columns
}
pagination=
{
pagination
}
// pagination={{ current: 1, total: Data.total}}
search=
{
false
}
toolBarRender=
{
false
}
options=
{
{
density
:
false
,
fullScreen
:
false
,
reload
:
false
,
setting
:
false
,
}
}
headerTitle=
"Visitor List"
onReset=
{
onResetFrom
}
//
onReset={onResetFrom}
onSubmit=
{
onSubmitForm
}
/>
</
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