修改引用,增加搜索的位置

This commit is contained in:
暮光:城中城
2019-02-18 12:18:12 +08:00
parent 584afec6d2
commit 1f4008667c
2 changed files with 29 additions and 1 deletions

View File

@@ -3,6 +3,8 @@
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<!--无论发布在哪、如何修改源码,请勿删除本行原作者信息,感谢-->
<meta name="author" content="暮光城中城项目地址https://gitee.com/zyplayer/zyplayer-doc" />
<title>dubbo文档管理系统</title>
<link rel="shortcut icon" href="webjars/doc-dubbo/img/dubbo.ico"/>
<link rel="stylesheet" href="webjars/doc-dubbo/css/element-ui.css">
@@ -170,7 +172,7 @@
<script type="text/javascript" src="webjars/doc-dubbo/js/common.js"></script>
<script type="text/javascript" src="webjars/doc-dubbo/js/toast.js"></script>
<script type="text/javascript" src="webjars/doc-dubbo/js/formatjson.js"></script>
<script type="text/javascript" src="webjars/doc-dubbo/js/doc-wiki-tree.js"></script>
<script type="text/javascript" src="webjars/doc-dubbo/js/doc-dubbo-tree.js"></script>
<script>
var app = new Vue({

View File

@@ -126,6 +126,32 @@ function findInPathsValue(pathsValue, keywords) {
if (isNotEmpty(interface) && interface.toLowerCase().indexOf(keywords) >= 0) {
return true;
}
if (pathsValue.nodeList.length > 0) {
for (var i = 0; i < pathsValue.nodeList.length; i++) {
var node = pathsValue.nodeList[i];
if (getNotEmptyStr(node.application).toLowerCase().indexOf(keywords) >= 0) {
return true;
}
if (!!node.methods && node.methods.length > 0) {
for (var j = 0; j < node.methods.length; j++) {
var method = node.methods[j];
if (method.toLowerCase().indexOf(keywords) >= 0) {
return true;
}
var path = interface + "." + method;
var docInfo = app.dubboDocMap[path];
if (!!docInfo) {
if (getNotEmptyStr(docInfo.explain).toLowerCase().indexOf(keywords) >= 0) {
return true;
}
if (getNotEmptyStr(docInfo.result).toLowerCase().indexOf(keywords) >= 0) {
return true;
}
}
}
}
}
}
return false;
}