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
29b2228f
Commit
29b2228f
authored
Dec 14, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限分配
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
64029eb2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
93 additions
and
93 deletions
+93
-93
CellList.ts
src/models/CommunityManagement/CellList.ts
+4
-10
init.ts
src/models/init.ts
+18
-0
login.ts
src/models/login.ts
+1
-0
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+15
-3
CellList.tsx
src/pages/CommunityManagement/CellList/CellList.tsx
+20
-38
Details.tsx
src/pages/CommunityManagement/CellList/Details.tsx
+0
-1
FacilityBookings.tsx
...CommunityManagement/FacilityBookings/FacilityBookings.tsx
+15
-4
VisitorRecord.tsx
...pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
+3
-14
VisitorRecord.tsx
...pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
+3
-14
Contract.tsx
src/pages/ContractManagement/Contract.tsx
+11
-7
Template.tsx
src/pages/runTest/Template.tsx
+1
-1
log.ts
src/utils/log.ts
+2
-1
No files found.
src/models/CommunityManagement/CellList.ts
View file @
29b2228f
...
...
@@ -48,13 +48,7 @@ export default {
//标准请求
*
RA
({
playload
},
{
call
,
put
})
{
const
resp
=
yield
call
(
service
.
RA
,
playload
);
// if (resp.code == 500||resp.error_code!="0000") {
// }
if
(
resp
.
code
==
500
&&
resp
.
error_code
!=
'0000'
)
{
getObjectInfo
(
playload
.
body
);
printf
(
playload
,
resp
);
message
.
error
(
`
${
resp
.
code
}
:
${
resp
.
msg
}
`
);
}
else
if
(
resp
.
error_code
==
'0001'
)
{
if
(
resp
.
error_code
!=
'0000'
)
{
getObjectInfo
(
playload
.
body
);
printf
(
playload
,
resp
);
message
.
error
(
`
${
resp
.
error_code
}
:
${
resp
.
error_msg
}
`
);
...
...
@@ -79,9 +73,9 @@ export default {
let
village
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
yield
put
({
type
:
'returnVillage'
,
village
});
// 提示跳转
message
.
success
(
`Information saved successfully!`
);
history
.
push
(
'/CommunityManagement/CellList'
);
// 告知结果
yield
put
({
type
:
'returnResult'
,
Result
}
);
}
break
;
case
32
:
// 获取小区详情
...
...
src/models/init.ts
View file @
29b2228f
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-14 18:28:21
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\init.ts
*/
import
*
as
service
from
'../services/Init'
;
import
{
message
}
from
'antd'
;
...
...
@@ -20,6 +28,16 @@ export default {
*
tosCommunityget
({
playload
},
{
call
,
put
})
{
const
resp
=
yield
call
(
service
.
tosCommunityget
,
playload
);
let
CommunityList
=
resp
.
data
.
communityList
;
localStorage
.
setItem
(
'CommunityList'
,
JSON
.
stringify
(
CommunityList
));
yield
put
({
type
:
'returnCommunityList'
,
CommunityList
});
},
// 新增,
*
addCommunityget
({
playload
},
{
call
,
put
,
select
})
{
const
newData
=
playload
?
playload
.
Result
:
[];
// 如果是null 就是空数组
const
village
=
yield
select
((
state
)
=>
state
.
Init
.
CommunityList
);
const
CommunityList
=
[...
village
,
...
newData
];
localStorage
.
setItem
(
'CommunityList'
,
JSON
.
stringify
(
CommunityList
));
yield
put
({
type
:
'returnCommunityList'
,
CommunityList
});
},
},
...
...
src/models/login.ts
View file @
29b2228f
...
...
@@ -139,6 +139,7 @@ const Model: LoginModelType = {
// 清楚用户信息
localStorage
.
removeItem
(
'userInfo'
);
localStorage
.
removeItem
(
'permission'
);
localStorage
.
removeItem
(
'CommunityList'
);
setCookie
(
'token'
,
''
);
setCookie
(
'id'
,
''
);
setCookie
(
'name'
,
''
);
...
...
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
29b2228f
...
...
@@ -31,7 +31,7 @@ const { RangePicker } = TimePicker;
const
Adds
=
(
props
:
any
)
=>
{
const
module
=
'CellList'
;
const
{
Data
,
dispatch
,
loading
,
imgUrl
}
=
props
;
const
{
Data
,
dispatch
,
loading
,
imgUrl
,
Result
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -102,6 +102,17 @@ const Adds = (props: any) => {
}
},
[
Data
]);
// 提交成功与否
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
// 更新本地小区
dispatch
({
type
:
'Init/addCommunityget'
,
playload
:
{
Result
:
new
Array
(
Result
.
data
)
}
});
// 提示跳转
message
.
success
(
`Information saved successfully!`
);
history
.
push
(
'/CommunityManagement/CellList'
);
}
},
[
Result
]);
// 监听编辑预览是否获取到地址以及发生改变
useEffect
(()
=>
{
if
(
imgUrl
!=
null
)
{
...
...
@@ -622,10 +633,11 @@ const Adds = (props: any) => {
// export default Adds;
function
map
(
state
:
any
)
{
console
.
log
(
state
);
const
Data
=
state
.
CellList
.
DataSave
;
const
{
imgUrl
}
=
state
.
CellList
;
const
{
imgUrl
,
Result
}
=
state
.
CellList
;
const
loading
=
state
.
loading
.
models
.
CellList
?
state
.
loading
.
models
.
CellList
:
false
;
const
{
Result
}
=
state
.
CellList
;
return
{
Data
,
loading
,
Result
,
imgUrl
};
}
export
default
connect
(
map
)(
Adds
);
src/pages/CommunityManagement/CellList/CellList.tsx
View file @
29b2228f
...
...
@@ -10,8 +10,6 @@ import TitleSearch from '@/components/TitleSearch/TitleSearch';
import
{
RA
,
SA
}
from
'@/utils/method'
;
import
{
objectColumns
}
from
'@/utils/string'
;
import
{
getCookie
}
from
'@/utils/method'
;
const
module
=
'CellList'
;
import
'./celllist.less'
;
...
...
@@ -59,59 +57,43 @@ const CellLists = (props: any) => {
],
]);
const
{
dispatch
,
Data
,
loading
,
curString
,
village
}
=
props
;
const
{
dispatch
,
loading
,
curString
,
village
,
Init
}
=
props
;
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 拉取数据的条件存储
const
[
term
,
setTerm
]
=
useState
({
communityNameList
:
Init
.
CommunityList
,
pageNum
:
1
}
as
any
);
// 拉取数据的条件存储
// 翻页数据
// function pagesList(name: string, list: any, num: number) {
// let msg = {
// residentialManagerUserName: name ? name : '',
// communityNameList: list,
// pageNum: num,
// };
// return msg;
// }
// 监听是否有数据
// 监听是否有小区列表
useEffect
(()
=>
{
if
(
Data
!=
null
)
{
let
obj
=
{
residentialManagerUserName
:
''
,
communityNameList
:
Data
.
communityList
,
if
(
village
==
null
)
{
const
obj
=
{
communityNameList
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
),
pageNum
:
1
,
};
setTerm
(
obj
);
// 存进搜索条件
}
else
{
const
userInfo
=
localStorage
.
getItem
(
'userInfo'
)
||
''
;
const
id
=
JSON
.
parse
(
userInfo
).
userModel
.
id
;
RA
(
55
,
{
id
:
id
},
module
,
dispatch
);
}
},
[
Data
]);
// 监听是否有数据
useEffect
(()
=>
{
if
(
village
==
null
)
{
RA
(
48
,
term
,
module
,
dispatch
);
setTerm
(
obj
);
RA
(
48
,
obj
,
module
,
dispatch
);
}
},
[
village
]);
const
goToAdd
=
()
=>
{
SA
(
null
as
any
,
module
,
dispatch
);
// 清空之前传递的数据
dispatch
({
type
:
module
+
'/urlRemove'
});
// 清掉图片信息
emptys
(
null
);
history
.
push
(
'/CommunityManagement/CellList/Add'
);
};
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
dispatch
({
type
:
module
+
'/urlRemove'
});
// 清掉图片信息
SA
(
values
,
module
,
dispatch
);
emptys
(
values
);
history
.
push
(
'/CommunityManagement/CellList/Add'
);
};
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
dispatch
({
type
:
module
+
'/urlRemove'
});
// 清掉图片信息
SA
(
values
,
module
,
dispatch
);
emptys
(
values
);
history
.
push
(
'/CommunityManagement/CellList/Detail'
);
};
// 清除操作之前的数据
const
emptys
=
(
data
:
any
)
=>
{
dispatch
({
type
:
module
+
'/urlRemove'
});
// 清掉图片信息
SA
(
data
,
module
,
dispatch
);
dispatch
({
type
:
module
+
'/ResultClear'
});
// 清空之前保存成功的结果
};
// 点击搜索
const
CallBackTitleSearch
=
(
comment
:
any
)
=>
{
...
...
@@ -122,7 +104,6 @@ const CellLists = (props: any) => {
pageNum
:
1
,
};
setTerm
(
obj
);
// 存进搜索条件
RA
(
48
,
obj
,
module
,
dispatch
);
}
else
{
message
.
error
(
'Please Enter And Select A Content To Search!'
);
...
...
@@ -205,7 +186,8 @@ const CellLists = (props: any) => {
function
map
(
state
:
any
)
{
const
loading
=
state
.
loading
.
models
.
CellList
;
const
Init
=
state
.
Init
;
const
{
Data
,
curString
,
village
}
=
state
[
module
];
return
{
Data
,
loading
,
curString
,
village
};
return
{
Data
,
loading
,
curString
,
village
,
Init
};
}
export
default
connect
(
map
)(
CellLists
);
src/pages/CommunityManagement/CellList/Details.tsx
View file @
29b2228f
...
...
@@ -297,7 +297,6 @@ const Detail = (props: any) => {
function
map
(
state
:
any
)
{
const
{
DataSave
,
detailData
,
imgUrl
,
overCom
}
=
state
.
CellList
;
// 上层传递来的值
const
loading
=
state
.
loading
.
models
.
CellList
;
console
.
log
(
state
);
return
{
DataSave
,
detailData
,
loading
,
imgUrl
,
overCom
};
}
export
default
connect
(
map
)(
Detail
);
src/pages/CommunityManagement/FacilityBookings/FacilityBookings.tsx
View file @
29b2228f
...
...
@@ -136,14 +136,19 @@ const FacilityBookings = (props: any) => {
setColumns2
(
objectColumns
(
key2
)
as
any
);
if
(
curString
.
tab
==
1
)
{
RA
(
9
,
{
communityNameList
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
),
userToken
:
token
,
pageNum
:
curString
.
curPage
,
subscribeDate
:
curString
.
subscribeDate
,
status
:
curString
.
status
,
communityNameList
:
curString
.
communityNameList
,
//
communityNameList: curString.communityNameList,
});
}
else
{
RA
(
8
,
{
userToken
:
token
,
pageNum
:
curString
.
curPage2
});
RA
(
8
,
{
userToken
:
token
,
pageNum
:
curString
.
curPage2
,
communityNameList
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
),
});
}
},
[]);
...
...
@@ -190,14 +195,19 @@ const FacilityBookings = (props: any) => {
QA
(
tmp
);
if
(
tab
==
1
)
{
RA
(
9
,
{
communityNameList
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
),
userToken
:
token
,
status
:
curString
.
status
,
subscribeDate
:
curString
.
subscribeDate
,
pageNum
:
curString
.
curPage
,
communityNameList
:
curString
.
communityNameList
,
//
communityNameList: curString.communityNameList,
});
}
else
{
RA
(
8
,
{
userToken
:
token
,
pageNum
:
curString
.
curPage2
});
RA
(
8
,
{
userToken
:
token
,
pageNum
:
curString
.
curPage2
,
communityNameList
:
JSON
.
parse
(
localStorage
.
getItem
(
'CommunityList'
)
as
any
),
});
}
}
function
Pagechange
(
current
:
any
,
pageSize
:
any
)
{
...
...
@@ -378,6 +388,7 @@ const FacilityBookings = (props: any) => {
};
function
mapStateToProps
(
state
:
any
)
{
console
.
log
(
state
);
const
{
Data
,
Data2
,
DataSave
,
curString
,
Result
}
=
state
.
FacilityBookings
;
const
{
token
}
=
state
.
login
;
const
loading
=
...
...
src/pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
View file @
29b2228f
...
...
@@ -43,33 +43,22 @@ const VisitorRecord = (props: any) => {
{
title
:
'Visiting Time'
,
dataIndex
:
'updateTime'
,
valueType
:
'date'
,
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
,
},
{
title
:
'Community'
,
dataIndex
:
'visitorCommunity'
},
// { title: 'Unit', dataIndex: 'inviterAddress' },
{
title
:
'Unit No'
,
title
:
'Unit No
.
'
,
dataIndex
:
'inviterAddress'
,
render
:
(
text
:
any
)
=>
<
span
>
{
text
}
</
span
>,
},
// ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
];
const
CallBackTitleSearch
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
// visitorCommunity
TosVisitorRecordGet
({
visitorCommunity
:
values
.
inviterAddress
,
});
};
const
[
form
]
=
Form
.
useForm
();
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
total
:
Data
!=
null
?
Data
.
length
:
0
,
defaultPageSize
:
1
2
,
defaultPageSize
:
1
5
,
showSizeChanger
:
false
,
showTitle
:
false
,
showTotal
:
false
,
...
...
src/pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
View file @
29b2228f
...
...
@@ -43,33 +43,22 @@ const VisitorRecord = (props: any) => {
{
title
:
'Visiting Time'
,
dataIndex
:
'updateTime'
,
valueType
:
'date'
,
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
,
},
{
title
:
'Community'
,
dataIndex
:
'visitorCommunity'
},
// { title: 'Unit', dataIndex: 'inviterAddress' },
{
title
:
'Unit No'
,
title
:
'Unit No
.
'
,
dataIndex
:
'inviterAddress'
,
render
:
(
text
:
any
)
=>
<
span
>
{
text
}
</
span
>,
},
// ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
];
const
CallBackTitleSearch
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
// visitorCommunity
TosVisitorRecordGet
({
visitorCommunity
:
values
.
inviterAddress
,
});
};
const
[
form
]
=
Form
.
useForm
();
// 分页
const
pagination
:
any
=
{
defaultCurrent
:
1
,
total
:
Data
!=
null
?
Data
.
length
:
0
,
defaultPageSize
:
1
2
,
defaultPageSize
:
1
5
,
showSizeChanger
:
false
,
showTitle
:
false
,
showTotal
:
false
,
...
...
src/pages/ContractManagement/Contract.tsx
View file @
29b2228f
...
...
@@ -9,7 +9,7 @@ import styles from './ContractContent.less';
import
SearchOptionsCommnity
from
'@/components/SearchOptions/SearchOptionsCommnity'
;
const
Contract
=
(
props
:
any
)
=>
{
const
{
location
,
dispatch
,
Contract
,
loading
}
=
props
;
const
{
location
,
dispatch
,
Contract
,
loading
,
Init
}
=
props
;
const
{
Data
}
=
Contract
;
// 把请求装在一个地方
...
...
@@ -20,11 +20,14 @@ const Contract = (props: any) => {
// 数据
useEffect
(()
=>
{
if
(
Data
==
null
)
{
//如果没数据请求一次
let
obj
=
{
pageNum
:
1
,
};
RA
(
19
,
obj
);
if
(
Init
!=
null
)
{
//如果没数据请求一次
let
obj
=
{
communityNameList
:
Init
.
CommunityList
,
pageNum
:
1
,
};
RA
(
19
,
obj
);
}
}
},
[
Data
]);
...
...
@@ -230,10 +233,11 @@ const Contract = (props: any) => {
};
const
mapStateToProps
=
(
state
:
any
)
=>
{
cons
ole
.
log
(
state
)
;
cons
t
Init
=
state
.
Init
;
return
{
Contract
:
state
.
Contract
,
loading
:
state
.
loading
.
models
.
Contract
||
false
,
Init
,
};
};
...
...
src/pages/runTest/Template.tsx
View file @
29b2228f
...
...
@@ -22,7 +22,7 @@ const Guard = (props: any) => {
return
(
<
div
className=
{
styles
.
base
}
>
<
TitleGet
title=
{
'Version 1.5.
2
'
}
/>
<
TitleGet
title=
{
'Version 1.5.
3
'
}
/>
{
/* <p>
token:{page.token}
name:{getCookie('name')}
...
...
src/utils/log.ts
View file @
29b2228f
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-1
1 14:22:2
7
* @LastEditTime: 2020-12-1
4 18:21:4
7
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\log.ts
...
...
@@ -18,6 +18,7 @@ export const logOut = () => {
localStorage
.
removeItem
(
'userInfo'
);
localStorage
.
removeItem
(
'loginTime'
);
localStorage
.
removeItem
(
'permission'
);
localStorage
.
removeItem
(
'CommunityList'
);
// 清掉本域名所有cookie
let
keys
=
document
.
cookie
.
match
(
/
[^
=;
]
+
(?=
=
)
/g
);
if
(
keys
)
{
...
...
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