Commit 44a31086 by zhaochengxiang

模型调整

parent 7cb07f96
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Table, Input, Form, Typography, Divider, Button, Select, Row, Col, Popover, Checkbox, Tooltip } from 'antd';
import { QuestionCircleOutlined, DeleteOutlined } from '@ant-design/icons';
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';
......@@ -423,6 +423,11 @@ const ImportActionIndex = (props) => {
dataIndex: 'name',
editable: true,
ellipsis: true,
render: (text, record, index) => {
return (
<span style={{ fontWeight: 'bold' }} >{text}</span>
)
}
},
{
title: '是否唯一索引',
......@@ -431,9 +436,13 @@ const ImportActionIndex = (props) => {
editable: true,
render: (unique, _, __) => {
if (unique === false) {
return '否';
return (
<CloseOutlined />
);
} else if (unique === true) {
return '是';
return (
<CheckOutlined />
)
}
return '';
......@@ -671,6 +680,7 @@ const ImportActionIndex = (props) => {
rowKey='name'
rowClassName="editable-row"
pagination={false}
sticky
/>
</Form>
</DndProvider>
......
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Table, Input, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col, Popover, Checkbox } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
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';
......@@ -58,7 +58,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
<>
<Row align='middle'>
<Col span={9}>
<span>类型名称:</span>
<span>名称:</span>
</Col>
<Col span={15}>
<Select
......@@ -430,6 +430,11 @@ const ImportActionTable = (props) => {
dataIndex: 'name',
editable: true,
ellipsis: true,
render: (text, record, index) => {
return (
<span style={{ fontWeight: 'bold' }} >{text}</span>
)
}
},
{
title: '类型',
......@@ -439,15 +444,26 @@ const ImportActionTable = (props) => {
ellipsis: true,
render: (datatype, record, index) => {
let _text = '';
if (datatype) {
_text = datatype.name||'';
(datatype.parameterCnNames||[]).forEach((cnName, index) => {
_text += ' ' + cnName + ':' + (datatype.parameterValues[index]?datatype.parameterValues[index]:0);
return (
<>
<span>{`名称: ${datatype.name||''}`}</span>
{
(datatype.parameterCnNames||[]).map((cnName, index) => {
return (
<div key={index}>
<span>{`${cnName}: `}</span>
<span style={{ fontWeight: 'bold' }} >{`${(datatype.parameterValues[index]?datatype.parameterValues[index]:0)}`}</span>
</div>
)
})
}
</>
)
}
return _text;
return '';
}
},
{
......@@ -457,9 +473,13 @@ const ImportActionTable = (props) => {
editable: true,
render: (nullable, record, index) => {
if (!nullable) {
return '否';
return (
<CloseOutlined />
);
} else if (nullable === true) {
return '是';
return (
<CheckOutlined />
)
}
return '';
......@@ -472,9 +492,13 @@ const ImportActionTable = (props) => {
editable: true,
render: (partOfPrimaryKey, record, index) => {
if (!partOfPrimaryKey) {
return '否';
return (
<CloseOutlined />
);
} else if (partOfPrimaryKey === true) {
return '是';
return (
<CheckOutlined />
)
}
return '';
......@@ -487,9 +511,13 @@ const ImportActionTable = (props) => {
editable: true,
render: (partOfDistributionKey, record, index) => {
if (!partOfDistributionKey) {
return '否';
return (
<CloseOutlined />
);
} else if (partOfDistributionKey === true) {
return '是';
return (
<CheckOutlined />
)
}
return '';
......@@ -703,6 +731,7 @@ const ImportActionTable = (props) => {
rowKey='iid'
rowClassName="editable-row"
pagination={false}
sticky
expandable={{
columnWidth: 0,
expandedRowRender: record => (
......
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