Commit 6743f9b0 authored by 田翔's avatar 田翔

fix: 地图类坐标仅显示问题

parent a353d3f0
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.8.0", "version": "2.8.1",
"description": "2.8.0: 时间组件格式化问题", "description": "2.8.1: 地图类坐标仅显示问题",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -58,28 +58,94 @@ const dateArray = { timeControl: ['时间', '仅时间', '日期', '日期月份 ...@@ -58,28 +58,94 @@ const dateArray = { timeControl: ['时间', '仅时间', '日期', '日期月份
const doNotDisplayInEditModelShape = ['编码'] const doNotDisplayInEditModelShape = ['编码']
const widgetData = { const widgetData = {
'TextInput': { name: '文本', type: '文本控件', }, 'TextInput': {
'TextArea': { name: '多行文本', type: '文本控件', }, name: '文本',
'NumberInput': { name: '数值', type: '文本控件', }, type: '文本控件',
'RichText': { name: '富文本', type: '文本控件', }, },
'Coding': { name: '编码', type: '文本控件' }, 'TextArea': {
'ComboBox': { name: '下拉框', type: '选择器控件' }, name: '多行文本',
'RadioButton': { name: '单选框', type: '选择器控件' }, type: '文本控件',
'CheckBox': { name: '复选框', type: '选择器控件' }, },
'SwitchSelector': { name: '开关', type: '选择器控件' }, 'NumberInput': {
'RelevanceSelect': { name: '关联选择', type: '选择器控件' }, name: '数值',
'CascadeSelector': { name: '联级选择', type: '选择器控件' }, type: '文本控件',
'PersonSelector': { name: '人员选择', type: '业务控件' }, },
'DeptSelector': { name: '部门选择', type: '业务控件' }, 'RichText': {
'AccountSelector': { name: '台账选择', type: '业务控件' }, name: '富文本',
'DateTime': { name: '日期选择', type: '时间控件' }, type: '文本控件',
'Time': { name: '时间选择', type: '时间控件' }, },
'FileUpload': { name: '附件', type: '附件控件' }, 'Coding': {
'Coordinate': { name: '坐标控件', type: 'GIS控件' }, name: '编码',
'Device': { name: '设备选择', type: 'GIS控件' }, type: '文本控件',
'SearchLocation': { name: '位置坐标', type: 'GIS控件' }, },
'RelationForm': { name: '关联表单', type: '高级控件' }, 'ComboBox': {
'AutoCalculate': { name: '自动计算', type: '高级控件' }, name: '下拉框',
type: '选择器控件',
},
'RadioButton': {
name: '单选框',
type: '选择器控件',
},
'CheckBox': {
name: '复选框',
type: '选择器控件',
},
'SwitchSelector': {
name: '开关按钮',
type: '选择器控件',
},
'RelevanceSelect': {
name: '关联选择',
type: '选择器控件'
},
'CascadeSelector': {
name: '联级选择',
type: '选择器控件',
},
'PersonSelector': {
name: '人员选择',
type: '业务控件',
},
'DeptSelector': {
name: '部门选择',
type: '业务控件',
},
'AccountSelector': {
name: '台账选择',
type: '业务控件',
},
'DateTime': {
name: '日期选择',
type: '时间控件',
},
'Time': {
name: '时间选择',
type: '时间控件',
},
'FileUpload': {
name: '附件',
type: '附件控件',
},
'Coordinate': {
name: '地图控件',
type: 'GIS控件',
},
'Device': {
name: '设备选择',
type: 'GIS控件',
},
'SearchLocation': {
name: '地址位置',
type: 'GIS控件',
},
'RelationForm': {
name: '关联表单',
type: '高级控件',
},
'AutoCalculate': {
name: '自动计算',
type: '高级控件',
},
} }
const getStyles = (type) => { const getStyles = (type) => {
......
import React, { useState, useEffect, useContext, useRef } from 'react' import React, { useState, useEffect } from 'react'
import { Input, Modal } from 'antd' import { Input, Button } from 'antd'
import { CompassOutlined } from '@ant-design/icons' import { CompassOutlined } from '@ant-design/icons'
import IconPack from '../../IconPack'
import { import {
ArcGISSceneMap, ArcGISSceneMap,
AutoCompleteSearch, AutoCompleteSearch,
...@@ -9,7 +10,6 @@ import { ...@@ -9,7 +10,6 @@ import {
GraphicsLayer, GraphicsLayer,
Point Point
} from '@wisdom-map/arcgismap' } from '@wisdom-map/arcgismap'
import { GlobalStore } from '../../../FormRender'
import Drag from '../../../components/Drag' import Drag from '../../../components/Drag'
const Coordinate = (props) => { const Coordinate = (props) => {
...@@ -17,13 +17,10 @@ const Coordinate = (props) => { ...@@ -17,13 +17,10 @@ const Coordinate = (props) => {
const { token, client } = window.globalConfig const { token, client } = window.globalConfig
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { disabled, placeholder, presetValue } = schema const { disabled, placeholder, presetValue } = schema
// const [coordinate, setCoordinate] = useState('')
const [layersConifg, setLayersConifg] = useState(() => { const [layersConifg, setLayersConifg] = useState(() => {
const mapConfig = window.globalConfig.mapsettings?.layers || null const mapConfig = window.globalConfig.mapsettings?.layers || null
return { layers: mapConfig }; return { layers: mapConfig };
}); });
// const mapSettings = window.globalConfig?.mapsettings
// const layers = window.globalConfig?.mapsettings?.layers
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [currentPointer, setCurrentPointer] = useState([]) const [currentPointer, setCurrentPointer] = useState([])
...@@ -59,7 +56,7 @@ const Coordinate = (props) => { ...@@ -59,7 +56,7 @@ const Coordinate = (props) => {
setCoordGetLayers(coordGetLayer); setCoordGetLayers(coordGetLayer);
getPoints(viewObject, coordGetLayer); getPoints(viewObject, coordGetLayer);
} }
}; }
const createGraphic = (geometry) => { const createGraphic = (geometry) => {
return new Graphic({ return new Graphic({
...@@ -93,13 +90,11 @@ const Coordinate = (props) => { ...@@ -93,13 +90,11 @@ const Coordinate = (props) => {
} }
const showMap = () => { const showMap = () => {
if (!schema.disabled) { setVisible(true)
setVisible(true);
}
} }
const onCancel = () => { const onCancel = () => {
setCurrentPointerCoordinate(initCoordinate); setCurrentPointerCoordinate(initCoordinate)
setVisible(false); setVisible(false);
} }
...@@ -140,6 +135,8 @@ const Coordinate = (props) => { ...@@ -140,6 +135,8 @@ const Coordinate = (props) => {
return ( return (
<div> <div>
{
!disabled ?
<Input <Input
disabled={disabled} disabled={disabled}
placeholder={placeholder} placeholder={placeholder}
...@@ -148,6 +145,9 @@ const Coordinate = (props) => { ...@@ -148,6 +145,9 @@ const Coordinate = (props) => {
style={{ width: '100%' }} style={{ width: '100%' }}
onClick={showMap} onClick={showMap}
/> />
:
<Button icon={<CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} />} onClick={showMap}>查看位置</Button>
}
<Drag <Drag
width={'80%'} width={'80%'}
title="选取坐标" title="选取坐标"
...@@ -158,6 +158,7 @@ const Coordinate = (props) => { ...@@ -158,6 +158,7 @@ const Coordinate = (props) => {
okText={'确定'} okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }} bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true} destroyOnClose={true}
{...disabled ? { footer: null } : {}}
> >
<div style={{ height: '90%' }}> <div style={{ height: '90%' }}>
<ArcGISSceneMap <ArcGISSceneMap
......
import React, { useState, useRef, useEffect, useContext } from 'react' import React, { useState, useRef, useEffect, useContext } from 'react'
import { Input, Modal } from 'antd' import { Input, Button } from 'antd'
import { CompassOutlined, ExclamationCircleOutlined } from '@ant-design/icons' import { CompassOutlined, ExclamationCircleOutlined } from '@ant-design/icons'
import { import {
ArcGISSceneMap, ArcGISSceneMap,
...@@ -16,188 +16,12 @@ let geometrystr = '' ...@@ -16,188 +16,12 @@ let geometrystr = ''
let gisInfo = {} let gisInfo = {}
let layer = 0 let layer = 0
const initMapConfig = [
{
"basemaps": [
{
"id": "高德地形",
"title": "高德地形",
"thumbnailUrl": "assets/images/thumbnail/thumbnail_1.jpg",
"baseLayers": [
{
"title": "高德地形",
"icon": "assets/images/thumbnail/thumbnail_1.jpg",
"layerType": "amap-v",
"url": "",
"opacity": 1,
"visible": false,
"useProxy": false,
"proxyUrl": "",
"style": null,
"extent": "",
"baseLayer": "",
"levelStart": "",
"levelEnd": "",
"levelEndEnlarge": false,
"resolution": "",
"origin": "",
"tileMatrix": "",
"zoom": 0
}
]
}
],
"id": "wlgcs",
"title": "wlgcs",
"icon": "",
"layerType": "PipenetLayer",
"url": "CityInterface/rest/services/MapServer.svc/wlgcs",
"opacity": 1,
"showLegend": true,
"visible": true,
"useProxy": true,
"proxyUrl": "",
"extent": "12733684.9026203,3560132.6351416963,12734623.874243027,3560857.1781486557",
"baseLayer": "",
"levelStart": null,
"levelEnd": null,
"resolution": "",
"origin": "",
"tileMatrix": "",
"wmtsUrl": "",
"schemename": "物联港",
"roles": "15,27,28,1015,1035,1036,1040,1041,1042,1037,1038,1039,43,57,60,61,62,63,64,65,1003,1004",
"areaName": "江夏区",
"boundColor": "#86C8F8",
"backgroundColor": "#009688",
"boundWidth": "5px",
"backgroundOpacity": "0.6",
"exportScheme": "pandagis"
},
{
"basemaps": [
{
"id": "高德地形",
"title": "高德地形",
"thumbnailUrl": "assets/images/thumbnail/thumbnail_1.jpg",
"baseLayers": [
{
"title": "高德地形",
"icon": "assets/images/thumbnail/thumbnail_1.jpg",
"layerType": "amap-v",
"url": "",
"opacity": 1,
"visible": false,
"useProxy": false,
"proxyUrl": "",
"style": null,
"extent": "",
"baseLayer": "",
"levelStart": "",
"levelEnd": "",
"levelEndEnlarge": false,
"resolution": "",
"origin": "",
"tileMatrix": "",
"zoom": 0
}
]
}
],
"id": "luanzhou",
"title": "luanzhou",
"icon": "",
"layerType": "dynamic",
"url": "CityInterface/rest/services/MapServer.svc/luanzhou",
"opacity": 1,
"showLegend": true,
"visible": true,
"useProxy": true,
"proxyUrl": "",
"extent": "13209667.350188782,4825282.3802740965,13220086.323771724,4831701.695887157",
"baseLayer": "",
"levelStart": null,
"levelEnd": null,
"resolution": "",
"origin": "",
"tileMatrix": "",
"wmtsUrl": "",
"schemename": "前端绘制管网测试方案",
"roles": null,
"areaName": "滦州市",
"boundColor": "#7de825",
"backgroundColor": "#000000",
"boundWidth": "10px",
"backgroundOpacity": "0.6",
"exportScheme": "arcgis"
},
{
"basemaps": [
{
"id": "高德地形",
"title": "高德地形",
"thumbnailUrl": "assets/images/thumbnail/thumbnail_1.jpg",
"baseLayers": [
{
"title": "高德地形",
"icon": "assets/images/thumbnail/thumbnail_1.jpg",
"layerType": "amap-v",
"url": "",
"opacity": 1,
"visible": false,
"useProxy": false,
"proxyUrl": "",
"style": null,
"extent": "",
"baseLayer": "",
"levelStart": "",
"levelEnd": "",
"levelEndEnlarge": false,
"resolution": "",
"origin": "",
"tileMatrix": "",
"zoom": 0
}
]
}
],
"id": "luanzhouZS",
"title": "luanzhouZS",
"icon": "",
"layerType": "dynamic",
"url": "CityInterface/rest/services/MapServer.svc/luanzhouZS",
"opacity": 1,
"showLegend": true,
"visible": true,
"useProxy": true,
"proxyUrl": "",
"extent": "13210364.94854749,4824486.87832399,13222264.608150885,4831691.679813754",
"baseLayer": "",
"levelStart": null,
"levelEnd": null,
"resolution": "",
"origin": "",
"tileMatrix": "",
"wmtsUrl": "",
"schemename": "业务平台",
"roles": null,
"areaName": "滦州市",
"boundColor": "#86C8F8",
"backgroundColor": "#000000",
"boundWidth": "5px",
"backgroundOpacity": "0.6",
"exportScheme": "pandagis"
}
]
const Device = (props) => { const Device = (props) => {
// const mapConfig = window.globalConfig?.mapsettings?.layers || initMapConfig
const { token, client } = window.globalConfig const { token, client } = window.globalConfig
const { addons, value, onChange, schema } = props const { addons, value, onChange, schema } = props
const { placeholder, disabled, parent } = schema const { placeholder, disabled, parent, presetValue } = schema
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
// const layersConifg = { layers: mapConfig }
let clickref = useRef(null) let clickref = useRef(null)
let view = useRef(null) let view = useRef(null)
...@@ -286,8 +110,21 @@ const Device = (props) => { ...@@ -286,8 +110,21 @@ const Device = (props) => {
setVisible(false) setVisible(false)
} }
useEffect(() => {
if (addons) {
if (presetValue) {
geometrystr = presetValue
}
addons.setValueByPath(addons.dataPath, presetValue)
} else {
onChange(presetValue)
}
}, [presetValue])
return ( return (
<div> <div>
{
!disabled ?
<Input <Input
disabled={disabled} disabled={disabled}
value={value} value={value}
...@@ -295,7 +132,9 @@ const Device = (props) => { ...@@ -295,7 +132,9 @@ const Device = (props) => {
onClick={iconClick} onClick={iconClick}
addonAfter={disabled ? null : <CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} onClick={iconClick} />} addonAfter={disabled ? null : <CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} onClick={iconClick} />}
style={{ width: '100%' }} style={{ width: '100%' }}
/> /> :
<Button icon={<CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} />} onClick={iconClick}>查看设备</Button>
}
<Drag <Drag
visible={visible} visible={visible}
title='设备选择' title='设备选择'
...@@ -306,6 +145,7 @@ const Device = (props) => { ...@@ -306,6 +145,7 @@ const Device = (props) => {
okText={'确定'} okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }} bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
getContainer={true} getContainer={true}
{...disabled ? { footer: null } : {}}
> >
<ArcGISSceneMap <ArcGISSceneMap
getMapInfo={getMapInfo} getMapInfo={getMapInfo}
......
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