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
b8ae18d8
Commit
b8ae18d8
authored
Nov 18, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小区公告,合同模板修复,账号编辑
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
f8fa3286
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
973 additions
and
132 deletions
+973
-132
config.ts
config/config.ts
+1
-1
SearchOptionsCommnity.tsx
src/components/SearchOptions/SearchOptionsCommnity.tsx
+2
-1
SearchOptionsTow.tsx
src/components/SearchOptions/SearchOptionsTow.tsx
+3
-1
Account.ts
src/models/CommunityManagement/Account.ts
+18
-4
Account.less
src/pages/AccountManagement/account/Account.less
+7
-1
Account.tsx
src/pages/AccountManagement/account/Account.tsx
+20
-5
AccountAdds.tsx
src/pages/AccountManagement/account/AccountAdds.tsx
+263
-0
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+38
-25
Add.tsx
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
+46
-15
CommunityAnnouncement.tsx
...anagement/CommunityAnnouncement/CommunityAnnouncement.tsx
+1
-1
Contract.tsx
src/pages/ContractManagement/Contract.tsx
+1
-1
ContractDetail copy.tsx
src/pages/ContractManagement/ContractDetail copy.tsx
+146
-0
ContractDetail.tsx
src/pages/ContractManagement/ContractDetail.tsx
+425
-75
tip.ts
src/utils/tip.ts
+2
-2
No files found.
config/config.ts
View file @
b8ae18d8
...
...
@@ -344,7 +344,7 @@ export default defineConfig({
routes
:
[
{
path
:
'./'
,
component
:
'./AccountManagement/account/Account'
},
{
path
:
'./edit'
,
component
:
'./AccountManagement/account/AccountEdit'
},
{
path
:
'./Add'
,
component
:
'./AccountManagement/account/Account
Edit
'
},
{
path
:
'./Add'
,
component
:
'./AccountManagement/account/Account
Adds
'
},
{
path
:
'./reset'
,
component
:
'./AccountManagement/account/AccountReset'
},
],
},
...
...
src/components/SearchOptions/SearchOptionsCommnity.tsx
View file @
b8ae18d8
...
...
@@ -4,7 +4,7 @@ import SearchOptions from './SearchOptions';
import
SearchOptionsTow
from
'./SearchOptionsTow'
;
const
SearchOptionsCommnity
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
type
}
=
props
;
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
type
,
disabled
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
...
...
@@ -32,6 +32,7 @@ const SearchOptionsCommnity = (props: any) => {
// onSubmit=
{
extendName
}
/
>
<
SearchOptionsTow
disabled
=
{
disabled
}
list
=
{
CommunityList
}
extendName
=
{
extendName
}
def
=
{
defaultName
}
...
...
src/components/SearchOptions/SearchOptionsTow.tsx
View file @
b8ae18d8
...
...
@@ -3,7 +3,7 @@ import { Select } from 'antd';
const
{
Option
}
=
Select
;
const
SearchOptionsTow
=
(
porps
:
any
)
=>
{
const
{
list
,
extendName
,
def
,
type
}
=
porps
;
const
{
list
,
extendName
,
def
,
type
,
disabled
}
=
porps
;
const
options
=
list
.
map
((
d
:
any
,
index
:
number
)
=>
(
<
Option
value=
{
d
}
key=
{
index
}
>
...
...
@@ -27,6 +27,7 @@ const SearchOptionsTow = (porps: any) => {
optionFilterProp=
"children"
onChange=
{
onChange
}
defaultValue=
{
def
}
disabled=
{
disabled
}
>
{
options
}
</
Select
>
...
...
@@ -39,6 +40,7 @@ const SearchOptionsTow = (porps: any) => {
optionFilterProp=
"children"
onChange=
{
onChange
}
defaultValue=
{
def
}
disabled=
{
disabled
}
>
{
options
}
</
Select
>
...
...
src/models/CommunityManagement/Account.ts
View file @
b8ae18d8
...
...
@@ -34,7 +34,7 @@ export default {
//标准请求
*
RA
({
playload
},
{
call
,
put
})
{
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
);
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
'0000'
)
{
}
if
(
resp
.
error_code
!=
'0000'
)
{
...
...
@@ -47,8 +47,17 @@ export default {
// yield put({ type: 'returnPage', Data });
}
break
;
case
38
:
{
console
.
log
(
resp
);
}
break
;
case
42
:
{
// 保存成功, 清掉原来数据 并且跳转
message
.
success
(
'Submitted Successfully !'
);
let
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
history
.
go
(
-
1
);
}
break
;
...
...
@@ -66,7 +75,7 @@ export default {
break
;
case
52
:
// 修改账号状态
{
let
Result
=
resp
.
data
;
let
Result
=
resp
.
error_code
;
yield
put
({
type
:
'returnResult'
,
Result
});
}
break
;
...
...
@@ -74,13 +83,18 @@ export default {
}
},
*
ReData
({},
{
put
})
{
var
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
},
*
ResultClear
({},
{
put
})
{
var
tmp
=
null
;
yield
put
({
type
:
'returnResult'
,
tmp
});
},
*
SA
({
playload
},
{
call
,
put
})
{
var
DataSave
=
playload
;
*
SA
({
DataSave
},
{
call
,
put
})
{
console
.
log
(
DataSave
)
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
},
...
...
src/pages/AccountManagement/account/Account.less
View file @
b8ae18d8
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 24px;
}
.contop {
background: #fff;
padding: 20px;
border-right: 4px;
margin-bottom: 15px;
h3 {
margin-bottom:
0
;
margin-bottom:
15px
;
position: relative;
.back {
position: absolute;
...
...
src/pages/AccountManagement/account/Account.tsx
View file @
b8ae18d8
...
...
@@ -23,12 +23,21 @@ const Account = (props: any) => {
if
(
Data
==
null
)
{
Refresh
();
}
},
[
Data
]);
//
页面进来
执行一次
},
[
Data
]);
//
监听Data
执行一次
// 监听改变状态提交结果
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
console
.
log
(
'改变'
);
// console.log('改变取消弹窗重新加载,在清空结果');
// let obj = {
// userStatus: accountName.userStatus == 0 ? 1 : 0,
// userID: accountName.tosUserId,
// };
// RA(52, obj);
setOver
(
false
);
// 清除结果
dispatch
({
type
:
'Account/ResultClear'
});
dispatch
({
type
:
'Account/ReData'
});
}
},
[
Result
]);
...
...
@@ -128,10 +137,17 @@ const Account = (props: any) => {
// 编辑- 新增
const
edit
=
(
item
:
any
)
=>
{
item
==
1
?
history
.
push
(
'./account/Add'
)
:
history
.
push
(
'./account/edit'
);
// console.log(item);
if
(
item
==
1
)
{
history
.
push
(
'./account/Add'
);
}
else
{
let
DataSave
=
item
;
dispatch
({
type
:
'Account/SA'
,
DataSave
});
history
.
push
(
'./account/edit'
);
}
};
// 停用账号
// 停用账号
弹窗
const
lockS
=
(
item
:
any
)
=>
{
setOver
(
true
);
setaccountName
(
item
);
...
...
@@ -278,7 +294,6 @@ const Account = (props: any) => {
};
const
AccountProps
=
(
styte
:
any
)
=>
{
console
.
log
(
styte
);
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
}
=
styte
.
Account
;
const
loading
=
styte
.
loading
.
models
.
Account
||
false
;
return
{
...
...
src/pages/AccountManagement/account/AccountAdds.tsx
0 → 100644
View file @
b8ae18d8
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Button
,
Pagination
,
message
,
Descriptions
,
Checkbox
,
Tree
,
Radio
,
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
SearchOutlined
,
ClearOutlined
,
EditOutlined
,
LeftOutlined
}
from
'@ant-design/icons'
;
import
{
getCookie
}
from
'@/utils/method'
;
import
'./Account.less'
;
import
{
zhCnFaci
}
from
'@/utils/power'
;
import
{
AccountTip
}
from
'@/utils/tip'
;
import
SelectCommunity
from
'@/components/SelectCommunity'
;
import
{
getNumber
}
from
'@/utils/string'
;
// 正则
import
{
RA
}
from
'@/utils/method'
;
import
moment
from
'moment'
;
const
Account
=
(
props
:
any
)
=>
{
const
module
=
'Account'
;
const
{
dispatch
,
Data
,
DataSave
,
DataSaveDetail
,
Result
,
loading
,
CommunityList
}
=
props
;
// 拉取数据的条件存储
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 小区列表
// const [comList, setCommunityList] = useState(CommunityList as any);
// // 数据
// useEffect(() => {
// if (CommunityList != null) {
// setCommunityList(CommunityList);
// }
// }, [CommunityList]);
// 权限列表
const
treeData
=
zhCnFaci
;
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
string
[]
>
([]);
// 展开栏目
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
<
string
[]
>
([]);
// 默认已选栏目
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
<
string
[]
>
([]);
// 设置选中的树节点
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
<
boolean
>
(
true
);
// 树形菜单展开关闭
// 单选 二级还是三级管理员
const
[
values
,
setvalues
]
=
useState
(
2
);
// 树形菜单展开关闭
// 表单标识
const
[
form
]
=
Form
.
useForm
();
const
formRef
=
useRef
(
null
);
// 保存提交
const
onFinishContract
=
async
(
value
:
any
)
=>
{
// console.log(value);
if
(
checkedKeys
.
length
==
0
)
{
// 权限
message
.
error
(
'Please Select Permission!'
);
return
false
;
}
else
if
(
value
.
community
.
value
==
null
||
value
.
community
.
value
.
length
==
0
)
{
// 小区
message
.
error
(
'Please Select The Jurisdiction Area!'
);
return
false
;
}
else
if
(
value
.
tosUserName
.
length
<
6
)
{
// 账号长度
message
.
error
(
'The Account Password is Greater Than 6 Digits!'
);
return
false
;
}
else
{
value
.
tosUserServiceCellList
=
value
.
community
.
value
;
// 管辖小区
value
.
tosUserEmail
=
value
.
tosUserName
;
// 邮箱就是账号
value
.
tosUserLevel
=
values
;
//级别
value
.
creatorName
=
getCookie
(
'name'
);
//新建者账号
value
.
creatorId
=
getCookie
(
'id'
);
//新建者ID
delete
value
.
community
;
// console.log(value);
// 另传权限
let
obj
=
{
userName
:
value
.
tosUserName
,
userPassword
:
value
.
tosUserPwd
,
permissionArray
:
checkedKeys
.
sort
((
n1
,
n2
)
=>
{
return
parseInt
(
n1
)
-
parseInt
(
n2
);
}),
};
// console.log(obj);
RA
(
38
,
value
,
module
,
dispatch
);
// 信息上传
RA
(
42
,
obj
,
module
,
dispatch
);
// 权限上传
}
};
//goToReturn
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
// 全选
const
onCheckAllChange
=
(
e
:
any
)
=>
{};
// 展开/收起树形菜单触发
const
onExpand
=
(
expandedKeys
:
any
)
=>
{
setExpandedKeys
(
expandedKeys
);
setAutoExpandParent
(
false
);
};
// 点击单个触发
const
onCheck
=
(
checkedKeys
:
any
)
=>
{
console
.
log
(
'onCheck'
,
checkedKeys
);
setCheckedKeys
(
checkedKeys
);
};
// 点击树节点触发 - 大栏目
const
onSelect
=
(
selectedKeys
:
any
,
info
:
any
)
=>
{
console
.
log
(
'onSelect'
,
info
);
setSelectedKeys
(
selectedKeys
);
};
// 管理员级别样式
const
radioStyle
=
{
display
:
'block'
,
height
:
'30px'
,
lineHeight
:
'30px'
,
marginBottom
:
'15px'
,
};
//级别切换
const
onRadio
=
(
e
:
any
)
=>
{
setvalues
(
e
.
target
.
value
);
};
//手机号
const
keyup_communityManagerFee
=
(
e
:
any
)
=>
{
e
.
target
.
value
=
keyup_tool
(
e
.
target
.
value
);
};
const
keyup_tool
=
(
value
:
any
)
=>
{
return
getNumber
(
value
.
replace
(
/
[^\d
^
\.]
+/g
,
''
));
};
// 选择小区名字并赋值
return
(
<>
<
div
className=
"contop"
style=
{
{
padding
:
'12px 20px'
}
}
>
<
h3
className=
"capi"
>
<
EditOutlined
/>
Add Account
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
Button
>
</
div
>
</
h3
>
<
hr
></
hr
>
<
Form
ref=
{
formRef
}
form=
{
form
}
autoComplete=
"off"
// layout="inline"
layout=
"horizontal"
name=
"contract"
onFinish=
{
onFinishContract
}
>
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserName"
label=
"Account ID"
rules=
{
AccountTip
[
0
]
}
>
<
Input
placeholder=
"Login Account"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosAccountName"
label=
"Name"
rules=
{
AccountTip
[
1
]
}
>
<
Input
placeholder=
"Name Of Administrator"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserPhone"
label=
"Phone"
rules=
{
AccountTip
[
2
]
}
>
<
Input
placeholder=
"Contact Information"
className=
"input"
maxLength=
{
11
}
onKeyUp=
{
keyup_communityManagerFee
}
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
<
Form
.
Item
name=
"community"
label=
"Community"
>
<
SelectCommunity
/>
</
Form
.
Item
>
<
div
className=
"diy"
style=
{
{
marginBottom
:
'14px'
}
}
>
<
div
className=
"label"
>
<
span
className=
"title"
>
Privilege Level:
</
span
>
</
div
>
<
div
className=
"label"
>
<
Radio
.
Group
defaultValue=
{
values
}
onChange=
{
onRadio
}
>
<
Radio
style=
{
radioStyle
}
value=
{
2
}
>
Two Level Administrator
</
Radio
>
<
Radio
style=
{
radioStyle
}
value=
{
3
}
>
Three Level Administrator
{
/* <Input placeholder="三级管理员" style={{ width: 160, marginLeft: 10 }} /> */
}
</
Radio
>
</
Radio
.
Group
>
</
div
>
</
div
>
<
div
className=
"diy"
style=
{
{
marginBottom
:
'24px'
}
}
>
<
div
className=
"label"
>
<
span
className=
"title"
>
Permission List:
</
span
>
</
div
>
<
div
className=
"label"
>
<
Tree
checkable
onExpand=
{
onExpand
}
expandedKeys=
{
expandedKeys
}
autoExpandParent=
{
autoExpandParent
}
onCheck=
{
onCheck
}
checkedKeys=
{
checkedKeys
}
onSelect=
{
onSelect
}
selectedKeys=
{
selectedKeys
}
treeData=
{
treeData
}
/>
</
div
>
</
div
>
<
div
className=
"diy"
>
<
div
className=
"label"
></
div
>
<
div
className=
"label"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
Submit
</
Button
>
</
div
>
</
div
>
</
Form
>
</
div
>
</>
);
};
const
AccountProps
=
(
state
:
any
)
=>
{
console
.
log
(
state
);
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
}
=
state
.
Account
;
const
{
CommunityList
}
=
state
.
Init
;
// 小区列表
const
loading
=
state
.
loading
.
models
.
Account
||
false
;
return
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
loading
,
CommunityList
,
};
};
export
default
connect
(
AccountProps
)(
Account
);
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
b8ae18d8
...
...
@@ -29,40 +29,53 @@ const Account = (props: any) => {
const
{
dispatch
,
Data
,
DataSave
,
DataSaveDetail
,
Result
,
loading
,
CommunityList
}
=
props
;
// 拉取数据的条件存储
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 小区列表
// const [comList, setCommunityList] = useState(CommunityList as any);
// // 数据
// useEffect(() => {
// if (CommunityList != null) {
// setCommunityList(CommunityList);
// }
// }, [CommunityList]);
// 权限列表
const
treeData
=
zhCnFaci
;
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
string
[]
>
([
'0'
]);
// 展开栏目
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
<
string
[]
>
([
'3'
]);
// 默认已选栏目
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
string
[]
>
([]);
// 展开栏目
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
<
string
[]
>
([]);
// 默认已选栏目
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
<
string
[]
>
([]);
// 设置选中的树节点
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
<
boolean
>
(
true
);
// 树形菜单展开关闭
// 单选 二级还是三级管理员
const
[
values
,
setvalues
]
=
useState
(
2
);
// 树形菜单展开关闭
// 已选小区
const
[
ServiceCell
,
setServiceCell
]
=
useState
(
null
as
any
);
// 表单标识
const
[
form
]
=
Form
.
useForm
();
const
formRef
=
useRef
(
null
);
// 拉取数据的条件存储
// const [term, setTerm] = useState({} as any);
// 小区列表
// const [comList, setCommunityList] = useState(CommunityList as any);
// // 数据
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
console
.
log
(
DataSave
);
// 赋值
form
.
setFieldsValue
({
tosUserName
:
DataSave
.
tosUserName
,
tosUserPhone
:
DataSave
.
tosUserPhone
,
tosAccountName
:
DataSave
.
tosAccountName
,
});
setvalues
(
DataSave
.
tosUserLevel
);
// 等级
setServiceCell
(
DataSave
.
tosUserServiceCell
.
split
(
','
));
// 已选小区
}
},
[
DataSave
]);
// 保存提交
const
onFinishContract
=
(
value
:
any
)
=>
{
console
.
log
(
value
);
const
onFinishContract
=
async
(
value
:
any
)
=>
{
//
console.log(value);
if
(
checkedKeys
.
length
==
0
)
{
// 权限
message
.
error
(
'Please Select Permission!'
);
return
false
;
}
else
if
(
value
.
community
.
value
.
length
==
0
)
{
}
else
if
(
value
.
community
.
value
==
null
||
value
.
community
.
value
.
length
==
0
)
{
// 小区
message
.
error
(
'Please Select The Jurisdiction Area!'
);
return
false
;
...
...
@@ -77,7 +90,7 @@ const Account = (props: any) => {
value
.
creatorName
=
getCookie
(
'name'
);
//新建者账号
value
.
creatorId
=
getCookie
(
'id'
);
//新建者ID
delete
value
.
community
;
console
.
log
(
value
);
//
console.log(value);
// 另传权限
let
obj
=
{
...
...
@@ -87,12 +100,13 @@ const Account = (props: any) => {
return
parseInt
(
n1
)
-
parseInt
(
n2
);
}),
};
console
.
log
(
obj
);
//
console.log(obj);
RA
(
38
,
value
,
module
,
dispatch
);
// 信息上传
RA
(
42
,
obj
,
module
,
dispatch
);
// 权限上传
}
};
//goToReturn
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
...
...
@@ -146,7 +160,7 @@ const Account = (props: any) => {
<
div
className=
"contop"
style=
{
{
padding
:
'12px 20px'
}
}
>
<
h3
className=
"capi"
>
<
EditOutlined
/>
{
DataSave
?
'Edit'
:
'Add'
}
Account
Edit
Account
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
...
...
@@ -154,8 +168,8 @@ const Account = (props: any) => {
</
Button
>
</
div
>
</
h3
>
</
div
>
<
div
className=
"contop"
>
<
hr
></
hr
>
<
Form
ref=
{
formRef
}
form=
{
form
}
...
...
@@ -167,7 +181,7 @@ const Account = (props: any) => {
>
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserName"
label=
"Account ID"
rules=
{
AccountTip
[
2
]
}
>
<
Form
.
Item
name=
"tosUserName"
label=
"Account ID"
rules=
{
AccountTip
[
0
]
}
>
<
Input
placeholder=
"Login Account"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
...
...
@@ -175,12 +189,12 @@ const Account = (props: any) => {
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosAccountName"
label=
"Name"
rules=
{
AccountTip
[
0
]
}
>
<
Form
.
Item
name=
"tosAccountName"
label=
"Name"
rules=
{
AccountTip
[
1
]
}
>
<
Input
placeholder=
"Name Of Administrator"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserPhone"
label=
"Phone"
rules=
{
AccountTip
[
1
]
}
>
<
Form
.
Item
name=
"tosUserPhone"
label=
"Phone"
rules=
{
AccountTip
[
2
]
}
>
<
Input
placeholder=
"Contact Information"
className=
"input"
...
...
@@ -246,7 +260,6 @@ const Account = (props: any) => {
};
const
AccountProps
=
(
state
:
any
)
=>
{
console
.
log
(
state
);
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
}
=
state
.
Account
;
const
{
CommunityList
}
=
state
.
Init
;
// 小区列表
const
loading
=
state
.
loading
.
models
.
Account
||
false
;
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
View file @
b8ae18d8
...
...
@@ -26,8 +26,10 @@ const Add = (props: any) => {
const
formRef
=
useRef
(
null
);
const
[
form
]
=
Form
.
useForm
();
// 图片地址
const
[
ImageSrc
,
setImageSrc
]
=
useState
([]
as
any
);
const
[
ImageSrc
,
setImageSrc
]
=
useState
([]
as
any
);
// 图片显示地址
const
[
ImageName
,
setImageName
]
=
useState
([]
as
any
);
// 全部图片名称
const
[
timeT
,
settimeT
]
=
useState
(
true
);
// 结束时间是否禁止选择
const
[
timeOver
,
settimeOver
]
=
useState
(
1
);
// 结束时间禁止天数
// 监听传递过来的值
useEffect
(()
=>
{
...
...
@@ -48,21 +50,29 @@ const Add = (props: any) => {
fileName
:
DataSave
.
noticImageName
,
};
RA
(
47
,
msg
,
module
,
dispatch
);
// 解除结束时间不可选
settimeT
(
false
);
// 图片名
setImageName
(
DataSave
.
noticImageName
.
split
(
','
));
}
},
[
DataSave
]);
// 监听图片状态 ImgSrc
useEffect
(()
=>
{
if
(
ImgSrc
!=
null
)
{
let
imgUrl
=
[
{
uid
:
'-1'
,
name
:
'image.png'
,
let
a
=
ImgSrc
.
map
((
item
:
any
,
index
:
number
)
=>
{
let
key
=
Object
.
keys
(
item
)[
0
];
return
{
uid
:
index
,
name
:
key
,
status
:
'done'
,
url
:
ImgSrc
,
},
];
setImageSrc
(
imgUrl
);
url
:
item
[
key
],
};
});
// 图片列表
setImageSrc
(
a
);
}
},
[
ImgSrc
]);
...
...
@@ -98,7 +108,6 @@ const Add = (props: any) => {
// 提交
const
onFinish
=
(
values
:
any
)
=>
{
// console.log(values);
var
tmp
=
values
;
if
(
DataSave
!=
null
)
{
tmp
.
id
=
DataSave
.
id
;
// 如果是修改传递的 修改ID
...
...
@@ -107,11 +116,11 @@ const Add = (props: any) => {
tmp
.
communityNum
=
values
.
community
.
value
;
tmp
.
noticScope
=
''
+
values
.
community
.
index
;
delete
tmp
.
community
;
// 文件名
tmp
.
noticImageName
=
values
.
file
?
values
.
file
[
0
]
:
null
;
// 文件名
如果动了。 新增删除 就传新的, 否则传旧的
tmp
.
noticImageName
=
values
.
file
?
values
.
file
:
ImageName
.
join
(
','
);
// 传递来的 和 表单的在一起
tmp
.
noticStartTime
=
values
.
noticStartTime
.
format
(
'YYYY-MM-DD'
);
tmp
.
noticEndTime
=
values
.
noticEndTime
?
values
.
noticEndTime
.
format
(
'YYYY-MM-DD'
)
:
null
;
// console.log(tmp);
RA
(
28
,
tmp
,
module
,
dispatch
);
};
...
...
@@ -120,6 +129,22 @@ const Add = (props: any) => {
return
current
&&
current
<=
moment
().
subtract
(
1
,
'days'
).
endOf
(
'day'
);
}
function
disabledDateOver
(
current
:
any
)
{
return
current
&&
current
<=
moment
().
subtract
(
timeOver
,
'days'
).
endOf
(
'day'
);
}
// 开始时间选择后打开结束时间
const
startTime
=
(
date
:
any
)
=>
{
settimeT
(
false
);
// 清除结束时间
form
.
setFieldsValue
({
noticEndTime
:
null
,
});
// 结束时间
let
day
=
moment
().
diff
(
date
,
'days'
)
+
1
;
settimeOver
(
day
);
};
return
(
<>
<
Spin
spinning=
{
loading
}
>
...
...
@@ -177,10 +202,16 @@ const Add = (props: any) => {
style=
{
{
width
:
200
}
}
placeholder=
"Effective Dates"
disabledDate=
{
disabledDate
}
onChange=
{
startTime
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticEndTime"
className=
"diyItem"
label=
"Expiration Date"
rules=
{
[]
}
>
<
DatePicker
style=
{
{
width
:
200
}
}
placeholder=
"Expiration Dates"
/>
<
DatePicker
style=
{
{
width
:
200
}
}
placeholder=
"Expiration Dates"
disabledDate=
{
disabledDateOver
}
disabled=
{
timeT
}
/>
</
Form
.
Item
>
<
hr
/>
<
Form
.
Item
style=
{
{
marginBottom
:
5
}
}
className=
"diyItem"
label=
" "
colon=
{
false
}
>
...
...
src/pages/CommunityManagement/CommunityAnnouncement/CommunityAnnouncement.tsx
View file @
b8ae18d8
...
...
@@ -165,7 +165,7 @@ const CommunityAnnouncement = (props: any) => {
}
else
{
// 要看是哪里分页
let
mlist
=
{
...
value
};
mlist
.
communityNumList
=
value
.
communityNumList
;
mlist
.
communityNumList
=
value
.
communityNumList
.
length
>
0
?
value
.
communityNumList
:
null
;
mlist
.
pageNum
=
1
;
// 把内容存进去
SA
(
DetailPage
(
mlist
),
module
,
dispatch
);
...
...
src/pages/ContractManagement/Contract.tsx
View file @
b8ae18d8
...
...
@@ -53,7 +53,7 @@ const Contract = (props: any) => {
title
:
'Contract Number'
,
render
:
function
(
record
:
any
)
{
let
mom
=
moment
(
record
.
contractValidEndDate
).
diff
(
moment
(),
'months'
);
console
.
log
(
mom
);
//
console.log(mom);
if
(
mom
<
2
)
{
return
(
<
Tooltip
title=
"Due Soon"
placement=
"right"
color=
{
'red'
}
key=
{
record
.
id
}
>
...
...
src/pages/ContractManagement/ContractDetail copy.tsx
0 → 100644
View file @
b8ae18d8
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
Spin
,
Descriptions
}
from
'antd'
;
import
{
LeftOutlined
}
from
'@ant-design/icons'
;
import
moment
from
'moment'
;
import
'./ContractContent.less'
;
import
PreView
from
'@/components/PreView/PreViewTow'
;
const
ContractDetail
=
(
props
:
any
)
=>
{
const
{
Contract
,
dispatch
,
FileImg
,
loading
}
=
props
;
const
{
DataSaveDetail
}
=
Contract
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'Contract/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
});
};
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 图片列表
const
[
tipTime
,
setTipTime
]
=
useState
([
'previous month'
,
'two months'
]
as
any
);
//提示时间
// 带来信息
useEffect
(()
=>
{
if
(
DataSaveDetail
==
null
)
{
history
.
push
(
'/ContractManagement'
);
}
else
{
// 请求
let
objData
=
{
type
:
'tosContractPreview'
,
fileName
:
DataSaveDetail
.
contractFileName
,
extends
:
DataSaveDetail
.
communityName
,
};
RA
(
47
,
objData
);
// 设置提示时间
let
a1
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
.
subtract
(
2
,
'month'
)
.
format
(
'YYYY-MM-DD'
);
let
a2
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
.
subtract
(
1
,
'month'
)
.
format
(
'YYYY-MM-DD'
);
setTipTime
([
a1
,
a2
]);
}
},
[
DataSaveDetail
]);
// 监听图片列表
useEffect
(()
=>
{
if
(
FileImg
!=
null
)
{
let
obj
=
new
Array
();
for
(
var
i
in
FileImg
)
{
let
a
=
{
uid
:
i
,
name
:
FileImg
[
i
].
fileName
,
status
:
'done'
,
type
:
FileImg
[
i
].
fileName
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
FileImg
[
i
].
fileUrl
,
};
obj
.
push
(
a
);
}
setFileList
([...
obj
]);
}
else
{
setFileList
([]);
}
},
[
FileImg
]);
return
(
<
Spin
spinning=
{
loading
}
>
{
DataSaveDetail
?
(
<
div
className=
"base"
>
{
/* 头部组件 */
}
<
div
className=
"box"
>
<
div
className=
"item1"
>
Detail Contract
</
div
>
<
button
className=
"item3"
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
button
>
</
div
>
<
div
className=
""
>
<
Descriptions
title=
""
bordered
layout=
"vertical"
>
<
Descriptions
.
Item
label=
"Contract Number :"
>
{
DataSaveDetail
.
contractNumber
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Party A :"
>
{
DataSaveDetail
.
contractPartyA
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Party B :"
>
{
DataSaveDetail
.
contractPartyB
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contract Title :"
span=
{
2
}
>
{
DataSaveDetail
.
contractTitle
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Community Name :"
>
{
DataSaveDetail
.
communityName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Date :"
>
<
p
>
{
DataSaveDetail
.
contractValidStartDate
}
~
{
DataSaveDetail
.
contractValidEndDate
}
</
p
>
<
p
style=
{
{
marginBottom
:
0
,
color
:
'#999'
}
}
>
The system will send e-mail notification in the
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
0
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
1
]
}
</
span
>
that the contract is about to
expire !
</
p
>
{
/* <p style={{ marginBottom: 0 }}>
<span style={{ color: 'red' }}>*</span> If the time has passed, it will not be
sent
</p> */
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contacts :"
>
{
DataSaveDetail
.
communityAccount
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Phone :"
>
{
DataSaveDetail
.
communityPhone
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contract Annex :"
span=
{
3
}
>
{
fileList
.
map
((
item
:
any
,
index
:
number
)
=>
{
return
<
PreView
OpenUrl=
{
item
}
key=
{
index
}
></
PreView
>;
})
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contract Remarks :"
>
{
DataSaveDetail
.
contractRemindContent
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
div
>
</
div
>
)
:
(
''
)
}
</
Spin
>
);
};
function
mapStateToProps
(
state
:
any
)
{
const
{
Contract
}
=
state
;
const
{
FileImg
}
=
Contract
;
const
loading
=
state
.
loading
.
models
.
Contract
||
false
;
return
{
Contract
,
FileImg
,
loading
,
};
}
export
default
connect
(
mapStateToProps
)(
ContractDetail
);
src/pages/ContractManagement/ContractDetail.tsx
View file @
b8ae18d8
This diff is collapsed.
Click to expand it.
src/utils/tip.ts
View file @
b8ae18d8
...
...
@@ -53,9 +53,9 @@ export const BookingsTip = [
// 账号新增编辑
export
const
AccountTip
=
[
[{
required
:
true
,
type
:
'email'
,
message
:
'Please enter email address !'
}],
[{
required
:
true
,
message
:
'Required'
}],
[{
required
:
true
,
message
:
'Required'
}],
[{
required
:
true
,
message
:
'Required'
}],
[{
required
:
true
,
message
:
'Please enter the correct contact information !'
}],
[{
required
:
true
,
message
:
'Required'
}],
[{
required
:
true
,
message
:
'Required'
}],
[{
required
:
true
,
message
:
'Required'
}],
...
...
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