Commit 188ff0f1 authored by 涂伟's avatar 涂伟

fix: '表单设计按钮优化'

parent cb260aac
Pipeline #68626 passed with stages
/* eslint-disable no-shadow */
/* eslint-disable react/jsx-boolean-value */
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import {
Form,
Modal,
......@@ -74,6 +74,8 @@ const AddModal = props => {
const [perviewPrase, setPerViewPrase] = useState(false);
const [tablesSchema, setTablesSchema] = useState(null); // 存储parseForm组件需要的数据格式
const formRef = useRef(null);
const getField = () => {
loadUnattachedTables().then(res => {
if (res.data.root && res.data.root.length) {
......@@ -480,9 +482,30 @@ const AddModal = props => {
</TreeSelect>
</div> */}
<div className={styles.btn}>
<Button type="primary" icon={<PlusSquareOutlined />} onClick={add}>
附加
{/* <Button
type="primary"
icon={<PlusSquareOutlined />}
onClick={() => formRef.current.clear()}
>
清除
</Button> */}
<Button
type="primary"
// icon={<PlusSquareOutlined />}
onClick={() => formRef.current.submit()}
>
提交
</Button>
<Button
type="primary"
// icon={<PlusSquareOutlined />}
onClick={() => formRef.current.preview()}
>
预览
</Button>
{/* <Button type="primary" icon={<PlusSquareOutlined />} onClick={add}>
附加
</Button> */}
<Button
type="primary"
icon={<RollbackOutlined />}
......@@ -495,7 +518,7 @@ const AddModal = props => {
</div>
</div>
<div style={{ width: '100%', height: 'calc(100% - 63px)', padding: '10px' }}>
{formObj && <FormDesigner tableName={formObj} />}
{formObj && <FormDesigner ref={formRef} tableName={formObj} />}
</div>
</div>
</Spin>
......
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