Commit 579541e0 by zhaochengxiang

资产详情增加标签

parent 39184a5b
......@@ -152,7 +152,7 @@ export default {
*/
proxy: {
'/api': {
target: 'http://139.198.126.96:9011',
target: 'http://139.198.127.54:18391',
// target: 'http://192.168.0.220',
// target: 'http://139.198.127.54:18392',
changeOrigin: true,
......
......@@ -177,7 +177,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => {
const { publicPath } = window as (Window & UmiType);
const logo = (
<img
src={`${publicPath}images/logo_hnyc.png`}
src={`${publicPath}images/logo_yuanyao.png`}
className="mx-1"
alt=""
style={{ maxHeight: '2rem' }}
......
......@@ -221,7 +221,7 @@ export default (__IS_BROWSER ? null : serverRender);
// Umi UI Bubble
require('../../../node_modules/umi-plugin-ui/lib/bubble').default({
port: 3000,
port: 3001,
path: '/Users/zcx/Desktop/react/hnyc-data-pro',
currentProject: '',
isBigfish: undefined,
......
......@@ -17,7 +17,7 @@ import {
} from 'antd';
import { UserModelState, CurrentUser } from '@/models/user';
// import { StateType } from '../model';
import { DataDesc, DataPreview, DataDetail, AppColumns, ApplyDesc } from './AssetListHelper';
import { DataDesc, DataPreview, DataDetail, AppColumns, ApplyDesc, ServiceAPI, RelativeUser } from './AssetListHelper';
import styles from '../style.less';
import { Omit } from '@/utils/commons';
......@@ -466,6 +466,12 @@ class AssetListCOM extends React.Component<Props, State> {
<TabPane tab="数据预览" key="preview">
<DataPreview dataPreview={dataPreview} />
</TabPane>
<TabPane tab="服务接口" key="service">
<ServiceAPI />
</TabPane>
<TabPane tab="相关用户" key="user">
<RelativeUser />
</TabPane>
</Tabs>
}
......
......@@ -180,6 +180,64 @@ export const DataDetail: React.FunctionComponent<DataDetailProps> = ({
}}
/>
</Descriptions.Item>
<Descriptions.Item>
<span
className={styles.download}
onClick={(e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {
e.preventDefault();
if (user) {
const { roles } = user;
let flag = false;
roles.forEach(item => {
if (item.indexOf('ROLE_dataCatalog_operator') !== -1) {
flag = true;
}
});
if (flag && downloadModel) {
downloadModel(tableModel.tableModelId);
} else {
message.info('无权限下载');
}
} else {
message.info('请登录');
}
}}
>
模型导出
</span>
{/* <Fragment> */}
{/* <span className={styles.downloadText} /> */}
<Divider type="vertical" />
<span
className={styles.download}
onClick={(e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {
e.preventDefault();
if (user) {
const { roles } = user;
let flag = false;
roles.forEach(role => {
if (role.indexOf('ROLE_metadataHarvester_operator') !== -1) {
flag = true;
}
});
if (flag) {
if (isHaveFile && download) {
download(metaData.namePath);
} else {
message.info('无下载内容');
}
} else {
message.info('无权限下载');
}
} else {
message.info('请登录');
}
}}
>
设计文档
</span>
{/* </Fragment> */}
</Descriptions.Item>
{
showApplyButton&&<Descriptions.Item>
<span
......@@ -358,3 +416,84 @@ const ApplyDescFunc: React.FunctionComponent<ApplyDescProps> = ({ dataDesc, form
export const ApplyDesc = Form.create({ name: "apply" })(ApplyDescFunc);
const requestColumns = [
{ key: 'name', dataIndex: 'name', title: '参数名称' },
{ key: 'must', dataIndex: 'must', title: '是否必须' },
{ key: 'type', dataIndex: 'type', title: '类型' },
{ key: 'description', dataIndex: 'description', title: '描述' },
];
const responseColumns = [
{ key: 'property', dataIndex: 'property', title: '返回属性名称' },
{ key: 'type', dataIndex: 'type', title: '类型' },
{ key: 'description', dataIndex: 'description', title: '描述' },
];
export const ServiceAPI: React.FunctionComponent = ({}) => {
const request = [
{ name: 'tableModelId', must: '是', type: 'string', description: '数据资产ID'}
];
const response = [
{ property: 'Reponse', type: '对象', description: '数据资产定义'}
];
return (
<Descriptions size="small" column={1}>
<Descriptions.Item label="功能说明">
获取数据资产定义
</Descriptions.Item>
<Descriptions.Item label="调用方式">
HTTP GET
</Descriptions.Item>
<Descriptions.Item label="请求地址">
http://192.168.0.211:8762/api/datacatalog/front/listTableModelColumnsWithQuerySql
</Descriptions.Item>
<Descriptions.Item label="请求参数">
<Table
size="small"
rowKey="key"
pagination={false}
columns={requestColumns}
dataSource={request}
/>
</Descriptions.Item>
<Descriptions.Item label="返回参数">
<Table
size="small"
rowKey="key"
pagination={false}
columns={responseColumns}
dataSource={response}
/>
</Descriptions.Item>
</Descriptions>
);
};
const userColumns = [
{ key: 'id', dataIndex: 'id', title: '序号' },
{ key: 'name', dataIndex: 'name', title: '用户名' },
{ key: 'applyTime', dataIndex: 'applyTime', title: '申请时间' },
];
export const RelativeUser: React.FunctionComponent = ({}) => {
const users = [
{ id: '1', name: 'zhangsan', applyTime: '2018-05-10'},
{ id: '2', name: 'lisi', applyTime: '2018-05-12'}
];
return (
<Table
size="small"
rowKey="key"
pagination={false}
columns={userColumns}
dataSource={users}
/>
);
};
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