Commit b1884113 authored by 田翔's avatar 田翔

fix: 搜索坐标地名原样输出

parent 3ff0cd3a
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.9.18", "version": "6.9.20",
"description": "6.9.18 台账选择器支持存储ID", "description": "6.9.20 搜索坐标地名原样输出",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -169,7 +169,7 @@ const TablePack = (props, ref) => { ...@@ -169,7 +169,7 @@ const TablePack = (props, ref) => {
} }
//关联表单表头 //关联表单表头
const getRelevanceColumnProps = ({ json, field, isEdit, autoArray }) => { const getRelevanceColumnProps = ({ json, field, isEdit, autoArray, accountFieids }) => {
const { fieldName, columnWidth, isSort, accurateSearch, alignment } = field const { fieldName, columnWidth, isSort, accurateSearch, alignment } = field
const { widget } = json?.[fieldName] || {} const { widget } = json?.[fieldName] || {}
let searchProps = {} let searchProps = {}
...@@ -254,7 +254,14 @@ const TablePack = (props, ref) => { ...@@ -254,7 +254,14 @@ const TablePack = (props, ref) => {
}, },
}), }),
render: (value, record) => { render: (value, record) => {
let props = { ...json[fieldName], fieldName, value, autoArray, record: { ...record } } let props = {
...json[fieldName],
fieldName,
value,
autoArray,
disabled: !accountFieids?.some(v => v.fieldName === fieldName && v.isEdit),
record: { ...record },
}
if (isEdit && !notUse?.includes('edit')) { if (isEdit && !notUse?.includes('edit')) {
return ( return (
<ValueEdit <ValueEdit
...@@ -358,13 +365,13 @@ const TablePack = (props, ref) => { ...@@ -358,13 +365,13 @@ const TablePack = (props, ref) => {
showField.forEach((v, i) => { showField.forEach((v, i) => {
if (parent === '关联表单') { if (parent === '关联表单') {
// array.push(getRelevanceColumnProps(json, v, isEdit)) // array.push(getRelevanceColumnProps(json, v, isEdit))
array.push(getRelevanceColumnProps({ json, field: v, isEdit, autoArray })) array.push(getRelevanceColumnProps({ json, field: v, isEdit, autoArray, accountFieids }))
} else { } else {
array.push(getColumnProps(json, v)) array.push(getColumnProps(json, v))
} }
}) })
return array return array
}, [parent, formJson, showField, fieldResize, filteredInfo, sortedInfo, isEdit, dataSource]) }, [parent, formJson, showField, fieldResize, filteredInfo, sortedInfo, isEdit, dataSource, accountFieids])
const showColumns = useMemo(() => { const showColumns = useMemo(() => {
return fileColumns.filter(v => checks.includes(v.dataIndex)) return fileColumns.filter(v => checks.includes(v.dataIndex))
......
...@@ -36,6 +36,7 @@ const Coordinate = (props) => { ...@@ -36,6 +36,7 @@ const Coordinate = (props) => {
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [initCoordinate, setInitCoordinate] = useState([]) const [initCoordinate, setInitCoordinate] = useState([])
const [currentPointerCoordinate, setCurrentPointerCoordinate] = useState([]) const [currentPointerCoordinate, setCurrentPointerCoordinate] = useState([])
const [targetPathText, setTargetPathText] = useState('')
const [text, setText] = useState(presetValue ? '加载中...' : '(空)') const [text, setText] = useState(presetValue ? '加载中...' : '(空)')
const [put, setPut] = useState(true) const [put, setPut] = useState(true)
const [view, setView] = useState(null) const [view, setView] = useState(null)
...@@ -127,6 +128,7 @@ const Coordinate = (props) => { ...@@ -127,6 +128,7 @@ const Coordinate = (props) => {
target: 'erroSendUpWidget',// 随便写 target: 'erroSendUpWidget',// 随便写
toolTip: '左键选择位置', toolTip: '左键选择位置',
drawEnd: geometry => { drawEnd: geometry => {
setTargetPathText('')
setCurrentPointerCoordinate([geometry.x, geometry.y]) setCurrentPointerCoordinate([geometry.x, geometry.y])
coordGetLayer && coordGetLayer.removeAll() coordGetLayer && coordGetLayer.removeAll()
const coordGraphic = createGraphic(geometry) const coordGraphic = createGraphic(geometry)
...@@ -168,6 +170,9 @@ const Coordinate = (props) => { ...@@ -168,6 +170,9 @@ const Coordinate = (props) => {
if (addressSync) { if (addressSync) {
let targetPath = getTargetPath(addressSync) let targetPath = getTargetPath(addressSync)
if (targetPath) { if (targetPath) {
if (targetPathText) {
addons.setValue(targetPath, targetPathText)
} else {
let LngLat = mercatorToLngLat(currentPointerCoordinate[0], currentPointerCoordinate[1]) let LngLat = mercatorToLngLat(currentPointerCoordinate[0], currentPointerCoordinate[1])
let postStr = { let postStr = {
lon: LngLat[0], lon: LngLat[0],
...@@ -183,6 +188,7 @@ const Coordinate = (props) => { ...@@ -183,6 +188,7 @@ const Coordinate = (props) => {
} }
} }
} }
}
if (areaSync && areaSyncField) { if (areaSync && areaSyncField) {
let targetPath = getTargetPath(areaSyncField) let targetPath = getTargetPath(areaSyncField)
if (targetPath) { if (targetPath) {
...@@ -220,6 +226,11 @@ const Coordinate = (props) => { ...@@ -220,6 +226,11 @@ const Coordinate = (props) => {
let array = value.location.split(',') let array = value.location.split(',')
let point = lngmkt({ lng: Number(array[0]), lat: Number(array[1]) }) let point = lngmkt({ lng: Number(array[0]), lat: Number(array[1]) })
onChange(`${point.x},${point.y}`) onChange(`${point.x},${point.y}`)
if (value?.name) {
setTargetPathText(`${value?.name}`)
} else {
setTargetPathText('')
}
} }
} }
......
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