Commit 79f350de authored by 涂伟's avatar 涂伟

fix: '1.运维GIS平台管网配置方案管理新增快捷搜索2.运维角色机构配置站点消失bug修复'

parent b0078cfa
......@@ -127,7 +127,9 @@ const FlowChart = props => {
message.success('删除成功');
} else {
// message.error(res.msg);
message.error({ content: <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div> });
message.error({
content: <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div>,
});
}
});
console.log(delNodes, delLinks, 'fffff');
......
......@@ -47,6 +47,7 @@
.tileBtn {
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
padding: 0 0 2rem;
}
......
import { Space, Table, Button, Popconfirm, notification, Spin } from 'antd';
import { Space, Table, Button, Popconfirm, notification, Spin, Input } from 'antd';
import React, { useState, useEffect } from 'react';
import styles from '../SchemeConfig.less';
import {
......@@ -22,6 +22,8 @@ const VectorData = props => {
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const [currentMetaData, setCurrentMetaData] = useState(null);
const [searchValue, setSearchValue] = useState('');
const { Search } = Input;
const columns = [
{
title: '服务名',
......@@ -183,13 +185,13 @@ const VectorData = props => {
setVisible(true);
};
useEffect(() => {
renderTile();
renderTile({ info: searchValue });
}, [flag]);
// 获取瓦片数据配置数据
const renderTile = () => {
const renderTile = (params = { info: '' }) => {
setTreeLoading(true);
solutionName();
GetVectorService().then(res => {
GetVectorService(params).then(res => {
if (res.msg === 'Ok') {
let arr = [];
res.data.VectorList.map(item => {
......@@ -207,12 +209,30 @@ const VectorData = props => {
}
});
};
// 搜索
const handleSearch = text => {
setFlag(flag + 1);
};
// 搜索框改变时存储输入的值
const handleChange = e => {
setSearchValue(e.target.value);
};
return (
<>
<div className={styles.pipeNetwork}>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.tileBtn}>
<span style={{ marginLeft: '20px', marginRight: '5px' }}>快速检索</span>
<Search
allowClear
placeholder="请输入服务名或工程名"
onSearch={handleSearch}
onChange={handleChange}
value={searchValue}
enterButton
style={{ width: '300px', marginRight: '20px' }}
/>
<Button
type="primary"
onClick={() => {
......
......@@ -6,7 +6,7 @@
* @LastEditors: dengchao 754083046@qq.com
*/
/* eslint-disable indent */
import { Button, Spin, Empty } from 'antd';
import { Button, Spin, Empty, Input } from 'antd';
import React, { useState, useEffect } from 'react';
import { OrderedListOutlined } from '@ant-design/icons';
import styles from '../SchemeConfig.less';
......@@ -26,6 +26,8 @@ const VectorData = props => {
const [formObj, setFormObj] = useState({});
const [keepData, setKeepData] = useState([]);
const [sortVisible, setSortVisible] = useState(false);
const [searchValue, setSearchValue] = useState('');
const { Search } = Input;
const onSubmit = prop => {
setVisible(false);
......@@ -40,15 +42,16 @@ const VectorData = props => {
setVisible(true);
};
useEffect(() => {
renderTile();
renderTile({ filter: searchValue });
}, [flag]);
// 获取瓦片数据配置数据
const renderTile = () => {
const renderTile = (params = { filter: '' }) => {
setTreeLoading(true);
GetMaplayerByTerminalType({
terminalType: 'scheme',
isBaseMap: false,
...params,
}).then(resdata => {
if (resdata.code == '0') {
setTreeLoading(false);
......@@ -97,10 +100,28 @@ const VectorData = props => {
const handleSort = () => {
setSortVisible(true);
};
// 搜索
const handleSearch = text => {
setFlag(flag + 1);
};
// 搜索框改变时存储输入的值
const handleChange = e => {
setSearchValue(e.target.value);
};
return (
<>
<div className={styles.tileBtn}>
<span style={{ marginLeft: '20px', marginRight: '5px' }}>快速检索</span>
<Search
allowClear
placeholder="请输入方案名或管网"
onSearch={handleSearch}
onChange={handleChange}
value={searchValue}
enterButton
style={{ width: '300px', marginRight: '20px' }}
/>
<Button
icon={<OrderedListOutlined className={styles.icon} />}
onClick={() => {
......
......@@ -174,7 +174,7 @@ const RelateRoleModal = props => {
))}
</div>
</TabPane>
<TabPane tab="站点" key="2">
<TabPane tab="站点" key="2" forceRender={true}>
<div style={{ height: '500px', overflowY: 'scroll' }}>
{visible &&
stationlist.map((station, index) => (
......@@ -223,7 +223,7 @@ const RelateRoleModal = props => {
))}
</div>
</TabPane>
<TabPane tab="站点" key="2">
<TabPane tab="站点" key="2" forceRender={true}>
<div style={{ height: '500px', overflowY: 'scroll' }}>
{visible &&
stationlist.map((station, index) => (
......
......@@ -168,8 +168,8 @@ export const SetBaseMapschemeName = param =>
export const SetServiceConfig = query => post(`${PANDA_GIS}/Maplayer/SetServiceConfig`, query);
// 获取方矢量数据列表
export const GetVectorService = () =>
get(`${PUBLISH_SERVICE}/Maplayer/GetVectorService`, { _version: 9999 });
export const GetVectorService = query =>
get(`${PUBLISH_SERVICE}/Maplayer/GetVectorService`, { ...query, _version: 9999 });
// 获取元数据的工作空间列表
export const GetGISServerMapList = 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