no message
parent
ba10cd9f67
commit
853147c7a4
|
@ -19,38 +19,9 @@ class NewUi extends Controller
|
|||
$typedocs = $docModel->getAllTypeDocs();
|
||||
$titles = $docModel->AllTitle();
|
||||
$groups = $docModel->getGroups();
|
||||
$doc_all = $docModel->getArticlesTree();
|
||||
$doc_all = $docModel->getArticlesTree(-1);
|
||||
|
||||
$mapforbuildtree = [];
|
||||
$articletree = [];
|
||||
echo("<pre>");
|
||||
|
||||
foreach ($doc_all as $key => $value){
|
||||
$tmp = array(
|
||||
'name' => $value['title'],
|
||||
'children' => array(),
|
||||
'id' =>$value['id'],
|
||||
'isParent'=> false,
|
||||
);
|
||||
$mapforbuildtree[$value['id']] = $tmp;
|
||||
}
|
||||
foreach ($doc_all as $key => $value){
|
||||
if($value['father'] != 0){
|
||||
array_push($mapforbuildtree[$value['father']]['children'],
|
||||
$mapforbuildtree[$value['id']]);
|
||||
$mapforbuildtree[$value['father']]["isParent"] = true;
|
||||
|
||||
}
|
||||
}
|
||||
foreach ($doc_all as $key => $value){
|
||||
if($value['level'] == 0){
|
||||
array_push($articletree,$mapforbuildtree[$value['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
$dat = json_encode ( $articletree ,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE );
|
||||
// var_dump($dat);
|
||||
echo("</pre>");
|
||||
|
||||
$groupstype = $docModel->GetAllGroupType();
|
||||
if(sizeof($this->params) == 2){
|
||||
|
@ -84,7 +55,7 @@ class NewUi extends Controller
|
|||
"topdoc"=>$top5,
|
||||
"title"=>"博客",
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$dat,
|
||||
"treedoc"=>$doc_all,
|
||||
]);
|
||||
else{
|
||||
View::renderTemplate("/blog/index.html",[
|
||||
|
@ -100,7 +71,7 @@ class NewUi extends Controller
|
|||
"topdoc"=>$top5,
|
||||
"title"=>"博客",
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$dat,
|
||||
"treedoc"=>$doc_all,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -111,18 +82,20 @@ class NewUi extends Controller
|
|||
|
||||
}
|
||||
$docModel = new Models\Doc();
|
||||
$firstpagedocs = [];
|
||||
$typedocs = $docModel->getAllTypeDocs();
|
||||
$doc = $docModel->doc((int)$this->params[0]);
|
||||
$titles = $docModel->AllTitle();
|
||||
$groups = $docModel->getGroups();
|
||||
$groupstype = $docModel->GetAllGroupType();
|
||||
$doc_all = $docModel->getArticlesTree((int)$this->params[0]);
|
||||
|
||||
$fisrtpage = $docModel->pageDoc(5,0,55);
|
||||
$markdown = new \ParsedownToC();
|
||||
$doc[0]['content'] = $markdown->body($doc[0]['content']);
|
||||
$doc[0]['toc'] = $markdown->contentsList();
|
||||
$top5 = $docModel->top5Doc();
|
||||
$firstpagedocs = [];
|
||||
$typedocs = $docModel->getAllTypeDocs();
|
||||
$doc = $docModel->doc((int)$this->params[0]);
|
||||
$titles = $docModel->AllTitle();
|
||||
$groups = $docModel->getGroups();
|
||||
$groupstype = $docModel->GetAllGroupType();
|
||||
|
||||
$fisrtpage = $docModel->pageDoc(5,0,55);
|
||||
$markdown = new \ParsedownToC();
|
||||
$doc[0]['content'] = $markdown->body($doc[0]['content']);
|
||||
$doc[0]['toc'] = $markdown->contentsList();
|
||||
$top5 = $docModel->top5Doc();
|
||||
|
||||
foreach ($fisrtpage as $key => $value) {
|
||||
$obj['title'] = $value['title'];
|
||||
|
@ -152,6 +125,8 @@ class NewUi extends Controller
|
|||
"group_type"=>$docModel->TypeGroup($doc[0]["type"])[0][0],
|
||||
"topdoc"=>$top5,
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$doc_all,
|
||||
|
||||
]);
|
||||
}
|
||||
else{
|
||||
|
@ -172,6 +147,8 @@ class NewUi extends Controller
|
|||
"group_type"=>$docModel->TypeGroup($doc[0]["type"])[0][0],
|
||||
"topdoc"=>$top5,
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$doc_all,
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -179,9 +156,12 @@ class NewUi extends Controller
|
|||
{
|
||||
if (sizeof($this->querys) != 0) {
|
||||
$docModel = new Models\Doc();
|
||||
|
||||
$commentModel = new Models\DocComment();
|
||||
$doc = $docModel->titleDoc(rawurldecode($this->querys['title']));
|
||||
$id = $doc[0]["id"];
|
||||
$doc_all = $docModel->getArticlesTree($doc[0]["id"]);
|
||||
|
||||
$markdown = new \ParsedownToC();
|
||||
$doc[0]['content'] = $markdown->body($doc[0]['content']);
|
||||
|
||||
|
@ -211,6 +191,7 @@ class NewUi extends Controller
|
|||
"group_type"=>$docModel->TypeGroup($doc[0]["type"])[0][0],
|
||||
"topdoc"=>$top5,
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$doc_all,
|
||||
|
||||
]);
|
||||
else
|
||||
|
@ -231,6 +212,8 @@ class NewUi extends Controller
|
|||
"group_type"=>$docModel->TypeGroup($doc[0]["type"])[0][0],
|
||||
"topdoc"=>$top5,
|
||||
"openapi"=>\App\Config::OpenApiUrl(),
|
||||
"treedoc"=>$doc_all,
|
||||
|
||||
]);
|
||||
} else {
|
||||
View::renderTemplate("/blog/article.html", ['title' => 'test', 'index' => false]);
|
||||
|
|
|
@ -104,6 +104,15 @@ class Doc extends Model
|
|||
return $recv;
|
||||
}
|
||||
}
|
||||
public function docTree($id){
|
||||
if(is_integer($id)){
|
||||
$db = static::getDB();
|
||||
$stmt = $db->query('select * from doc_copy1 where id = '.$id);
|
||||
$recv = $stmt->fetchAll();
|
||||
return $recv;
|
||||
}
|
||||
}
|
||||
|
||||
public function titleDoc($title){
|
||||
$db = static::getDB();
|
||||
$stmt = $db->query('select * from doc where title = \''.$title.'\' and doc.is_public = 0');
|
||||
|
@ -134,6 +143,12 @@ class Doc extends Model
|
|||
$result = $stmt->fetchAll();
|
||||
return $result;
|
||||
}
|
||||
public function getChildrenDocs($id){
|
||||
$db = static::getDB();
|
||||
$stmt = $db->query('select * from doc_copy1 where doc_copy1.father = '.$id);
|
||||
$result = $stmt->fetchAll();
|
||||
return $result;
|
||||
}
|
||||
public function getAllTypeDocs(){
|
||||
$typedocs = [];
|
||||
$doctypes = $this->getTypes();
|
||||
|
@ -147,12 +162,74 @@ class Doc extends Model
|
|||
}
|
||||
return $typedocs;
|
||||
}
|
||||
public function getArticlesTree(){
|
||||
public function getArticlesTree($opendocid){
|
||||
$db = static::getDB();
|
||||
$mapforbuildtree = [];
|
||||
$articletree = [];
|
||||
|
||||
$stmt = $db->query('select id,title,father,level from doc_copy1');
|
||||
$result = $stmt->fetchAll();
|
||||
return $result;
|
||||
$doc_all = $stmt->fetchAll();
|
||||
foreach ($doc_all as $key => $value){
|
||||
$tmp = array(
|
||||
'name' => $value['title'],
|
||||
'id' =>$value['id'],
|
||||
'isParent'=> false,
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'],
|
||||
'father' => (int)$value['father'],
|
||||
);
|
||||
if($opendocid == $value['father'])
|
||||
$tmp['open'] = true;
|
||||
$mapforbuildtree[$value['id']] = $tmp;
|
||||
|
||||
}
|
||||
foreach ($doc_all as $key => $value){
|
||||
if($value['father'] != 0){
|
||||
if(!isset($mapforbuildtree[$value['father']]['children'])){
|
||||
$mapforbuildtree[$value['father']]['children'] = array();
|
||||
}
|
||||
array_push($mapforbuildtree[$value['father']]['children'],
|
||||
$mapforbuildtree[$value['id']]);
|
||||
$mapforbuildtree[$value['father']]["isParent"] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$stack = [];
|
||||
if($opendocid > 0){
|
||||
array_push($stack,$opendocid);
|
||||
// var_dump($mapforbuildtree[$opendocid]);
|
||||
$fahterid = $mapforbuildtree[$opendocid]['father'];
|
||||
array_push($stack,$fahterid);
|
||||
while($fahterid != '0'){
|
||||
// var_dump($mapforbuildtree[$fahterid]);
|
||||
$fahterid = $mapforbuildtree[$fahterid]['father'];
|
||||
array_push($stack,$fahterid);
|
||||
}
|
||||
if(count($stack) > 2) {
|
||||
$i = count($stack) - 2;
|
||||
|
||||
$tmp = &$mapforbuildtree[$stack[$i]];
|
||||
for(;$i > 0;$i--){
|
||||
$tmp['open'] = true;
|
||||
foreach($tmp['children'] as $key => $value){
|
||||
if($value['id'] == $stack[$i - 1]){
|
||||
$tmp = &$tmp['children'][$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// $tmp = $mapforbuildtree[$stack[$i]];
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach ($doc_all as $key => $value){
|
||||
if($value['level'] == 0){
|
||||
array_push($articletree,$mapforbuildtree[$value['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
$dat = json_encode ( $articletree ,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE );
|
||||
return $dat;
|
||||
}
|
||||
|
||||
public function getAllDocGroup(){
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
<script src="/api/App/Views/blog/js//jquery-editable-select.min.js"></script>
|
||||
<script src="/api/App/Views/blog/js//bootstrap-treeview.min.js"></script>
|
||||
<link href="/api/App/Views/blog/css/jquery-editable-select.min.css" rel="stylesheet">
|
||||
<script src="/api/App/Views/blog/js//jquery.ztree.all.min.js"></script>
|
||||
<link href="/api/App/Views/blog/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
|
||||
<link href="/api/App/Views/blog/css/ztree.css" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#doc_toc ul {
|
||||
margin-left: -15px;
|
||||
|
@ -73,12 +77,12 @@
|
|||
|
||||
<body style="background: #eee">
|
||||
|
||||
<div class="list-group col-lg-1" style="position: fixed; bottom: 10px;left: 10px">
|
||||
<div class="list-group col-lg-1" style="position: fixed; bottom: 10px;right: -10px">
|
||||
<a class="list-group-item active">
|
||||
最新文章
|
||||
</a>
|
||||
{% for doc in topdoc %}
|
||||
<a href="{{ url }}NewUi/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a>
|
||||
<a href="{{ url }}ArticleTree/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
@ -128,57 +132,97 @@
|
|||
</div>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<a id="expandAllBtn" href="#" title="不管你有多NB,统统都要听我的!!"
|
||||
onclick="return false;" style="margin-left: 25px;margin-top: 20px;">展开</a>
|
||||
</ul>
|
||||
|
||||
<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)
|
||||
}
|
||||
var setting = {
|
||||
callback: {
|
||||
onMouseDown: onMouseDown,
|
||||
}
|
||||
};
|
||||
var jsonData = "{{treedoc}}"
|
||||
jsonData = jsonData.replace(/&/g, "&");
|
||||
jsonData = jsonData.replace(/</g, "<");
|
||||
jsonData = jsonData.replace(/>/g, ">");
|
||||
jsonData = jsonData.replace(/ /g, " ");
|
||||
jsonData = jsonData.replace(/"/g, "\"");
|
||||
|
||||
console.log(jsonData)
|
||||
znode = $.parseJSON(jsonData)
|
||||
console.log(znode)
|
||||
$(document).ready(function(){
|
||||
$.fn.zTree.init($("#treeDemo"), setting, znode);
|
||||
$("#expandAllBtn").bind("click", {type:"expandAll"}, expandNode);
|
||||
|
||||
});
|
||||
</SCRIPT>
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade in active" id="home">
|
||||
<div class="container" style="padding: 5px; margin: 0px;width: 100%">
|
||||
<div class="row">
|
||||
<div id="grouptab" class="col-md-1" style="background: #bbbbbb; text-align: center;padding: 10px;">
|
||||
<ul class="nav nav-tabs" style="font-size: 12px;">
|
||||
{% for key,group in groups %}
|
||||
<li >
|
||||
<a href="#group_key_{{key}}" data-toggle="tab">
|
||||
{{group}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="doctype" class="col-md-1" style="background: #d4ccb0;padding: 0px;">
|
||||
<div id="grouptabContent" class="tab-content">
|
||||
{% for key,group_type in group_types %}
|
||||
<div id="group_key_{{key}}" class="tab-pane" style="background:#d4ccb0; margin-left: 5px;" >
|
||||
<ul class="nav nav-tabs" style="font-size: 12px;">
|
||||
{% for keys,types in group_type.arr %}
|
||||
<li style="width: 100%; background:#d4ccb0;">
|
||||
<a style="background:#d4ccb0;" href="#doc_type_{{ keys }}" data-toggle="tab" onclick="loadtypedoc(this)" >
|
||||
{{types.type_name}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" style="padding: 0px;" id="docs">
|
||||
<div id="typedocContent" class="tab-content">
|
||||
{% for key,typedoc in typedocs %}
|
||||
<div id="doc_type_{{typedoc.key}}" class="tab-pane" style="background:#d4ccb0; padding: 0px;" >
|
||||
<ul class="nav nav-tabs" style="font-size: 12px;">
|
||||
{% for docid,doc in typedoc.arr %}
|
||||
<li class="active" style="width: 100%; background:#d4ccb0;">
|
||||
<a style="background:#d4ccb0;" href="{{ url }}NewUi/article/{{ docid }}/{{ doc.title }}">
|
||||
{{doc.title}}
|
||||
</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="col-md-3" style="height: 800px;">
|
||||
<div class="zTreeDemoBackground left">
|
||||
<ul id="treeDemo" class="ztree">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7" style="padding: 0px;" id="docshow" >
|
||||
<div class="panel panel-default" id="doc_id_{{ doc.id }}" style="letter-spacing: 0.5px;">
|
||||
|
||||
|
||||
{% for doc in docs %}
|
||||
<div class="panel panel-default" id="doc_id_{{ doc.id }}" style="letter-spacing: 0.4px;">
|
||||
<div class="panel-heading" style="font-size: 20px ; background: #1d5987;color: white">
|
||||
{{ doc.title }}
|
||||
<div style="float: right; margin-right: 30px;">
|
||||
上次修改时间: {{ doc.update_time }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body" style="letter-spacing: 0.5px">
|
||||
{{ doc.content | raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<!-- <div class="panel panel-default" id="doc_id_{{ doc.id }}" style="letter-spacing: 0.5px;">
|
||||
<div class="panel-heading" style=" background: #1d5987;color: white">
|
||||
{{ doc.title }}
|
||||
<div style="float: right; margin-right: 10px;">
|
||||
|
@ -189,6 +233,7 @@
|
|||
{{ doc.content | raw }}
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="comment-filed">
|
||||
<!--发表评论区begin-->
|
||||
<div>
|
||||
|
|
|
@ -1,220 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>crystal blue</title>
|
||||
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<link href="/api/App/Views/blog/css/left.css" rel="stylesheet" type="text/css">
|
||||
<link href="/api/App/Views/blog/css/comment.css" rel="stylesheet" type="text/css">
|
||||
<link href="/api/App/Views/blog/css/bootstrap-treeview.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script type="text/javascript" src="/api/App/Views/blog/js/left.js"></script>
|
||||
<script type="text/javascript" src="/api/App/Views/blog/js/scripts.js"></script>
|
||||
<script type="text/javascript" src="/api/App/Views/blog/js/comment.js"></script>
|
||||
|
||||
<script type="text/javascript" id="MathJax-script" async
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
|
||||
<script src="/api/App/Views/blog/js//jquery-editable-select.min.js"></script>
|
||||
<script src="/api/App/Views/blog/js//bootstrap-treeview.min.js"></script>
|
||||
<link href="/api/App/Views/blog/css/jquery-editable-select.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
.container {
|
||||
width: 800px;
|
||||
height: 600px;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#top {
|
||||
font-family: "Source Code Pro";
|
||||
color: #FFFDFF;
|
||||
font: 13px white;
|
||||
position: absolute;
|
||||
margin: 0 auto;
|
||||
top: 0px;
|
||||
bottom: auto;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
z-index: 0;
|
||||
padding: 24px 0px 0px 0px;
|
||||
background: #20375f;
|
||||
border: 1px solid rgb(187, 187, 187);
|
||||
overflow: auto;
|
||||
display: block;
|
||||
visibility: visible;
|
||||
overflow: hidden;
|
||||
}
|
||||
#top li {
|
||||
display: inline-block;
|
||||
margin: 3px 10px;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
border: #0a0a0a 1px ;
|
||||
background: #1d5987;
|
||||
}
|
||||
#sidebar {
|
||||
margin-top: 1px;
|
||||
padding-left: 0px;
|
||||
display: inline-block;
|
||||
bottom: 0px;
|
||||
}
|
||||
#container{
|
||||
display: block;
|
||||
position:absolute;
|
||||
left:50%;
|
||||
margin-left: -50%;
|
||||
top:104px;
|
||||
width:100%;
|
||||
height:auto!important;
|
||||
min-height:600px;
|
||||
}
|
||||
|
||||
#container #left{
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
width: 14%;
|
||||
height: auto;
|
||||
background: #d9d6cb;
|
||||
}
|
||||
|
||||
#container #right{
|
||||
vertical-align:top;
|
||||
top: 0px;
|
||||
display: inline-block;
|
||||
width: 85%;
|
||||
height: auto;
|
||||
min-height: 800px;
|
||||
float: top;
|
||||
margin: -6px;
|
||||
}
|
||||
#content table{
|
||||
display: table;
|
||||
white-space: normal;
|
||||
line-height: normal;
|
||||
font-weight: normal;
|
||||
font-size: medium;
|
||||
font-style: normal;
|
||||
text-align: start;
|
||||
border-spacing: 2px;
|
||||
font-variant: normal;
|
||||
border: #0a0a0a 1px;
|
||||
color: -internal-quirk-inherit;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
td{
|
||||
display: table-cell;
|
||||
vertical-align: inherit;
|
||||
border-color: inherit;
|
||||
border:1px solid;
|
||||
}
|
||||
tr{
|
||||
display: table-row;
|
||||
vertical-align: inherit;
|
||||
border-color: inherit;
|
||||
|
||||
border:1px solid;
|
||||
}
|
||||
ul li a{
|
||||
color: white;
|
||||
}
|
||||
#page{
|
||||
bottom: 0px;
|
||||
background: #eee;
|
||||
height: 30px;
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
#page ul {
|
||||
padding:0; /* 将默认的内边距去掉 */
|
||||
margin:auto; /* 将默认的外边距去掉 */
|
||||
width: 10%;
|
||||
height: 30px;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#page ul li{
|
||||
list-style:none; /* 将默认的列表符号去掉 */
|
||||
padding:0; /* 将默认的内边距去掉 */
|
||||
margin:0; /* 将默认的外边距去掉 */
|
||||
float: left; /* 往左浮动 */
|
||||
display: block;
|
||||
width: 20px;
|
||||
font-size: 25px;
|
||||
text-decoration: none;
|
||||
background: #20375f;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<body style="background: #eee">
|
||||
|
||||
<div id="top">
|
||||
<div style="display: inline;float: right;"></div>
|
||||
<div id="sidebar">
|
||||
<ul style="padding-left: 0px">
|
||||
<li><a href="{{ url }}index" style="font-size: 25px;text-decoration: none; background: #20375f;">文章</a></li>
|
||||
<li><a href="{{ url }}project" style="font-size: 25px;text-decoration: none; background: #20375f;">memo</a></li>
|
||||
<li style="font-size: 25px;text-decoration: none; background: #20375f;">众筹需求</li>
|
||||
<li><a href="{{ url }}data" style="font-size: 25px;text-decoration: none; background: #20375f;">数据聚合</a></li>
|
||||
<li><a href="{{ url }}donate" style="font-size: 25px;text-decoration: none; background: #20375f;">赞助</a></li>
|
||||
<li><a href="{{ url }}guide" style="font-size: 25px;text-decoration: none; background: #20375f;">本博客说明</a></li>
|
||||
<li style="margin-left: 200px;font-size: 25px;text-decoration: none;background: #20375f;">文章搜索</li>
|
||||
<li style="margin-left: 0px;font-size: 25px;">
|
||||
<form style="background: #0b3e6f;">
|
||||
<select id="editable-select" style="width: 300px; height: 30px;margin-top: -10px;color: white; " >
|
||||
{% for title in alltitle %}
|
||||
<option>{{ title.title }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo {{ route }} ?>
|
||||
{{ (route) }}
|
||||
{% if route == "article" %}
|
||||
{% include '/blog/template/article.html' %}
|
||||
{% endif %}
|
||||
{% if route == "donate" %}
|
||||
{% include '/blog/template/donate.html' %}
|
||||
{% endif %}
|
||||
{% if route == "project" %}
|
||||
{% include '/blog/template/project.html' %}
|
||||
{% endif %}
|
||||
{% if route == "data" %}
|
||||
{% include '/blog/template/data.html' %}
|
||||
{% endif %}
|
||||
{% if route == "guide" %}
|
||||
{% include '/blog/template/guide.html' %}
|
||||
{% endif %}
|
||||
<script type="text/javascript" async>
|
||||
firstinit = false;
|
||||
setTimeout( function(){
|
||||
if (!firstinit){
|
||||
delegateApi({{docid}});
|
||||
updateMenu();
|
||||
firstinit = true;
|
||||
}else{
|
||||
}
|
||||
$("#doc_type_{{type}}").addClass("active");
|
||||
$("#doc_type_{{type}}").find('ul.subMenu').slideDown();
|
||||
},1000);
|
||||
$('#editable-select').editableSelect({
|
||||
effects: 'slide',
|
||||
appendTo: 'body',
|
||||
duration: 200,
|
||||
}
|
||||
).on('select.editable-select',function (e,li) {
|
||||
window.location.replace("{{ url }}NewUi/search?title=" + li.text() + "&type=0");
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -3,8 +3,8 @@ div.content_wrap div.left{float: left;width: 250px;}
|
|||
div.content_wrap div.right{float: right;width: 340px;}
|
||||
div.zTreeDemoBackground {width:100%;height:100%;text-align:left;}
|
||||
|
||||
ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:100%;height:100%;overflow-y:scroll;overflow-x:auto;}
|
||||
ul.log {border: 1px solid #617775;background: #f0f6e4;width:300px;height:170px;overflow: hidden;}
|
||||
ul.ztree {margin-top: 10px;width:100%;height:100%;overflow-x:auto;}
|
||||
ul.log {width:300px;height:170px;overflow: hidden;}
|
||||
ul.log.small {height:45px;}
|
||||
ul.log li {color: #666666;list-style: none;padding-left: 10px;}
|
||||
ul.log li.dark {background-color: #E3E3E3;}
|
||||
|
|
|
@ -300,7 +300,6 @@
|
|||
popNode.style.top = top+"px";
|
||||
popNode.style.left = left+"px";
|
||||
document.getElementById("content_table").style.width = width + "px";
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,66 +1,24 @@
|
|||
{% block newartile %}
|
||||
<SCRIPT type="text/javascript">
|
||||
var setting = { };
|
||||
function onMouseDown(event, treeId, treeNode) {
|
||||
console.log(event,treeId,treeNode)
|
||||
}
|
||||
var setting = {
|
||||
callback: {
|
||||
onMouseDown: onMouseDown,
|
||||
}
|
||||
};
|
||||
var jsonData = "{{treedoc}}"
|
||||
|
||||
jsonData = jsonData.replace(/&/g, "&");
|
||||
jsonData = jsonData.replace(/</g, "<");
|
||||
jsonData = jsonData.replace(/>/g, ">");
|
||||
jsonData = jsonData.replace(/ /g, " ");
|
||||
jsonData = jsonData.replace(/"/g, "\"");
|
||||
console.log("fasdfasdfasdfsdf",jsonData)
|
||||
|
||||
znode = $.parseJSON(jsonData)
|
||||
console.log(znode)
|
||||
var zNodes =[
|
||||
{ name:"父节点1 - 展开", open:true,id:1234,
|
||||
children: [
|
||||
{ name:"父节点11 - 折叠",
|
||||
children: [
|
||||
{ name:"叶子节点111"},
|
||||
{ name:"叶子节点112"},
|
||||
{ name:"叶子节点113"},
|
||||
{ name:"叶子节点114",id:123}
|
||||
]},
|
||||
{ name:"父节点12 - 折叠",
|
||||
children: [
|
||||
{ name:"叶子节点121"},
|
||||
{ name:"叶子节点122"},
|
||||
{ name:"叶子节点123"},
|
||||
{ name:"叶子节点124"}
|
||||
]},
|
||||
{ name:"父节点13 - 没有子节点", isParent:true}
|
||||
]},
|
||||
{ name:"父节点2 - 折叠",
|
||||
children: [
|
||||
{ name:"父节点21 - 展开", open:true,
|
||||
children: [
|
||||
{ name:"叶子节点211"},
|
||||
{ name:"叶子节点212"},
|
||||
{ name:"叶子节点213"},
|
||||
{ name:"叶子节点214"}
|
||||
]},
|
||||
{ name:"父节点22 - 折叠",
|
||||
children: [
|
||||
{ name:"叶子节点221"},
|
||||
{ name:"叶子节点222"},
|
||||
{ name:"叶子节点223"},
|
||||
{ name:"叶子节点224"}
|
||||
]},
|
||||
{ name:"父节点23 - 折叠",
|
||||
children: [
|
||||
{ name:"叶子节点231"},
|
||||
{ name:"叶子节点232"},
|
||||
{ name:"叶子节点233"},
|
||||
{ name:"叶子节点234"}
|
||||
]}
|
||||
]},
|
||||
{ name:"父节点3 - 没有子节点", isParent:true}
|
||||
|
||||
];
|
||||
|
||||
$(document).ready(function(){
|
||||
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
|
||||
$.fn.zTree.init($("#treeDemo"), setting, znode);
|
||||
});
|
||||
</SCRIPT>
|
||||
|
||||
|
@ -68,7 +26,9 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3" style="height: 800px;">
|
||||
<div class="zTreeDemoBackground left">
|
||||
<ul id="treeDemo" class="ztree"></ul>
|
||||
<ul id="treeDemo" class="ztree">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
|
@ -139,12 +99,12 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group col-lg-1" style="position: fixed; bottom: 10px;left: 10px">
|
||||
<div class="list-group col-lg-1" style="position: fixed; bottom: 10px;right: -10px">
|
||||
<a class="list-group-item active">
|
||||
最新文章
|
||||
</a>
|
||||
{% for doc in topdoc %}
|
||||
<a href="{{ url }}NewUi/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a>
|
||||
<a href="{{ url }}ArticleTree/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
rm ../code.tar.gz
|
||||
del ../code.tar.gz
|
||||
tar.exe -czf ../code.tar.gz ./*
|
||||
scp -i ./id_rsa ../code.tar.gz ubuntu@117.50.176.114:/var/www/html/api/
|
||||
ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo tar -zxvf /var/www/html/api/code.tar.gz -C /var/www/html/api/
|
||||
ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo rm code.tar.gz
|
||||
scp -i ./id_rsa ../code.tar.gz ubuntu@117.50.176.114:/home/ubuntu/
|
||||
@REM ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo tar -zxvf /var/www/html/api/code.tar.gz -C /var/www/html/api/
|
||||
@REM ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo rm code.tar.gz
|
||||
|
|
Loading…
Reference in New Issue