no message

doctree
zcy 2022-04-18 22:58:29 +08:00
parent fa155ecde1
commit 0684f4ebc0
3 changed files with 38 additions and 3 deletions

View File

@ -188,6 +188,7 @@ class NewUi extends Controller
"group_types"=>$groupstype,
"title"=>urldecode ($this->querys['title']),
"doc"=>$doc[0],
"docs"=>$doc,
"comments" => $doccoment,
"comment_count" => count($doccoment),
"doc_type"=>$doc[0]["type"],
@ -195,7 +196,6 @@ class NewUi extends Controller
"topdoc"=>$top5,
"openapi"=>\App\Config::OpenApiUrl(),
"treedoc"=>$doc_all,
]);
else
View::renderTemplate("/blog/article.html", [
@ -209,6 +209,7 @@ class NewUi extends Controller
"group_types"=>$groupstype,
"title"=>urldecode ($this->querys['title']),
"doc"=>$doc[0],
"docs"=>$doc,
"comments" => $doccoment,
"comment_count" => count($doccoment),
"doc_type"=>$doc[0]["type"],
@ -216,7 +217,6 @@ class NewUi extends Controller
"topdoc"=>$top5,
"openapi"=>\App\Config::OpenApiUrl(),
"treedoc"=>$doc_all,
]);
} else {
View::renderTemplate("/blog/article.html", ['title' => 'test', 'index' => false]);

View File

@ -53,6 +53,8 @@
</div>
</form>
</li>
<a id="expandAllBtn" href="#" title="不管你有多NB统统都要听我的"
onclick="return false;" style="margin-left: 25px;margin-top: 20px;">展开</a>
</ul>
</div>
<div id='testdiv' style='height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;'>

View File

@ -1,5 +1,37 @@
{% block newartile %}
<SCRIPT type="text/javascript">
function expandNode(e) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
type = e.data.type,
nodes = zTree.getSelectedNodes();
if (type.indexOf("All")<0 && nodes.length == 0) {
alert("请先选择一个父节点");
}
if (type == "expandAll") {
zTree.expandAll(true);
} else if (type == "collapseAll") {
zTree.expandAll(false);
} else {
var callbackFlag = $("#callbackTrigger").attr("checked");
for (var i=0, l=nodes.length; i<l; i++) {
zTree.setting.view.fontCss = {};
if (type == "expand") {
zTree.expandNode(nodes[i], true, null, null, callbackFlag);
} else if (type == "collapse") {
zTree.expandNode(nodes[i], false, null, null, callbackFlag);
} else if (type == "toggle") {
zTree.expandNode(nodes[i], null, null, null, callbackFlag);
} else if (type == "expandSon") {
zTree.expandNode(nodes[i], true, true, null, callbackFlag);
} else if (type == "collapseSon") {
zTree.expandNode(nodes[i], false, true, null, callbackFlag);
}
}
}
}
function onMouseDown(event, treeId, treeNode) {
console.log(event,treeId,treeNode)
}
@ -21,7 +53,8 @@
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting, znode);
var obj = $('#treeDemo' + "{{id}}" + "_span");
console.log("fasdfasdfasdfsad",obj);
$("#expandAllBtn").bind("click", {type:"expandAll"}, expandNode);
});
</SCRIPT>