Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xform
Project
Project
Details
Activity
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
田翔
xform
Commits
8b70e2ac
Commit
8b70e2ac
authored
Aug 07, 2024
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增选中巡检对象
parent
d704a540
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
18 deletions
+57
-18
process.js
src/apis/process.js
+8
-0
settings.js
src/core/FormDesigner/config/settings.js
+2
-2
index.js
src/core/widgets/settings/groupSource/AreaTaskShine/index.js
+47
-16
No files found.
src/apis/process.js
View file @
8b70e2ac
...
...
@@ -639,6 +639,14 @@ export function GetLayersShareField({ mapServer, layerNames }) {
})
}
//获取巡检方案
export
function
GetAreaTaskProgramme
()
{
return
request
({
url
:
`PandaOMS/OMS/WorkOrderCenter/GetAreaTaskProgramme`
,
method
:
'get'
})
}
//获取分区
export
function
FetchAreaList
({
userID
,
sourceType
})
{
return
request
({
...
...
src/core/FormDesigner/config/settings.js
View file @
8b70e2ac
...
...
@@ -2445,8 +2445,8 @@ const mapWidgets = [
widget
:
'HiddenCondition'
},
areaTaskShine
:
{
title
:
'
映射字段
'
,
name
:
'
映射字段
'
,
title
:
'
巡检对象
'
,
name
:
'
巡检对象
'
,
type
:
'array'
,
widget
:
'AreaTaskShine'
,
default
:
[],
...
...
src/core/widgets/settings/groupSource/AreaTaskShine/index.js
View file @
8b70e2ac
...
...
@@ -9,7 +9,8 @@ import {
getMaplayerByTerminalType
,
GetLayerList
,
GetLayerFields
,
GetLayersShareField
GetLayersShareField
,
GetAreaTaskProgramme
}
from
'../../../../../apis/process'
import
Drag
from
'../../../../components/Drag'
...
...
@@ -30,6 +31,7 @@ const AreaTaskShine = (props) => {
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
tableName
,
setTableName
]
=
useState
(
formData
?.
tableName
)
const
[
accountName
,
setAccountName
]
=
useState
(
formData
?.
accountName
)
const
[
taskList
,
setTaskList
]
=
useState
([])
const
[
accountList
,
setAccountList
]
=
useState
([])
const
[
mapServers
,
setMapServers
]
=
useState
([])
const
[
service
,
setService
]
=
useState
(
formData
?.
service
)
...
...
@@ -43,12 +45,12 @@ const AreaTaskShine = (props) => {
.
validateFields
()
.
then
((
values
)
=>
{
const
{
field
,
accountName
,
service
,
layerName
}
=
form
.
getFieldsValue
()
if
(
!
toField
.
some
(
v
=>
v
.
name
===
'工单编号'
))
{
return
message
.
error
(
`【
${
accountName
}
】台账不存在工单编号字段`
)
}
if
(
!
toField
.
some
(
v
=>
v
.
name
===
'反馈状态'
))
{
return
message
.
error
(
`【
${
accountName
}
】台账不存在反馈状态字段`
)
}
//
if (!toField.some(v => v.name === '工单编号')) {
//
return message.error(`【${accountName}】台账不存在工单编号字段`)
//
}
//
if (!toField.some(v => v.name === '反馈状态')) {
//
return message.error(`【${accountName}】台账不存在反馈状态字段`)
//
}
addons
.
setValue
(
'accountName'
,
accountName
)
addons
.
setValue
(
'service'
,
service
)
addons
.
setValue
(
'layerName'
,
layerName
)
...
...
@@ -127,6 +129,13 @@ const AreaTaskShine = (props) => {
form
.
setFieldsValue
({
field
:
values
,
service
,
layerName
})
}
const
taskNameChange
=
(
value
)
=>
{
let
item
=
taskList
.
find
(
v
=>
v
.
Name
===
value
)
if
(
item
)
{
form
.
setFieldsValue
({
accountName
:
item
.
FeedbackAccountName
,
tableName
:
item
.
FeedbackTableName
,
service
:
item
.
MapServerName
,
layerName
:
item
?.
LayerName
.
split
(
','
)
||
[]
})
}
}
const
clear
=
()
=>
{
addons
.
setValue
(
'tableName'
,
''
)
addons
.
setValue
(
'accountName'
,
''
)
...
...
@@ -136,14 +145,22 @@ const AreaTaskShine = (props) => {
setVisible
(
false
)
}
const
getProgramme
=
async
()
=>
{
const
{
code
,
data
}
=
await
GetAreaTaskProgramme
()
if
(
code
===
0
)
{
setTaskList
(
data
)
}
}
useEffect
(()
=>
{
if
(
visible
)
{
if
(
service
&&
layerName
)
{
getFromField
()
}
if
(
tableName
)
{
getToField
()
}
// if (service && layerName) {
// getFromField()
// }
// if (tableName) {
// getToField()
// }
getProgramme
()
}
},
[
visible
,
service
,
layerName
,
tableName
])
...
...
@@ -156,7 +173,7 @@ const AreaTaskShine = (props) => {
<
Drag
getContainer
=
{
false
}
width
=
'500px'
title
=
'
字段映射
'
title
=
'
巡检对象
'
bodyStyle
=
{{
maxHeight
:
500
,
overflow
:
'auto'
}}
visible
=
{
visible
}
footer
=
{
...
...
@@ -168,9 +185,22 @@ const AreaTaskShine = (props) => {
}
onCancel
=
{()
=>
setVisible
(
false
)}
>
<
Form
name
=
"dynamic_form_nest_item"
form
=
{
form
}
autoComplete
=
"off"
labelCol
=
{{
span
:
5
}}
>
<
Form
name
=
"dynamic_form_nest_item"
form
=
{
form
}
autoComplete
=
"off"
labelCol
=
{{
span
:
5
}}
>
<
Form
.
Item
label
=
'巡检对象'
name
=
'taskName'
rules
=
{[{
required
:
true
,
message
:
'gis反馈台账必填'
,
}]}
>
<
Select
showSearch
options
=
{
taskList
.
map
(
v
=>
({
label
:
v
.
Name
,
value
:
v
.
Name
}))}
onChange
=
{
taskNameChange
}
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
'GIS反馈台账'
name
=
'accountName'
rules
=
{[{
required
:
true
,
message
:
'gis反馈台账必填'
,
}]}
>
<
Select
disabled
showSearch
options
=
{
accountList
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
name
}))}
onChange
=
{(
value
)
=>
{
...
...
@@ -184,7 +214,7 @@ const AreaTaskShine = (props) => {
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
'方案名称'
name
=
'service'
rules
=
{[{
required
:
true
,
message
:
'方案名称必填'
,
},]}
>
<
Select
options
=
{
mapServers
}
onChange
=
{(
value
)
=>
setService
(
value
)}
/
>
<
Select
disabled
options
=
{
mapServers
}
onChange
=
{(
value
)
=>
setService
(
value
)}
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
'图层名称'
...
...
@@ -202,6 +232,7 @@ const AreaTaskShine = (props) => {
onChange
=
{(
value
)
=>
{
setlayerName
(
value
)
}}
disabled
>
{
layers
.
map
(
v
=>
<
Select
.
Option
value
=
{
v
.
layerName
}
>
{
v
.
layerName
}
<
/Select.Option>
)
...
...
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