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

细节优化

parent 8bd9ec06
{
"name": "panda-xform",
"version": "2.0.3",
"description": "2.0.3: 修复编码报错问题",
"version": "2.0.4",
"description": "2.0.4: 细节优化",
"keywords": [
"panda-xform"
],
......
import React, { useEffect, useState, useRef } from 'react'
import { Modal, Input, Form, message, Dropdown, Menu, Tree } from 'antd'
import React, { useState, useRef } from 'react'
import { Modal, Input, message, Dropdown, Menu, Tree } from 'antd'
import styles from './index.less'
import { getTableNumberList, getFormFieldAnalysisDtos } from '../../../../../apis/process'
import { isObject } from '../../../../../utils'
......@@ -17,7 +17,7 @@ const fnList = [
{ label: '向上取整', value: '$math.floor()' },
]
const ControlRules = (props) => {
const CalculateRule = (props) => {
const { value, onChange, addons } = props
const { parent, name } = addons.formData
......@@ -41,13 +41,17 @@ const ControlRules = (props) => {
}
}
setFieldList(array)
if (array.length > 0) {
setVisible(true)
} else {
message.error('无可用字段')
}
} else {
message.error(msg)
}
}
const inputClick = () => {
setVisible(true)
getFieldList()
setRule(value || '')
if (value) {
......@@ -165,4 +169,4 @@ const ControlRules = (props) => {
}
export default ControlRules
export default CalculateRule
import React, { useEffect, useState, useRef } from 'react'
import { Modal, Input, Form, message, Dropdown, Menu, Tree } from 'antd'
import React, { useState, useRef } from 'react'
import { Modal, Input, message, Dropdown, Menu, Tree } from 'antd'
import styles from './index.less'
import { ReloadTableFields, ruleValidation } from '../../../../../apis/process'
......@@ -109,43 +109,47 @@ const ControlRules = (props) => {
destroyOnClose
getContainer={false}
>
<div className={styles.configContent}>
<div className={styles.leftTree}>
<Tree
blockNode
defaultExpandedKeys={[parent.tableName]}
autoExpandParent={true}
onSelect={onSelect}
selectedKeys={[currentSelectId]}
treeData={fieldList}
/>
</div>
<div className={styles.rightContent}>
<div className={styles.textAreaBox}>
<Dropdown overlay={fnListRender} placement="bottom" arrow>
<div className={styles.insertFn}>插入函数</div>
</Dropdown>
<TextArea
id="ruleText"
autoSize={{ minRows: 19, maxRows: 19 }}
value={rule}
rows={4}
ref={ruleText}
onChange={e => setRule(e.target.value)}
/>
{
parent?.tableName ? (
<div className={styles.configContent}>
<div className={styles.leftTree}>
<Tree
blockNode
defaultExpandedKeys={[parent.tableName]}
autoExpandParent={true}
onSelect={onSelect}
selectedKeys={[currentSelectId]}
treeData={fieldList}
/>
</div>
<div className={styles.rightContent}>
<div className={styles.textAreaBox}>
<Dropdown overlay={fnListRender} placement="bottom" arrow>
<div className={styles.insertFn}>插入函数</div>
</Dropdown>
<TextArea
id="ruleText"
autoSize={{ minRows: 19, maxRows: 19 }}
value={rule}
rows={4}
ref={ruleText}
onChange={e => setRule(e.target.value)}
/>
</div>
<ul className={styles.tipBox}>
<li>
<p>请从左侧面板选择字段或选项</p>
<p>
{'支持'} <i>英文</i> {'模式下运算符(+、-、*、/><==!=<=>='}
</p>
</li>
<li>{`示例:{表名.是否缴费} = ‘是’ and {表名.缴费金额} > 1000`}</li>
</ul>
</div>
</div>
<ul className={styles.tipBox}>
<li>
<p>请从左侧面板选择字段或选项</p>
<p>
{'支持'} <i>英文</i> {'模式下运算符(+、-、*、/><==!=<=>='}
</p>
</li>
<li>{`示例:{表名.是否缴费} = ‘是’ and {表名.缴费金额} > 1000`}</li>
</ul>
</div>
</div>
) : null
}
</Modal>
</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