Commit 39195280 authored by 田翔's avatar 田翔

fix: 设备选择器配置修改

parent 78607ee9
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.9.1", "version": "4.9.2",
"description": "4.9.1 节点不显示的字段不参与隐藏计算", "description": "4.9.2 设备选择器配置修改",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -74,6 +74,12 @@ const DeviceFieldshine = (props) => { ...@@ -74,6 +74,12 @@ const DeviceFieldshine = (props) => {
} }
} }
const fromFieldChange = (value) => {
const { field, service, layerName } = form.getFieldsValue()
let values = field.map(v => ({ ...v, layerName: v.fromField === value ? layerName : v.layerName }))
form.setFieldsValue({ field: values, service, layerName })
}
return ( return (
<div className={styles.fieldshine}> <div className={styles.fieldshine}>
<Input <Input
...@@ -161,6 +167,7 @@ const DeviceFieldshine = (props) => { ...@@ -161,6 +167,7 @@ const DeviceFieldshine = (props) => {
treeDefaultExpandAll treeDefaultExpandAll
showCheckedStrategy showCheckedStrategy
onFocus={fromFieldFocus} onFocus={fromFieldFocus}
onChange={fromFieldChange}
> >
{fromField.map(s => <TreeNode value={s.field} title={s.fieldAlias} key={s.field} />)} {fromField.map(s => <TreeNode value={s.field} title={s.fieldAlias} key={s.field} />)}
</TreeSelect> </TreeSelect>
...@@ -200,6 +207,13 @@ const DeviceFieldshine = (props) => { ...@@ -200,6 +207,13 @@ const DeviceFieldshine = (props) => {
</TreeNode> </TreeNode>
</TreeSelect> </TreeSelect>
</Form.Item> </Form.Item>
<Form.Item
hidden={true}
{...restField}
name={[name, 'layerName']}
>
<Input />
</Form.Item>
{index !== 0 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null} {index !== 0 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null}
</Space> </Space>
))} ))}
......
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