控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {extend name="admin@index_layout"/}
  2. {block name="main"}
  3. <style type="text/css">
  4. .collapse {position: absolute; left: 0; top: calc(40vh - 68px); width: 15px; height: 68px; z-index: 3; }
  5. .collapse-bg {width: 0; height: 50px; position: absolute; top: 0; left: 0; border-bottom: 9px solid transparent; border-right: none; border-left: 15px solid #009688; border-top: 9px solid transparent; -o-transition: all 0.1s ease,0.1s ease; -ms-transition: all 0.1s ease,0.1s ease; -moz-transition: all 0.1s ease,0.1s ease; -webkit-transition: all 0.1s ease,0.1s ease; }
  6. .collapse:hover .navbar-collapse{left: 3px;}
  7. .collapse:hover .collapse-bg{border-bottom: 9px solid transparent; border-left: 20px solid #009688; border-top: 9px solid transparent; }
  8. .navbar-collapse {width: 15px; left: 0; height: 68px; position: relative; text-align: center; cursor: pointer; }
  9. .navbar-collapse>span {color: #fff; font-size: 14px; line-height: 68px; vertical-align: text-top; }
  10. #left-sider{padding:0 10px; -webkit-transition: width .2s ease;transition: width .2s ease;}
  11. #right-box{padding:0 10px;}
  12. #left-sider.hidden{width: 0;padding: 0; overflow: hidden;}
  13. </style>
  14. <div class="collapse">
  15. <div class="collapse-bg"></div>
  16. <div class="navbar-collapse" >
  17. <span class="layui-icon layui-icon-spread-left"></span>
  18. </div>
  19. </div>
  20. <div class="layui-row">
  21. <div class="layui-col-md2 layui-col-sm12" id="left-sider">
  22. <div class="layui-card">
  23. <div class="layui-card-header">栏目列表</div>
  24. <div class="layui-card-body" id="iframe_categorys" style="overflow:auto;">
  25. <ul class="ztree" style="margin-left: 5px;margin-top:5px; padding: 0;">
  26. <li><a title="全部展开、折叠"><span class="button ico_open"></span><span id="ztree_expandAll">全部展开、折叠 </span></a> </li>
  27. </ul>
  28. <ul id="tree" class="ztree" style="overflow:auto;"></ul>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="layui-col-md10 layui-col-sm12" id="right-box">
  33. <div class="layui-card">
  34. <div class="layui-card-body">
  35. <iframe name="right" id="iframe_categorys_list" src="{:url('panl')}" style="height: 100%; width:100%;border:none;" frameborder="0" scrolling="auto"></iframe>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. {/block}
  41. {block name="script"}
  42. <script type="text/javascript">
  43. layui.use(['jquery', 'ztree'], function() {
  44. var $ = layui.$;
  45. var zTree;
  46. var demoIframe;
  47. var zNodes = {$json|raw};
  48. var setting = {
  49. data: {
  50. key: {
  51. name: "catname"
  52. },
  53. simpleData: {
  54. enable: true,
  55. idKey: "id",
  56. pIdKey: "parentid"
  57. }
  58. },
  59. callback: {
  60. //捕获单击节点之前的事件回调函数
  61. beforeClick: function(treeId, treeNode) {
  62. var zTree = $.fn.zTree.getZTreeObj("tree");
  63. if (treeNode.isParent) {
  64. zTree.expandNode(treeNode);
  65. return true;
  66. }
  67. },
  68. onClick: function(event, treeId, treeNode) {
  69. //保存当前点击的栏目ID
  70. layui.data("tree_catid", {key: 'catid',value: treeNode.id});
  71. }
  72. }
  73. };
  74. $(document).ready(function() {
  75. var B_tab_height = parent.layui.$("#content>.pear-frame").length > 0 ? 93 : 135;
  76. var B_frame_height = parent.layui.$("#content").height() - B_tab_height;
  77. $(window).on('resize', function() {
  78. setTimeout(function() {
  79. B_frame_height = parent.layui.$("#content").height() - B_tab_height;
  80. frameheight();
  81. }, 100);
  82. });
  83. $('.collapse').on("click", function() {
  84. var t = $(this).find('.layui-icon');
  85. $('#left-sider').toggleClass("hidden");
  86. if ($('#left-sider').hasClass("hidden")) {
  87. t.attr("class", "layui-icon layui-icon-shrink-right");
  88. $("#right-box").attr("class", 'layui-col-md12 layui-col-sm12');
  89. } else {
  90. t.attr("class", "layui-icon layui-icon-spread-left");
  91. $("#right-box").attr("class", 'layui-col-md10 layui-col-sm12');
  92. };
  93. })
  94. function frameheight() {
  95. $("#iframe_categorys").height(B_frame_height);
  96. $("#iframe_categorys_list").height(B_frame_height+36);
  97. }
  98. frameheight();
  99. //初始化
  100. $.fn.zTree.init($("#tree"), setting, zNodes);
  101. //获取对象
  102. var zTree = $.fn.zTree.getZTreeObj("tree");
  103. //全选
  104. $("#ztree_expandAll").click(function() {
  105. if ($(this).data("open")) {
  106. zTree.expandAll(false);
  107. $(this).data("open", false);
  108. } else {
  109. zTree.expandAll(true);
  110. $(this).data("open", true);
  111. }
  112. });
  113. //定位到上次打开的栏目,进行展开tree_catid
  114. var tree_catid = layui.data('tree_catid').catid;
  115. if (tree_catid) {
  116. var nodes = zTree.getNodesByParam("id", tree_catid, null);
  117. zTree.selectNode(nodes[0]);
  118. }
  119. });
  120. });
  121. </script>
  122. {/block}