Commit e53e80b1 by zhaochengxiang

修改模型bug

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