No Description
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.

picture_folder.htm 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  8. <!-- Apple devices fullscreen -->
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <!-- Apple devices fullscreen -->
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  12. <title>在线管理</title>
  13. <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/css/style.css?v={$version|default='1.2.9'}">
  14. <link rel="stylesheet" href="__PUBLIC__/plugins/ztree/css/iframe.css?v={$version}">
  15. <link rel="stylesheet" href="__PUBLIC__/plugins/ztree/css/zTreeStyle/zTreeStyle_uploadify.css?v={$version}" type="text/css">
  16. <style type="text/css">
  17. .ztree li{
  18. line-height: 22px;
  19. }
  20. .ztree .node_name{
  21. font-size: 13px !important;
  22. }
  23. .hover{
  24. line-height: 22px;
  25. }
  26. #saveBtn{ float: right; }
  27. .ui-layout-pane {
  28. background: #fff;
  29. }
  30. .ui-layout-center{
  31. padding:0 15px 60px 15px;
  32. }
  33. </style>
  34. <script type="text/javascript">
  35. var eyou_basefile = "{$Request.baseFile}";
  36. var module_name = "{$Think.const.MODULE_NAME}";
  37. var __root_dir__ = "__ROOT_DIR__";
  38. </script>
  39. </head>
  40. <body>
  41. <div class="ui-layout-west" >
  42. <div class="upload-main-left">
  43. <div class="upload-nav">
  44. <ul>
  45. <li><a href="{:url('Uploadify/upload',['num'=>$info['num'],'input'=>$info['input'],'path'=>$info['path'],'func'=>$info['func'],'lang'=>$Request.param.lang])}">本地上传</a></li>
  46. <li> <a class="upload-nav-active" href="javascript:void(0);">在线管理</a></li>
  47. </ul>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="ui-layout-center" >
  52. <iframe name="content_body" id="content_body" src="{:url('Uploadify/get_images_path',['num'=>$info['num'],'func'=>$info['func']])}" width="100%" height="100%" frameborder="0" style="margin-bottom: 50px;"></iframe>
  53. <div class="upload-button">
  54. <div id="saveBtn" class="upload-btn">确定使用</div>
  55. </div>
  56. </div>
  57. <div class="ui-layout-east area manage-area" id="manage_area">
  58. <div class="ztreeContent">
  59. <div id="tree" class="ztree"></div>
  60. </div>
  61. </div>
  62. {load href="__STATIC__/common/js/jquery.min.js" /}
  63. <script src="__STATIC__/admin/js/jquery.layout-latest.min.js"></script>
  64. <script type="text/javascript" src="__PUBLIC__/plugins/ztree/js/jquery.ztree.core.min.js"></script>
  65. <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js?v={$version|default='1.2.9'}"></script>
  66. <script type="text/javascript">
  67. var myLayout;
  68. jQuery(document).ready(function () {
  69. myLayout = jQuery("body").layout({
  70. /* 全局配置 */
  71. closable: false /* 是否显示点击关闭隐藏按钮*/
  72. , resizable: true /* 是否允许拉动*/
  73. , maskContents: true /* 加入此参数,框架内容页就可以拖动了*/
  74. /* 顶部配置 */
  75. , north__spacing_open: 0 /* 顶部边框大小*/
  76. /* 底部配置 */
  77. , south__spacing_open: 0 /* 底部边框大小*/
  78. , west__spacing_open: 0 /* 左部边框大小*/
  79. , east__spacing_open: 1 /* 右部边框大小*/
  80. /* some pane-size settings*/
  81. , west__minSize: 140 /*左侧最小宽度*/
  82. , west__maxSize: 143 /*左侧最大宽度*/
  83. /* 左侧配置 */
  84. , west__slidable: false
  85. , west__animatePaneSizing: false
  86. , west__fxSpeed_size: "slow" /* 'fast' animation when resizing west-pane*/
  87. , west__fxSpeed_open: 1000 /* 1-second animation when opening west-pane*/
  88. , west__fxSettings_open: { easing: "easeOutBounce" } // 'bounce' effect when opening*/
  89. , west__fxName_close: "none" /* NO animation when closing west-pane*/
  90. , stateManagement__enabled: false /*是否读取cookies*/
  91. , showDebugMessages: false ,
  92. });
  93. });
  94. var zNodes = {$zNodes};
  95. var setting = {
  96. view:{
  97. dblClickExpand:false
  98. ,showLine:true
  99. // ,showIcon: false
  100. },
  101. data:{
  102. simpleData:{
  103. enable:true
  104. }
  105. },
  106. callback:{
  107. beforeExpand:beforeExpand
  108. ,onExpand:onExpand
  109. ,onClick:onClick
  110. }
  111. };
  112. var curExpandNode=null;
  113. function beforeExpand(treeId,treeNode) {
  114. var pNode=curExpandNode?curExpandNode.getParentNode():null;
  115. var treeNodeP=treeNode.parentTId?treeNode.getParentNode():null;
  116. var zTree=$.fn.zTree.getZTreeObj("tree");
  117. for(var i=0,l=!treeNodeP?0:treeNodeP.children.length;i<l; i++){
  118. if(treeNode!==treeNodeP.children[i]){zTree.expandNode(treeNodeP.children[i],false);}
  119. };
  120. while (pNode){
  121. if(pNode===treeNode){break;}
  122. pNode=pNode.getParentNode();
  123. };
  124. if(!pNode){singlePath(treeNode);}
  125. };
  126. function singlePath(newNode) {
  127. if (newNode === curExpandNode) return;
  128. if (curExpandNode && curExpandNode.open==true) {
  129. var zTree = $.fn.zTree.getZTreeObj("tree");
  130. if (newNode.parentTId === curExpandNode.parentTId) {
  131. zTree.expandNode(curExpandNode, false);
  132. } else {
  133. var newParents = [];
  134. while (newNode) {
  135. newNode = newNode.getParentNode();
  136. if (newNode === curExpandNode) {
  137. newParents = null;
  138. break;
  139. } else if (newNode) {
  140. newParents.push(newNode);
  141. }
  142. }
  143. if (newParents!=null) {
  144. var oldNode = curExpandNode;
  145. var oldParents = [];
  146. while (oldNode) {
  147. oldNode = oldNode.getParentNode();
  148. if (oldNode) {
  149. oldParents.push(oldNode);
  150. }
  151. }
  152. if (newParents.length>0) {
  153. zTree.expandNode(oldParents[Math.abs(oldParents.length-newParents.length)-1], false);
  154. } else {
  155. zTree.expandNode(oldParents[oldParents.length-1], false);
  156. }
  157. }
  158. }
  159. }
  160. curExpandNode = newNode;
  161. };
  162. function onExpand(event,treeId,treeNode){curExpandNode=treeNode;};
  163. function onClick(e,treeId,treeNode){
  164. var zTree=$.fn.zTree.getZTreeObj("tree");
  165. zTree.expandNode(treeNode,null,null,null,true);
  166. }
  167. $(function(){
  168. $.fn.zTree.init($("#tree"),setting,zNodes);
  169. $(".ui-layout-north li:first-child").click();
  170. });
  171. </script>
  172. <script type="text/javascript">
  173. // 点击确认使用
  174. $("#saveBtn").click(function(){
  175. var frm = $("#content_body").contents();
  176. // 将选中的图片拼装数组
  177. var images_array = [];
  178. frm.find("#list li").each(function(){
  179. var val = $(this).attr("data-url");
  180. if($(this).hasClass("selected")){
  181. images_array.push(val);
  182. }
  183. });
  184. // 若未选择图片就点确认则提示
  185. if (!images_array.length) {
  186. layer.msg('请选择图片~~', {icon: 2,time: 1500});
  187. return false;
  188. }
  189. $.ajax({
  190. type:'POST',
  191. url:"{:url('Uploadify/update_pic', ['_ajax'=>1])}",
  192. data:{images_array:images_array},
  193. success: function(res) {
  194. }
  195. });
  196. // 调用父级方法,传入图片数据
  197. var callback = "{$info.func}";
  198. var num = {$info.num|default=1};
  199. if(num > 0){
  200. if (num == 1) {
  201. fileurl_tmp = images_array[0];
  202. } else {
  203. fileurl_tmp = images_array;
  204. }
  205. eval('window.parent.'+callback+'(fileurl_tmp)');
  206. window.parent.layer.closeAll();
  207. }
  208. });
  209. </script>
  210. </body>
  211. </html>