Commit 7c1a2023 by zhaochengxiang

查看规范

parent 2471eca5
...@@ -5,6 +5,7 @@ import { Subject } from 'rxjs'; ...@@ -5,6 +5,7 @@ import { Subject } from 'rxjs';
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 DebounceInput from './DebounceInput'; import DebounceInput from './DebounceInput';
...@@ -55,6 +56,9 @@ const ImportActionHeader = (props) => { ...@@ -55,6 +56,9 @@ const ImportActionHeader = (props) => {
const [ dataTypeList, setDataTypeList ] = useState(null); const [ dataTypeList, setDataTypeList ] = useState(null);
const [ bindingLoadRangeList, setBindingLoadRangeList ] = useState(null); const [ bindingLoadRangeList, setBindingLoadRangeList ] = useState(null);
const [isCollapse, setCollapse] = useState(true) const [isCollapse, setCollapse] = useState(true)
const [ruleParams, setRuleParams] = useState({
visible: false
})
useEffect(() => { useEffect(() => {
getDataTypeList(); getDataTypeList();
...@@ -331,6 +335,9 @@ const ImportActionHeader = (props) => { ...@@ -331,6 +335,9 @@ const ImportActionHeader = (props) => {
<ConstraintSelect <ConstraintSelect
constraints={constraints} constraints={constraints}
onChange={onConstraintChange} onChange={onConstraintChange}
onDetail={() => {
setRuleParams({ visible: true })
}}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -357,7 +364,9 @@ const ImportActionHeader = (props) => { ...@@ -357,7 +364,9 @@ const ImportActionHeader = (props) => {
<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 }}><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(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>} >{highlightSearchContentByTerms(modelerData.dataResidence||'', terms)}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>规范</div>} >{modelerData.easyDataModelerModelingConstraint?(modelerData.easyDataModelerModelingConstraint.cnName||''):''}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>规范</div>} >
{modelerData.easyDataModelerModelingConstraint?(modelerData.easyDataModelerModelingConstraint.cnName||''):''}
</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据表类型</div>} >{modelerData.tableType}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>数据表类型</div>} >{modelerData.tableType}</Descriptions.Item>
</Descriptions> </Descriptions>
) )
...@@ -479,19 +488,26 @@ const ImportActionHeader = (props) => { ...@@ -479,19 +488,26 @@ const ImportActionHeader = (props) => {
} }
</React.Fragment> </React.Fragment>
} }
<Rule
{...ruleParams}
onCancel={() => {
setRuleParams({ visible: false })
}}
/>
</div> </div>
) )
} }
export default ImportActionHeader; export default ImportActionHeader;
const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps }) => { const ConstraintSelect = ({ value = {}, constraints = [], onChange, onDetail, ...restProps }) => {
return ( return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<Select <Select
onChange={onChange} onChange={(val) => { onChange?.(val) }}
value={value?.id} value={value?.id}
placeholder='请选择规范' placeholder='请选择规范'
style={{ flex: 1 }}
{...restProps} {...restProps}
> >
{ {
...@@ -502,6 +518,8 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps ...@@ -502,6 +518,8 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps
}) })
} }
</Select> </Select>
<Button className='ml-3' onClick={() => { onDetail?.() }}>查看</Button>
</div>
) )
} }
......
...@@ -21,7 +21,7 @@ const nodeItems = [ ...@@ -21,7 +21,7 @@ const nodeItems = [
] ]
const FC = (props) => { const FC = (props) => {
const { node } = props const { node, readonly } = props
const [args, setArgs] = React.useState(() => ({ const [args, setArgs] = React.useState(() => ({
statusId: undefined, statusId: undefined,
alertTypeId: undefined, alertTypeId: undefined,
...@@ -127,7 +127,7 @@ const FC = (props) => { ...@@ -127,7 +127,7 @@ const FC = (props) => {
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 200, width: readonly ? 80 : 200,
render: (text, record) => { render: (text, record) => {
return ( return (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
...@@ -148,6 +148,8 @@ const FC = (props) => { ...@@ -148,6 +148,8 @@ const FC = (props) => {
> >
规则详情 规则详情
</PermissionButton> </PermissionButton>
{
!readonly && <React.Fragment>
<div style={{ margin: '0 5px' }}> <div style={{ margin: '0 5px' }}>
<Divider type='vertical' /> <Divider type='vertical' />
</div> </div>
...@@ -181,6 +183,8 @@ const FC = (props) => { ...@@ -181,6 +183,8 @@ const FC = (props) => {
> >
删除 删除
</PermissionButton> </PermissionButton>
</React.Fragment>
}
</div> </div>
) )
} }
...@@ -341,14 +345,17 @@ const FC = (props) => { ...@@ -341,14 +345,17 @@ const FC = (props) => {
</div> </div>
<div className='d-flex py-3' style={{ justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid #EFEFEF' }}> <div className='d-flex py-3' style={{ justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid #EFEFEF' }}>
<Space> <Space>
<PermissionButton {
!readonly && <PermissionButton
onClick={onAddClick} onClick={onAddClick}
// permissionKey='新增' // permissionKey='新增'
defaultPermission={true} defaultPermission={true}
> >
新建 新建
</PermissionButton> </PermissionButton>
<PermissionButton }
{
!readonly && <PermissionButton
onClick={onBatchDeteteClick} onClick={onBatchDeteteClick}
// permissionKey='删除' // permissionKey='删除'
defaultPermission={true} defaultPermission={true}
...@@ -357,6 +364,7 @@ const FC = (props) => { ...@@ -357,6 +364,7 @@ const FC = (props) => {
> >
删除 删除
</PermissionButton> </PermissionButton>
}
<PermissionButton <PermissionButton
onClick={onExportClick} onClick={onExportClick}
defaultPermission={true} defaultPermission={true}
......
import React from "react"
import { Modal } from "antd"
import RuleCURD from './rule'
const FC = (props) => {
const { visible, onCancel } = props
const close = () => {
onCancel?.()
}
return (
<Modal
visible={visible}
footer={null}
width='80%'
bodyStyle={{ padding: '15px', overflowX: 'auto', maxHeight: '80vh' }}
title='规范详情'
centered destroyOnClose
onCancel={() => { close() }}
>
<RuleCURD readonly={true} />
</Modal>
)
}
export default FC
\ No newline at end of file
...@@ -11,7 +11,7 @@ import Version from './rule-catalog-version' ...@@ -11,7 +11,7 @@ import Version from './rule-catalog-version'
import { showMessage } from '../../../../util' import { showMessage } from '../../../../util'
const FC = (props) => { const FC = (props) => {
const { onClick } = props const { onClick, readonly } = props
const [loading, setLoading] = React.useState(false) const [loading, setLoading] = React.useState(false)
const [data, setData] = React.useState() const [data, setData] = React.useState()
const [selectedNode, setSelectedNode] = React.useState() const [selectedNode, setSelectedNode] = React.useState()
...@@ -165,7 +165,8 @@ const FC = (props) => { ...@@ -165,7 +165,8 @@ const FC = (props) => {
return ( return (
<div> <div>
<div className='px-3' style={{ {
!readonly && <div className='px-3' style={{
display: 'flex', display: 'flex',
width: '100%', width: '100%',
height: 40, height: 40,
...@@ -185,6 +186,7 @@ const FC = (props) => { ...@@ -185,6 +186,7 @@ const FC = (props) => {
</Tooltip> </Tooltip>
</Space> </Space>
</div> </div>
}
<div className='p-3'> <div className='p-3'>
<Spin spinning={loading}> <Spin spinning={loading}>
<Tree <Tree
...@@ -194,7 +196,7 @@ const FC = (props) => { ...@@ -194,7 +196,7 @@ const FC = (props) => {
treeData={treeData} treeData={treeData}
onSelect={onTreeSelect} onSelect={onTreeSelect}
selectedKeys={(selectedNode?.id)?[selectedNode?.id]:undefined} selectedKeys={(selectedNode?.id)?[selectedNode?.id]:undefined}
shouldRowContextMenu={() => true} shouldRowContextMenu={() => !readonly}
menuData={[ menuData={[
{ id: 'edit', title: '编辑目录' }, { id: 'edit', title: '编辑目录' },
{ id: 'up', title: '上移目录' }, { id: 'up', title: '上移目录' },
......
...@@ -10,6 +10,7 @@ import Separate from '../../AssetManage/Component/Separate' ...@@ -10,6 +10,7 @@ import Separate from '../../AssetManage/Component/Separate'
import '../../AssetManage/index.less' import '../../AssetManage/index.less'
const FC = (props) => { const FC = (props) => {
const { readonly = false } = props
const [node, setNode] = React.useState() const [node, setNode] = React.useState()
const onTreeClick = (value) => { const onTreeClick = (value) => {
...@@ -23,7 +24,7 @@ const FC = (props) => { ...@@ -23,7 +24,7 @@ const FC = (props) => {
<Tree onClick={onTreeClick} {...props} /> <Tree onClick={onTreeClick} {...props} />
</div> </div>
<div className='middle'> <div className='middle'>
<List node={node} /> <List node={node} {...props} />
</div> </div>
</div> </div>
) )
......
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