Commit 401771cf authored by 田翔's avatar 田翔

fix: 代码优化

parent ad4fee0a
{
"name": "panda-xform",
"version": "6.8.17",
"description": "6.8.17 设备选择增加传入参数",
"version": "6.9.5",
"description": "6.9.5 列表查看设备传参只读",
"keywords": [
"panda-xform"
],
......
......@@ -3,7 +3,7 @@ import styles from './index.less'
import { Button } from 'antd'
import {
ArcGISSceneMap,
ClickQuery,
WorkFlowEquipmentQuery,
geomUtils,
GraphicsLayer,
Graphic,
......@@ -50,11 +50,12 @@ const CoordView = (props) => {
zoom: 15
})
}
clickref.current = new ClickQuery({
clickref.current = new WorkFlowEquipmentQuery({
view: view.current,
offsetX: -150,
offsetY: -310,
continuous: false,
onlyWhatch: true,
...obj,
callback: ({ clickPoint, matchPoint, data }) => {
gisInfo = {}
......@@ -177,6 +178,7 @@ const CoordView = (props) => {
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
destroyOnClose
footer={null}
>
<ArcGISSceneMap
getMapInfo={getMapInfo}
......
......@@ -314,6 +314,7 @@ const Account = (props, ref) => {
}
}
setSubmitLoading(false);
props?.submitOK?.()
};
const search = (values) => {
......
......@@ -3,7 +3,7 @@ import { Input, Button } from 'antd'
import { CompassOutlined, DownOutlined } from '@ant-design/icons'
import {
ArcGISSceneMap,
ClickQuery,
WorkFlowEquipmentQuery,
geomUtils,
GraphicsLayer,
Graphic
......@@ -66,7 +66,11 @@ const Device = (props) => {
zoom: 15
})
}
clickref.current = new ClickQuery({
if (clickref.current) {
clickref.current?.closetip()
clickref.current = null
}
clickref.current = new WorkFlowEquipmentQuery({
layerInfos: layersInfo,
view: view.current,
offsetX: -150,
......@@ -86,7 +90,8 @@ const Device = (props) => {
}
if (matchPoint) {
geometrystr = `${matchPoint.x},${matchPoint.y}`
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code }
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code, ...data.attributes }
console.log('gisInfo', gisInfo)
} else if (clickPoint) {
geometrystr = `${clickPoint.x},${clickPoint.y}`
layer = new GraphicsLayer({
......@@ -144,7 +149,11 @@ const Device = (props) => {
zoom: 15
})
}
clickref.current = new ClickQuery({
if (clickref.current) {
clickref.current?.closetip()
clickref.current = null
}
clickref.current = new WorkFlowEquipmentQuery({
view: view.current,
offsetX: -150,
offsetY: -310,
......@@ -163,7 +172,7 @@ const Device = (props) => {
}
if (matchPoint) {
geometrystr = `${matchPoint.x},${matchPoint.y}`
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code }
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code, ...data.attributes }
} else if (clickPoint) {
geometrystr = `${clickPoint.x},${clickPoint.y}`
layer = new GraphicsLayer({
......@@ -200,12 +209,27 @@ const Device = (props) => {
const onOk = () => {
onChange(geometrystr)
console.log('fieldshine', fieldshine, gisInfo)
let { paths } = addons.getSchemaByPath('#')
if (Array.isArray(paths)) {
paths.forEach(v => {
let values = addons.getValue(v)
if (isObject(values)) {
for (let key in values) {
if (Array.isArray(fieldshine) && fieldshine.length) {
fieldshine.forEach(item => {
if (item.toField === key && gisInfo?.[item.fromField]) {
const schema = addons.getSchemaByPath(`${v}.${key}`);
if (['FileUpload', 'TextInput'].includes(schema.widget)) {
addons.setSchemaByPath(`${v}.${key}`, { ...schema, otherValue: gisInfo?.[item?.fromField] });
} else if (['NumberInput'].includes(schema.widget)) {
addons.setValueByPath(`${v}.${key}`, gisInfo?.[item?.fromField] + '')
} else {
addons.setValueByPath(`${v}.${key}`, gisInfo?.[item?.fromField])
}
}
})
}
if (key === 'GIS编码' && gisInfo.gisCode) {
const schema = addons.getSchemaByPath(`${v}.${key}`);
if (['FileUpload', 'TextInput'].includes(schema.widget)) {
......
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