Commit e45a7f6d authored by shaoan123's avatar shaoan123

优化gis配置模块

parent 73d07fda
Pipeline #27003 skipped with stages
.container{ .container{
width: 100%; width: 100%;
height: calc(100vh - 100px) ;
background-color: #ffffff; background-color: #ffffff;
display: flex; display: flex;
padding: 0.8rem; padding: 0.8rem;
.ant-table-thead tr th { .ant-table-thead tr th {
font-weight: 600; font-weight: 600;
...@@ -102,6 +103,9 @@ ...@@ -102,6 +103,9 @@
} }
.cardItem{ .cardItem{
width: 18rem; width: 18rem;
height: 18rem; height: 26rem;
margin: 0 2rem; margin: 0 2rem;
} }
.solutionConfig{
}
\ No newline at end of file
import { Space, Table, Button, Popconfirm, notification } from 'antd'; import { Space, Table, Button, Popconfirm, notification,Spin } from 'antd';
import React, { useState, useEffect, Modal } from 'react'; import React, { useState, useEffect } from 'react';
import styles from '../SchemeConfig.less' import styles from '../SchemeConfig.less'
import { import {
GetAllConfig, GetAllConfig,
...@@ -163,6 +163,7 @@ const TileData = props => { ...@@ -163,6 +163,7 @@ const TileData = props => {
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
handleAdd(); handleAdd();
...@@ -191,6 +192,7 @@ const TileData = props => { ...@@ -191,6 +192,7 @@ const TileData = props => {
formObj={formObj} formObj={formObj}
baseMap = {baseMap} baseMap = {baseMap}
/> />
</Spin>
</> </>
) )
} }
......
import { Space, Table, Button, Popconfirm, notification } 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 {
...@@ -194,6 +194,7 @@ const VectorData = props => { ...@@ -194,6 +194,7 @@ const VectorData = props => {
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
handleAdd(); handleAdd();
...@@ -227,6 +228,7 @@ const VectorData = props => { ...@@ -227,6 +228,7 @@ const VectorData = props => {
onCancel={() => setPreviewVisible(false)} onCancel={() => setPreviewVisible(false)}
metaData={currentMetaData} metaData={currentMetaData}
/> />
</Spin>
</> </>
) )
} }
......
...@@ -145,7 +145,7 @@ const CardData = props => { ...@@ -145,7 +145,7 @@ const CardData = props => {
<div className={styles.schemeItem}><span className={styles.schemeName}>瓦片</span> <div className={styles.schemeItem}><span className={styles.schemeName}>瓦片</span>
<Button className={styles.schemeBtn} onClick={() => addTile(props.item)}> <PlusOutlined />添加瓦片</Button> <Button className={styles.schemeBtn} onClick={() => addTile(props.item)}> <PlusOutlined />添加瓦片</Button>
</div> </div>
<div style={{ overflowY: 'scroll', height: '5.5rem' }}> <div style={{ overflowY: 'scroll', maxHeight: '11.4rem' }}>
{props.item.baseMap && props.item.baseMap.length ? props.item.baseMap.map((baseMapItem, baseindex) => { {props.item.baseMap && props.item.baseMap.length ? props.item.baseMap.map((baseMapItem, baseindex) => {
return <div className={styles.mapItem} key={baseindex} > return <div className={styles.mapItem} key={baseindex} >
<div className={classnames({ <div className={classnames({
......
import { Button } from 'antd'; 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 {
...@@ -48,6 +48,7 @@ const VectorData = props => { ...@@ -48,6 +48,7 @@ const VectorData = props => {
}; };
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}>
<div style={{ width: 'calc(100vw - 265px)' }}> <div style={{ width: 'calc(100vw - 265px)' }}>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
...@@ -72,6 +73,7 @@ const VectorData = props => { ...@@ -72,6 +73,7 @@ const VectorData = props => {
formObj={formObj} formObj={formObj}
/> />
</div> </div>
</Spin>
</> </>
) )
} }
......
...@@ -15,7 +15,6 @@ import AddModal from './AddModal' ...@@ -15,7 +15,6 @@ 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 [initValues, setInitValues] = 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列表下标
...@@ -25,11 +24,8 @@ const VectorData = props => { ...@@ -25,11 +24,8 @@ const VectorData = props => {
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 [webIndex, setWebIndex] = useState(0); // web默认选中状态
const [handIndex, setHandIndex] = useState(0); // 手持默认选中状态
const [type, setType] = useState(''); // 弹窗类型 const [type, setType] = useState(''); // 弹窗类型
const [checkLoading, setCheckLoading] = useState(false) const [checkLoading, setCheckLoading] = useState(false)
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' }); const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const columns = [ const columns = [
{ {
...@@ -39,9 +35,9 @@ const VectorData = props => { ...@@ -39,9 +35,9 @@ const VectorData = props => {
render: (text, record, index) => ( render: (text, record, index) => (
<Space> <Space>
<Checkbox <Checkbox
checked={webStatus[index + webCurrent * 3]} checked={webStatus[index + webCurrent * 5]}
onChange={e => { onChange={e => {
onChangeCheck(e, record, index + webCurrent * 3); onChangeCheck(e, record, index + webCurrent * 5);
}} }}
/> />
</Space> </Space>
...@@ -100,9 +96,9 @@ const VectorData = props => { ...@@ -100,9 +96,9 @@ const VectorData = props => {
render: (text, record, index) => ( render: (text, record, index) => (
<Space> <Space>
<Checkbox <Checkbox
checked={handStatus[index + handCurrent * 3]} checked={handStatus[index + handCurrent * 5]}
onChange={e => { onChange={e => {
onChangeHand(e, record, index + handCurrent * 3); onChangeHand(e, record, index + handCurrent * 5);
}} }}
/> />
</Space> </Space>
...@@ -167,7 +163,7 @@ const VectorData = props => { ...@@ -167,7 +163,7 @@ const VectorData = props => {
SetServiceConfig(query).then(res => { SetServiceConfig(query).then(res => {
if (res.IsSuccess) { if (res.IsSuccess) {
prompt('success', '关联角色成功') prompt('success', '关联角色成功')
setFlag(flag + 1)
} }
else { else {
prompt('fail', '关联角色失败') prompt('fail', '关联角色失败')
...@@ -175,7 +171,7 @@ const VectorData = props => { ...@@ -175,7 +171,7 @@ const VectorData = props => {
}).catch(err=>{ }).catch(err=>{
prompt('fail', '网络请求失败') prompt('fail', '网络请求失败')
}) })
setFlag(flag + 1)
} }
...@@ -412,7 +408,7 @@ const VectorData = props => { ...@@ -412,7 +408,7 @@ const VectorData = props => {
}, [flag]); }, [flag]);
// 获取瓦片数据配置数据 // 获取瓦片数据配置数据
const renderTile = () => { const renderTile = () => {
setTreeLoading(true); setCheckLoading(true)
//查询手持方案 //查询手持方案
var schemeConfigQueryRequest = GetAllConfig({ var schemeConfigQueryRequest = GetAllConfig({
terminalType: 'phone', terminalType: 'phone',
...@@ -429,7 +425,6 @@ const VectorData = props => { ...@@ -429,7 +425,6 @@ const VectorData = props => {
res[0].Result.map((item, index) => { res[0].Result.map((item, index) => {
if (item.isDefault) { if (item.isDefault) {
arr.push(true) arr.push(true)
setHandIndex(index)
} else { } else {
arr.push(false) arr.push(false)
} }
...@@ -446,7 +441,6 @@ const VectorData = props => { ...@@ -446,7 +441,6 @@ const VectorData = props => {
res[1].Result.map((item, index) => { res[1].Result.map((item, index) => {
if (item.type === "pipenet") { if (item.type === "pipenet") {
arr.push(true) arr.push(true)
setWebIndex(index)
} else { } else {
arr.push(false) arr.push(false)
} }
...@@ -456,6 +450,9 @@ const VectorData = props => { ...@@ -456,6 +450,9 @@ const VectorData = props => {
setWebData(res[1].Result) setWebData(res[1].Result)
setWebStatus(arr) setWebStatus(arr)
} }
setCheckLoading(false)
}).catch(e=>{
setCheckLoading(false)
}) })
}; };
...@@ -465,7 +462,7 @@ const VectorData = props => { ...@@ -465,7 +462,7 @@ const VectorData = props => {
return ( return (
<> <>
<Spin tip="loading..." spinning={checkLoading}> <Spin tip="loading..." spinning={checkLoading}>
<div> <div className={styles.solutionConfig}>
<div > <div >
<Divider orientation="left"><div className={styles.divider}> Web <PlusOutlined <Divider orientation="left"><div className={styles.divider}> Web <PlusOutlined
onClick={() => { addType('add') }} onClick={() => { addType('add') }}
...@@ -477,7 +474,7 @@ const VectorData = props => { ...@@ -477,7 +474,7 @@ const VectorData = props => {
pagination={{ pagination={{
showTotal: (total, range) => showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`, `第${range[0]}-${range[1]} 条/共 ${total} 条`,
defaultPageSize: 3, defaultPageSize: 5,
onChange: (value) => { onChange: (value) => {
setWebCurrent(value - 1) setWebCurrent(value - 1)
} }
...@@ -500,7 +497,7 @@ const VectorData = props => { ...@@ -500,7 +497,7 @@ const VectorData = props => {
pagination={{ pagination={{
showTotal: (total, range) => showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`, `第${range[0]}-${range[1]} 条/共 ${total} 条`,
defaultPageSize: 3, defaultPageSize: 10,
onChange: (value) => { onChange: (value) => {
setHandCurrent(value - 1) setHandCurrent(value - 1)
} }
......
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