Commit c05a17c5 by zhaochengxiang

资产浏览编辑资产

parent c09edecb
...@@ -84,7 +84,7 @@ export function constraints() { ...@@ -84,7 +84,7 @@ export function constraints() {
return GetJSON("/datamodeler/easyDataModelerConstraint/constraints"); return GetJSON("/datamodeler/easyDataModelerConstraint/constraints");
} }
//模 //模
export function templates() { export function templates() {
return GetJSON("/datamodeler/easyDataModelerTemplateCURD/getAllDataModelTemplates"); return GetJSON("/datamodeler/easyDataModelerTemplateCURD/getAllDataModelTemplates");
} }
...@@ -110,7 +110,7 @@ export function draftUsingDDL(payload) { ...@@ -110,7 +110,7 @@ export function draftUsingDDL(payload) {
return PostJSON("/datamodeler/easyDataModelerDesign/draftUsingDDL", payload); return PostJSON("/datamodeler/easyDataModelerDesign/draftUsingDDL", payload);
} }
//切换模或者规范时调用 //切换模或者规范时调用
export function consult(payload) { export function consult(payload) {
return PostJSON("/datamodeler/easyDataModelerDesign/consult", payload); return PostJSON("/datamodeler/easyDataModelerDesign/consult", payload);
} }
......
...@@ -552,6 +552,16 @@ const AssetAction = (props) => { ...@@ -552,6 +552,16 @@ const AssetAction = (props) => {
</div> </div>
} }
{ {
readOnly && <div className='flex' style={{ justifyContent: 'right' }}>
{
currentAction==='detail' ? <Button type='primary' onClick={onActionButtonClick}>编辑</Button> : <Space>
<Button type='primary' onClick={onCancelButtonClick}>取消</Button>
<Button type='primary' onClick={onActionButtonClick}>保存</Button>
</Space>
}
</div>
}
{
(action!=='add' && (id||'')!=='') && <div> (action!=='add' && (id||'')!=='') && <div>
<div className='pl-common py-compact-common'> <div className='pl-common py-compact-common'>
<Descriptions column={1}> <Descriptions column={1}>
......
...@@ -129,7 +129,7 @@ const ImportAssetDrawer = (props) => { ...@@ -129,7 +129,7 @@ const ImportAssetDrawer = (props) => {
const handleOk = () => { const handleOk = () => {
if ((fileList||[]).length === 0) { if ((fileList||[]).length === 0) {
showMessage('info', '请先选择模上传'); showMessage('info', '请先选择模上传');
return; return;
} }
...@@ -182,7 +182,7 @@ const ImportAssetDrawer = (props) => { ...@@ -182,7 +182,7 @@ const ImportAssetDrawer = (props) => {
<Form layout='inline'> <Form layout='inline'>
<Form.Item label='Excel导入:'> <Form.Item label='Excel导入:'>
<Button className='mr-2' icon={<DownloadOutlined />} onClick={ downloadTemplate }> <Button className='mr-2' icon={<DownloadOutlined />} onClick={ downloadTemplate }>
下载 下载
</Button> </Button>
<Upload style={{ display: 'inline' }} {...uploadProps }> <Upload style={{ display: 'inline' }} {...uploadProps }>
<Button icon={ <Button icon={
......
...@@ -143,7 +143,7 @@ const ImportDirectory = (props) => { ...@@ -143,7 +143,7 @@ const ImportDirectory = (props) => {
onCancel={() => { onCancel && onCancel() }} onCancel={() => { onCancel && onCancel() }}
footer={ footer={
<Space> <Space>
<Button type="primary" onClick={ download } >下载</Button> <Button type="primary" onClick={ download } >下载</Button>
<Button type="primary" onClick={() => { upload(false); } } loading={uploading}>上传</Button> <Button type="primary" onClick={() => { upload(false); } } loading={uploading}>上传</Button>
<Button onClick={() => { onCancel && onCancel() }}>返回</Button> <Button onClick={() => { onCancel && onCancel() }}>返回</Button>
</Space> </Space>
......
...@@ -35,7 +35,7 @@ const ImportElement = (props) => { ...@@ -35,7 +35,7 @@ const ImportElement = (props) => {
const handleOk = () => { const handleOk = () => {
if ((fileList||[]).length === 0) { if ((fileList||[]).length === 0) {
showMessage('info', '请先选择模上传'); showMessage('info', '请先选择模上传');
return; return;
} }
...@@ -73,7 +73,7 @@ const ImportElement = (props) => { ...@@ -73,7 +73,7 @@ const ImportElement = (props) => {
> >
<div> <div>
<Button icon={<DownloadOutlined />} onClick={ downloadTemplate }> <Button icon={<DownloadOutlined />} onClick={ downloadTemplate }>
下载 下载
</Button> </Button>
</div> </div>
<div className='mt-3'> <div className='mt-3'>
......
...@@ -56,7 +56,7 @@ const DefineTable = (props) => { ...@@ -56,7 +56,7 @@ const DefineTable = (props) => {
ellipsis: true, ellipsis: true,
}, },
{ {
title: '模名称', title: '模名称',
dataIndex: 'name', dataIndex: 'name',
width: 200, width: 200,
ellipsis: true, ellipsis: true,
...@@ -65,7 +65,7 @@ const DefineTable = (props) => { ...@@ -65,7 +65,7 @@ const DefineTable = (props) => {
}, },
}, },
{ {
title: '模中文名称', title: '模中文名称',
dataIndex: 'cnName', dataIndex: 'cnName',
width: 200, width: 200,
ellipsis: true, ellipsis: true,
...@@ -77,7 +77,7 @@ const DefineTable = (props) => { ...@@ -77,7 +77,7 @@ const DefineTable = (props) => {
ellipsis: true, ellipsis: true,
}, },
{ {
title: '模描述', title: '模描述',
dataIndex: 'comment', dataIndex: 'comment',
width: 200, width: 200,
ellipsis: true, ellipsis: true,
...@@ -185,7 +185,7 @@ const DefineTable = (props) => { ...@@ -185,7 +185,7 @@ const DefineTable = (props) => {
<Button onClick={onAddClick}>新建</Button> <Button onClick={onAddClick}>新建</Button>
</Space> </Space>
<Space> <Space>
<Tooltip title={(checkedKeys||[]).length===0?'请先选择模':''}> <Tooltip title={(checkedKeys||[]).length===0?'请先选择模':''}>
<Button onClick={onBatchDeleteClick} disabled={(checkedKeys||[]).length===0} loading={deleteLoading}>删除</Button> <Button onClick={onBatchDeleteClick} disabled={(checkedKeys||[]).length===0} loading={deleteLoading}>删除</Button>
</Tooltip> </Tooltip>
</Space> </Space>
......
...@@ -159,7 +159,7 @@ const DefineTree = (props) => { ...@@ -159,7 +159,7 @@ const DefineTree = (props) => {
const deleteNode = () => { const deleteNode = () => {
modal.confirm({ modal.confirm({
title: '提示!', title: '提示!',
content: '删除目录会删除相关的模,您确定删除吗?', content: '删除目录会删除相关的模,您确定删除吗?',
onOk: () => { onOk: () => {
setLoading(true); setLoading(true);
dispatch({ dispatch({
......
...@@ -26,17 +26,17 @@ const UpdateBasicInfo = (props) => { ...@@ -26,17 +26,17 @@ const UpdateBasicInfo = (props) => {
> >
<Row gutter={10}> <Row gutter={10}>
<Col xs={24} sm={24} lg={12}> <Col xs={24} sm={24} lg={12}>
<Form.Item label='中文名称' name='cnName' rules={[{ required: true, message: '请填写模中文名称' }]}> <Form.Item label='中文名称' name='cnName' rules={[{ required: true, message: '请填写模中文名称' }]}>
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12}> <Col xs={24} sm={24} lg={12}>
<Form.Item label='英文名称' name='name' rules={[{ required: true, message: '请填写模名称' }]}> <Form.Item label='英文名称' name='name' rules={[{ required: true, message: '请填写模名称' }]}>
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12}> <Col xs={24} sm={24} lg={12}>
<Form.Item label='模描述' name='comment'> <Form.Item label='模描述' name='comment'>
<TextArea row={4} /> <TextArea row={4} />
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -44,7 +44,7 @@ const UpdateBasicInfo = (props) => { ...@@ -44,7 +44,7 @@ const UpdateBasicInfo = (props) => {
</Form> : <Descriptions column={2}> </Form> : <Descriptions column={2}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>中文名称</div>} >{template?.cnName||''}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>中文名称</div>} >{template?.cnName||''}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>英文名称</div>}>{template?.name||''}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>英文名称</div>}>{template?.name||''}</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>描述</div>}>{template?.comment||''}</Descriptions.Item> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 85 }}>描述</div>}>{template?.comment||''}</Descriptions.Item>
</Descriptions> </Descriptions>
} }
</div> </div>
......
...@@ -28,14 +28,14 @@ export const UpdateTemplateModal = (props) => { ...@@ -28,14 +28,14 @@ export const UpdateTemplateModal = (props) => {
const title = useMemo(() => { const title = useMemo(() => {
if (action === 'add') { if (action === 'add') {
return '新建模'; return '新建模';
} }
if (action === 'detail') { if (action === 'detail') {
return '模详情'; return '模详情';
} }
if (action === 'update') { if (action === 'update') {
return '编辑模'; return '编辑模';
} }
return ''; return '';
}, [action]) }, [action])
......
...@@ -229,7 +229,7 @@ const ImportDataDrawer = (props) => { ...@@ -229,7 +229,7 @@ const ImportDataDrawer = (props) => {
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button icon={<DownloadOutlined />} onClick={downloadTemplate }> <Button icon={<DownloadOutlined />} onClick={downloadTemplate }>
下载 下载
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
......
...@@ -79,7 +79,7 @@ class ImportExcel extends React.Component { ...@@ -79,7 +79,7 @@ class ImportExcel extends React.Component {
</Col> </Col>
<Col span={6}> <Col span={6}>
<Button icon={<DownloadOutlined />} onClick={ this.downloadTemplate }> <Button icon={<DownloadOutlined />} onClick={ this.downloadTemplate }>
下载 下载
</Button> </Button>
</Col> </Col>
</Row> </Row>
......
...@@ -79,11 +79,11 @@ const EditTemplate = (props) => { ...@@ -79,11 +79,11 @@ const EditTemplate = (props) => {
let title = ''; let title = '';
if (action === 'add') { if (action === 'add') {
title = '新增模'; title = '新增模';
} else if (action === 'edit') { } else if (action === 'edit') {
title = '模编辑'; title = '模编辑';
} else if (action === 'detail') { } else if (action === 'detail') {
title = '模详情'; title = '模详情';
} }
let actionsBtn = null; let actionsBtn = null;
......
...@@ -170,7 +170,7 @@ const PartitionCURD = (props) => { ...@@ -170,7 +170,7 @@ const PartitionCURD = (props) => {
} }
}, },
callback: () => { callback: () => {
showMessage('success', '模分区成功'); showMessage('success', '模分区成功');
getPartitions(); getPartitions();
} }
}) })
......
...@@ -78,7 +78,7 @@ const TemplateAction = (props) => { ...@@ -78,7 +78,7 @@ const TemplateAction = (props) => {
}); });
} }
//模不需要对字段进行校验 //模不需要对字段进行校验
const onTableChange = (data) => { const onTableChange = (data) => {
let newTemplateData = {...templateData, ...{easyDataModelerDataModelAttributes: data}}; let newTemplateData = {...templateData, ...{easyDataModelerDataModelAttributes: data}};
......
...@@ -35,7 +35,7 @@ const TemplateCURD = (props) => { ...@@ -35,7 +35,7 @@ const TemplateCURD = (props) => {
width: 60, width: 60,
}, },
{ {
title: '模名称', title: '模名称',
dataIndex: 'name', dataIndex: 'name',
width: 180, width: 180,
ellipsis: true, ellipsis: true,
...@@ -56,7 +56,7 @@ const TemplateCURD = (props) => { ...@@ -56,7 +56,7 @@ const TemplateCURD = (props) => {
ellipsis: true, ellipsis: true,
}, },
{ {
title: '模描述', title: '模描述',
dataIndex: 'remark', dataIndex: 'remark',
ellipsis: true, ellipsis: true,
}, },
...@@ -124,7 +124,7 @@ const TemplateCURD = (props) => { ...@@ -124,7 +124,7 @@ const TemplateCURD = (props) => {
const deleteItem = (record) => { const deleteItem = (record) => {
modal.confirm({ modal.confirm({
title: '提示!', title: '提示!',
content: '您确定要删除该模吗?', content: '您确定要删除该模吗?',
onOk: () => { onOk: () => {
dispatch({ dispatch({
type: 'datamodel.deleteTemplate', type: 'datamodel.deleteTemplate',
...@@ -134,7 +134,7 @@ const TemplateCURD = (props) => { ...@@ -134,7 +134,7 @@ const TemplateCURD = (props) => {
} }
}, },
callback: () => { callback: () => {
showMessage('success', '模删除成功'); showMessage('success', '模删除成功');
getTemplates(); getTemplates();
} }
}) })
......
...@@ -75,7 +75,7 @@ const WordTemplate = (props) => { ...@@ -75,7 +75,7 @@ const WordTemplate = (props) => {
return ( return (
<Form form={form} {...layout} onFinish={handleOk}> <Form form={form} {...layout} onFinish={handleOk}>
<Form.Item <Form.Item
label='最新模上传' label='最新模上传'
required={true} required={true}
> >
<Row> <Row>
...@@ -101,7 +101,7 @@ const WordTemplate = (props) => { ...@@ -101,7 +101,7 @@ const WordTemplate = (props) => {
</Col> </Col>
<Col> <Col>
<Button className='ml-3' icon={<DownloadOutlined />} onClick={ downloadTemplate }> <Button className='ml-3' icon={<DownloadOutlined />} onClick={ downloadTemplate }>
下载 下载
</Button> </Button>
</Col> </Col>
</Row> </Row>
......
...@@ -20,7 +20,7 @@ const ModelConfig = () => { ...@@ -20,7 +20,7 @@ const ModelConfig = () => {
return ( return (
<div className='model-config'> <div className='model-config'>
<Tabs activeKey={tabKey} onChange={onTabChange}> <Tabs activeKey={tabKey} onChange={onTabChange}>
<TabPane tab='Word模配置' key='1'> <TabPane tab='Word模配置' key='1'>
<WordTemplate /> <WordTemplate />
</TabPane> </TabPane>
<TabPane tab='生成表类型配置' key='2'> <TabPane tab='生成表类型配置' key='2'>
......
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