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
508ba46c
Commit
508ba46c
authored
Mar 03, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报告员
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
2eb42250
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
691 additions
and
12 deletions
+691
-12
config.ts
config/config.ts
+14
-2
PdfUpload.tsx
src/components/Form/PdfUpload.tsx
+5
-3
zip.less
src/components/Form/zip.less
+1
-1
PictureOptionsRow.tsx
src/components/PictureOptions/PictureOptionsRow.tsx
+1
-1
SecurityLayout copy.tsx
src/layouts/SecurityLayout copy.tsx
+2
-0
menu.ts
src/locales/en-US/menu.ts
+3
-2
menu.ts
src/locales/zh-CN/menu.ts
+9
-0
ServicePro.ts
src/models/CommunityManagement/ServicePro.ts
+84
-0
service.less
src/pages/AccountManagement/Service/service.less
+24
-0
service.tsx
src/pages/AccountManagement/Service/service.tsx
+170
-0
serviceDetail.tsx
src/pages/AccountManagement/Service/serviceDetail.tsx
+201
-0
serviceEdit.tsx
src/pages/AccountManagement/Service/serviceEdit.tsx
+157
-0
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+2
-2
params.ts
src/utils/params.ts
+6
-1
power.js
src/utils/power.js
+12
-0
No files found.
config/config.ts
View file @
508ba46c
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-0
2-25 11:57:26
* @LastEditTime: 2021-0
3-03 15:04:15
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
...
...
@@ -376,7 +376,19 @@ export default defineConfig({
{
path
:
'*'
,
component
:
'@/pages/404'
},
],
},
{
path
:
'./service'
,
name
:
'service'
,
routes
:
[
{
path
:
'./'
,
component
:
'./AccountManagement/Service/service'
},
{
path
:
'./edit/:id'
,
component
:
'./AccountManagement/Service/serviceEdit'
},
{
path
:
'./detail/:id'
,
component
:
'./AccountManagement/Service/serviceDetail'
,
},
{
path
:
'*'
,
component
:
'@/pages/404'
},
],
},
{
path
:
'./SystemFeedback'
,
name
:
'systemfeedback'
,
...
...
src/components/Form/PdfUpload.tsx
View file @
508ba46c
/*
* @Author: your name
* @Date: 2021-02-01 14:54:48
* @LastEditTime: 2021-0
2-25 14:28:02
* @LastEditTime: 2021-0
3-03 10:08:06
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
...
...
@@ -214,7 +214,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
onChange
&&
onChange
(
list
);
}
// console.log(list);
setImgList
([...
list
]);
};
...
...
@@ -289,6 +289,8 @@ const PdfUpload: React.FC<PriceInputProps> = ({
const
inpChange
=
(
e
:
any
)
=>
{
let
{
id
,
value
}
=
e
.
target
;
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
imgList
));
// console.log(imgList);
// console.log(id);
list
[
id
].
name
=
value
;
// 在判断上传文件了没 ,上传了的话去掉提示
...
...
@@ -312,7 +314,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
placeholder=
"Basic usage"
className=
"pdf-input"
onChange=
{
inpChange
}
// id=
{
Math
.
floor
(
Math
.
random
()
*
100)
as
any
}
id=
{
index
}
value=
{
item
.
name
}
disabled=
{
disabled
}
maxLength=
{
30
}
...
...
src/components/Form/zip.less
View file @
508ba46c
...
...
@@ -30,7 +30,7 @@
}
.pdf-input {
width:
104
px;
width:
208
px;
margin-right: 10px;
}
.pdf-div {
...
...
src/components/PictureOptions/PictureOptionsRow.tsx
View file @
508ba46c
...
...
@@ -169,7 +169,7 @@ const PictureOptionsRow = (props: any) => {
onChange=
{
handleChange
}
// 点击上传
disabled=
{
props
.
over
}
>
{
fileList
.
length
>=
limitNum
?
null
:
props
.
disabled
?
null
:
uploadButton
}
{
fileList
.
length
>=
limitNum
||
props
.
over
?
null
:
props
.
disabled
?
null
:
uploadButton
}
</
Upload
>
<
Modal
title=
"Preview"
...
...
src/layouts/SecurityLayout copy.tsx
View file @
508ba46c
...
...
@@ -81,6 +81,8 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
{
path
:
'/AccountManagement/account/Detail'
,
title
:
'查看账号'
,
key
:
'63'
},
{
path
:
'/AccountManagement/account/edit'
,
title
:
'编辑账号'
,
key
:
'64'
},
{
path
:
'/AccountManagement/account/Add'
,
title
:
'添加账号'
,
key
:
'65'
},
//报告员
{
path
:
'/AccountManagement/service'
,
title
:
'报告员'
,
key
:
'71'
},
];
// 用户重新打开需要重新登录
...
...
src/locales/en-US/menu.ts
View file @
508ba46c
/*
* @Author: your name
* @Date: 2020-12-14 18:52:22
* @LastEditTime: 2021-0
1-12 14:43:56
* @LastEditors:
your name
* @LastEditTime: 2021-0
3-03 16:23:17
* @LastEditors:
Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\locales\en-US\menu.ts
*/
...
...
@@ -83,4 +83,5 @@ export default {
'menu.accountmanagement.systemfeedback'
:
'System Feedback'
,
'menu.accountmanagement.companyinformation'
:
'Company Information'
,
'menu.accountmanagement.languagesettings'
:
'Language Settings'
,
'menu.accountmanagement.service'
:
'Service Provider Management'
,
};
src/locales/zh-CN/menu.ts
View file @
508ba46c
/*
* @Author: your name
* @Date: 2020-12-14 18:52:22
* @LastEditTime: 2021-03-01 10:05:23
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\locales\zh-CN\menu.ts
*/
export
default
{
'menu.welcome'
:
'欢迎'
,
'menu.more-blocks'
:
'更多区块'
,
...
...
@@ -75,4 +83,5 @@ export default {
'menu.accountmanagement.systemfeedback'
:
'BUG反馈'
,
'menu.accountmanagement.companyinformation'
:
'公司信息'
,
'menu.accountmanagement.languagesettings'
:
'语言设置'
,
'menu.accountmanagement.service'
:
'报告员'
,
};
src/models/CommunityManagement/ServicePro.ts
0 → 100644
View file @
508ba46c
/*
* @Author: your name
* @Date: 2021-01-14 09:23:51
* @LastEditTime: 2021-03-03 15:44:51
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts
*/
import
*
as
service
from
'../../services/tos'
;
import
{
message
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
printf
}
from
'@/utils/log'
;
export
default
{
namespace
:
'ServicePro'
,
state
:
{
Data
:
null
,
DataSave
:
null
,
},
reducers
:
{
returnPage
(
state
,
{
Data
})
{
return
{
...
state
,
Data
};
},
returnDataSave
(
state
,
{
DataSave
})
{
return
{
...
state
,
DataSave
};
},
returnDataSaveCommunity
(
state
,
{
Community
})
{
let
DataSave
=
{
...
state
.
DataSave
,
...
Community
};
return
{
...
state
,
DataSave
};
},
},
effects
:
{
//标准请求
*
RA
({
playload
},
{
call
,
put
})
{
const
resp
=
yield
call
(
service
.
RA
,
playload
);
if
(
resp
.
error_code
!=
'0000'
)
{
printf
(
playload
,
resp
);
message
.
error
(
`
${
resp
.
error_code
}
:
${
resp
.
error_msg
}
`
);
}
else
{
console
.
log
(
playload
);
switch
(
playload
.
index
)
{
case
68
:
// 获取列表
{
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
case
69
:
// 获取详情
{
let
DataSave
=
resp
.
data
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
}
break
;
case
72
:
// 小区改变
{
let
Community
=
resp
.
data
;
Community
.
communityName
=
playload
.
body
.
communityName
;
yield
put
({
type
:
'returnDataSaveCommunity'
,
Community
});
}
break
;
case
70
:
// 小区编辑保存
case
71
:
// 小区回复保存
{
let
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
history
.
push
(
'/AccountManagement/service'
);
}
break
;
}
}
},
*
SA
({
DataSave
},
{
call
,
put
})
{
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
*
ResultDataSave
({
playload
},
{
call
,
put
})
{
let
DataSave
=
null
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
},
};
src/pages/AccountManagement/Service/service.less
0 → 100644
View file @
508ba46c
.contop {
padding: 20px;
}
.pages {
padding: 20px;
text-align: right;
}
.edit {
padding: 20px;
.form_s {
margin-top: 20px;
}
}
.ant-form-item {
margin-bottom: 18px;
}
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 24px;
}
src/pages/AccountManagement/Service/service.tsx
0 → 100644
View file @
508ba46c
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Space
,
message
,
Pagination
,
Spin
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
TitleSearch
from
'@/components/TitleSearch/TitleSearch'
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
const
module
=
'ServicePro'
;
import
'./service.less'
;
import
moment
from
'moment'
;
const
service
=
(
props
:
any
)
=>
{
const
columns
=
[
{
title
:
'Community'
,
dataIndex
:
'communityName'
,
key
:
'communityName'
,
width
:
240
,
},
{
title
:
'Rapporteur'
,
dataIndex
:
'reporterName'
,
key
:
'reporterName'
,
width
:
160
,
},
{
title
:
'Upload description'
,
dataIndex
:
'reportContent'
,
key
:
'reportContent'
,
width
:
400
,
ellipsis
:
true
,
},
{
title
:
'Submission Time'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
width
:
160
,
render
:
(
text
:
any
)
=>
<
span
>
{
moment
(
text
.
time
).
format
(
'YYYY-MM-DD'
)
}
</
span
>,
},
{
title
:
'Action'
,
key
:
'action'
,
width
:
120
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
a
onClick=
{
()
=>
{
emptys
(
record
,
`/AccountManagement/service/edit`
);
}
}
>
Edit
</
a
>
<
a
onClick=
{
()
=>
{
emptys
(
record
,
'/AccountManagement/service/detail'
);
}
}
>
Delete
</
a
>
</
Space
>
),
},
];
const
{
Data
,
dispatch
,
loading
,
Init
}
=
props
;
const
[
term
,
setTerm
]
=
useState
(
null
as
any
);
// 拉取数据的条件存储
// 监听是否有数据
useEffect
(()
=>
{
if
(
Init
.
CommunityList
!==
null
&&
Data
==
null
)
{
let
obj
=
{
communityNameList
:
Init
.
CommunityList
,
reporterName
:
null
,
pageNum
:
1
,
};
setTerm
({
...
obj
});
RA
(
68
,
obj
,
module
,
dispatch
);
}
},
[
Init
,
Data
]);
// 清除操作之前的数据
const
emptys
=
(
data
:
any
,
url
:
any
)
=>
{
// dispatch({ type: module + '/urlRemove' }); // 清掉图片信息
// dispatch({ type: module + '/delRemove' }); // 清掉之前的详情
dispatch
({
type
:
module
+
'/ResultDataSave'
});
// 清空详情缓存
// SA(data, module, dispatch);
history
.
push
(
url
+
'/'
+
data
.
id
);
};
// 点击搜索
const
CallBackTitleSearch
=
(
comment
:
any
)
=>
{
if
(
comment
.
communityName
.
length
>
0
||
typeof
comment
.
label
!==
'undefined'
)
{
let
obj
=
{
reporterName
:
comment
.
label
,
communityNameList
:
comment
.
communityName
.
length
>
0
?
comment
.
communityName
:
null
,
pageNum
:
1
,
};
setTerm
({
...
obj
});
// 存进搜索条件
RA
(
68
,
obj
,
module
,
dispatch
);
}
else
{
message
.
error
(
'Please Enter And Select A Content To Search!'
);
}
};
// 点击页面属性传参数
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
let
p
=
{
pageNum
:
page
,
};
let
t
=
{
...
term
,
...
p
};
setTerm
(
t
);
RA
(
68
,
t
,
module
,
dispatch
);
};
return
(
<
div
>
<>
{
/* <TitleSearch listkey={['communityName']} list={['Community Name']} onSubmit={CallBackTitleSearch}/> */
}
<
div
className=
"contop"
>
<
TitleSearch
username=
{
[
'label'
,
"Rapporteur's name"
]
}
community=
{
'communityName'
}
checklist=
{
Init
?
Init
.
CommunityList
:
[]
}
onSubmit=
{
CallBackTitleSearch
}
/>
</
div
>
<
ProTable
pagination=
{
false
}
// 隐藏默认分页
rowKey=
{
'id'
}
dataSource=
{
Data
?
Data
.
list
:
null
}
columns=
{
columns
}
search=
{
false
}
loading=
{
loading
}
toolBarRender=
{
false
}
scroll=
{
{
x
:
980
}
}
options=
{
false
}
headerTitle=
"Community List"
/>
{
Data
?
(
<
div
className=
"pages"
>
<
Pagination
current=
{
Data
.
page
.
currentPage
}
total=
{
Data
.
page
.
totalRow
}
pageSize=
{
Data
.
page
.
curPageSize
}
onChange=
{
paginationHandler
}
showSizeChanger=
{
false
}
/>
</
div
>
)
:
(
''
)
}
</>
</
div
>
);
};
function
map
(
state
:
any
)
{
console
.
log
(
state
);
const
loading
=
state
.
loading
.
models
.
ServicePro
;
const
Init
=
state
.
Init
;
const
{
Data
,
curString
,
village
}
=
state
[
module
];
return
{
Data
,
loading
,
curString
,
village
,
Init
};
}
export
default
connect
(
map
)(
service
);
src/pages/AccountManagement/Service/serviceDetail.tsx
0 → 100644
View file @
508ba46c
/*
* @Author: your name
* @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-03-03 16:23:36
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Spin
,
Form
,
Input
}
from
'antd'
;
import
{
connect
}
from
'umi'
;
const
{
TextArea
}
=
Input
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
const
module
=
'ServicePro'
;
import
'./service.less'
;
import
TitleBack
from
'@/components/TitleBack/TitleBack'
;
import
PictureOptionsRow
from
'@/components/PictureOptions/PictureOptionsRow'
;
const
service
=
(
props
:
any
)
=>
{
const
{
DataSave
,
dispatch
,
loading
,
match
,
user
}
=
props
;
const
[
term
,
setTerm
]
=
useState
(
null
as
any
);
// 默认小区
const
[
ImageSrc
,
setImageSrc
]
=
useState
([]
as
any
);
// 图片地址
const
[
form
]
=
Form
.
useForm
();
// 监听是否有数据
useEffect
(()
=>
{
if
(
match
.
params
.
id
)
{
RA
(
69
,
{
id
:
match
.
params
.
id
},
module
,
dispatch
);
}
},
[
match
]);
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
setTerm
({
...
DataSave
});
if
(
DataSave
.
reportPictures
.
length
>
0
)
{
// 图片名any
let
a
=
DataSave
.
reportPictures
.
map
((
item
:
any
,
i
:
any
)
=>
{
let
img
=
DataSave
.
reportImages
.
split
(
','
);
let
key
=
img
[
i
];
return
{
uid
:
i
,
name
:
key
,
status
:
'done'
,
url
:
item
,
};
});
// 图片列表
setImageSrc
(
a
);
}
}
},
[
DataSave
]);
//onFinish 提交
const
onFinish
=
(
values
:
any
)
=>
{
values
.
reportId
=
match
.
params
.
id
;
values
.
replyId
=
user
.
currentUser
.
userModel
.
id
;
values
.
replyImages
=
values
.
replyImages
.
join
(
','
);
// console.log(values);
RA
(
71
,
values
,
module
,
dispatch
);
};
return
(
<
Spin
spinning=
{
loading
}
>
<
div
className=
"edit"
>
{
/* 标题 */
}
<
TitleBack
title=
{
'Report details'
}
/>
{
/* 信息 */
}
<
div
className=
"form_s"
>
<
Form
name=
"basic"
form=
{
form
}
initialValues=
{
{
remember
:
true
}
}
labelCol=
{
{
xs
:
12
,
sm
:
6
,
md
:
6
,
lg
:
4
,
xl
:
4
,
xxl
:
2
}
}
wrapperCol=
{
{
xs
:
12
,
sm
:
18
,
md
:
18
,
lg
:
20
,
xl
:
20
,
xxl
:
22
}
}
onFinish=
{
onFinish
}
>
{
/* 小区名 */
}
<
Form
.
Item
label=
"Community"
>
{
term
?
term
.
communityName
:
null
}
</
Form
.
Item
>
{
/* 小区地址 */
}
<
Form
.
Item
label=
"Address"
>
<
span
>
{
term
?
`${term.communityAddress} , ${term.postCode}`
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告人 */
}
<
Form
.
Item
label=
"Rapporteur"
>
<
span
>
{
term
?
term
.
reporterName
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告人联系方式 */
}
<
Form
.
Item
label=
"Contact Details"
>
<
span
>
{
term
?
term
.
reporterPhone
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告描述 */
}
<
Form
.
Item
label=
"Description"
>
<
TextArea
rows=
{
4
}
style=
{
{
maxWidth
:
600
,
width
:
'100%'
}
}
value=
{
term
?
term
.
reportContent
:
null
}
disabled
/>
</
Form
.
Item
>
{
/* 报告图片 */
}
<
Form
.
Item
label=
"Picture"
>
<
PictureOptionsRow
action=
"/tos/image/upload"
data=
{
{
imageType
:
'tosReportImage'
,
identification
:
''
,
}
}
limitNums=
{
10
}
imgs=
{
ImageSrc
}
over=
{
true
}
/>
</
Form
.
Item
>
<
hr
></
hr
>
{
/* --------------------------------------------------------------------------------------------- */
}
{
term
&&
term
.
replyData
.
length
>
0
?
term
.
replyData
.
map
((
v
:
any
,
idx
:
any
)
=>
{
let
imgs
=
v
.
replyPictures
.
map
((
item
:
any
,
i
:
any
)
=>
{
return
{
uid
:
i
,
name
:
'Imags'
,
status
:
'done'
,
url
:
item
,
};
});
return
(
<
div
key=
{
idx
}
>
{
/* 回复人 */
}
<
Form
.
Item
label=
"Contact Details"
>
<
span
>
{
`${v.replyName} - ${v.replyPhone}`
}
</
span
>
</
Form
.
Item
>
{
/* 回复内容 */
}
<
Form
.
Item
label=
"Overview"
>
<
TextArea
rows=
{
4
}
style=
{
{
maxWidth
:
600
,
width
:
'100%'
}
}
value=
{
v
.
replyContent
}
disabled
/>
</
Form
.
Item
>
{
/* 回复图片 */
}
<
Form
.
Item
label=
"Picture"
>
<
PictureOptionsRow
action=
"/tos/image/upload"
data=
{
{
imageType
:
'tosReportImage'
,
identification
:
''
,
}
}
limitNums=
{
10
}
imgs=
{
imgs
}
over=
{
true
}
/>
</
Form
.
Item
>
<
hr
></
hr
>
</
div
>
);
})
:
null
}
{
/* --------------------------------------------------------------------------------------------- */
}
{
/* 回复描述 */
}
<
Form
.
Item
label=
"Overview"
name=
"replyContent"
rules=
{
[{
required
:
true
}]
}
>
<
TextArea
rows=
{
4
}
style=
{
{
maxWidth
:
600
,
width
:
'100%'
}
}
/>
</
Form
.
Item
>
{
/* 回复图片 */
}
<
Form
.
Item
label=
"Picture"
name=
"replyImages"
rules=
{
[{
required
:
true
}]
}
>
<
PictureOptionsRow
action=
"/tos/image/upload"
data=
{
{
imageType
:
'tosReportImage'
,
identification
:
''
,
}
}
limitNums=
{
10
}
over=
{
loading
}
/>
</
Form
.
Item
>
{
/* --------------------------------------------------------------------------------------------- */
}
{
/* 提交 */
}
<
Form
.
Item
label=
" "
colon=
{
false
}
>
<
Button
type=
"primary"
loading=
{
loading
}
htmlType=
"submit"
>
Submit
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
</
div
>
</
Spin
>
);
};
function
map
(
state
:
any
)
{
console
.
log
(
state
);
const
loading
=
state
.
loading
.
models
.
ServicePro
;
const
{
Init
,
user
}
=
state
;
const
{
DataSave
,
curString
,
village
}
=
state
[
module
];
return
{
DataSave
,
loading
,
curString
,
village
,
Init
,
user
};
}
export
default
connect
(
map
)(
service
);
src/pages/AccountManagement/Service/serviceEdit.tsx
0 → 100644
View file @
508ba46c
/*
* @Author: your name
* @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-03-03 14:56:54
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Spin
,
Form
,
Input
}
from
'antd'
;
import
{
connect
}
from
'umi'
;
const
{
TextArea
}
=
Input
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
const
module
=
'ServicePro'
;
import
'./service.less'
;
import
TitleBack
from
'@/components/TitleBack/TitleBack'
;
import
SearchOptionsCommnity
from
'@/components/SearchOptions/SearchOptionsCommnity'
;
import
PictureOptionsRow
from
'@/components/PictureOptions/PictureOptionsRow'
;
import
moment
from
'moment'
;
const
service
=
(
props
:
any
)
=>
{
const
{
DataSave
,
dispatch
,
loading
,
match
}
=
props
;
const
[
term
,
setTerm
]
=
useState
(
null
as
any
);
// 默认小区
const
[
ImageSrc
,
setImageSrc
]
=
useState
([]
as
any
);
// 图片地址
const
[
form
]
=
Form
.
useForm
();
// 监听是否有数据
useEffect
(()
=>
{
if
(
match
.
params
.
id
)
{
RA
(
69
,
{
id
:
match
.
params
.
id
},
module
,
dispatch
);
}
},
[
match
]);
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
setTerm
({
...
DataSave
});
form
.
setFieldsValue
({
communityName
:
DataSave
.
communityName
,
reportContent
:
DataSave
.
reportContent
,
reportImages
:
DataSave
.
reportImages
?
DataSave
.
reportImages
.
split
(
','
)
:
null
,
});
if
(
DataSave
.
reportPictures
.
length
>
0
)
{
// 图片名any
let
a
=
DataSave
.
reportPictures
.
map
((
item
:
any
,
i
:
any
)
=>
{
let
img
=
DataSave
.
reportImages
.
split
(
','
);
let
key
=
img
[
i
];
return
{
uid
:
i
,
name
:
key
,
status
:
'done'
,
url
:
item
,
};
});
// 图片列表
setImageSrc
(
a
);
}
}
},
[
DataSave
]);
//onFinish 提交
const
onFinish
=
(
values
:
any
)
=>
{
values
.
id
=
match
.
params
.
id
;
values
.
reportImages
=
values
.
reportImages
.
join
(
','
);
RA
(
70
,
values
,
module
,
dispatch
);
};
// 选择小区名字并赋值
const
opname
=
(
value
:
any
)
=>
{
// console.log(value);
if
(
value
)
{
RA
(
72
,
{
communityName
:
value
},
module
,
dispatch
);
}
form
.
setFieldsValue
({
communityName
:
value
,
});
};
return
(
<
Spin
spinning=
{
loading
}
>
<
div
className=
"edit"
>
{
/* 标题 */
}
<
TitleBack
title=
{
'Edit report'
}
/>
{
/* 信息 */
}
<
div
className=
"form_s"
>
<
Form
name=
"basic"
form=
{
form
}
initialValues=
{
{
remember
:
true
}
}
labelCol=
{
{
xs
:
12
,
sm
:
6
,
md
:
6
,
lg
:
4
,
xl
:
4
,
xxl
:
2
}
}
wrapperCol=
{
{
xs
:
12
,
sm
:
18
,
md
:
18
,
lg
:
20
,
xl
:
20
,
xxl
:
22
}
}
onFinish=
{
onFinish
}
>
{
/* 小区名 */
}
<
Form
.
Item
label=
"Community"
name=
"communityName"
rules=
{
[{
required
:
true
}]
}
>
<
SearchOptionsCommnity
// ubmit={extendName}
opname=
{
opname
}
defaultName=
{
term
?
term
.
communityName
:
null
}
// type={1} // 单选还是多选 单选就直接去掉
/>
</
Form
.
Item
>
{
/* 小区地址 */
}
<
Form
.
Item
label=
"Address"
>
<
span
>
{
term
?
`${term.communityAddress} , ${term.postCode}`
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告人 */
}
<
Form
.
Item
label=
"Rapporteur"
>
<
span
>
{
term
?
term
.
reporterName
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告人联系方式 */
}
<
Form
.
Item
label=
"Contact Details"
>
<
span
>
{
term
?
term
.
reporterPhone
:
null
}
</
span
>
</
Form
.
Item
>
{
/* 报告描述 */
}
<
Form
.
Item
label=
"Description"
name=
"reportContent"
rules=
{
[{
required
:
true
}]
}
>
<
TextArea
rows=
{
4
}
style=
{
{
maxWidth
:
600
,
width
:
'100%'
}
}
/>
</
Form
.
Item
>
{
/* 报告图片 */
}
<
Form
.
Item
label=
"Picture"
name=
"reportImages"
rules=
{
[{
required
:
true
}]
}
>
<
PictureOptionsRow
action=
"/tos/image/upload"
data=
{
{
imageType
:
'tosReportImage'
,
identification
:
''
,
}
}
limitNums=
{
10
}
imgs=
{
ImageSrc
}
over=
{
loading
}
/>
</
Form
.
Item
>
{
/* --------------------------------------------------------------------------------------------- */
}
{
/* 提交 */
}
<
Form
.
Item
label=
" "
colon=
{
false
}
>
<
Button
type=
"primary"
loading=
{
loading
}
htmlType=
"submit"
>
Submit
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
</
div
>
</
Spin
>
);
};
function
map
(
state
:
any
)
{
const
loading
=
state
.
loading
.
models
.
ServicePro
;
const
Init
=
state
.
Init
;
const
{
DataSave
,
curString
,
village
}
=
state
[
module
];
return
{
DataSave
,
loading
,
curString
,
village
,
Init
};
}
export
default
connect
(
map
)(
service
);
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
508ba46c
...
...
@@ -478,7 +478,7 @@ const Adds = (props: any) => {
<
div
className=
"formBox"
>
{
forms
?
(
<
div
className=
"pdfform"
>
<
p
style=
{
{
marginBottom
:
6
}
}
>
Form
</
p
>
<
p
style=
{
{
marginBottom
:
6
}
}
>
Form
s
</
p
>
<
Form
.
Item
name=
{
'formsPdfList'
}
label=
""
...
...
@@ -503,7 +503,7 @@ const Adds = (props: any) => {
</
div
>
)
:
(
<
div
className=
"acitves"
>
<
Button
onClick=
{
switchs
}
>
Form
</
Button
>
<
Button
onClick=
{
switchs
}
>
Click to upload forms
</
Button
>
</
div
>
)
}
</
div
>
...
...
src/utils/params.ts
View file @
508ba46c
/*
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-0
2-23 17:12:49
* @LastEditTime: 2021-0
3-03 15:51:17
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
...
...
@@ -100,4 +100,9 @@ export const requestList = [
[
'/tos/tosCompany/edit'
,
'65 修改公司信息'
,
{}],
[
'/tos/tosCompany/get'
,
'66 获取公司信息'
,
{}],
[
'/tos/users/edit'
,
'67 修改admin信息'
,
{}],
[
'/tos/report/get/list'
,
'68 web端报告列表'
,
{}],
[
'/tos/report/get/detail'
,
'69 web端报告详情'
,
{}],
[
'/tos/report/edit'
,
'70 web端报告编辑'
,
{}],
[
'/tos/report/reply'
,
'71 web端报告员回复'
,
{}],
[
'/tos/community/get/address'
,
'72 根据小区名搜索小区地址'
,
{}],
];
src/utils/power.js
View file @
508ba46c
...
...
@@ -154,6 +154,12 @@ export const zhCnFaci = [
disabled
:
true
,
children
:
[{
title
:
'查看访客记录'
,
key
:
'61'
,
disableCheckbox
:
true
}],
},
{
title
:
'报告员权限'
,
key
:
'71'
,
disabled
:
true
,
children
:
[{
title
:
'报告员'
,
key
:
'72'
,
disableCheckbox
:
true
}],
},
{
title
:
'账号管理'
,
key
:
'62'
,
...
...
@@ -325,6 +331,12 @@ export const enUsFaci = [
disabled
:
true
,
children
:
[{
title
:
'View Visitor Record'
,
key
:
'61'
,
disableCheckbox
:
true
}],
},
{
title
:
'Building Condit'
,
key
:
'71'
,
disabled
:
true
,
children
:
[{
title
:
'Building Condit'
,
key
:
'72'
,
disableCheckbox
:
true
}],
},
{
title
:
'Account Management'
,
key
:
'62'
,
...
...
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