Commit 789ff5fd by zhaochengxiang

模型ji基本信息展开

parent 006f8d94
import React, { useState, useEffect } from 'react';
import { Form, Input, Row, Col, Descriptions, Select, AutoComplete, Checkbox } from 'antd';
import { Form, Input, Row, Col, Descriptions, Select, AutoComplete, Checkbox, Button } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons';
import { highlightSearchContentByTerms, generateUUID } from '../../../../util';
import { dispatchLatest } from '../../../../model';
......@@ -423,8 +424,8 @@ const ImportActionHeader = (props) => {
}
}
const onOnlyShowRequireChange = (e) => {
setOnlyShowRequireChange(e.target.checked);
const onOnlyShowRequireChange = () => {
setOnlyShowRequireChange(!onlyShowRequireChange);
}
let distributionDescription = '', primaryDescription = '', partitionsDescription = '', semiPrimaryDescription = '';
......@@ -488,7 +489,9 @@ const ImportActionHeader = (props) => {
}}
>
<h2>基本信息</h2>
<Checkbox onChange={onOnlyShowRequireChange} defaultChecked={onlyShowRequireChange} value={onlyShowRequireChange}>仅显示必填项</Checkbox>
{
onlyShowRequireChange ? <Button type='text' style={{ padding: 0, color: '#0069AC' }} onClick={onOnlyShowRequireChange}>展开<DownOutlined /></Button> : <Button type='text' style={{ padding: 0, color: '#0069AC' }} onClick={onOnlyShowRequireChange}>收起<UpOutlined /></Button>
}
</div>
{
editable ? (
......
.model-import-action-header {
.yy-form-item {
.yy-form-item:nth-last-col {
margin-bottom: 24px;
}
......
......@@ -118,6 +118,7 @@ const ModelTable = (props) => {
id: MENU_ID,
});
const [ tableWidth, setTableWidth ] = useState(0);
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const [ subSelectedRowKeys, setSubSelectedRowKeys ] = useState([]);
// const [ mouseEnterKey, setMouseEnterKey ] = useState(null);
......@@ -620,6 +621,9 @@ const ModelTable = (props) => {
<div className={classes}>
<ResizeObserver
onResize={({ width }) => {
if (tableWidth !== width) {
setTableWidth(width);
let newColumns = [...cols];
if ((modelId||'') !== '') {
......@@ -645,6 +649,7 @@ const ModelTable = (props) => {
});
setColumns(newColumns);
}
}}
>
<Table
......
......@@ -41,6 +41,7 @@ const ResizeableHeaderCell = props => {
const SuggestTable = (props) => {
const { suggests, onSelect } = props;
const [ tableWidth, setTableWidth ] = useState(0);
const cols = [
{
......@@ -174,6 +175,8 @@ const SuggestTable = (props) => {
<ResizeObserver
onResize={({ width }) => {
if (tableWidth !== width) {
setTableWidth(width);
let newColumns = [...cols];
newColumns.forEach((column, index) => {
......@@ -191,6 +194,7 @@ const SuggestTable = (props) => {
});
setColumns(newColumns);
}
}}
>
<Table
......
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