Commit 87d7da63 authored by 田翔's avatar 田翔

fix: 区域任务优化

parent 49e0265b
No related merge requests found
{
"name": "panda-xform",
"version": "6.7.2",
"description": "6.7.2 区域任务优化",
"version": "6.7.3",
"description": "6.7.3 区域任务优化",
"keywords": [
"panda-xform"
],
......
......@@ -2452,6 +2452,7 @@ const mapWidgets = [
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于区域控件列表显示',
},
taskSummary: {
title: '任务摘要',
......@@ -2459,6 +2460,7 @@ const mapWidgets = [
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于任务对象显示',
},
required: {
title: '必填',
......
......@@ -37,7 +37,6 @@ const getRings = (rings) => {
const AreaTask = (props) => {
console.log('props', props)
const codes = window?.pandaXform?.codes || { 工单编号: '', 事件编号: '', }
const userID = window?.globalConfig?.userInfo?.OID || 1;
const { token, client } = window.globalConfig
......
......@@ -13,7 +13,7 @@ import {
const TaskFieldList = (props) => {
const { value, addons, onChange } = props
const { title, value, addons, onChange, schema } = props
const { service, layerName, accountName, tableName } = addons.formData || {}
const [visible, setVisible] = useState(false)
......@@ -43,7 +43,9 @@ const TaskFieldList = (props) => {
setGISCheck(value?.filter(v => v.fieldType === 'gis').map(v => v.fieldName) || [])
setAccCheck(value?.filter(v => v.fieldType === '台账').map(v => v.fieldName) || [])
getGISField()
getAccountField()
if (schema.$id === 'fieldList') {
getAccountField()
}
setVisible(true)
}
......@@ -57,14 +59,18 @@ const TaskFieldList = (props) => {
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: '台账', })
})
if (GISField.length) {
GISCheck?.forEach(v => {
let fieldAliasName = GISField.find(s => s.fieldName === v)?.fieldAliasName || v
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: 'gis', })
})
}
if (AccountField.length) {
AccCheck?.forEach(v => {
let fieldAliasName = AccountField.find(s => s.name === v)?.alias || v
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: '台账', })
})
}
onChange(array)
setVisible(false)
}
......@@ -73,13 +79,13 @@ const TaskFieldList = (props) => {
<div>
<Input value={value?.map(v => v.fieldName)?.join(',')} onClick={inputClick} />
<Drag
title='前端显示字段'
title={title || '前端显示字段'}
onOk={onOk}
onCancel={() => setVisible(false)}
visible={visible}
>
<div>
<Checkbox.Group style={{ width: '100%' }} value={GISCheck} onChange={GISChange}>
<Checkbox.Group style={{ width: '100%', display: GISField.length ? 'block' : 'none' }} value={GISCheck} onChange={GISChange}>
<div>GIS字段</div>
<Row>
{
......@@ -93,7 +99,7 @@ const TaskFieldList = (props) => {
}
</Row>
</Checkbox.Group>
<Checkbox.Group style={{ width: '100%' }} value={AccCheck} onChange={AccChange}>
<Checkbox.Group style={{ width: '100%', display: AccountField.length ? 'block' : 'none' }} value={AccCheck} onChange={AccChange}>
<div style={{ marginTop: '10px' }}>台账字段</div>
<Row>
{
......
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