Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnyc-data
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
Commits
048f610d
Commit
048f610d
authored
Apr 30, 2020
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的订阅 已获授权
parent
bcdaeaac
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
221 additions
and
5 deletions
+221
-5
App.jsx
src/App.jsx
+2
-0
assets.js
src/model/assets.js
+9
-0
user.js
src/model/user.js
+8
-0
assets.js
src/service/assets.js
+9
-0
user.js
src/service/user.js
+10
-3
index.jsx
src/view/Home/index.jsx
+23
-1
AssetList.js
src/view/Manage/Assets/components/AssetList.js
+27
-1
index.jsx
src/view/Manage/index.jsx
+5
-0
index.jsx
src/view/User/Authorized/index.jsx
+64
-0
index.jsx
src/view/User/Subscrible/index.jsx
+64
-0
No files found.
src/App.jsx
View file @
048f610d
...
...
@@ -17,9 +17,11 @@ export default class App extends React.Component {
<
Switch
>
<
Route
path=
{
`${ContextPath}/signin`
}
component=
{
Signin
}
exact
/>
<
Route
path=
{
`${ContextPath}/manage`
}
exact
component=
{
()
=>
<
Redirect
to=
{
`${ContextPath}/manage/assets`
}
/>
}
/>
<
Route
path=
{
`${ContextPath}/user`
}
exact
component=
{
()
=>
<
Redirect
to=
{
`${ContextPath}/user/subscrible`
}
/>
}
/>
<
Route
path=
{
`${ContextPath}/home`
}
component=
{
Home
}
/>
<
Route
path=
{
`${ContextPath}/manage`
}
component=
{
Manage
}
/>
<
Route
path=
{
`${ContextPath}/user`
}
component=
{
Manage
}
/>
<
Route
component=
{
RedirectHome
}
/>
</
Switch
>
</
Router
>
...
...
src/model/assets.js
View file @
048f610d
...
...
@@ -45,10 +45,18 @@ export function* subscribeTableModel(payload) {
return
yield
call
(
service
.
subscribeTableModel
,
payload
);
}
export
function
*
unSubscribeTableModel
(
payload
)
{
return
yield
call
(
service
.
unSubscribeTableModel
,
payload
);
}
export
function
*
setTableModelScore
(
payload
)
{
return
yield
call
(
service
.
setTableModelScore
,
payload
);
}
export
function
*
apply
(
payload
)
{
return
yield
call
(
service
.
apply
,
payload
);
}
export
function
*
getDataFlowCount
(
payload
)
{
return
yield
call
(
service
.
getDataFlowCount
,
payload
);
}
\ No newline at end of file
src/model/user.js
View file @
048f610d
...
...
@@ -12,3 +12,11 @@ export function* signin(payload) {
export
function
*
signout
()
{
return
yield
call
(
service
.
signout
);
}
export
function
*
getUserSubscribeTableModels
(
payload
)
{
return
yield
call
(
service
.
getUserSubscribeTableModels
,
payload
);
}
export
function
*
listPrivilegeTableModels
(
payload
)
{
return
yield
call
(
service
.
listPrivilegeTableModels
,
payload
);
}
src/service/assets.js
View file @
048f610d
...
...
@@ -41,10 +41,18 @@ export async function subscribeTableModel(payload) {
return
PostJSON
(
"/datacatalog/front/subscribeTableModel"
,
payload
);
}
export
async
function
unSubscribeTableModel
(
payload
)
{
return
PostJSON
(
"/datacatalog/front/unSubscribeTableModel"
,
payload
);
}
export
async
function
setTableModelScore
(
payload
)
{
return
Post
(
"/datacatalog/front/setTableModelScore"
,
payload
);
}
export
async
function
apply
(
payload
){
return
Post
(
'/datacatalog/front/apply'
,
payload
);
}
export
function
getDataFlowCount
(
payload
)
{
return
GetJSON
(
'/metadatarepo/rest/jobInfo/getDataFlowCount'
)
}
\ No newline at end of file
src/service/user.js
View file @
048f610d
import
{
PostJSON
,
Post
}
from
"../util/axios"
import
{
PostJSON
,
Post
,
GetJSON
}
from
"../util/axios"
export
function
sessionInfo
(
payload
)
{
return
PostJSON
(
"/auth/sessionInfo"
,
payload
)
...
...
@@ -9,4 +9,12 @@ export function signin(payload) {
}
export
function
signout
()
{
return
Post
(
"/auth/signout"
)
}
\ No newline at end of file
}
export
function
getUserSubscribeTableModels
(
payload
)
{
return
GetJSON
(
"/datacatalog/front/getUserSubscribeTableModels"
)
}
export
function
listPrivilegeTableModels
(
payload
)
{
return
GetJSON
(
"/datacatalog/front/listPrivilegeTableModels"
)
}
src/view/Home/index.jsx
View file @
048f610d
...
...
@@ -5,11 +5,33 @@ import { GetSession } from '../../util';
import
{
HomeLayout
}
from
'../../layout'
;
import
{
HomeSearch
,
HomeMenu
,
HomeGrid
}
from
'./HomeHelper'
;
import
{
dispatchLatest
}
from
'../../model'
;
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
flowCount
:
{}
}
}
componentDidMount
()
{
dispatchLatest
({
type
:
'assets.getDataFlowCount'
,
payload
:
{},
callback
:
data
=>
{
(
this
.
unmount
===
undefined
)
&&
this
.
setState
({
flowCount
:
data
,
})
}
})
}
render
()
{
const
{
session
}
=
this
.
props
;
const
{
flowCount
}
=
this
.
state
;
return
(
<
React
.
Fragment
>
...
...
@@ -18,7 +40,7 @@ class Home extends Component {
<
div
className=
"home-container overflow-hidden"
>
<
HomeSearch
{
...
this
.
props
}
/>
<
HomeMenu
/>
<
HomeGrid
/>
<
HomeGrid
tooltipData=
{
flowCount
}
/>
</
div
>
:
<
GetSession
{
...
this
.
props
}
/>
}
/>
...
...
src/view/Manage/Assets/components/AssetList.js
View file @
048f610d
...
...
@@ -125,7 +125,7 @@ class AssetListCOM extends Component {
}
render
()
{
const
{
tableModels
,
loading
,
subscribeTableModel
,
updateItems
}
=
this
.
props
;
const
{
tableModels
,
loading
,
subscribeTableModel
,
updateItems
,
subscrible
=
false
}
=
this
.
props
;
const
{
tableModel
,
showModal
,
tabKey
,
metedata
,
dataDesc
,
dataPreview
,
activeBtn
}
=
this
.
state
;
const
IconText
=
({
type
,
text
})
=>
(
...
...
@@ -213,6 +213,32 @@ class AssetListCOM extends Component {
订阅
<
/Button
>
),
item
.
subscribed
&&
subscrible
&&
(
<
Button
size
=
"small"
type
=
"link"
icon
=
"book"
onClick
=
{
e
=>
{
e
.
preventDefault
();
if
(
dispatch
)
{
dispatch
({
type
:
'assets.unSubscribeTableModel'
,
payload
:
{
params
:
{
tableModelId
:
item
.
tableModelId
}
},
callback
:
(
response
)
=>
{
if
(
response
!==
null
)
{
message
.
success
(
'取消订阅成功'
);
if
(
updateItems
)
{
updateItems
();
}
}
},
});
}
}}
>
取消订阅
<
/Button
>
),
];
}
return
[];
...
...
src/view/Manage/index.jsx
View file @
048f610d
...
...
@@ -6,6 +6,8 @@ import { GetSession } from "../../util";
import
{
ManageLayout
}
from
"../../layout"
;
import
Assets
from
'./Assets'
;
import
Search
from
'./Search'
;
import
Subscrible
from
'../User/Subscrible'
;
import
Authorized
from
'../User/Authorized'
;
class
Manage
extends
Component
{
constructor
()
{
...
...
@@ -31,6 +33,9 @@ class Manage extends Component {
component=
{
Search
}
/>
<
Route
path=
{
`${match.path}/assets`
}
component=
{
Assets
}
/>
<
Route
path=
{
`${match.path}/subscrible`
}
component=
{
Subscrible
}
/>
<
Route
path=
{
`${match.path}/authorized`
}
component=
{
Authorized
}
/>
</
Switch
>
)
:
(
<
GetSession
{
...
this
.
props
}
/>
...
...
src/view/User/Authorized/index.jsx
0 → 100644
View file @
048f610d
import
React
,
{
Component
}
from
"react"
;
import
{
Card
,
Pagination
}
from
'antd'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
paginate
}
from
'../../../util'
;
import
AssetListCOM
from
'../../Manage/Assets/components/AssetList'
;
export
default
class
Authorized
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
items
:
[],
pageNum
:
1
,
pageSize
:
10
,
loading
:
false
};
}
componentDidMount
()
{
this
.
updateItems
();
}
updateItems
()
{
dispatch
({
type
:
'user.listPrivilegeTableModels'
,
payload
:
{
},
callback
:
data
=>
{
(
this
.
unmount
===
undefined
)
&&
this
.
setState
({
loading
:
false
,
items
:
data
||
[],
})
}
})
}
render
()
{
const
{
items
,
pageNum
,
pageSize
,
loading
}
=
this
.
state
;
const
_items
=
paginate
(
items
,
pageNum
,
pageSize
);
return
(
<
Card
bordered=
{
false
}
>
<
AssetListCOM
loading=
{
loading
}
tableModels=
{
_items
}
updateItems=
{
this
.
updateItems
.
bind
(
this
)
}
subscrible
/>
<
Pagination
className=
"text-center"
showSizeChanger
showQuickJumper
onChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
setState
({
pageNum
:
_pageNum
,
pageSize
:
_pageSize
||
10
});
}
}
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
setState
({
pageNum
:
_pageNum
||
1
,
pageSize
:
_pageSize
});
}
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
items
.
length
}
/>
</
Card
>
);
}
}
src/view/User/Subscrible/index.jsx
0 → 100644
View file @
048f610d
import
React
,
{
Component
}
from
"react"
;
import
{
Card
,
Pagination
}
from
'antd'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
paginate
}
from
'../../../util'
;
import
AssetListCOM
from
'../../Manage/Assets/components/AssetList'
;
export
default
class
Subscrible
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
items
:
[],
pageNum
:
1
,
pageSize
:
10
,
loading
:
false
};
}
componentDidMount
()
{
this
.
updateItems
();
}
updateItems
()
{
dispatch
({
type
:
'user.getUserSubscribeTableModels'
,
payload
:
{
},
callback
:
data
=>
{
(
this
.
unmount
===
undefined
)
&&
this
.
setState
({
loading
:
false
,
items
:
data
||
[],
})
}
})
}
render
()
{
const
{
items
,
pageNum
,
pageSize
,
loading
}
=
this
.
state
;
const
_items
=
paginate
(
items
,
pageNum
,
pageSize
);
return
(
<
Card
bordered=
{
false
}
>
<
AssetListCOM
loading=
{
loading
}
tableModels=
{
_items
}
updateItems=
{
this
.
updateItems
.
bind
(
this
)
}
subscrible
/>
<
Pagination
className=
"text-center"
showSizeChanger
showQuickJumper
onChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
setState
({
pageNum
:
_pageNum
,
pageSize
:
_pageSize
||
10
});
}
}
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
setState
({
pageNum
:
_pageNum
||
1
,
pageSize
:
_pageSize
});
}
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
items
.
length
}
/>
</
Card
>
);
}
}
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