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
d01f930e
Commit
d01f930e
authored
Jan 20, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '修改三维配置,地图配置界面留白样式'
parent
39a277af
Pipeline
#43225
skipped with stages
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1287 additions
and
1277 deletions
+1287
-1277
TileConfig.jsx
...formCenter/gis/dimensionsConfig/TileConfig/TileConfig.jsx
+1
-1
VectorData.jsx
...formCenter/gis/dimensionsConfig/VectorData/VectorData.jsx
+1
-1
projectMessage.jsx
...er/gis/dimensionsConfig/projectMessage/projectMessage.jsx
+82
-76
solutionConfig.jsx
...er/gis/dimensionsConfig/solutionConfig/solutionConfig.jsx
+423
-427
TileConfig.jsx
...platformCenter/gis/schemeConfig/TileConfig/TileConfig.jsx
+184
-191
VectorData.jsx
...platformCenter/gis/schemeConfig/VectorData/VectorData.jsx
+1
-1
projectMessage.jsx
...Center/gis/schemeConfig/projectMessage/projectMessage.jsx
+86
-80
solutionConfig.jsx
...Center/gis/schemeConfig/solutionConfig/solutionConfig.jsx
+509
-500
No files found.
src/pages/platformCenter/gis/dimensionsConfig/TileConfig/TileConfig.jsx
View file @
d01f930e
...
@@ -228,7 +228,7 @@ const TileData = props => {
...
@@ -228,7 +228,7 @@ const TileData = props => {
dataSource=
{
tileData
}
dataSource=
{
tileData
}
bordered
bordered
rowKey=
"type"
rowKey=
"type"
scroll=
{
{
y
:
4
00
}
}
scroll=
{
{
y
:
6
00
}
}
pagination=
{
{
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
}
}
}
}
...
...
src/pages/platformCenter/gis/dimensionsConfig/VectorData/VectorData.jsx
View file @
d01f930e
...
@@ -190,7 +190,7 @@ const VectorData = props => {
...
@@ -190,7 +190,7 @@ const VectorData = props => {
dataSource=
{
tileData
}
dataSource=
{
tileData
}
bordered
bordered
rowKey=
"id"
rowKey=
"id"
scroll=
{
{
y
:
4
00
}
}
scroll=
{
{
y
:
6
00
}
}
pagination=
{
{
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
}
}
}
}
...
...
src/pages/platformCenter/gis/dimensionsConfig/projectMessage/projectMessage.jsx
View file @
d01f930e
import
{
Button
,
Spin
}
from
'antd'
;
/* eslint-disable indent */
import
{
Button
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../dimensionsConfig.less'
import
styles
from
'../dimensionsConfig.less'
;
import
{
import
{
GetSchemaInfoList
}
from
'@/services/webConfig/api'
;
GetSchemaInfoList
import
AddModal
from
'./AddModal'
;
}
from
'@/services/webConfig/api'
;
import
Cards
from
'./components/card'
;
import
AddModal
from
'./AddModal'
import
Cards
from
'./components/card'
const
VectorData
=
props
=>
{
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
tileData
,
setTileData
]
=
useState
([]);
// 页面初始化数据
const
[
tileData
,
setTileData
]
=
useState
([]);
// 页面初始化数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 状态更新
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 状态更新
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
formObj
,
setFormObj
]
=
useState
({});
const
onSubmit
=
prop
=>
{
const
onSubmit
=
prop
=>
{
setVisible
(
false
);
setVisible
(
false
);
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
)
};
};
const
onDeletebaseMap
=
value
=>
{
const
onDeletebaseMap
=
(
value
)
=>
{
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
)
};
}
const
handleAdd
=
()
=>
{
const
handleAdd
=
()
=>
{
setType
(
'schemeAdd'
);
setType
(
'schemeAdd'
);
setVisible
(
true
);
setVisible
(
true
);
};
}
useEffect
(()
=>
{
useEffect
(()
=>
{
renderTile
();
renderTile
();
},
[
flag
]);
},
[
flag
]);
// 获取瓦片数据配置数据
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
const
renderTile
=
()
=>
{
setTreeLoading
(
true
);
setTreeLoading
(
true
);
GetSchemaInfoList
().
then
(
res
=>
{
GetSchemaInfoList
().
then
(
if
(
res
.
msg
===
'Ok'
)
{
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTileData
(
res
.
data
);
setTreeLoading
(
false
);
}
else
{
setTileData
(
res
.
data
);
setTreeLoading
(
false
);
}
else
{
}
setTreeLoading
(
false
);
});
};
}
return
(
}
<>
)
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
};
<
div
style=
{
{
height
:
'780px'
,
overflow
:
'scroll'
}
}
>
return
(
<
div
className=
{
styles
.
tileBtn
}
>
<>
<
Button
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
type=
"primary"
<
div
style=
{
{
width
:
'calc(100vw - 265px)'
}
}
>
onClick=
{
()
=>
{
<
div
className=
{
styles
.
tileBtn
}
>
handleAdd
();
<
Button
type=
"primary"
onClick=
{
()
=>
{
}
}
handleAdd
();
>
}
}
>
新增
新增
</
Button
>
</
Button
>
</
div
>
</
div
>
<
div
className=
{
styles
.
cardsList
}
>
<
div
className=
{
styles
.
cardsList
}
>
{
tileData
&&
tileData
.
length
{
tileData
&&
tileData
.
length
?
?
tileData
.
map
((
item
,
index
)
=>
{
tileData
.
map
((
item
,
index
)
=>
{
return
(
return
<
div
className=
{
styles
.
cardItem
}
key=
{
index
}
span=
{
5
}
offset=
{
2
}
style=
{
{
marginBottom
:
'1rem'
}
}
>
<
div
<
Cards
item=
{
item
}
deletebaseMaps=
{
onDeletebaseMap
}
></
Cards
>
className=
{
styles
.
cardItem
}
</
div
>
key=
{
index
}
})
:
''
}
span=
{
5
}
</
div
>
offset=
{
2
}
<
AddModal
style=
{
{
marginBottom
:
'1rem'
}
}
visible=
{
visible
}
>
onCancel=
{
()
=>
setVisible
(
false
)
}
<
Cards
item=
{
item
}
deletebaseMaps=
{
onDeletebaseMap
}
/>
callBackSubmit=
{
onSubmit
}
</
div
>
type=
{
type
}
);
formObj=
{
formObj
}
})
/>
:
''
}
</
div
>
</
div
>
</
Spin
>
<
AddModal
</>
visible=
{
visible
}
)
onCancel=
{
()
=>
setVisible
(
false
)
}
}
callBackSubmit=
{
onSubmit
}
export
default
VectorData
type=
{
type
}
\ No newline at end of file
formObj=
{
formObj
}
/>
</
div
>
</
Spin
>
</>
);
};
export
default
VectorData
;
src/pages/platformCenter/gis/dimensionsConfig/solutionConfig/solutionConfig.jsx
View file @
d01f930e
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../dimensionsConfig.less'
import
styles
from
'../dimensionsConfig.less'
;
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
import
{
PlusOutlined
deleteConfig
,
}
from
'@ant-design/icons'
;
SettingRoleWebSchema
,
import
{
SetServiceConfig
,
deleteConfig
,
SettingRoleWebSchema
,
SetServiceConfig
,
DeleteWebSchema
,
GetWebSchemaList
,
GetSchemaInfoList
,
IsActionWebSchema
DeleteWebSchema
,
GetWebSchemaList
,
GetSchemaInfoList
,
IsActionWebSchema
,
}
from
'@/services/webConfig/api'
;
}
from
'@/services/webConfig/api'
;
import
{
import
{
UserAddOutlined
}
from
'@ant-design/icons'
;
UserAddOutlined
import
AddModal
from
'./AddModal'
;
}
from
'@ant-design/icons'
;
import
AddModal
from
'./AddModal'
const
VectorData
=
props
=>
{
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
record
,
setRecord
]
=
useState
({});
//选中关联角色的方案名
const
[
record
,
setRecord
]
=
useState
({});
//选中关联角色的方案名
const
[
webCurrent
,
setWebCurrent
]
=
useState
(
0
);
// web列表下标
const
[
webCurrent
,
setWebCurrent
]
=
useState
(
0
);
// web列表下标
const
[
handCurrent
,
setHandCurrent
]
=
useState
(
0
);
// hand列表下标
const
[
handCurrent
,
setHandCurrent
]
=
useState
(
0
);
// hand列表下标
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
handStatus
,
setHandStatus
]
=
useState
([]);
// 更新状态
const
[
handStatus
,
setHandStatus
]
=
useState
([]);
// 更新状态
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
)
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
columns
=
[
const
columns
=
[
{
{
title
:
'默认方案'
,
title
:
'默认方案'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
Checkbox
<
Checkbox
checked=
{
webStatus
[
index
+
webCurrent
*
5
]
}
checked=
{
webStatus
[
index
+
webCurrent
*
5
]
}
onChange=
{
e
=>
{
onChange=
{
e
=>
{
onChangeCheck
(
e
,
record
,
index
+
webCurrent
*
5
);
onChangeCheck
(
e
,
record
,
index
+
webCurrent
*
5
);
}
}
}
}
/>
/>
</
Space
>
</
Space
>
),
),
},
},
{
{
title
:
'方案名'
,
title
:
'方案名'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
<
Space
>
{
record
.
scheme
.
schemename
}
</
Space
>,
<
Space
>
},
{
record
.
scheme
.
schemename
}
{
</
Space
>
title
:
'关联角色'
,
),
align
:
'center'
,
},
render
:
(
text
,
record
,
index
)
=>
(
{
<
Space
>
title
:
'关联角色'
,
<
Space
>
align
:
'center'
,
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
render
:
(
text
,
record
,
index
)
=>
(
<
VisibleRoleModal
<
Space
>
onSubmit=
{
onPushSubmit
}
<
Space
>
title=
{
'关联角色'
}
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
','
)
:
[]
}
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
title=
{
"关联角色"
}
initValues
={
record
.
roles
!=
null
?
record
.
roles
.
split
(","):[]}
operate=
{
<
UserAddOutlined
/>
}
/>
operate=
{
<
UserAddOutlined
/>
}
</
div
>
/>
</
Space
>
</
div
>
</
Space
>
</
Space
>
),
</
Space
>
},
),
{
},
title
:
'编辑'
,
{
align
:
'center'
,
title
:
'编辑'
,
render
:
(
text
,
record
,
index
)
=>
(
align
:
'center'
,
<
Space
>
render
:
(
text
,
record
,
index
)
=>
(
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
Space
>
<
Popconfirm
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
title=
"是否删除此条方案?"
<
Popconfirm
okText=
"确认"
title=
"是否删除此条方案?"
cancelText=
"取消"
okText=
"确认"
onConfirm=
{
()
=>
{
cancelText=
"取消"
delWebConfirm
(
record
);
onConfirm=
{
()
=>
{
}
}
delWebConfirm
(
record
);
>
}
}
<
Button
size=
"small"
danger
>
>
删除
<
Button
size=
"small"
danger
>
</
Button
>
删除
</
Popconfirm
>
</
Button
>
</
div
>
</
Popconfirm
>
</
Space
>
</
div
>
),
</
Space
>
}
),
},
];
];
// const columns1 = [
// const columns1 = [
// {
// {
// title: '查询方案',
// title: '查询方案',
// align: 'center',
// align: 'center',
// render: (text, record, index) => (
// render: (text, record, index) => (
// <Space>
// <Space>
// <Checkbox
// <Checkbox
// checked={handStatus[index + handCurrent * 5]}
// checked={handStatus[index + handCurrent * 5]}
// onChange={e => {
// onChange={e => {
// onChangeHand(e, record, index + handCurrent * 5);
// onChangeHand(e, record, index + handCurrent * 5);
// }}
// }}
// />
// />
// </Space>
// </Space>
// ),
// ),
// },
// },
// {
// {
// title: '方案名',
// title: '方案名',
// align: 'center',
// align: 'center',
// render: (text, record, index) => (
// render: (text, record, index) => (
// <Space>
// <Space>
// {record.scheme.schemename}
// {record.scheme.schemename}
// </Space>
// </Space>
// ),
// ),
// },
// },
// {
// {
// title: '关联角色',
// title: '关联角色',
// align: 'center',
// align: 'center',
// render: (text, record, index) => (
// render: (text, record, index) => (
// <Space>
// <Space>
// <div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
// <div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
// <VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} initValues ={record.roles!=null?record.roles.split(","):[]} operate={<UserAddOutlined />} />
// <VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} initValues ={record.roles!=null?record.roles.split(","):[]} operate={<UserAddOutlined />} />
// </div>
// </div>
// </Space>
// </Space>
// ),
// ),
// },
// },
// {
// {
// title: '编辑',
// title: '编辑',
// align: 'center',
// align: 'center',
// render: (text, record, index) => (
// render: (text, record, index) => (
// <Space>
// <Space>
// <div onClick={e => e.stopPropagation()}>
// <div onClick={e => e.stopPropagation()}>
// <Popconfirm
// <Popconfirm
// title="是否删除此条方案?"
// title="是否删除此条方案?"
// okText="确认"
// okText="确认"
// cancelText="取消"
// cancelText="取消"
// onConfirm={() => {
// onConfirm={() => {
// delhandConfirm(record);
// delhandConfirm(record);
// }}
// }}
// >
// >
// <Button size="small" danger>
// <Button size="small" danger>
// 删除
// 删除
// </Button>
// </Button>
// </Popconfirm>
// </Popconfirm>
// </div>
// </div>
// </Space>
// </Space>
// ),
// ),
// }
// }
// ];
//获取选中的角色
const
onPushSubmit
=
(
value
)
=>
{
let
id
=
[]
if
(
value
.
length
)
{
id
=
value
.
map
(
item
=>
{
return
item
.
id
})
let
query
=
{
schemaname
:
record
.
scheme
.
schemename
,
roles
:
id
.
join
(
','
)
}
SettingRoleWebSchema
(
query
).
then
(
res
=>
{
if
(
res
.
msg
===
""
)
{
prompt
(
'success'
,
'关联角色成功'
)
setFlag
(
flag
+
1
)
}
else
{
prompt
(
'fail'
,
'关联角色失败'
)
}
}).
catch
(
err
=>
{
prompt
(
'fail'
,
'网络请求失败'
)
})
}
}
// ];
//获取角色
//获取选中的角色
const
pickRole
=
(
record
)
=>
{
const
onPushSubmit
=
value
=>
{
setRecord
(
record
)
let
id
=
[];
}
if
(
value
.
length
)
{
//设置web方案
id
=
value
.
map
(
item
=>
{
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
return
item
.
id
;
setCheckLoading
(
true
)
});
IsActionWebSchema
({
schemaname
:
record
.
scheme
.
schemename
}).
then
(
res
=>
{
let
query
=
{
setCheckLoading
(
false
)
schemaname
:
record
.
scheme
.
schemename
,
if
(
res
.
msg
===
''
){
roles
:
id
.
join
(
','
),
prompt
(
'success'
,
'设置成功'
)
};
setFlag
(
flag
+
1
)
SettingRoleWebSchema
(
query
)
}
.
then
(
res
=>
{
else
{
if
(
res
.
msg
===
''
)
{
prompt
(
'fail'
,
res
.
msg
)
prompt
(
'success'
,
'关联角色成功'
);
}
setFlag
(
flag
+
1
);
}
else
{
prompt
(
'fail'
,
'关联角色失败'
);
}
})
})
.
catch
(
err
=>
{
prompt
(
'fail'
,
'网络请求失败'
);
});
}
}
};
//获取角色
const
pickRole
=
record
=>
{
setRecord
(
record
);
};
//设置web方案
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
);
IsActionWebSchema
({
schemaname
:
record
.
scheme
.
schemename
}).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
msg
===
''
)
{
prompt
(
'success'
,
'设置成功'
);
setFlag
(
flag
+
1
);
}
else
{
prompt
(
'fail'
,
res
.
msg
);
}
});
};
//选择手持方案
//选择手持方案
const
onChangeHand
=
(
e
,
record
,
index
)
=>
{
const
onChangeHand
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
);
setCheckLoading
(
true
)
const
newLoadings
=
[...
handStatus
];
const
newLoadings
=
[...
handStatus
];
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
return
loadIndex
==
index
?
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
]
:
newLoadings
[
loadIndex
]
=
false
?
(
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
])
})
:
(
newLoadings
[
loadIndex
]
=
false
);
setHandStatus
(
newLoadings
)
});
let
query
=
{
setHandStatus
(
newLoadings
);
schemename
:
record
[
'schemename'
],
let
query
=
{
terminalType
:
'phone'
,
schemename
:
record
[
'schemename'
],
isBaseMap
:
false
,
terminalType
:
'phone'
,
jsonCfg
:
JSON
.
stringify
({
isBaseMap
:
false
,
isDefault
:
newLoadings
[
index
],
jsonCfg
:
JSON
.
stringify
({
})
isDefault
:
newLoadings
[
index
],
}
}),
if
(
!
newLoadings
[
index
])
{
};
SetServiceConfig
(
query
).
then
(
res
=>
{
if
(
!
newLoadings
[
index
])
{
setCheckLoading
(
false
)
SetServiceConfig
(
query
).
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
setCheckLoading
(
false
);
const
changehandData
=
[...
handData
];
if
(
res
.
msg
===
'Ok'
)
{
changehandData
[
index
].
isDefault
=
false
const
changehandData
=
[...
handData
];
setHandData
(
changehandData
)
changehandData
[
index
].
isDefault
=
false
;
prompt
(
'success'
,
'设置成功'
)
setHandData
(
changehandData
);
}
else
{
prompt
(
'success'
,
'设置成功'
);
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
}
else
{
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
})
return
}
}
var
beforeDefault
=
handData
.
findIndex
((
item
)
=>
item
[
'isDefault'
]);
});
SetServiceConfig
({
return
;
schemename
:
record
[
'schemename'
],
}
var
beforeDefault
=
handData
.
findIndex
(
item
=>
item
[
'isDefault'
]);
SetServiceConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
true
,
}),
}).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
true
;
setHandData
(
changehandData
);
if
(
beforeDefault
!=
-
1
)
{
SetServiceConfig
({
schemename
:
changehandData
[
beforeDefault
].
schemename
,
terminalType
:
'phone'
,
terminalType
:
'phone'
,
isBaseMap
:
false
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
jsonCfg
:
JSON
.
stringify
({
isDefault
:
true
,
isDefault
:
false
,
})
}),
}).
then
(
res
=>
{
}).
then
(
res
=>
{
setCheckLoading
(
false
)
setCheckLoading
(
false
);
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
handData
];
const
changehandData1
=
[...
handData
];
changehandData
[
index
].
isDefault
=
true
changehandData1
[
beforeDefault
].
isDefault
=
false
;
setHandData
(
changehandData
)
setHandData
(
changehandData1
);
if
(
beforeDefault
!=
-
1
)
{
prompt
(
'success'
,
'设置成功'
);
SetServiceConfig
({
return
;
schemename
:
changehandData
[
beforeDefault
].
schemename
,
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
false
,
})
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData1
=
[...
handData
];
changehandData1
[
beforeDefault
].
isDefault
=
false
setHandData
(
changehandData1
)
prompt
(
'success'
,
'设置成功'
)
return
;
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
})
}
}
}
})
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
}
});
const
prompt
=
(
type
,
content
)
=>
{
if
(
type
==
'success'
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
}
}
});
};
const
prompt
=
(
type
,
content
)
=>
{
if
(
type
==
'success'
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
}
const
onSubmit
=
prop
=>
{
};
setVisible
(
false
);
const
onSubmit
=
prop
=>
{
setFlag
(
flag
+
1
)
setVisible
(
false
);
};
setFlag
(
flag
+
1
);
//删除web配置方案
};
const
delWebConfirm
=
(
record
)
=>
{
//删除web配置方案
DeleteWebSchema
(
record
.
scheme
.
schemename
).
then
(
res
=>
{
const
delWebConfirm
=
record
=>
{
if
(
res
.
msg
===
""
)
{
DeleteWebSchema
(
record
.
scheme
.
schemename
).
then
(
res
=>
{
prompt
(
'success'
,
'删除成功'
)
if
(
res
.
msg
===
''
)
{
setFlag
(
flag
+
1
)
prompt
(
'success'
,
'删除成功'
);
setFlag
(
flag
+
1
);
}
else
{
prompt
(
'fail'
,
'删除失败'
);
}
});
};
//删除手持配置方案
const
delhandConfirm
=
record
=>
{
deleteConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
}).
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
prompt
(
'success'
,
'删除成功'
);
setFlag
(
flag
+
1
);
}
else
{
prompt
(
'fail'
,
'删除失败'
);
}
});
};
//添加方案
const
addType
=
type
=>
{
setType
(
type
);
let
listData
=
[];
type
==
'add'
?
(
listData
=
webData
)
:
(
listData
=
handData
);
let
webSchemenameArr
=
[],
schemeArr
=
[];
setTreeLoading
(
true
);
GetSchemaInfoList
().
then
(
res
=>
{
if
(
res
.
data
&&
res
.
data
.
length
)
{
setTreeLoading
(
false
);
listData
.
map
(
item
=>
{
webSchemenameArr
.
push
(
item
.
scheme
.
schemename
);
});
res
.
data
.
map
(
item
=>
{
if
(
!
webSchemenameArr
.
includes
(
item
.
schemename
))
schemeArr
.
push
(
item
.
schemename
);
});
setSchemename
(
schemeArr
);
if
(
schemeArr
.
length
)
{
setVisible
(
true
);
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
else
{
setTreeLoading
(
false
);
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
});
};
useEffect
(()
=>
{
renderTile
();
},
[
flag
]);
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
setCheckLoading
(
true
);
//查询手持方案
// var schemeConfigQueryRequest = GetMaplayerByTerminalType({
// terminalType: 'phone',
// isBaseMap: false
// })
//查询web方案
var
webSchemeQueryRequest
=
GetWebSchemaList
();
Promise
.
all
([
webSchemeQueryRequest
])
.
then
(
res
=>
{
// if (res[0].msg==="Ok" && res[0].data.phone) {
// let arr = []
// res[0].data.phone.optionalLayer.layers.map((item, index) => {
// if (item.isDefault) {
// arr.push(true)
// } else {
// arr.push(false)
// }
}
else
{
// item.isStatus = 'phone'
prompt
(
'fail'
,
'删除失败'
)
// return item
};
// })
})
// setHandData(res[0].data.phone.optionalLayer.layers)
}
// setHandStatus(arr)
//删除手持配置方案
const
delhandConfirm
=
(
record
)
=>
{
deleteConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
}).
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
prompt
(
'success'
,
'删除成功'
)
setFlag
(
flag
+
1
)
// }
if
(
res
[
0
].
msg
===
'Ok'
&&
res
[
0
].
data
)
{
let
arr
=
[];
res
[
0
].
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
isDefault
)
{
arr
.
push
(
true
);
}
else
{
}
else
{
prompt
(
'fail'
,
'删除失败'
)
arr
.
push
(
false
);
};
})
}
//添加方案
const
addType
=
(
type
)
=>
{
setType
(
type
);
let
listData
=
[]
type
==
'add'
?
listData
=
webData
:
listData
=
handData
let
webSchemenameArr
=
[],
schemeArr
=
[]
setTreeLoading
(
true
);
GetSchemaInfoList
().
then
(
res
=>
{
if
(
res
.
data
&&
res
.
data
.
length
)
{
setTreeLoading
(
false
);
listData
.
map
(
item
=>
{
webSchemenameArr
.
push
(
item
.
scheme
.
schemename
)
})
res
.
data
.
map
(
item
=>
{
if
(
!
webSchemenameArr
.
includes
(
item
.
schemename
))
schemeArr
.
push
(
item
.
schemename
)
})
setSchemename
(
schemeArr
)
if
(
schemeArr
.
length
)
{
setVisible
(
true
);
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
else
{
setTreeLoading
(
false
);
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
)
}
useEffect
(()
=>
{
renderTile
();
},
[
flag
]);
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
setCheckLoading
(
true
)
//查询手持方案
// var schemeConfigQueryRequest = GetMaplayerByTerminalType({
// terminalType: 'phone',
// isBaseMap: false
// })
//查询web方案
var
webSchemeQueryRequest
=
GetWebSchemaList
()
Promise
.
all
([
webSchemeQueryRequest
]).
then
(
res
=>
{
// if (res[0].msg==="Ok" && res[0].data.phone) {
// let arr = []
// res[0].data.phone.optionalLayer.layers.map((item, index) => {
// if (item.isDefault) {
// arr.push(true)
// } else {
// arr.push(false)
// }
// item.isStatus = 'phone'
// return item
// })
// setHandData(res[0].data.phone.optionalLayer.layers)
// setHandStatus(arr)
// }
if
(
res
[
0
].
msg
===
"Ok"
&&
res
[
0
].
data
)
{
let
arr
=
[]
res
[
0
].
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
isDefault
)
{
arr
.
push
(
true
)
}
else
{
arr
.
push
(
false
)
}
item
.
isStatus
=
'web'
return
item
})
setWebData
(
res
[
0
].
data
)
setWebStatus
(
arr
)
}
}
setCheckLoading
(
false
)
item
.
isStatus
=
'web'
;
}).
catch
(
e
=>
{
return
item
;
setCheckLoading
(
false
)
});
})
setWebData
(
res
[
0
].
data
);
setWebStatus
(
arr
);
};
}
setCheckLoading
(
false
);
})
.
catch
(
e
=>
{
return
(
setCheckLoading
(
false
);
<>
});
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
};
<
div
className=
{
styles
.
solutionConfig
}
>
<
div
>
<
Divider
orientation=
"left"
><
div
className=
{
styles
.
divider
}
>
Web
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'add'
)
}
}
className=
{
styles
.
dividerIcon
}
/></
div
></
Divider
>
<
Table
columns=
{
columns
}
dataSource=
{
webData
}
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
(
value
)
=>
{
setWebCurrent
(
value
-
1
)
}
}
}
return
(
rowKey=
{
(
record
,
index
)
=>
record
.
scheme
.
schemename
}
<>
scroll=
{
{
y
:
400
}
}
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
>
<
div
className=
{
styles
.
solutionConfig
}
>
</
Table
>
<
div
>
</
div
>
<
Divider
orientation=
"left"
>
{
/* <Divider orientation="left"><div className={styles.divider}>手持 <PlusOutlined
<
div
className=
{
styles
.
divider
}
>
{
' '
}
Web
{
' '
}
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'add'
);
}
}
className=
{
styles
.
dividerIcon
}
/>
</
div
>
</
Divider
>
<
Table
columns=
{
columns
}
dataSource=
{
webData
}
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
value
=>
{
setWebCurrent
(
value
-
1
);
},
}
}
rowKey=
{
(
record
,
index
)
=>
record
.
scheme
.
schemename
}
scroll=
{
{
y
:
600
}
}
/>
</
div
>
{
/* <Divider orientation="left"><div className={styles.divider}>手持 <PlusOutlined
onClick={() => { addType('addHand') }}
onClick={() => { addType('addHand') }}
className={styles.dividerIcon} /></div> </Divider>
className={styles.dividerIcon} /></div> </Divider>
<Table
<Table
...
@@ -450,17 +447,17 @@ const VectorData = props => {
...
@@ -450,17 +447,17 @@ const VectorData = props => {
}}
}}
>
>
</Table> */
}
</Table> */
}
</
div
>
</
div
>
</
Spin
>
</
Spin
>
<
AddModal
<
AddModal
visible=
{
visible
}
visible=
{
visible
}
onCancel=
{
()
=>
setVisible
(
false
)
}
onCancel=
{
()
=>
setVisible
(
false
)
}
callBackSubmit=
{
onSubmit
}
callBackSubmit=
{
onSubmit
}
type=
{
type
}
type=
{
type
}
formObj=
{
formObj
}
formObj=
{
formObj
}
listData=
{
schemename
}
listData=
{
schemename
}
/>
/>
</>
</>
)
);
}
};
export
default
VectorData
export
default
VectorData
;
\ No newline at end of file
src/pages/platformCenter/gis/schemeConfig/TileConfig/TileConfig.jsx
View file @
d01f930e
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Spin
}
from
'antd'
;
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
;
import
{
import
{
GettMaplayer
,
deleteConfig
}
from
'@/services/webConfig/api'
;
GettMaplayer
,
import
AddModal
from
'./AddModal'
;
deleteConfig
}
from
'@/services/webConfig/api'
;
import
AddModal
from
'./AddModal'
const
TileData
=
props
=>
{
const
TileData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
tileData
,
setTileData
]
=
useState
([]);
// table表格数据
const
[
tileData
,
setTileData
]
=
useState
([]);
// table表格数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
baseMap
,
setBaseMap
]
=
useState
([]);
//底图数据
const
[
baseMap
,
setBaseMap
]
=
useState
([]);
//底图数据
const
columns
=
[
const
columns
=
[
{
{
title
:
'服务名'
,
title
:
'服务名'
,
dataIndex
:
'servicename'
,
dataIndex
:
'servicename'
,
key
:
'servicename'
,
key
:
'servicename'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'标签'
,
title
:
'标签'
,
dataIndex
:
'label'
,
dataIndex
:
'label'
,
key
:
'label'
,
key
:
'label'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'类型'
,
title
:
'类型'
,
dataIndex
:
'type'
,
dataIndex
:
'type'
,
key
:
'type'
,
key
:
'type'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'透明度'
,
title
:
'透明度'
,
dataIndex
:
'alpha'
,
dataIndex
:
'alpha'
,
key
:
'alpha'
,
key
:
'alpha'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'编辑'
,
title
:
'编辑'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
Space
>
<
Space
>
<
Button
<
Button
type=
"primary"
type=
"primary"
size=
"small"
size=
"small"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
changebaseMap
(
record
);
changebaseMap
(
record
);
}
}
}
}
>
>
编辑
编辑
</
Button
>
</
Button
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
Popconfirm
<
Popconfirm
title=
"是否删除该底图?"
title=
"是否删除该底图?"
okText=
"确认"
okText=
"确认"
cancelText=
"取消"
cancelText=
"取消"
onConfirm=
{
()
=>
{
onConfirm=
{
()
=>
{
delConfirm
(
record
);
delConfirm
(
record
);
}
}
}
}
>
>
<
Button
size=
"small"
danger
>
<
Button
size=
"small"
danger
>
删除
删除
</
Button
>
</
Button
>
</
Popconfirm
>
</
Popconfirm
>
</
div
>
</
div
>
</
Space
>
</
Space
>
),
),
},
},
];
const
changebaseMap
=
record
=>
{
setType
(
'edit'
);
setFormObj
(
record
);
setVisible
(
true
);
};
const
onSubmit
=
prop
=>
{
setVisible
(
false
);
setFlag
(
flag
+
1
);
};
];
const
delConfirm
=
record
=>
{
const
changebaseMap
=
(
record
)
=>
{
const
{
servicename
=
''
}
=
record
;
setType
(
'edit'
);
setTreeLoading
(
true
);
setFormObj
(
record
);
deleteConfig
({
setVisible
(
true
);
servicename
:
servicename
,
}
terminalType
:
'base'
,
const
onSubmit
=
prop
=>
{
isBaseMap
:
true
,
setVisible
(
false
);
})
setFlag
(
flag
+
1
)
.
then
(
res
=>
{
};
setFlag
(
flag
+
1
);
setTreeLoading
(
false
);
const
delConfirm
=
(
record
)
=>
{
if
(
res
.
msg
===
'Ok'
)
{
const
{
servicename
=
''
}
=
record
;
// form.resetFields();
setTreeLoading
(
true
);
// callBackSubmit();
deleteConfig
({
notification
.
success
({
servicename
:
servicename
,
message
:
'提示'
,
terminalType
:
'base'
,
duration
:
3
,
isBaseMap
:
true
description
:
res
.
message
||
'删除成功'
,
}).
then
(
res
=>
{
});
setFlag
(
flag
+
1
)
}
else
{
setTreeLoading
(
false
);
notification
.
error
({
if
(
res
.
msg
===
'Ok'
)
{
message
:
'提示'
,
// form.resetFields();
duration
:
3
,
// callBackSubmit();
description
:
res
.
message
||
'删除失败'
,
notification
.
success
({
});
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
||
'删除成功'
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
||
'删除失败'
,
});
}
}).
catch
(
err
=>
{
setFlag
(
flag
+
1
)
setTreeLoading
(
false
);
})
}
const
handleAdd
=
()
=>
{
if
(
baseMap
.
length
)
{
setType
(
'add'
);
setVisible
(
true
);
}
}
else
{
})
notification
.
warning
({
.
catch
(
err
=>
{
message
:
'提示'
,
setFlag
(
flag
+
1
);
duration
:
3
,
setTreeLoading
(
false
);
description
:
'地图类型已都存在,可编辑修改'
,
});
});
};
}
const
handleAdd
=
()
=>
{
if
(
baseMap
.
length
)
{
setType
(
'add'
);
setVisible
(
true
);
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'地图类型已都存在,可编辑修改'
,
});
}
}
useEffect
(()
=>
{
};
renderTile
();
useEffect
(()
=>
{
},
[
flag
]);
renderTile
();
// 获取瓦片数据配置数据
},
[
flag
]);
const
renderTile
=
()
=>
{
// 获取瓦片数据配置数据
setTreeLoading
(
true
);
const
renderTile
=
()
=>
{
const
baseMapData
=
[
'高德地形'
,
'高德影像'
,
'天地图地形'
,
'天地图影像'
]
setTreeLoading
(
true
);
GettMaplayer
({
const
baseMapData
=
[
'高德地形'
,
'高德影像'
,
'天地图地形'
,
'天地图影像'
];
terminalType
:
'base'
,
GettMaplayer
({
isBaseMap
:
true
terminalType
:
'base'
,
}).
then
(
isBaseMap
:
true
,
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
msg
===
'Ok'
)
{
setTreeLoading
(
false
);
setTreeLoading
(
false
);
setTileData
(
res
.
data
.
general
.
baseMap
.
layers
);
setTileData
(
res
.
data
.
general
.
baseMap
.
layers
);
res
.
data
.
general
.
baseMap
.
layers
.
map
((
item
)
=>
{
res
.
data
.
general
.
baseMap
.
layers
.
map
(
item
=>
{
let
index
=
baseMapData
.
indexOf
(
item
.
servicename
);
let
index
=
baseMapData
.
indexOf
(
item
.
servicename
);
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
baseMapData
.
splice
(
index
,
1
);
baseMapData
.
splice
(
index
,
1
);
}
}
})
});
setBaseMap
(
baseMapData
)
setBaseMap
(
baseMapData
);
}
else
{
}
else
{
setTreeLoading
(
false
);
setTreeLoading
(
false
);
notification
.
error
({
notification
.
error
({
message
:
'获取失败'
,
message
:
'获取失败'
,
description
:
res
.
message
,
description
:
res
.
message
,
});
});
}
}
}
});
)
};
};
return
(
<>
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
<
div
className=
{
styles
.
tileBtn
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
handleAdd
();
}
}
>
新增
</
Button
>
</
div
>
<
Table
columns=
{
columns
}
dataSource=
{
tileData
}
bordered
rowKey=
"type"
scroll=
{
{
y
:
400
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}
}
return
(
>
<>
</
Table
>
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
<
AddModal
<
div
className=
{
styles
.
tileBtn
}
>
visible=
{
visible
}
<
Button
onCancel=
{
()
=>
setVisible
(
false
)
}
type=
"primary"
callBackSubmit=
{
onSubmit
}
onClick=
{
()
=>
{
type=
{
type
}
handleAdd
();
formObj=
{
formObj
}
}
}
baseMap=
{
baseMap
}
>
/>
新增
</
Spin
>
</
Button
>
</>
</
div
>
)
<
Table
}
columns=
{
columns
}
export
default
TileData
dataSource=
{
tileData
}
\ No newline at end of file
bordered
rowKey=
"type"
scroll=
{
{
y
:
600
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
}
}
/>
<
AddModal
visible=
{
visible
}
onCancel=
{
()
=>
setVisible
(
false
)
}
callBackSubmit=
{
onSubmit
}
type=
{
type
}
formObj=
{
formObj
}
baseMap=
{
baseMap
}
/>
</
Spin
>
</>
);
};
export
default
TileData
;
src/pages/platformCenter/gis/schemeConfig/VectorData/VectorData.jsx
View file @
d01f930e
...
@@ -215,7 +215,7 @@ const VectorData = props => {
...
@@ -215,7 +215,7 @@ const VectorData = props => {
dataSource=
{
tileData
}
dataSource=
{
tileData
}
bordered
bordered
rowKey=
"CreateTime"
rowKey=
"CreateTime"
scroll=
{
{
y
:
4
00
}
}
scroll=
{
{
y
:
6
00
}
}
pagination=
{
{
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
}
}
}
}
...
...
src/pages/platformCenter/gis/schemeConfig/projectMessage/projectMessage.jsx
View file @
d01f930e
import
{
Button
,
Spin
}
from
'antd'
;
/* eslint-disable indent */
import
{
Button
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
;
import
{
import
{
GetMaplayerByTerminalType
}
from
'@/services/webConfig/api'
;
GetMaplayerByTerminalType
import
AddModal
from
'./AddModal'
;
}
from
'@/services/webConfig/api'
;
import
Cards
from
'./components/card'
;
import
AddModal
from
'./AddModal'
import
Cards
from
'./components/card'
const
VectorData
=
props
=>
{
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
tileData
,
setTileData
]
=
useState
([]);
// 页面初始化数据
const
[
tileData
,
setTileData
]
=
useState
([]);
// 页面初始化数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 状态更新
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 状态更新
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
formObj
,
setFormObj
]
=
useState
({});
const
onSubmit
=
prop
=>
{
const
onSubmit
=
prop
=>
{
setVisible
(
false
);
setVisible
(
false
);
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
)
};
};
const
onDeletebaseMap
=
value
=>
{
const
onDeletebaseMap
=
(
value
)
=>
{
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
)
};
}
const
handleAdd
=
()
=>
{
const
handleAdd
=
()
=>
{
setType
(
'schemeAdd'
);
setType
(
'schemeAdd'
);
setVisible
(
true
);
setVisible
(
true
);
};
}
useEffect
(()
=>
{
useEffect
(()
=>
{
renderTile
();
renderTile
();
},
[
flag
]);
},
[
flag
]);
// 获取瓦片数据配置数据
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
const
renderTile
=
()
=>
{
setTreeLoading
(
true
);
setTreeLoading
(
true
);
GetMaplayerByTerminalType
({
GetMaplayerByTerminalType
({
terminalType
:
'scheme'
,
terminalType
:
'scheme'
,
isBaseMap
:
false
,
isBaseMap
:
false
}).
then
(
res
=>
{
}).
then
(
console
.
log
(
'res'
,
res
);
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
console
.
log
(
'res'
,
res
);
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTileData
(
res
.
data
.
scheme
.
optionalLayer
.
layers
);
setTreeLoading
(
false
);
}
else
{
setTileData
(
res
.
data
.
scheme
.
optionalLayer
.
layers
);
setTreeLoading
(
false
);
}
else
{
}
setTreeLoading
(
false
);
});
};
}
return
(
}
<>
)
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
};
<
div
style=
{
{
height
:
'780px'
,
overflow
:
'scroll'
}
}
>
return
(
<
div
className=
{
styles
.
tileBtn
}
>
<>
<
Button
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
type=
"primary"
<
div
style=
{
{
width
:
'calc(100vw - 265px)'
}
}
>
onClick=
{
()
=>
{
<
div
className=
{
styles
.
tileBtn
}
>
handleAdd
();
<
Button
type=
"primary"
onClick=
{
()
=>
{
}
}
handleAdd
();
>
}
}
>
新增
新增
</
Button
>
</
Button
>
</
div
>
</
div
>
<
div
className=
{
styles
.
cardsList
}
>
<
div
className=
{
styles
.
cardsList
}
>
{
tileData
&&
tileData
.
length
{
tileData
&&
tileData
.
length
?
?
tileData
.
map
((
item
,
index
)
=>
{
tileData
.
map
((
item
,
index
)
=>
{
return
(
return
<
div
className=
{
styles
.
cardItem
}
key=
{
index
}
span=
{
5
}
offset=
{
2
}
style=
{
{
marginBottom
:
'1rem'
}
}
>
<
div
<
Cards
item=
{
item
}
deletebaseMaps=
{
onDeletebaseMap
}
></
Cards
>
className=
{
styles
.
cardItem
}
</
div
>
key=
{
index
}
})
:
''
}
span=
{
5
}
</
div
>
offset=
{
2
}
<
AddModal
style=
{
{
marginBottom
:
'1rem'
}
}
visible=
{
visible
}
>
onCancel=
{
()
=>
setVisible
(
false
)
}
<
Cards
item=
{
item
}
deletebaseMaps=
{
onDeletebaseMap
}
/>
callBackSubmit=
{
onSubmit
}
</
div
>
type=
{
type
}
);
formObj=
{
formObj
}
})
/>
:
''
}
</
div
>
</
div
>
</
Spin
>
<
AddModal
</>
visible=
{
visible
}
)
onCancel=
{
()
=>
setVisible
(
false
)
}
}
callBackSubmit=
{
onSubmit
}
export
default
VectorData
type=
{
type
}
\ No newline at end of file
formObj=
{
formObj
}
/>
</
div
>
</
Spin
>
</>
);
};
export
default
VectorData
;
src/pages/platformCenter/gis/schemeConfig/solutionConfig/solutionConfig.jsx
View file @
d01f930e
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
;
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
import
{
PlusOutlined
deleteConfig
,
}
from
'@ant-design/icons'
;
setServiceType
,
import
{
SetServiceConfig
,
deleteConfig
,
setServiceType
,
SetServiceConfig
,
GetMaplayerByTerminalType
GetMaplayerByTerminalType
,
}
from
'@/services/webConfig/api'
;
}
from
'@/services/webConfig/api'
;
import
{
import
{
UserAddOutlined
}
from
'@ant-design/icons'
;
UserAddOutlined
import
AddModal
from
'./AddModal'
;
}
from
'@ant-design/icons'
;
import
AddModal
from
'./AddModal'
const
VectorData
=
props
=>
{
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
record
,
setRecord
]
=
useState
({});
//选中关联角色的方案名
const
[
record
,
setRecord
]
=
useState
({});
//选中关联角色的方案名
const
[
webCurrent
,
setWebCurrent
]
=
useState
(
0
);
// web列表下标
const
[
webCurrent
,
setWebCurrent
]
=
useState
(
0
);
// web列表下标
const
[
handCurrent
,
setHandCurrent
]
=
useState
(
0
);
// hand列表下标
const
[
handCurrent
,
setHandCurrent
]
=
useState
(
0
);
// hand列表下标
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
handStatus
,
setHandStatus
]
=
useState
([]);
// 更新状态
const
[
handStatus
,
setHandStatus
]
=
useState
([]);
// 更新状态
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
)
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
columns
=
[
const
columns
=
[
{
{
title
:
'默认方案'
,
title
:
'默认方案'
,
align
:
'center'
,
align
:
'center'
,
key
:
'url'
,
key
:
'url'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
Checkbox
<
Checkbox
checked=
{
webStatus
[
index
+
webCurrent
*
5
]
}
checked=
{
webStatus
[
index
+
webCurrent
*
5
]
}
onChange=
{
e
=>
{
onChange=
{
e
=>
{
onChangeCheck
(
e
,
record
,
index
+
webCurrent
*
5
);
onChangeCheck
(
e
,
record
,
index
+
webCurrent
*
5
);
}
}
}
}
/>
/>
</
Space
>
</
Space
>
),
),
},
},
{
{
title
:
'方案名'
,
title
:
'方案名'
,
dataIndex
:
'schemename'
,
dataIndex
:
'schemename'
,
key
:
'schemename'
,
key
:
'schemename'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'关联角色'
,
title
:
'关联角色'
,
align
:
'center'
,
align
:
'center'
,
key
:
'type'
,
key
:
'type'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
Space
>
<
Space
>
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
title=
{
"关联角色"
}
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
","
)
:
[]
}
operate=
{
<
UserAddOutlined
/>
}
/>
<
VisibleRoleModal
</
div
>
onSubmit=
{
onPushSubmit
}
</
Space
>
title=
{
'关联角色'
}
</
Space
>
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
','
)
:
[]
}
),
operate=
{
<
UserAddOutlined
/>
}
},
/>
{
</
div
>
title
:
'编辑'
,
</
Space
>
align
:
'center'
,
</
Space
>
key
:
'schemename'
,
),
render
:
(
text
,
record
,
index
)
=>
(
},
<
Space
>
{
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
title
:
'编辑'
,
<
Popconfirm
align
:
'center'
,
title=
"是否删除此条方案?"
key
:
'schemename'
,
okText=
"确认"
render
:
(
text
,
record
,
index
)
=>
(
cancelText=
"取消"
<
Space
>
onConfirm=
{
()
=>
{
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
delWebConfirm
(
record
);
<
Popconfirm
}
}
title=
"是否删除此条方案?"
>
okText=
"确认"
<
Button
size=
"small"
danger
>
cancelText=
"取消"
删除
onConfirm=
{
()
=>
{
</
Button
>
delWebConfirm
(
record
);
</
Popconfirm
>
}
}
</
div
>
>
</
Space
>
<
Button
size=
"small"
danger
>
),
删除
}
</
Button
>
</
Popconfirm
>
];
</
div
>
const
columns1
=
[
</
Space
>
{
),
title
:
'查询方案'
,
},
align
:
'center'
,
];
key
:
'url'
,
const
columns1
=
[
render
:
(
text
,
record
,
index
)
=>
(
{
<
Space
>
title
:
'查询方案'
,
<
Checkbox
align
:
'center'
,
checked=
{
handStatus
[
index
+
handCurrent
*
5
]
}
key
:
'url'
,
onChange=
{
e
=>
{
render
:
(
text
,
record
,
index
)
=>
(
onChangeHand
(
e
,
record
,
index
+
handCurrent
*
5
);
<
Space
>
}
}
<
Checkbox
/>
checked=
{
handStatus
[
index
+
handCurrent
*
5
]
}
</
Space
>
onChange=
{
e
=>
{
),
onChangeHand
(
e
,
record
,
index
+
handCurrent
*
5
);
},
}
}
{
/>
title
:
'方案名'
,
</
Space
>
dataIndex
:
'schemename'
,
),
key
:
'schemename'
,
},
align
:
'center'
{
},
title
:
'方案名'
,
{
dataIndex
:
'schemename'
,
title
:
'关联角色'
,
key
:
'schemename'
,
align
:
'center'
,
align
:
'center'
,
key
:
'type'
,
},
render
:
(
text
,
record
,
index
)
=>
(
{
<
Space
>
title
:
'关联角色'
,
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
align
:
'center'
,
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
selectValue=
{
[]
}
title=
{
"关联角色"
}
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
","
)
:
[]
}
operate=
{
<
UserAddOutlined
/>
}
/>
key
:
'type'
,
</
div
>
render
:
(
text
,
record
,
index
)
=>
(
</
Space
>
<
Space
>
),
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
},
<
VisibleRoleModal
{
onSubmit=
{
onPushSubmit
}
title
:
'编辑'
,
selectValue=
{
[]
}
align
:
'center'
,
title=
{
'关联角色'
}
key
:
'schemename'
,
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
','
)
:
[]
}
render
:
(
text
,
record
,
index
)
=>
(
operate=
{
<
UserAddOutlined
/>
}
<
Space
>
/>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
</
div
>
<
Popconfirm
</
Space
>
title=
"是否删除此条方案?"
),
okText=
"确认"
},
cancelText=
"取消"
{
onConfirm=
{
()
=>
{
title
:
'编辑'
,
delhandConfirm
(
record
);
align
:
'center'
,
}
}
key
:
'schemename'
,
>
render
:
(
text
,
record
,
index
)
=>
(
<
Button
size=
"small"
danger
>
<
Space
>
删除
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
</
Button
>
<
Popconfirm
</
Popconfirm
>
title=
"是否删除此条方案?"
</
div
>
okText=
"确认"
</
Space
>
cancelText=
"取消"
),
onConfirm=
{
()
=>
{
}
delhandConfirm
(
record
);
}
}
];
>
//获取选中的角色
<
Button
size=
"small"
danger
>
const
onPushSubmit
=
(
value
)
=>
{
删除
let
id
=
[]
</
Button
>
if
(
value
.
length
)
{
</
Popconfirm
>
id
=
value
.
map
(
item
=>
{
return
item
.
id
})
</
div
>
let
query
=
{
</
Space
>
schemename
:
record
.
schemename
,
),
terminalType
:
record
.
isStatus
,
},
isBaseMap
:
false
,
];
jsonCfg
:
JSON
.
stringify
({
//获取选中的角色
roles
:
id
.
join
(
','
)
const
onPushSubmit
=
value
=>
{
})
let
id
=
[];
}
if
(
value
.
length
)
{
SetServiceConfig
(
query
).
then
(
res
=>
{
id
=
value
.
map
(
item
=>
{
if
(
res
.
msg
===
"Ok"
)
{
return
item
.
id
;
prompt
(
'success'
,
'关联角色成功'
)
});
setFlag
(
flag
+
1
)
let
query
=
{
}
schemename
:
record
.
schemename
,
else
{
terminalType
:
record
.
isStatus
,
prompt
(
'fail'
,
'关联角色失败'
)
isBaseMap
:
false
,
}
jsonCfg
:
JSON
.
stringify
({
}).
catch
(
err
=>
{
roles
:
id
.
join
(
','
),
prompt
(
'fail'
,
'网络请求失败'
)
}),
})
};
SetServiceConfig
(
query
)
}
.
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
prompt
(
'success'
,
'关联角色成功'
);
}
setFlag
(
flag
+
1
);
//获取角色
}
else
{
const
pickRole
=
(
record
)
=>
{
prompt
(
'fail'
,
'关联角色失败'
);
console
.
log
(
'recird'
,
record
);
}
setRecord
(
record
)
}
//设置web方案
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
)
const
newLoadings
=
[...
webStatus
];
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
?
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
]
:
newLoadings
[
loadIndex
]
=
false
})
})
setWebStatus
(
newLoadings
)
.
catch
(
err
=>
{
let
query
=
{
prompt
(
'fail'
,
'网络请求失败'
);
schemename
:
record
[
'schemename'
],
});
type
:
'dynamic'
}
}
};
if
(
!
newLoadings
[
index
])
{
//获取角色
setServiceType
(
query
).
then
(
res
=>
{
const
pickRole
=
record
=>
{
setCheckLoading
(
false
)
console
.
log
(
'recird'
,
record
);
if
(
res
.
IsSuccess
)
{
setRecord
(
record
);
const
changehandData
=
[...
webData
];
};
changehandData
[
index
].
type
=
'dynamic'
//设置web方案
setWebData
(
changehandData
)
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
prompt
(
'success'
,
'设置成功'
)
setCheckLoading
(
true
);
}
else
{
const
newLoadings
=
[...
webStatus
];
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
}
return
loadIndex
==
index
?
(
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
])
})
:
(
newLoadings
[
loadIndex
]
=
false
);
return
});
setWebStatus
(
newLoadings
);
let
query
=
{
schemename
:
record
[
'schemename'
],
type
:
'dynamic'
,
};
if
(
!
newLoadings
[
index
])
{
setServiceType
(
query
).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
webData
];
changehandData
[
index
].
type
=
'dynamic'
;
setWebData
(
changehandData
);
prompt
(
'success'
,
'设置成功'
);
}
else
{
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
}
}
var
beforeDefault
=
webData
.
findIndex
((
item
)
=>
item
[
'type'
]
==
'pipenet'
);
});
setServiceType
({
return
;
schemename
:
record
[
'schemename'
],
}
type
:
'pipenet'
var
beforeDefault
=
webData
.
findIndex
(
item
=>
item
[
'type'
]
==
'pipenet'
);
}).
then
(
res
=>
{
setServiceType
({
setCheckLoading
(
false
)
schemename
:
record
[
'schemename'
],
type
:
'pipenet'
,
}).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
webData
];
changehandData
[
index
].
type
=
'pipenet'
;
setWebData
(
changehandData
);
if
(
beforeDefault
!=
-
1
)
{
setServiceType
({
schemename
:
changehandData
[
beforeDefault
].
schemename
,
type
:
'dynamic'
,
}).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
IsSuccess
)
{
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
webData
];
const
changehandData1
=
[...
webData
];
changehandData
[
index
].
type
=
'pipenet'
changehandData1
[
beforeDefault
].
type
=
'dynamic'
;
setWebData
(
changehandData
)
setWebData
(
changehandData1
);
if
(
beforeDefault
!=
-
1
)
{
prompt
(
'success'
,
'设置成功'
);
setServiceType
({
return
;
schemename
:
changehandData
[
beforeDefault
].
schemename
,
type
:
'dynamic'
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData1
=
[...
webData
];
changehandData1
[
beforeDefault
].
type
=
'dynamic'
setWebData
(
changehandData1
)
prompt
(
'success'
,
'设置成功'
)
return
;
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
})
}
}
}
})
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
}
});
//选择手持方案
const
onChangeHand
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
)
const
newLoadings
=
[...
handStatus
];
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
?
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
]
:
newLoadings
[
loadIndex
]
=
false
})
setHandStatus
(
newLoadings
)
let
query
=
{
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
newLoadings
[
index
],
})
}
}
if
(
!
newLoadings
[
index
])
{
}
SetServiceConfig
(
query
).
then
(
res
=>
{
});
setCheckLoading
(
false
)
};
if
(
res
.
msg
===
"Ok"
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
false
setHandData
(
changehandData
)
prompt
(
'success'
,
'设置成功'
)
}
else
{
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
}
})
//选择手持方案
return
const
onChangeHand
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
);
const
newLoadings
=
[...
handStatus
];
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
?
(
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
])
:
(
newLoadings
[
loadIndex
]
=
false
);
});
setHandStatus
(
newLoadings
);
let
query
=
{
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
newLoadings
[
index
],
}),
};
if
(
!
newLoadings
[
index
])
{
SetServiceConfig
(
query
).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
false
;
setHandData
(
changehandData
);
prompt
(
'success'
,
'设置成功'
);
}
else
{
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
}
}
var
beforeDefault
=
handData
.
findIndex
((
item
)
=>
item
[
'isDefault'
]);
});
SetServiceConfig
({
return
;
schemename
:
record
[
'schemename'
],
}
var
beforeDefault
=
handData
.
findIndex
(
item
=>
item
[
'isDefault'
]);
SetServiceConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
true
,
}),
}).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
true
;
setHandData
(
changehandData
);
if
(
beforeDefault
!=
-
1
)
{
SetServiceConfig
({
schemename
:
changehandData
[
beforeDefault
].
schemename
,
terminalType
:
'phone'
,
terminalType
:
'phone'
,
isBaseMap
:
false
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
jsonCfg
:
JSON
.
stringify
({
isDefault
:
true
,
isDefault
:
false
,
})
}),
}).
then
(
res
=>
{
}).
then
(
res
=>
{
setCheckLoading
(
false
)
setCheckLoading
(
false
);
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
handData
];
const
changehandData1
=
[...
handData
];
changehandData
[
index
].
isDefault
=
true
changehandData1
[
beforeDefault
].
isDefault
=
false
;
setHandData
(
changehandData
)
setHandData
(
changehandData1
);
if
(
beforeDefault
!=
-
1
)
{
prompt
(
'success'
,
'设置成功'
);
SetServiceConfig
({
return
;
schemename
:
changehandData
[
beforeDefault
].
schemename
,
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
false
,
})
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData1
=
[...
handData
];
changehandData1
[
beforeDefault
].
isDefault
=
false
setHandData
(
changehandData1
)
prompt
(
'success'
,
'设置成功'
)
return
;
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
})
}
}
}
})
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
);
}
});
const
prompt
=
(
type
,
content
)
=>
{
if
(
type
==
'success'
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
}
}
});
};
const
prompt
=
(
type
,
content
)
=>
{
if
(
type
==
'success'
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
content
,
});
}
}
const
onSubmit
=
prop
=>
{
};
setVisible
(
false
);
const
onSubmit
=
prop
=>
{
setFlag
(
flag
+
1
)
setVisible
(
false
);
};
setFlag
(
flag
+
1
);
//删除web配置方案
};
const
delWebConfirm
=
(
record
)
=>
{
//删除web配置方案
deleteConfig
({
const
delWebConfirm
=
record
=>
{
schemename
:
record
[
'schemename'
],
deleteConfig
({
terminalType
:
'web'
,
schemename
:
record
[
'schemename'
],
isBaseMap
:
false
terminalType
:
'web'
,
}).
then
(
res
=>
{
isBaseMap
:
false
,
if
(
res
.
msg
===
"Ok"
)
{
}).
then
(
res
=>
{
prompt
(
'success'
,
'删除成功'
)
if
(
res
.
msg
===
'Ok'
)
{
setFlag
(
flag
+
1
)
prompt
(
'success'
,
'删除成功'
);
setFlag
(
flag
+
1
);
}
else
{
}
else
{
prompt
(
'fail'
,
'删除失败'
)
prompt
(
'fail'
,
'删除失败'
);
};
}
})
});
}
};
//删除手持配置方案
//删除手持配置方案
const
delhandConfirm
=
(
record
)
=>
{
const
delhandConfirm
=
record
=>
{
deleteConfig
({
deleteConfig
({
schemename
:
record
[
'schemename'
],
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
terminalType
:
'phone'
,
isBaseMap
:
false
isBaseMap
:
false
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
msg
===
'Ok'
)
{
prompt
(
'success'
,
'删除成功'
)
prompt
(
'success'
,
'删除成功'
);
setFlag
(
flag
+
1
)
setFlag
(
flag
+
1
);
}
else
{
prompt
(
'fail'
,
'删除失败'
);
}
});
};
//添加方案
const
addType
=
type
=>
{
setType
(
type
);
let
listData
=
[];
type
==
'add'
?
(
listData
=
webData
)
:
(
listData
=
handData
);
let
webSchemenameArr
=
[],
schemeArr
=
[];
setTreeLoading
(
true
);
GetMaplayerByTerminalType
({
terminalType
:
'scheme'
,
isBaseMap
:
false
,
}).
then
(
res
=>
{
if
(
res
.
data
.
scheme
&&
res
.
data
.
scheme
.
optionalLayer
.
layers
.
length
)
{
setTreeLoading
(
false
);
listData
.
map
(
item
=>
{
webSchemenameArr
.
push
(
item
.
schemename
);
});
res
.
data
.
scheme
.
optionalLayer
.
layers
.
map
(
item
=>
{
if
(
!
webSchemenameArr
.
includes
(
item
.
schemename
))
schemeArr
.
push
(
item
.
schemename
);
});
setSchemename
(
schemeArr
);
if
(
schemeArr
.
length
)
{
setVisible
(
true
);
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
else
{
setTreeLoading
(
false
);
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
});
};
useEffect
(()
=>
{
renderTile
();
},
[
flag
]);
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
setCheckLoading
(
true
);
//查询手持方案
var
schemeConfigQueryRequest
=
GetMaplayerByTerminalType
({
terminalType
:
'phone'
,
isBaseMap
:
false
,
});
//查询web方案
var
webSchemeQueryRequest
=
GetMaplayerByTerminalType
({
terminalType
:
'web'
,
isBaseMap
:
false
,
});
Promise
.
all
([
schemeConfigQueryRequest
,
webSchemeQueryRequest
])
.
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
if
(
res
[
0
].
msg
===
'Ok'
&&
res
[
0
].
data
.
phone
)
{
let
arr
=
[];
res
[
0
].
data
.
phone
.
optionalLayer
.
layers
.
map
((
item
,
index
)
=>
{
if
(
item
.
isDefault
)
{
arr
.
push
(
true
);
}
else
{
}
else
{
prompt
(
'fail'
,
'删除失败'
)
arr
.
push
(
false
);
};
})
}
//添加方案
const
addType
=
(
type
)
=>
{
setType
(
type
);
let
listData
=
[]
type
==
'add'
?
listData
=
webData
:
listData
=
handData
let
webSchemenameArr
=
[],
schemeArr
=
[]
setTreeLoading
(
true
);
GetMaplayerByTerminalType
({
terminalType
:
'scheme'
,
isBaseMap
:
false
}).
then
(
res
=>
{
if
(
res
.
data
.
scheme
&&
res
.
data
.
scheme
.
optionalLayer
.
layers
.
length
)
{
setTreeLoading
(
false
);
listData
.
map
(
item
=>
{
webSchemenameArr
.
push
(
item
.
schemename
)
})
res
.
data
.
scheme
.
optionalLayer
.
layers
.
map
(
item
=>
{
if
(
!
webSchemenameArr
.
includes
(
item
.
schemename
))
schemeArr
.
push
(
item
.
schemename
)
})
setSchemename
(
schemeArr
)
if
(
schemeArr
.
length
)
{
setVisible
(
true
);
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
else
{
setTreeLoading
(
false
);
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
}
)
}
useEffect
(()
=>
{
renderTile
();
},
[
flag
]);
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
setCheckLoading
(
true
)
//查询手持方案
var
schemeConfigQueryRequest
=
GetMaplayerByTerminalType
({
terminalType
:
'phone'
,
isBaseMap
:
false
})
//查询web方案
var
webSchemeQueryRequest
=
GetMaplayerByTerminalType
({
terminalType
:
'web'
,
isBaseMap
:
false
})
Promise
.
all
([
schemeConfigQueryRequest
,
webSchemeQueryRequest
]).
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
if
(
res
[
0
].
msg
===
"Ok"
&&
res
[
0
].
data
.
phone
)
{
let
arr
=
[]
res
[
0
].
data
.
phone
.
optionalLayer
.
layers
.
map
((
item
,
index
)
=>
{
if
(
item
.
isDefault
)
{
arr
.
push
(
true
)
}
else
{
arr
.
push
(
false
)
}
item
.
isStatus
=
'phone'
return
item
})
setHandData
(
res
[
0
].
data
.
phone
.
optionalLayer
.
layers
)
setHandStatus
(
arr
)
item
.
isStatus
=
'phone'
;
return
item
;
});
setHandData
(
res
[
0
].
data
.
phone
.
optionalLayer
.
layers
);
setHandStatus
(
arr
);
}
if
(
res
[
1
].
msg
===
'Ok'
&&
res
[
1
].
data
.
web
)
{
let
arr
=
[];
res
[
1
].
data
.
web
.
optionalLayer
.
layers
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
===
'pipenet'
)
{
arr
.
push
(
true
);
}
else
{
arr
.
push
(
false
);
}
}
if
(
res
[
1
].
msg
===
"Ok"
&&
res
[
1
].
data
.
web
)
{
item
.
isStatus
=
'web'
;
let
arr
=
[]
return
item
;
res
[
1
].
data
.
web
.
optionalLayer
.
layers
.
map
((
item
,
index
)
=>
{
});
if
(
item
.
type
===
"pipenet"
)
{
setWebData
(
res
[
1
].
data
.
web
.
optionalLayer
.
layers
);
arr
.
push
(
true
)
setWebStatus
(
arr
);
}
else
{
}
arr
.
push
(
false
)
setCheckLoading
(
false
);
}
})
item
.
isStatus
=
'web'
.
catch
(
e
=>
{
return
item
setCheckLoading
(
false
);
})
});
setWebData
(
res
[
1
].
data
.
web
.
optionalLayer
.
layers
)
};
setWebStatus
(
arr
)
}
setCheckLoading
(
false
)
}).
catch
(
e
=>
{
setCheckLoading
(
false
)
})
};
return
(
<>
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
<
div
className=
{
styles
.
solutionConfig
}
>
<
div
>
<
Divider
orientation=
"left"
><
div
className=
{
styles
.
divider
}
>
Web
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'add'
)
}
}
className=
{
styles
.
dividerIcon
}
/></
div
></
Divider
>
<
Table
columns=
{
columns
}
dataSource=
{
webData
}
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
(
value
)
=>
{
setWebCurrent
(
value
-
1
)
}
}
}
rowKey=
"schemename"
scroll=
{
{
y
:
400
}
}
>
</
Table
>
</
div
>
<
Divider
orientation=
"left"
><
div
className=
{
styles
.
divider
}
>
手持
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'addHand'
)
}
}
className=
{
styles
.
dividerIcon
}
/></
div
>
</
Divider
>
<
Table
columns=
{
columns1
}
dataSource=
{
handData
}
bordered
rowKey=
"schemename"
scroll=
{
{
y
:
400
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
(
value
)
=>
{
setHandCurrent
(
value
-
1
)
}
}
}
return
(
>
<>
</
Table
>
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
</
div
>
<
div
className=
{
styles
.
solutionConfig
}
>
</
Spin
>
<
div
>
<
AddModal
<
Divider
orientation=
"left"
>
visible=
{
visible
}
<
div
className=
{
styles
.
divider
}
>
onCancel=
{
()
=>
setVisible
(
false
)
}
{
' '
}
callBackSubmit=
{
onSubmit
}
Web
{
' '
}
type=
{
type
}
<
PlusOutlined
formObj=
{
formObj
}
onClick=
{
()
=>
{
listData=
{
schemename
}
addType
(
'add'
);
}
}
className=
{
styles
.
dividerIcon
}
/>
</
div
>
</
Divider
>
<
Table
columns=
{
columns
}
dataSource=
{
webData
}
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
value
=>
{
setWebCurrent
(
value
-
1
);
},
}
}
rowKey=
"schemename"
scroll=
{
{
y
:
400
}
}
/>
/>
</>
</
div
>
)
<
Divider
orientation=
"left"
>
}
<
div
className=
{
styles
.
divider
}
>
export
default
VectorData
手持
{
' '
}
\ No newline at end of file
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'addHand'
);
}
}
className=
{
styles
.
dividerIcon
}
/>
</
div
>
{
' '
}
</
Divider
>
<
Table
columns=
{
columns1
}
dataSource=
{
handData
}
bordered
rowKey=
"schemename"
scroll=
{
{
y
:
600
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
8
,
onChange
:
value
=>
{
setHandCurrent
(
value
-
1
);
},
}
}
/>
</
div
>
</
Spin
>
<
AddModal
visible=
{
visible
}
onCancel=
{
()
=>
setVisible
(
false
)
}
callBackSubmit=
{
onSubmit
}
type=
{
type
}
formObj=
{
formObj
}
listData=
{
schemename
}
/>
</>
);
};
export
default
VectorData
;
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