Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnyc-data-pro
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
hnyc-data-pro
Commits
579541e0
Commit
579541e0
authored
May 08, 2020
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产详情增加标签
parent
39184a5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
4 deletions
+149
-4
config.ts
config/config.ts
+1
-1
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+1
-1
umi.js
src/pages/.umi/umi.js
+1
-1
AssetList.tsx
src/pages/assets/components/AssetList.tsx
+7
-1
AssetListHelper.tsx
src/pages/assets/components/AssetListHelper.tsx
+139
-0
No files found.
config/config.ts
View file @
579541e0
...
...
@@ -152,7 +152,7 @@ export default {
*/
proxy
:
{
'/api'
:
{
target
:
'http://139.198.12
6.96:901
1'
,
target
:
'http://139.198.12
7.54:1839
1'
,
// target: 'http://192.168.0.220',
// target: 'http://139.198.127.54:18392',
changeOrigin
:
true
,
...
...
src/layouts/BasicLayout.tsx
View file @
579541e0
...
...
@@ -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'
}
}
...
...
src/pages/.umi/umi.js
View file @
579541e0
...
...
@@ -221,7 +221,7 @@ export default (__IS_BROWSER ? null : serverRender);
// Umi UI Bubble
require
(
'../../../node_modules/umi-plugin-ui/lib/bubble'
).
default
({
port
:
300
0
,
port
:
300
1
,
path
:
'/Users/zcx/Desktop/react/hnyc-data-pro'
,
currentProject
:
''
,
isBigfish
:
undefined
,
...
...
src/pages/assets/components/AssetList.tsx
View file @
579541e0
...
...
@@ -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
>
}
...
...
src/pages/assets/components/AssetListHelper.tsx
View file @
579541e0
...
...
@@ -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
}
/>
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment