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

fix: 区域任务优化

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