Commit 54f867eb authored by 田翔's avatar 田翔

fix: 区域任务列表实现照片预览

parent 333803de
{
"name": "panda-xform",
"version": "6.7.5",
"description": "6.7.5 列表显示数值配置问题",
"version": "6.7.6",
"description": "6.7.6 区域任务列表实现照片预览",
"keywords": [
"panda-xform"
],
......
......@@ -14,7 +14,7 @@ import {
SimpleFillSymbol,
} from '@wisdom-map/arcgismap'
import Drag from '../../../components/Drag'
import { isJson, isObject, getNanoid, mercatorToLngLat } from '../../../../utils'
import { isJson, isObject, getNanoid, mercatorToLngLat, getFieldInfo } from '../../../../utils'
import {
FetchAreaList,
GetAreaLayerTaskData,
......@@ -22,6 +22,7 @@ import {
GetAccountPageList,
GetCaseGISAreaData,
} from '../../../../apis/process'
import FileView from '../../../Account/components/TablePack/components/FileView'
const getRings = (rings) => {
rings = rings.map(ring => {
......@@ -110,15 +111,31 @@ const AreaTask = (props) => {
const columns = useMemo(() => {
let array = []
let widgetInfo = {}
if (formJson) {
widgetInfo = getFieldInfo(JSON.parse(formJson))
}
fieldList?.forEach(v => {
array.push({
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
})
let schema = widgetInfo[v.fieldName]
if (v.fieldType === '台账' && schema?.widget === 'FileUpload') {
array.push({
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
render: (value) => {
return <FileView value={value} {...schema} />
}
})
} else {
array.push({
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
})
}
})
return array
}, [isGIS, fieldList])
}, [isGIS, fieldList, formJson])
const onSelect = (value, areaList) => {
setSelectedKeys(value)
......@@ -219,8 +236,10 @@ const AreaTask = (props) => {
}
const showMap = () => {
getData(value)
setVisible(true)
if (addons) {
getData(value)
setVisible(true)
}
}
const onCancel = () => {
......@@ -338,7 +357,7 @@ const AreaTask = (props) => {
}
}
const getDataSource = async (presetValue) => {
const getDataSource = async () => {
let params = {
user: userID,
mapServerName: service,
......@@ -365,7 +384,7 @@ const AreaTask = (props) => {
addons.setValueByPath(addons.dataPath, presetValue)
if (presetValue) {
getConfig()
getDataSource(presetValue)
getDataSource()
}
} else {
onChange(presetValue)
......
......@@ -115,6 +115,7 @@ const TextInput = (props) => {
setShowValue(valueNext)
if (isStoreID && valueNext) {
if (textDefalut === '【本人姓名】') {
console.log('props', props, valueNext)
getUserInfo(valueNext)
} else if (textDefalut === '【本人部门】') {
getDeptInfo(valueNext)
......
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