|
@@ -5,6 +5,7 @@ import ItemAttribute from './ItemAttribute';
|
|
import { uuidv4 } from '@antv/xflow';
|
|
import { uuidv4 } from '@antv/xflow';
|
|
import { Button } from 'antd';
|
|
import { Button } from 'antd';
|
|
import RelModal from './RelModal';
|
|
import RelModal from './RelModal';
|
|
|
|
+import FormulaModal from './FormulaModal';
|
|
|
|
|
|
function AuditForm(props) {
|
|
function AuditForm(props) {
|
|
const { value, onChange } = props;
|
|
const { value, onChange } = props;
|
|
@@ -14,9 +15,12 @@ function AuditForm(props) {
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
|
|
const [relVisible, setRelVisible] = useState(false); //关联选项弹窗
|
|
const [relVisible, setRelVisible] = useState(false); //关联选项弹窗
|
|
|
|
+ const [forVisible, setForVisible] = useState(false); //计算公式弹窗
|
|
const [addToTable, setAddToTable] = useState(false);
|
|
const [addToTable, setAddToTable] = useState(false);
|
|
const [currentTableID, setCurrentTableID] = useState('');
|
|
const [currentTableID, setCurrentTableID] = useState('');
|
|
|
|
|
|
|
|
+ console.log('-----------------', formList);
|
|
|
|
+
|
|
const handleAddItem = (item) => {
|
|
const handleAddItem = (item) => {
|
|
if (addToTable) {
|
|
if (addToTable) {
|
|
// 新增列处理
|
|
// 新增列处理
|
|
@@ -163,9 +167,11 @@ function AuditForm(props) {
|
|
list={formList}
|
|
list={formList}
|
|
></FormContent>
|
|
></FormContent>
|
|
<ItemAttribute
|
|
<ItemAttribute
|
|
|
|
+ formList={formList}
|
|
key={selectList[selectList.length - 1]}
|
|
key={selectList[selectList.length - 1]}
|
|
item={findFormItem()}
|
|
item={findFormItem()}
|
|
onRelClick={() => setRelVisible(true)}
|
|
onRelClick={() => setRelVisible(true)}
|
|
|
|
+ onFormulaClick={() => setForVisible(true)}
|
|
onChange={onChangeAttribute}
|
|
onChange={onChangeAttribute}
|
|
></ItemAttribute>
|
|
></ItemAttribute>
|
|
</div>
|
|
</div>
|
|
@@ -188,6 +194,18 @@ function AuditForm(props) {
|
|
onChangeAttribute(value);
|
|
onChangeAttribute(value);
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
|
|
+ <FormulaModal
|
|
|
|
+ item={formList.find((item) => item.props.id === select)}
|
|
|
|
+ numFiledList={formList.filter(
|
|
|
|
+ (item) => item.componentName == 'NumberField',
|
|
|
|
+ )}
|
|
|
|
+ visible={forVisible}
|
|
|
|
+ onCancel={() => setForVisible(false)}
|
|
|
|
+ onChange={(value) => {
|
|
|
|
+ setForVisible(false);
|
|
|
|
+ onChangeAttribute(value);
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|