Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JDChain
Explorer
提交
d0c61c45
E
Explorer
项目概览
JDChain
/
Explorer
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Explorer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d0c61c45
编写于
12月 04, 2018
作者:
J
jinlong12
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码提交
上级
bec31dd4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
35 deletion
+89
-35
server/app.js
server/app.js
+86
-1
src/pages/search/search.t.html
src/pages/search/search.t.html
+2
-4
src/stores/SearchStore.js
src/stores/SearchStore.js
+1
-30
未找到文件。
server/app.js
浏览文件 @
d0c61c45
...
...
@@ -78,6 +78,91 @@ app.use('/search', search);
//{pages}//
app
.
post
(
'
/common/getLoginInfo
'
,
function
(
req
,
res
)
{
res
.
type
(
'
json
'
);
let
params
=
req
.
body
,
ret
=
{};
const
datas
=
_
.
times
(
100
,
function
(
i
)
{
let
num
=
i
+
1
;
return
{
test1
:
num
+
100000
,
test2
:
'
测试
'
+
num
,
test4
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test5
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test6
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test8
:
_
.
random
(
1
,
10
),
test9
:
_
.
random
(
1
,
10
),
test10
:
_
.
random
(
1
,
10
),
test11
:
_
.
random
(
1
,
10
),
test12
:
_
.
random
(
1
,
10
),
test14
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test15
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test16
:
_
.
random
(
1
,
24
),
test17
:
_
.
random
(
10
,
90
)
+
'
%
'
,
test18
:
_
.
random
(
1
,
100000
)
};
});
const
pageIndex
=
params
.
currentPage
,
pageSize
=
params
.
pageSize
,
start
=
(
pageIndex
-
1
)
*
pageSize
,
end
=
pageIndex
*
pageSize
,
data
=
datas
.
filter
((
obj
,
i
)
=>
{
if
(
i
>=
start
&&
i
<
end
)
{
return
true
;
}
});
Object
.
assign
({
"
message
"
:
"
OK
"
,
"
data
"
:
{
"
blocks
"
:
[{
"
hash_id
"
:
"
6Kw7g7pXTF89UXUNrbC4GQtjwrhguTSvCJicAbBCTiJMG
"
,
"
height
"
:
1
},
{
"
hash_id
"
:
"
68WiytpLnQYZamD9HSAaPGToUu2i7q3MZnSHQVD1tBhN4
"
,
"
height
"
:
2
},
{
"
hash_id
"
:
"
682tzY4JXr6ZByH5hMfKX4w8CJYUH3gKskNRP6UNgT7si
"
,
"
height
"
:
3
},
{
"
hash_id
"
:
"
682nAtP3QaisaQ5ZBXjMTeNPCEn27jJrB7zMF2wt3ScGB
"
,
"
height
"
:
4
},
{
"
hash_id
"
:
"
682FXSCzrgES1MQQthyuWFbyMpLDTHv5MbcK5M2hD2ucn
"
,
"
height
"
:
5
}],
"
txs
"
:
null
}
});
res
.
send
({
"
message
"
:
"
OK
"
,
"
data
"
:
{
"
blocks
"
:
[{
"
hash_id
"
:
"
6Kw7g7pXTF89UXUNrbC4GQtjwrhguTSvCJicAbBCTiJMG
"
,
"
height
"
:
1
},
{
"
hash_id
"
:
"
68WiytpLnQYZamD9HSAaPGToUu2i7q3MZnSHQVD1tBhN4
"
,
"
height
"
:
2
},
{
"
hash_id
"
:
"
682tzY4JXr6ZByH5hMfKX4w8CJYUH3gKskNRP6UNgT7si
"
,
"
height
"
:
3
},
{
"
hash_id
"
:
"
682nAtP3QaisaQ5ZBXjMTeNPCEn27jJrB7zMF2wt3ScGB
"
,
"
height
"
:
4
},
{
"
hash_id
"
:
"
682FXSCzrgES1MQQthyuWFbyMpLDTHv5MbcK5M2hD2ucn
"
,
"
height
"
:
5
}],
"
txs
"
:
null
}
});
});
app
.
get
(
'
/api/v1/search
'
,
function
(
req
,
res
)
{
res
.
type
(
'
json
'
);
let
ret
=
{};
...
...
@@ -86,7 +171,7 @@ app.post('/common/getLoginInfo', function(req, res) {
});
res
.
send
(
ret
);
})
;
})
let
server
=
app
.
listen
(
configs
.
port
,
function
()
{
let
host
=
server
.
address
().
address
;
...
...
src/pages/search/search.t.html
浏览文件 @
d0c61c45
<template
name=
"dataTable"
class=
"{styles.content}"
>
<h2
class=
"fjb-title"
>
区块搜索
</h2>
<div
>
{searchItem()}
<ant-Button>
搜索
</ant-Button>
<div>
123
</div>
</template>
\ No newline at end of file
src/stores/SearchStore.js
浏览文件 @
d0c61c45
...
...
@@ -4,34 +4,5 @@ import { autobind } from 'core-decorators';
import
{
Notification
}
from
'
flarej/lib/components/antd/notification
'
;
export
default
class
SearchStore
{
@
observable
pageIndex
=
1
;
@
observable
pageSize
=
10
;
@
observable
count
=
0
;
@
observable
tableData
=
[];
@
autobind
@
action
getTableData
(
currentPage
=
this
.
pageIndex
,
pageSize
=
this
.
pageSize
)
{
return
fetchData
(
`
${
G_WEB_DOMAIN
}
/search/getTableData`
,
result
=>
{
transaction
(()
=>
{
if
(
result
.
success
)
{
this
.
pageIndex
=
currentPage
;
this
.
pageSize
=
pageSize
;
this
.
count
=
result
.
totalCount
;
this
.
tableData
=
result
.
data
;
}
else
{
this
.
pageIndex
=
1
;
this
.
pageSize
=
10
;
this
.
count
=
0
;
this
.
tableData
=
[];
Notification
.
error
({
description
:
'
获取表格数据出错,异常是:
'
+
result
.
msg
,
duration
:
null
});
}
});
},
{
currentPage
,
pageSize
,
},
{
method
:
'
post
'
}).
catch
((
ex
)
=>
{
Notification
.
error
({
description
:
'
获取表格数据出错,错误是:
'
+
ex
,
duration
:
null
});
});
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录