Commit e53e80b1 by zhaochengxiang

修改模型bug

parent daaf9476
......@@ -21,7 +21,7 @@ const ImportAction = (props) => {
useEffect(() =>{
if ((action||'')==='' || (action==='add'&&(hints||[]).length===0&&(ddl||'').length===0&&(modelerId||'')===''&&roughModelerData==={})) return;
if ((action||'')==='') return;
//初始化form状态
if (action==='add'||action==='edit') {
......@@ -53,6 +53,8 @@ const ImportAction = (props) => {
} else if (roughModelerData !== {}) {
setLoading(false);
getExtraData(roughModelerData);
} else {
setLoading(false);
}
} else if(action === 'edit' || action === 'detail') {
getCurrentDataModel();
......
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Input, Form, Typography, Divider, Button, Select, Row, Col, Popover, Checkbox, Tooltip } from 'antd';
import { Input, Form, Typography, Divider, Button, Select, Row, Col, Popover, Checkbox, Tooltip, Table } from 'antd';
import { QuestionCircleOutlined, DeleteOutlined, CloseOutlined, CheckOutlined } from '@ant-design/icons';
import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper';
import ProTable from "@ant-design/pro-table";
import Helper from './Help';
import { showMessage, highlightSearchContentByTerms } from '../../../../util';
......@@ -669,7 +668,7 @@ const ImportActionIndex = (props) => {
<div id="containerId">
<DndProvider backend={HTML5Backend} >
<Form form={form} component={false} onValuesChange={onValuesChange}>
<ProTable
<Table
components={{
body: {
cell: EditableCell,
......@@ -691,13 +690,6 @@ const ImportActionIndex = (props) => {
rowKey='name'
rowClassName="editable-row"
pagination={false}
search={false}
options={{
density: false,
setting: false,
reload: false,
}}
columnEmptyText={false}
sticky
/>
</Form>
......
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Input, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col, Popover, Checkbox, Tooltip } from 'antd';
import { Input, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col, Popover, Checkbox, Tooltip, Table } from 'antd';
import { QuestionCircleOutlined, CloseOutlined, CheckOutlined } from '@ant-design/icons';
import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper';
import ProTable from "@ant-design/pro-table";
import { generateUUID, highlightSearchContentByTerms, showMessage } from '../../../../util';
import { dispatchLatest } from '../../../../model';
......@@ -278,7 +277,10 @@ const ImportActionTable = (props) => {
form.setFieldsValue({
name: '',
cnName: '',
datatype: {},
datatype: null,
nullable: null,
partOfPrimaryKey: null,
partOfDistributionKey: null,
remark: '',
defaultValue: '',
definition: '',
......@@ -855,7 +857,7 @@ const ImportActionTable = (props) => {
<div id="containerId">
<DndProvider backend={HTML5Backend} >
<Form form={form} component={false} onValuesChange={onValuesChange}>
<ProTable
<Table
components={{
body: {
cell: EditableCell,
......@@ -883,14 +885,7 @@ const ImportActionTable = (props) => {
size='small'
rowKey='iid'
pagination={false}
search={false}
scroll={{ x: 1500 }}
options={{
density: false,
setting: false,
reload: false,
}}
columnEmptyText={false}
sticky
expandable={{
columnWidth: 0,
......
......@@ -5,7 +5,7 @@
}
}
.yy-pro-table {
.yy-table {
.yy-card-body {
padding: 0 !important;
}
......
......@@ -78,7 +78,7 @@ const ImportStockWordModal = (props) => {
const getLogs = (p = 1, s = 20) => {
setLoading(true);
dispatch({
type: 'datamodeler.importWordLogs',
type: 'datamodel.importWordLogs',
payload: {
params: {
page: p,
......@@ -133,6 +133,7 @@ const ImportStockWordModal = (props) => {
},
callback: data => {
setConfirmLoading(false);
setFileList([]);
getLogs(pageNum, pageSize);
onSuccess && onSuccess();
},
......
......@@ -175,6 +175,16 @@ class Model extends React.Component {
this.setState({ filterTableData: _filterData });
}
onImportUnconditionBtnClick = () => {
const { catalogId } = this.state;
if (!catalogId || catalogId==='') {
showMessage('info', '请先选择目录');
return;
}
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${catalogId}`);
}
onImportExcelBtnClick = () => {
const { catalogId } = this.state;
if (!catalogId || catalogId==='') {
......@@ -399,7 +409,9 @@ class Model extends React.Component {
onCreateModelMenuClick = (e) => {
const { key } = e;
if (key === 'excel') {
if (key === 'uncondition') {
this.onImportUnconditionBtnClick();
} else if (key === 'excel') {
this.onImportExcelBtnClick();
} else if (key === 'excel-copy') {
this.onImportExcelCopyBtnClick();
......@@ -452,6 +464,9 @@ class Model extends React.Component {
const createModelMenu = (
<Menu onClick={this.onCreateModelMenuClick}>
<Menu.Item key='uncondition'>
新增
</Menu.Item>
<Menu.Item key='excel'>
Excel导入
</Menu.Item>
......
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