Commit f7161fb7 authored by 田翔's avatar 田翔

fix: 地图坐标增加地址同步功能

parent 2d7ecfd9
{
"name": "panda-xform",
"version": "2.9.2",
"description": "2.9.2: 去掉多行文本中的获取地址配置",
"version": "2.9.3",
"description": "2.9.3: 地图坐标增加地址同步功能",
"keywords": [
"panda-xform"
],
......
......@@ -2102,7 +2102,7 @@ const mapWidgets = [
title: '地图坐标',
type: 'string',
widget: 'Coordinate',
placeholder: '请选择坐标位置',
placeholder: '请选择地图坐标',
},
setting: {
widget: {
......@@ -2143,6 +2143,12 @@ const mapWidgets = [
widget: 'BooleanSwitch',
description: '自动获取当前地址(手持端专用)'
},
addressSync: {
title: '地址同步',
type: 'string',
widget: 'AddressSync',
description: '位置信息将会同步到下方字段中'
},
required: {
title: '必填',
type: 'boolean',
......
import React, { useState } from 'react'
import { Select, message } from 'antd'
import { ReloadTableFields } from '../../../../../apis/process'
const AddressSync = (props) => {
const { value, onChange, schema, addons } = props
const { tableNameParent } = addons.formData
const [options, setOptions] = useState([])
const onFocus = async () => {
if (!tableNameParent) {
return message.info('请选择表名!')
}
const { code, data, msg } = await ReloadTableFields({ tableName: tableNameParent })
if (code === 0) {
let result = data.root.map(v => { return { label: v.name, value: v.name } })
setOptions(result)
} else {
message.error(msg)
}
}
const selectChange = (value) => {
onChange(value)
}
return (
<Select
style={{ width: '100%' }}
options={options}
value={value}
onFocus={onFocus}
onChange={selectChange}
>
</Select>
)
}
export default AddressSync
\ No newline at end of file
......@@ -8,6 +8,7 @@ import SourceType from './SourceType'
import TableName from './TableName'
import FieldName from './FieldName'
import CalculateRule from './CalculateRule'
import AddressSync from './AddressSync'
const groupSource = {
Dictionary,
......@@ -20,6 +21,7 @@ const groupSource = {
TableName,
FieldName,
CalculateRule,
AddressSync,
}
export default groupSource
\ No newline at end of file
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