Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
ReactWeb5
CivManage
Commits
e0e84e02
Commit
e0e84e02
authored
Jun 16, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '流程中心gis配置增加验证'
parent
60a8e1ca
Pipeline
#74418
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
AddGIS.jsx
...onents/flowChartComponents/nodeModalComponents/AddGIS.jsx
+19
-9
No files found.
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/AddGIS.jsx
View file @
e0e84e02
/* eslint-disable no-unused-expressions */
/* eslint-disable no-else-return */
/* eslint-disable prefer-destructuring */
/* eslint-disable prefer-destructuring */
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
GetMaplayerByTerminalType
,
GetLayerList
,
GetLayerFields
}
from
'@/services/flow/flow'
;
import
{
GetMaplayerByTerminalType
,
GetLayerList
,
GetLayerFields
}
from
'@/services/flow/flow'
;
...
@@ -103,7 +105,7 @@ const AddModal = props => {
...
@@ -103,7 +105,7 @@ const AddModal = props => {
let
obj
=
form
.
getFieldsValue
();
let
obj
=
form
.
getFieldsValue
();
let
newValue
=
value
?
value
:
schemeValue
;
let
newValue
=
value
?
value
:
schemeValue
;
console
.
log
(
schemeValue
);
console
.
log
(
schemeValue
);
debugger
debugger
;
let
data
=
newValue
.
find
(
i
=>
i
.
servicename
===
obj
.
schemeName
);
let
data
=
newValue
.
find
(
i
=>
i
.
servicename
===
obj
.
schemeName
);
GetLayerFields
({
GetLayerFields
({
mapServer
:
data
.
servicename
,
mapServer
:
data
.
servicename
,
...
@@ -125,8 +127,13 @@ const AddModal = props => {
...
@@ -125,8 +127,13 @@ const AddModal = props => {
// 表单监听
// 表单监听
const
onValuesChange
=
val
=>
{
const
onValuesChange
=
val
=>
{
if
(
Object
.
keys
(
val
)[
0
]
===
'schemeName'
)
{
if
(
Object
.
keys
(
val
)[
0
]
===
'schemeName'
)
{
form
.
setFieldsValue
({
nodeName1
:
''
,
nodeValue1
:
''
,
users
:
[]
});
setLayerValue
([]);
setLayerFields
([]);
layerData
.
current
=
{};
getLayerList
(
val
[
Object
.
keys
(
val
)[
0
]]);
getLayerList
(
val
[
Object
.
keys
(
val
)[
0
]]);
}
else
if
(
Object
.
keys
(
val
)[
0
]
===
'nodeName1'
)
{
}
else
if
(
Object
.
keys
(
val
)[
0
]
===
'nodeName1'
)
{
form
.
setFieldsValue
({
nodeValue1
:
''
});
getLayerFields
(
val
[
Object
.
keys
(
val
)[
0
]]);
getLayerFields
(
val
[
Object
.
keys
(
val
)[
0
]]);
}
else
if
(
Object
.
keys
(
val
)[
0
]
===
'Fields'
)
{
}
else
if
(
Object
.
keys
(
val
)[
0
]
===
'Fields'
)
{
let
arr
=
[];
let
arr
=
[];
...
@@ -134,13 +141,13 @@ const AddModal = props => {
...
@@ -134,13 +141,13 @@ const AddModal = props => {
arr
.
push
(...
item
.
TableFields
);
arr
.
push
(...
item
.
TableFields
);
});
});
let
data
=
arr
.
find
(
i
=>
i
.
FieldName
===
val
[
Object
.
keys
(
val
)[
0
]]);
let
data
=
arr
.
find
(
i
=>
i
.
FieldName
===
val
[
Object
.
keys
(
val
)[
0
]]);
console
.
log
(
data
);
setTableType
(
data
.
type
);
setTableType
(
data
.
type
);
setType
(
data
.
FiledType
);
setType
(
data
.
FiledType
);
setTableName
(
data
.
table
);
setTableName
(
data
.
table
);
// 修改源字段字段类型改变要重新获取type更新所有目标字段下拉框数据
form
.
setFieldsValue
({
schemeName
:
''
,
nodeName1
:
''
,
nodeValue1
:
''
,
users
:
[]
});
// getLayerFields(val[Object.keys(val)[0]]);
setLayerValue
([]);
setLayerFields
([]);
layerData
.
current
=
{};
}
}
};
};
...
@@ -296,7 +303,7 @@ const AddModal = props => {
...
@@ -296,7 +303,7 @@ const AddModal = props => {
{
layerFields
&&
{
layerFields
&&
layerFields
.
map
(
item
=>
(
layerFields
.
map
(
item
=>
(
<
Option
value=
{
item
.
field
}
key=
{
item
.
field
}
>
<
Option
value=
{
item
.
field
}
key=
{
item
.
field
}
>
<
span
>
{
item
.
field
}
</
span
>
<
span
>
{
item
.
field
Alias
}
</
span
>
</
Option
>
</
Option
>
))
}
))
}
</
Select
>
</
Select
>
...
@@ -328,6 +335,9 @@ const AddModal = props => {
...
@@ -328,6 +335,9 @@ const AddModal = props => {
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
onChange=
{
e
=>
{
onChange=
{
e
=>
{
getLayerFields
(
e
,
key
);
getLayerFields
(
e
,
key
);
let
obj
=
form
.
getFieldsValue
().
users
;
obj
[
key
].
nodeValue
=
''
;
form
.
setFieldsValue
({
users
:
obj
});
}
}
}
}
>
>
{
layerValue
&&
{
layerValue
&&
...
@@ -347,7 +357,7 @@ const AddModal = props => {
...
@@ -347,7 +357,7 @@ const AddModal = props => {
fieldKey=
{
[
fieldKey
,
'last'
]
}
fieldKey=
{
[
fieldKey
,
'last'
]
}
labelCol=
{
{
span
:
8
}
}
labelCol=
{
{
span
:
8
}
}
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
style=
{
{
width
:
'230px'
,
marginLeft
:
'
3
px'
}
}
style=
{
{
width
:
'230px'
,
marginLeft
:
'
5
px'
}
}
>
>
<
Select
<
Select
placeholder=
"请选择设备字段"
placeholder=
"请选择设备字段"
...
@@ -358,7 +368,7 @@ const AddModal = props => {
...
@@ -358,7 +368,7 @@ const AddModal = props => {
layerData
.
current
[
key
].
map
(
item
=>
{
layerData
.
current
[
key
].
map
(
item
=>
{
return
(
return
(
<
Option
value=
{
item
.
field
}
key=
{
item
.
field
}
>
<
Option
value=
{
item
.
field
}
key=
{
item
.
field
}
>
<
span
>
{
item
.
field
}
</
span
>
<
span
>
{
item
.
field
Alias
}
</
span
>
</
Option
>
</
Option
>
);
);
})
}
})
}
...
@@ -387,7 +397,7 @@ const AddModal = props => {
...
@@ -387,7 +397,7 @@ const AddModal = props => {
onClick=
{
()
=>
add
()
}
onClick=
{
()
=>
add
()
}
block
block
icon=
{
<
PlusOutlined
/>
}
icon=
{
<
PlusOutlined
/>
}
style=
{
{
width
:
'
411px'
,
marginLeft
:
'87
px'
}
}
style=
{
{
width
:
'
394px'
,
marginLeft
:
'99
px'
}
}
>
>
新增项
新增项
</
Button
>
</
Button
>
...
...
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