Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ycc-website
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Website
ycc-website
Commits
7f19fb15
Commit
7f19fb15
authored
Feb 07, 2022
by
chenqikuai
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:blockDetail overview
parent
5ec341a3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
50 deletions
+111
-50
LeftBox.vue
...components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
+20
-10
RightBox.vue
...omponents/pc/BlockChainBrowser/BlockOverview/RightBox.vue
+4
-0
index.vue
src/components/pc/BlockChainBrowser/BlockOverview/index.vue
+12
-5
blockDetail.ts
src/mixin/blockDetail.ts
+64
-0
blockDetail.vue
src/views/pc/blockDetail.vue
+11
-35
No files found.
src/components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
View file @
7f19fb15
<
template
>
<
template
>
<div
class=
"left-box"
:style=
"
{ backgroundImage: `url(${leftBoxbgPng})` }">
<div
class=
"left-box"
:style=
"
{ backgroundImage: `url(${leftBoxbgPng})` }"
v-loading="loading"
element-loading-text="Loading..."
element-loading-spinner="el-icon-loading"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"flex left overflow-hidden flex-shrink-0"
>
<div
class=
"flex left overflow-hidden flex-shrink-0"
>
<img
<img
...
@@ -12,7 +18,7 @@
...
@@ -12,7 +18,7 @@
区块高度
区块高度
</div>
</div>
<div
class=
"my-block-height overflow-hidden overflow-ellipsis"
>
<div
class=
"my-block-height overflow-hidden overflow-ellipsis"
>
09238409823094820394808
{{
$route
.
query
.
height
}}
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -32,34 +38,34 @@
...
@@ -32,34 +38,34 @@
交易数量
交易数量
</div>
</div>
<div
class=
"my-benifit"
>
<div
class=
"my-benifit"
>
13
{{
data
.
txCount
}}
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex items-center"
style=
"margin-top: 35px;"
>
<div
class=
"flex items-center"
style=
"margin-top: 35px;"
>
<div
class=
"my-title theTitle"
>
时间戳
</div>
<div
class=
"my-title theTitle"
>
时间戳
</div>
<div
class=
"my-content1"
>
2021-11-23
</div>
<div
class=
"my-content1"
>
{{
data
.
blockTime
|
formatTime
}}
</div>
</div>
</div>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<div
class=
"my-title theTitle"
>
区块哈希
</div>
<div
class=
"my-title theTitle"
>
区块哈希
</div>
<div
class=
"my-content1"
>
<div
class=
"my-content1"
>
0xf9807e9f0d272ea0109a69f6360f53291783bac47569a8bc988a06ae9c50f8ae
{{
data
.
hash
}}
</div>
</div>
<copy-btn
:copyTxt=
"
10293809128
"
class=
"ml-4"
>
复制
</copy-btn>
<copy-btn
:copyTxt=
"
data.hash
"
class=
"ml-4"
>
复制
</copy-btn>
</div>
</div>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<div
class=
"my-title theTitle"
>
默克尔根
</div>
<div
class=
"my-title theTitle"
>
默克尔根
</div>
<div
class=
"my-content1"
>
<div
class=
"my-content1"
>
0x1d4b6d53da04f9a817c1c183d8b4a7fbb47b35ccdf286de3fb27473362684a19
{{
data
.
txHash
}}
</div>
</div>
<copy-btn
:copyTxt=
"
10293809128
"
class=
"ml-4"
>
复制
</copy-btn>
<copy-btn
:copyTxt=
"
data.txHash
"
class=
"ml-4"
>
复制
</copy-btn>
</div>
</div>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<div
class=
"my-title theTitle"
>
状态哈希
</div>
<div
class=
"my-title theTitle"
>
状态哈希
</div>
<div
class=
"my-content1"
>
<div
class=
"my-content1"
>
0x2ea9289ef78e17448c00aa3857f0fefd64191fc7dcc4ea524236be14efc7ad44
{{
data
.
stateHash
}}
</div>
</div>
<copy-btn
:copyTxt=
"
10293809128
"
class=
"ml-4"
>
复制
</copy-btn>
<copy-btn
:copyTxt=
"
data.stateHash
"
class=
"ml-4"
>
复制
</copy-btn>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -71,6 +77,10 @@ import Vue from 'vue'
...
@@ -71,6 +77,10 @@ import Vue from 'vue'
import
CopyBtn
from
'../../CopyBtn.vue'
import
CopyBtn
from
'../../CopyBtn.vue'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
components
:
{
CopyBtn
},
components
:
{
CopyBtn
},
props
:
{
data
:
Object
,
loading
:
Boolean
,
},
data
()
{
data
()
{
return
{
return
{
leftBoxbgPng
,
leftBoxbgPng
,
...
...
src/components/pc/BlockChainBrowser/BlockOverview/RightBox.vue
View file @
7f19fb15
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
backgroundImage: `url(${url})`,
backgroundImage: `url(${url})`,
backgroundPosition: backgroundPosition,
backgroundPosition: backgroundPosition,
}"
}"
v-loading="loading"
element-loading-text="Loading..."
element-loading-spinner="el-icon-loading"
>
>
<div
class=
"my-title mt-11"
>
<div
class=
"my-title mt-11"
>
{{
type
===
'last'
?
'上个区块'
:
'下个区块'
}}
{{
type
===
'last'
?
'上个区块'
:
'下个区块'
}}
...
@@ -29,6 +32,7 @@ export default Vue.extend({
...
@@ -29,6 +32,7 @@ export default Vue.extend({
props
:
{
props
:
{
type
:
String
as
PropType
<
'last'
|
'next'
>
,
type
:
String
as
PropType
<
'last'
|
'next'
>
,
height
:
[
Number
,
String
],
height
:
[
Number
,
String
],
loading
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
...
...
src/components/pc/BlockChainBrowser/BlockOverview/index.vue
View file @
7f19fb15
<
template
>
<
template
>
<div
class=
"block-overview flex justify-between"
>
<div
class=
"block-overview flex justify-between"
>
<left-box></left-box>
<left-box
:data=
"data"
:loading=
"loading"
></left-box>
<div
class=
"h-full"
>
<div
class=
"h-full"
>
<right-box
<right-box
:loading=
"loading"
type=
"last"
type=
"last"
style=
"margin-bottom: 30px;"
style=
"margin-bottom: 30px;"
:height=
"lastHeight"
:height=
"data.lastBlockHeight"
></right-box>
<right-box
type=
"next"
:loading=
"loading"
:height=
"data.nextBlockHeight"
:init=
"init"
></right-box>
></right-box>
<right-box
type=
"next"
:height=
"nextHeight"
></right-box>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -23,8 +29,9 @@ export default Vue.extend({
...
@@ -23,8 +29,9 @@ export default Vue.extend({
RightBox
,
RightBox
,
},
},
props
:
{
props
:
{
lastHeight
:
Number
,
data
:
Object
,
nextHeight
:
Number
,
init
:
Function
,
loading
:
Boolean
,
},
},
})
})
</
script
>
</
script
>
...
...
src/mixin/blockDetail.ts
0 → 100644
View file @
7f19fb15
import
{
searchInputPlaceholder
}
from
"@/constant"
;
import
{
getRpc
}
from
"ycc-api/src/service/Rpc"
;
import
{
getBlockDetail
}
from
"ycc-api/src/service/blockDetail/index"
;
import
Vue
from
"vue"
;
const
Rpc
=
getRpc
(
"/yccApi"
);
export
default
Vue
.
extend
({
data
()
{
return
{
searchInputPlaceholder
,
searchValue
:
""
,
tabList
:
[
{
name
:
"交易记录"
,
value
:
"1"
},
{
name
:
"共识节点"
,
value
:
"2"
},
],
focusedTab
:
"1"
,
optionList
:
[
{
name
:
"交易记录"
,
value
:
"1"
},
{
name
:
"共识节点"
,
value
:
"2"
},
],
selectedOption
:
"1"
,
overview
:
{
txCount
:
""
,
blockTime
:
0
,
hash
:
""
,
stateHash
:
""
,
txHash
:
""
,
lastBlockHeight
:
0
,
nextBlockHeight
:
0
,
},
loadingOverview
:
false
,
};
},
methods
:
{
selectOption
(
v
:
string
)
{
this
.
selectedOption
=
v
;
},
clickSearch
(
v
:
string
)
{
console
.
log
(
v
,
" show search value"
);
},
setSearchValue
(
v
:
string
)
{
this
.
searchValue
=
v
;
},
setFocusedTab
(
v
:
string
)
{
this
.
focusedTab
=
v
;
},
async
init
()
{
this
.
loadingOverview
=
true
;
const
{
overview
,
txs
}
=
(
await
getBlockDetail
(
"ycc"
,
"/yccApi"
,
{
height
:
Number
(
this
.
$route
.
query
.
height
),
}))
||
{};
overview
&&
(
this
.
overview
=
overview
);
this
.
loadingOverview
=
false
;
},
},
async
mounted
()
{
this
.
init
();
},
watch
:
{
"$route.query.height"
(
newV
,
oldV
)
{
this
.
init
();
},
},
});
src/views/pc/blockDetail.vue
View file @
7f19fb15
...
@@ -7,7 +7,12 @@
...
@@ -7,7 +7,12 @@
:value=
"searchValue"
:value=
"searchValue"
:setValue=
"setSearchValue"
:setValue=
"setSearchValue"
></chain-search>
></chain-search>
<block-overview
style=
"margin-top: 30px;"
></block-overview>
<block-overview
style=
"margin-top: 30px;"
:data=
"overview"
:init=
"init"
:loading=
"loadingOverview"
></block-overview>
<TabList
<TabList
:tabList=
"tabList"
:tabList=
"tabList"
:setFocusedTab=
"(v) => (focusedTab = v)"
:setFocusedTab=
"(v) => (focusedTab = v)"
...
@@ -22,7 +27,7 @@
...
@@ -22,7 +27,7 @@
共找到13笔交易
共找到13笔交易
</
template
>
</
template
>
</DataFilter>
</DataFilter>
<
TradeTable></TradeTable
>
<
!-- <TradeTable></TradeTable> --
>
</div>
</div>
</template>
</template>
...
@@ -30,10 +35,10 @@
...
@@ -30,10 +35,10 @@
import
ChainSearch
from
'@/components/pc/BlockChainBrowser/ChainSearch.vue'
import
ChainSearch
from
'@/components/pc/BlockChainBrowser/ChainSearch.vue'
import
BlockOverview
from
'@/components/pc/BlockChainBrowser/BlockOverview/index.vue'
import
BlockOverview
from
'@/components/pc/BlockChainBrowser/BlockOverview/index.vue'
import
TabList
from
'@/components/pc/BlockChainBrowser/TabList/index.vue'
import
TabList
from
'@/components/pc/BlockChainBrowser/TabList/index.vue'
import
{
searchInputPlaceholder
}
from
'@/constant'
import
DataFilter
from
'@/components/pc/BlockChainBrowser/DataFilter/index.vue'
import
DataFilter
from
'@/components/pc/BlockChainBrowser/DataFilter/index.vue'
import
TradeTable
from
'@/components/pc/BlockChainBrowser/TradeTable/index.vue'
//
import TradeTable from '@/components/pc/BlockChainBrowser/TradeTable/index.vue'
import
Vue
from
'vue'
import
Vue
from
'vue'
import
blockDetailMixin
from
'@/mixin/blockDetail'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
components
:
{
components
:
{
...
@@ -41,38 +46,9 @@ export default Vue.extend({
...
@@ -41,38 +46,9 @@ export default Vue.extend({
BlockOverview
,
BlockOverview
,
TabList
,
TabList
,
DataFilter
,
DataFilter
,
TradeTable
,
// TradeTable,
},
data
()
{
return
{
searchInputPlaceholder
,
searchValue
:
''
,
tabList
:
[
{
name
:
'交易记录'
,
value
:
'1'
},
{
name
:
'共识节点'
,
value
:
'2'
},
],
focusedTab
:
'1'
,
optionList
:
[
{
name
:
'交易记录'
,
value
:
'1'
},
{
name
:
'共识节点'
,
value
:
'2'
},
],
selectedOption
:
'1'
,
}
},
methods
:
{
selectOption
(
v
:
string
)
{
this
.
selectedOption
=
v
},
clickSearch
(
v
:
string
)
{
console
.
log
(
v
,
' show search value'
)
},
setSearchValue
(
v
:
string
)
{
this
.
searchValue
=
v
},
setFocusedTab
(
v
:
string
)
{
this
.
focusedTab
=
v
},
},
},
mixins
:
[
blockDetailMixin
],
})
})
</
script
>
</
script
>
...
...
chenqikuai
@chenqikuai
mentioned in commit
748f7ae1
·
Mar 03, 2022
mentioned in commit
748f7ae1
mentioned in commit 748f7ae18ac2f8eb14ee7c2865eaea786342a520
Toggle commit list
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