Commit 90ca6ff2 authored by mayongxin's avatar mayongxin
parents 55ffd0d3 ce8bca89
Pipeline #26219 skipped with stages
...@@ -6,94 +6,60 @@ import thumbnail_2 from '@/assets/images/thumbnail/thumbnail_2.jpg'; ...@@ -6,94 +6,60 @@ import thumbnail_2 from '@/assets/images/thumbnail/thumbnail_2.jpg';
import thumbnail_3 from '@/assets/images/thumbnail/thumbnail_3.jpg'; import thumbnail_3 from '@/assets/images/thumbnail/thumbnail_3.jpg';
import thumbnail_4 from '@/assets/images/thumbnail/thumbnail_4.jpg'; import thumbnail_4 from '@/assets/images/thumbnail/thumbnail_4.jpg';
import { import {
SetServiceConfig, SetServiceConfig
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import {
addMySQLConnString,
editMySQLConnString,
} from '@/services/database/api';
import { number } from 'prop-types';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const { callBackSubmit = () => { }, type, formObj, visible } = props; const { callBackSubmit = () => { }, type, formObj, visible, baseMap } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [radio, setRadio] = useState(); const [radio, setRadio] = useState();
const [alpha, setAlpha] = useState(0); const [alpha, setAlpha] = useState(1);
const [mapType, setMapType] = useState(0); const [mapType, setMapType] = useState(0);
const [ImgIndex, setImgIndex] = useState('');
const [form] = Form.useForm(); const [form] = Form.useForm();
const [baseMap, setBaseMap] = useState(['天地图地形', '天地图影像', '地形图', '自定义底图']); //底图数据
const arr = ['assets/images/thumbnail/thumbnail_1.jpg', 'assets/images/thumbnail/thumbnail_2.jpg', 'assets/images/thumbnail/thumbnail_3.jpg', 'assets/images/thumbnail/thumbnail_4.jpg'] const arr = ['assets/images/thumbnail/thumbnail_1.jpg', 'assets/images/thumbnail/thumbnail_2.jpg', 'assets/images/thumbnail/thumbnail_3.jpg', 'assets/images/thumbnail/thumbnail_4.jpg']
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
if (type === 'add') { let arr = {
addMySQLConnString({ servicename: obj.servicename,
_version: 9999, terminalType: 'base',
_dc: Date.now(), isBaseMap: true,
...obj, jsonCfg: JSON.stringify({
alpha: alpha,
label: obj.label,
url: obj.url,
icon: obj.icon,
type: obj.type,
}) })
.then(res => {
setLoading(false);
if (res.success) {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.message || '新增成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.message || '新增失败',
});
}
})
.catch(err => {
setLoading(false);
console.error(err);
});
} else if (type === 'edit') {
handleEdit();
} }
SetServiceConfig(arr)
.then(res => {
setLoading(false);
if (res.IsSuccess) {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.message || type =='add'?'新增成功':'编辑成功'
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.message || type =='add'?'新增失败':'编辑失败'
});
}
})
.catch(err => { setLoading(false); });
} }
}); });
}; };
const handleEdit = () => {
let obj = form.getFieldsValue();
SetServiceConfig({
servicename: serviceName,
terminalType: 'base',
isBaseMap: true,
jsonCfg: JSON.stringify(query)
})
.then(res => {
setLoading(false);
if (res.success) {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.message || '编辑成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.message || '编辑失败',
});
}
})
.catch(err => setLoading(false));
};
const onFinish = value => { }; const onFinish = value => { };
useEffect(() => { useEffect(() => {
...@@ -102,7 +68,9 @@ const AddModal = props => { ...@@ -102,7 +68,9 @@ const AddModal = props => {
setRadio('') setRadio('')
form.resetFields(); form.resetFields();
form.setFieldsValue({ form.setFieldsValue({
servicename: baseMap[0] servicename: baseMap[0],
label: baseMap[0],
type: servicenameToType(baseMap[0])
}) })
break; break;
case 'edit': case 'edit':
...@@ -119,13 +87,12 @@ const AddModal = props => { ...@@ -119,13 +87,12 @@ const AddModal = props => {
default: default:
break; break;
} }
console.log(baseMap.indexOf(form.getFieldsValue('').servicename)) // if (form.getFieldsValue('').servicename && baseMap.indexOf(form.getFieldsValue('').servicename) == 2 || baseMap.indexOf(form.getFieldsValue('').servicename) == 3) {
if (form.getFieldsValue('').servicename && baseMap.indexOf(form.getFieldsValue('').servicename) == 2 || baseMap.indexOf(form.getFieldsValue('').servicename) == 3) { // setMapType(1)
setMapType(1) // }
} // else {
else { // setMapType(0)
setMapType(0) // }
}
}, [visible]); }, [visible]);
...@@ -139,11 +106,11 @@ const AddModal = props => { ...@@ -139,11 +106,11 @@ const AddModal = props => {
}, },
}; };
const onChange = (value) => { const onChange = (value) => {
let silderData = (value / 100).toFixed(2) let silderData = value == 100 ? 1 : (value / 100).toFixed(1)
setAlpha(silderData) setAlpha(silderData)
} }
const tipFormatter = (value) => { const tipFormatter = (value) => {
return (value / 100).toFixed(2) return (value / 100).toFixed(1)
} }
const imgURL = [ const imgURL = [
...@@ -165,12 +132,44 @@ const AddModal = props => { ...@@ -165,12 +132,44 @@ const AddModal = props => {
setRadio(e.target.value) setRadio(e.target.value)
} }
const handleChange = (value) => { const handleChange = (value) => {
form.setFieldsValue({
if ( baseMap.indexOf(value) == 2 || baseMap.indexOf(value) == 3) { type: servicenameToType(value)
setMapType(1) })
} // if (baseMap.indexOf(value) == 2 || baseMap.indexOf(value) == 3) {
else { // setMapType(1)
setMapType(0) // }
// else {
// setMapType(0)
// }
}
//添加地图类型
const servicenameToType = (servicename) => {
// if (servicename.indexOf('地形图') > -1)
// servicename = '地形图'
// if (servicename.indexOf('自定义底图') > -1)
// servicename = '自定义底图'
switch (servicename) {
case "谷歌地形":
return 'google-v';
case "谷歌影像(注记)":
return 'google-i-a';
case "谷歌影像":
return 'google-i';
case "高德影像":
return 'amap-i';
case "高德地形":
return 'amap-v';
case "天地图影像":
return 'tianditu-i-ia';
case "天地图地形":
return 'tianditu-v-va';
case "自定义底图":
return 'google-user';
case "地形图":
case "瓦片图":
return "pipenet-tile";
default:
return 'arcgis-tilelayer';
} }
} }
//选择坐标系 //选择坐标系
...@@ -219,7 +218,7 @@ const AddModal = props => { ...@@ -219,7 +218,7 @@ const AddModal = props => {
label="类型" label="类型"
name="type" name="type"
> >
<Input placeholder="请输入类型" allowClear /> <Input placeholder="请输入类型" allowClear disabled />
</Item> </Item>
<Item <Item
label="URL" label="URL"
...@@ -238,7 +237,7 @@ const AddModal = props => { ...@@ -238,7 +237,7 @@ const AddModal = props => {
onChange={onChange} onChange={onChange}
step={0.1} step={0.1}
tipFormatter={tipFormatter} tipFormatter={tipFormatter}
defaultValue={type === 'add' ? 0 : formObj.alpha * 100} defaultValue={type === 'add' ? 100 : formObj.alpha * 100}
/> />
</Col> </Col>
<Col span={4}> <Col span={4}>
...@@ -246,7 +245,7 @@ const AddModal = props => { ...@@ -246,7 +245,7 @@ const AddModal = props => {
min={0} min={0}
max={1} max={1}
style={{ margin: '0 16px' }} style={{ margin: '0 16px' }}
defaultValue={type === 'add' ? 0 : formObj.alpha} defaultValue={type === 'add' ? 1 : formObj.alpha}
value={alpha} value={alpha}
onChange={onChange} onChange={onChange}
/> />
......
import { Space, Table, Button, Popconfirm,notification } from 'antd'; import { Space, Table, Button, Popconfirm, notification } from 'antd';
import React, { useState, useEffect, Modal } from 'react'; import React, { useState, useEffect, Modal } from 'react';
import styles from '../SchemeConfig.less' import styles from '../SchemeConfig.less'
import { import {
GetAllConfig, GetAllConfig,
DeleteConfig
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import AddModal from './AddModal' import AddModal from './AddModal'
const TileData = props => { const TileData = props => {
...@@ -11,6 +12,8 @@ const TileData = props => { ...@@ -11,6 +12,8 @@ const TileData = props => {
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [type, setType] = useState('add'); // 弹窗类型 const [type, setType] = useState('add'); // 弹窗类型
const [formObj, setFormObj] = useState({}); const [formObj, setFormObj] = useState({});
const [flag, setFlag] = useState(0); // 弹窗类型
const [baseMap, setBaseMap] = useState([]); //底图数据
const columns = [ const columns = [
{ {
title: '服务名', title: '服务名',
...@@ -75,23 +78,62 @@ const TileData = props => { ...@@ -75,23 +78,62 @@ const TileData = props => {
setVisible(true); setVisible(true);
} }
const onSubmit = prop => { const onSubmit = prop => {
setVisible(false); setVisible(false);
setFlag(flag + 1)
}; };
const delConfirm = (record) => { const delConfirm = (record) => {
console.log('record', record) const { servicename = '' } = record;
setTreeLoading(true);
DeleteConfig({
servicename: servicename,
terminalType: 'base',
isBaseMap: true
}).then(res => {
setFlag(flag + 1)
setTreeLoading(false);
console.log('res', res)
if (res.IsSuccess) {
// form.resetFields();
// callBackSubmit();
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 = ()=>{ const handleAdd = () => {
setType('add'); if(baseMap.length){
setVisible(true); setType('add');
setVisible(true);
}
else{
notification.warning({
message: '提示',
duration: 3,
description: '地图类型已都存在,可编辑修改',
});
}
} }
useEffect(() => { useEffect(() => {
renderTile(); renderTile();
}, []); }, [flag]);
// 获取瓦片数据配置数据 // 获取瓦片数据配置数据
const renderTile = () => { const renderTile = () => {
setTreeLoading(true); setTreeLoading(true);
const baseMapData = ['高德地形', '高德影像', '天地图地形', '天地图影像']
GetAllConfig({ GetAllConfig({
terminalType: 'base', terminalType: 'base',
isBaseMap: true isBaseMap: true
...@@ -100,6 +142,13 @@ const TileData = props => { ...@@ -100,6 +142,13 @@ const TileData = props => {
if (res.Result && res.Result.length > 0) { if (res.Result && res.Result.length > 0) {
setTreeLoading(false); setTreeLoading(false);
setTileData(res.Result); setTileData(res.Result);
res.Result.map( (item) =>{
let index = baseMapData.indexOf(item.servicename);
if (index != -1) {
baseMapData.splice(index, 1);
}
})
setBaseMap(baseMapData)
} else { } else {
setTreeLoading(false); setTreeLoading(false);
notification.error({ notification.error({
...@@ -134,6 +183,7 @@ const TileData = props => { ...@@ -134,6 +183,7 @@ const TileData = props => {
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
type={type} type={type}
formObj={formObj} formObj={formObj}
baseMap = {baseMap}
/> />
</> </>
) )
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification, Button } from 'antd'; import { Form, Modal, Input, Select, AutoComplete, Button, notification } from 'antd';
import styles from '../SchemeConfig.less' import styles from '../SchemeConfig.less'
import { import {
SetServiceConfig, GetGISServerMapList,
publisService
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import {
addMySQLConnString,
editMySQLConnString,
} from '@/services/database/api';
import { number } from 'prop-types';
const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const { callBackSubmit = () => { }, type, formObj, visible } = props; const { callBackSubmit = () => { }, type, formObj, visible,solutionNames } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [mapType, setMapType] = useState(0); const [workSpace, setWorkSpace] = useState('');
const [ImgIndex, setImgIndex] = useState(''); const [serviceName, setServicename] = useState([{
value: 'geoserver',
item: 'geoserver'
}]);
const [workList, setWorkList] = useState([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { Item } = Form;
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
// setLoading(true); setLoading(true);
// let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
// if (type === 'add') { if (type === 'add') {
// addMySQLConnString({ let query = {
// _version: 9999, _version: 9999,
// _dc: Date.now(), gsIP: obj.serviceadress,
// ...obj, gsPort: obj.port,
// }) gsAppName: obj.servicename,
// .then(res => { gsUser: obj.user,
// setLoading(false); gsWorkspaceName: obj.workname,
// if (res.success) { gsPwd: obj.password,
// form.resetFields(); serviceName: obj.name,
// callBackSubmit(); solution: solutionNames,
// notification.success({ }
// message: '提示', let timeout =120000
// duration: 3, publisService(query,timeout)
// description: res.message || '新增成功', .then(res => {
// }); console.log('res',res)
// } else { setLoading(false);
// notification.error({ if (res.success) {
// message: '提示', form.resetFields();
// duration: 3, callBackSubmit();
// description: res.message || '新增失败', notification.success({
// }); message: '提示',
// } duration: 3,
// }) description: res.message || '新增成功',
// .catch(err => { });
// setLoading(false); handlelocalStorage('add',obj.serviceadress, obj.servicename)
// console.error(err); } else {
// }); notification.error({
// } else if (type === 'edit') { message: '提示',
// handleEdit(); duration: 3,
// } description: res.message || '新增失败',
});
}
})
.catch(err => {
console.log(err);
setLoading(false);
});
} else if (type === 'edit') {
handleEdit();
}
} }
}); });
}; };
const handleEdit = () => { const handleEdit = () => {
// SetServiceConfig({ // SetServiceConfig({
// servicename: serviceName, // servicename: serviceName,
...@@ -90,17 +104,54 @@ const AddModal = props => { ...@@ -90,17 +104,54 @@ const AddModal = props => {
useEffect(() => { useEffect(() => {
switch (type) { switch (type) {
case 'add': case 'add':
form.resetFields(); let gsIp = [];
let localStorageData = handlelocalStorage('get');
if (localStorageData) {
gsIp = localStorageData.map(item => ({
value: item.gsIp,
item: item.gsIp
}));
}
let localIps = ['192.168.12.7', '192.168.19.100']
let port = localIps.includes(gsIp) ? 8080 : 8088
form.setFieldsValue({ servicename: serviceName[0].value, port, ...formObj });
break; break;
case 'edit': case 'edit':
form.setFieldsValue({ ...formObj }); form.setFieldsValue({ ...formObj });
break; break;
default: default:
break; break;
} }
}, [visible]); }, [visible]);
//存储到localstorage
const handlelocalStorage = (type, gsIp, gisAppName) => {
if (!localStorage) return null;
let result = JSON.parse(localStorage.getItem('metaData'))
if (type == 'get') {
return result;
}
if (!result || !result.find(item => item.gsIp == gsIp)) {
if (!result) result = [];
result.push({
gsIp,
gisAppName: [{
value: gisAppName,
item: gisAppName
}]
})
localStorage.setItem('metaData', JSON.stringify(result))
return
}
let data = result.find(item => item.gsIp == gsIp)
let isHasGisAppName = data.gisAppName.find(item => item.value == gisAppName);
if (isHasGisAppName) return;
data.gisAppName.push({
value: gisAppName,
item: gisAppName
})
localStorage.setItem('metaData', JSON.stringify(result))
};
const layout = { const layout = {
layout: 'horizontal', layout: 'horizontal',
...@@ -113,6 +164,49 @@ const AddModal = props => { ...@@ -113,6 +164,49 @@ const AddModal = props => {
}; };
const handleChange = () => { } const handleChange = () => { }
//选择工作空间
const selectWorkspace = () => {
let obj = form.getFieldsValue();
form.validateFields(['serviceadress', 'port', 'servicename', 'user', 'password']).then(validate => {
if (validate) {
let query = {
GISServerIP: obj.serviceadress,
GISServerPort: obj.port,
gsAppName: obj.servicename,
gsUser: obj.user,
gsPwd: obj.password,
isGeoServer: true,
_version: 9999,
}
GetGISServerMapList(query).then(res => {
if (Array.isArray(res)) {
const defaultValue= res[0].name||''
form.setFieldsValue({ name:defaultValue,workname:defaultValue});
setWorkList(res)
setWorkSpace(defaultValue)
}
else {
notification.error({
message: '提示',
duration: 3,
description: '获取工作空间失败',
});
}
})
}
})
};
//选择工作空间
const handleWorkspace = (value) => {
form.setFieldsValue({
workname: value,
name:value
})
setWorkSpace(value)
}
return ( return (
<Modal <Modal
title={`${type === 'add' ? '元数据发布' : '编辑'}`} title={`${type === 'add' ? '元数据发布' : '编辑'}`}
...@@ -133,7 +227,7 @@ const AddModal = props => { ...@@ -133,7 +227,7 @@ const AddModal = props => {
<Form form={form} {...layout} onFinish={onFinish}> <Form form={form} {...layout} onFinish={onFinish}>
<Item <Item
label="GIS服务器地址" label="GIS服务器地址"
name="servicename" name="serviceadress"
rules={[{ required: true, message: '请选择服务名' }]} rules={[{ required: true, message: '请选择服务名' }]}
> >
<Input placeholder="请输入gis服务器地址" allowClear /> <Input placeholder="请输入gis服务器地址" allowClear />
...@@ -148,12 +242,13 @@ const AddModal = props => { ...@@ -148,12 +242,13 @@ const AddModal = props => {
<Item <Item
label="GIS服务器名" label="GIS服务器名"
name="serviceName" name="servicename"
rules={[{ required: true, message: '请输入GIS服务器名' }]} rules={[{ required: true, message: '请输入GIS服务器名' }]}
> >
<Select onChange={handleChange}> <AutoComplete
placeholder="Email"
</Select> options={serviceName}
/>
</Item> </Item>
<Item <Item
label="用户名称" label="用户名称"
...@@ -167,18 +262,18 @@ const AddModal = props => { ...@@ -167,18 +262,18 @@ const AddModal = props => {
name="password" name="password"
rules={[{ required: true, message: '请输入用户密码' }]} rules={[{ required: true, message: '请输入用户密码' }]}
> >
<Input placeholder="请输入用户密码" allowClear /> <Input.Password placeholder="请输入用户密码" allowClear />
</Item> </Item>
<Item <Item
label="工作空间名称" label="工作空间名称"
name="password" name="workname"
rules={[{ required: true, message: '请选择工作空间名称' }]} rules={[{ required: true, message: '请选择工作空间名称' }]}
> >
<div className={styles.imgList}> <div className={styles.imgList}>
<Select onChange={handleChange}> <Select onChange={handleWorkspace} value ={workSpace}>
{workList.length ? workList.map((item, index) => { return <Option key={index} value={item.name}>{item.name}</Option> }) : ''}
</Select> </Select>
<Button style={{marginLeft:'0.5rem'}}>选择工作空间</Button> <Button style={{ marginLeft: '0.5rem' }} onClick={() => { selectWorkspace() }}>选择工作空间</Button>
</div> </div>
</Item> </Item>
<Item <Item
......
...@@ -2,16 +2,18 @@ import { Space, Table, Button, Popconfirm, notification } from 'antd'; ...@@ -2,16 +2,18 @@ import { Space, Table, Button, Popconfirm, notification } 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 {
GetVectorService, GetVectorService, deleteVectorService, getSolutionList, updatePublishedMetaData
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import AddModal from './AddModal' import AddModal from './AddModal'
const VectorData = props => { const VectorData = 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 [flag, setFlag] = useState(0); // 更新list
const [loading, setLoading] = useState([]); // 更新状态 const [loading, setLoading] = useState([]); // 更新状态
const [type, setType] = useState('add'); // 弹窗类型 const [type, setType] = useState('add'); // 弹窗类型
const [formObj, setFormObj] = useState({}); const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const columns = [ const columns = [
{ {
title: '服务名', title: '服务名',
...@@ -70,25 +72,76 @@ const VectorData = props => { ...@@ -70,25 +72,76 @@ const VectorData = props => {
}, },
]; ];
//更新
const enterLoading = (record, index) => { const enterLoading = (record, index) => {
console.log(loading)
const newLoadings = [...loading]; const newLoadings = [...loading];
newLoadings[index] = true newLoadings[index] = true
setLoading(newLoadings) setLoading(newLoadings)
setTimeout(() => { let query = {
console.log(12) serviceName: record.serviceName,
_version: 9999,
solution: solutionNames
}
updatePublishedMetaData(query).then(res => {
const newLoadings = [...loading];
newLoadings[index] = false
setLoading(newLoadings)
if (res.success) {
setFlag(flag + 1)
notification.success({
message: '提示',
duration: 3,
description: '更新元数据成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: '更新元数据失败',
});
};
}).catch(err => {
const newLoadings = [...loading]; const newLoadings = [...loading];
newLoadings[index] = false newLoadings[index] = false
setLoading(newLoadings) setLoading(newLoadings)
}, 1000); })
} }
const onSubmit = prop => {
const solutionName = () => {
getSolutionList({
_version: 9999
}).then(res => {
setSolutionNames(res.currentSolution)
})
}
const onSubmit = prop => {
setVisible(false); setVisible(false);
}; };
const delConfirm = (record) => { const delConfirm = (record) => {
console.log('record', record) let query = {
serviceName: record.serviceName,
_version: 9999,
solution: solutionNames
}
deleteVectorService(query).then(res => {
if (res.success) {
setFlag(flag + 1)
notification.success({
message: '提示',
duration: 3,
description: '删除元数据成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: '删除元数据失败',
});
};
})
} }
const handleAdd = () => { const handleAdd = () => {
setType('add'); setType('add');
...@@ -96,15 +149,16 @@ const VectorData = props => { ...@@ -96,15 +149,16 @@ const VectorData = props => {
} }
useEffect(() => { useEffect(() => {
renderTile(); renderTile();
}, []); }, [flag]);
// 获取瓦片数据配置数据 // 获取瓦片数据配置数据
const renderTile = () => { const renderTile = () => {
setTreeLoading(true); setTreeLoading(true);
solutionName();
GetVectorService().then( GetVectorService().then(
res => { res => {
if (res && res.length > 0) { if (res && res.length > 0) {
let arr = [] let arr = []
res.map(item=>{ res.map(item => {
arr.push(false) arr.push(false)
}) })
setLoading(arr) setLoading(arr)
...@@ -146,6 +200,7 @@ const VectorData = props => { ...@@ -146,6 +200,7 @@ const VectorData = props => {
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
type={type} type={type}
formObj={formObj} formObj={formObj}
solutionNames={solutionNames}
/> />
</> </>
) )
......
...@@ -64,7 +64,7 @@ const VectorData = props => { ...@@ -64,7 +64,7 @@ const VectorData = props => {
} }
return ( return (
<> <>
<Row> <div style={{ width: 'calc(100vw - 265px)' }}>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
handleAdd(); handleAdd();
...@@ -72,56 +72,56 @@ const VectorData = props => { ...@@ -72,56 +72,56 @@ const VectorData = props => {
新增 新增
</Button> </Button>
</div> </div>
</Row> <Row >
<Row gutter={16}> {tileData && tileData.length ?
{tileData && tileData.length ? tileData.map((item, index) => {
tileData.map((item, index) => { return <Col key={index} span={5}> <Card title={<div><span className={styles.schemeName}>方案名</span>{item.schemename}</div>} extra={<a href="#">
return <Col key={index} span={8}> <Card title={<div><span className={styles.schemeName}>方案名</span>{item.schemename}</div>} extra={<a href="#"> <Popconfirm
<Popconfirm title="是否删除该方案?"
title="是否删除该方案?" okText="确认"
okText="确认" cancelText="取消"
cancelText="取消" onConfirm={() => {
onConfirm={() => { deleteTile(record);
deleteTile(record); }}
}} >
> <CloseOutlined />
<CloseOutlined /> </Popconfirm> </a>} style={{ width: 300 }}>
</Popconfirm> </a>} style={{ width: 300 }}> <p><span className={styles.schemeName}>矢量</span> {item.servicename}</p>
<p><span className={styles.schemeName}>矢量</span> {item.servicename}</p> <div className={styles.schemeItem}><span className={styles.schemeName}>瓦片</span>
<div className={styles.schemeItem}><span className={styles.schemeName}>瓦片</span> <Button className={styles.schemeBtn} onClick={() => addTile(item, index)}> <PlusOutlined />添加瓦片</Button>
<Button className={styles.schemeBtn} onClick={() => addTile(item, index)}> <PlusOutlined />添加瓦片</Button>
</div>
{item.baseMap && item.baseMap.length ? item.baseMap.map((baseMapItem, baseindex) => {
return <div key={baseindex} className={styles.mapItem} >
<div className={classnames({
[styles.defaultTile]: true,
[styles.activeTile]: baseindex == item.defaultBaseMap,
})}>默认</div>
<div className={styles.mapText}>{baseMapItem}</div>
<div className={styles.mapIcon}>
<Popconfirm
title="是否删除该底图?"
okText="确认"
cancelText="取消"
onConfirm={() => {
deleteTile(record);
}}
>
<CloseOutlined />
</Popconfirm> </div>
</div> </div>
}) : ''} {item.baseMap && item.baseMap.length ? item.baseMap.map((baseMapItem, baseindex) => {
</Card> return <div key={baseindex} className={styles.mapItem} >
</Col> <div className={classnames({
}) : ''} [styles.defaultTile]: true,
</Row > [styles.activeTile]: baseindex == item.defaultBaseMap,
<AddModal })}>默认</div>
visible={visible} <div className={styles.mapText}>{baseMapItem}</div>
onCancel={() => setVisible(false)} <div className={styles.mapIcon}>
callBackSubmit={onSubmit} <Popconfirm
type={type} title="是否删除该底图?"
formObj={formObj} okText="确认"
/> cancelText="取消"
onConfirm={() => {
deleteTile(record);
}}
>
<CloseOutlined />
</Popconfirm> </div>
</div>
}) : ''}
</Card>
</Col>
}) : ''}
</Row >
<AddModal
visible={visible}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
formObj={formObj}
/>
</div>
</> </>
) )
} }
......
...@@ -4,7 +4,7 @@ import SiteModal from '@/components/Modal/SiteModa'; ...@@ -4,7 +4,7 @@ import SiteModal from '@/components/Modal/SiteModa';
import classnames from 'classnames' import classnames from 'classnames'
import styles from './UserModal.less'; import styles from './UserModal.less';
import lodash, { clone } from 'lodash'; import lodash, { clone } from 'lodash';
import { Card, Empty, Pagination, Checkbox, notification, Input,Row,Col } from 'antd' import { Card, Empty, Pagination, Checkbox, notification, Input, Row, Col } from 'antd'
import { import {
getWebModuleTree, getWebModuleTree,
chooseUserToStation, chooseUserToStation,
...@@ -96,7 +96,7 @@ const UserModal = props => { ...@@ -96,7 +96,7 @@ const UserModal = props => {
}).then( }).then(
res => { res => {
let list = [] let list = []
if (res.data&&res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.map((item, index) => { res.data.map((item, index) => {
list.push({ list.push({
...@@ -354,16 +354,17 @@ const Panels2 = React.memo(props => { ...@@ -354,16 +354,17 @@ const Panels2 = React.memo(props => {
{/* <UpOutlined className={styles.siteIcon} /> */} {/* <UpOutlined className={styles.siteIcon} /> */}
<UserOutlined className={styles.siteIcon} /> <UserOutlined className={styles.siteIcon} />
<p style={{ color }}>{GroupName}</p> <p style={{ color }}>{GroupName}</p>
</div>
<div className={styles.sitePanelCon}>
<Checkbox <Checkbox
key="0" key="0"
className={styles.siteList} className={styles.siteListTitle}
checked={isChecked} checked={isChecked}
onClick={e => props.handleChangeAll(e, index)} onClick={e => props.handleChangeAll(e, index)}
> >
全选 全选
</Checkbox> </Checkbox>
</div>
<div className={styles.sitePanelCon}>
{Users.length > 0 && {Users.length > 0 &&
Users.map((v, vIndex) => ( Users.map((v, vIndex) => (
<CheckBoxRow <CheckBoxRow
......
...@@ -52,14 +52,21 @@ ...@@ -52,14 +52,21 @@
} }
.siteList { .siteList {
width: 120px;
// margin:0 0 15px 0;
padding: 0 0 15px 10px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.siteListTitle {
width: 199px; width: 199px;
// margin:0 0 15px 0; // margin:0 0 15px 0;
padding: 0 0 15px 0; padding: 0 0 0 15px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.sitePanel { .sitePanel {
margin: 0 0 10px 0; margin: 0 0 10px 0;
} }
......
...@@ -86,7 +86,7 @@ const SiteManageV2 = () => { ...@@ -86,7 +86,7 @@ const SiteManageV2 = () => {
checkBoxLoading: false, checkBoxLoading: false,
}); });
const [total, setTotal] = useState(0); // 分页总数 const [total, setTotal] = useState(0); // 分页总数
const [page, setPage] = useState({ pageNum: 1, pageSize: 5 }); const [page, setPage] = useState({ pageNum: 1, pageSize: 10 });
const [selectList, setSelectList] = useState([]); // 选择列表数据 const [selectList, setSelectList] = useState([]); // 选择列表数据
const [updatePageUser, setUpdatePageUser] = useState(1);// const [updatePageUser, setUpdatePageUser] = useState(1);//
const [updateCheck, setUpdateCheck] = useState(1); const [updateCheck, setUpdateCheck] = useState(1);
...@@ -253,7 +253,7 @@ const SiteManageV2 = () => { ...@@ -253,7 +253,7 @@ const SiteManageV2 = () => {
} else { } else {
setCurrentStation(props[0]); setCurrentStation(props[0]);
} }
setPage({ pageNum: 1, pageSize: 5 }); setPage({ pageNum: 1, pageSize: 10 });
} }
// 弹出模态框 // 弹出模态框
...@@ -598,7 +598,7 @@ const SiteManageV2 = () => { ...@@ -598,7 +598,7 @@ const SiteManageV2 = () => {
) : ( ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)} )}
<Spin spinning={visibleParams.loading}> <Spin spinning={visibleParams.loading} >
{dataList.map((item, index) => ( {dataList.map((item, index) => (
<Panels <Panels
{...item} {...item}
...@@ -617,9 +617,9 @@ const SiteManageV2 = () => { ...@@ -617,9 +617,9 @@ const SiteManageV2 = () => {
size="small" size="small"
total={total} total={total}
current={page.pageNum} current={page.pageNum}
defaultPageSize="5" defaultPageSize="10"
onChange={handleChangePage} onChange={handleChangePage}
pageSizeOptions={['5']} pageSizeOptions={['10']}
/> />
</div>) : '' </div>) : ''
} }
......
...@@ -87,6 +87,13 @@ ...@@ -87,6 +87,13 @@
} }
.siteManageContainer { .siteManageContainer {
.ant-card-body{
padding: 15px;
}
.ant-spin-container{
overflow-y: scroll;
height: calc(100vh - 410px);
}
.ant-tree-treenode { .ant-tree-treenode {
width: 100% !important; width: 100% !important;
...@@ -243,7 +250,7 @@ ...@@ -243,7 +250,7 @@
min-height: calc(100vh - 210px); min-height: calc(100vh - 210px);
max-height: calc(100vh - 210px); max-height: calc(100vh - 210px);
min-width: 600px; min-width: 600px;
overflow-y: scroll;
} }
...@@ -317,9 +324,9 @@ ...@@ -317,9 +324,9 @@
.siteSelectList { .siteSelectList {
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
height: 200px; height: 120px;
overflow: auto; overflow: auto;
margin-bottom: 50px; margin-bottom:20px;
.siteSelectUl { .siteSelectUl {
margin: 0; margin: 0;
...@@ -329,25 +336,24 @@ ...@@ -329,25 +336,24 @@
flex-wrap: wrap; flex-wrap: wrap;
li { li {
width: 200px;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: rgba(24, 144, 255, 0.16) url('../../../assets/images/icons/close.png') no-repeat 175px; background: rgba(24, 144, 255, 0.16) url('../../../assets/images/icons/close.png') no-repeat 170px;
background-size: 20px; background-size: 20px;
background-position:center right;
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
padding: 0 20px 0 10px; padding: 0 40px 0 10px;
} }
} }
} }
.siteline { .siteline {
border-top: 1px solid #eee;
padding-top: 15px;
margin-top: 20px;
} }
.siteBtn { .siteBtn {
......
...@@ -163,8 +163,36 @@ export const GetAllConfig = query => ...@@ -163,8 +163,36 @@ export const GetAllConfig = query =>
//设置底图数据 //设置底图数据
export const SetServiceConfig = query => export const SetServiceConfig = query =>
get(`${CITY_SERVICE}/OMS.svc/SetServiceConfig`, {query}); get(`${CITY_SERVICE}/OMS.svc/SetServiceConfig`, query);
//获取方矢量数据列表
export const GetVectorService = () => export const GetVectorService = () =>
get(`${CITY_SERVICE}/OMS.svc/D_GetVectorService`, { _version: 9999 }); get(`${CITY_SERVICE}/OMS.svc/D_GetVectorService`, { _version: 9999 });
//删除底图配置
export const DeleteConfig = query =>
get(`${CITY_SERVICE}/OMS.svc/DeleteConfig`, query);
//获取元数据的工作空间列表
export const GetGISServerMapList = query =>
get(`${CITY_SERVICE}/OMS.svc/D_GetGISServerMapList`, query);
//发布原数据
export const publisService = (query,timeout) =>
get(`${CITY_SERVICE}/OMS.svc/D_Publish_GS_Service`, query,timeout);
//解决方案名称
export const getSolutionList = (query) =>
get(`${CITY_SERVICE}/OMS.svc/W4_GetSolutionList`, query );
//删除元数据
export const deleteVectorService = (query) =>
get(`${CITY_SERVICE}/OMS.svc/D_DeleteVectorService`, query );
//更新元数据
export const updatePublishedMetaData = (query) =>
get(`${CITY_SERVICE}/OMS.svc/D_UpdatePublishedMetaData`, query );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment