Commit 2cbc5f62 authored by 田翔's avatar 田翔

细节优化

parent 8bd9ec06
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.0.3", "version": "2.0.4",
"description": "2.0.3: 修复编码报错问题", "description": "2.0.4: 细节优化",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
import React, { useEffect, useState, useRef } from 'react' import React, { useState, useRef } from 'react'
import { Modal, Input, Form, message, Dropdown, Menu, Tree } from 'antd' import { Modal, Input, message, Dropdown, Menu, Tree } from 'antd'
import styles from './index.less' import styles from './index.less'
import { getTableNumberList, getFormFieldAnalysisDtos } from '../../../../../apis/process' import { getTableNumberList, getFormFieldAnalysisDtos } from '../../../../../apis/process'
import { isObject } from '../../../../../utils' import { isObject } from '../../../../../utils'
...@@ -17,7 +17,7 @@ const fnList = [ ...@@ -17,7 +17,7 @@ const fnList = [
{ label: '向上取整', value: '$math.floor()' }, { label: '向上取整', value: '$math.floor()' },
] ]
const ControlRules = (props) => { const CalculateRule = (props) => {
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { parent, name } = addons.formData const { parent, name } = addons.formData
...@@ -41,13 +41,17 @@ const ControlRules = (props) => { ...@@ -41,13 +41,17 @@ const ControlRules = (props) => {
} }
} }
setFieldList(array) setFieldList(array)
if (array.length > 0) {
setVisible(true)
} else {
message.error('无可用字段')
}
} else { } else {
message.error(msg) message.error(msg)
} }
} }
const inputClick = () => { const inputClick = () => {
setVisible(true)
getFieldList() getFieldList()
setRule(value || '') setRule(value || '')
if (value) { if (value) {
...@@ -165,4 +169,4 @@ const ControlRules = (props) => { ...@@ -165,4 +169,4 @@ const ControlRules = (props) => {
} }
export default ControlRules export default CalculateRule
import React, { useEffect, useState, useRef } from 'react' import React, { useState, useRef } from 'react'
import { Modal, Input, Form, message, Dropdown, Menu, Tree } from 'antd' import { Modal, Input, message, Dropdown, Menu, Tree } from 'antd'
import styles from './index.less' import styles from './index.less'
import { ReloadTableFields, ruleValidation } from '../../../../../apis/process' import { ReloadTableFields, ruleValidation } from '../../../../../apis/process'
...@@ -109,6 +109,8 @@ const ControlRules = (props) => { ...@@ -109,6 +109,8 @@ const ControlRules = (props) => {
destroyOnClose destroyOnClose
getContainer={false} getContainer={false}
> >
{
parent?.tableName ? (
<div className={styles.configContent}> <div className={styles.configContent}>
<div className={styles.leftTree}> <div className={styles.leftTree}>
<Tree <Tree
...@@ -146,6 +148,8 @@ const ControlRules = (props) => { ...@@ -146,6 +148,8 @@ const ControlRules = (props) => {
</ul> </ul>
</div> </div>
</div> </div>
) : null
}
</Modal> </Modal>
</div> </div>
) )
......
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