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
4e516143
Commit
4e516143
authored
Feb 28, 2022
by
chenqikuai
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c2a54a0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
34 deletions
+24
-34
.eslintrc.js
.eslintrc.js
+11
-11
chartsInAddr.vue
src/components/chartsInAddr.vue
+3
-16
blockChainBrowser.ts
src/mixin/blockChainBrowser.ts
+7
-6
index.ts
src/service/index.ts
+3
-1
No files found.
.eslintrc.js
View file @
4e516143
module
.
exports
=
{
module
.
exports
=
{
root
:
true
,
root
:
true
,
env
:
{
env
:
{
node
:
true
node
:
true
,
},
},
'extends'
:
[
extends
:
[
'plugin:vue/essential'
,
"plugin:vue/essential"
,
'eslint:recommended'
,
"eslint:recommended"
,
'@vue/typescript/recommended'
"@vue/typescript/recommended"
,
],
],
parserOptions
:
{
parserOptions
:
{
ecmaVersion
:
2020
ecmaVersion
:
2020
,
},
},
rules
:
{
rules
:
{
'no-console'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
"no-console"
:
process
.
env
.
NODE_ENV
===
"production"
?
"warn"
:
"off"
,
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
"no-debugger"
:
process
.
env
.
NODE_ENV
===
"production"
?
"warn"
:
"off"
,
"@typescript-eslint/explicit-module-boundary-types"
:
'off'
"@typescript-eslint/explicit-module-boundary-types"
:
"off"
,
}
}
,
}
}
;
src/components/chartsInAddr.vue
View file @
4e516143
...
@@ -7,37 +7,23 @@ import * as echarts from 'echarts/core'
...
@@ -7,37 +7,23 @@ import * as echarts from 'echarts/core'
import
{
import
{
BarChart
,
BarChart
,
// 系列类型的定义后缀都为 SeriesOption
// 系列类型的定义后缀都为 SeriesOption
BarSeriesOption
,
LineChart
,
LineChart
,
LineSeriesOption
,
}
from
'echarts/charts'
}
from
'echarts/charts'
import
{
import
{
TitleComponent
,
TitleComponent
,
// 组件类型的定义后缀都为 ComponentOption
// 组件类型的定义后缀都为 ComponentOption
TitleComponentOption
,
TooltipComponent
,
TooltipComponent
,
TooltipComponentOption
,
GridComponent
,
GridComponent
,
GridComponentOption
,
// 数据集组件
// 数据集组件
DatasetComponent
,
DatasetComponent
,
DatasetComponentOption
,
// 内置数据转换器组件 (filter, sort)
// 内置数据转换器组件 (filter, sort)
TransformComponent
,
TransformComponent
,
}
from
'echarts/components'
}
from
'echarts/components'
import
{
LabelLayout
,
UniversalTransition
}
from
'echarts/features'
import
{
LabelLayout
,
UniversalTransition
}
from
'echarts/features'
import
{
CanvasRenderer
}
from
'echarts/renderers'
import
{
CanvasRenderer
}
from
'echarts/renderers'
import
{
getAccountRecords
,
statSearch
}
from
'@/service/api'
import
{
getAccountRecords
}
from
'@/service/api'
import
moment
from
'moment'
import
moment
from
'moment'
// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
type
ECOption
=
echarts
.
ComposeOption
<
|
BarSeriesOption
|
LineSeriesOption
|
TitleComponentOption
|
TooltipComponentOption
|
GridComponentOption
|
DatasetComponentOption
>
// 注册必须的组件
// 注册必须的组件
echarts
.
use
([
echarts
.
use
([
...
@@ -112,6 +98,7 @@ export default VueTypedMixins(chartsMixin).extend({
...
@@ -112,6 +98,7 @@ export default VueTypedMixins(chartsMixin).extend({
series
:
[
series
:
[
{
{
data
:
this
.
xData
data
:
this
.
xData
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.
map
((
i
:
any
)
=>
(
i
&&
i
[
0
]
&&
i
[
0
].
balance
)
||
0
)
.
map
((
i
:
any
)
=>
(
i
&&
i
[
0
]
&&
i
[
0
].
balance
)
||
0
)
.
map
((
i
)
=>
i
/
1
e8
)
.
map
((
i
)
=>
i
/
1
e8
)
.
reverse
(),
.
reverse
(),
...
@@ -129,7 +116,7 @@ export default VueTypedMixins(chartsMixin).extend({
...
@@ -129,7 +116,7 @@ export default VueTypedMixins(chartsMixin).extend({
this
.
draw
()
this
.
draw
()
},
},
watch
:
{
watch
:
{
scale
(
v
)
{
scale
()
{
this
.
draw
()
this
.
draw
()
},
},
},
},
...
...
src/mixin/blockChainBrowser.ts
View file @
4e516143
...
@@ -76,6 +76,7 @@ export default Vue.extend({
...
@@ -76,6 +76,7 @@ export default Vue.extend({
fetchLatestTxListData
()
{
fetchLatestTxListData
()
{
getTxList
(
1
,
6
).
then
((
ret
)
=>
{
getTxList
(
1
,
6
).
then
((
ret
)
=>
{
if
(
!
ret
.
error
)
{
if
(
!
ret
.
error
)
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this
.
latestTxs
=
ret
.
result
.
map
((
i
:
any
)
=>
({
this
.
latestTxs
=
ret
.
result
.
map
((
i
:
any
)
=>
({
...
i
,
...
i
,
hash
:
i
.
hash
,
hash
:
i
.
hash
,
...
@@ -128,7 +129,7 @@ export default Vue.extend({
...
@@ -128,7 +129,7 @@ export default Vue.extend({
((
" "
((
" "
.
repeat
(
5
)
.
repeat
(
5
)
.
split
(
" "
)
.
split
(
" "
)
.
map
((
i
)
=>
({}))
as
unknown
)
as
iBlockMsg
[]);
.
map
(()
=>
({}))
as
unknown
)
as
iBlockMsg
[]);
return
getLatestBlock
(
"ycc"
,
"/yccApi"
).
then
((
ret
)
=>
{
return
getLatestBlock
(
"ycc"
,
"/yccApi"
).
then
((
ret
)
=>
{
this
.
latestBlocks
=
ret
||
[];
this
.
latestBlocks
=
ret
||
[];
return
ret
;
return
ret
;
...
@@ -192,26 +193,26 @@ export default Vue.extend({
...
@@ -192,26 +193,26 @@ export default Vue.extend({
// 100 亿+30*725000 + 15*(当前高度-725000)
// 100 亿+30*725000 + 15*(当前高度-725000)
return
100
*
1
e8
+
30
*
725000
+
15
*
(
this
.
latestHeight
-
725000
);
return
100
*
1
e8
+
30
*
725000
+
15
*
(
this
.
latestHeight
-
725000
);
},
},
msgList
():
any
[]
{
msgList
():
{
icon
:
string
;
title
:
string
;
number
:
number
}
[]
{
return
[
return
[
{
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/latestBlock.png"
),
icon
:
require
(
"@/assets/images/blockChainBrowser/home/latestBlock.png"
),
title
:
this
.
$t
(
"lang.chainMsg.latestBlock"
),
title
:
this
.
$t
(
"lang.chainMsg.latestBlock"
)
as
string
,
number
:
this
.
latestHeight
,
number
:
this
.
latestHeight
,
},
},
{
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/nodeNumber.png"
),
icon
:
require
(
"@/assets/images/blockChainBrowser/home/nodeNumber.png"
),
title
:
this
.
$t
(
"lang.chainMsg.nodeNum"
),
title
:
this
.
$t
(
"lang.chainMsg.nodeNum"
)
as
string
,
number
:
this
.
nodeNum
,
number
:
this
.
nodeNum
,
},
},
{
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/circulateNumber.png"
),
icon
:
require
(
"@/assets/images/blockChainBrowser/home/circulateNumber.png"
),
title
:
this
.
$t
(
"lang.chainMsg.circulation"
),
title
:
this
.
$t
(
"lang.chainMsg.circulation"
)
as
string
,
number
:
this
.
circulationNum
,
number
:
this
.
circulationNum
,
},
},
{
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/pledgeQuantity.png"
),
icon
:
require
(
"@/assets/images/blockChainBrowser/home/pledgeQuantity.png"
),
title
:
this
.
$t
(
"lang.chainMsg.pledgeQuantity"
),
title
:
this
.
$t
(
"lang.chainMsg.pledgeQuantity"
)
as
string
,
number
:
this
.
ticketCount
,
number
:
this
.
ticketCount
,
},
},
];
];
...
...
src/service/index.ts
View file @
4e516143
export
function
axios
<
T
>
(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export
function
axios
<
T
=
iJrpcRet
<
any
>>
(
url
:
string
,
url
:
string
,
config
:
{
config
:
{
method
:
string
;
method
:
string
;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
params
:
any
;
params
:
any
;
}
}
):
Promise
<
T
>
{
):
Promise
<
T
>
{
...
...
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