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
3acdde74
Commit
3acdde74
authored
May 09, 2020
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加元数据
parent
4111be2b
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
186 additions
and
162 deletions
+186
-162
index.js
src/layout/index.js
+1
-1
assets.js
src/model/assets.js
+5
-0
routes.js
src/routes.js
+5
-5
assets.js
src/service/assets.js
+0
-1
index.js
src/util/index.js
+2
-2
HomeHelper.js
src/view/Home/HomeHelper.js
+24
-4
index.jsx
src/view/Home/index.jsx
+3
-21
AssetList.js
src/view/Manage/Assets/components/AssetList.js
+4
-4
index.jsx
src/view/Manage/Assets/index.jsx
+3
-3
SearchHelper.js
src/view/Manage/Search/components/SearchHelper.js
+44
-57
index.jsx
src/view/Manage/Search/index.jsx
+2
-2
index.jsx
src/view/Manage/index.jsx
+6
-2
MetadataTree.js
src/view/Metadata/Indicator/components/MetadataTree.js
+3
-3
index.jsx
src/view/Metadata/Indicator/index.jsx
+2
-2
index.jsx
src/view/Metadata/Standard/index.jsx
+2
-2
index.jsx
src/view/Metadata/index.jsx
+23
-0
index.jsx
src/view/User/Authorized/index.jsx
+2
-2
index.jsx
src/view/User/Question/index.jsx
+53
-49
index.jsx
src/view/User/Subscrible/index.jsx
+2
-2
No files found.
src/layout/index.js
View file @
3acdde74
...
...
@@ -15,7 +15,7 @@ import logo from '../assets/logo_hnyc.png';
const
{
Header
,
Sider
,
Content
}
=
Layout
;
const
{
SubMenu
}
=
Menu
;
const
_Logout
=
({
session
})
=>
session
?
const
_Logout
=
({
session
,
location
})
=>
session
?
<
Menu
className
=
{
"ml-auto layout-menu"
}
mode
=
"horizontal"
theme
=
"light"
onClick
=
{
null
}
>
<
SubMenu
...
...
src/model/assets.js
View file @
3acdde74
import
*
as
service
from
'../service/assets'
;
import
{
call
}
from
'redux-saga/effects'
;
export
function
*
getDomainsAndHotwords
(
payload
)
{
const
domains
=
yield
call
(
service
.
domains
,
null
);
const
hotwords
=
yield
call
(
service
.
getHotWord
,
payload
);
return
{
domains
:
domains
||
[],
hotwords
:
hotwords
||
[]};
}
export
function
*
domains
(
payload
)
{
return
yield
call
(
service
.
domains
,
payload
);
...
...
src/routes.js
View file @
3acdde74
...
...
@@ -20,7 +20,7 @@ export const routes = [
text
:
'数据资产'
},
{
name
:
'meta
search
'
,
name
:
'meta
data
'
,
text
:
'元数据'
},
{
...
...
@@ -31,10 +31,10 @@ export const routes = [
name
:
'standard'
,
text
:
'数据标准'
},
{
name
:
'dataquality'
,
text
:
'数据质量'
}
//
{
//
name: 'dataquality',
//
text: '数据质量'
//
}
]
},
{
...
...
src/service/assets.js
View file @
3acdde74
import
{
PostJSON
,
Post
,
GetJSON
}
from
"../util/axios"
export
function
domains
(
payload
)
{
return
GetJSON
(
"/authservice/domains"
,
payload
);
}
...
...
src/util/index.js
View file @
3acdde74
import
React
from
"react"
;
import
{
message
}
from
'antd'
;
import
{
Redirect
}
from
'react-router-dom'
;
import
{
dispatch
,
action
}
from
'../model'
;
import
{
dispatch
Latest
,
action
}
from
'../model'
;
import
{
set_sess_state
}
from
"../model/reducer"
;
export
const
ContextPath
=
'/data-platform'
;
...
...
@@ -50,7 +50,7 @@ export function Connect(modules) {
export
class
GetSession
extends
React
.
Component
{
componentDidMount
()
{
const
{
history
,
location
}
=
this
.
props
;
dispatch
({
dispatch
Latest
({
type
:
'user.fetchSessionInfo'
,
callback
:
session
=>
{
if
(
session
&&
session
.
userId
)
{
...
...
src/view/Home/HomeHelper.js
View file @
3acdde74
...
...
@@ -5,6 +5,7 @@ import { Tooltip, Input, Row, Col } from 'antd';
import
{
ContextPath
}
from
'../../util'
;
import
Comet
from
'./Comet'
;
import
{
dispatchLatest
}
from
'../../model'
;
import
menuImg1
from
'../../assets/home/menu1.png'
;
import
menuImg2
from
'../../assets/home/menu2.png'
;
...
...
@@ -105,9 +106,9 @@ export class HomeSearch extends Component {
const
homeMenu
=
[
{
title
:
'数据资产'
,
img
:
menuImg1
,
url
:
`
${
ContextPath
}
/manage/assets`
},
{
title
:
'元数据'
,
img
:
menuImg2
,
url
:
'/center-home/view/metasearch'
},
{
title
:
'数据指标'
,
img
:
menuImg3
},
{
title
:
'数据标准'
,
img
:
menuImg4
},
{
title
:
'元数据'
,
img
:
menuImg2
,
url
:
`
${
ContextPath
}
/manage/metadata`
},
{
title
:
'数据指标'
,
img
:
menuImg3
,
url
:
`
${
ContextPath
}
/manage/indicator`
},
{
title
:
'数据标准'
,
img
:
menuImg4
,
url
:
`
${
ContextPath
}
/manage/standard`
},
{
title
:
'数据质量'
,
img
:
menuImg5
},
];
...
...
@@ -264,8 +265,27 @@ const netData = [
];
export
class
HomeGrid
extends
Component
{
constructor
()
{
super
();
this
.
state
=
{
tooltipData
:
{}
};
}
componentDidMount
()
{
dispatchLatest
({
type
:
'assets.getDataFlowCount'
,
payload
:
{},
callback
:
data
=>
{
this
.
setState
({
tooltipData
:
data
})
}
})
}
render
()
{
const
{
tooltipData
}
=
this
.
props
;
const
{
tooltipData
}
=
this
.
state
;
return
(
<
div
className
=
{
'home-grid-outter'
}
style
=
{{}}
>
...
...
src/view/Home/index.jsx
View file @
3acdde74
...
...
@@ -5,40 +5,22 @@ import { GetSession } from '../../util';
import
{
HomeLayout
}
from
'../../layout'
;
import
{
HomeSearch
,
HomeMenu
,
HomeGrid
}
from
'./HomeHelper'
;
import
{
dispatch
}
from
'../../model'
;
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
flowCount
:
{}
}
}
componentDidMount
()
{
dispatch
({
type
:
'assets.getDataFlowCount'
,
payload
:
{},
callback
:
data
=>
{
this
.
setState
({
flowCount
:
data
})
}
})
}
render
()
{
const
{
session
}
=
this
.
props
;
const
{
flowCount
}
=
this
.
state
;
return
(
<
React
.
Fragment
>
<
HomeLayout
{
...
this
.
props
}
content=
{
(
session
&&
session
.
userId
)
?
content=
{
(
session
&&
session
.
userId
)
?
(
<
div
className=
"home-container overflow-hidden"
>
<
HomeSearch
{
...
this
.
props
}
/>
<
HomeMenu
/>
<
HomeGrid
tooltipData=
{
flowCount
}
/>
<
HomeGrid
/>
</
div
>
)
:
<
GetSession
{
...
this
.
props
}
/>
}
/>
</
React
.
Fragment
>
...
...
src/view/Manage/Assets/components/AssetList.js
View file @
3acdde74
...
...
@@ -15,7 +15,7 @@ import {
import
{
DataDesc
,
DataPreview
,
DataDetail
,
ApplyDesc
}
from
'./AssetListHelper'
;
import
styles
from
'../style.less'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
const
{
Text
}
=
Typography
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -46,7 +46,7 @@ class AssetListCOM extends Component {
this
.
setState
({
activeBtn
:
0
});
dispatch
({
dispatch
Latest
({
type
:
'assets.getMetadata'
,
payload
:
tableModel
.
tableIdInSource
,
callback
:
data
=>
{
...
...
@@ -57,7 +57,7 @@ class AssetListCOM extends Component {
}
})
dispatch
({
dispatch
Latest
({
type
:
'assets.listTableModelColumnsWithQuerySql'
,
payload
:
{
tableModelId
:
tableModel
.
tableModelId
},
callback
:
desc
=>
{
...
...
@@ -74,7 +74,7 @@ class AssetListCOM extends Component {
if
(
preState
.
tabKey
!==
tabKey
&&
tabKey
!==
'description'
&&
tableModel
)
{
if
(
tabKey
===
'preview'
)
{
dispatch
({
dispatch
Latest
({
type
:
'assets.listTableModelSampleDatas'
,
payload
:
{
tableModelId
:
tableModel
.
tableModelId
},
callback
:
preview
=>
{
...
...
src/view/Manage/Assets/index.jsx
View file @
3acdde74
...
...
@@ -3,7 +3,7 @@ import { Row, Col, Card, Input, Pagination } from 'antd';
import
AssetTreeCOM
from
'./components/AssetTree'
;
import
AssetListCOM
from
'./components/AssetList'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
Latest
}
from
'../../../model'
;
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
const
{
Search
}
=
Input
;
...
...
@@ -22,7 +22,7 @@ class Assets extends Component {
getTreeData
=
()
=>
{
dispatch
({
dispatch
Latest
({
type
:
'assets.queryTopicAsTree'
,
payload
:
null
,
callback
:
data
=>
{
...
...
@@ -37,7 +37,7 @@ class Assets extends Component {
if
(
node
)
{
this
.
setState
({
currentNode
:
node
,
pageNum
,
pageSize
,
loading
:
true
});
dispatch
({
dispatch
Latest
({
type
:
'assets.listCatalogTableModelsByPage'
,
payload
:
{
dirId
:
node
.
nodeId
,
pageNum
,
pageSize
,
keyword
},
callback
:
data
=>
{
...
...
src/view/Manage/Search/components/SearchHelper.js
View file @
3acdde74
import
React
,
{
Component
}
from
"react"
;
import
{
Row
,
Col
,
Spin
,
Tabs
,
Tag
,
Input
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
Latest
}
from
'../../../../model'
;
const
{
TabPane
}
=
Tabs
;
const
{
CheckableTag
}
=
Tag
;
...
...
@@ -11,51 +11,36 @@ export class SearchBar extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
domains
:
null
,
hotWords
:
null
,
keyword
:
''
,
domain
:
''
,
loading
Domain
:
false
,
loadingHotWord
:
false
};
this
.
state
=
{
domains
:
null
,
hotWords
:
null
,
keyword
:
''
,
domain
:
''
,
loading
:
false
};
}
componentDidMount
()
{
const
{
location
,
onChange
}
=
this
.
props
;
const
_keyword
=
(
location
.
query
&&
location
.
query
.
search
)
?
location
.
query
.
search
:
''
;
this
.
setState
({
keyword
:
_keyword
},()
=>
{
this
.
setState
({
loadingDomain
:
true
},
()
=>
{
dispatch
({
type
:
'assets.domains'
,
payload
:
null
,
callback
:
data
=>
{
this
.
setState
({
loadingDomain
:
false
,
domains
:
data
});
}
});
});
this
.
setState
({
loadingHotWord
:
true
},
()
=>
{
dispatch
({
type
:
'assets.getHotWord'
,
payload
:
{
topNum
:
5
},
callback
:
data
=>
{
this
.
setState
({
loadingHotWord
:
false
,
hotWords
:
data
},()
=>
{
const
{
keyword
,
domain
}
=
this
.
state
;
onChange
&&
onChange
(
keyword
,
domain
);
});
}
});
});
});
this
.
setState
({
keyword
:
_keyword
,
loading
:
true
},()
=>
{
dispatchLatest
({
type
:
'assets.getDomainsAndHotwords'
,
payload
:
{
topNum
:
5
},
callback
:
data
=>
{
this
.
setState
({
loading
:
false
,
domains
:
data
.
domains
,
hotWords
:
data
.
hotwords
},()
=>
{
const
{
keyword
,
domain
}
=
this
.
state
;
onChange
&&
onChange
(
keyword
,
domain
);
});
}
})
})
}
render
()
{
const
{
onChange
}
=
this
.
props
;
const
{
domains
,
hotWords
,
domain
,
keyword
,
loading
Domain
,
loadingHotWord
}
=
this
.
state
;
const
{
domains
,
hotWords
,
domain
,
keyword
,
loading
}
=
this
.
state
;
var
tabDomains
=
null
;
let
tabDomains
=
null
;
if
(
domains
&&
domains
.
length
>
0
)
{
tabDomains
=
[{
domainId
:
''
,
domainName
:
'所有'
},
...
domains
];
}
...
...
@@ -82,7 +67,8 @@ export class SearchBar extends Component {
<
/Row
>
<
Row
className
=
{
'pb-3'
}
>
<
Col
span
=
{
12
}
offset
=
{
6
}
>
<
Spin
spinning
=
{
loadingDomain
}
>
{
<
Spin
spinning
=
{
loading
}
>
{
tabDomains
&&<
Tabs
defaultActiveKey
=
{
domain
}
onChange
=
{
active
=>
{
...
...
@@ -93,7 +79,8 @@ export class SearchBar extends Component {
return
<
TabPane
tab
=
{
domain
.
domainName
}
key
=
{
`
${
domain
.
domainId
}
`
}
><
/TabPane>
;
})}
<
/Tabs
>
}
<
/Spin
>
}
<
/Spin
>
<
/Col
>
<
/Row
>
<
Row
>
...
...
@@ -101,26 +88,26 @@ export class SearchBar extends Component {
<
span
>
热门搜索
:
<
/span
>
<
/Col
>
<
Col
span
=
{
10
}
>
<
Spin
spinning
=
{
loading
HotWord
}
>
{
hotWords
&&
hotWords
.
map
(
hotWord
=>
{
return
(
<
CheckableTag
key
=
{
hotWord
}
checked
=
{
hotWord
===
keyword
}
onChange
=
{
checked
=>
{
const
{
domain
}
=
this
.
state
;
if
(
checked
)
{
this
.
setState
({
keyword
:
hotWord
});
onChange
&&
onChange
(
hotWord
,
domain
);
}
}}
>
{
hotWord
}
<
/CheckableTag
>
);
})
}
<
Spin
spinning
=
{
loading
}
>
{
hotWords
&&
hotWords
.
map
(
hotWord
=>
{
return
(
<
CheckableTag
key
=
{
hotWord
}
checked
=
{
hotWord
===
keyword
}
onChange
=
{
checked
=>
{
const
{
domain
}
=
this
.
state
;
if
(
checked
)
{
this
.
setState
({
keyword
:
hotWord
});
onChange
&&
onChange
(
hotWord
,
domain
);
}
}}
>
{
hotWord
}
<
/CheckableTag
>
);
})
}
<
/Spin
>
<
/Col
>
<
/Row
>
...
...
src/view/Manage/Search/index.jsx
View file @
3acdde74
...
...
@@ -2,7 +2,7 @@ import React, { Component } from "react";
import
{
Card
,
Pagination
}
from
'antd'
;
import
{
SearchBar
}
from
'./components/SearchHelper'
;
import
AssetListCOM
from
'../Assets/components/AssetList'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
Latest
}
from
'../../../model'
;
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
class
SearchResult
extends
Component
{
...
...
@@ -13,7 +13,7 @@ class SearchResult extends Component {
getList
=
(
keyword
,
domain
,
pageNum
=
1
,
pageSize
=
10
)
=>
{
this
.
setState
({
keyword
,
domain
,
pageNum
,
pageSize
,
loading
:
true
},()
=>
{
dispatch
({
dispatch
Latest
({
type
:
'assets.searchTableModelsByPage'
,
payload
:
{
keyword
,
pageNum
,
domain
,
pageSize
},
callback
:
data
=>
{
...
...
src/view/Manage/index.jsx
View file @
3acdde74
...
...
@@ -6,11 +6,14 @@ import { GetSession } from "../../util";
import
{
ManageLayout
}
from
"../../layout"
;
import
Assets
from
'./Assets'
;
import
Search
from
'./Search'
;
import
Metadata
from
'../Metadata'
;
import
Indicator
from
'../Metadata/Indicator'
;
import
Standard
from
'../Metadata/Standard'
;
import
Subscrible
from
'../User/Subscrible'
;
import
Authorized
from
'../User/Authorized'
;
import
Question
from
'../User/Question'
;
import
Indicator
from
'../Metadata/Indicator'
;
import
Standard
from
'../Metadata/Standard'
;
class
Manage
extends
Component
{
constructor
()
{
...
...
@@ -36,6 +39,7 @@ class Manage extends Component {
component=
{
Search
}
/>
<
Route
path=
{
`${match.path}/assets`
}
component=
{
Assets
}
/>
<
Route
path=
{
`${match.path}/metadata`
}
component=
{
Metadata
}
/>
<
Route
path=
{
`${match.path}/indicator`
}
component=
{
Indicator
}
/>
<
Route
path=
{
`${match.path}/standard`
}
component=
{
Standard
}
/>
<
Route
path=
{
`${match.path}/subscrible`
}
component=
{
Subscrible
}
/>
...
...
src/view/Metadata/Indicator/components/MetadataTree.js
View file @
3acdde74
...
...
@@ -4,7 +4,7 @@ import React, { Component } from "react"
import
{
Tree
,
Card
,
Spin
,
Select
,
Row
}
from
'antd'
;
import
{
connect
}
from
'react-redux'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
const
{
Option
}
=
Select
;
...
...
@@ -29,7 +29,7 @@ class MetadataTreeCOM extends Component {
const
{
session
}
=
this
.
props
;
const
_this
=
this
;
dispatch
({
dispatch
Latest
({
type
:
'user.domains'
,
payload
:
{
userId
:
session
.
userId
...
...
@@ -72,7 +72,7 @@ class MetadataTreeCOM extends Component {
const
{
type
}
=
this
.
props
;
const
_this
=
this
;
dispatch
({
dispatch
Latest
({
type
:
'metadata.queryTopicAsTree'
,
payload
:
{
parentClass
:
'Catalog'
,
...
...
src/view/Metadata/Indicator/index.jsx
View file @
3acdde74
...
...
@@ -5,7 +5,7 @@ import { Row, Col, Card, Pagination, Input } from 'antd';
import
PageHeaderWrapper
from
"../../../layout/PageHeaderWrapper"
;
import
MetadataTreeCOM
from
"./components/MetadataTree"
;
import
MetadataListCOM
from
"./components/MetadataList"
;
import
{
dispatch
}
from
"../../../model"
;
import
{
dispatch
Latest
}
from
"../../../model"
;
import
"./style.less"
;
const
{
Search
}
=
Input
;
...
...
@@ -23,7 +23,7 @@ export default class Indicator extends Component {
this
.
setState
({
treeSelectId
,
pageNum
,
pageSize
,
loading
:
true
});
dispatch
({
dispatch
Latest
({
type
:
'metadata.tableModelsByPage'
,
payload
:
{
parentId
:
treeSelectId
,
pageNum
,
pageSize
,
name
:
keyword
,
model
:
'Indicator'
},
callback
:
data
=>
{
...
...
src/view/Metadata/Standard/index.jsx
View file @
3acdde74
...
...
@@ -5,7 +5,7 @@ import { Row, Col, Card, Pagination, Input } from 'antd';
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
import
MetadataTreeCOM
from
"../Indicator/components/MetadataTree"
;
import
MetadataListCOM
from
"../Indicator/components/MetadataList"
;
import
{
dispatch
}
from
"../../../model"
;
import
{
dispatch
Latest
}
from
"../../../model"
;
const
{
Search
}
=
Input
;
...
...
@@ -22,7 +22,7 @@ export default class Standard extends Component {
this
.
setState
({
treeSelectId
,
pageNum
,
pageSize
,
loading
:
true
});
dispatch
({
dispatch
Latest
({
type
:
'metadata.tableModelsByPage'
,
payload
:
{
parentId
:
treeSelectId
,
pageNum
,
pageSize
,
name
:
keyword
,
model
:
'DataStandard'
},
callback
:
data
=>
{
...
...
src/view/Metadata/index.jsx
0 → 100644
View file @
3acdde74
import
React
,
{
Component
}
from
"react"
;
import
{
Card
}
from
'antd'
;
import
PageHeaderWrapper
from
'../../layout/PageHeaderWrapper'
;
export
default
class
Metadata
extends
Component
{
render
()
{
return
(
<
PageHeaderWrapper
{
...
this
.
props
}
>
<
Card
bordered=
{
false
}
>
<
iframe
title=
"元数据"
src=
"/center-home/meta"
style=
{
{
width
:
'100%'
,
height
:
'741px'
,
border
:
0
}
}
/>
</
Card
>
</
PageHeaderWrapper
>
);
}
}
src/view/User/Authorized/index.jsx
View file @
3acdde74
import
React
,
{
Component
}
from
"react"
;
import
{
Card
,
Pagination
}
from
'antd'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
Latest
}
from
'../../../model'
;
import
{
paginate
}
from
'../../../util'
;
import
AssetListCOM
from
'../../Manage/Assets/components/AssetList'
;
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
...
...
@@ -20,7 +20,7 @@ export default class Authorized extends Component {
updateItems
()
{
this
.
setState
({
loading
:
true
},
()
=>
{
dispatch
({
dispatch
Latest
({
type
:
'user.listPrivilegeTableModels'
,
payload
:
{
},
callback
:
data
=>
{
...
...
src/view/User/Question/index.jsx
View file @
3acdde74
import
React
,
{
Component
}
from
"react"
;
import
{
Card
,
Table
,
Radio
,
Pagination
,
Input
}
from
'antd'
;
import
{
Card
,
Table
,
Radio
,
Pagination
,
Input
,
Button
}
from
'antd'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
export
default
class
Question
extends
Component
{
...
...
@@ -42,9 +43,9 @@ export default class Question extends Component {
{
title
:
'操作'
,
render
:
(
text
,
record
)
=>
(
<
a
onClick=
{
()
=>
{
this
.
onQuestionUpdate
(
record
);
}
}
>
<
Button
onClick=
{
()
=>
{
this
.
onQuestionUpdate
(
record
);
}
}
>
更新
</
a
>
</
Button
>
),
},
]
...
...
@@ -69,7 +70,7 @@ export default class Question extends Component {
payload
.
performance
=
type
;
}
dispatch
({
dispatch
Latest
({
type
:
'user.questions'
,
payload
:
payload
,
callback
:
data
=>
{
...
...
@@ -101,51 +102,54 @@ export default class Question extends Component {
render
()
{
const
{
keyword
,
type
,
loading
,
columns
,
items
,
pageNum
,
pageSize
,
total
}
=
this
.
state
;
return
(
<
Card
bordered=
{
false
}
title=
{
<
Input
.
Search
placeholder=
"请输入项目名称"
value=
{
keyword
}
onSearch=
{
this
.
onSearch
}
onChange=
{
e
=>
{
this
.
setState
({
keyword
:
e
.
target
.
value
});
}
}
/>
}
extra=
{
<
Radio
.
Group
value=
{
type
}
onChange=
{
this
.
onTypeChange
}
>
<
Radio
.
Button
value=
"all"
>
全部
</
Radio
.
Button
>
<
Radio
.
Button
value=
"confirm"
>
确认问题
</
Radio
.
Button
>
<
Radio
.
Button
value=
"dealing"
>
正在解决
</
Radio
.
Button
>
<
Radio
.
Button
value=
"solve"
>
解决问题
</
Radio
.
Button
>
</
Radio
.
Group
>
}
>
<
Table
rowKey=
"id"
columns=
{
columns
}
dataSource=
{
items
}
pagination=
{
false
}
loading=
{
loading
}
/>
<
Pagination
className=
"text-center"
showSizeChanger
showQuickJumper
onChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
getList
(
type
,
keyword
,
_pageNum
,
_pageSize
);
}
}
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
getList
(
type
,
keyword
,
_pageNum
,
_pageSize
);
}
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
total
}
/>
<
PageHeaderWrapper
{
...
this
.
props
}
>
<
Card
bordered=
{
false
}
title=
{
<
Input
.
Search
placeholder=
"请输入项目名称"
value=
{
keyword
}
onSearch=
{
this
.
onSearch
}
onChange=
{
e
=>
{
this
.
setState
({
keyword
:
e
.
target
.
value
});
}
}
style=
{
{
width
:
'300px'
}
}
/>
}
extra=
{
<
Radio
.
Group
value=
{
type
}
onChange=
{
this
.
onTypeChange
}
>
<
Radio
.
Button
value=
"all"
>
全部
</
Radio
.
Button
>
<
Radio
.
Button
value=
"confirm"
>
确认问题
</
Radio
.
Button
>
<
Radio
.
Button
value=
"dealing"
>
正在解决
</
Radio
.
Button
>
<
Radio
.
Button
value=
"solve"
>
解决问题
</
Radio
.
Button
>
</
Radio
.
Group
>
}
>
<
Table
rowKey=
"id"
columns=
{
columns
}
dataSource=
{
items
}
pagination=
{
false
}
loading=
{
loading
}
/>
<
Pagination
className=
"text-center"
showSizeChanger
showQuickJumper
onChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
getList
(
type
,
keyword
,
_pageNum
,
_pageSize
);
}
}
onShowSizeChange=
{
(
_pageNum
,
_pageSize
)
=>
{
this
.
getList
(
type
,
keyword
,
_pageNum
,
_pageSize
);
}
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
total
}
/>
</
Card
>
</
Card
>
</
PageHeaderWrapper
>
);
}
}
src/view/User/Subscrible/index.jsx
View file @
3acdde74
import
React
,
{
Component
}
from
"react"
;
import
{
Card
,
Pagination
}
from
'antd'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
Latest
}
from
'../../../model'
;
import
{
paginate
}
from
'../../../util'
;
import
AssetListCOM
from
'../../Manage/Assets/components/AssetList'
;
import
PageHeaderWrapper
from
'../../../layout/PageHeaderWrapper'
;
...
...
@@ -20,7 +20,7 @@ export default class Subscrible extends Component {
updateItems
()
{
this
.
setState
({
loading
:
true
},
()
=>
{
dispatch
({
dispatch
Latest
({
type
:
'user.getUserSubscribeTableModels'
,
payload
:
{
},
callback
:
data
=>
{
...
...
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