diff --git a/src/api/index.js b/src/api/index.js
index 940b3627..546c079d 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -62,3 +62,29 @@ export function getAdStatisticsData( params ) {
});
}
+// 基础地图创建涂层
+export function createLayer( params ) {
+ return request('/api/basicMap/createLayer', {
+ method: 'POST',
+ params: params
+ });
+}
+
+// 基础地图修改涂层
+export function updateLayer( params ) {
+ return request('/api/basicMap/updateLayer', {
+ method: 'POST',
+ params: params
+ });
+}
+
+// 基础地图删除涂层
+export function deleteLayer( params ) {
+ return request('/api/basicMap/deleteLayer', {
+ method: 'get',
+ params: params
+ });
+}
+
+
+
diff --git a/src/assets/images/modal_bg.png b/src/assets/images/modal_bg.png
new file mode 100644
index 00000000..0e5b00c9
Binary files /dev/null and b/src/assets/images/modal_bg.png differ
diff --git a/src/assets/images/modal_bg2.png b/src/assets/images/modal_bg2.png
new file mode 100644
index 00000000..a10c8aa0
Binary files /dev/null and b/src/assets/images/modal_bg2.png differ
diff --git a/src/index.less b/src/index.less
index 99781f96..0ba60463 100644
--- a/src/index.less
+++ b/src/index.less
@@ -104,6 +104,44 @@ body {
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
border-radius: 10px;
opacity: 1;
+ text-align: center;
+ }
+ #add-layer {
+ margin-bottom: 18px;
+ }
+ .ant-modal-content {
+ background: url(./assets/images/modal_bg.png) no-repeat;
+ background-size: cover;
+ }
+ .ant-modal-header {
+ background: none;
+ }
+ .ant-modal-footer {
+ text-align: center !important;
+ }
+ .radio-btn {
+ width: 56px;
+ height: 56px;
+ margin-right: 40px;
+ border-radius: 0% !important;
+ }
+ #redio-btn-group .icon-01 {
+ background: url(./assets/icon/position_icon1_big.png) no-repeat center center;
+ background-size: 80%;
+ }
+ #redio-btn-group .icon-02 {
+ background: url(./assets/icon/position_icon2_big.png) no-repeat center center;
+ background-size: 80%;
+ }
+ #redio-btn-group .icon-03 {
+ background: url(./assets/icon/position_icon3_big.png) no-repeat center center;
+ background-size: 34%;
+ }
+ .showItem {
+ display: inline-block;
+ }
+ .hideItem {
+ display: none;
}
.layer-data-wrap .ant-tree {
background: none;
@@ -152,6 +190,8 @@ body {
background: #FFFFFF;
opacity: 1;
padding: 22px 68px;
+ position: relative;
+ z-index: 999;
}
.header-left {
float: left;
diff --git a/src/pages/BaseMap/LayerData/index.js b/src/pages/BaseMap/LayerData/index.js
index a8bcf02c..0c7af8c5 100644
--- a/src/pages/BaseMap/LayerData/index.js
+++ b/src/pages/BaseMap/LayerData/index.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { Tree } from 'antd';
+import { Tree, Button, Modal, Form, Input, Radio } from 'antd';
import axios from 'axios';
import {
DownOutlined,
@@ -7,6 +7,7 @@ import {
EyeInvisibleOutlined,
} from '@ant-design/icons';
import SetLogoImagePath from './SetLogoImagePath'
+import { createLayer } from '../../../api';
import '../../../index.less';
class LayerData extends React.Component {
@@ -15,6 +16,13 @@ class LayerData extends React.Component {
this.state = {
treeData: [],
layerId: '',
+ isModalOpen: false,
+ addLayer: {
+ id: 0,
+ logoImagePath: '',
+ name: '',
+ note: '',
+ },
}
}
@@ -65,6 +73,73 @@ class LayerData extends React.Component {
this.props.getLayerShapes(layerId, info.selected);
}
}
+ //弹出框事件
+ showModal = () => {
+ this.setState({
+ isModalOpen: true
+ });
+ };
+ handleOk = (values) => {
+ if (this.state.addLayer.id != 0) { //编辑图层
+ updateLayer({
+ id: this.state.addLayer.id,
+ logoImagePath: this.state.addLayer.logoImagePath,
+ name: this.state.addLayer.name,
+ note: this.state.addLayer.note,
+ }).then((e) => {
+ this.setState({
+ isModalOpen: false
+ });
+ })
+ } else {
+ createLayer({ //创建图层
+ id: this.state.addLayer.id,
+ logoImagePath: this.state.addLayer.logoImagePath,
+ name: this.state.addLayer.name,
+ note: this.state.addLayer.note,
+ }).then((e) => {
+ this.setState({
+ isModalOpen: false
+ });
+ })
+ }
+ };
+ handleCancel = () => {
+ this.setState({
+ isModalOpen: false
+ });
+ };
+ onLayerNameChange = (e) => {
+ this.setState({
+ addLayer: {
+ id: this.state.addLayer.id,
+ logoImagePath: this.state.addLayer.logoImagePath,
+ note: this.state.addLayer.note,
+ name: e.target.value,
+ }
+ })
+ };
+ onLayerNoteChange = (e) => {
+ this.setState({
+ addLayer: {
+ id: this.state.addLayer.id,
+ logoImagePath: this.state.addLayer.logoImagePath,
+ name: this.state.addLayer.name,
+ note: e.target.value,
+ }
+ })
+ };
+ onLayerIogoImagePathChange = (e) => {
+ this.setState({
+ addLayer: {
+ id: this.state.addLayer.id,
+ note: this.state.addLayer.note,
+ name: this.state.addLayer.name,
+ logoImagePath: e.target.value,
+ }
+ })
+ };
+ //弹出框事件
render() {
return (
@@ -77,6 +152,37 @@ class LayerData extends React.Component {
treeData={this.state.treeData}
onSelect={this.onLayerSelect}
/>
+
+