Commit 2799b217 by zhaochengxiang

bug fix

parent 7cdb5e99
import React, { useState, useEffect, useMemo, useRef } from 'react'; import React, { useState, useEffect, useMemo, useRef } from 'react';
import { Form, Input, Row, Col, Descriptions, Select, AutoComplete, Button, Divider, Tooltip, Checkbox, Space } from 'antd'; import { Form, Input, Row, Col, Select, AutoComplete, Button, Divider, Tooltip, Checkbox, Space } from 'antd';
import { DownOutlined, UpOutlined, ExclamationCircleFilled, WarningFilled } from '@ant-design/icons'; import { DownOutlined, UpOutlined, ExclamationCircleFilled, WarningFilled } from '@ant-design/icons';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import classnames from 'classnames';
import { highlightSearchContentByTerms, generateUUID, IsArr } from '../../../../util'; import { highlightSearchContentByTerms, generateUUID, IsArr } from '../../../../util';
import { dispatch, dispatchLatest } from '../../../../model'; import { dispatch, dispatchLatest } from '../../../../model';
import Rule from '../../ModelConfig/Component/rule-readonly'; import Rule from '../../ModelConfig/Component/rule-readonly';
import DebounceInput from './DebounceInput'; import DebounceInput from './DebounceInput';
import DataQuality, { DataQualityFeignTagList } from '../../../QianKun/data-quality'
import './ImportActionHeader.less'; import './ImportActionHeader.less';
...@@ -151,8 +152,8 @@ const ImportActionHeader = (props) => { ...@@ -151,8 +152,8 @@ const ImportActionHeader = (props) => {
}, [editable, modelerData]) }, [editable, modelerData])
const marginBottom = useMemo(() => { const marginBottom = useMemo(() => {
return 15 return editable ? 15 : 10
}, []) }, [editable])
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
...@@ -262,15 +263,11 @@ const ImportActionHeader = (props) => { ...@@ -262,15 +263,11 @@ const ImportActionHeader = (props) => {
} }
return ( return (
<div className='model-import-action-header'> <div className={classnames('model-import-action-header', editable?'':'model-import-action-header-readolny')}>
<div className='model-import-action-basic mb-3'> <div className='model-import-action-basic mb-3'>
<h3 className='mr-3' style={{ marginBottom: 0 }}>基本信息</h3> <h3 className='mr-3' style={{ marginBottom: 0 }}>基本信息</h3>
</div> </div>
{ <Form form={form} {...formItemLayout}
editable ? (
<Form
form={form}
{...formItemLayout}
onValuesChange={onValuesChange} onValuesChange={onValuesChange}
> >
<Row gutter={10}> <Row gutter={10}>
...@@ -281,7 +278,11 @@ const ImportActionHeader = (props) => { ...@@ -281,7 +278,11 @@ const ImportActionHeader = (props) => {
rules={[{ required: true, message: '请输入中文名称!' }]} rules={[{ required: true, message: '请输入中文名称!' }]}
style={{ marginBottom }} style={{ marginBottom }}
> >
<InputDebounce /> {
editable ? <InputDebounce /> : <span>
{highlightSearchContentByTerms(modelerData?.cnName, terms)}
</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -291,10 +292,9 @@ const ImportActionHeader = (props) => { ...@@ -291,10 +292,9 @@ const ImportActionHeader = (props) => {
rules={[{ required: true, message: '请输入英文名称!' }]} rules={[{ required: true, message: '请输入英文名称!' }]}
style={{ marginBottom }} style={{ marginBottom }}
> >
<AutoComplete {
options={options} editable ? <AutoComplete options={options} onSearch={onSearch} /> : <span>{highlightSearchContentByTerms(modelerData?.name, terms)}</span>
onSearch={onSearch} }
/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -304,7 +304,9 @@ const ImportActionHeader = (props) => { ...@@ -304,7 +304,9 @@ const ImportActionHeader = (props) => {
rules={[{ required: true, message: '请输入数据内容!' }]} rules={[{ required: true, message: '请输入数据内容!' }]}
style={{ marginBottom }} style={{ marginBottom }}
> >
<TextArea rows={1} placeholder='描述数据表包含的业务数据,包括数据内容业务描述、表的适用范围、数据粒度、数据统计口径、数据来源等。对于原始数据表,可以说明加载的源接口信息。' /> {
editable ? <TextArea rows={1} placeholder='描述数据表包含的业务数据,包括数据内容业务描述、表的适用范围、数据粒度、数据统计口径、数据来源等。对于原始数据表,可以说明加载的源接口信息。' /> : <span>{highlightSearchContentByTerms(modelerData?.remark, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -313,7 +315,9 @@ const ImportActionHeader = (props) => { ...@@ -313,7 +315,9 @@ const ImportActionHeader = (props) => {
name="easyDataModelerPrimaryKey" name="easyDataModelerPrimaryKey"
style={{ marginBottom }} style={{ marginBottom }}
> >
<AttributesSelect modelerData={modelerData} mode='tags' /> {
editable ? <AttributesSelect modelerData={modelerData} mode='tags' /> : <span>{highlightSearchContentByTerms(primaryDescription, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -322,7 +326,9 @@ const ImportActionHeader = (props) => { ...@@ -322,7 +326,9 @@ const ImportActionHeader = (props) => {
name="dataResidence" name="dataResidence"
style={{ marginBottom }} style={{ marginBottom }}
> >
<Input placeholder='描述数据表落地的数据平台及数据库' /> {
editable ? <Input placeholder='描述数据表落地的数据平台及数据库' /> : <span>{highlightSearchContentByTerms(modelerData?.dataResidence, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -332,13 +338,20 @@ const ImportActionHeader = (props) => { ...@@ -332,13 +338,20 @@ const ImportActionHeader = (props) => {
rules={[{ required: true, message: '请选择规范!' }]} rules={[{ required: true, message: '请选择规范!' }]}
style={{ marginBottom }} style={{ marginBottom }}
> >
<ConstraintSelect {
editable ? <ConstraintSelect
constraints={constraints} constraints={constraints}
onChange={onConstraintChange} onChange={onConstraintChange}
onDetail={() => { onDetail={() => {
setRuleParams({ visible: true }) setRuleParams({ visible: true })
}} }}
/> /> : <Space>
{modelerData?.easyDataModelerModelingConstraint?.cnName}
<a onClick={() => {
setRuleParams({ visible: true })
}}>查看</a>
</Space>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -348,34 +361,33 @@ const ImportActionHeader = (props) => { ...@@ -348,34 +361,33 @@ const ImportActionHeader = (props) => {
rules={[{ required: true, message: '请选择数据表类型!' }]} rules={[{ required: true, message: '请选择数据表类型!' }]}
style={{ marginBottom }} style={{ marginBottom }}
> >
<TemplateSelect {
editable ? <TemplateSelect
modelerData={modelerData} modelerData={modelerData}
templates={templates} templates={templates}
onChange={onTemplateChange} onChange={onTemplateChange}
/> : <span>{modelerData?.tableType}</span>
}
</Form.Item>
</Col>
{
modelerData?.id && modelerData?.state?.id === '4' && <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item
label="标签"
style={{ marginBottom }}
>
<DataQuality
type={DataQualityFeignTagList}
data={{
type: 'model',
id: modelerData?.id,
}}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
}
</Row> </Row>
</Form> </Form>
) : (
<Descriptions column={3}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}><ItemTitle name='cnName' cnName='中文名称' validateReports={validateReports} /></div>} >{highlightSearchContentByTerms(modelerData.cnName||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}><ItemTitle name='name' cnName='英文名称' validateReports={validateReports} /></div>}>{highlightSearchContentByTerms(modelerData.name||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}><ItemTitle name='remark' cnName='数据内容' validateReports={validateReports} /></div>}>{highlightSearchContentByTerms(modelerData.remark||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>技术主键</div>} >{highlightSearchContentByTerms(primaryDescription||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据平台</div>} >{highlightSearchContentByTerms(modelerData.dataResidence||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }} >规范</div>} >
<Space>
{modelerData.easyDataModelerModelingConstraint?(modelerData.easyDataModelerModelingConstraint.cnName||''):''}
<a onClick={() => {
setRuleParams({ visible: true })
}}>查看</a>
</Space>
</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据表类型</div>} >{modelerData.tableType}</Descriptions.Item>
</Descriptions>
)
}
<div className='model-import-action-technical mb-3' style={{ <div className='model-import-action-technical mb-3' style={{
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
...@@ -391,10 +403,7 @@ const ImportActionHeader = (props) => { ...@@ -391,10 +403,7 @@ const ImportActionHeader = (props) => {
} }
</div> </div>
{ {
!isCollapse && <React.Fragment> !isCollapse && <Form
{
editable ? (
<Form
form={form} form={form}
{...formItemLayout} {...formItemLayout}
onValuesChange={onValuesChange} onValuesChange={onValuesChange}
...@@ -406,7 +415,9 @@ const ImportActionHeader = (props) => { ...@@ -406,7 +415,9 @@ const ImportActionHeader = (props) => {
name="easyDataModelerDistributionKey" name="easyDataModelerDistributionKey"
style={{ marginBottom }} style={{ marginBottom }}
> >
<AttributesSelect modelerData={modelerData} /> {
editable ? <AttributesSelect modelerData={modelerData} /> : <span>{highlightSearchContentByTerms(distributionDescription, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -415,7 +426,9 @@ const ImportActionHeader = (props) => { ...@@ -415,7 +426,9 @@ const ImportActionHeader = (props) => {
name="partition" name="partition"
style={{ marginBottom }} style={{ marginBottom }}
> >
<PartitionSelect modelerData={modelerData} partitionTypes={supportedPartitionTypes} /> {
editable ? <PartitionSelect modelerData={modelerData} partitionTypes={supportedPartitionTypes} /> : <span>{highlightSearchContentByTerms(partitionsDescription, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -424,7 +437,9 @@ const ImportActionHeader = (props) => { ...@@ -424,7 +437,9 @@ const ImportActionHeader = (props) => {
name="easyDataModelerSemiPrimaryKey" name="easyDataModelerSemiPrimaryKey"
style={{ marginBottom }} style={{ marginBottom }}
> >
<AttributesSelect modelerData={modelerData} mode='tags' /> {
editable ? <AttributesSelect modelerData={modelerData} mode='tags' /> : <span>{highlightSearchContentByTerms(semiPrimaryDescription, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -433,7 +448,9 @@ const ImportActionHeader = (props) => { ...@@ -433,7 +448,9 @@ const ImportActionHeader = (props) => {
name="dataCircumstances" name="dataCircumstances"
style={{ marginBottom }} style={{ marginBottom }}
> >
<Input placeholder='描述数据表中数据的更新频率、每日增量情况、数据量级和历史数据' /> {
editable ? <Input placeholder='描述数据表中数据的更新频率、每日增量情况、数据量级和历史数据' /> : <span>{highlightSearchContentByTerms(modelerData?.dataCircumstances, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -442,7 +459,9 @@ const ImportActionHeader = (props) => { ...@@ -442,7 +459,9 @@ const ImportActionHeader = (props) => {
name="dataUpdatingTiming" name="dataUpdatingTiming"
style={{ marginBottom }} style={{ marginBottom }}
> >
<UpdateSelect placeholder='描述数据表的更新时间点'/> {
editable ? <UpdateSelect placeholder='描述数据表的更新时间点'/> : <div>{highlightSearchContentByTerms(modelerData?.dataUpdatingTiming, terms)}</div>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -452,13 +471,15 @@ const ImportActionHeader = (props) => { ...@@ -452,13 +471,15 @@ const ImportActionHeader = (props) => {
tooltip={dataTypeRemark} tooltip={dataTypeRemark}
style={{ marginBottom }} style={{ marginBottom }}
> >
<Select allowClear placeholder='请选择数据类型'> {
editable ? <Select allowClear placeholder='请选择数据类型'>
{ {
dataTypeList?.map((item, index) => <Option key={index} value={item}> dataTypeList?.map((item, index) => <Option key={index} value={item}>
{item} {item}
</Option>) </Option>)
} }
</Select> </Select> : <span>{highlightSearchContentByTerms(modelerData?.dataType, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
...@@ -468,30 +489,19 @@ const ImportActionHeader = (props) => { ...@@ -468,30 +489,19 @@ const ImportActionHeader = (props) => {
tooltip={bindingLoadRemark} tooltip={bindingLoadRemark}
style={{ marginBottom }} style={{ marginBottom }}
> >
<Select allowClear placeholder='请选择绑定加载范围'> {
editable ? <Select allowClear placeholder='请选择绑定加载范围'>
{ {
bindingLoadRangeList?.map((item, index) => <Option key={index} value={item}> bindingLoadRangeList?.map((item, index) => <Option key={index} value={item}>
{item} {item}
</Option>) </Option>)
} }
</Select> </Select> : <span>{highlightSearchContentByTerms(modelerData?.bindingLoadRang, terms)}</span>
}
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
</Form> </Form>
) : (
<Descriptions column={3}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分布键</div>} >{highlightSearchContentByTerms(distributionDescription||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>分区键</div>} >{highlightSearchContentByTerms(partitionsDescription||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>类主键</div>} >{highlightSearchContentByTerms(semiPrimaryDescription||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据情况</div>} >{highlightSearchContentByTerms(modelerData.dataCircumstances||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>更新时间</div>} >{highlightSearchContentByTerms(modelerData.dataUpdatingTiming||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据类型</div>} >{highlightSearchContentByTerms(modelerData.dataType||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>绑定加载范围</div>} >{highlightSearchContentByTerms(modelerData.bindingLoadRange||'', terms)}</Descriptions.Item>
</Descriptions>
)
}
</React.Fragment>
} }
<Rule <Rule
{...ruleParams} {...ruleParams}
......
.model-import-action-header { .model-import-action-header-readolny {
.yy-descriptions-row > th, .yy-descriptions-row > td { .yy-form-item-label > label {
padding-bottom: 15px; height: auto;
}
.yy-form-item-control-input {
min-height: 0;
} }
} }
\ No newline at end of file
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