no message
parent
d3bb6431d7
commit
fa155ecde1
|
@ -23,7 +23,7 @@ class NewUi extends Controller
|
|||
$groups = $docModel->getGroups();
|
||||
$doc_all = $redis->get("artilcetree");
|
||||
if( $doc_all == ""){
|
||||
$doc_all = $docModel->getArticlesTree((int)$this->params[0]);
|
||||
$doc_all = $docModel->getArticlesTree(-1);
|
||||
$redis->set("artilcetree", $doc_all);
|
||||
}
|
||||
|
||||
|
|
|
@ -176,7 +176,20 @@ class Doc extends Model
|
|||
'isParent'=> false,
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'],
|
||||
'father' => (int)$value['father'],
|
||||
'level' => $value['level']
|
||||
);
|
||||
|
||||
if($tmp['level'] == '0') {
|
||||
$tmp = array(
|
||||
'name' => $value['title'],
|
||||
'id' =>$value['id'],
|
||||
'isParent'=> false,
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'],
|
||||
'father' => (int)$value['father'],
|
||||
'level' => $value['level'],
|
||||
'open' => true
|
||||
);
|
||||
}
|
||||
if($opendocid == $value['father'])
|
||||
$tmp['open'] = true;
|
||||
$mapforbuildtree[$value['id']] = $tmp;
|
||||
|
|
|
@ -178,6 +178,10 @@ function expandNode(e) {
|
|||
onMouseDown: onMouseDown,
|
||||
}
|
||||
};
|
||||
|
||||
var obj = $('#treeDemo' + "{{id}}" + "_span");
|
||||
console.log("fasdfasdfasdfsad",obj);
|
||||
|
||||
var jsonData = "{{treedoc}}"
|
||||
jsonData = jsonData.replace(/&/g, "&");
|
||||
jsonData = jsonData.replace(/</g, "<");
|
||||
|
@ -185,7 +189,6 @@ function expandNode(e) {
|
|||
jsonData = jsonData.replace(/ /g, " ");
|
||||
jsonData = jsonData.replace(/"/g, "\"");
|
||||
|
||||
console.log(jsonData)
|
||||
znode = $.parseJSON(jsonData)
|
||||
console.log(znode)
|
||||
$(document).ready(function(){
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
}
|
||||
};
|
||||
var jsonData = "{{treedoc}}"
|
||||
|
||||
jsonData = jsonData.replace(/&/g, "&");
|
||||
jsonData = jsonData.replace(/</g, "<");
|
||||
jsonData = jsonData.replace(/>/g, ">");
|
||||
|
@ -19,6 +20,8 @@
|
|||
console.log(znode)
|
||||
$(document).ready(function(){
|
||||
$.fn.zTree.init($("#treeDemo"), setting, znode);
|
||||
var obj = $('#treeDemo' + "{{id}}" + "_span");
|
||||
console.log("fasdfasdfasdfsad",obj);
|
||||
});
|
||||
</SCRIPT>
|
||||
|
||||
|
@ -31,51 +34,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<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">
|
||||
1级索引{{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>
|
||||
</div> -->
|
||||
<div class="col-lg-8" style="padding: 0px;" id="docshow" >
|
||||
{% for doc in docs %}
|
||||
<div class="panel panel-default" id="doc_id_{{ doc.id }}" style="letter-spacing: 0.4px;">
|
||||
|
|
|
@ -60,7 +60,6 @@ abstract class Model
|
|||
$dsn = 'mysql:host=117.50.176.114' . ';dbname=' . Config::DB_NAME . ';charset=utf8';
|
||||
else
|
||||
$dsn = 'mysql:host=127.0.0.1' . ';dbname=' . Config::DB_NAME . ';charset=utf8';
|
||||
// var_dump($dsn);
|
||||
try {
|
||||
$db = new PDO($dsn, Config::DB_USER, Config::DB_PASSWORD,$ssl);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
|
Loading…
Reference in New Issue