Commit 991d2820 authored by 田翔's avatar 田翔

fix: 区域任务增加前端显示字段配置

parent a62e41f1
{
"name": "panda-xform",
"version": "6.0.49",
"description": "6.0.49 区域任务控件完善",
"version": "6.7.1",
"description": "6.7.1 区域任务增加前端显示字段配置",
"keywords": [
"panda-xform"
],
......
......@@ -2439,13 +2439,6 @@ const mapWidgets = [
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
// screenShot: {
// title: '是否显示缩略图',
// type: 'boolean',
// widget: 'BooleanSwitch',
// default: false,
// description: '只读情况下会显示缩略图'
// },
areaTaskShine: {
title: '映射字段',
name: '映射字段',
......@@ -2453,6 +2446,20 @@ const mapWidgets = [
widget: 'AreaTaskShine',
default: [],
},
fieldList: {
title: '前端显示字段',
name: '前端显示字段',
type: 'array',
default: [],
widget: 'TaskFieldList',
},
taskSummary: {
title: '任务摘要',
name: '任务摘要',
type: 'array',
default: [],
widget: 'TaskFieldList',
},
required: {
title: '必填',
type: 'boolean',
......
......@@ -483,7 +483,7 @@ const AreaTask = (props) => {
{
layerCount.map(v => {
return (
<div>
<div key={v.layerName}>
<span>{v.layerName}:</span>
<span style={{ marginLeft: '5px' }}>{v.layerCount}</span>
</div>
......
import React, { useMemo, useState } from 'react'
import { Input, Checkbox, Row, Col, message } from 'antd'
import Drag from '../../../../components/Drag'
import {
LoadLedgers,
ReloadTableFields,
QueryFields,
getMaplayerByTerminalType,
GetLayerList,
GetLayerFields,
GetLayersShareField
} from '../../../../../apis/process'
const TaskFieldList = (props) => {
const { value, addons, onChange } = props
const { service, layerName, accountName, tableName } = addons.formData || {}
const [visible, setVisible] = useState(false)
const [GISField, setGISField] = useState([])
const [AccountField, setAccountField] = useState([])
const [GISCheck, setGISCheck] = useState([])
const [AccCheck, setAccCheck] = useState([])
const getGISField = async () => {
const { code, data } = await GetLayersShareField({ mapServer: service, layerNames: layerName })
if (code === '0') {
setGISField(data || [])
}
}
const getAccountField = async () => {
const { code, data } = await ReloadTableFields({ tableName: tableName })
if (code === 0) {
setAccountField(data?.root)
}
}
const inputClick = () => {
if (!service || !layerName || !tableName) {
return message.error('请配置字段映射中的配置')
}
setGISCheck(value?.filter(v => v.fieldType === 'GIS').map(v => v.fieldName) || [])
setAccCheck(value?.filter(v => v.fieldType === '台账').map(v => v.fieldName) || [])
getGISField()
getAccountField()
setVisible(true)
}
const GISChange = (value) => {
setGISCheck(value)
}
const AccChange = (value) => {
setAccCheck(value)
}
const onOk = () => {
let array = []
GISCheck?.forEach(v => {
let fieldAliasName = GISField.find(s => s.fieldName === v)?.fieldAliasName || v
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: 'GIS', })
})
AccCheck?.forEach(v => {
let fieldAliasName = AccountField.find(s => s.name === v)?.alias || v
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: '台账', })
})
onChange(array)
setVisible(false)
}
return (
<div>
<Input value={value ? JSON.stringify(value) : ''} onClick={inputClick} />
<Drag
title='前端显示字段'
onOk={onOk}
onCancel={() => setVisible(false)}
visible={visible}
>
<div>
<Checkbox.Group style={{ width: '100%' }} value={GISCheck} onChange={GISChange}>
<div>GIS字段</div>
<Row>
{
GISField.map(v => {
return (
<Col span={8} key={v.fieldName}>
<Checkbox value={v.fieldName}>{v.fieldAliasName}</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
<Checkbox.Group style={{ width: '100%' }} value={AccCheck} onChange={AccChange}>
<div style={{ marginTop: '10px' }}>台账字段</div>
<Row>
{
AccountField.map(v => {
return (
<Col span={8} key={v.name}>
<Checkbox value={v.name}>{v.alias}</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
</div>
</Drag>
</div>
)
}
export default TaskFieldList
\ No newline at end of file
......@@ -8,6 +8,7 @@ import ControlRules from './ControlRules'
import SourceType from './SourceType'
import TableName from './TableName'
import FieldList from './FieldList'
import TaskFieldList from './TaskFieldList'
import FieldName from './FieldName'
import CalculateRule from './CalculateRule'
import AddressSync from './AddressSync'
......@@ -30,6 +31,7 @@ const groupSource = {
SourceType,
TableName,
FieldList,
TaskFieldList,
FieldName,
CalculateRule,
AddressSync,
......
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